/* A studio desk. Left: chat with the Desk assistant (Haiku). Right: the board (jobs, Drive links, voice keys, rules, team). Stacks on phones. */
:root {
  --bg: #f6f3ee; --panel: #fffdf9; --ink: #1d1a2b; --muted: #6b6578; --line: #e3ddd2;
  --accent: #b5541c; --accent-ink: #fff7ef; --night: #23204a; --night-ink: #f3efe6;
  --ok: #2e7d4f; --warn: #b7791f; --bad: #b3261e; --wait: #4c5bd4; --chip: #efe9df;
  --display: "Rozha One", Georgia, serif;
  --body: "Hind", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #15131f; --panel: #1e1b2c; --ink: #efeae0; --muted: #a49db3; --line: #332f45;
  --accent: #e08a4c; --accent-ink: #1a120b; --night: #2c2858; --night-ink: #f3efe6;
  --ok: #5cc28a; --warn: #e3b05a; --bad: #ef7b72; --wait: #8e9bff; --chip: #2a263b; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #15131f; --panel: #1e1b2c; --ink: #efeae0; --muted: #a49db3; --line: #332f45;
  --accent: #e08a4c; --accent-ink: #1a120b; --night: #2c2858; --night-ink: #f3efe6;
  --ok: #5cc28a; --warn: #e3b05a; --bad: #ef7b72; --wait: #8e9bff; --chip: #2a263b; color-scheme: dark }
* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--body); }
[hidden] { display: none !important }
.wrap { max-width: 1280px; margin: 0 auto; padding-block: 20px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 20px }
header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px }
h1 { font: 400 clamp(30px, 4vw, 44px)/1.1 var(--display); margin: 0; text-wrap: balance }
h1 small { font: 500 15px var(--body); color: var(--muted); margin-left: 10px; letter-spacing: .02em }
h3 { font: 600 16px var(--body); margin: 4px 0 0 }
.status { font: 13px var(--mono); color: var(--muted) }
.status b { color: var(--ink); font-weight: 500 }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: start }
@media (max-width: 900px) { .grid { grid-template-columns: minmax(0, 1fr) } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; min-width: 0 }
.panel > h2 { font: 400 22px var(--display); margin: 0; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap }
.panel > h2 span { font: 13px var(--body); color: var(--muted) }
.chat-panel { display: flex; flex-direction: column; height: min(80vh, 780px); min-height: 520px }
@media (min-width: 901px) { .chat-panel { position: sticky; top: 16px } }
.log { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere }
.msg.me { align-self: flex-end; background: var(--night); color: var(--night-ink); border-bottom-right-radius: 4px }
.msg.desk { align-self: flex-start; background: var(--chip); border-bottom-left-radius: 4px }
.msg.note { align-self: center; background: none; color: var(--muted); font-size: 14px; text-align: center }
.msg.err { align-self: center; background: none; color: var(--bad); font-size: 14px; text-align: center }
.msg.typing::after { content: "▍"; animation: blink 1s steps(1) infinite; color: var(--muted) }
@keyframes blink { 50% { opacity: 0 } }
.ticket { align-self: stretch; border: 1.5px dashed var(--accent); border-radius: 12px; padding: 10px 14px; display: grid; gap: 4px; background: var(--panel) }
.ticket .t { font-weight: 600 }
.kv { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 2px 10px; font-size: 14px; margin: 0 }
.kv dt { color: var(--muted) } .kv dd { margin: 0; overflow-wrap: anywhere }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.compose { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px }
textarea, input[type=text], input[type=password], input:not([type]), select { font: 16px/1.4 var(--body); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--bg); color: var(--ink); min-width: 0; max-width: 100% }
.compose textarea { width: 100%; min-height: 60px; max-height: 180px; resize: vertical }
textarea:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.quick { display: flex; flex-wrap: wrap; gap: 6px }
button { font: 600 14px var(--body); border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 14px; cursor: pointer; min-height: 36px }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) }
button.ghost { background: none }
button.danger { color: var(--bad) }
button:disabled { opacity: .5; cursor: default }
.quick button { font-weight: 500; font-size: 13px; padding: 5px 11px; min-height: 32px }
.tabs { display: flex; gap: 2px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none }
.tabs button { border: none; border-radius: 8px 8px 0 0; background: none; color: var(--muted); padding: 8px 11px; white-space: nowrap; flex: none }
.tabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent) }
.list { padding: 10px 12px 14px; display: grid; gap: 10px }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; min-width: 0 }
.item .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline }
.item .ttl { font-weight: 600; overflow-wrap: anywhere }
.meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin: 0 }
.err { color: var(--bad) }
.pill { font: 600 12px var(--body); padding: 2px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid currentColor }
.pill.new, .pill.needs_voices { color: var(--wait) } .pill.building { color: var(--warn) } .pill.done { color: var(--ok) } .pill.failed { color: var(--bad) } .pill.needs_owner { color: var(--accent) } .pill.cancelled { color: var(--muted) }
.chips { display: flex; flex-wrap: wrap; gap: 5px }
.chip { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--chip); color: var(--ink) }
a { color: var(--accent); text-underline-offset: 2px; overflow-wrap: anywhere }
.bar { height: 6px; border-radius: 999px; background: var(--chip); overflow: hidden } .bar i { display: block; height: 100%; background: var(--accent); transition: width .4s }
.building .bar i { background: linear-gradient(90deg, var(--accent), var(--warn)) }
.voices { border-top: 1px dashed var(--line); padding-top: 8px; display: grid; gap: 8px }
.vrow { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 4px; min-width: 0 }
.vrow .vt { font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere }
.vrow.ok { border-color: var(--ok) } .vrow.ok .vh::after { content: " · uploaded"; color: var(--ok); font-weight: 600 }
.vh { font-weight: 600; font-size: 14px } .vs { font: 12px var(--mono); color: var(--muted); overflow-wrap: anywhere }
input[type=file] { font: 13px var(--body); max-width: 100% }
.links a { display: inline-block; margin-right: 12px }
.empty { padding: 22px 14px; color: var(--muted); text-align: center; font-size: 14px }
.rules { padding: 12px 16px 16px; display: grid; gap: 14px }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; margin: 0; min-width: 0 }
legend { font-weight: 600; padding: 0 4px }
.rules label, .form label { display: flex; gap: 8px; align-items: center; font-size: 15px; flex-wrap: wrap }
.form { display: grid; gap: 10px }
.form label { flex-direction: column; align-items: stretch; gap: 3px; font-size: 14px; color: var(--muted) }
.form .inline { flex-direction: row; align-items: center; color: var(--ink) }
.pre { font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; background: var(--bg); border-radius: 8px; padding: 8px 10px; margin: 0 }
.secret { font: 15px var(--mono); background: var(--chip); padding: 6px 10px; border-radius: 8px; user-select: all; overflow-wrap: anywhere }
.ok-t { color: var(--ok) } .bad-t { color: var(--bad) }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--night); color: var(--night-ink); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px) }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px }
.login-card { width: min(380px, 100%); padding: 24px; display: grid; gap: 12px }
.login-card label { display: grid; gap: 4px; font-size: 14px; color: var(--muted) }
.login-card input { width: 100% }
@media (prefers-reduced-motion: no-preference) { .msg, .item { animation: rise .18s ease-out } @keyframes rise { from { transform: translateY(4px); opacity: .6 } to { transform: none; opacity: 1 } } }
