:root {
    --ink: #1d2433;
    --muted: #5d6676;
    --line: #dfe3ea;
    --paper: #ffffff;
    --ground: #f5f6f8;
    --accent: #1f5c4a;
    --accent-soft: #e4f0ec;
    --danger: #a33a2b;
    --warn: #8a6100;
    --radius: 8px;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--ground);
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
a { color: var(--accent); }
code, pre { font-family: Consolas, "Cascadia Mono", monospace; font-size: .9em; }
pre { background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; overflow-x: auto; white-space: pre-wrap; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.top { position: relative; display: flex; align-items: center; gap: 2rem; padding: .75rem 2rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { white-space: nowrap; font-weight: 700; text-decoration: none; color: var(--ink); font-size: 1.1rem; margin: 0; }
.brand span { color: var(--accent); font-weight: 500; }
.menu-panel { display: flex; align-items: center; gap: 2rem; flex: 1; min-width: 0; }
.top nav { display: flex; gap: .25rem; flex: 1; }
.top nav a { white-space: nowrap; padding: .4rem .75rem; border-radius: var(--radius); text-decoration: none; color: var(--muted); }
.top nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.who { color: var(--muted); font-size: .9rem; display: flex; gap: .5rem; align-items: center; min-width: 0; white-space: nowrap; }
.who .email { overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }
.menu-button { display: none; margin-left: auto; padding: .4rem; background: none; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); line-height: 0; }
.menu-button svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 2rem; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem; }
.loading { padding: 3rem; text-align: center; color: var(--muted); }
.lead { color: var(--muted); max-width: 70ch; }
@media (max-width: 960px) {
    .top { padding: .6rem 1rem; gap: 1rem; }
    .menu-button { display: inline-flex; }
    .menu-panel { display: none; }
    .top.open .menu-panel { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; position: absolute; top: 100%; left: 0; right: 0; z-index: 10; padding: .5rem 1rem 1rem; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 8px 16px rgb(0 0 0 / .06); }
    .top.open nav { flex-direction: column; }
    .top.open nav a { padding: .65rem .75rem; }
    .top.open .who { justify-content: space-between; padding: .65rem .75rem 0; border-top: 1px solid var(--line); }
    .who .email { max-width: none; }
    main { padding: 1.25rem 1rem; }
}
@media (max-width: 640px) {
    main table { display: block; overflow-x: auto; white-space: nowrap; }
}
.muted { color: var(--muted); font-size: .9rem; }

label { display: block; margin: 0 0 .9rem; font-weight: 600; font-size: .92rem; }
label small, fieldset small { display: block; font-weight: 400; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]), textarea, select {
    display: block; width: 100%; margin-top: .25rem; padding: .55rem .7rem; font: inherit; font-weight: 400;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 600; font-size: .92rem; padding: 0 .25rem; }
label.option { font-weight: 400; display: flex; gap: .5rem; align-items: flex-start; margin: .35rem 0; }
label.option.spaced { margin-bottom: 1.1rem; }
label.option.inline { display: inline-flex; margin-right: .75rem; }
label.option input { margin-top: .3rem; }

button { font: inherit; cursor: pointer; border-radius: var(--radius); padding: .55rem 1rem; border: 1px solid transparent; }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--accent); color: #fff; }
button.secondary { background: var(--paper); border-color: var(--line); color: var(--ink); }
button.danger { background: var(--paper); border-color: var(--danger); color: var(--danger); }
button.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; text-align: left; }
button.small { padding: .3rem .7rem; font-size: .85rem; }
button.wide { display: block; width: 100%; margin-top: .75rem; }
.actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.examples { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; }
.examples p { width: 100%; margin: 0; }
button.chip { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem; font-size: .9rem; color: var(--ink); text-align: left; }
button.chip:hover { border-color: var(--accent); color: var(--accent); }
.turn .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.start ol { margin: 0; padding-left: 1.25rem; line-height: 1.7; }
.panel.highlight { border-color: var(--accent); background: var(--accent-soft); }

.grid { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1rem 0; font-size: .92rem; }
.grid th { text-align: left; font-weight: 600; color: var(--muted); background: var(--ground); }
.grid th, .grid td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tr.selected td { background: var(--accent-soft); }
.grid td small { display: block; }

.status { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--ground); }
.status.indexed, .status.ready { background: var(--accent-soft); color: var(--accent); }
.status.failed, .status.notext { background: #f8e6e3; color: var(--danger); }
.status.pending, .status.queued, .status.transcribing, .status.writing { background: #fbf1d9; color: var(--warn); }

details.panel > summary { cursor: pointer; font-weight: 600; }
details.panel[open] > summary { margin-bottom: .75rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.chip { display: inline-flex; gap: .4rem; align-items: center; font-weight: 500; font-size: .9rem; margin: 0; padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer; }
.chip input { display: none; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip small { color: var(--muted); }

.conversation { display: flex; flex-direction: column; gap: 1.25rem; margin: 1.5rem 0; }
.turn { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.question { font-weight: 600; margin: 0 0 .75rem; }
.answer { margin-bottom: 1rem; }
.cite { font-size: .8em; vertical-align: super; text-decoration: none; font-weight: 600; margin-left: 1px; }
.sources { font-size: .88rem; color: var(--muted); padding-left: 0; list-style: none; }
.sources li { margin-bottom: .6rem; padding: .25rem .5rem; }
.sources li:target { background: var(--accent-soft); border-radius: var(--radius); }
.sources p { margin: .2rem 0 0; }
.thinking { color: var(--muted); }
.cursor { display: inline-block; width: .5em; height: 1em; margin-left: 2px; vertical-align: text-bottom; background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }
form.ask { position: sticky; bottom: 0; background: var(--ground); padding: 1rem 0; display: flex; gap: .75rem; align-items: flex-end; }
form.ask textarea { margin: 0; }

.spinner { display: inline-block; width: .9em; height: .9em; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -.1em; }
@keyframes spin { to { transform: rotate(360deg); } }

.trial-banner { margin: 0; padding: .6rem 1.25rem; background: #fdf3dc; color: #6b4e00; font-size: .9rem; }
.note { padding: .7rem 1rem; border-radius: var(--radius); margin: 1rem 0; }
.note.error { background: #f8e6e3; color: var(--danger); }
.note.success { background: var(--accent-soft); color: var(--accent); }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 1rem 0; }
.tab { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); }
.tab.on { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.5rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
textarea.minutes { font-family: inherit; }
.transcript { white-space: pre-wrap; color: var(--muted); }

.plain { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.plain-card { width: 100%; max-width: 440px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 2rem; }
.plain-card .brand { margin-bottom: 1.25rem; }
.plain-card button.primary { width: 100%; }
