/* Aïoli Studio — charter tokens and common pieces (buttons, forms, boxes, modal, toasts, tables, sign-in card).
   Charter = the website aioeli.com (public/landing/site.css of the platform repo, read 2026-11-29): olive #17201A, aïoli #EBC85A,
   aïoli ink #8A6A0C (aïoli as text on light backgrounds), garlic #F4F0E6, leaf #5E7A4E; system sans-serif for text, IBM Plex
   Mono for labels; square corners (2–3 px). The website has no dark page: dark = its dark sections (olive ground, garlic text,
   aïoli accent). Theme: html[data-theme="light" | "dark"], none = follows the system. Density: html.compact (see shell.css).
   No inline styles anywhere (CSP style-src 'self'): JS sets classes, or element.style properties (CSSOM is allowed). */
:root {
  --olive: #17201A; --olive-2: #222D24; --olive-line: #34402F;
  --aioli: #EBC85A; --aioli-ink: #8A6A0C; --garlic: #F4F0E6; --leaf: #5E7A4E;
  --on-dark-2: #D3D9CB; --on-dark-3: #A4AF98;

  --bg: #F7F5EF; --surface: #FFFFFF; --surface-2: #FBFAF7; --hover: #F1EEE5;
  --line: #DADADA; --line-2: #ECE9E1;
  --ink: #17201A; --ink-2: #4A4636; --muted: #6B6553;
  --accent: var(--aioli); --on-accent: var(--olive); --accent-ink: var(--aioli-ink); --accent-soft: #F6EDCC;
  --danger: #A63D2A; --danger-soft: #F7E4DE; --ok: #3F6B35; --ok-soft: #E5EEDD;
  --frame: var(--olive); --frame-2: var(--olive-2); --frame-line: var(--olive-line); --frame-t: var(--garlic); --frame-m: var(--on-dark-3);
  --shadow: 0 1px 2px rgba(23,32,26,.05), 0 10px 30px rgba(23,32,26,.06);
  --shadow-pop: 0 16px 48px rgba(23,32,26,.18);
  --radius: 3px;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111712; --surface: #1A221C; --surface-2: #161D18; --hover: #243026;
    --line: #34402F; --line-2: #2A342B;
    --ink: #F4F0E6; --ink-2: #D3D9CB; --muted: #A4AF98;
    --accent-ink: #EBC85A; --accent-soft: #3A3620;
    --danger: #E58B73; --danger-soft: #3A2420; --ok: #A3C58F; --ok-soft: #22321F;
    --frame: #0D120F; --frame-2: #222D24; --frame-line: #2A342B;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25); --shadow-pop: 0 16px 48px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111712; --surface: #1A221C; --surface-2: #161D18; --hover: #243026;
  --line: #34402F; --line-2: #2A342B;
  --ink: #F4F0E6; --ink-2: #D3D9CB; --muted: #A4AF98;
  --accent-ink: #EBC85A; --accent-soft: #3A3620;
  --danger: #E58B73; --danger-soft: #3A2420; --ok: #A3C58F; --ok-soft: #22321F;
  --frame: #0D120F; --frame-2: #222D24; --frame-line: #2A342B;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.25); --shadow-pop: 0 16px 48px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
h1 { font-size: 26px; font-weight: 650; line-height: 1.15; }
h2 { font-size: 16px; font-weight: 650; }
p { margin: 0 0 10px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--aioli); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--leaf); }
:root[data-theme="dark"] .eyebrow { color: var(--aioli); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eyebrow { color: var(--aioli); } }
.soon { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 2px; font: 500 10px var(--mono); letter-spacing: .06em;
  text-transform: uppercase; background: var(--hover); color: var(--muted); vertical-align: 1px; }
.pill { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--aioli); color: var(--olive);
  font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.ic { display: inline-grid; place-items: center; flex: none; }
.ic svg { width: 18px; height: 18px; display: block; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 34px; padding: 6px 16px;
  border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--ink); font: 600 13px var(--sans);
  cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--aioli); border-color: var(--aioli); color: var(--olive); }
.btn.primary:hover { filter: brightness(1.06); border-color: var(--aioli); }
.btn.dark { background: var(--olive); border-color: var(--olive); color: var(--garlic); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { min-height: 26px; padding: 2px 10px; font-size: 12px; }
.btn.wide { width: 100%; min-height: 44px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: default; filter: none; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 2px; background: none;
  color: inherit; cursor: pointer; padding: 0; position: relative; }
.icon-btn svg { width: 20px; height: 20px; }

/* forms */
input[type=text], input[type=email], input[type=search], input[type=url], input[type=number], input:not([type]), select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--aioli); outline-offset: -1px; border-color: var(--aioli); }
select { width: auto; max-width: 100%; }
textarea { resize: vertical; }
.fld { display: block; margin: 0 0 14px; }
.fld > span { display: block; margin-bottom: 4px; font-weight: 600; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.seg button { border: 0; background: none; color: var(--ink-2); font: 500 12.5px var(--sans); padding: 6px 12px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--olive); color: var(--garlic); }

/* boxes, notices, empty states */
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.box > h2, .box > .bh { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.box > .in { padding: 16px; }
.notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--aioli); border-radius: var(--radius); padding: 11px 16px; margin: 0 0 18px; }
.notice.err { border-left-color: var(--danger); background: var(--danger-soft); }
.notice.ok { border-left-color: var(--ok); }
.empty { max-width: 560px; margin: 56px auto; text-align: center; color: var(--ink-2); }
.empty .ic svg { width: 40px; height: 40px; color: var(--muted); }
.empty h2 { margin: 14px 0 8px; font-size: 19px; color: var(--ink); }
.empty p { color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* modal (ui.js modal / confirmBox): title and buttons stay visible, the content in between scrolls */
.ovl { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(13,18,15,.55); }
.mdl { display: flex; flex-direction: column; width: 100%; max-width: 500px; max-height: calc(100dvh / var(--zf, 1) - 32px);
  background: var(--surface); color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-pop); overflow: hidden; }
.mdl.wide { max-width: 1000px; }
.mdl > h2 { flex: none; padding: 18px 20px 6px; font-size: 19px; }
.mdl > .in { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px 20px 18px; }
.mdl > .ft { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); }

/* toasts (ui.js toast / toastAct / busyToast) */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { max-width: 380px; padding: 11px 18px; border-radius: var(--radius); background: var(--olive); color: var(--garlic); box-shadow: var(--shadow-pop); }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { border-left: 4px solid var(--aioli); }
.toast.tact { display: flex; align-items: center; gap: 12px; }
.toast.tact button { border: 0; background: none; color: var(--aioli); font: 700 13px var(--sans); cursor: pointer; padding: 0; }
.toast.busy { min-width: 260px; }
.tb-l { display: flex; align-items: center; gap: 8px; }
.tb-n { margin-left: auto; font-variant-numeric: tabular-nums; }
.tb-bar { height: 5px; margin-top: 8px; border-radius: 2px; background: rgba(255,255,255,.25); overflow: hidden; }
.tb-bar i { display: block; height: 100%; width: 0; background: var(--aioli); transition: width .2s; }
.spin { width: 16px; height: 16px; flex: none; border: 2px solid rgba(255,255,255,.3); border-top-color: var(--aioli); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }

/* tables (table.js): sort on the header, a filter per column, widths dragged and kept per table */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); overflow: hidden; text-overflow: ellipsis; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl th { position: relative; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); user-select: none; }
table.tbl th.sortable { cursor: pointer; }
table.tbl th.sortable:hover { color: var(--ink); }
table.tbl th[aria-sort="ascending"]::after { content: ' ↑'; }
table.tbl th[aria-sort="descending"]::after { content: ' ↓'; }
table.tbl tr.flt th { padding: 4px 6px; background: var(--surface); text-transform: none; letter-spacing: 0; }
table.tbl tr.flt input { padding: 4px 8px; font: 12.5px var(--sans); }
table.tbl tbody tr:hover { background: var(--hover); }
table.tbl .rsz { position: absolute; top: 0; right: 0; bottom: 0; width: 6px; cursor: col-resize; }
table.tbl .rsz:hover, table.tbl .rsz.on { background: var(--aioli); }
table.tbl td.none { text-align: center; color: var(--muted); padding: 22px; }

/* sign-in (public/index.html) */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.auth-logo { display: block; height: 44px; width: auto; margin: 0 auto 22px; }
.auth-logo.on-dark { display: none; }
:root[data-theme="dark"] .auth-logo.on-light { display: none; }
:root[data-theme="dark"] .auth-logo.on-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-logo.on-light { display: none; } :root:not([data-theme="light"]) .auth-logo.on-dark { display: block; } }
.auth-card h1 { margin: 8px 0 14px; font-size: 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; }
.auth-card label { font-size: 13px; font-weight: 600; }
.auth-card input { margin-top: 5px; height: 44px; font-size: 15px; }
.auth-card input.code { font-size: 22px; letter-spacing: .3em; text-align: center; }
.auth-err { padding: 9px 12px; border-radius: 2px; background: var(--danger-soft); color: var(--danger); }
.auth-alt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-div { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.auth-div::before, .auth-div::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.auth-foot { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: center; align-items: center; font-size: 12.5px; color: var(--muted); }
.auth-links { display: flex; gap: 14px; justify-content: center; font-size: 13px; }
/* the workspace picker (issue #3) */
.auth-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; }
.auth-list button { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.auth-list button:hover { border-color: var(--ink); }
.auth-list small { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* settings: members and sign-in methods (issue #3) */
.row-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 12px; }
.inline-form input, .inline-form select { flex: 1 1 200px; min-width: 0; }
.tag { display: inline-block; padding: 1px 7px; border: 1px solid var(--line); border-radius: 2px; font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
