/* Shared look for the Pages-served pages (contribute/, place/, API/). One file, no build step.
   Linked BEFORE each page's own <style>, so a page rule of equal specificity still wins.
   The token names (--bg --fg --mut --line --acc --ok --warn --bad --sel) are used inline by the
   pages' scripts (style="color:var(--warn)"): do not rename them. */
:root {
  color-scheme: light dark;
  --bg:#fff; --bg-2:#f6f7f9; --fg:#14171a; --mut:#5f6670; --line:#dfe2e6; --acc:#0b5fff;
  --ok:#0a7d32; --warn:#9a6400; --bad:#b3261e; --sel:#eef3ff;
  --radius:8px; --shadow:0 1px 2px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.12);
  --fs-xs:.75rem; --fs-sm:.85rem; --fs-md:.95rem; --fs-lg:1.05rem; --fs-xl:1.25rem;
  --s1:.25rem; --s2:.5rem; --s3:.75rem; --s4:1rem; --s5:1.5rem;
  --ctl-h:2.1rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#15171b; --bg-2:#1b1e23; --fg:#e9eaec; --mut:#9aa0a6; --line:#2b2f36; --acc:#7aa2ff;
    --ok:#5dd47f; --warn:#e0b050; --bad:#ff6b5e; --sel:#1d2633;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.45);
  }
}
* { box-sizing:border-box; }
/* A class that sets display (a grid, say) would otherwise beat the hidden attribute. */
[hidden] { display:none !important; }
body { background:var(--bg); color:var(--fg);
       font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; }
a { color:var(--acc); }

button, input, select, textarea {
  font:inherit; color:var(--fg); background:var(--bg);
  border:1px solid var(--line); border-radius:6px; padding:.3rem .65rem; }
button, select, input:not([type=checkbox]):not([type=radio]):not([type=file]) { min-height:var(--ctl-h); }
button { cursor:pointer; transition:border-color .12s, background-color .12s, color .12s; }
button:hover:not(:disabled), select:hover { border-color:var(--acc); }
button:disabled { opacity:.5; cursor:not-allowed; }
:is(button, input, select, textarea, summary, a):focus-visible { outline:2px solid var(--acc); outline-offset:1px; }
button.primary { background:var(--acc); border-color:var(--acc); color:#fff; font-weight:600; }
button.primary:hover:not(:disabled) { filter:brightness(1.1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button.primary { color:#0c1220; } }
button.on, button[aria-pressed="true"], button[aria-selected="true"] {
  border-color:var(--acc); color:var(--acc); background:var(--sel); font-weight:600; }
button.primary.on { background:var(--acc); color:#fff; }

table { border-collapse:collapse; width:100%; }
th, td { text-align:left; padding:.35rem .5rem; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--mut); font-weight:500; font-size:var(--fs-xs); text-transform:none; }

.pill { display:inline-block; padding:.05rem .45rem; border-radius:99px; font-size:.72rem;
        border:1px solid var(--line); color:var(--mut); background:var(--bg-2); }
.warnbox, .badbox, .okbox { border:1px solid var(--warn); border-left-width:4px; border-radius:6px;
        padding:.5rem .7rem; margin:.6rem 0;
        background:color-mix(in srgb, var(--warn) 9%, var(--bg)); }
.warnbox h3 { margin:0 0 .3rem; font-size:var(--fs-sm); color:var(--warn); }
.badbox { border-color:var(--bad); background:color-mix(in srgb, var(--bad) 9%, var(--bg)); }
.badbox h3 { color:var(--bad); }
.okbox { border-color:var(--ok); background:color-mix(in srgb, var(--ok) 9%, var(--bg)); }
.okbox h3 { color:var(--ok); }
.note { color:var(--mut); font-size:.8rem; margin:.3rem 0; }
.sub { color:var(--mut); font-family:ui-monospace,Menlo,Consolas,monospace; font-size:.8rem; word-break:break-all; }
code { font-family:ui-monospace,Menlo,Consolas,monospace; }

dialog { max-width:40rem; border:1px solid var(--line); border-radius:12px; padding:1.1rem 1.4rem;
         background:var(--bg); color:var(--fg); box-shadow:var(--shadow); }
dialog::backdrop { background:rgba(0,0,0,.45); }

details.help { border:1px solid var(--line); border-radius:var(--radius); background:var(--bg-2); padding:.35rem .8rem; }
details.help > summary { cursor:pointer; color:var(--mut); font-size:var(--fs-sm); font-weight:500; padding:.1rem 0; }
details.help[open] > summary { margin-bottom:.3rem; }
