:root {
  --accent: #2563EB;
  --accent-deep: #1D4ED8;
  --accent-soft: #DBEAFE;
  --soft: #F1F4F8;
  --paper: #FFFFFF;
  --wood: #6B4423;
  --ink: #111827;
  --muted: #6B7280;
  --line: #E3E6EB;
  --green: #3FA34D;
  --red: #E5484D;
  --bg: #ECEEF1;
  --shadow: 0 12px 32px rgba(60, 45, 20, .10), 0 2px 6px rgba(60, 45, 20, .08);
  --radius: 16px;
  font-family: Outfit, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color-scheme: light; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }
#world.dragging { cursor: grabbing; }

/* ---------- top bar ---------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10; min-height: 60px;
  padding: env(safe-area-inset-top, 0px) calc(16px + env(safe-area-inset-right, 0px)) 0 calc(16px + env(safe-area-inset-left, 0px));
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.spacer { flex: 1; }
.brand { display: flex; align-items: center; gap: 12px; padding-right: 16px; border-right: 1px solid var(--line); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand strong { display: block; font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.brand span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.brand span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.group { display: flex; gap: 2px; }
.icon-btn, .text-btn {
  border: 0; background: transparent; border-radius: 999px; height: 34px; min-width: 34px;
  font-weight: 700; font-size: 16px;
}
.text-btn { font-size: 13px; padding: 0 12px; font-weight: 600; }
.icon-btn:hover, .text-btn:hover { background: var(--soft); }
.chip { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--paper); box-shadow: var(--shadow); font-weight: 700; font-size: 13px; }
.timer-chip { background: var(--accent); color: #fff; font-variant-numeric: tabular-nums; }
.me-chip {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 4px 14px 4px 4px;
  background: #fff; border-radius: 999px; font-weight: 600; font-size: 13px;
}

.avatar {
  position: relative; width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.dot { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; }

/* ---------- dock ---------- */
#dock {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 12px; padding: 8px 10px;
  background: var(--paper); border-radius: 999px; box-shadow: var(--shadow); max-width: calc(100vw - 24px);
}
.team { display: flex; gap: 6px; }
.team button { border: 0; background: transparent; padding: 2px; border-radius: 50%; }
.team button:hover .avatar { transform: translateY(-2px); }
.team .avatar { width: 38px; height: 38px; transition: transform .15s; }
.team button.away .avatar { opacity: .45; }
.dock-actions { display: flex; gap: 4px; padding-left: 10px; border-left: 1px solid var(--line); }
.dock-btn { border: 0; background: var(--soft); border-radius: 999px; padding: 9px 14px; font-weight: 700; font-size: 13px; }
.dock-btn:hover { background: var(--accent-soft); }

/* ---------- panel ---------- */
#panel {
  position: fixed; top: 72px; right: 12px; bottom: 76px; width: 370px; z-index: 9;
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow-y: auto; padding: 18px 18px 22px;
}
.panel-close {
  position: sticky; top: 0; float: right; margin: -6px -6px 0 0; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: var(--soft); font-size: 20px; line-height: 1; z-index: 2;
}
.kicker { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }
#panel h2 { margin: 0 0 6px; font-size: 22px; }
#panel h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.lead { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 12px; }
.fine { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.4; }
.fine a { color: var(--accent); }
.present { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--soft); font-size: 12px; font-weight: 600; }
.pill .avatar { width: 22px; height: 22px; font-size: 10px; border-width: 1px; }
.pill .dot { width: 8px; height: 8px; border-width: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--paper); border-radius: 10px;
  padding: 9px 12px; font-weight: 700; font-size: 13px; text-decoration: none; color: var(--ink);
}
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--accent); border-color: var(--accent-deep); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.btn.block { width: 100%; }
.btn.big { padding: 14px 18px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.row { display: flex; gap: 8px; margin-top: 8px; }
.row > input, .row > select { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 8px; }
input, select, textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; min-height: 70px; line-height: 1.4; }
label.field span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.seg { display: flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 8px 4px; font-size: 12px; font-weight: 700; }
.seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.tasks { list-style: none; padding: 0; margin: 8px 0 0; }
.tasks li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tasks li input { width: auto; }
.tasks li span { flex: 1; }
.tasks li.done span { text-decoration: line-through; color: var(--muted); }
.x { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; }

.notes-list { list-style: none; padding: 0; margin: 0; }
.notes-list li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.notes-list b { display: block; font-size: 12px; color: var(--muted); }

.ideas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.idea { position: relative; padding: 10px 24px 10px 10px; border-radius: 4px; font-size: 13px; min-height: 64px; box-shadow: 0 2px 4px rgba(0,0,0,.12); word-break: break-word; }
.idea .x { position: absolute; top: 2px; right: 2px; }
.swatches { display: flex; gap: 6px; margin-top: 8px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }

.wb-preview { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: block; margin-bottom: 8px; }

.clock { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; margin: 4px 0 8px; }

.chat { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 50vh; overflow-y: auto; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.35; background: var(--soft); align-self: flex-start; }
.msg.mine { background: var(--accent); color: #fff; align-self: flex-end; }
.msg b { display: block; font-size: 11px; opacity: .7; }

.room-list { list-style: none; margin: 0; padding: 0; }
.room-list button { display: flex; width: 100%; justify-content: space-between; align-items: center; border: 0; background: transparent; padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 600; }
.room-list button:hover { background: var(--soft); }
.room-list small { color: var(--muted); font-weight: 500; }

/* ---------- toasts ---------- */
#toasts { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(460px, calc(100vw - 24px)); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 14px; box-shadow: var(--shadow); font-size: 14px; animation: rise .2s ease; }
.toast button { border: 0; background: var(--accent); color: #fff; border-radius: 8px; padding: 5px 10px; font-weight: 700; font-size: 12px; }
.toast button + button { background: rgba(255,255,255,.15); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- modal ---------- */
#modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(17, 24, 39, .45); backdrop-filter: blur(6px); }
#modal[hidden] { display: none; }
.modal-card { position: relative; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--paper); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.modal-card.wide { width: min(1200px, 100%); padding: 16px; }
.modal-card h2 { margin: 0 0 6px; font-size: 24px; }
.who { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.who button { display: flex; align-items: center; gap: 10px; padding: 10px; border: 2px solid var(--line); background: #fff; border-radius: 14px; text-align: left; font-weight: 700; }
.who button.on { border-color: var(--accent); background: var(--soft); }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.colors input { height: 40px; padding: 2px; }
.help-list { padding-left: 18px; line-height: 1.6; font-size: 14px; }

/* face scan, theater video, app launcher */
.face-row { display: flex; gap: 14px; align-items: center; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.face-row .avatar.lg { width: 64px; height: 64px; font-size: 20px; }
.scan { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #000; }
.scan video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.scan::after { content: ''; position: absolute; left: 50%; top: 46.9%; width: 46.5%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 999px rgba(0, 0, 0, .45); }
.video { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 10px; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.face-btn { color: var(--accent); background: var(--accent-soft); margin-right: 6px; }
.face-btn:hover { background: #BFDBFE; }
/* Screen: a floating TV window over the house. Drag the bar to move it, the corner to resize it. */
#screen { position: fixed; z-index: 20; display: flex; flex-direction: column; min-width: 320px; min-height: 200px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
  padding: 8px; background: #0F1117; color: #E5E7EB; border-radius: 16px; box-shadow: 0 24px 60px rgba(15, 17, 23, .45); resize: both; overflow: hidden; }
#screen[hidden] { display: none; }
#screen.max { left: 12px !important; top: 72px !important; width: calc(100vw - 24px) !important; height: calc(100vh - 148px) !important; resize: none; }
#screen.min { height: auto !important; min-height: 0; resize: none; }
#screen.min .scr-body { flex: none; height: 0; overflow: hidden; }   /* kept in the page so the video keeps playing */
#screen.dragging iframe { pointer-events: none; }
.scr-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.scr-view { flex: 1; min-height: 0; border-radius: 10px; overflow: hidden; background: #000; }
.scr-view iframe { width: 100%; height: 100%; border: 0; display: block; }
.scr-pop { margin: 0; text-align: center; }
.tv-bar { display: flex; align-items: center; gap: 6px; cursor: grab; touch-action: none; }
#screen.dragging .tv-bar { cursor: grabbing; }
.scr-app { width: auto; max-width: 60%; padding: 6px 10px; border-radius: 999px; border-color: #2D3443; background: #1F2430; color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; }
#screen .icon-btn { flex: none; color: #E5E7EB; }
#screen .icon-btn:hover { background: #1F2430; }
#screen .row input { background: #1F2430; border-color: #2D3443; color: #fff; }
.tv-idle { height: 100%; display: grid; place-content: center; text-align: center; gap: 8px; padding: 24px; color: #94A3B8; }
.tv-idle b { font-size: 28px; color: #fff; }
.tv-idle p { margin: 0 auto; max-width: 440px; }
.tv-idle .btn { justify-self: center; }

/* first visit: a landing card beside the live floor instead of a blurred modal */
#modal.landing { background: transparent; backdrop-filter: none; place-items: center start; padding: 76px 16px 16px max(16px, 5vw); pointer-events: none; }
#modal.landing .modal-card { pointer-events: auto; width: min(400px, 100%); padding: 30px 28px; border: 1px solid var(--line); box-shadow: 0 30px 60px rgba(60, 45, 20, .14); }
.landing h1 { margin: 8px 0 12px; font-size: 40px; line-height: 1.04; letter-spacing: -.03em; font-weight: 700; }
.landing .lead { font-size: 15px; }
.landing .pick { margin: 18px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.landing .who { grid-template-columns: 1fr; margin-top: 8px; }

.wb-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.wb-tools .swatch { width: 28px; height: 28px; }
.wb-tools .sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
#wbCanvas { width: 100%; height: auto; aspect-ratio: 16 / 9; background: #fff; border-radius: 12px; border: 1px solid var(--line); touch-action: none; cursor: crosshair; display: block; }

/* ---------- quest log ---------- */
#quests { position: fixed; top: 72px; left: 12px; z-index: 8; width: 300px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px 14px; }
#quests[hidden] { display: none; }
#quests.mini { width: auto; padding: 0; background: transparent; box-shadow: none; }
.q-head { display: flex; align-items: center; gap: 6px; }
.q-title { flex: 1; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-deep); }
.q-count { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; margin-right: 4px; }
.q-add { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--soft); font-weight: 800; }
.q-add:hover { background: var(--accent-soft); }
.q-project { margin: 10px 0 0; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.q-list { list-style: none; margin: 4px 0 0; padding: 0; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; max-height: 64px; overflow: hidden; transition: max-height .3s ease, opacity .3s ease, padding .3s ease; }
.q-text { position: relative; flex: 1; font-size: 13px; color: var(--muted); line-height: 1.3; }
.q-item.active .q-text { font-size: 16px; font-weight: 800; color: var(--ink); }
.q-item.active .q-text::before { content: '▶ '; color: var(--accent-deep); }
.q-text::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.q-item.done .q-text { color: var(--muted); }
.q-item.done .q-text::after { transform: scaleX(1); }
.q-item.gone { max-height: 0; opacity: 0; padding: 0; }
.q-item.fresh { animation: glow 1.1s ease; border-radius: 8px; }
.q-check { flex: none; width: 26px; height: 26px; border: 2px solid var(--accent-deep); border-radius: 8px; background: #fff; font-weight: 900; line-height: 1; }
.q-check:hover { background: var(--soft); }
.q-item.done .q-check { background: var(--accent); color: #fff; animation: pop .3s ease; }
.q-new { margin-left: 6px; padding: 2px 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .08em; vertical-align: middle; }
.q-carry { color: var(--accent-deep); font-weight: 800; }
.q-more, .q-empty { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.q-banner { margin: 10px 0 8px; text-align: center; font-weight: 800; }
.q-pill { border: 0; border-radius: 999px; padding: 8px 14px; background: var(--paper); box-shadow: var(--shadow); font-weight: 700; font-size: 13px; max-width: min(320px, calc(100vw - 24px)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-xp { position: fixed; z-index: 31; pointer-events: none; font-weight: 900; color: var(--accent-deep); text-shadow: 0 1px 0 #fff; animation: floatUp 1s ease forwards; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@keyframes pop { 50% { transform: scale(1.25); } }
@keyframes glow { from { background: var(--accent-soft); } }
@keyframes floatUp { to { transform: translateY(-36px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .q-item, .q-text::after { transition: none; }
  .q-item.fresh, .q-item.done .q-check, .q-xp { animation: none; }
}

/* ---------- projects ---------- */
.proj { padding: 10px 0; border-bottom: 1px solid var(--line); }
.proj-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.proj-head small, .tasks small { color: var(--muted); font-weight: 500; }
.proj .row select { flex: none; width: auto; }
.newproj { margin-top: 10px; }
.newproj summary { list-style: none; cursor: pointer; }
.newproj summary::-webkit-details-marker { display: none; }
.members { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; font-weight: 600; }
.members input { width: auto; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.link-chip { display: inline-flex; align-items: center; border-radius: 999px; background: var(--accent-soft); font-size: 12px; font-weight: 700; }
.link-chip a { color: var(--accent-deep); text-decoration: none; padding: 4px 4px 4px 10px; }
.link-chip a:last-child { padding-right: 10px; }
.link-chip .x { font-size: 15px; padding: 0 8px 0 2px; }
details.more { margin-top: 6px; }
details.more summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--accent); }

/* ---------- war room, focus room ---------- */
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.board small { color: var(--muted); }
.board small.on { display: block; margin-top: 2px; color: var(--ink); }
.standups p { margin: 4px 0 0; font-size: 13px; line-height: 1.35; }
.standups p small { display: inline-block; min-width: 64px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.standups .blocker { color: var(--red); }
.metrics { list-style: none; margin: 0; padding: 0; }
.metrics li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.metric-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 700; }
.metric-head small { color: var(--muted); font-weight: 500; }
.metrics .row { margin-top: 4px; align-items: center; }
.metric-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
input.metric-value { padding: 4px 10px; }
.focus-on { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.25; }

/* ---------- floors ---------- */
#fade { position: fixed; inset: 0; z-index: 35; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
#fade.on { opacity: 1; }
#panel h3.floor-h { margin-top: 16px; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.col h4 { margin: 0 0 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tcard { background: var(--soft); border-radius: 8px; padding: 6px 7px; margin-top: 6px; font-size: 12px; line-height: 1.3; word-break: break-word; }
.tcard small { display: block; color: var(--muted); margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { #fade { transition: none; } }

/* ---------- company tools ---------- */
.light { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #94A3B8; }
.light.up { background: var(--green); box-shadow: 0 0 0 3px rgba(63, 163, 77, .18); }
.light.down { background: var(--red); box-shadow: 0 0 0 3px rgba(229, 72, 77, .18); }
.pipe { list-style: none; margin: 0; padding: 0; }
.pipe li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pipe li.won .pipe-head b { color: var(--green); }
.pipe li.lost { opacity: .55; }
.pipe-head { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.pipe-head small { flex: 1; color: var(--muted); }
.pipe .row select { flex: none; width: auto; }
.goal { padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
.goal-head { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.goal-head span { flex: 1; }
.goal input[type=range] { padding: 0; border: 0; accent-color: var(--accent); }
.bar { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.star { margin: 0; font-size: 14px; color: var(--muted); }
.star b { font-size: 28px; color: var(--ink); margin-right: 6px; }
small.late { color: var(--red); font-weight: 700; }

/* ---------- speed ---------- */
.modal-card.cmd { width: min(560px, 100%); padding: 10px; align-self: start; margin-top: 12vh; }
.cmdk input { font-size: 16px; padding: 12px 14px; }
.cmd-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.cmd-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; }
.cmd-list li small { color: var(--muted); font-weight: 500; }
.cmd-list li.on { background: var(--accent-soft); }
.cmd-list li.none { color: var(--muted); cursor: default; font-weight: 500; }
.cmdk .fine { text-align: center; }
.gh { list-style: none; margin: 0; padding: 0; }
.gh li { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.3; }
.gh a { color: var(--ink); text-decoration: none; font-weight: 600; }
.gh a:hover { color: var(--accent); }
.gh small { display: block; color: var(--muted); }
#banner { position: fixed; left: 50%; top: 38%; z-index: 36; transform: translate(-50%, -50%); padding: 18px 30px; border-radius: 20px; background: var(--ink); color: #fff; text-align: center; box-shadow: var(--shadow); pointer-events: none; animation: bannerIn .45s ease; }
#banner[hidden] { display: none; }
#banner b { display: block; font-size: 34px; letter-spacing: .08em; color: var(--accent-soft); }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, -40%) scale(.92); } }
@media (prefers-reduced-motion: reduce) { #banner { animation: none; } }

@media (max-width: 760px) {
  #quests { top: calc(108px + env(safe-area-inset-top, 0px)); left: calc(8px + env(safe-area-inset-left, 0px)); width: min(300px, calc(100vw - 16px)); padding: 10px 12px; }
  #quests .q-item:not(.active), #quests .q-more { display: none; }
  #screen:not(.max) { left: 8px !important; top: auto !important; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); width: calc(100vw - 16px) !important; height: 42vh !important; resize: none; }
  #screen.min { height: auto !important; }
  #topbar { padding-left: calc(8px + env(safe-area-inset-left, 0px)); padding-right: calc(8px + env(safe-area-inset-right, 0px)); flex-wrap: wrap; }
  .brand { border-right: 0; padding-right: 0; }
  .brand span { display: none; }
  #modal.landing { place-items: end center; padding: 16px; }
  .landing h1 { font-size: 30px; }
  .text-btn { padding: 0 8px; }
  .me-chip span.name { display: none; }
  #panel { top: auto; left: calc(8px + env(safe-area-inset-left, 0px)); right: calc(8px + env(safe-area-inset-right, 0px)); bottom: calc(74px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: 52%; }
  #dock { bottom: calc(8px + env(safe-area-inset-bottom, 0px)); gap: 8px; padding: 6px 8px; }
  .team .avatar { width: 32px; height: 32px; }
  .dock-btn { padding: 8px 10px; }
  #toasts { top: 110px; }
}
