/* Layout: a one-screen workshop wall. Header, pegboard message wall and composer on the left; on wide screens a printer rail hangs on the right. */
:root {
  --bg: #E7EAED;
  --peg: #D0D5DB;
  --surface: #FFFFFF;
  --surface-2: #F2F4F6;
  --ink: #14181D;
  --muted: #59626D;
  --line: #D2D7DD;
  --accent: #F5C20A;
  --accent-strong: #D9A700;
  --accent-ink: #1A1500;
  --mine: #FFF0B3;
  --mine-line: #E9CF73;
  --link: #1C59BF;
  --tape: #1F2B46;
  --tape-ink: #F3F5F9;
  --ok: #166B3C;
  --warn: #A9500A;
  --bad: #BF2A2A;
  --bad-ink: #FFFFFF;
  --focus: #1C59BF;
  --scrim: rgba(12, 15, 19, .48);
  --shadow: 0 1px 2px rgba(20, 24, 29, .07), 0 3px 10px rgba(20, 24, 29, .06);
  --display: "Big Shoulders", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101317; --peg: #1A1F25; --surface: #191D22; --surface-2: #21262C; --ink: #E8EBEE; --muted: #99A2AC;
    --line: #2B3239; --accent: #FFC928; --accent-strong: #FFD757; --accent-ink: #1A1500; --mine: #352E14; --mine-line: #574B1D;
    --link: #86B3FF; --tape: #2B4887; --tape-ink: #F3F5F9; --ok: #4CC07D; --warn: #F0A262; --bad: #FF7474; --bad-ink: #1A0A0A; --focus: #86B3FF;
    --scrim: rgba(0, 0, 0, .62); --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 3px 12px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101317; --peg: #1A1F25; --surface: #191D22; --surface-2: #21262C; --ink: #E8EBEE; --muted: #99A2AC;
  --line: #2B3239; --accent: #FFC928; --accent-strong: #FFD757; --accent-ink: #1A1500; --mine: #352E14; --mine-line: #574B1D;
  --link: #86B3FF; --tape: #2B4887; --tape-ink: #F3F5F9; --ok: #4CC07D; --warn: #F0A262; --bad: #FF7474; --bad-ink: #1A0A0A; --focus: #86B3FF;
  --scrim: rgba(0, 0, 0, .62); --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 3px 12px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

[hidden] { display: none !important; }
html { box-sizing: border-box; height: 100%; background: var(--surface); }
*, *::before, *::after { box-sizing: inherit; }
body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; overflow: hidden; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app { position: fixed; left: 0; right: 0; top: var(--app-top, 0px); height: var(--app-h, 100dvh); display: flex; flex-direction: column; }

/* Header */
.bar { flex: none; background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 3; }
.bar-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand h1 { margin: 0; font: 800 26px/0.95 var(--display); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.brand p { margin: 2px 0 0; font: 400 12px/1.2 var(--mono); color: var(--muted); letter-spacing: .04em; white-space: nowrap; }
.hours-chip { display: inline-flex; align-items: center; gap: 7px; min-width: 0; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font: 600 13px/1 var(--body); white-space: nowrap; }
.hours-chip #hoursText { overflow: hidden; text-overflow: ellipsis; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.open { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.dot.closed { background: var(--bad); }
.here { display: flex; align-items: center; gap: 6px; flex: none; font: 600 13px/1 var(--body); color: var(--muted); }
.here .live { display: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.here .stack { display: flex; }
.here .stack .av { width: 26px; height: 26px; font-size: 11px; margin-left: -7px; box-shadow: 0 0 0 2px var(--surface); }
.here .stack .av:first-child { margin-left: 0; }
.me-btn { border: 0; background: none; padding: 0; border-radius: 50%; display: grid; place-items: center; min-width: 40px; min-height: 40px; }
.me-btn .av { width: 34px; height: 34px; font-size: 13px; }

/* Avatars: a filament spool in the person's colour */
.av { --c: #7A8591; width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--c); color: var(--av-ink, #fff); font: 700 14px/1 var(--body); letter-spacing: .01em; box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--c) 55%, #000 18%), inset 0 0 0 5px color-mix(in srgb, var(--c) 88%, #fff 12%); user-select: none; }
.av.claude { --c: var(--tape); color: var(--accent); }
.av.claude svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }

/* Main grid */
.main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); max-width: 1240px; width: 100%; margin: 0 auto; }
.chat { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.rail { display: none; }
@media (min-width: 960px) {
  .main { grid-template-columns: minmax(0, 1fr) 344px; }
  .rail { display: block; overflow-y: auto; border-left: 1px solid var(--line); background: var(--surface-2); }
  .strip { display: none !important; }
}

/* Mobile printer strip */
.strip { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-block: 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.strip button { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 6px 10px 6px 8px; border-radius: 12px; border: 1px solid var(--line); border-left: 5px solid var(--edge, var(--line)); background: var(--surface-2); text-align: left; }
.strip button.run { --edge: var(--accent); }
.strip button.free { --edge: var(--ok); }
.strip button.done { --edge: var(--link); }
.strip button.issue { border-left-color: transparent; border-image: repeating-linear-gradient(-45deg, var(--accent) 0 4px, var(--ink) 4px 8px) 0 0 0 5 / 0 0 0 5px; }
.strip .dymo { font-size: 10px; padding: 3px 6px 2px; }
.strip .st-t { min-width: 0; font: 600 13px/1.15 var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip .st-t small { display: block; font: 400 11.5px/1.2 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.sdot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--muted); }
.sdot.run { background: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.sdot.free { background: var(--ok); }
.sdot.issue { background: repeating-linear-gradient(-45deg, var(--accent) 0 3px, var(--ink) 3px 6px); }
.sdot.done { background: var(--link); }

/* Label-maker tape */
.dymo { display: inline-block; font: 600 11.5px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--tape-ink); background: var(--tape); padding: 4px 9px 3px; border-radius: 3px; white-space: nowrap; text-shadow: 0 1px 0 rgba(0, 0, 0, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 -1px 0 rgba(0, 0, 0, .3), 0 1px 1px rgba(0, 0, 0, .12); }
.dymo.sm { font-size: 10.5px; padding: 3px 7px 2px; }

/* Message wall */
.scroller { flex: 1; min-height: 64px; overflow-x: hidden; overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain; background-color: var(--bg); background-image: radial-gradient(circle, var(--peg) 1.7px, transparent 2.1px); background-size: 22px 22px; background-attachment: local; scroll-padding-bottom: 16px; }
.log-in { max-width: 780px; margin: 0 auto; padding-block: 18px 10px; display: flex; flex-direction: column; min-height: 100%; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; margin-top: auto; }

.day { align-self: center; margin: 18px 0 10px; }
.unread { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--warn); }
.unread::before, .unread::after { content: ""; flex: 1; height: 0; border-top: 2px dashed color-mix(in srgb, var(--warn) 55%, transparent); }

.msg { display: flex; gap: 10px; align-items: flex-end; margin-top: 3px; }
.msg.first { margin-top: 14px; }
.msg .av-slot { width: 36px; flex: none; align-self: flex-start; }
.msg .col { min-width: 0; max-width: min(560px, 84%); display: flex; flex-direction: column; align-items: flex-start; }
.msg.mine { flex-direction: row-reverse; }
.msg.mine .av-slot { display: none; }
.msg.mine .col { align-items: flex-end; }
.meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; max-width: 100%; margin: 0 4px 4px; font: 400 12px/1.2 var(--mono); color: var(--muted); }
.meta .nm { font: 700 13.5px/1.2 var(--body); color: var(--ink); }
.meta .nm.auto { font-style: italic; font-weight: 600; }
.meta .nm, .meta .tag { min-width: 0; overflow-wrap: anywhere; }
.meta .tag { font: 600 11px/1 var(--mono); padding: 3px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.meta .tag.org { background: var(--tape); border-color: var(--tape); color: var(--tape-ink); }
.bubble { position: relative; max-width: 100%; padding: 9px 13px 9px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow-wrap: anywhere; white-space: pre-wrap; cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent; }
.msg:not(.mine) .bubble { border-top-left-radius: 6px; }
.msg:not(.mine):not(.first) .bubble { border-top-left-radius: 6px; }
.msg.mine .bubble { background: var(--mine); border-color: var(--mine-line); border-top-right-radius: 6px; }
.bubble.big { font-size: 38px; line-height: 1.1; padding: 4px 8px; background: transparent !important; border-color: transparent !important; box-shadow: none; }
.bubble.gone { font-style: italic; color: var(--muted); background: transparent; box-shadow: none; border-style: dashed; cursor: default; }
.msg.open .bubble { outline: 2px solid color-mix(in srgb, var(--focus) 55%, transparent); outline-offset: 1px; }
.msg.flash .bubble { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 70%, transparent); } 100% { box-shadow: var(--shadow); } }
.msg.sending .bubble { opacity: .65; }
.more { flex: none; align-self: center; width: 30px; height: 30px; margin: 0 2px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; opacity: 0; transition: opacity .12s; }
.more svg.i { width: 18px; height: 18px; }
.msg:hover .more, .msg.open .more, .more:focus-visible { opacity: 1; }
.more:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
@media (hover: none) {
  .more:not(:focus-visible) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; }
}

.quote { display: block; width: 100%; margin: -2px 0 7px; padding: 6px 9px; border: 0; border-left: 3px solid var(--accent-strong); border-radius: 6px; background: color-mix(in srgb, var(--ink) 6%, transparent); text-align: left; font: 400 13px/1.35 var(--body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote b { color: var(--ink); font-weight: 700; }

.ph { display: block; margin: 2px 0 6px; padding: 0; border: 0; background: var(--surface-2); border-radius: 12px; overflow: hidden; width: min(300px, 100%); }
.ph img { display: block; width: 100%; height: auto; max-width: 100%; object-fit: cover; }
.ph.broken { display: grid; place-items: center; min-height: 90px; color: var(--muted); font: 400 13px/1.3 var(--body); padding: 12px; cursor: default; }
.bubble.only-photo { padding: 4px; }
.bubble.only-photo .ph { margin: 0; }

.rxs { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 2px 0; }
.rxs button { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: 600 13px/1 var(--body); }
.rxs button.me { border-color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.rxs button span { font-size: 15px; }

.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0 2px; padding: 5px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); animation: pop .16s ease-out; }
.acts .em { width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; font-size: 20px; line-height: 1; }
.acts .em:hover, .acts .em.me { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.acts .sep { width: 1px; align-self: stretch; background: var(--line); margin: 4px 2px; }
.acts .tx { display: inline-flex; align-items: center; gap: 5px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; font: 600 13.5px/1 var(--body); }
.acts .tx:hover { background: var(--surface-2); }
.acts .tx.danger { color: var(--bad); }
.acts .tx.arm { background: var(--bad); color: var(--bad-ink); }
@keyframes pop { from { transform: translateY(4px) scale(.98); opacity: 0; } }

.msg.enter .col { animation: extrude .32s cubic-bezier(.2, .9, .3, 1.2); transform-origin: bottom left; }
.msg.mine.enter .col { transform-origin: bottom right; }
@keyframes extrude { from { transform: scaleY(.2) translateY(10px); opacity: 0; } 60% { opacity: 1; } }

/* Status cards (in chat and on the board) */
.stc { white-space: normal; min-width: min(260px, 70vw); }
.stc-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.pill { font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 5px 8px 4px; border-radius: 999px; white-space: nowrap; }
.pill.run { background: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--ink); }
.pill.free { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.pill.issue { background: var(--accent); color: var(--accent-ink); }
.pill.done { background: color-mix(in srgb, var(--link) 16%, transparent); color: var(--link); }
.pill.unknown { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.stc-run { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.stc-big { font: 600 19px/1.15 var(--mono); font-variant-numeric: tabular-nums; }
.stc-sub { font: 400 13px/1.3 var(--body); color: var(--muted); margin-top: 2px; }
.stc-note { margin: 8px 0 0; font: 400 15px/1.4 var(--body); white-space: pre-wrap; }
.stc-free, .stc-issue { margin-top: 8px; font: 600 15px/1.35 var(--body); }
.stc-issue { padding-top: 8px; border-top: 6px solid transparent; border-image: repeating-linear-gradient(-45deg, var(--accent) 0 7px, var(--ink) 7px 14px) 6; }
.stc .mini-act { margin-top: 10px; }
.stc-ended { margin-top: 8px; }

/* Build-volume tower: fills bottom-up in layer lines */
.tower { position: relative; width: 34px; height: 44px; flex: none; border: 2px solid var(--ink); border-top-style: dashed; border-radius: 3px 3px 2px 2px; background: color-mix(in srgb, var(--ink) 5%, transparent); overflow: hidden; }
.tower::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: -2px; height: 4px; background: var(--ink); }
.tower i { position: absolute; left: 3px; right: 3px; bottom: 2px; height: calc(var(--p, 0) * 100% - 4px); min-height: 2px; background: repeating-linear-gradient(0deg, var(--accent) 0 2px, var(--accent-strong) 2px 3px); border-radius: 1px; transition: height .6s ease; }
.tower.done i { background: repeating-linear-gradient(0deg, color-mix(in srgb, var(--link) 70%, var(--surface)) 0 2px, var(--link) 2px 3px); }

/* Typing line */
.typing { min-height: 26px; padding: 6px 4px 0 46px; font: 400 13px/1.3 var(--body); color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 2px; background: var(--muted); animation: bead 1.1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bead { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Empty state */
.empty { margin: auto 0; padding: 24px 0 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.empty[hidden] { display: none; }
.empty svg.purge { width: min(300px, 80%); height: auto; }
.purge path { fill: none; stroke: var(--accent-strong); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.4s .2s ease-out forwards; }
.purge .plate { fill: var(--surface-2); stroke: var(--line); stroke-width: 2; stroke-dasharray: none; animation: none; stroke-dashoffset: 0; }
.purge .nz { fill: var(--ink); stroke: none; animation: none; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.empty h2 { margin: 0; font: 800 30px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; text-wrap: balance; }
.empty p { margin: 0; max-width: 42ch; color: var(--muted); text-wrap: pretty; }
.starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 560px; margin-top: 4px; }
.starters button { padding: 9px 14px; min-height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font: 600 14px/1.25 var(--body); text-align: left; }
.starters button:hover { border-color: var(--accent-strong); }
.loading { font: 400 13px/1 var(--mono); color: var(--muted); letter-spacing: .06em; }

/* Jump pill */
.jump { position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px; min-height: 40px; border-radius: 999px; border: 0; background: var(--tape); color: var(--tape-ink); font: 600 14px/1 var(--body); box-shadow: 0 4px 16px rgba(0, 0, 0, .25); }
.jump-wrap { position: relative; flex: none; height: 0; }

/* Access card */
.access { flex: none; background: var(--surface); border-top: 1px solid var(--line); }
.access-in { max-width: 780px; margin: 0 auto; padding-block: 14px calc(14px); display: flex; gap: 12px; align-items: flex-start; }
.access-in svg { margin-top: 2px; color: var(--muted); }
.access h3 { margin: 0 0 2px; font: 700 15px/1.3 var(--body); }
.access p { margin: 0; font: 400 14px/1.4 var(--body); color: var(--muted); }
.access-in > div { flex: 1; min-width: 0; }
.access.lost svg { color: var(--warn); }
.join { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.join .text-in { flex: 1; min-width: 150px; min-height: 44px; font: 600 16px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.join .text-in::placeholder { letter-spacing: .04em; text-transform: none; font-family: var(--body); font-weight: 400; }
.join-err { margin-top: 6px !important; color: var(--bad) !important; }

/* Composer */
.composer { flex: none; background: var(--surface); border-top: 1px solid var(--line); margin: 0; }
.comp-in { max-width: 780px; margin: 0 auto; padding-block: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.tools { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tools::-webkit-scrollbar { display: none; }
.tool { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 34px; padding: 0 12px 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font: 600 13px/1 var(--body); white-space: nowrap; }
.tool svg.i { width: 17px; height: 17px; }
.tool:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.tool:disabled { opacity: .5; cursor: default; }
.tool[aria-pressed="true"] { background: var(--tape); border-color: var(--tape); color: var(--tape-ink); }
.tool[aria-pressed="true"] svg { color: var(--accent); }
.row { display: flex; align-items: flex-end; gap: 8px; }
.field { flex: 1; min-width: 0; display: flex; align-items: flex-end; border: 1.5px solid var(--line); border-radius: 22px; background: var(--surface-2); transition: border-color .15s; }
.field:focus-within { border-color: var(--focus); }
.asking .field { border-color: var(--tape); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tape) 18%, transparent); }
textarea#msgInput { flex: 1; min-width: 0; min-height: 43px; resize: none; border: 0; outline: 0; background: transparent; padding: 10px 14px; max-height: min(148px, 22dvh); line-height: 1.4; font-size: 16px; }
textarea#msgInput::placeholder { color: var(--muted); }
.send { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: inset 0 -3px 0 var(--accent-strong); transition: transform .12s, opacity .12s; }
.send:active { transform: scale(.94); }
.send:disabled { opacity: .45; cursor: default; }
.send svg.i { width: 22px; height: 22px; stroke-width: 2.2; }
.asking .send { background: var(--tape); color: var(--accent); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3); }
.count { font: 400 12px/1 var(--mono); color: var(--muted); align-self: flex-end; padding: 0 4px 8px; }
.count.over { color: var(--bad); }
.chipbar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font: 400 13.5px/1.3 var(--body); min-width: 0; }
.chipbar .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chipbar .txt b { font-weight: 700; }
.chipbar img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex: none; }
.chipbar.ask .txt { white-space: normal; }
.chipbar.ask { background: color-mix(in srgb, var(--tape) 10%, var(--surface)); border-color: color-mix(in srgb, var(--tape) 35%, var(--line)); }
.xbtn { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--muted); }
.xbtn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }

/* Rail */
.rail-in { padding-block: 18px 28px; display: flex; flex-direction: column; gap: 14px; }
.rail h2 { margin: 6px 0 0; }
.board { display: flex; flex-direction: column; gap: 12px; }
.pcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 12px; box-shadow: var(--shadow); }
.pcard::before { content: ""; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); }
.pcard.issue { border-color: color-mix(in srgb, var(--accent-strong) 70%, var(--line)); }
.pcard.issue .stripe { height: 8px; margin: 10px -14px 0; background: repeating-linear-gradient(-45deg, var(--accent) 0 9px, var(--ink) 9px 18px); }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pc-body { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.pc-txt { min-width: 0; }
.pc-big { font: 600 20px/1.15 var(--mono); font-variant-numeric: tabular-nums; }
.pc-sub { font: 400 13px/1.35 var(--body); color: var(--muted); margin-top: 3px; }
.pc-note { margin: 10px 0 0; font: 400 14px/1.4 var(--body); overflow-wrap: anywhere; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ok); }
.live-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.pc-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font: 600 14px/1 var(--body); }
.btn:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.btn.primary { background: var(--accent); border-color: var(--accent-strong); color: var(--accent-ink); box-shadow: inset 0 -2px 0 var(--accent-strong); }
.btn.dark { background: var(--tape); border-color: var(--tape); color: var(--tape-ink); }
.btn.sm { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: default; }
.hours { width: 100%; border-collapse: collapse; font: 400 14px/1.3 var(--body); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.hours td { padding: 8px 12px; border-top: 1px solid var(--line); }
.hours tr:first-child td { border-top: 0; }
.hours td:last-child { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hours tr.today td { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); font-weight: 700; }
.hours tr.closed td:last-child { color: var(--muted); }
.note { margin: 0; font: 400 13px/1.45 var(--body); color: var(--muted); }
.hours-now { display: flex; align-items: center; gap: 8px; font: 700 15px/1.3 var(--body); }
.rail .flash-rail { animation: flash-rail 1.2s ease-out; }
@keyframes flash-rail { 0%, 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 70%, transparent); } }

/* Sheets */
dialog.sheet { width: min(560px, 100%); max-width: 100%; max-height: min(92%, 760px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); overflow: auto; }
dialog.sheet::backdrop { background: var(--scrim); }
dialog.sheet[open] { animation: sheet-in .22s cubic-bezier(.2, .9, .3, 1); }
@keyframes sheet-in { from { transform: translateY(16px); opacity: 0; } }
@media (max-width: 640px) {
  dialog.sheet { margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0; max-height: 92%; }
  dialog.sheet[open] { animation-name: sheet-up; }
  @keyframes sheet-up { from { transform: translateY(40%); } }
}
.sheet form, .sheet .sheet-body { display: flex; flex-direction: column; gap: 16px; padding: 18px max(18px, env(safe-area-inset-left, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-right, 0px)); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-h h2 { margin: 0; font: 800 24px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.sheet fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.sheet legend, .field-l { display: block; margin: 0 0 7px; padding: 0; font: 600 12px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 6px 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); font: 700 15px/1.15 var(--body); text-align: center; }
.seg input:checked + span { border-color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg .sdot { width: 9px; height: 9px; }
.dur { display: flex; gap: 10px; }
.dur label { display: flex; align-items: center; gap: 8px; padding: 0 14px 0 6px; min-height: 54px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); font: 600 15px/1 var(--mono); color: var(--muted); }
.dur input { width: 64px; border: 0; background: transparent; outline: 0; font: 600 26px/1 var(--mono); text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.dur label:focus-within { border-color: var(--focus); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.quick button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: 600 13px/1 var(--mono); }
.done-at { margin: 12px 0 0; font: 700 16px/1.35 var(--body); }
.done-at span { font-family: var(--mono); }
.after { margin: 6px 0 0; padding: 9px 12px; border-radius: 10px; background: color-mix(in srgb, var(--link) 10%, var(--surface)); font: 400 13.5px/1.4 var(--body); color: var(--ink); }
.text-in { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); outline: 0; font-size: 16px; }
.text-in:focus { border-color: var(--focus); }
.sheet-f { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.sheet-f .btn { min-height: 46px; padding: 0 18px; }
.hint { margin: -6px 0 0; font: 400 14px/1.4 var(--body); color: var(--muted); }

/* Lightbox, toast */
dialog.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; color: #fff; background: rgba(6, 8, 10, .9); padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); cursor: zoom-out; }
dialog.lightbox[open] { display: grid; place-items: center; }
dialog.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox .xbtn { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); color: #fff; background: rgba(255, 255, 255, .14); width: 44px; height: 44px; }
.toast { position: fixed; z-index: 40; left: 50%; top: calc(66px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -12px); max-width: min(440px, calc(100% - 32px)); padding: 11px 16px; border-radius: 12px; background: var(--tape); color: var(--tape-ink); font: 600 14px/1.35 var(--body); box-shadow: 0 8px 24px rgba(0, 0, 0, .28); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Live Claude answer */
.ai-bubble { background: var(--surface); border: 1px solid color-mix(in srgb, var(--tape) 40%, var(--line)); border-top-left-radius: 6px; }
.ai-foot { margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--line); font: 400 11.5px/1.35 var(--mono); color: var(--muted); white-space: normal; }
.thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-style: italic; }
.ask-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; white-space: normal; }
.ask-acts .note { font-size: 13px; }

@media (max-width: 520px) {
  .brand p { display: none; }
  .brand { gap: 8px; flex: none; }
  .brand h1 { font-size: 22px; }
  .brand-mark { display: none; }
  .bar-in { gap: 8px; padding-block: 8px; }
  .hours-chip { padding: 0 10px; font-size: 12.5px; }
  .here .lbl, .here .stack { display: none; }
  .here .live { display: inline-block; }
  .me-btn .av { width: 32px; height: 32px; font-size: 12px; }
  .msg .col { max-width: 86%; }
  .msg .av-slot, .msg .av-slot .av { width: 30px; }
  .msg .av-slot .av { height: 30px; font-size: 12px; }
  .typing { padding-left: 40px; }
  .strip .st-t small { white-space: normal; }
}
@media (max-height: 500px) {
  .strip { display: none; }
}
@media (max-width: 360px) {
  .here { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .purge path { stroke-dashoffset: 0; }
}
