/* Innovers Board: the Innovers Workbench look (white surfaces, logo purple, Comfortaa, 24 px cards). No inline styles anywhere (strict CSP).
   AA: #c340cc (accent) is 4.26:1 on white, so it is used only for borders, bars, focus rings and large text;
   links, small text and white-on-colour buttons use the logo purple #5a2b5f (10.8:1 on white). */
@font-face { font-family: "Comfortaa"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(/public/fonts/comfortaa-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Comfortaa"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(/public/fonts/comfortaa-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --plum: #4a2350; --brand: #5a2b5f; --brand-hover: #4a2350; --accent: #c340cc; --soft: #f3eaf8; --brand-tint: #f3eaf8; --brand-line: #dccbe4;
  --bg: #fcfafd; --white: #fff; --surface-2: #faf6fc; --line: #e6dcec; --line-soft: #f0e9f4;
  --text: #1f2329; --text-2: #44494f; --muted: #6b7280; --faint: #8a9099;
  --font: "Comfortaa", "Segoe UI", "Segoe UI Variable Text", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Segoe UI Arabic", Tahoma, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  --r: 10px; --r-lg: 14px; --r-card: 24px;
  --shadow-1: 0 1px 2px rgba(16,24,40,.06);
  --ok: #1a7f37; --okbg: #e9f5ec; --okln: #b7dfc2;
  --warn: #9a6700; --warnbg: #fdf5e0; --warnln: #f0d9a0;
  --bad: #b42318; --badbg: #fdecea; --badln: #f5c2bd;
  --grey: #57606a; --greybg: #eef0f3; --greyln: #d5d9df;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--brand); }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: var(--mono); font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.block { display: block; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* Top bar: white, like the Workbench */
.bar { background: var(--white); color: var(--text); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px rgba(90,43,95,.06); }
.bar .row1 { display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 16px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--brand); text-decoration: none; white-space: nowrap; }
.brand img, .formlogo img { height: 40px; width: auto; display: block; }
.formlogo { text-align: center; margin: 4px 0 22px; }
.formlogo img { margin: 0 auto; }
.brand .prod { font-size: 14px; font-weight: 700; padding-left: 12px; border-left: 1px solid var(--line); color: var(--text-2); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.me { display: flex; align-items: center; gap: 9px; white-space: nowrap; font-size: 13px; min-width: 0; }
.me .nm { line-height: 1.2; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.me .nm small { display: block; font-size: 11px; color: var(--muted); }
button.ghost { border: 1px solid var(--brand-line); background: transparent; color: var(--brand); border-radius: 999px; padding: 5px 12px; font-size: 13px; white-space: nowrap; }
button.ghost:hover { background: var(--soft); }

/* Layout */
.wrap { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 53px); }
.side { border-right: 1px solid var(--line); background: var(--white); padding: 12px 10px 24px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r); text-decoration: none; color: var(--text-2); margin-bottom: 1px; font-size: 13.5px; position: relative; }
.side a:hover { background: var(--surface-2); color: var(--text); }
.side a.on { background: var(--brand-tint); color: var(--brand); font-weight: 600; }
.side a.on::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side a .lb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side h4 { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin: 18px 10px 6px; }
main { padding: 18px 28px 64px; min-width: 0; max-width: 1440px; }
main.narrow { max-width: 520px; margin: 0 auto; padding: 28px 16px 64px; }
.sq { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--faint); }
.sq.implementation { background: #77387e; } .sq.support { background: #0b5cad; } .sq.register { background: #9a6700; } .sq.internal { background: #57606a; }

/* Page header */
.crumbs { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--muted); }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
h1 { color: var(--text); font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0; line-height: 1.25; overflow-wrap: anywhere; }
p.sub { color: var(--muted); margin: 4px 0 0; }

/* Tiles and cards */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.tile { display: block; text-decoration: none; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px; box-shadow: var(--shadow-1); }
.tile span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.tile b { display: block; font-size: 26px; font-weight: 600; color: var(--text); margin-top: 4px; line-height: 1.2; }
.tile small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tile.acc { border-top: 3px solid var(--accent); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-1); overflow: hidden; }
.card.spaced, .grid2 + .card { margin-top: 16px; }
.card > h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--brand); padding: 14px 20px; background: var(--soft); border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card > h3 .cnt { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--greybg); border-radius: 10px; padding: 0 8px; }
.card > p, .cb { padding: 12px 16px; margin: 0; }
.empty { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 4px; padding: 1px 8px; white-space: nowrap; border: 1px solid; line-height: 18px; }
.pill.ok { background: var(--okbg); color: var(--ok); border-color: var(--okln); }
.pill.warn { background: var(--warnbg); color: var(--warn); border-color: var(--warnln); }
.pill.grey { background: var(--greybg); color: var(--grey); border-color: var(--greyln); }

/* Tables live in scroll wrappers so nothing overflows the page */
.tw { overflow-x: auto; max-width: 100%; position: relative; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.acts { white-space: nowrap; }
td.acts form + form { margin-left: 6px; }

/* Forms */
.form { padding: 14px 16px; display: grid; gap: 12px; }
.form.row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.form.row .note, .form.row input[type=hidden] { grid-column: 1 / -1; }
.field { display: grid; gap: 4px; }
.field span { font-weight: 600; font-size: 13px; }
.field small { color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=password], select { width: 100%; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; background: var(--white); min-width: 0; }
form.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
form.inline select { width: auto; max-width: 220px; }
button, .button { border: 1px solid var(--line); background: var(--white); border-radius: var(--r); padding: 7px 12px; text-decoration: none; color: var(--text); display: inline-block; }
button:hover, .button:hover { background: var(--surface-2); }
button.primary, .button.primary { background: var(--brand); border-color: var(--brand); color: var(--white); font-weight: 700; }
button.primary:hover, .button.primary:hover { background: var(--brand-hover); }
button.danger { color: var(--bad); border-color: var(--badln); }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.note { border: 1px solid; border-radius: var(--r); padding: 8px 12px; margin: 0 0 12px; }
.note.ok { background: var(--okbg); color: var(--ok); border-color: var(--okln); }
.note.bad { background: var(--badbg); color: var(--bad); border-color: var(--badln); }
.form .note { margin: 0; }
fieldset.ticks { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; margin: 0; min-width: 0; }
fieldset.ticks legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.tick { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr); gap: 4px 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.tick:last-child { border-bottom: 0; }
.tick .lead { color: var(--muted); font-size: 13px; }
.qr { text-align: center; }
.qr img { border: 1px solid var(--line); border-radius: var(--r); max-width: 100%; height: auto; }
code.secret { overflow-wrap: anywhere; }
.codes { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.codes code { display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; text-align: center; font-size: 15px; }
.steps { list-style: none; padding: 0; margin: 0 0 14px; display: flex; gap: 6px; flex-wrap: wrap; counter-reset: s; }
.steps li { counter-increment: s; font-size: 12.5px; color: var(--muted); background: var(--greybg); border-radius: 10px; padding: 2px 10px; }
.steps li::before { content: counter(s) ". "; }
.steps li.on { background: var(--brand-tint); color: var(--brand); font-weight: 600; }
ul.log { list-style: none; margin: 0; padding: 8px 16px 12px; }
ul.log li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
ul.log li:last-child { border-bottom: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--accent); font-weight: 600; }

/* Phone: the left menu becomes a top menu */
@media (max-width: 760px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 6px 8px; display: flex; gap: 2px; overflow-x: auto; }
  .side h4 { display: none; }
  .side a { flex: none; margin: 0; padding: 6px 10px; }
  .side a.on::before { display: none; }
  main { padding: 14px 14px 48px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .brand .prod { display: none; }
  .me .nm small { display: none; }
  .tick { grid-template-columns: auto minmax(0, 1fr); }
  .tick .lead { grid-column: 2; }
}

/* Part 2: tasks, board, team (phone first) */
.pill.st.proposed { background: var(--brand-tint); color: var(--brand); border-color: var(--brand-line); }
.pill.st.todo, .pill.st.rejected, .pill.st.closed { background: var(--greybg); color: var(--grey); border-color: var(--greyln); }
.pill.st.in_progress, .pill.st.in_review { background: var(--warnbg); color: var(--warn); border-color: var(--warnln); }
.pill.st.done { background: var(--okbg); color: var(--ok); border-color: var(--okln); }
.pill.rm.behind { background: var(--badbg); color: var(--bad); border-color: var(--badln); }
.pill.rm.due_today { background: var(--warnbg); color: var(--warn); border-color: var(--warnln); }
.note.warn { background: var(--warnbg); color: var(--warn); border-color: var(--warnln); margin: 0 16px 12px; }
.note.grey { background: var(--greybg); color: var(--grey); border-color: var(--greyln); margin: 0 16px 12px; }
.ctext { white-space: pre-wrap; overflow-wrap: anywhere; }
.card > .ctext { padding: 0 16px 12px; }
.bar2 { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; margin: 0 0 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
.check { display: flex; gap: 8px; align-items: center; }
.grp { margin: 0; padding: 10px 16px 4px; font-size: 13px; }
.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.board .col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px; min-width: 0; }
.board .col h3 { margin: 2px 4px 8px; font-size: 13px; display: flex; justify-content: space-between; }
.board .empty { margin: 4px; font-size: 12.5px; }
.tcard { display: grid; gap: 3px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; margin-bottom: 6px; text-decoration: none; color: var(--text); overflow-wrap: anywhere; }
.tcard small { color: var(--muted); font-size: 12px; }
.tcard .pill { justify-self: start; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; padding: 12px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
h4.sub { margin: 0; padding: 4px 16px; font-size: 13px; }
.checks { margin: 0; padding: 0 16px 12px 34px; }
.acts { padding: 12px 16px; display: grid; gap: 10px; }
.form.act { padding: 0; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
textarea { font: inherit; width: 100%; box-sizing: border-box; }
ul.log.comments, ul.log.history, ul.log.work, ul.log.waiting, ul.log.reminders { overflow-wrap: anywhere; }
.teams { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.teams .card { margin: 0; }
.members { list-style: none; margin: 0 0 10px; padding: 0; }
.members li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.form.add { padding: 0; grid-template-columns: minmax(0, 1fr) auto; }
.cb .lead { margin: 0 0 6px; }
details.cb summary { cursor: pointer; font-weight: 600; }
@media (min-width: 761px) {
  .board { grid-template-columns: repeat(7, minmax(190px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
  .teams { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
input[type=date], input[type=time], input[type=number], textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; background: var(--white); min-width: 0; box-sizing: border-box; }
/* Part 3: set-up milestones, the Plan tab, the plan form, versions, track and general views. */
fieldset.milestones, fieldset.prow { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; margin: 0; min-width: 0; display: grid; gap: 10px; }
fieldset.milestones legend, fieldset.prow legend { font-weight: 600; font-size: 13px; padding: 0 4px; overflow-wrap: anywhere; }
fieldset.milestones p { margin: 0; font-size: 13px; }
.msrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.bar2 { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 12px; }
.bar2 p { margin: 0; }
.btnrow { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
ul.plan { list-style: none; margin: 0; padding: 8px 16px 12px; }
ul.plan > li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); display: grid; gap: 4px; min-width: 0; }
ul.plan > li:last-child { border-bottom: 0; }
.pl { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; overflow-wrap: anywhere; min-width: 0; }
.pbar { display: block; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.pbar > span { display: block; height: 100%; background: var(--brand); border-radius: 4px; min-width: 4px; }
.pbar.phase > span { background: var(--muted); }
.pbar.mile > span { background: var(--accent); }
.ms { color: var(--brand); }
.prog { font-size: 12.5px; color: var(--muted); }
.amt { font-weight: 600; white-space: nowrap; }
ul.linked { margin: 0; padding-left: 18px; font-size: 13px; }
ul.changes { margin: 4px 0 0; padding-left: 18px; overflow-wrap: anywhere; }
.crumbs { margin: 0 0 10px; }
.tw { overflow-x: auto; max-width: 100%; }
.planform { display: grid; gap: 12px; }
/* The general view has many count columns: narrower cells and wrapping headers so it fits a laptop without scrolling. */
table.overview th, table.overview td { padding: 9px 8px; }
table.overview th { white-space: normal; }
table.overview td:first-child { min-width: 140px; }

/* Part 4: notifications, profile and the Workbench board */
.bell { position: relative; display: inline-flex; align-items: center; color: inherit; padding: 6px; border-radius: var(--r); }
.bell .badge { position: absolute; top: -2px; right: -4px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
a.me { color: inherit; text-decoration: none; }
a.me:hover .nm, a.me:focus .nm { text-decoration: underline; }
ul.log.notes li { overflow-wrap: anywhere; }
ul.log.notes li.unread button { font-weight: 700; }
button.linkish { background: none; border: 0; padding: 0; color: var(--brand); text-align: left; font: inherit; cursor: pointer; text-decoration: underline; overflow-wrap: anywhere; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.pager { padding: 0 16px; }
.card > form.inline, .card > p { margin-left: 16px; margin-right: 16px; }
table.prefs td, table.prefs th { vertical-align: middle; }
.sw { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.sw input { width: 20px; height: 20px; }
.wbgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.wbreq { padding: 0 0 12px; overflow-wrap: anywhere; }
.wbreq > p, .wbreq > ul { margin: 0 16px 8px; }
.wbreq ul.points { padding-left: 20px; }
.updated { margin: 0 0 12px; }
@media (max-width: 760px) {
  .wbgrid { grid-template-columns: minmax(0, 1fr); }
}

/* Part 4 after Yahya's test: show or hide a password, Remember me */
.field .pw { position: relative; display: block; font-weight: 400; font-size: 14px; }
.pw input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 34px; padding: 0; border: 0; border-radius: var(--r); background: transparent; color: var(--brand); }
.pw-toggle:hover { background: var(--soft); }
.pw-toggle[aria-pressed="true"] { color: var(--accent); background: var(--soft); }
.check.remember { font-size: 13.5px; }
.check.remember input { width: 18px; height: 18px; accent-color: var(--brand); }
.card + .grid2 { margin-top: 16px; }
/* AA: form fields need a 3:1 edge; small counts and step labels need 4.5:1 text. */
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], select, textarea { border-color: #8a7590; }
.card > h3 .cnt { background: var(--white); }
.steps li { color: var(--text-2); }

/* Calendar (item 6): a Sunday-first month grid; a day-by-day list on a phone. */
.calnav { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.calnav h2 { margin: 0; font-size: 1.1rem; }
.cal { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { font-weight: 700; text-align: center; font-size: .85rem; }
.cal .day { min-height: 84px; border: 1px solid var(--line, #ddd); border-radius: 8px; padding: 4px; overflow-wrap: anywhere; font-size: .85rem; }
.cal .day.out { opacity: .6; }
.cal .day ul { list-style: none; margin: 4px 0 0; padding: 0; }
.cal .day li { margin-bottom: 4px; }
.cal time { font-weight: 700; }
@media (max-width: 700px) {
  .cal { display: block; }
  .cal .dow, .cal .day.none, .cal .day.out { display: none; }
  .cal .day { min-height: 0; margin-bottom: 6px; }
}

/* Yahya's 20 Nov review: board swimlanes by track, role checkboxes */
.lane { margin-top: 14px; }
.lane .grp { margin: 0 0 8px; }
fieldset.roles { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0; min-width: 0; }
fieldset.roles legend { font-weight: 700; padding: 0 4px; }
fieldset.roles .check { display: inline-flex; margin: 4px 12px 4px 0; }
.roleform details { margin-top: 6px; }

/* Settings, People on a phone: one stacked card per person (name, email, roles, status), the Change roles form below
   the card's facts rather than inside a table cell. The table stays as it is from 761 px. */
@media (max-width: 760px) {
  table.people, table.people tbody { display: block; }
  table.people thead { display: none; }
  table.people tr { display: flex; flex-direction: column; gap: 4px; margin: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white); }
  table.people td { display: block; padding: 0; border: 0; overflow-wrap: anywhere; }
  table.people td.nm { font-weight: 700; color: var(--brand); order: 1; }
  table.people td.em { order: 2; color: var(--text-2); }
  table.people td.rolecell { display: contents; }
  table.people .rl { order: 3; }
  table.people td:nth-child(4) { order: 4; }
  table.people td:nth-child(5) { order: 5; }
  table.people td.acts { order: 6; white-space: normal; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
  table.people td.acts form + form { margin-left: 0; }
  table.people .roleform { order: 7; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
  table.people .rl::before, table.people td:nth-child(4)::before, table.people td:nth-child(5)::before { color: var(--muted); font-size: 12.5px; }
  table.people .rl::before { content: "Roles: "; }
  table.people td:nth-child(4)::before { content: "Status: "; }
  table.people td:nth-child(5)::before { content: "Spaces: "; }
}

/* Version 2, part 1: agents. The roster and the control room directory are tables from 761 px and one stacked card
   per agent on a phone (labels from data-label), so 375 px has no sideways scrolling. */
.tablewrap { overflow-x: auto; max-width: 100%; }
table.roster td { overflow-wrap: anywhere; }
.pill.ag.live { background: var(--okbg); color: var(--ok); border-color: var(--okln); }
.pill.ag.pilot { background: var(--warnbg); color: var(--warn); border-color: var(--warnln); }
.pill.ag.paused { background: var(--greybg); color: var(--grey); border-color: var(--greyln); }
.pill.st.needs { background: var(--warnbg); color: var(--warn); border-color: var(--warnln); }
.aglink { margin-right: 8px; }
.needs-approval { border-color: var(--warnln); }
.needs-approval .draft { padding: 12px 16px; margin: 12px 16px; background: var(--surface-2); border-radius: var(--r-lg); white-space: pre-wrap; }
.needs-approval > p.muted { padding: 0 16px; }
li.agent-post > b { color: var(--accent); }
.card.today form.inline { display: block; padding: 0 16px 14px; }
.today-list { padding-left: 34px; }
code.token { overflow-wrap: anywhere; word-break: break-all; display: block; padding: 10px; background: var(--surface-2); border-radius: var(--r-lg); }
fieldset.field .check { display: inline-flex; margin: 4px 12px 4px 0; }
@media (max-width: 760px) {
  table.roster, table.roster tbody { display: block; }
  table.roster thead { display: none; }
  table.roster tr { display: flex; flex-direction: column; gap: 4px; margin: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white); }
  table.roster td { display: block; padding: 0; border: 0; }
  table.roster td::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12.5px; }
  table.roster td:first-child::before { content: none; }
}
