/* 1337.kiwi — Design-System v1.2 „Terminal trifft Frucht"
   Schwarz-Weiß-Grün: Grün ist Signal (Primär-Aktion, Kurz-Codes, Erfolg), nie Tapete.
   Monospace für alles Produkthafte (Marke, URLs, Codes, Buttons, Zahlen), Grotesk für Erklärtext. */

:root {
    color-scheme: light dark;
    --paper: #FAFCF6;      /* Seitengrund */
    --surface: #F1F6E9;    /* Karten, Flächen */
    --ink: #101408;        /* Text, Ränder */
    --muted: #5A6350;      /* Sekundärtext */
    --line: #DCE4D0;       /* Trennlinien */
    --kiwi: #7ABA1C;       /* Signal: Primär-Aktion, Erfolg */
    --kiwi-deep: #507A14;  /* grüner Text auf Flächen (kontrastsicher) */
    --kiwi-tint: #E9F4DA;  /* Hover, markierte Zeilen */
    --radius: 6px;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
    :root {
        --paper: #0D110A;
        --surface: #151B10;
        --ink: #EAF2DF;
        --muted: #97A488;
        --line: #26301C;
        --kiwi: #99D73C;
        --kiwi-deep: #BAE878;
        --kiwi-tint: #1B2611;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 1rem 3rem; }

a { color: var(--kiwi-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--kiwi); outline-offset: 2px; }

code, .prefix { font-family: var(--mono); }

/* Kopf & Fuß */
.site-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.2rem 0; gap: 1rem; flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1.5rem;
}
.brand {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-family: var(--mono);
    font-size: 1.35rem; font-weight: 700; color: var(--ink);
    letter-spacing: -0.02em;
}
.brand svg, .brand img { display: block; }
.brand .tld { color: var(--kiwi-deep); }
.brand:hover { text-decoration: none; }
/* Blinkender Cursor hinter der Wortmarke — Terminal-Gruß */
.brand .cursor {
    display: inline-block;
    width: 0.55em; height: 0.09em;
    background: var(--kiwi);
    margin-left: 0.12em;
    animation: brand-blink 1.1s steps(1) infinite;
}
@keyframes brand-blink { 50% { opacity: 0; } }
.site-head nav { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.site-head nav a { color: var(--ink); }
.who, .site-head nav a.who { color: var(--muted); font-family: var(--mono); font-size: 0.85rem; }
.site-foot {
    margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
    color: var(--muted); font-size: 0.8rem; text-align: center;
    font-family: var(--mono);
}
.site-foot a { color: var(--muted); }
.site-foot p { margin: 0.25rem 0; }

/* Hero (öffentliche Seite) */
.hero { text-align: center; margin: 2.5rem 0 2rem; }
.hero h1 { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 0.4rem; text-wrap: balance; }
.accent { color: var(--kiwi-deep); }
.sub { color: var(--muted); margin: 0; }

/* Karten — kantig und flach, Radius max. 6 px, kein Schatten */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem;
    margin-bottom: 1.2rem;
}
.card h1 { margin-top: 0; }
.card h2, .card h3 { margin: 0 0 0.8rem; }
.card.narrow { max-width: 420px; margin: 3rem auto; }
.card.narrow-wide { max-width: 720px; margin: 2rem auto; }
.card.narrow-wide h2 { margin-top: 1.4rem; font-size: 1.1rem; }
.card.highlight { border-color: var(--kiwi); border-left-width: 3px; }
.card.center { text-align: center; margin: 3rem auto; max-width: 420px; }

/* Formulare */
label {
    display: block; font-weight: 500; font-size: 0.78rem;
    font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--muted); margin: 0.7rem 0 0.3rem;
}
input[type="text"], input[type="password"], input[type="search"], input[type="url"],
input[type="date"], input[type="number"], select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 0.95rem;
    background: var(--paper);
    color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--kiwi); outline-offset: -1px; border-color: var(--kiwi); }
/* Datumsfelder: iOS/Safari erzwingt sonst eine intrinsische Breite und
   sprengt schmale Layouts nach rechts */
input[type="date"] {
    min-width: 0;
    display: block;
    -webkit-appearance: none;
    appearance: none;
}
/* Flex-Kinder dürfen schrumpfen (sonst schieben intrinsische Breiten die Zeile auf) */
.short-row > *, .actions > *, .actions form.inline > * { min-width: 0; }
/* Kompakte Datumsfelder in Tabellen-Aktionen */
.actions input[type="date"] { width: auto; padding: 0.3rem 0.5rem; font-size: 0.85rem; }

/* Leere Vorschau (noch keine Eingabe) nicht als kaputtes Bild anzeigen */
.preview img:not([src]) { display: none; }

/* Typ-Umschalter der QR-Generatoren (Link/WLAN/Kontakt/Termin) */
.type-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin: 0 0 1.4rem; }
.type-nav .active { background: var(--kiwi); border-color: var(--kiwi); color: #101408; }
.type-nav .active:hover { background: var(--kiwi); }
input[type="color"] { width: 100%; height: 2.4rem; padding: 0.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
input[type="range"] { width: 100%; accent-color: var(--kiwi); }
.hp { position: absolute; left: -9999px; }

.short-row { display: flex; gap: 0.5rem; align-items: center; }
.short-row input[type="text"], .short-row input[type="search"], .short-row select { flex: 1; }
.prefix { color: var(--muted); white-space: nowrap; }
.grid-form { display: grid; gap: 0.4rem; }
.grid-form button { justify-self: start; margin-top: 0.6rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }

/* Buttons — sprechen Mono, sie sind Kommandos.
   Primär ist die einzige gefüllte grüne Fläche im Sichtfeld. */
.btn {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--ink);
    border-radius: 5px;
    background: transparent;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--kiwi-tint); text-decoration: none; }
.btn-primary { background: var(--kiwi); border-color: var(--kiwi); color: #101408; }
.btn-primary:hover { background: var(--kiwi); filter: brightness(0.93); }
.btn-small { padding: 0.28rem 0.7rem; font-size: 0.8rem; }
.btn-danger { border-color: var(--line); color: var(--muted); }
.btn-danger:hover { border-color: var(--ink); color: var(--ink); background: transparent; }

/* Meldungen — Erfolg ist grün; Fehler brauchen kein Rot,
   ihnen fehlt einfach das Grün. */
.flash {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid;
    font-family: var(--mono);
    font-size: 0.9rem;
}
.flash-ok { background: var(--kiwi-tint); border-color: var(--kiwi); color: var(--kiwi-deep); }
.flash-err { background: var(--surface); border-color: var(--ink); color: var(--ink); }

/* Ergebnis + QR */
.result { text-align: center; }
.result .short-row { max-width: 480px; margin: 0 auto 1rem; }
.result input { font-weight: 700; text-align: center; color: var(--kiwi-deep); }
.qr-preview { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.qr-preview img { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.qr-links { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }

/* Tabellen — Kurz-Codes und Zahlen in Mono, Kopfzeile wie ein Terminal-Label */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th {
    text-align: left; color: var(--muted); font-weight: 500;
    font-family: var(--mono); font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.07em;
}
th, td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td a { font-family: var(--mono); }
.row-hl td { background: var(--kiwi-tint); }
.url-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.actions { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.actions form.inline { display: flex; gap: 0.35rem; margin: 0; }
.actions input[type="password"] { width: 150px; padding: 0.3rem 0.5rem; font-size: 0.85rem; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.list-head form { margin: 0; }

/* Badges */
.badge {
    display: inline-block; padding: 0.1rem 0.5rem; border-radius: 4px;
    font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-expired { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.badge-quiet { background: transparent; color: var(--muted); border: 1px solid var(--line); }

/* Einstellungen */
.radio-group { display: grid; gap: 0.7rem; margin-bottom: 1rem; }
.radio {
    display: flex; gap: 0.7rem; align-items: flex-start;
    padding: 0.8rem; border: 1px solid var(--line); border-radius: var(--radius);
    font-family: inherit; font-weight: 400; font-size: 0.95rem;
    text-transform: none; letter-spacing: 0; color: var(--ink);
    cursor: pointer; margin: 0;
}
.radio:has(input:checked) { border-color: var(--kiwi); background: var(--kiwi-tint); }
.radio input { margin-top: 0.25rem; accent-color: var(--kiwi-deep); }

/* Statistik — Zahlen sind Inhalt: Mono, tabellarisch */
.stat-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.stat { display: flex; flex-direction: column; }
.stat strong { font-family: var(--mono); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.bars { display: block; }
.bar { fill: var(--kiwi); }
.bar-zero { fill: var(--line); }
.chart-label { fill: var(--muted); font-family: var(--mono); }

/* QR-Designer */
.designer { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.designer .preview { text-align: center; position: sticky; top: 1rem; }
.designer .preview img { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-width: 100%; height: auto; margin-bottom: 0.8rem; }
/* Auf der Untergrund-Bühne bringt das Bild keinen eigenen Grund mit –
   transparente Rahmen-Ecken liegen direkt auf Hell/Dunkel auf */
#preview-stage { line-height: 0; max-width: 100%; }
#preview-stage img { background: transparent; border: 0; border-radius: 0; margin-bottom: 0; }
.controls form { margin-top: 0.8rem; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 0.85rem; }

@media (max-width: 720px) {
    .designer { grid-template-columns: 1fr; }
    .designer .preview { position: static; }
    .hero h1 { font-size: 1.55rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
