/* Ardea by StreamSoft - teal and white (the StreamSoft marketing palette) */
:root {
  --teal-900: #0b4f4a;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-100: #ccfbf1;
  --teal-50: #f0fdfa;
  --ink: #0f2a2a;
  --muted: #5b7373;
  --line: #d7e7e5;
  --bg: #ffffff;
  --soft: #f6fbfa;
  --danger: #b42318;
  --radius: 14px;
  /* chart colours (checked with the dataviz palette validator: answered / failed stay apart for colour-blind readers;
     cancelled is a deliberate neutral, always named in the legend and the hover box) */
  --c-answered: #0d9488;
  --c-failed: #dc3d43;
  --c-cancelled: #8a9e9c;
  --c-output: #0f766e;
  --c-input: #3fb5a6;
  --c-users: #0d9488;
  --c-questions: #0d9488;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; }
a { color: var(--teal-700); }
code, pre { font-family: "Cascadia Code", Consolas, "Courier New", monospace; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* top bar */
.bar { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 5; }
.bar .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.brand svg { width: 30px; height: 30px; }
.brand small { font-weight: 500; color: var(--muted); font-size: .8rem; }
.bar .spacer { flex: 1; }
.bar .who { color: var(--muted); font-size: .9rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--teal-700); background: var(--teal-700);
  color: #fff; padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--teal-900); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: #fff; color: var(--teal-700); }
.btn.ghost:hover { background: var(--teal-50); }
.btn.small { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.btn.danger { border-color: var(--danger); background: #fff; color: var(--danger); }

/* status light */
.light { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.light::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #9aa9a8; }
.light.on::before { background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }

/* home */
.hero { background: linear-gradient(160deg, var(--teal-50), #fff 60%); border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; padding-top: 56px; padding-bottom: 56px; align-items: start; }
.hero h1 { font-size: 2.4rem; line-height: 1.15; margin: 0 0 14px; }
.hero h1 span { color: var(--teal-700); }
.hero p.lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 20px; }
.points { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.points li { padding-left: 28px; position: relative; }
.points li::before { content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--teal-100);
  box-shadow: inset 0 0 0 5px var(--teal-600); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 6px 24px rgba(15, 118, 110, .06); }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; background: var(--soft); padding: 4px; border-radius: 10px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.on { background: #fff; color: var(--teal-700); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
label { display: block; font-size: .85rem; font-weight: 600; margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-500); outline-offset: 0; border-color: var(--teal-500); }
.form .btn { width: 100%; margin-top: 16px; }
.msg { margin-top: 12px; font-size: .9rem; color: var(--danger); min-height: 1.2em; }
.fine { font-size: .8rem; color: var(--muted); margin-top: 12px; }

.section { padding: 48px 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid3 h3 { margin: 0 0 6px; font-size: 1.05rem; }
.grid3 p { margin: 0; color: var(--muted); font-size: .95rem; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 22px 0; }

/* chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 61px); }
.thread { flex: 1; overflow-y: auto; padding: 24px 0 12px; }
.turn { margin: 0 auto 18px; max-width: 820px; padding: 0 20px; }
.q { background: var(--teal-700); color: #fff; border-radius: 16px 16px 4px 16px; padding: 10px 14px; margin-left: auto; width: fit-content; max-width: 85%; white-space: pre-wrap; }
.a { margin-top: 10px; background: var(--soft); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 12px 16px; max-width: 100%; overflow-x: auto; }
/* an answer (chat page .a, admin question detail .abox): drawn like the Ardea app's (UI\MarkdownView.cs) */
.a p, .abox p { margin: 0 0 10px; } .a p:last-child, .abox p:last-child { margin-bottom: 0; }
.a ul, .a ol, .abox ul, .abox ol { margin: 0 0 10px; padding-left: 22px; }
.a li::marker, .abox li::marker { color: var(--teal-600); font-weight: 700; }
.a h3, .a h4, .abox h3, .abox h4 { margin: 12px 0 6px; color: var(--teal-700); }
.a hr, .abox hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.a code, .abox code { background: #e3f4f1; color: #0b5e57; padding: 1px 6px; border-radius: 5px; font-size: .9em; white-space: nowrap; }
.a blockquote, .abox blockquote { margin: 0 0 10px; padding: 8px 14px; border-left: 4px solid #b5c7c4; background: #f5f8f7; border-radius: 0 8px 8px 0; }
/* code: a dark panel like a code editor, the language and Copy in a strip along the top, syntax colours */
.code { margin: 10px 0 12px; background: #0f1e1d; border: 1px solid #243a37; border-radius: 10px; overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 14px; background: #0a1615; border-bottom: 1px solid #243a37; }
.code-head span { color: #8fb8b1; font-size: .72rem; font-weight: 700; letter-spacing: .06em; }
.code-copy { border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: .78rem; padding: 3px 10px; border-radius: 6px; cursor: pointer; }
.code-copy:hover { background: rgba(255, 255, 255, .16); }
.code-copy.done { border-color: #5eead4; color: #5eead4; }
.code pre { margin: 0; padding: 12px 14px; overflow-x: auto; background: none; color: #d7e6e3; font-size: .86rem; line-height: 1.5; border-radius: 0; }
.code pre code { background: none; color: inherit; padding: 0; border-radius: 0; font-size: inherit; white-space: inherit; }
.t-comment { color: #6f928b; font-style: italic; }
.t-string { color: #c3e88d; }
.t-keyword, .t-operator { color: #c792ea; }
.t-command { color: #82aaff; }
.t-parameter { color: #ffcb6b; }
.t-variable { color: #5eead4; }
.t-number { color: #f78c6c; }
.t-type { color: #89ddff; }
/* callouts: Note, Tip, Important, Warning, Caution */
.callout { margin: 10px 0 12px; padding: 10px 14px 10px 16px; border-radius: 10px; border-left: 4px solid; }
.c-title { display: flex; align-items: center; gap: 7px; font-weight: 700; margin-bottom: 3px; }
.c-title svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.c-note { background: #eef8f6; border-color: #0d9488; } .c-note .c-title { color: #0f766e; }
.c-tip { background: #eff9f2; border-color: #16a34a; } .c-tip .c-title { color: #15803d; }
.c-important { background: #f5f1fe; border-color: #7c3aed; } .c-important .c-title { color: #6d28d9; }
.c-warning { background: #fff7e8; border-color: #d97706; } .c-warning .c-title { color: #b45309; }
.c-caution { background: #fdf1f1; border-color: #dc2626; } .c-caution .c-title { color: #b91c1c; }
.meta { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.sources { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.sources span { color: #8aa0a0; }
.waiting { color: var(--muted); font-style: italic; }
.a.err { border-color: #f3c3bd; background: #fff5f4; color: var(--danger); }
.composer { border-top: 1px solid var(--line); background: #fff; padding: 14px 0 18px; }
.composer form { max-width: 820px; margin: 0 auto; padding: 0 20px; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { resize: none; min-height: 48px; max-height: 200px; }
.composer .fine { max-width: 820px; margin: 8px auto 0; padding: 0 20px; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty h2 { color: var(--ink); margin: 0 0 8px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.suggest button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); }
.suggest button:hover { border-color: var(--teal-500); color: var(--teal-700); }

/* admin */
.admin h2 { margin: 28px 0 12px; font-size: 1.15rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.stat b { display: block; font-size: 1.6rem; color: var(--teal-700); }
.stat span { color: var(--muted); font-size: .85rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.tablebox { border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eef2f2; color: var(--muted); }
.pill.ready { background: #dcfce7; color: #166534; }
.pill.gaming, .pill.paused, .pill.loading { background: #fef3c7; color: #92400e; }
.pill.revoked { background: #fee4e2; color: var(--danger); }
.pill.complex { background: #ccebe7; color: var(--teal-700); }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 200px; }
.keybox { margin-top: 14px; padding: 14px; border: 1px dashed var(--teal-500); border-radius: 12px; background: var(--teal-50); }
.keybox code { word-break: break-all; display: block; padding: 8px; background: #fff; border-radius: 8px; margin: 6px 0; }
.clip { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* bar chart (Ardea.bars): drawn in real pixels, never stretched */
.chart { width: 100%; }
.chart .ch-plot { position: relative; height: 190px; }
.chart.tall .ch-plot { height: 250px; }
.chart svg { display: block; outline: none; }
.chart svg:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 2px; border-radius: 6px; }
.chart .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: #edf3f2; stroke-width: 1; }
.chart .axis { stroke: #c9d9d7; stroke-width: 1; }
.chart .hl { fill: var(--teal-50); }
.chart .empty { font-size: 13px; fill: var(--muted); }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .82rem; color: var(--muted); margin: 0 0 10px; }
.ch-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ch-legend i, .ch-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ch-legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(15, 42, 42, .12); font-size: .82rem; min-width: 170px; z-index: 2; }
.ch-tip b { display: block; margin-bottom: 4px; color: var(--ink); white-space: nowrap; }
.ch-tip div { display: flex; align-items: center; gap: 7px; color: var(--muted); line-height: 1.7; }
.ch-tip div span { margin-left: auto; padding-left: 14px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-tip .sum { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 3px; }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 32px; }
  .hero h1 { font-size: 1.8rem; }
  .grid3 { grid-template-columns: 1fr; }
  .bar .who { display: none; }
}
