/* Community Boudica: shared styles. Large text, high contrast, no web fonts. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1b2430;
  --muted: #4a5563;
  --line: #d9dde3;
  --sea: #0e5a7a;          /* primary */
  --sea-ink: #ffffff;
  --sea-soft: #e3f0f5;
  --harbour: #b5412b;      /* accent */
  --sand: #f3ead9;
  --ok: #2d6a3e;
  --warn-bg: #fff4d6;
  --warn-ink: #6b4a00;
  --radius: 14px;
  --focus: #f2b705;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161c; --surface: #1a2129; --ink: #eef2f5; --muted: #b3bcc6;
    --line: #2e3945; --sea: #5fb4d6; --sea-ink: #0b1a22; --sea-soft: #16303c;
    --harbour: #f08b73; --sand: #262219; --ok: #7cc58f;
    --warn-bg: #3a2f10; --warn-ink: #f5d98a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11161c; --surface: #1a2129; --ink: #eef2f5; --muted: #b3bcc6;
  --line: #2e3945; --sea: #5fb4d6; --sea-ink: #0b1a22; --sea-soft: #16303c;
  --harbour: #f08b73; --sand: #262219; --ok: #7cc58f;
  --warn-bg: #3a2f10; --warn-ink: #f5d98a; color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 112.5%; }            /* 18px base */
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
}
a { color: var(--sea); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Header */
header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
nav.main { margin-left: auto; }
nav.main ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; }
nav.main a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
nav.main a:hover, nav.main a[aria-current="page"] { background: var(--sea-soft); color: var(--sea); }

/* Hero */
.hero { background: linear-gradient(180deg, var(--sea-soft), var(--bg)); padding: 40px 0 28px; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.2; margin: 0 0 8px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 20px; max-width: 42em; }

h1 { font-size: 2rem; line-height: 1.25; }
h2 { font-size: 1.45rem; line-height: 1.3; margin-top: 2rem; }
h3 { font-size: 1.15rem; }
main { padding-bottom: 48px; }
.page-head { padding: 28px 0 8px; }
.page-head p { color: var(--muted); max-width: 44em; }

/* Ask box */
.ask { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 2px 10px rgb(0 0 0 / .05); }
.ask label { font-weight: 600; display: block; margin-bottom: 8px; }
.ask .row { display: flex; gap: 8px; }
.ask textarea {
  flex: 1; min-height: 56px; resize: vertical; font: inherit; color: var(--ink);
  background: var(--bg); border: 2px solid var(--line); border-radius: 10px; padding: 12px;
}
.ask textarea:focus { border-color: var(--sea); outline: none; }
.btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 10px;
  background: var(--sea); color: var(--sea-ink); padding: 12px 20px; text-decoration: none; display: inline-block;
}
.btn.secondary { background: var(--sea-soft); color: var(--sea); }
.btn[disabled] { opacity: .6; cursor: wait; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  font: inherit; font-size: .9rem; cursor: pointer; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); border-radius: 999px; padding: 6px 14px;
}
.chip:hover { border-color: var(--sea); color: var(--sea); }
.answer { margin-top: 14px; }
.msg { border-radius: 12px; padding: 12px 14px; margin-top: 10px; white-space: pre-wrap; }
.msg.user { background: var(--sea-soft); }
.msg.bot { background: var(--sand); }
.msg .meta { display: block; font-size: .8rem; color: var(--muted); margin-top: 6px; white-space: normal; }
/* Learn AI: the model's planning notes, collapsed under the answer */
.thinking { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; white-space: normal; }
.thinking summary { cursor: pointer; color: var(--sea); font-weight: 600; font-size: .92rem; padding: 4px 0; }
.thinking summary:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; border-radius: 4px; }
.thinking-explain { font-size: .85rem; color: var(--muted); margin: 6px 0 8px; }
.thinking-text { white-space: pre-wrap; font-size: .9rem; color: var(--muted); background: var(--surface);
  border-left: 3px solid var(--sea); border-radius: 8px; padding: 10px 12px; overflow-wrap: anywhere; }
.ai-note { font-size: .85rem; color: var(--muted); margin: 10px 0 0; }

/* Cards / doors */
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 28px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; color: var(--ink); text-decoration: none; display: block;
}
a.card:hover { border-color: var(--sea); }
.card h3 { margin: 6px 0 4px; }
.card p { margin: 0; color: var(--muted); }
.card .icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--sea-soft); color: var(--sea); }
.card .icon svg { width: 24px; height: 24px; }

.list { display: grid; gap: 12px; margin-top: 16px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.item h3 { margin: 0 0 4px; }
.item dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 8px 0 0; font-size: .95rem; }
.item dt { color: var(--muted); }
.item dd { margin: 0; }
.tag { display: inline-block; font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--sea-soft); color: var(--sea); margin-right: 6px; }
.tag.verify { background: var(--warn-bg); color: var(--warn-ink); }
.tag.example { background: var(--line); color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.filters input[type=search], .filters select {
  font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-width: 0; flex: 1 1 220px;
}

.notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.help-grid .item strong { font-size: 1.2rem; display: block; }

.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 48px; margin: 14px 0; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--sea); color: var(--sea-ink); display: grid; place-items: center; font-weight: 700;
}
blockquote.try { border-left: 4px solid var(--harbour); background: var(--surface); margin: 12px 0; padding: 10px 14px; border-radius: 0 10px 10px 0; }

footer.site { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0; font-size: .9rem; color: var(--muted); }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer.site a { color: var(--muted); }

@media (max-width: 640px) {
  nav.main { margin-left: 0; width: 100%; }
  .ask .row { flex-direction: column; }
  .item dl { grid-template-columns: 1fr; }
  .item dt { margin-top: 6px; }
}

/* Account forms */
.wrap.narrow { max-width: 640px; }
/* form.plain: the same look with no script attached (admin page). */
form.account fieldset, form.contact fieldset, form.website fieldset, form.plain fieldset { border: 0; padding: 0; margin: 0; }
form.account label, form.contact label, form.website label, form.plain label { display: block; font-weight: 600; margin-top: 18px; }
form.account input, form.contact input, form.contact select, form.contact textarea, form.website input, form.plain input {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 6px;
}
form.contact textarea { min-height: 160px; resize: vertical; }
form.account input:focus, form.contact input:focus, form.contact select:focus, form.contact textarea:focus,
form.website input:focus, form.plain input:focus { border-color: var(--sea); outline: none; }
form.account .btn, form.contact .btn, form.website .btn, form.plain .btn { margin-top: 22px; }
/* Hidden from people; only automated form-fillers complete it. */
form.contact .extra-field, form.website .extra-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hint { font-size: .9rem; color: var(--muted); margin: 6px 0 0; }
.notice.ok { background: var(--sea-soft); color: var(--ink); }
.notice.ok h2 { margin-top: 0; }
p.code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.3rem; letter-spacing: .06em;
  background: var(--surface); border: 2px dashed var(--sea); border-radius: 10px; padding: 12px 14px;
  overflow-wrap: anywhere;
}

/* Welcome / safety message (home + join) */
.welcome { margin-top: 32px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--harbour); border-radius: var(--radius); padding: 20px; }
.welcome h2 { margin-top: 0; }
.welcome .lead-in { color: var(--muted); max-width: 46em; }
.audiences { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; margin-top: 12px; }
.narrow .audiences { grid-template-columns: 1fr; }
.aud { background: var(--bg); border-radius: 10px; padding: 14px 16px; }
.aud h3 { margin: 0 0 6px; color: var(--sea); }
.aud p { margin: 0 0 8px; }
.aud p:last-child { margin-bottom: 0; }

/* Admin page */
#admin-signin { max-width: 420px; }
.admin-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn.danger { color: var(--warn-ink); }
#admin h2 .count { font-size: .9rem; font-weight: 400; color: var(--muted); }
.admin-item { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--sea);
  border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.admin-item.handled { border-left-color: var(--line); }
.admin-item p { margin: 6px 0; }
.admin-item .meta { font-size: .9rem; color: var(--muted); }
.admin-item .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-list { padding-left: 20px; }
.admin-list li { margin: 8px 0; }
form.plain.inline { max-width: 420px; }
