/* Tabled: GenEx soft (GenEx navy and blue, IBM Plex Sans), docs/DESIGN.md.
   No inline styles anywhere: the CSP allows this file only. */

/* IBM Plex Sans, copied from genex-pdq's static/fonts with its OFL licence.  The font
   files never change; a new cut gets a new file name (Caddy serves /static as immutable). */
@font-face { font-family: 'Plex'; src: url('../fonts/ibm-plex-sans-latin.woff2') format('woff2'); font-weight: 100 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plex'; src: url('../fonts/ibm-plex-sans-latin-ext.woff2') format('woff2'); font-weight: 100 700; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --navy: #233145;
  --navy-deep: #1A2535;
  --navy-hover: #2D3E57;
  --blue: #27789D;
  --blue-text: #1F6585;
  --sky: #5FB3D6;
  --blue-wash: #E8F2F7;
  --blue-wash-2: #D9EBF3;
  --blue-line: #BCD9E7;
  --teal: #0F766E;
  --teal-wash: #E2F4F1;
  --teal-text: #0F6B62;
  --mist: #F3F5F8;
  --paper: #FFFFFF;
  --ink: #233145;
  --ink-muted: #5C6878;
  --ink-quiet: #6B7686;
  --link: #1F6585;
  --on-dark: #EEF3F8;
  --on-dark-muted: #A9B5C4;
  --border: #E2E7EE;
  --border-strong: #D5DCE5;
  --line-soft: #EEF1F5;
  --hover: #F2F6FA;
  --late: #B3261E;
  --late-wash: #FDE8E6;
  --late-text: #8A1C12;
  --shadow-tip: 0 6px 16px rgba(20, 30, 45, 0.22);
  --sans: 'Plex', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--sans); color: var(--ink); background: var(--mist); }
a { color: var(--link); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
.display { font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; }
.muted { color: var(--ink-muted); }
.small { font-size: 13px; }
.block { display: block; }
.gap-top { margin-top: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; stroke: none; }

/* Hover tips: any element with data-tip shows it above itself. */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: var(--navy); color: var(--on-dark);
  font: 500 13px/1.3 var(--sans); pointer-events: none; z-index: 30; box-shadow: var(--shadow-tip);
}

/* ---- shell ---- */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side {
  flex: 1 1 220px; max-width: 248px; padding: 28px 16px; display: flex; flex-direction: column; gap: 28px;
  background: var(--navy); color: var(--on-dark);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--on-dark); text-decoration: none; font: 600 24px/1 var(--sans); letter-spacing: -0.01em; }
.brand:hover { color: var(--on-dark); }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--on-dark); text-decoration: none; }
.nav a:hover { background: rgba(255,255,255,0.07); color: var(--on-dark); }
.nav a[aria-current] { background: var(--navy-hover); color: var(--sky); font-weight: 600; }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--blue); color: #FFFFFF; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 0 4px 0 8px; }
.me form { margin-left: auto; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 18px; background: var(--blue); color: #FFFFFF; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.me-name { font-size: 14px; line-height: 1.3; }
.me-name small { display: block; color: var(--on-dark-muted); font-size: 12px; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn.on-dark:hover { background: rgba(255,255,255,0.09); }
.main { flex: 999 1 560px; min-width: 0; max-width: 1280px; padding: 32px 40px 64px; }

@media (min-width: 901px) {
  .side { position: sticky; top: 0; height: 100vh; }
}
@media (max-width: 900px) {
  .side { flex-basis: 100%; max-width: none; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .me { margin: 0 0 0 auto; }
  .me-name { display: none; }
  .main { padding: 20px 16px 48px; }
}

/* ---- page parts ---- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 24px; }
.ph-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.page-head h1 { font-size: 40px; line-height: 1.1; }
.ph-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; text-decoration: none; }
.crumb .ic { width: 16px; height: 16px; }
.approved { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-size: 14px; font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--paper); color: var(--ink); font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--blue); color: var(--ink); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: var(--on-dark); }
.btn.primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); color: var(--on-dark); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }

.panel { background: var(--paper); border: 1px solid var(--border); border-radius: 12px; padding: 24px; min-width: 0; }
.panel-title { font: 600 16px/1.3 var(--sans); margin: 0 0 12px; }
.panel-big { font-size: 26px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.panel-head .panel-title { margin: 0; }
.panel-head a { font-size: 14px; }
.empty { color: var(--ink-muted); padding: 8px 0; list-style: none; }

.flashes { margin: 0 0 16px; }
.flash { padding: 10px 14px; border-radius: 10px; margin: 0 0 8px; font-size: 15px; }
.flash-good { background: #E2F3EA; color: #14603F; }
.flash-warn { background: #FFF2D9; color: #7A4A00; }

.demo-note { background: var(--blue-wash); color: #1D4E66; padding: 10px 14px; border-radius: 10px; font-size: 14px; margin: 0 0 16px; }
.notice { display: flex; align-items: center; gap: 10px; background: var(--blue-wash); color: #1D4E66; padding: 12px 16px; border-radius: 12px; margin: 0 0 24px; }

/* ---- home ---- */
.home-grid, .meeting-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 1100px) { .home-grid, .meeting-grid { grid-template-columns: minmax(0, 1fr); } }
.meeting-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.meeting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; margin: 0 -16px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.meeting-row:hover { background: var(--hover); color: var(--ink); }
.mr-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mr-title { font-weight: 600; }
.mr-meta { font-size: 14px; color: var(--ink-muted); }
.mr-counts { font-size: 13px; color: var(--blue-text); }
.stage { flex: none; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--blue-wash); color: var(--blue-text); }
.stage-ready { background: var(--teal-wash); color: var(--teal-text); }
.stage-failed, .stage-recording { background: var(--late-wash); color: var(--late-text); }
.overdue-line { display: flex; align-items: center; gap: 6px; color: var(--late); font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.overdue-line .ic { width: 16px; height: 16px; }
.action-list, .decision-list, .done-list { list-style: none; margin: 0; padding: 0; }
.action-list li, .decision-list li { padding: 10px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.action-list li:first-child, .decision-list li:first-child { border-top: 0; padding-top: 0; }
.action-list .is-overdue .small { color: var(--late); }

/* ---- player ---- */
.player { display: flex; align-items: center; gap: 18px; padding: 16px 20px; border-radius: 12px; background: var(--paper); border: 1px solid var(--border); margin: 0 0 12px; }
.play { flex: none; width: 48px; height: 48px; border-radius: 24px; border: 0; background: var(--blue); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.play:hover { background: var(--blue-text); }
.play .ic { width: 18px; height: 18px; }
.play .i-pause, .play.is-playing .i-play { display: none; }
.play.is-playing .i-pause { display: block; }
.wave { flex: 1; min-width: 0; height: 56px; display: block; cursor: pointer; }
.wave rect { fill: var(--blue-line); }
.wave rect.on { fill: var(--blue); }
.wave .mk { stroke: var(--blue-text); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pos { flex: none; font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.marks-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 24px; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; margin: -8px 0 24px; }
.photos img { display: block; width: 120px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.log-box { background: var(--paper); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin: 0 0 24px; font-size: 15px; }
.log-box summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.log-box ul { margin: 8px 0 0; padding-left: 22px; }
.log-box li { margin: 4px 0; }

.time { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 15px; border: 1px solid var(--border-strong); background: var(--paper); color: var(--link); font: 500 13px/1 var(--sans); font-variant-numeric: tabular-nums; text-decoration: none; cursor: pointer; flex: none; white-space: nowrap; }
.time .ic { width: 12px; height: 12px; }
.time.mark .ic { width: 14px; height: 14px; }
.time:hover { border-color: var(--blue); background: var(--blue-wash); color: var(--ink); }

/* ---- minutes ---- */
.overview { font-size: 17px; line-height: 1.6; max-width: 70ch; }
.minutes h3 { font: 600 15px/1.3 var(--sans); margin: 24px 0 10px; }
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: flex-start; gap: 12px; }
.item-text { flex: 1; min-width: 0; font-size: 15px; line-height: 1.45; padding-top: 3px; }
.log .item { padding: 12px 0; border-top: 1px solid var(--border); }
.log .item:first-child { border-top: 0; padding-top: 0; }
.chip { flex: none; width: 84px; text-align: center; padding: 3px 0; border-radius: 8px; font-size: 12px; font-weight: 600; border: 1.5px solid transparent; margin-top: 2px; }
.chip-agreed { background: var(--teal); border-color: var(--teal); color: #FFFFFF; }
.chip-proposed { border-color: var(--blue); color: var(--blue-text); background: var(--paper); }
.chip-open { border-color: #98A2B0; color: #445163; background: var(--paper); }
.chip-rejected { background: var(--line-soft); border-color: var(--line-soft); color: #445163; }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { width: 48px; padding-left: 0; }
.table .quiet { color: var(--ink-quiet); }
.table .when { white-space: nowrap; }
.table tr.is-done td:nth-child(3) { text-decoration: line-through; color: var(--ink-muted); }
.tag-overdue { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--late); }
.from { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.from span { font-size: 14px; color: var(--ink-muted); }
/* On a phone each table row stacks: the tick, then who, what, when and where it came from. */
@media (max-width: 700px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody { display: block; }
  .table tr { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: block; padding: 2px 0; border: 0; grid-column: 2; }
  .table td:first-child { grid-column: 1; grid-row: 1 / span 4; width: auto; }
  .table td:nth-child(2) { font-weight: 600; }
  .table .when { white-space: normal; font-size: 14px; color: var(--ink-muted); }
  .from { justify-content: flex-start; flex-wrap: wrap; }
}
.tick { width: 32px; height: 32px; border-radius: 16px; border: 2px solid var(--blue); background: var(--paper); color: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tick .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.tick:hover { color: var(--blue); }
.tick.on { background: var(--teal); border-color: var(--teal); color: #FFFFFF; }
.done-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; }

/* ---- transcript ---- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-muted); margin: 0 0 12px; }
.field input { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--paper); color: var(--ink); font: 15px var(--sans); }
.rename { margin: 0 0 16px; }
.rename summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--link); list-style: none; }
.rename summary::-webkit-details-marker { display: none; }
.rename summary .ic { width: 16px; height: 16px; }
.rename-form { padding-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.rename-form .btn { align-self: flex-start; margin-top: 8px; }
.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 680px; overflow-y: auto; }
.line { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px 10px; border-radius: 10px; scroll-margin: 24px; }
.line[hidden] { display: none; }
.line p { font-size: 15px; line-height: 1.5; padding-top: 4px; }
.line.is-current { background: var(--blue-wash); }
.who { font-weight: 700; margin-right: 4px; }
.who-0 { color: var(--navy); }
.who-1 { color: var(--teal); }
.who-2 { color: var(--blue-text); }
.who-3 { color: #6B55B5; }
.who-4 { color: #9A5B00; }

/* ---- actions page ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.pill { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--border-strong); background: var(--paper); color: var(--ink); text-decoration: none; font-size: 14px; }
.pill:hover { border-color: var(--blue); color: var(--ink); }
.pill[aria-current] { background: var(--navy); border-color: var(--navy); color: var(--on-dark); }

/* ---- sign in ---- */
body.landing { background: var(--navy); }
.signin-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin { width: min(420px, 100%); background: var(--mist); border-radius: 16px; padding: 32px; box-shadow: 0 30px 60px rgba(10, 16, 26, 0.35); display: flex; flex-direction: column; gap: 16px; }
.signin-brand { display: flex; align-items: center; gap: 12px; font: 600 28px/1 var(--sans); letter-spacing: -0.01em; }
.signin h1 { font-size: 32px; line-height: 1.15; }
.lede { color: var(--ink-muted); }
.form { display: flex; flex-direction: column; gap: 4px; }
.form .btn { margin-top: 8px; }
.code-in { width: 100%; height: 56px; border-radius: 12px; border: 1px solid var(--border-strong); color: var(--ink); font: 600 28px var(--sans); letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--ink-muted); font-size: 14px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }
.qr { align-self: center; }
.key { font-size: 16px; letter-spacing: 0.1em; background: var(--paper); border: 1px solid var(--border); padding: 10px; border-radius: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.codes { columns: 2; margin: 0; padding-left: 20px; font-variant-numeric: tabular-nums; }
.small-print { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-muted); }
.small-print .ic { width: 16px; height: 16px; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
