/* Hell (Standard) */
:root {
  --bg: #fff;
  --fg: #111827;
  --muted: #6b7280;
  --brand: #36b;
  --border: #e5e7eb;

  /* helle Oberflächen */
  --surface: #fff;
  --surface-alt: #f9fafb;
  --th: #e5e7eb;
  --link: #1d4ed8;
  --link-hover: #163ea6;

  color-scheme: light dark;
}

/* Dunkel */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --fg: #f1f5f9;
    --muted: #94a3b8;
    --brand: #93c5fd;
    --border: #334155;

    /* dunkle Oberflächen */
    --surface: #0b1220;
    --surface-alt: #111827;
    --th: #1e293b;
    --link: #60a5fa;
    --link-hover: #3b82f6;
  }
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}

body{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.45;
}

/* Header + Tabs */
.page-header{ padding: 1.25rem .75rem .5rem; text-align: center; }

.page-header h1{
  margin: .5rem 0 0;
  font-size: clamp(1.25rem, 2vw + .9rem, 2rem);
  font-weight: 700;
}

.tabs{
  display: inline-flex;
  gap: .5rem;
  background: color-mix(in oklab, var(--surface) 92%, var(--fg) 8%);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: .3rem .5rem;
}

.tabs a{
  text-decoration: none;
  color: var(--brand);
  padding: .4rem .8rem;
  border-radius: 9999px;
  font-weight: 600;
}

.tabs a:hover, .tabs a:focus{
  background: color-mix(in oklab, var(--surface) 85%, var(--fg) 15%);
  outline: none;
}

.container{ max-width: 1100px; margin: 0 auto; padding: 0 .75rem 2rem; }

h2{
  color: var(--brand);
  font-size: clamp(1.1rem, 1.2vw + .85rem, 1.5rem);
  margin: 1rem 0 .5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: .25rem;
}

/* Tabelle Desktop */
.table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background: var(--surface);
}

.table{
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.table thead th{
  background: var(--th);
  text-align: left;
  padding: .75rem .9rem;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
}

.table td{
  padding: .7rem .9rem;
  vertical-align: top;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
}

.table tbody tr:nth-child(odd) td{
  background: var(--surface-alt);
}
.text-center{ text-align: center; }

a{ color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus{ color: var(--link-hover); outline: none; }

/* Scrollbare Fingerprints, wird für Handys gebraucht */
code.fingerprint{
  display: block;
  max-width: 100%;
  overflow: auto hidden;
  white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .95em;
  background: color-mix(in oklab, var(--surface) 92%, var(--fg) 8%);
  border: 1px solid var(--border);
  padding: .2rem .35rem;
  border-radius: .375rem;
}

.disabled{ color: var(--muted); cursor: not-allowed; text-decoration: line-through; }

/* Screenreader */
.sr-only{
  position:absolute; width:1px;height:1px; padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

/* Tabelle Telefon */
@media (width <= 640px){

  .table{ min-width: 0; border-collapse: separate; border-spacing: 0; }
  .table thead{ display: none; }
  .table-wrap{ border: 0; background: transparent; }

  .table tbody{ display: grid; gap: .75rem; }

  .table tbody tr{
    display: grid;
    gap: .5rem;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: .75rem;
    background: var(--surface);
    box-shadow: 0 1px 0 rgb(0 0 0 / 3%);
  }

  .table td{
    display: grid;
    grid-template-columns: 11.5rem 1fr;
    gap: .5rem;
    border: 0;
    background: transparent !important;
    padding: .25rem 0;
    color: var(--fg);
  }

  /* S/MIME Labels – vorher #374151, jetzt var(--fg) für Dark */
  .table-smime td:nth-child(1)::before{ content: "Name"; font-weight: 600; color: var(--fg); }
  .table-smime td:nth-child(2)::before{ content: "Download DER"; font-weight: 600; color: var(--fg); }
  .table-smime td:nth-child(3)::before{ content: "Download PEM"; font-weight: 600; color: var(--fg); }
  .table-smime td:nth-child(4)::before{ content: "Fingerprint (SHA-1)"; font-weight: 600; color: var(--fg); }

  /* PGP Labels */
  .table-pgp td:nth-child(1)::before{ content: "Name"; font-weight: 600; color: var(--fg); }
  .table-pgp td:nth-child(2)::before{ content: "Download"; font-weight: 600; color: var(--fg); }
  .table-pgp td:nth-child(3)::before{ content: "Ablauf"; font-weight: 600; color: var(--fg); }
  .table-pgp td:nth-child(4)::before{ content: "Fingerprint"; font-weight: 600; color: var(--fg); }

  /* Links touch-freundlich */
  .table a, .tabs a{
    padding: .5rem .75rem;
    display: inline-block;
  }

  /* Fingerprint-Box etwas größer auf dem Telefon */
  code.fingerprint{
    padding: .35rem .5rem;
  }
}

/* Fallback, falls color-mix nicht unterstützt wird */
@supports not (color: color-mix(in oklab, white, black)){
  .tabs{ background: var(--surface-alt); }
  code.fingerprint{ background: var(--surface-alt); }
}
.footer {
/*   background-color: #1a1a1a;   /* dunkel */ 
  padding: 2rem 1rem;
  text-align: center;
  margin-top: 3rem;
  border-top: 1px solid #333;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer a {
/*  color: #f0f0f0;*/
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: #ff6600; 
}
