@font-face {
  font-family: "Mona Sans";
  src: url("/fonts/mona-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --line: #e6e6e6;
  --fill: #f3f3f3;
  --fill-2: #e9e9e9;
  --radius: 16px;
  --radius-sm: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Mona Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.4; height: 100%; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; }
input, select, textarea { -webkit-user-select: text; user-select: text; font: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.app { display: flex; flex-direction: column; height: 100dvh; min-height: 100vh; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-top) + 10px) 18px 8px; }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.office-name { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--fg); }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--fg); }
.icon-btn:active { background: var(--fill); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot-on { background: #111; }
.dot-off { background: #fff; border: 2px solid #bbb; }
.dot-warn { background: #fff; border: 2px solid #111; }

.banner { margin: 0 16px 8px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--fill); font-size: 14px; color: var(--fg); }

/* tabs */
.tabs { display: flex; gap: 6px; margin: 0 16px 10px; padding: 4px; background: var(--fill); border-radius: 14px; }
.tab { flex: 1; height: 40px; border-radius: 11px; font-size: 15px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tab.active { background: #fff; color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.count { font-size: 12px; font-weight: 600; color: var(--faint); }
.tab.active .count { color: var(--muted); }

/* main */
.main { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px 16px; }
.view { display: none; }
.view.active { display: block; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 15px; }

/* bot cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 12px; margin-bottom: 10px; }
.card:active { background: #fafafa; }
.card-head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 17px; flex: none; background: var(--fill); color: var(--fg); }
.avatar.working { background: #111; color: #fff; }
.avatar.blocked { background: #fff; color: #111; border: 2px solid #111; }
.card-title { flex: 1; min-width: 0; }
.card-name { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--fill); color: var(--muted); white-space: nowrap; flex: none; letter-spacing: 0.01em; }
.pill.working { background: #111; color: #fff; }
.pill.review { background: var(--fill-2); color: var(--fg); }
.pill.blocked, .pill.needs_input { background: #fff; color: #111; border: 1.5px solid #111; }
.pill.done { background: var(--fill); color: var(--fg); }
.pill.offline { background: #fff; color: var(--faint); border: 1px solid var(--line); }
.card-task { margin-top: 10px; font-size: 15px; font-weight: 500; }
.card-task .project { color: var(--muted); font-weight: 400; }
.progress { height: 5px; background: var(--fill); border-radius: 999px; margin-top: 10px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: #111; border-radius: 999px; }
.card-log { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }
.card-log span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-log time { color: var(--faint); flex: none; font-variant-numeric: tabular-nums; }
.card.is-blocked { border-color: #111; }

/* pipeline */
.section { margin-bottom: 18px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 2px 8px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.section-head .n { font-size: 13px; color: var(--muted); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; margin-bottom: 8px; }
.item .who { width: 34px; height: 34px; border-radius: 50%; background: var(--fill); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.item .who.working { background: #111; color: #fff; }
.item .txt { flex: 1; min-width: 0; }
.item .t1 { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t2 { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .pct { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.item.queued .who { background: #fff; border: 1px dashed #bbb; color: var(--muted); }
.item .prio { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #111; }

/* activity */
.ev { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.ev time { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 2px; }
.ev .who { font-weight: 600; font-size: 14px; }
.ev .what { font-size: 15px; color: var(--fg); }
.ev.type-ask .what, .ev.type-manager_reply .what { font-style: normal; }
.ev.type-ask .who::after { content: " · you asked"; font-weight: 400; color: var(--muted); }
.ev.type-manager_reply .who::after { content: " · replied"; font-weight: 400; color: var(--muted); }
.ev.type-done .who::after { content: " · finished"; font-weight: 400; color: var(--muted); }
.ev.type-blocked .who::after, .ev.type-needs_input .who::after { content: " · blocked"; font-weight: 700; }
.ev.type-assigned .who::after { content: " · started"; font-weight: 400; color: var(--muted); }
.ev.type-system .who, .ev.type-alert .who { color: var(--muted); }
.ev.type-log .what { color: var(--muted); }

/* call bar */
.callbar { padding: 10px 16px calc(var(--safe-bottom) + 12px); border-top: 1px solid var(--line); background: #fff; }
.call-btn { width: 100%; height: 64px; border-radius: 20px; background: #111; color: #fff; font-size: 19px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 12px; }
.call-btn:active { background: #333; }

/* sheets */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.25); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 22px 22px 0 0; padding: 8px 18px calc(var(--safe-bottom) + 20px); max-height: 86dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-grip { width: 40px; height: 5px; border-radius: 999px; background: #ddd; margin: 4px auto 14px; }
.sheet-title { font-size: 20px; font-weight: 600; margin: 0 0 12px; }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.sheet-head .avatar { width: 52px; height: 52px; font-size: 20px; }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 600; }
.sheet-head .sub { color: var(--muted); font-size: 14px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 15px; margin: 14px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.logs { margin-top: 6px; }
.logs .log { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.logs .log time { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 13px; }
.group { padding: 14px 0; border-bottom: 1px solid var(--line); }
.group:last-child { border-bottom: 0; }
.group-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; font-size: 15px; }
.row.toggle input { width: 22px; height: 22px; accent-color: #111; }
.field { display: block; margin: 8px 0; font-size: 15px; }
.field > span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.field input, .field select { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 12px; background: #fff; color: var(--fg); font-size: 16px; }
.btn { height: 46px; padding: 0 16px; border-radius: 12px; background: #111; color: #fff; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.btn:active { background: #333; }
.btn:disabled { background: #bbb; }
.btn-ghost { background: #fff; color: #111; border: 1px solid var(--line); }
.btn-ghost:active { background: var(--fill); }
.btn-row { display: flex; gap: 8px; margin-top: 8px; }
.btn-row .btn { flex: 1; }
.hint { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.sheet .btn.full { width: 100%; margin-top: 12px; }

/* call screen */
.call { position: fixed; inset: 0; z-index: 30; background: #fff; display: flex; flex-direction: column; padding: calc(var(--safe-top) + 14px) 20px calc(var(--safe-bottom) + 18px); }
.call-top { display: flex; justify-content: space-between; align-items: flex-start; }
.call-name { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.call-sub { font-size: 15px; color: var(--muted); margin-top: 2px; min-height: 20px; }
.call-timer { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 6px; }
.call-avatar-wrap { display: flex; justify-content: center; padding: 26px 0 18px; }
.call-avatar { width: 112px; height: 112px; border-radius: 50%; background: #111; color: #fff; font-size: 44px; font-weight: 600; display: flex; align-items: center; justify-content: center; outline: 0 solid rgba(17,17,17,0.12); outline-offset: 0; }
.call.state-listening .call-avatar { background: #fff; color: #111; border: 3px solid #111; }
.call.state-speaking .call-avatar { outline: 14px solid rgba(17,17,17,0.10); }
.call.state-thinking .call-avatar { background: #555; }
.transcript { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 2px; display: flex; flex-direction: column; gap: 8px; }
.line { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 16px; line-height: 1.35; }
.line.you { align-self: flex-end; background: #111; color: #fff; border-bottom-right-radius: 6px; }
.line.manager { align-self: flex-start; background: var(--fill); color: #111; border-bottom-left-radius: 6px; }
.line.sys { align-self: center; color: var(--muted); font-size: 13px; background: none; padding: 2px 0; }
.line.interim { opacity: 0.55; }
.call-form { display: flex; gap: 8px; margin-top: 10px; }
.call-form input { flex: 1; height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font-size: 16px; }
.call-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.round-btn { width: 60px; height: 60px; border-radius: 50%; background: var(--fill); color: #111; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.round-btn:active { background: var(--fill-2); }
.round-btn-dark { background: #111; color: #fff; }
.round-btn-dark:active { background: #333; }
.talk-btn { flex: 1; height: 72px; border-radius: 36px; background: #fff; color: #111; border: 2px solid #111; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 17px; font-weight: 600; }
.talk-btn:active, .call.state-listening .talk-btn { background: #111; color: #fff; }
.talk-btn:disabled { opacity: 0.35; }
.talk-btn.muted-on { background: var(--fill); border-color: var(--fill); color: var(--muted); }

@media (prefers-color-scheme: dark) {
  /* The kiosk stays white on purpose (readable at a glance across the desk).
     Override here if you ever want a dark version. */
}
