/* Instrument Sans (SIL Open Font License, see fonts/OFL.txt). Served from this site: no outside requests. */
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
:root {
  /* duetto: creme paper, maroon accent, near-black ink (taken from the logo). */
  --bg: #faf9f5; --side: #f3f1ea; --fg: #23251f; --muted: #6b6760; --line: #e6e2d8;
  --hover: #eae7de; --accent: #722b32; --accent-fg: #fdfbf7; --bubble: #f0ede5; --field: #ffffff;
  --green: #22a559; --yellow: #e0a614; --grey: #b5aba0; --warn-bg: #fbeac0; --warn-fg: #6b4a00; --bad: #b3261e;
  --brand-font: "Playfair Display", "Didot", "Bodoni 72", "Bodoni MT", "Noto Serif Display", "Times New Roman", Georgia, serif;
}
/* Dark mode: follows the device unless the person picked one with the switch. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171414; --side: #1e1a1a; --fg: #f1ebe4; --muted: #a69c92; --line: #332c2b;
    --hover: #2a2423; --accent: #e3a0a6; --accent-fg: #2a1114; --bubble: #241f1e; --field: #1e1a1a;
    --grey: #5e5552; --warn-bg: #3a3112; --warn-fg: #f3d47a; --bad: #fc8181;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171414; --side: #1e1a1a; --fg: #f1ebe4; --muted: #a69c92; --line: #332c2b;
    --hover: #2a2423; --accent: #e3a0a6; --accent-fg: #2a1114; --bubble: #241f1e; --field: #1e1a1a;
    --grey: #5e5552; --warn-bg: #3a3112; --warn-fg: #f3d47a; --bad: #fc8181;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.5 "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 7px 12px; }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.link { border: 0; background: none; padding: 0; color: var(--muted); font-size: 13px; }
button.link:hover { color: var(--fg); text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { border: 1px solid var(--line); background: var(--field); border-radius: 8px; padding: 8px 10px; width: 100%; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

/* Sign in */
.login { max-width: 360px; margin: 10vh auto 0; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.brand img { border-radius: 0; }
.brand-name { font-family: var(--brand-font); font-size: 50px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.brand-tag { color: var(--muted); font-size: 15px; margin-top: 4px; }
.brand img { width: 68px; height: 68px; }
.side-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--brand-font); font-size: 29px; line-height: 1; font-weight: 700; letter-spacing: -.02em; }
.side-brand img { border-radius: 0; }
.splash { display: flex; align-items: center; justify-content: center; gap: 12px; height: 80dvh; font-family: var(--brand-font); font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.splash img { border-radius: 0; }
.login h1 { font-size: 18px; margin: 0 0 4px; }
.login .error { color: var(--bad); min-height: 22px; margin-top: 10px; font-size: 14px; }
.login button { width: 100%; margin-top: 16px; }
.login .langs { margin-top: 18px; text-align: center; }

/* Layout */
.app { display: grid; grid-template-columns: 264px 1fr; height: 100dvh; }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 14px 14px 8px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.side-scroll { overflow-y: auto; flex: 1; padding-bottom: 8px; }
.side h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 14px 4px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.side h2 button { padding: 0 6px; font-size: 16px; line-height: 20px; border: 0; background: none; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; padding: 5px 14px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; border-radius: 0; }
.row:hover { background: var(--hover); }
.row.current { background: var(--hover); font-weight: 600; }
.row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .time { font-size: 12px; color: var(--muted); font-weight: 400; }
.badge { background: var(--accent); color: var(--accent-fg); border-radius: 10px; font-size: 11px; padding: 0 6px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grey); flex: none; }
.dot.active { background: var(--green); }
.dot.idle { background: var(--yellow); }
.side-foot { border-top: 1px solid var(--line); padding: 10px 14px; display: grid; gap: 6px; font-size: 13px; }
.side-foot .me { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.side-foot select { padding: 4px 8px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 12px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.head { border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; gap: 10px; min-height: 52px; }
.head .title { font-weight: 600; }
.head .sub { color: var(--muted); font-size: 13px; }
.menu-btn { display: none; }
.notice { background: var(--warn-bg); color: var(--warn-fg); font-size: 13px; padding: 6px 16px; }
.notice:empty { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 12px 16px; }
.empty { color: var(--muted); text-align: center; margin-top: 20vh; }

.msg { padding: 6px 0; display: flex; gap: 10px; align-items: flex-start; }
.msg-body { flex: 1; min-width: 0; }
.av { border-radius: 50%; flex: none; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; line-height: 1; user-select: none; }
.msg > .av { margin-top: 3px; }
.av-wrap { position: relative; display: inline-flex; flex: none; }
.av-wrap .dot { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border: 2px solid var(--side); }
.head .av-wrap .dot { border-color: var(--bg); }
.pos { color: var(--muted); font-weight: 400; font-size: 12px; }
.side-foot button.me { border: 0; background: none; padding: 4px 0; text-align: left; width: 100%; border-radius: 8px; }
.side-foot button.me:hover { background: var(--hover); }
.side-foot .me .grow { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pf-photo { display: flex; align-items: center; gap: 14px; margin: 8px 0 4px; }
.pf-hint { font-size: 12px; margin: 6px 0 0 !important; }
.msg .meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.msg .meta b { color: var(--fg); font-size: 14px; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .pending { color: var(--muted); font-size: 13px; }
.msg .second { margin-top: 4px; padding: 6px 10px; background: var(--bubble); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.msg .tools { display: flex; gap: 12px; align-items: center; margin-top: 2px; min-height: 20px; flex-wrap: wrap; }
.flag { background: var(--warn-bg); color: var(--warn-fg); border-radius: 6px; padding: 1px 8px; font-size: 12px; border: 0; }
.tag { color: var(--muted); font-size: 12px; }
.file { display: inline-flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-top: 4px; max-width: 100%; }
.file .fname { font-weight: 600; overflow-wrap: anywhere; }
.file .links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.file a { color: var(--accent); text-decoration: none; }
.file .note { font-size: 12px; color: var(--muted); }

.thumb { position: relative; display: block; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; max-width: min(320px, 100%); background: var(--bubble); line-height: 0; }
.thumb img { display: block; max-width: 100%; max-height: 260px; }
.thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.file .links button.link { color: var(--accent); }

/* A translation that has just arrived is shown arriving. */
@keyframes arrive { 0% { background: color-mix(in srgb, var(--who, var(--accent)) 26%, var(--bg)); } }
@keyframes arrive-text { 0% { opacity: 0; transform: translateY(3px); } 100% { opacity: 1; transform: none; } }
.msg.fresh { animation: arrive 2.4s ease-out; border-radius: 8px; }
.msg.fresh .text { animation: arrive-text .5s ease-out; }
@media (prefers-reduced-motion: reduce) { .msg.fresh, .msg.fresh .text { animation: none; } }
.typing { min-height: 20px; padding: 0 16px; font-size: 13px; color: var(--muted); }
.demo-bar { background: color-mix(in srgb, var(--accent) 10%, var(--bg)); border-bottom: 1px solid var(--line); font-size: 13px; padding: 6px 16px; }
.demo-bar a { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.demo-lead { color: var(--muted); margin: 6px 0 4px; }
.demo-start h1 { font-size: 22px; }

.composer { border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.composer textarea { resize: none; min-height: 44px; max-height: 180px; display: block; }
.composer .bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.composer .hint { flex: 1; font-size: 12px; color: var(--muted); min-width: 0; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; user-select: none; margin: 0; color: var(--fg); }
.switch input { width: auto; }
.chosen { font-size: 13px; color: var(--muted); margin-top: 6px; }
.chosen:empty { display: none; }

/* Panels */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.panel { background: var(--bg); border-radius: 14px; padding: 20px; width: 100%; max-width: 460px; max-height: 86dvh; overflow-y: auto; border: 1px solid var(--line); }
.panel.wide { max-width: 640px; }
.panel h3 { margin: 0 0 6px; font-size: 18px; }
.panel p { color: var(--muted); margin: 0 0 10px; }
.panel .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; align-items: center; }
.panel .actions .steps { margin-right: auto; color: var(--muted); font-size: 13px; }
.panel .error { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 18% 0 0; z-index: 10; transform: translateX(-100%); transition: transform .18s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  .app.menu-open .side { transform: none; }
  .menu-btn { display: inline-block; padding: 5px 10px; }
  .grid2 { grid-template-columns: 1fr; }
}

/* Markup screen. Always dark, so a photo reads the same in light and dark mode. */
/* touch-action: quick taps on the tools must each count; without it a phone can read two fast taps as a double-tap zoom and drop the second. */
.mk { touch-action: manipulation; position: fixed; inset: 0; z-index: 30; background: #101214; color: #f1f3f5; display: flex; flex-direction: column; height: 100dvh; -webkit-user-select: none; user-select: none; }
.mk-top { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
.mk-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: #c5cad1; }
.mk-btn { background: #23272c; color: #f1f3f5; border: 1px solid #353a41; border-radius: 10px; min-width: 44px; min-height: 44px; padding: 0 14px; font-size: 16px; }
.mk-btn.mk-done { background: #8f3640; border-color: #8f3640; color: #fff; font-weight: 600; }
.mk-pages { display: inline-flex; align-items: center; gap: 6px; }
.mk-page { font-size: 14px; min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.mk-status { font-size: 13px; color: #ffd98a; padding: 0 12px; min-height: 0; }
.mk-status:empty { display: none; }
.mk-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: none; cursor: crosshair; }
.mk-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; --inv: 1; }
.mk-img { display: block; width: 100%; height: 100%; pointer-events: none; -webkit-user-drag: none; }
.mk-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mk-notes { position: absolute; inset: 0; pointer-events: none; }
.mk-note { position: absolute; width: 0; height: 0; pointer-events: auto; cursor: pointer; transform: scale(var(--inv)); transform-origin: 0 0; }
.mk-note.mk-open { z-index: 2; }
.mk-pin { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; border: 2px solid #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.mk-pin[style*="ffd400"] { color: #222; }
.mk-bubble { position: absolute; left: 18px; top: -14px; width: max-content; max-width: 210px; background: rgba(255, 255, 255, .96); color: #17191c; border-radius: 8px; padding: 5px 9px; font-size: 14px; line-height: 1.35; box-shadow: 0 2px 10px rgba(0, 0, 0, .45); -webkit-user-select: text; user-select: text; }
.mk-note.mk-left .mk-bubble { left: auto; right: 18px; }
.mk-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.mk-sub, .mk-who { font-size: 12px; color: #68707c; }
.mk-orig { margin-top: 4px; padding-top: 4px; border-top: 1px solid #d9dde3; font-size: 13px; color: #3c434c; white-space: pre-wrap; overflow-wrap: anywhere; }
.mk-flag { font-size: 12px; color: #7a5600; background: #fff6d6; border-radius: 4px; padding: 1px 4px; margin-top: 3px; }
.mk-acts { display: flex; gap: 14px; margin-top: 4px; }
.mk-link { border: 0; background: none; padding: 6px 0; color: #722b32; font-size: 13px; }
.mk-sheet { padding: 0 10px 8px; }
.mk-sheet[hidden] { display: none; }
.mk-sheet textarea { background: #fff; color: #17191c; border-color: #fff; font-size: 16px; resize: none; -webkit-user-select: text; user-select: text; }
.mk-sheet-bar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.mk-hint { text-align: center; font-size: 12px; color: #8a929c; padding: 4px 8px 0; }
.mk-tools { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
.mk-tool { background: #23272c; color: #f1f3f5; border: 1px solid #353a41; border-radius: 12px; min-width: 56px; min-height: 52px; padding: 4px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
.mk-tool.on { background: #f1f3f5; color: #101214; border-color: #f1f3f5; }
.mk-glyph { font-size: 20px; line-height: 22px; }
.mk-label { font-size: 11px; line-height: 14px; }
.mk-color { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; background: var(--c); border: 3px solid #101214; outline: 2px solid #353a41; padding: 0; }
.mk-color.on { outline: 3px solid #fff; }
.mk-sep { width: 1px; height: 30px; background: #353a41; margin: 0 2px; }
@media (max-width: 460px) { .mk-tools { gap: 4px; padding-left: 4px; padding-right: 4px; } .mk-tool { min-width: 46px; padding: 4px 2px; } .mk-color { width: 36px; height: 36px; min-width: 36px; } .mk-sep { margin: 0; } }
@media (max-width: 350px) { .mk-color { width: 30px; height: 30px; min-width: 30px; } .mk-sep { display: none; } .mk-label { font-size: 10px; } }

.theme-btn { position: fixed; top: 10px; right: 12px; z-index: 5; }

.langs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 18px; }
.langs .link { width: auto; }
@media (max-width: 760px) { .composer .bar { flex-wrap: wrap; } .composer .hint { order: 9; flex: 0 0 100%; } .composer .bar .switch { flex: 1; } }

.head-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.head-text .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.head-text .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; min-width: 0; }
@media (max-width: 760px) { .head-text { flex-direction: column; align-items: stretch; gap: 0; line-height: 1.25; } .head-text .sub { flex: none; font-size: 12px; } .head-text .title { flex: none; } }
.msg .meta > * { white-space: nowrap; flex: 0 0 auto; }
.msg .meta .pos { flex: 0 1 auto;  min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.msg .meta b { flex: 0 0 auto; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }

.demo-link { display: block; text-align: center; margin-top: 16px; color: var(--accent); font-weight: 600; text-decoration: none; }
.demo-link:hover { text-decoration: underline; }

/* Join screen and the admin's Activity page */
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.notice-line { text-align: center; margin-top: 14px; }
.join .sent { color: var(--fg); font-size: 14px; margin-top: 10px; }
.join button.primary { margin-top: 16px; width: 100%; }
.act { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: flex; flex-direction: column; }
.act-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.act-head h2 { margin: 0; font-size: 18px; flex: 1; }
.act a.btn { border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; color: var(--fg); text-decoration: none; font-size: 14px; }
.act-body { overflow-y: auto; padding: 16px; display: grid; gap: 16px; align-content: start; -webkit-overflow-scrolling: touch; }
.act-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.act .card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--field); min-width: 0; }
.act .card h3 { margin: 0 0 8px; font-size: 16px; }
.act .card h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.act .sub { color: var(--muted); font-size: 13px; }
.act .on { color: #2e9e5b; font-size: 12px; font-weight: 600; }
.seat-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.seat-line b { font-size: 20px; }
.meter { height: 10px; border-radius: 6px; background: var(--hover); overflow: hidden; margin: 8px 0; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; }
.meter i.full { background: var(--bad, #c0392b); }
.requests .req { font-size: 13px; padding: 4px 0; border-top: 1px solid var(--line); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.link-row { display: flex; gap: 8px; }
.link-row input { font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--field); display: grid; gap: 2px; }
.tile b { font-size: 22px; line-height: 1.2; }
.tile span { font-size: 12px; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 72px; }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; background: color-mix(in srgb, var(--hover) 55%, transparent); border-radius: 3px; min-width: 0; }
.bar i { display: block; width: 100%; background: var(--accent); border-radius: 3px; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.act table { border-collapse: collapse; width: 100%; font-size: 13px; }
.act th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
.act td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.act td.num { font-variant-numeric: tabular-nums; }
.act td.asked { white-space: normal; min-width: 220px; }
.act td.asked ul { margin: 0; padding-left: 16px; }
.feed { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.feed li { padding: 5px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.feed li[data-type=login_failed] b { color: var(--bad, #c0392b); }
.foot-links .badge { margin-left: 4px; }

/* Delete, pins, catch-up, voice notes, scanned text, notifications */
.msg { position: relative; }
.drawer { position: relative; flex: none; align-self: center; display: inline-flex; align-items: center; gap: 0; margin-left: 4px; opacity: .55; transition: opacity .12s; }
.msg:hover > .drawer, .msg:focus-within > .drawer, .drawer.show { opacity: 1; }
.drawer > .drawer-btn { color: var(--muted); font-size: 17px; min-width: 32px; height: 32px; border-radius: 16px; }
.drawer > .drawer-btn:hover, .drawer > .drawer-btn.on { color: var(--fg); background: var(--hover); }
.pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--field); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(35, 37, 31, .18); padding: 6px; }
.emoji-pop { display: flex; gap: 2px; }
.menu-pop { display: flex; flex-direction: column; min-width: 210px; }
.menu-item { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--fg); text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.menu-item:hover { background: var(--hover); }
.menu-item .mi-icon { width: 18px; text-align: center; }
.menu-item.x { color: var(--bad); font-weight: 600; }
.menu-item.ok { color: #1f7a45; }
.menu-item.ok.on { font-weight: 700; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.menu-ask { padding: 8px 10px; font-size: 14px; max-width: 240px; }
.menu-ask-acts { display: flex; gap: 8px; margin-top: 8px; }
.msg.menu-open { z-index: 5; }
.drawer-btn { border: 0; background: transparent; color: var(--fg); border-radius: 7px; min-width: 28px; height: 28px; padding: 0 6px; font-size: 14px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.drawer-btn:hover { background: var(--hover); }
.drawer-btn.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.drawer-btn.x { color: var(--bad); font-weight: 700; font-size: 15px; }
.drawer-btn.x:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.drawer .ask { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding-left: 8px; color: var(--fg); white-space: nowrap; }
.drawer-btn.danger-btn { background: var(--bad); color: #fff; font-weight: 600; font-size: 13px; padding: 0 10px; }
.drawer-btn.danger-btn:hover { background: var(--bad); filter: brightness(1.08); }
.msg.deleted .gone { color: var(--muted); font-style: italic; font-size: 14px; }
.msg.pinned { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 8px; box-shadow: inset 3px 0 0 var(--accent); padding-left: 8px; }
.msg .meta .decision { color: var(--accent); font-weight: 600; font-size: 12px; }
.msg.flash { animation: arrive 2.4s ease-out; border-radius: 8px; }
.head-btns { display: flex; gap: 6px; flex: none; }
.head-btn { border: 1px solid var(--line); background: var(--field); color: var(--fg); border-radius: 8px; padding: 4px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 2px; cursor: pointer; }
.head-btn:hover { background: var(--hover); }
.head-btn .count { background: var(--accent); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; margin-left: 4px; }
@media (max-width: 760px) { .head-btn .lbl { display: none; } .head-btn { padding: 4px 8px; } }
.pins { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.pins li { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; }
.pin-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.pin-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.pin-acts { display: flex; gap: 14px; margin-top: 4px; font-size: 13px; }
.catchup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.catchup { max-height: 62vh; overflow: auto; }
.catchup-text .cu-head { font-weight: 700; margin: 12px 0 4px; }
.catchup-text .cu-head:first-child { margin-top: 4px; }
.catchup-text .cu-item { margin: 2px 0 2px 4px; padding-left: 14px; position: relative; white-space: pre-wrap; }
.catchup-text .cu-item::before { content: '•'; position: absolute; left: 0; color: var(--accent); }
.flag-note { background: var(--warn-bg); color: var(--warn-fg); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.cu-channels { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--field); color: var(--fg); border-radius: 14px; padding: 3px 10px; font-size: 13px; cursor: pointer; }
.voice { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; border: 1px solid var(--line); border-radius: 22px; padding: 4px 12px 4px 8px; max-width: 100%; background: var(--field); }
.voice audio { height: 34px; max-width: 260px; min-width: 0; flex: 1 1 200px; }
.voice .note { font-size: 12px; color: var(--muted); }
.rec { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #b3261e; font-variant-numeric: tabular-nums; }
.rec-dot { width: 10px; height: 10px; border-radius: 5px; background: #d93025; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
button.small { padding: 3px 10px; font-size: 13px; }
.scan { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 6px; font-size: 14px; }
.scan summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--accent); }
.scan-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; max-height: 320px; overflow: auto; }
.scan .tag { font-size: 11px; }

.drawer-sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
.drawer-btn.ok { color: #1f7a45; font-weight: 700; }
.drawer-btn.ok.on { background: color-mix(in srgb, #1f7a45 14%, transparent); }
.drawer-btn.quiet { color: var(--muted); font-size: 13px; }
.drawer-btn.emoji { font-size: 17px; min-width: 32px; }
.emoji-row { display: inline-flex; gap: 1px; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.react-chip { padding: 1px 8px; font-size: 13px; }
.react-chip.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--field)); }
.confirmed { margin-top: 3px; font-size: 12px; color: #1f7a45; font-weight: 600; }
.meta .edited { color: var(--muted); font-size: 12px; }
.edit-box { margin-top: 4px; }
.edit-text { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--field); color: var(--fg); resize: vertical; }
.edit-acts { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.quote { display: block; text-align: left; width: fit-content; max-width: 100%; margin: 3px 0 2px; padding: 3px 10px; border: 0; border-left: 3px solid var(--accent); border-radius: 4px; background: var(--bubble); color: var(--muted); font-size: 13px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote b { color: var(--fg); font-weight: 600; }
.reply-bar { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 6px 6px; border-bottom: 1px dashed var(--line); margin-bottom: 6px; }
.reply-bar .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar .muted { color: var(--muted); }
@media (hover: none) { .drawer { opacity: .8; } }

/* The opening */
.intro { position: fixed; inset: 0; z-index: 100; overflow: hidden; cursor: pointer; color: #fbf3ea; display: grid; place-items: center;
  background: radial-gradient(90% 70% at 50% 46%, #4a1a21 0%, #2b0f14 46%, #150709 100%); }
.intro-glow { position: absolute; left: 50%; top: 44%; width: min(120vw, 1100px); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(closest-side, rgba(196, 96, 104, .42), rgba(150, 60, 70, .16) 45%, transparent 72%); filter: blur(20px); }
.intro-grain { position: absolute; inset: 0; pointer-events: none; opacity: .11; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"); }
.intro-lockup { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 20px; }
.intro-stage { width: clamp(150px, 30vmin, 250px); height: auto; overflow: visible; filter: drop-shadow(0 24px 50px rgba(0, 0, 0, .45)); }
.intro-tile { fill: #722b32; opacity: 0; }
.intro-tile-line { fill: none; stroke: #e7c9a5; stroke-width: 1.2; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.intro-sole > g { opacity: 0; }
.intro-sole-fill { fill: #fbf3ea; opacity: 0; }
.intro-sole-line { fill: none; stroke: #f3dcc0; stroke-width: 1.1; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.intro-sheen { fill: rgba(255, 255, 255, .22); }
.intro-word { margin-top: clamp(20px, 3.6vmin, 34px); font-family: var(--brand-font); font-weight: 700; font-size: clamp(60px, 13vmin, 128px); line-height: 1.05; letter-spacing: -.015em; white-space: nowrap; color: #fbf3ea; }
/* Each letter carries its own strip of light, so the pass still shows while letters move. */
.intro-word span { display: inline-block; opacity: 0; padding-bottom: .08em;
  background: linear-gradient(100deg, #fbf3ea 0%, #fbf3ea 38%, #ffffff 47%, #e9c79f 53%, #fbf3ea 62%, #fbf3ea 100%) 100% 0 / 320% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.intro-rule { width: clamp(90px, 16vmin, 150px); height: 1px; margin-top: clamp(16px, 2.6vmin, 24px); background: linear-gradient(90deg, transparent, #e7c9a5, transparent); opacity: 0; transform-origin: center; }
.intro-tag { margin-top: clamp(14px, 2.2vmin, 20px); font-size: clamp(12px, 1.9vmin, 16px); text-transform: uppercase; letter-spacing: .28em; padding-left: .28em; color: #e9cfc4; opacity: 0; }
/* Still version (reduced motion): everything in its final place. */
.intro.done .intro-tile, .intro.done .intro-sole > g, .intro.done .intro-sole-fill, .intro.done .intro-word span, .intro.done .intro-rule, .intro.done .intro-tag { opacity: 1; }
.intro.done .intro-sheen, .intro.done .intro-sole-line { display: none; }

/* The tour: a lit-up hole over the part being explained, the card beside it */
.overlay.tour.spot { background: transparent; display: block; padding: 0; }
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(20, 16, 14, .58); outline: 2px solid #f3d9a4; outline-offset: 2px; pointer-events: none; transition: all .25s ease; animation: tour-pulse 1.6s ease-in-out infinite; }
@keyframes tour-pulse { 50% { outline-color: rgba(243, 217, 164, .35); outline-offset: 6px; } }
.overlay.tour.spot .tour-card { position: fixed; width: min(360px, calc(100vw - 24px)); max-width: none; box-shadow: 0 18px 40px rgba(0, 0, 0, .28); animation: rise .3s ease-out both; }
@media (prefers-reduced-motion: reduce) { .tour-hole { animation: none; transition: none; } }
.drawer.tour-on, .msg .drawer.tour-on { opacity: 1; visibility: visible; }
.pop.up { top: auto; bottom: calc(100% + 4px); }

/* The video tour: a button on the sign-in and demo pages, a player over the page */
.tour-video-btn { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  /* with no picture: a slimmer branded card */ margin-top: 18px; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; color: #fff; text-align: left;
  background: radial-gradient(90% 80% at 50% 40%, #84363e 0%, #5a2027 60%, #2b0f14 100%); box-shadow: 0 10px 28px rgba(60, 20, 25, .18); transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s; }
.tour-video-btn:hover, .tour-video-btn:focus-visible { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(60, 20, 25, .3); }
.tv-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left top; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.tour-video-btn:hover .tv-thumb { transform: scale(1.05); }
.tour-video-btn:not(.has-thumb) { aspect-ratio: auto; height: 96px; background: radial-gradient(120% 160% at 18% 0%, #8a3a43 0%, #722b32 45%, #4a1a21 100%); }
.tour-video-btn:not(.has-thumb) .tv-shade { display: none; }
.tour-video-btn:not(.has-thumb) .play { left: 48px; top: 50%; width: 52px; height: 52px; background: #fbf3ea; color: #722b32; }
.tour-video-btn:not(.has-thumb):hover .play { transform: translate(-50%, -50%) scale(1.08); }
.tour-video-btn:not(.has-thumb) .tv-label { left: 90px; right: 14px; bottom: auto; top: 50%; transform: translateY(-50%); text-shadow: none; }
.tour-video-btn:not(.has-thumb) .tv-length { top: auto; bottom: 10px; right: 12px; background: rgba(0, 0, 0, .28); }
.tv-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 8, 10, .05) 30%, rgba(20, 8, 10, .82) 100%); }
.tour-video-btn .play { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 20px; padding-left: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); transition: transform .25s cubic-bezier(.16,1,.3,1); }
:root[data-theme="dark"] .tour-video-btn .play { background: #722b32; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tour-video-btn .play { background: #722b32; } }
.tour-video-btn:hover .play { transform: translate(-50%, -50%) scale(1.1); }
.play-ring { position: absolute; inset: -2px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); animation: tv-ring 2.2s ease-out infinite; }
@keyframes tv-ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .play-ring { animation: none; opacity: .5; } .tour-video-btn, .tv-thumb, .tour-video-btn .play { transition: none; } }
.tv-label { position: absolute; left: 14px; right: 34%; bottom: 11px; display: grid; gap: 1px; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.tv-title { font-weight: 700; font-size: 15px; }
.tv-sub { font-size: 12px; opacity: .88; line-height: 1.3; }
.tv-length { position: absolute; right: 10px; top: 10px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, .6); border-radius: 6px; padding: 2px 7px; }
.tv-length:empty { display: none; }
.video-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(15, 12, 11, .82); display: grid; place-items: center; padding: 16px; }
.video-box { position: relative; width: min(1100px, 100%); aspect-ratio: 16 / 9; max-height: calc(100vh - 32px); background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.video-box video, .video-box iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.video-close { position: absolute; top: 8px; right: 8px; z-index: 1; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 16px; cursor: pointer; }

/* Pinned messages (kept at hand), apart from decisions */
.stuck-tag { color: #1f6f8b; font-weight: 600; }
.msg .meta .stuck-tag { margin-left: 6px; font-size: 12px; }
/* Catch-up: files and photos shared while away */
.cu-files { margin-top: 14px; display: grid; gap: 6px; }
.cu-file { display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--fg); font: inherit; cursor: pointer; }
.cu-file:hover { background: var(--hover); }
.cu-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; background: var(--hover); }
.cu-icon { width: 56px; height: 56px; display: grid; place-items: center; font-size: 24px; flex: none; border-radius: 8px; background: var(--hover); }
.cu-file-text { display: grid; gap: 2px; min-width: 0; }
.cu-file-text b { overflow-wrap: anywhere; }
.cu-important { color: var(--accent); font-weight: 600; font-size: 12px; }
.cu-tr { color: var(--muted); font-size: 12px; }
.cu-file-meta { color: var(--muted); font-size: 12px; }
.cu-file-cap { font-size: 13px; }

/* ---------------- search, threads, later, status, polls, settings, huddles ---------------- */
.search-btn { margin: 0 12px 8px; text-align: left; color: var(--muted); background: var(--field); font-size: 14px; padding: 6px 10px; }
.search-btn:hover { color: var(--fg); }
.search-row { display: flex; gap: 8px; margin: 6px 0 10px; }
.search-row select { width: auto; max-width: 40%; }
.search-list mark { background: var(--warn-bg); color: var(--warn-fg); border-radius: 3px; padding: 0 1px; }
.side-tools { padding: 4px 0 2px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.count-dim { color: var(--muted); font-size: 12px; }
.side h2 button + button { margin-left: 2px; }
.muted-row .grow { opacity: .6; }
.archived-row .grow { opacity: .5; font-style: italic; }
.muted-icon, .huddle-dot { font-size: 12px; }
.huddle-dot { animation: huddle-pulse 1.6s ease-in-out infinite; }
@keyframes huddle-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .huddle-dot { animation: none; } }
.status-bits { margin-left: 4px; font-size: 13px; }
.status-link { display: block; text-align: left; margin: 2px 14px 6px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: calc(100% - 28px); }
.app.with-thread { grid-template-columns: 264px 1fr minmax(300px, 380px); }
.thread-pane { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.thread-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.thread-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.thread-sep { margin: 6px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 6px; }
.thread-composer textarea { min-height: 54px; }
.thread-line { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 3px 8px; font-size: 13px; color: var(--accent); background: none; border: 1px solid transparent; }
.thread-line:hover { border-color: var(--line); background: var(--field); }
.thread-avs { display: inline-flex; }
.thread-avs > * { margin-right: -4px; }
@media (max-width: 1100px) { .app.with-thread { grid-template-columns: 264px 1fr; } .thread-pane { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 9; box-shadow: 0 0 40px rgba(0, 0, 0, .2); } }
@media (max-width: 760px) { .app.with-thread { grid-template-columns: 1fr; } .thread-pane { width: 100%; } }
.saved-tag { font-size: 12px; color: var(--muted); margin-top: 2px; }
.remind-tag { font-size: 12px; color: var(--muted); }
.remind-tag.due, li.due .pin-text { color: var(--accent); font-weight: 600; }
.choice-list { display: grid; gap: 6px; margin: 10px 0; }
.choice-list .choice { text-align: left; }
.choice-list .choice.on, .choice-list .choice:hover { border-color: var(--accent); }
.choice-list.presets { grid-template-columns: 1fr 1fr; }
.row-inline { display: flex; gap: 8px; align-items: center; }
.row-inline > label { margin: 0; display: flex; gap: 6px; align-items: center; }
.emoji-in { width: 56px; flex: none; text-align: center; }
.sched-preview { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--bubble); border-radius: 6px; white-space: pre-wrap; }
.check { display: flex; align-items: center; gap: 6px; color: var(--fg); font-size: 14px; }
.check input { width: auto; }
.poll-opts { display: grid; gap: 6px; margin: 8px 0; }
.poll { display: grid; gap: 6px; margin: 6px 0 2px; max-width: 460px; }
.poll-opt-btn { position: relative; display: flex; align-items: center; gap: 8px; text-align: left; overflow: hidden; background: var(--field); padding: 8px 12px; }
.poll-opt-btn.mine { border-color: var(--accent); font-weight: 600; }
.poll-bar { position: absolute; inset: 0 auto 0 0; background: var(--hover); z-index: 0; transition: width .3s; }
.poll-label, .poll-count { position: relative; z-index: 1; }
.poll-label { flex: 1; }
.poll-orig { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.poll-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.poll-foot { font-size: 12px; color: var(--muted); }
.poll.closed .poll-opt-btn { opacity: .8; }
.mini-list { list-style: none; padding: 0; margin: 6px 0; }
.mini-list li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pick-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; margin: 6px 0; max-height: 200px; overflow-y: auto; }
.danger-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
pre.code { white-space: pre-wrap; word-break: break-all; font-size: 12px; background: var(--bubble); padding: 8px; border-radius: 6px; }
.archived-note { margin: 10px 16px 16px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; }
.archived-tag { font-weight: 400; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100% - 32px)); background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font-size: 14px; }
.toast .link { color: var(--bg); font-weight: 600; text-decoration: underline; font-size: 14px; }
.toast .drawer-btn { color: var(--bg); background: none; border: 0; }
/* huddles */
.huddle-btn.live { border-color: var(--green); }
.huddle-btn.on { background: var(--green); color: #fff; border-color: var(--green); }
.huddle-banner { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--bubble); border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
button.small { padding: 4px 10px; font-size: 13px; }
.huddle { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: min(420px, calc(100% - 32px)); background: var(--side); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 48px rgba(0, 0, 0, .28); display: flex; flex-direction: column; overflow: hidden; }
.huddle-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.huddle .h-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; padding: 8px; max-height: 46dvh; overflow-y: auto; }
.huddle[data-count="1"] .h-tiles, .huddle[data-count="2"] .h-tiles { grid-template-columns: 1fr 1fr; }
.h-tile { position: relative; aspect-ratio: 4 / 3; background: #1d1a19; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.h-tile video { width: 100%; height: 100%; object-fit: cover; }
.h-tile[data-user] video[muted] { transform: scaleX(-1); }
.h-tile .tile-av { display: grid; place-items: center; }
.h-tile .tile-name { position: absolute; left: 6px; bottom: 6px; right: 6px; font-size: 12px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-tile[data-conn="connecting"], .h-tile[data-conn="new"] { opacity: .7; }
.captions { padding: 6px 12px; min-height: 52px; max-height: 140px; overflow-y: auto; font-size: 14px; border-top: 1px solid var(--line); background: var(--bg); }
.cap { padding: 2px 0; }
.cap-orig { font-size: 12px; color: var(--muted); }
.cap.interim { color: var(--muted); }
.huddle-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }
.huddle-bar button { font-size: 13px; padding: 6px 10px; }
.huddle-bar button.on { border-color: var(--accent); }
.huddle-bar .danger-btn { margin-left: auto; background: var(--bad); color: #fff; border-color: var(--bad); }
.huddle.min .h-tiles, .huddle.min .captions { display: none; }
@media (max-width: 760px) { .huddle { right: 8px; left: 8px; bottom: 8px; width: auto; } }
.poll-foot .link { margin-left: 8px; }

/* Create account, the waiting screen, and the admin's People and alerts panel. */
.signup-line { margin-top: 16px; text-align: center; font-size: 14px; color: var(--muted); }
.login .signup-line button { width: auto; margin: 0; font-weight: 600; }
.login.signup { margin-top: 6vh; }
.signup-wait { font-size: 15px; line-height: 1.55; margin: 8px 0 0; }
.signup-wait[data-state="declined"] { color: var(--bad); }
.signup .muted, [data-role="people-panel"] .muted { color: var(--muted); }
.signup .small, [data-role="people-panel"] .small { font-size: 13px; }
.signup-dots { display: flex; gap: 7px; justify-content: center; margin: 22px 0 14px; }
.signup-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: signup-dot 1.2s ease-in-out infinite; }
.signup-dots i:nth-child(2) { animation-delay: .15s; }
.signup-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes signup-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .signup-dots i { animation: none; opacity: .6; } }
[data-role="people-panel"] h3 { margin: 18px 0 6px; font-size: 15px; }
[data-role="people-panel"] .strong { font-weight: 600; }
.signup-row, .alert-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.signup-row .grow, .alert-row .grow, .watch-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.watch-list { max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 2px 10px; }
.watch-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; margin: 0; cursor: pointer; color: var(--fg); font-size: 14px; }
.watch-row input { width: auto; flex: none; }
.signup-gate { margin-top: 18px; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 12px; }
.signup-gate .strong { font-weight: 600; }
.signup-gate p { margin: 2px 0 0; }
.watch-row { cursor: default; flex-wrap: wrap; border-top: 1px solid var(--line); }
.watch-row:first-child { border-top: 0; }
.watch-row.is-off .grow { opacity: .55; }
.row-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.remove-ask { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.watch-list { max-height: 320px; }
.link-box { border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px; margin: 8px 0 10px; }
.link-row { display: flex; gap: 8px; margin-top: 6px; }
.link-row input { flex: 1; min-width: 0; font-size: 13px; }
button.danger-btn { background: var(--bad); color: #fff; border-color: var(--bad); }

/* Messages waiting to be sent. */
.msg[data-role="waiting-msg"] .text { opacity: .6; }
.msg[data-role="waiting-msg"][data-state="failed"] .text { opacity: 1; }
.out-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-top: 2px; }

/* Tasks, defect reports, approvals, order chats, seen-by. */
.items { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13.5px; background: var(--field); max-width: 560px; }
.item.is-mine { border-color: var(--accent); }
.item.is-done .item-main { opacity: .6; }
.item-main { flex: 1; min-width: 0; }
.item-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--muted); background: transparent; padding: 0; line-height: 1; font-size: 13px; flex: none; }
.item-check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.item-due.late, .order-ship.late { color: var(--bad); font-weight: 600; }
.item-x { color: var(--muted); padding: 0 2px; }
.sev { border-radius: 6px; padding: 0 6px; font-size: 12px; font-weight: 600; }
.sev-minor { background: color-mix(in srgb, var(--muted) 22%, transparent); }
.sev-major { background: color-mix(in srgb, #d98a00 28%, transparent); }
.sev-critical { background: var(--bad); color: #fff; }
.item .ok { color: #1f8a4c; } .item .bad { color: var(--bad); }
.reject-row { display: flex; gap: 6px; flex: 1 1 100%; }
.reject-row input { flex: 1; min-width: 0; padding: 4px 8px; }
.seen { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.seen-btn { font-size: 12px; color: var(--muted); padding: 0; }
.seen-list { flex: 1 1 100%; } .seen-list .not-yet { opacity: .8; }
.important-tag { color: var(--bad); font-weight: 600; }
.order-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.order-po { font-weight: 700; }
.stages { display: flex; gap: 4px; flex-wrap: wrap; }
.stage { border-radius: 999px; padding: 3px 12px; font-size: 12.5px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.stage.past { color: var(--fg); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.stage.now { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.tab { border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.tab.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.tab.on .count-dim { color: inherit; opacity: .8; }
.work-list { display: flex; flex-direction: column; max-height: 55vh; overflow: auto; }
.work-row { display: flex; gap: 10px; align-items: center; text-align: left; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; padding: 9px 4px; color: inherit; text-decoration: none; width: 100%; }
.work-row:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.work-row.is-done { opacity: .55; }
.work-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.work-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-meta { font-size: 12px; color: var(--muted); }
.panel .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quote-line { border-left: 3px solid var(--line); padding-left: 8px; }

/* Conversions, quick replies, glossary suggestions. */
.conv { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.conv-rate { opacity: .8; }
.quick-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; max-height: 46vh; overflow: auto; }
.quick-row { display: flex; gap: 6px; align-items: center; }
.quick { flex: 1; text-align: left; border-radius: 10px; padding: 8px 12px; }
.suggest-box, .rate-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.suggest-box h4 { margin: 0 0 4px; }
.suggest-box .strong { font-weight: 600; } .suggest-box .muted { color: var(--muted); } .suggest-box .small { font-size: 13px; }
.rate-box .link-row input { max-width: 120px; flex: none; }

/* The tour's opening menu. */
.tour-menu { max-width: 520px; width: calc(100vw - 24px); max-height: calc(100vh - 24px); overflow: auto; }
.tour-choose { font-weight: 600; margin: 12px 0 8px; }
.tour-groups { display: flex; flex-direction: column; gap: 6px; }
.tour-group { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; cursor: pointer; margin: 0; color: var(--fg); }
.tour-group.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tour-group input { width: auto; flex: none; accent-color: var(--accent); }
.tg-icon { font-size: 18px; width: 24px; text-align: center; flex: none; }
.tg-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tg-name { font-weight: 600; font-size: 14.5px; }
.tg-about { font-size: 12.5px; color: var(--muted); }
.tg-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tour-menu .actions { flex-wrap: wrap; }
.suggest-box .warn-text { color: #a2551a; margin-top: 2px; }
.bot-setup { margin: 10px 0; display: grid; gap: 4px; } .bot-setup code { font-size: 12px; word-break: break-all; background: var(--soft, rgba(0,0,0,.05)); padding: 6px 8px; border-radius: 6px; display: block; }
.bot-channels { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 8px; } .signup-row .muted { color: var(--muted); } .signup-row .small { font-size: 13px; }

/* ---------------------------------------------------------------- sidebar foot: you + ⚙ settings */
.side-foot { position: relative; padding: 8px 10px; }
.side-foot .me-row { display: flex; align-items: center; gap: 4px; }
.side-foot button.me { flex: 1; min-width: 0; padding: 6px 6px; }
.side-foot .me .grow { overflow: hidden; }
.side-foot .me .me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .me .pos { font-size: 12px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .gear { position: relative; flex: none; width: 36px; height: 36px; padding: 0; border: 0; background: none; border-radius: 10px; font-size: 18px; color: var(--muted); display: grid; place-items: center; }
.side-foot .gear:hover, .side-foot .gear.on { background: var(--hover); color: var(--fg); }
.side-foot .gear .badge { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; font-size: 10px; line-height: 16px; padding: 0 4px; }
.st-menu { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 30; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.06); padding: 6px; max-height: min(78vh, 640px); overflow-y: auto; animation: st-in .12s ease-out; }
@keyframes st-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.st-card { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.st-card .grow { min-width: 0; }
.st-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-sub { font-size: 12px; color: var(--muted); }
.st-group { padding: 2px 0; }
.st-group + .st-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.st-head { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 4px 10px 2px; }
.st-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 14px; color: var(--fg); text-align: left; cursor: pointer; }
.st-item:hover, .st-item:focus-visible { background: var(--hover); outline: none; }
.st-ic { width: 20px; text-align: center; flex: none; }
.st-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-val { font-size: 12px; color: var(--muted); }
.st-val.on { color: var(--accent); font-weight: 600; }
.st-item .badge { margin-left: auto; }
.st-lang { cursor: default; }
.st-lang .st-label { flex: none; }
.st-lang select { flex: 1; min-width: 0; margin-left: auto; padding: 3px 6px; font-size: 13px; border-radius: 6px; }
.st-item.danger { color: #b3261e; }
:root[data-theme="dark"] .st-item.danger { color: #f2a7a0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st-item.danger { color: #f2a7a0; } }

/* ---------------------------------------------------------------- profile */
.pf { display: grid; gap: 4px; }
.pf-top { display: flex; align-items: center; gap: 16px; margin: 2px 0 4px; }
.pf-face-wrap { position: relative; flex: none; }
.pf-face .av { border-radius: 50%; }
.pf-cam { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: var(--bg); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.pf-who { min-width: 0; }
.pf-big { font-size: 20px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-sub { color: var(--muted); font-size: 13px; }
.pf-photo-acts { display: flex; gap: 12px; margin-top: 4px; font-size: 13px; }
.pf-section { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 10px; margin-top: 8px; display: grid; gap: 2px; }
.pf-section label { margin-top: 4px; font-size: 13px; }
.pf .pf-hint { margin: 2px 0 0 !important; }
.pf .actions { margin-top: 10px; }
.pf-head { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pf-section .grid2 select, .pf-section .grid2 input { width: 100%; }
.pf-tz-line { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.pf-status { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; margin-top: 4px; }
.pf-pw summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; }
.pf-pw summary::-webkit-details-marker { display: none; }
.pf-pw summary::after { content: '›'; float: right; color: var(--muted); transition: transform .15s; }
.pf-pw[open] summary::after { transform: rotate(90deg); }
.pf-msg { font-size: 13px; margin-left: 8px; }
.pf-msg.ok { color: #2e7d32; } .pf-msg.bad { color: #b3261e; }
:root[data-theme="dark"] .pf-msg.ok { color: #8fd694; }
.voice [data-act="voice-use"] { margin-left: 6px; font-size: 12px; }
/* Village Desk (web/desk.js): requests, one request, residents. */
.desk-tabs { display: flex; gap: 6px; margin: 4px 0 12px; border-bottom: 1px solid var(--line); }
.desk-tabs button { border: 0; background: none; padding: 8px 12px; border-bottom: 3px solid transparent; border-radius: 0; color: var(--muted); font-weight: 600; }
.desk-tabs button.on { color: var(--fg); border-bottom-color: var(--accent); }
.desk-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.desk-filters select { width: auto; } .desk-filters input[type="search"] { flex: 1; min-width: 160px; }
.desk-check { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; margin: 0; } .desk-check input { width: auto; }
.desk-list { display: flex; flex-direction: column; gap: 6px; }
.desk-row { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; border: 1px solid var(--line); background: var(--field); border-radius: 10px; padding: 9px 12px; }
.desk-row:hover { background: var(--hover); }
.desk-row.late { border-left: 4px solid var(--bad); } .desk-row.closed { opacity: .72; }
.desk-ref { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; font-size: 13px; padding-top: 2px; }
.desk-title { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.desk-row small, .desk-history small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.desk-state { text-align: right; white-space: nowrap; font-size: 13px; }
.desk-row .bad, .desk-meta .bad { color: var(--bad); font-weight: 600; }
.desk-meta { font-size: 13.5px; } .panel p.desk-details { color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bubble); border-radius: 10px; padding: 10px 12px; }
.desk-pill { display: inline-block; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 0 10px; font-weight: 600; }
.desk-pill.closed { border-color: var(--green); color: var(--green); }
.desk-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0; font-size: 14px; }
.desk-facts dt { color: var(--muted); } .desk-facts dd { margin: 0; overflow-wrap: anywhere; }
button.link.strong { color: var(--accent); font-size: 14px; text-align: left; }
.desk-photos { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; } .desk-photos img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.desk-actions { border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px 12px; margin: 12px 0; } .desk-actions #desk-step-note { margin-top: 6px; }
.desk-history { padding-left: 18px; margin: 6px 0 12px; font-size: 14px; } .desk-history li { margin: 6px 0; overflow-wrap: anywhere; }
.panel h3 { margin-top: 14px; } .desk-admin { justify-content: flex-start; }
a.link { color: var(--muted); font-size: 13px; }
/* The Village Desk name is two words: set a little smaller than the one-word factory name. */
.brand.desk-brand .brand-name { font-size: 40px; } .side-brand.desk-brand { font-size: 23px; }
.brand-place { margin-top: 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }

/* ------------------------------------------------------------ Village Desk v2: staff screens */
.desk-tabs { overflow-x: auto; scrollbar-width: thin; flex-wrap: nowrap; }
.desk-tabs button { white-space: nowrap; flex: none; }
.desk-note-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 14px; background: var(--field); }
.desk-note-box > b:first-child { display: block; margin-bottom: 4px; }
.desk-note-box.dup { border-color: var(--accent); border-style: dashed; }
.desk-note-box .link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0; }
.desk-note-box .link-row input, .desk-note-box .link-row select { width: auto; flex: 1 1 140px; min-width: 0; }
.desk-pill.lang { border-color: var(--muted); color: var(--muted); }
.panel p.desk-details.english { background: none; border: 1px dashed var(--line); }
.desk-photos a { position: relative; display: block; }
.desk-photos a span { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.fee-row { border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 6px; }
.desk-drawer { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 10px 0; }
.desk-drawer > summary { cursor: pointer; font-weight: 600; }
.desk-cite { border-left: 3px solid var(--accent); padding: 4px 10px; margin: 6px 0; }
.desk-cite summary { cursor: pointer; } .desk-cite small { display: block; color: var(--muted); }

.wo-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.wo-col { background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 120px; }
.wo-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 2px 4px 8px; }
.wo-card { background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.wo-card.prio-urgent { border-left-color: var(--bad); } .wo-card.prio-this-week { border-left-color: #c9a46a; }
.wo-open { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 0; }
.wo-open:hover { background: var(--hover); }
.wo-ref { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); }
.wo-ref em { font-style: normal; font-weight: 600; }
.wo-open b { display: block; margin: 2px 0; overflow-wrap: anywhere; }
.wo-open small { color: var(--muted); font-size: 12px; }
.wo-send { display: flex; gap: 6px; padding: 0 8px 8px; } .wo-send select { flex: 1; min-width: 0; width: auto; } .wo-send button { padding: 6px 10px; }

.map { position: relative; height: min(60vh, 480px); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: repeating-linear-gradient(0deg, transparent 0 63px, var(--line) 63px 64px), repeating-linear-gradient(90deg, transparent 0 63px, var(--line) 63px 64px), var(--field); touch-action: none; cursor: grab; user-select: none; }
.map-tiles img { position: absolute; width: 256px; height: 256px; pointer-events: none; }
.pin { position: absolute; width: 18px; height: 18px; margin: -18px 0 0 -9px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; background: var(--accent); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); padding: 0; cursor: pointer; }
.pin:hover, .pin:focus-visible { width: 24px; height: 24px; margin: -24px 0 0 -12px; z-index: 2; }
.pin.t-work-order, .pin-dot.t-work-order { background: #2f6f9f; } .pin.t-permit, .pin-dot.t-permit { background: #b98a3e; } .pin.t-records-request { background: #6b5b95; }
.pin.late, .pin-dot.late { box-shadow: 0 0 0 3px var(--bad), 0 2px 6px rgba(0, 0, 0, .35); }
.pin.dup, .pin-dot.dup { border-style: dashed; border-color: #111; }
.pin.closed { opacity: .5; }
.pin.asset, .pin-dot.asset { border-radius: 3px; transform: rotate(45deg); width: 12px; height: 12px; margin: -6px 0 0 -6px; background: #4d7c5a; }
.map-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.map-zoom button { width: 34px; height: 34px; padding: 0; font-size: 18px; font-weight: 700; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.map-credit { position: absolute; right: 6px; bottom: 4px; font-size: 10.5px; background: rgba(255, 255, 255, .8); color: #333; padding: 0 4px; border-radius: 4px; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.pin-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); margin-right: 5px; vertical-align: -1px; border: 2px solid #fff; }
.pin-dot.late { background: var(--accent); } .pin-dot.dup { background: var(--accent); }

.asset-state { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: var(--field); border: 1px solid var(--line); white-space: nowrap; }
.asset-state.s-needs-repair { color: var(--bad); border-color: var(--bad); } .asset-state.s-in-service { color: var(--green); border-color: var(--green); }
.import-preview { overflow-x: auto; } .import-preview table, .dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.import-preview th, .import-preview td, .dash-table th, .dash-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.import-problems { color: var(--bad); font-size: 13px; }
.import-sum { font-size: 15px; }

.notice-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; } .notice-row.urgent { border-left: 4px solid var(--bad); }
.notice-row p { white-space: pre-wrap; margin: 6px 0; } .notice-row small { color: var(--muted); display: block; }
.notice-row .desk-pill { margin-left: 8px; font-size: 12px; }

.dash-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 640px) { .dash-tiles { grid-template-columns: repeat(2, 1fr); } }
.dash-tile { background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.dash-tile b { display: block; font: 700 24px/1.1 var(--display, Georgia), Georgia, serif; } .dash-tile span { color: var(--muted); font-size: 13px; }
.dash-tile.bad b { color: var(--bad); }
.dash-weeks { display: flex; gap: 6px; align-items: flex-end; height: 140px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.dash-week { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.dash-week small { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.dash-pair { flex: 1; width: 100%; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.dash-pair i, .dash-legend i { display: inline-block; width: 40%; max-width: 18px; border-radius: 3px 3px 0 0; min-height: 2px; }
.dash-pair i.in, .dash-legend i.in { background: var(--accent); } .dash-pair i.out, .dash-legend i.out { background: #c9a46a; }
.dash-legend { font-size: 13px; color: var(--muted); } .dash-legend i { width: 10px; height: 10px; margin: 0 4px 0 8px; border-radius: 2px; }
.dash-bars { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.dash-bars li { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr auto; gap: 8px; align-items: center; padding: 4px 0; }
.dash-bars li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bars li i { display: block; height: 8px; border-radius: 4px; background: var(--accent); opacity: .8; }
.dash-table td.bad { color: var(--bad); font-weight: 700; }

.rec-doc { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.rec-findings { list-style: none; padding: 0; margin: 6px 0; font-size: 13.5px; } .rec-findings li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.rec-findings code { background: var(--field); border-radius: 4px; padding: 0 4px; } .rec-findings small { display: block; color: var(--muted); }
.desk-row mark { background: #f5e3a6; color: inherit; border-radius: 3px; }
.msg.failed .desk-state b { color: var(--bad); } .msg.held .desk-state b { color: #a87b1e; } .msg.sent .desk-state b { color: var(--green); }

/* Village Desk overview: every service on one page (web/desk-home.js). */
.desk-home-row { font-weight: 700; }
.desk-home-row .count-dim { font-weight: 500; font-size: 12px; }
.svc-hello { display: flex; gap: 16px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 16px; margin: 4px 0 14px; background: var(--field); }
.svc-hello h3 { margin: 0 0 4px; font: 700 19px/1.25 var(--brand-font); }
.svc-hello p { margin: 0; color: var(--muted); font-size: 14px; }
.svc-hello-acts { flex: none; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.svc { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--field); transition: border-color .15s ease, transform .15s ease; }
.svc:hover { border-color: var(--accent); }
.svc-top { display: flex; align-items: center; gap: 10px; }
.svc-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--bubble); font-size: 18px; }
.svc h3 { margin: 0; font-size: 15px; line-height: 1.25; }
.svc-what { margin: 0; font-size: 13px; color: var(--muted); flex: 1; }
.svc-stat { font-size: 13px; font-weight: 600; }
.svc-stat .bad { color: var(--bad); }
.svc-need { margin: 0; font-size: 12px; padding: 6px 8px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-fg); }
.svc-acts { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.svc-acts .link { font-weight: 600; }
.svc-setup { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.svc-setup h3 { margin: 0; }
.svc-setup ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; font-size: 14px; }
.svc-setup li { color: var(--muted); }
.svc-setup li.on { color: var(--fg); }
.svc-setup li.on span { color: var(--green); font-weight: 700; }
.svc-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 6px; scrollbar-width: thin; }
.svc-strip button { flex: none; white-space: nowrap; font-size: 13px; padding: 6px 10px; border-radius: 999px; background: var(--field); }
.svc-strip button:hover { border-color: var(--accent); }
.tour-menu.desk-tour .tour-groups { max-height: min(52vh, 460px); overflow-y: auto; }
@media (max-width: 760px) {
  .svc-hello { flex-direction: column; align-items: flex-start; }
  .svc-grid { grid-template-columns: 1fr; }
}
.side-foot .gear.signout { width: auto; padding: 0 10px; display: flex; gap: 6px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); }
.side-foot .gear.signout span[aria-hidden] { font-size: 15px; }
.side-foot .gear.signout:hover { color: var(--bad); border-color: var(--bad); }
/* Village Desk: Settings and Sign out are big labelled buttons on their own row under your name. */
.side-foot .me-row.desk { flex-wrap: wrap; gap: 6px; }
.side-foot .me-row.desk button.me { flex: 1 0 100%; }
/* Same size as the other buttons (Huddle, Pinned, Catch up): 15px text, 7px by 12px, 8px corners. */
.side-foot .me-row.desk .gear { flex: 1 1 0; width: auto; height: auto; padding: 7px 12px; display: flex; gap: 6px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 15px; font-weight: 500; color: var(--fg); }
.side-foot .me-row.desk .gear > span[aria-hidden] { font-size: 15px; }
.side-foot .me-row.desk .gear.on, .side-foot .me-row.desk .gear:hover { border-color: var(--accent); background: var(--hover); }
.side-foot .me-row.desk .gear.signout:hover { color: var(--bad); border-color: var(--bad); }
.side-foot .me-row.desk .gear .badge { top: -6px; right: -6px; }

/* Village Desk civic modules: the All features menu, grouped overview, meetings, checklists, Coming up */
.desk-tabs .desk-menu-btn { color: var(--accent); border: 1px solid var(--line); border-radius: 8px; background: var(--field); padding: 6px 12px; margin: 2px 6px 6px 0; border-bottom: 1px solid var(--line); }
.desk-tabs .desk-menu-btn:hover { background: var(--hover); }
.features-menu { position: fixed; z-index: 60; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 48px rgba(0, 0, 0, .22); display: flex; flex-direction: column; overflow: hidden; }
.features-menu.sheet { left: 8px; right: 8px; top: 8px; bottom: 8px; }
.features-menu .fm-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.features-menu .fm-body { overflow-y: auto; padding: 8px 10px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; align-content: start; }
.features-menu .fm-group h4 { margin: 8px 4px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.features-menu .fm-group button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 8px; font-size: 14px; color: var(--fg); }
.features-menu .fm-group button:hover, .features-menu .fm-group button:focus-visible { background: var(--hover); }
.svc-section { margin: 0 0 16px; }
.svc-section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.nt-templates { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.nt-templates button { border: 1px solid var(--line); background: var(--field); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.nt-templates button:hover { background: var(--hover); }
.lib-record { display: flex; flex-direction: column; gap: 2px; }
.lib-record .desk-check { font-size: 13px; color: var(--muted); padding-left: 4px; }
.agenda { margin: 6px 0 8px; padding-left: 22px; }
.agenda li { margin: 4px 0; }
.agenda li > div { display: inline-block; vertical-align: top; max-width: calc(100% - 64px); }
.agenda-move { float: right; white-space: nowrap; }
.agenda-move button { padding: 0 6px; }
.ballots { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 12px; margin: 8px 0; }
.ballots label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.ballots select { width: auto; }
.vote-row { border-top: 1px dashed var(--line); padding: 6px 0; }
.vote-row:first-of-type { border-top: 0; }
.vote-row small { display: block; color: var(--muted); }
.checklist .check-row { border-top: 1px solid var(--line); padding: 8px 0; }
.check-item { display: flex; gap: 8px; align-items: baseline; }
.check-mark { width: 18px; text-align: center; font-weight: 700; color: var(--muted); }
.check-row.r-pass .check-mark, .check-row.r-done .check-mark { color: #2e7d4f; }
.check-row.r-fail .check-mark { color: var(--accent); }
.check-row .link-row button { min-height: 36px; }
.desk-letter { white-space: pre-wrap; font: 14px/1.5 Georgia, serif; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 8px 0; max-height: 360px; overflow-y: auto; }
.cal-day { margin: 0 0 14px; }
.cal-day h3 { font-size: 14px; margin: 0 0 6px; color: var(--muted); }
.cal-day.today h3 { color: var(--accent); }
.cal-day.late h3 { color: var(--accent); }
.cal-day .desk-row { margin: 0 0 6px; }
.desk-row .desk-ref[aria-hidden] { font-size: 18px; }
@media (max-width: 760px) { .agenda-move { float: none; display: block; } .ballots { grid-template-columns: 1fr; } }

/* Who said what. Each person's messages sit on a soft shade of the colour of their profile icon,
   with a stripe of that colour down the left edge and their name in it. Messages in a row from
   one person join into one block, so a new colour always means a new speaker. */
.msg[data-who] { margin-top: 8px; padding: 8px 12px 8px 14px; border-radius: 10px; background: color-mix(in srgb, var(--who) 8%, var(--bg)); box-shadow: inset 3px 0 0 var(--who); }
.msg[data-who]:first-child { margin-top: 0; }
.msg[data-who].same { margin-top: 0; padding-top: 4px; border-top-left-radius: 0; border-top-right-radius: 0; }
.msg[data-who]:has(+ .msg.same) { padding-bottom: 4px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.msg[data-who].same > .av { visibility: hidden; height: 0 !important; }
.msg[data-who] .meta b { color: color-mix(in srgb, var(--who) 80%, #000); }
.msg[data-who] > img.av { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--who); }
.msg[data-who] .second, .msg[data-who] .quote { background: color-mix(in srgb, var(--who) 7%, var(--field)); }
.msg[data-who].pinned { padding-left: 14px; box-shadow: inset 3px 0 0 var(--who), inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.msg[data-who].deleted { background: color-mix(in srgb, var(--who) 4%, var(--bg)); }
:root[data-theme="dark"] .msg[data-who] { background: color-mix(in srgb, var(--who) 17%, var(--bg)); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--who) 70%, #fff); }
:root[data-theme="dark"] .msg[data-who] .meta b { color: color-mix(in srgb, var(--who) 45%, #fff); }
:root[data-theme="dark"] .msg[data-who].deleted { background: color-mix(in srgb, var(--who) 9%, var(--bg)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .msg[data-who] { background: color-mix(in srgb, var(--who) 17%, var(--bg)); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--who) 70%, #fff); }
  :root:not([data-theme="light"]) .msg[data-who] .meta b { color: color-mix(in srgb, var(--who) 45%, #fff); }
  :root:not([data-theme="light"]) .msg[data-who].deleted { background: color-mix(in srgb, var(--who) 9%, var(--bg)); }
}
@media (max-width: 760px) { .msg[data-who] { padding-right: 8px; } }
