:root {
    /* AuThenTo brand — sky blue + grass green on light paper */
    --sky: #38b6ff;
    --sky-600: #1c9bec;
    --deep: #0f4c75;
    --deep-700: #0c3b5c;
    --grass: #7ac943;
    --grass-600: #63b431;
    --ink: #17303f;
    --muted: #5f7488;
    --paper: #eaf3fb;
    --paper-2: #f3f8fd;
    --card: #ffffff;
    --line: #d9e6f2;
    --amber: #f5a623;
    --red: #e5484d;
    --shadow: 0 2px 10px rgba(15, 76, 117, .07);
    --shadow-lg: 0 10px 30px rgba(15, 76, 117, .12);
    --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --radius: 16px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 240px, var(--paper-2) 100%);
    background-attachment: fixed;
    font-family: "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ---- top bar --------------------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(1.4) blur(6px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .6);
    position: sticky;
    top: 0;
    z-index: 10;
}
/* thin sky→grass accent under the bar, echoing the logo */
.topbar::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -3px;
    height: 3px;
    background: linear-gradient(90deg, var(--sky), var(--grass));
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo {
    height: 40px; width: auto; display: block;
    border-radius: 9px;
    box-shadow: var(--shadow);
}
.brand-sub {
    font-weight: 600; font-size: 15px; color: var(--deep);
    padding-left: 12px; border-left: 1px solid var(--line);
}
.topbar nav { display: flex; gap: 6px; margin-left: auto; }
.topbar nav a {
    color: var(--muted); text-decoration: none; font-weight: 600;
    padding: 7px 14px; border-radius: 999px; transition: background .15s, color .15s;
}
.topbar nav a:hover { color: var(--deep); background: var(--paper); }
.topbar nav a.active { color: #fff; background: var(--sky); }

/* ---- layout ---------------------------------------------------------- */
main { max-width: 1120px; margin: 0 auto; padding: 26px 24px 60px; }

h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; color: var(--deep); letter-spacing: -.2px; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; margin: 0 0 12px; }
a { color: var(--sky-600); font-weight: 600; }
a:hover { color: var(--deep); }
p { margin: 0 0 16px; }
.lead { color: var(--muted); font-size: 15px; max-width: 62ch; }

.grid { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }

.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row + .row { margin-top: 12px; }
label { color: var(--ink); }

fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 14px; padding: 12px 14px; background: var(--paper-2); }
legend { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 0 6px; }

input[type="number"] {
    width: 84px; background: #fff; color: var(--ink);
    border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
    font-family: inherit; font-size: 14px;
}
input[type="number"]:focus, input[type="checkbox"]:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--sky); width: 16px; height: 16px; vertical-align: -2px; }

/* ---- buttons --------------------------------------------------------- */
button {
    font-family: inherit; font-size: 15px; font-weight: 700;
    border: 0; border-radius: 11px; padding: 11px 22px; cursor: pointer;
    color: #fff; background: var(--sky);
    box-shadow: var(--shadow); transition: transform .08s ease, background .15s, box-shadow .15s;
}
button:hover { background: var(--sky-600); box-shadow: var(--shadow-lg); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 3px solid rgba(56, 182, 255, .45); outline-offset: 2px; }

#recordBtn { background: var(--grass); }
#recordBtn:hover { background: var(--grass-600); }

button.secondary { background: #fff; color: var(--deep); border: 1.5px solid var(--line); box-shadow: none; }
button.secondary:hover { background: var(--paper); border-color: var(--sky); color: var(--deep); box-shadow: none; }

button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }

button.danger {
    background: #fff; color: var(--red); border: 1.5px solid var(--line);
    box-shadow: none; padding: 7px 14px; font-size: 13px; border-radius: 9px;
}
button.danger:hover { background: #fdecec; border-color: var(--red); color: var(--red); box-shadow: none; }

/* flash banner (e.g. after deleting a session) */
.flash {
    background: #eef9f1; border: 1px solid #bfe6c9; color: #2e7d4f;
    padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600;
}

/* ---- status ---------------------------------------------------------- */
.status { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--deep); }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(95, 116, 136, .12); }
.dot.idle { background: #9fb6c9; box-shadow: 0 0 0 4px rgba(159, 182, 201, .18); }
.dot.connecting { background: var(--amber); box-shadow: 0 0 0 4px rgba(245, 166, 35, .18); animation: pulse 1s infinite; }
.dot.streaming { background: var(--grass); box-shadow: 0 0 0 4px rgba(122, 201, 67, .22); animation: pulse 1s infinite; }
.dot.done { background: var(--sky); box-shadow: 0 0 0 4px rgba(56, 182, 255, .2); }
.dot.error { background: var(--red); box-shadow: 0 0 0 4px rgba(229, 72, 77, .18); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ---- metrics --------------------------------------------------------- */
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.metric { background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.metric .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
.metric .v { font-size: 26px; font-weight: 700; color: var(--deep); font-variant-numeric: tabular-nums; line-height: 1.2; }

/* ---- transcript ------------------------------------------------------ */
.transcript {
    min-height: 64px; background: var(--paper-2); border: 1px solid var(--line);
    border-radius: 12px; padding: 14px 16px; font-size: 18px; color: var(--ink);
    white-space: pre-wrap; line-height: 1.6;
}
.transcript:empty::before { content: "Das Transkript erscheint hier, sobald Sprache erkannt wird…"; color: var(--muted); font-size: 15px; }

/* explanatory hints + option rows + service items */
.hint { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.metric .k .hint { font-size: 10px; text-transform: none; letter-spacing: 0; }
.opt { display: flex; align-items: flex-start; gap: 9px; padding: 4px 0; line-height: 1.4; }
.opt input { margin-top: 3px; flex: 0 0 auto; }
.opt b { font-weight: 700; }

.svc-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.svc-item:first-child { padding-top: 0; }
.svc-item:last-child { border-bottom: 0; padding-bottom: 0; }
.svc-item input { margin-top: 3px; flex: 0 0 auto; }
.svc-name { font-weight: 700; color: var(--ink); }
.svc-desc { color: var(--muted); font-size: 13px; line-height: 1.45; }
.svc-tech { color: var(--muted); font-family: var(--mono); font-size: 11px; margin-top: 3px; opacity: .85; }

/* ---- raw log --------------------------------------------------------- */
.log {
    font-family: var(--mono); font-size: 12px; background: var(--paper-2);
    border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
    height: 440px; overflow: auto;
}
.log .line { padding: 3px 0; border-bottom: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.log .line:last-child { border-bottom: 0; }
.log .ts { color: var(--muted); }
.log .in { color: var(--grass-600); font-weight: 700; }
.log .out { color: var(--sky-600); font-weight: 700; }
.log .err { color: var(--red); font-weight: 700; }

/* ---- tables ---------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
tbody tr:hover td { background: var(--paper); }
tr:last-child td { border-bottom: 0; }

/* ---- odds and ends --------------------------------------------------- */
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid var(--line); color: var(--muted); background: #fff; }
.pill.ok { color: var(--grass-600); border-color: #bfe6a0; background: #f1fae8; }
.pill.warn { color: #b9791a; border-color: #f2d59a; background: #fdf4e2; }

pre.json {
    font-family: var(--mono); font-size: 12px; background: var(--paper-2);
    border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--ink);
    overflow: auto; max-height: 540px; line-height: 1.5;
}

audio { width: 100%; margin-top: 10px; }

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