:root {
  --bg: #f6f5f1; --surface: #ffffff; --ink: #1d2327; --muted: #6b7378; --line: #e2e0d8;
  --accent: #1f6f5c; --accent-ink: #ffffff; --warn: #a15c00; --err: #b3261e; --user: #e8f1ee; --event: #f1efe8;
  color-scheme: light;
}
/* dark: the system's choice, unless the user chose (Account, Appearance: html[data-theme]) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181a; --surface: #1d2124; --ink: #e7e9ea; --muted: #9aa3a8; --line: #2c3236;
    --accent: #4fb69a; --accent-ink: #0d1412; --warn: #e0a24a; --err: #ff8a80; --user: #1f2e2a; --event: #23282b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15181a; --surface: #1d2124; --ink: #e7e9ea; --muted: #9aa3a8; --line: #2c3236;
  --accent: #4fb69a; --accent-ink: #0d1412; --warn: #e0a24a; --err: #ff8a80; --user: #1f2e2a; --event: #23282b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.ghost { background: transparent; }
button.danger { background: transparent; color: var(--err); border-color: var(--err); }
.other-ways { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.other-ways:not(:has(button:not([hidden]))) { display: none; }
.captcha { margin: 10px 0; min-height: 65px; }
.invite input { flex: 1; min-width: 0; }
button.link { display: block; border: none; background: none; color: var(--accent); padding: 8px 0 0; }
.notice { color: var(--accent); }
.verify { margin: 12px 16px 0; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 10px; background: var(--user); }
.verify p { margin: 0 0 8px; }
.verify.warn { border-color: var(--warn); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.verify.warn p { margin: 0; flex: 1 1 16em; }
#credits.low { color: var(--warn); font-weight: 600; }
#project-credits { font-size: 13px; }
.verify-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.verify-row input { width: 9em; letter-spacing: 2px; }
button.wide { width: 100%; }
button.small { padding: 4px 10px; font-size: 13px; }
.panel-body td button { white-space: nowrap; }
.row { display: flex; gap: 8px; align-items: flex-end; }
.row label { flex: 1; margin: 6px 0; }
.row button { margin-bottom: 6px; }
.panel-body img.qr { width: 190px; display: block; margin: 6px 0 10px; border-radius: 4px; }
code.key { font: 14px/1.4 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; overflow-wrap: anywhere; }
ol.codes { columns: 2; font: 14px/1.7 ui-monospace, Menlo, Consolas, monospace; padding-left: 2em; }
button:disabled { opacity: .5; cursor: default; }
input, textarea { font: inherit; width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
textarea:disabled { cursor: not-allowed; opacity: .7; }
label { display: block; margin: 10px 0; color: var(--muted); font-size: 13px; }
label input, label textarea { margin-top: 4px; color: var(--ink); font-size: 15px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
label.check input { width: auto; margin: 0; }
.consent { font-size: 13px; color: var(--muted); margin: 12px 0; }
.ready { border: 1px solid var(--accent); border-radius: 10px; background: var(--user); padding: 10px 12px; margin-bottom: 12px; }
.ready p { margin: 0 0 4px; font-weight: 600; }
.pw { position: relative; display: block; margin-top: 4px; }
.pw input { margin-top: 0; padding-right: 64px; }
.pw .reveal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: none; background: none;
  color: var(--accent); padding: 4px 8px; font-size: 13px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -.02em;
  color: var(--accent); font-size: 40px; margin: 0; }
.logo img { display: block; }
.logo.small { display: inline-flex; gap: 8px; font-size: 20px; }
.muted { color: var(--muted); }
.error { color: var(--err); min-height: 1.5em; }
.auth { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.tagline { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.tab { border: none; background: transparent; color: var(--muted); padding: 6px 10px; }
.tab.active { color: var(--ink); background: var(--event); }
.layout { display: grid; height: 100vh; grid-template-columns: var(--left, 240px) minmax(0, 1fr) minmax(0, var(--right, 460px));
  grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top top" "projects chat panel"; position: relative; }
/* the lines between the columns, dragged to widen one (rirti's app.js: columns) */
.splitter { grid-row: 2 / 3; grid-column: 2 / 3; position: absolute; top: 0; bottom: 0; width: 10px; z-index: 5; cursor: col-resize; touch-action: none; }
#split-left { left: -5px; }
#split-right { right: -5px; }
.splitter::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
.splitter:hover::after, .splitter:focus-visible::after, .splitter.dragging::after { background: var(--accent); }
.splitter:focus-visible { outline: none; }
.layout.resizing { cursor: col-resize; user-select: none; }
.layout.resizing .chat, .layout.resizing .panel, .layout.resizing .projects { pointer-events: none; }
.layout.in-account #split-right { display: none; }
.top { grid-area: top; display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.spacer { flex: 1; }
.projects { grid-area: projects; padding: 12px; border-right: 1px solid var(--line); overflow: auto; }
.projects ul { list-style: none; padding: 0; margin: 12px 0 0; }
.projects li button { width: 100%; text-align: left; border: none; background: transparent; padding: 8px; }
.projects li button.active { background: var(--event); }
.projects .sub { display: block; font-size: 12px; color: var(--muted); }
.projects input[type="search"] { width: 100%; margin-top: 10px; }
.projects .link { font-size: 13px; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: var(--event); }
.menu .items { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 13em; display: flex;
  flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 6px 20px rgb(0 0 0 / .18); }
.menu .items button { border: none; background: transparent; text-align: left; padding: 8px 10px; }
.menu .items button:hover { background: var(--event); }
.menu .items button.danger { color: var(--err); }
.prefs textarea, .prefs input[type="text"], .support textarea { width: 100%; }
.board-info { margin-top: 18px; }
.checks label { display: flex; gap: 8px; align-items: baseline; margin: 6px 0; color: var(--ink); font-size: 14px; }
.checks input[type="checkbox"] { width: auto; flex: none; margin: 0; }
.shared a { color: var(--accent); }
.chat { grid-area: chat; display: flex; flex-direction: column; min-height: 0; container: chat / inline-size; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--event); color: var(--muted); }
.messages { flex: 1; overflow: auto; list-style: none; margin: 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 760px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.msg .who { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; font-size: 12px;
  line-height: 1.5; color: var(--muted); margin-bottom: 2px; }  /* one row: who at the left, when in the middle, copy */
.msg .who .when { font-variant-numeric: tabular-nums; white-space: nowrap; }
.msg .copy { justify-self: end; padding: 2px; border: none; background: none; color: var(--muted); line-height: 0; }
.msg .copy:hover, .msg .copy:focus-visible { color: var(--ink); }
.msg .copy .icon { width: 14px; height: 14px; }
@media (hover: hover) {  /* a mouse: shown on the message it points at; a touch screen: always */
  .msg .copy { opacity: 0; }
  .msg:hover .copy, .msg .copy:focus-visible { opacity: 1; }
}
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--user); }
.msg.event { background: var(--event); border-style: dashed; font-size: 14px; }
.msg.working .text { display: flex; align-items: center; gap: 8px; }
.msg.working .text > span:nth-child(2) { flex: 1; min-width: 0; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: thinking 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
button .dots i { width: 5px; height: 5px; background: currentColor; }  /* a step starting, on its button */
@keyframes thinking { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .7; } }
.elapsed { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.stop-work { flex: none; padding: 2px 10px; font-size: 13px; }
.way { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.way[hidden] { display: none; }
.way progress { display: block; width: 100%; height: 6px; margin: 0 0 4px; accent-color: var(--accent); }
.way-text { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bars { display: grid; grid-template-columns: minmax(0, max-content) minmax(48px, 1fr) auto; gap: 2px 8px;
  align-items: center; margin: 6px 0 0; }
.bars:empty { display: none; }
.bars .bar { display: contents; }
.bars progress { -webkit-appearance: none; appearance: none; height: 5px; margin: 0; border: 0; border-radius: 3px;
  background: var(--line); overflow: hidden; }
.bars progress::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
.bars progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
.bars progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
.bar-label { overflow-wrap: anywhere; }
.bar-count { font-variant-numeric: tabular-nums; text-align: right; }
.bars-left { margin: 4px 0 0; overflow-wrap: anywhere; }
.bars-left[hidden] { display: none; }
.steps { list-style: none; margin: 8px 0 0; padding: 0 4px 0 0; font-size: 13px; color: var(--muted);
  max-height: 11.5em; overflow-y: auto; scrollbar-gutter: stable; }
.steps:empty { display: none; }
.steps li { padding: 1px 0; overflow-wrap: anywhere; }
.steps li::before { content: "✓"; display: inline-block; width: 1.3em; color: var(--accent); }
.step-now { margin: 6px 0 0; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.step-now::before { content: "●"; display: inline-block; width: 1.3em; color: var(--accent); animation: thinking 1.2s infinite ease-in-out; }
@media (prefers-reduced-motion: reduce) { .step-now::before { animation: none; } }
.composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.resume { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 16px; font-size: 14px;
  border-top: 1px solid var(--line); background: var(--event); }
.resume[hidden] { display: none; }
.resume span { flex: 1; min-width: 12em; }
.composer button { align-self: flex-end; }
.composer-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.composer-actions { display: flex; flex-direction: column; gap: 6px; justify-content: flex-end; }
.composer-files { display: flex; flex-wrap: wrap; gap: 6px; }
.composer-files .file { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 4px 2px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.composer-files .file button { border: none; background: none; padding: 0 6px; color: var(--muted); }
.composer-count { font-size: 12px; align-self: flex-end; }
.composer.dropping { outline: 2px dashed var(--accent); outline-offset: -4px; }
.msg .files { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.msg .files a { color: var(--accent); }
.caveat { margin: 0; padding: 0 16px 8px; font-size: 11px; line-height: 1.4; color: var(--muted); text-align: center; }
.panel { grid-area: panel; border-left: 1px solid var(--line); padding: 12px; overflow: auto; background: var(--surface); container: panel / inline-size; }
.panel-body h3 { font-size: 15px; margin: 14px 0 6px; }
.notes { font-size: 14px; line-height: 1.45; overflow-wrap: break-word; }  /* an engineer's notes, a point a line */
.notes ul { margin: 0 0 10px; padding-left: 18px; }
.notes li { margin: 5px 0; }
.notes li ul { margin: 3px 0 0; }
.notes li li { margin: 2px 0; }
.notes h4 { font-size: 13px; margin: 12px 0 4px; color: var(--ink); }
.notes b { color: var(--ink); font-weight: 600; }
.table-wrap { max-width: 100%; overflow-x: auto; }  /* a table too wide for its column scrolls, its words whole */
.panel-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.panel-body th, .panel-body td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
.panel-body th, .panel-body td:first-child, .panel-body td a { white-space: nowrap; overflow-wrap: normal; }
.panel-body img { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.sev-error { color: var(--err); } .sev-warning { color: var(--warn); }
.low-stock { color: var(--warn); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.panel-body .mouser + .mouser { margin-top: 6px; }
/* each column lays out its content for its width: a narrow panel shows a wide table's rows as cards, its
   cells labelled; a wide one gives them room; a narrow chat wraps its head and puts Send under the box */
@container panel (max-width: 480px) {
  .table-wrap.stack table, .table-wrap.stack tbody, .table-wrap.stack tr, .table-wrap.stack td { display: block; width: auto; }
  .table-wrap.stack thead { display: none; }
  .table-wrap.stack tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .table-wrap.stack td { border: none; padding: 2px 0; white-space: normal; }
  .table-wrap.stack td:first-child:not([data-label]) { float: left; margin: 0 8px 0 0; white-space: nowrap; }
  .table-wrap.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}
@container panel (min-width: 760px) {
  .panel-body table { font-size: 14px; }
  .panel-body th, .panel-body td { padding: 6px 10px; }
}
@container chat (max-width: 560px) {
  .chat-head { flex-wrap: wrap; }
  .chat-head h2 { flex: 1 1 100%; }
  .composer { flex-direction: column; }
  .composer-actions { flex-direction: row; justify-content: flex-end; }
}
@container chat (min-width: 1100px) {
  .msg { max-width: 900px; }
}
select { font: inherit; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(60vh, 1fr) auto; grid-template-areas: "top" "projects" "chat" "panel"; height: auto; }
  .splitter { display: none; }
  .projects, .panel { border: none; border-bottom: 1px solid var(--line); }
  .chat-head { flex-wrap: wrap; }
  .chat-head h2 { flex: 1 1 100%; }
}
.dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); padding: 16px 20px;
  max-width: min(520px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgb(0 0 0 / .45); }
.dialog h3 { margin: 0 0 8px; }
.shared { max-width: 980px; margin: 0 auto; padding: 16px; }
.shared header { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.shared table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 16px; }
.shared th, .shared td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.shared img { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.shared .scroll { overflow-x: auto; }

/* the account: its button at the bottom left, its menu, its screens */
.projects { display: flex; flex-direction: column; overflow: visible; }
.projects ul { flex: 1; min-height: 0; overflow: auto; }
.account { position: relative; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.account-button { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid transparent;
  background: transparent; padding: 8px; border-radius: 10px; text-align: left; }
.account-button:hover, .account-button[aria-expanded="true"] { background: var(--event); }
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700;
  letter-spacing: .02em; }
.who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-size: 12px; }
.account-menu { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 20; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
.account-menu hr { border: none; border-top: 1px solid var(--line); margin: 6px 4px; }
.account-menu .item { display: flex; align-items: center; gap: 12px; width: 100%; border: none; background: transparent;
  padding: 9px 10px; border-radius: 8px; text-align: left; color: var(--ink); text-decoration: none; font-size: 14px; }
.account-menu .item:hover, .account-menu .item:focus-visible { background: var(--event); outline: none; }
.account-menu .item .label { flex: 1; }
.account-menu .item.person .who { flex: 1; }
.account-menu .item > .icon:last-child:not(:first-child) { width: 16px; height: 16px; color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.has-sub { position: relative; }
.submenu { position: absolute; left: calc(100% + 8px); bottom: 0; z-index: 21; min-width: 220px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); }
.layout.in-account .chat, .layout.in-account .panel { display: none; }
.account-view { grid-column: 2 / 4; grid-row: 2; overflow: auto; padding: 16px 28px 40px; }
.account-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.account-head h2 { margin: 0; font-size: 20px; }
.account-head .ghost { padding: 6px 10px; }
.account-view .tabs { margin: 6px 0 4px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.account-body { max-width: 760px; }
@media (max-width: 1000px) {
  .projects { overflow: visible; }
  .account-view { grid-column: 1; grid-row: 3; padding: 16px; }
  .submenu { left: 0; bottom: calc(100% + 6px); }
}
.board-choices-box { margin: 0 0 10px; display: grid; gap: 8px; }
.board-choices { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.board-choices[hidden] { display: none; }
.board-choices input[type="number"] { width: 6.5em; }
label.check { display: flex; gap: 8px; align-items: center; }
