/* Unbridled Brand Guidelines V1.0. Light = white/gravel. Dark = deepest blue. */
:root {
  --bg: #E8EEF2;
  --surface: #FFFFFF;
  --sunk: #D7E3EA;
  --ink: #1C252D;
  --muted: #4B4F54;
  --line: #A6BBC8;
  --accent: #5A8BA7;
  --accent-soft: #D5E8F2;
  --accent-ink: #FFFFFF;
  --goal: #396889;
  --ok: #3A6016;
  --ok-soft: #E4EED4;
  --full: #DC582A;
  --full-soft: #F8E0D6;
  --shadow: 0 1px 2px rgba(28,37,45,.08), 0 8px 22px rgba(45,70,84,.10);
  --gs-border: #5A8BA7;
  --bo-border: #AC6D29;
  --f-display: "Azo Sans", "Outfit", "Segoe UI", system-ui, sans-serif;
  --f-body: "Azo Sans", "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "Outfit", ui-monospace, "Cascadia Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #001C28; --surface: #2D4654; --sunk: #396889; --ink: #E8EEF2; --muted: #A6BBC8; --line: #396889;
    --accent: #78B0D1; --accent-soft: #2D4654; --accent-ink: #001C28; --goal: #78B0D1;
    --ok: #A3BC72; --ok-soft: #173A00; --full: #E87847; --full-soft: #650D05;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 22px rgba(0,0,0,.28);
    --gs-border: #78B0D1;
    --bo-border: #D4B104;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #001C28; --surface: #2D4654; --sunk: #396889; --ink: #E8EEF2; --muted: #A6BBC8; --line: #396889;
  --accent: #78B0D1; --accent-soft: #2D4654; --accent-ink: #001C28; --goal: #78B0D1;
  --ok: #A3BC72; --ok-soft: #173A00; --full: #E87847; --full-soft: #650D05;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 22px rgba(0,0,0,.28);
  --gs-border: #78B0D1;
  --bo-border: #D4B104;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #E8EEF2; --surface: #FFFFFF; --sunk: #D7E3EA; --ink: #1C252D; --muted: #4B4F54; --line: #A6BBC8;
  --accent: #5A8BA7; --accent-soft: #D5E8F2; --accent-ink: #FFFFFF; --goal: #396889;
  --ok: #3A6016; --ok-soft: #E4EED4; --full: #DC582A; --full-soft: #F8E0D6;
  --shadow: 0 1px 2px rgba(28,37,45,.08), 0 8px 22px rgba(45,70,84,.10);
  --gs-border: #5A8BA7;
  --bo-border: #AC6D29;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
#view-agenda, #view-manage, #view-report { display: grid; gap: 20px; }
#view-agenda { gap: 28px; }
.wrap { max-width: 980px; margin: 0 auto; padding-block: 28px 80px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 20px; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; line-height: 1.15; font-weight: 700; }
h1 { font-size: clamp(28px, 5vw, 40px); }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.eyebrow { font-family: var(--f-body); font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* Header */
.top { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: flex-end; }
.top .ev { display: grid; gap: 6px; min-width: 0; flex: 1 1 380px; }
.top .sub { color: var(--muted); max-width: 60ch; }
.top .sub-list { margin: 0; padding-left: 1.15em; display: grid; gap: 2px; }
.top .sub-list.nested { margin-top: 2px; padding-left: 1.25em; }
.top .sub-list strong { color: var(--ink); font-weight: 700; }
.me { display: grid; gap: 8px; flex: 0 1 300px; min-width: 0; }
.prefs { display: grid; gap: 10px; }
#theme-label { font-size: 12px; font-weight: 600; color: var(--muted); }
#theme-modes { width: fit-content; flex-wrap: nowrap; gap: 2px; padding: 2px; border-radius: 8px; }
#theme-modes button { padding: 5px 10px; font-size: 13px; }
.who { display: flex; align-items: center; gap: 10px; }
.who img { width: 32px; height: 32px; border-radius: 50%; }
.field { display: grid; gap: 4px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
select, input[type=text], input[type=email], input[type=url], input[type=number], input[type=date], input[type=time], input[type=search], textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 84px; }

/* Banner and progress */
.banner { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; }
.progress { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.super-block { flex: 1 1 100%; width: 100%; display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.super-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; width: 100%; }
.super-grid .nom-field:last-child:nth-child(odd) { grid-column: 1 / -1; }
.super-grid .nom-field { min-width: 0; display: grid; gap: 6px; }
.super-grid .nom-field label { font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.25; letter-spacing: 0; text-transform: none; }
.super-grid .nom-field input, .super-grid .suggest, .super-grid .nom-chip { width: 100%; }
.pips { display: flex; gap: 6px; }
.pip { width: 26px; height: 8px; border-radius: 4px; background: var(--sunk); border: 1px solid var(--line); }
.pip.on { background: var(--accent); border-color: var(--accent); }
.progress .count { font-family: var(--f-display); font-size: 22px; font-weight: 700; }
.progress.done .count { color: var(--ok); }
.deadline { flex-basis: 100%; font-weight: 600; color: var(--goal); border-top: 1px solid var(--line); padding-top: 10px; }
.deadline.closed { color: var(--full); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }

/* Agenda rail */
.day { display: grid; gap: 10px; }
.day-head { display: grid; gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; }
.time { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 14px; color: var(--muted); }
.time b { display: block; color: var(--ink); font-weight: 500; font-size: 14px; }
.block { background: var(--surface); border: 2px solid var(--bo-border); border-radius: 12px; min-width: 0; box-shadow: var(--shadow); }
.block.keynote { border: 3px solid var(--gs-border); box-shadow: var(--shadow); }
.block.pause { background: transparent; border-style: dashed; color: var(--muted); padding: 10px 14px; font-size: 14px; }
.block-in { padding: 14px 16px; display: grid; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-body); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--sunk); color: var(--muted); width: fit-content; }
.tag.key { background: var(--accent); color: var(--accent-ink); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.full { background: var(--full-soft); color: var(--full); }
.speaker { font-weight: 600; }
.desc { color: var(--muted); max-width: 70ch; white-space: pre-line; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 7px 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.quiet { border-color: transparent; background: none; color: var(--accent); padding-inline: 6px; }
.btn.danger { color: var(--full); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

/* Breakout dropdown */
.bo-head { width: 100%; background: none; border: 0; text-align: left; cursor: pointer; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; border-radius: 12px; }
.bo-head .chev { width: 18px; height: 18px; transition: transform .15s; color: var(--muted); }
.bo-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.bo-head .pick { font-size: 14px; color: var(--muted); }
.bo-head .pick strong { color: var(--ink); }
.bo-body { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.ses { border: 2px solid var(--bo-border); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; align-content: start; background: var(--surface); box-shadow: var(--shadow); }
.ses.mine { border-color: var(--ok); background: var(--ok-soft); }
.meter { position: relative; height: 8px; background: var(--sunk); border-radius: 4px; border: 1px solid var(--line); }
.meter .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 4px; }
.meter .fill.full { background: var(--full); }
.meter .goal { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--goal); }
.meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta .goalkey { color: var(--goal); font-weight: 600; }
.note { font-size: 13px; color: var(--muted); }

/* Manage + report */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 14px; min-width: 0; box-shadow: var(--shadow); }
.panel.fold { padding: 0; gap: 0; }
.panel.fold > .bo-head { padding: 14px 16px; }
.panel.fold.open { padding-bottom: 16px; }
.panel.fold.open > :not(.bo-head) { margin-inline: 16px; margin-top: 12px; }
.panel-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.tablewrap { overflow-x: auto; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--surface); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--ink); font-weight: 700; background: var(--sunk); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font-size: 14px; }
.chip img { width: 24px; height: 24px; border-radius: 50%; }
.chip button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 16px; line-height: 1; }
.results { display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.results button { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; cursor: pointer; text-align: left; }
.results button:last-child { border-bottom: 0; }
.results img { width: 24px; height: 24px; border-radius: 50%; }
.suggest { position: relative; }
.suggest-list { position: absolute; z-index: 8; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 240px; overflow: auto; display: grid; }
.suggest-item { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover, .suggest-item:focus { background: var(--accent-soft); }
.nom-chip { width: 100%; justify-content: flex-start; border-radius: 10px; padding: 8px 10px; }

/* Editor overlay */
.overlay { position: fixed; inset: 0; background: rgba(10,16,22,.5); display: grid; place-items: center; padding: 16px; z-index: 20; overflow-y: auto; }
.dialog { background: var(--surface); border-radius: 14px; padding: 20px; width: min(560px, 100%); display: grid; gap: 14px; box-shadow: var(--shadow); max-height: calc(100% - 32px); overflow-y: auto; }
.err { color: var(--full); font-size: 14px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); z-index: 30; box-shadow: var(--shadow); }
/* TBD / unconfirmed highlighting */
:root { --tbd: #FFF1A8; --tbd-line: #D9B437; --tbd-ink: #5E4700; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tbd: #3A3210; --tbd-line: #8C7626; --tbd-ink: #F3DC86; } }
:root[data-theme="dark"] { --tbd: #3A3210; --tbd-line: #8C7626; --tbd-ink: #F3DC86; }
:root[data-theme="light"] { --tbd: #FFF1A8; --tbd-line: #D9B437; --tbd-ink: #5E4700; }
.tag.tbd { background: var(--tbd); color: var(--tbd-ink); box-shadow: inset 0 0 0 1px var(--tbd-line); }
mark.tbd { background: var(--tbd); color: var(--tbd-ink); padding: 0 5px; border-radius: 4px; font-size: 13px; font-weight: 600; }
.ses.tbd, .block.keynote.tbd { background: var(--tbd); border-color: var(--tbd-line); }
.ses.tbd.mine { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
tr.tbd td { background: var(--tbd); }
.checks { display: grid; gap: 4px; }
.checks label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
.checks label.tbd { background: var(--tbd); border-color: var(--tbd-line); }
.checks input { margin-top: 4px; width: 16px; height: 16px; }
.checks .sub { grid-column: 2; font-size: 13px; color: var(--muted); }
.gate { max-width: 560px; width: 100%; margin: 12px auto 0; }
.agenda-mail { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.agenda-mail-card { margin-top: 8px; }
.modes { display: inline-flex; gap: 4px; padding: 4px; background: var(--sunk); border-radius: 10px; flex-wrap: wrap; }
.modes button { border: 0; background: none; padding: 7px 14px; border-radius: 7px; font-weight: 600; cursor: pointer; color: var(--muted); }
.modes button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.next-page { display: flex; justify-content: flex-end; padding-top: 8px; }
.next-page-btn { display: inline-flex; align-items: center; gap: 10px; }
.next-arrow { font-size: 20px; line-height: 1; }
.steps { flex-basis: 100%; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.step { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.step.todo { border-color: var(--accent); background: var(--accent-soft); }
.step.done { border-color: var(--ok); background: var(--ok-soft); }
.step b { font-size: 15px; }
.step span { font-size: 13px; color: var(--muted); }
.tag.need { background: var(--accent); color: var(--accent-ink); }
.block.needs { border-color: var(--accent); box-shadow: var(--shadow); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }

@media (max-width: 620px) {
  .row { grid-template-columns: 1fr; gap: 4px; }
  .time { padding-top: 0; display: flex; gap: 8px; align-items: baseline; }
  .time b { display: inline; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.who .initials, .chip .initials {
  width: 32px; height: 32px; border-radius: 50%; display:inline-flex; align-items:center; justify-content:center;
  background: var(--accent-soft); color: var(--accent); font-weight:700; font-size:12px; flex:0 0 auto;
}
.chip .initials { width:24px; height:24px; font-size:11px; }
