/* Compact, dark mobile interface. All assets and fonts stay local. */
:root {
  color-scheme: dark;
  --paper: #000;
  --surface: #161616;
  --raised: #222;
  --ink: #f0f0f0;
  --secondary-ink: #c4c4c4;
  --muted: #999;
  --line: #303030;
  --soft-line: #252525;
  --wash: #202020;
  --red: #e29a91;
  --red-wash: #312321;
  --amber: #d7be91;
  --amber-wash: #2c2820;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --page-gutter: 16px;
  --nav-height: 54px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
button:disabled { opacity: .4; cursor: default; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a, button, input, textarea, select, summary { outline-offset: 3px; }
:focus-visible { outline: 2px solid #aaa; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); overflow-wrap: anywhere; }
h1 { font-size: 20px; font-weight: 500; line-height: 28px; letter-spacing: -.3px; }
h2 { font-size: 17px; font-weight: 500; line-height: 25px; }
h3 { font-size: 15px; font-weight: 500; line-height: 23px; }
p + p { margin-top: 7px; }
svg { display: block; flex-shrink: 0; }
button svg, .button-icon, .ui-icon { width: 20px; height: 20px; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Controls use compact visible geometry; standalone icons have extended hits. */
.primary { color: #1b1b1b; background: var(--ink); border-color: var(--ink); font-weight: 500; }
.secondary { color: var(--ink); background: var(--wash); border-color: transparent; }
.outline { color: var(--secondary-ink); background: transparent; border-color: var(--line); }
.danger { color: var(--red); background: transparent; border-color: #63443e; }
.quiet { color: var(--secondary-ink); background: transparent; }
.small { min-height: 32px; padding: 6px 10px; font-size: 12px; line-height: 18px; border-radius: 17px; }
.icon-button { position: relative; flex-shrink: 0; width: 36px; min-width: 36px; min-height: 36px; height: 36px; padding: 7px; }
.icon-button::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; }
.wide { width: 100%; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.space-between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.hint, .muted { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 18px; overflow-wrap: anywhere; }
.eyebrow, .page-kicker, .workspace-overline, .settings-section-label { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 17px; letter-spacing: 0; }
.page-kicker { margin-bottom: 5px; }
.page-count { color: var(--muted); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.notice { color: var(--secondary-ink); font-size: 12px; line-height: 19px; overflow-wrap: anywhere; }
.notice:not(:empty) { border-left: 2px solid #747474; background: var(--wash); padding: 9px 11px; }
.notice.error { color: var(--red); background: var(--red-wash); border-left-color: #b27268; }
.error-text { color: var(--red); font-size: 12px; line-height: 19px; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; max-width: 100%; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 15px; overflow-wrap: anywhere; }
.badge.warn { color: var(--amber); border-color: #514632; background: var(--amber-wash); }
.badge.error { color: var(--red); border-color: #62433c; background: var(--red-wash); }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.divider { height: 1px; background: var(--line); margin: 3px 0; }

/* Login is a small access panel, with no promotional hero. */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: calc(28px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom)); }
.login-card { width: 100%; max-width: 320px; }
.login-masthead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 30px; }
.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; color: var(--ink); font-size: 16px; font-weight: 500; line-height: 22px; letter-spacing: -.25px; text-decoration: none; }
.brand img { flex-shrink: 0; width: 24px; height: 24px; border-radius: 6px; }
.login-edition { color: var(--muted); font-size: 11px; line-height: 17px; }
.login-intro { margin-bottom: 22px; }
.login-card h1 { font-size: 23px; font-weight: 500; line-height: 31px; letter-spacing: 0; }
.lead { margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 21px; }
.login-card > .primary { justify-content: space-between; width: 100%; max-width: 240px; min-height: 38px; padding: 9px 14px; border-radius: 20px; font-size: 13px; }
.login-card > .primary svg { width: 17px; height: 17px; }
.login-card > .hint { margin-top: 10px; font-size: 11px; line-height: 18px; }
#login-status:not(:empty) { margin-top: 16px; }
.login-card [hidden] { display: none !important; }
.enrollment { margin-top: 0; }
.enrollment .hint { margin-bottom: 15px; font-size: 11px; line-height: 18px; }
.enrollment form { display: grid; gap: 8px; }
.enrollment label { margin-top: 3px; font-size: 12px; }
.enrollment button { width: fit-content; min-height: 36px; margin-top: 6px; }
.enrollment .enrollment-help { margin: 12px 0 0; }
.auth-switch { display: block; min-height: 44px; margin-top: 22px; padding: 12px 0; border-top: 1px solid var(--soft-line); color: var(--secondary-ink); font-size: 12px; line-height: 20px; text-decoration: none; }
.privacy-note { margin-top: 24px; color: #959593; font-size: 11px; line-height: 18px; }

/* Application pages. The conversation has its own compact toolbar instead. */
.app-page { height: 100%; overflow: hidden; }
.app-shell { position: fixed; top: var(--app-top, 0px); left: 0; right: 0; display: flex; flex-direction: column; width: 100%; max-width: 880px; height: var(--app-height, 100dvh); min-height: 0; margin: 0 auto; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); overflow: hidden; }
@media (display-mode: standalone) {
  .app-shell { height: var(--app-height, 100vh); }
}
.keyboard-open .app-shell { padding-bottom: 0; }
.app-header { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin: 0 var(--page-gutter); padding: 4px 0; }
.app-shell[data-view="tasks"] > .app-header, .app-shell[data-view="settings"] > .app-header { display: none; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.app-header .brand { font-size: 16px; }
.app-header .brand img { width: 23px; height: 23px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; color: var(--muted); font-size: 11px; line-height: 17px; }
.status-dot::before { content: ""; display: block; width: 4px; height: 4px; border-radius: 50%; background: #999; }
.status-dot.offline::before { background: var(--amber); }
#main { flex: 1; min-height: 0; padding: 0 var(--page-gutter) 12px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin-bottom: 8px; }
.page-heading h1 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; font-size: 17px; line-height: 25px; }
.page-heading .hint { margin-top: 5px; }
.page-heading > button { flex-shrink: 0; }
.tab-bar { position: relative; z-index: 10; display: flex; flex-shrink: 0; align-items: stretch; width: 100%; min-height: var(--nav-height); margin: 0; padding: 3px 12px; border-top: 1px solid var(--soft-line); background: #000e; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.tab-bar button { display: flex; flex: 1; flex-direction: column; gap: 3px; min-height: 46px; padding: 6px 10px; border: 0; border-radius: 0; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 15px; }
.tab-bar svg { width: 18px; height: 18px; }
.tab-bar button[aria-current] { color: var(--ink); }

/* Sessions are compact two-line rows, without editorial numbering. */
.session-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.session-card { display: block; width: 100%; min-height: 66px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--soft-line); border-radius: 0; background: transparent; text-align: left; }
.session-card-body { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; min-width: 0; }
.session-card-top { display: flex; align-items: center; justify-content: space-between; flex: 0 0 100%; gap: 12px; min-width: 0; }
.session-title, .session-card h3 { min-width: 0; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 500; line-height: 22px; text-overflow: ellipsis; white-space: nowrap; }
.session-card-top time { flex-shrink: 0; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 17px; font-variant-numeric: tabular-nums; }
.session-meta { flex: 1 1 100px; min-width: 0; margin: 0; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.session-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; margin: 0; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 18px; }
.session-card-foot time { color: var(--muted); font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.session-index, .session-card .arrow { display: none; }
.session-card.archived .session-title { color: var(--secondary-ink); }
.section-caption { margin: 22px 0 4px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 17px; }

/* Fixed viewport conversation: only messages/approvals scroll, never under input. */
.app-shell.in-workspace { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
.keyboard-open .app-shell.in-workspace { padding-bottom: 6px; }
.app-shell.in-workspace > .app-header, .app-shell.in-workspace > .tab-bar { display: none; }
.app-shell.in-workspace > #main { display: flex; flex: 1; flex-direction: column; min-height: 0; padding-top: 6px; padding-bottom: 0; overflow: hidden; }
.workspace-container { display: flex; flex: 1; flex-direction: column; width: 100%; max-width: 680px; height: 100%; min-height: 0; margin: 0 auto; }
.workspace-container > .workspace-top, .workspace-container > .workspace-context { flex-shrink: 0; }
.workspace-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 6px; background: #000c; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.workspace-heading { flex: 1; min-width: 0; }
.workspace-title { margin: 0; overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 21px; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.workspace-subtitle { margin: 1px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-top > .icon-button { width: 40px; min-width: 40px; min-height: 40px; height: 40px; padding: 9px; border: 1px solid #353535; border-radius: 50%; background: #222c; color: var(--ink); }
.workspace-actions { display: flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 0; width: 88px; height: 40px; padding: 0 3px; border: 1px solid #353535; border-radius: 22px; background: #222c; }
.workspace-actions .icon-button { width: 40px; min-width: 40px; min-height: 38px; height: 38px; padding: 9px; border: 0; border-radius: 50%; background: transparent; }
.workspace-actions .icon-button::after { inset: -3px 0; }
.workspace-overline { display: none; }
.workspace-context { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 9px; }
.workspace-context:empty, .workspace-context:not(:has(> :not([hidden]))) { display: none; }
.workspace-context .badge { padding: 1px 6px; border-color: #383838; font-size: 11px; line-height: 15px; }
.conversation-content { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.conversation-content:focus-visible { outline-offset: -2px; }
.messages { display: flex; flex: 1 0 auto; flex-direction: column; gap: 26px; min-height: 0; padding: 10px 0 20px; }
.conversation-content > .messages:has(> .empty) { justify-content: center; }
.conversation-content > #approvals { flex-shrink: 0; padding-bottom: 4px; }
.message { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.message-author { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 17px; }
.user-message { align-self: flex-end; max-width: 91%; padding: 10px 14px; border: 0; border-radius: 21px; background: #242424; color: var(--ink); font-size: 16px; font-weight: 400; line-height: 26px; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-message { color: var(--ink); font-size: 16px; line-height: 26px; white-space: normal; overflow-wrap: anywhere; }
.assistant-message.message-plain { white-space: pre-wrap; }
.assistant-message p + p, .assistant-message p + ul, .assistant-message p + ol { margin-top: 14px; }
.assistant-message ul, .assistant-message ol { margin: 14px 0; padding-left: 22px; }
.assistant-message li + li { margin-top: 7px; }
.assistant-message h3, .assistant-message h4 { margin: 20px 0 10px; color: var(--ink); font-size: 16px; font-weight: 600; line-height: 26px; }
.assistant-message > :first-child { margin-top: 0; }
.assistant-message > :last-child { margin-bottom: 0; }
.assistant-message strong { font-weight: 600; }
.assistant-message code { padding: 2px 4px; border-radius: 5px; background: #222; font-family: var(--mono); font-size: 13px; line-height: 21px; }
.assistant-message pre { max-width: 100%; margin: 14px 0; padding: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); white-space: pre; overflow-wrap: normal; }
.assistant-message pre code { padding: 0; border-radius: 0; background: transparent; }
.message-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; line-height: 17px; }
.message-footer time { margin-left: 2px; font-size: 11px; font-variant-numeric: tabular-nums; }
.message-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.message-actions .icon-button, .message-footer > .icon-button { width: 32px; min-width: 32px; min-height: 36px; height: 36px; padding: 8px 6px; border: 0; background: transparent; color: #b5b5b5; }
.message-actions .icon-button::after, .message-footer > .icon-button::after { inset: -4px 0; }
.message-status { font-size: 11px; line-height: 17px; }
.artifact-link { align-self: flex-start; justify-content: flex-start; gap: 10px; max-width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 13px; line-height: 20px; text-align: left; }
.artifact-link span { min-width: 0; overflow-wrap: anywhere; }
.media-card, .media-file { width: 100%; max-width: 480px; min-width: 0; }
.media-preview { width: 100%; margin: 4px 0 0; }
.media-stage { position: relative; display: grid; align-items: center; justify-items: center; width: 100%; min-height: 180px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #161616; }
.media-content { display: block; width: 100%; max-width: 100%; max-height: 62vh; object-fit: contain; }
.media-image .media-stage[data-state="ready"] { min-height: 0; background: transparent; }
.media-stage[data-state="loading"] .media-content, .media-stage[data-state="error"] .media-content { visibility: hidden; }
.media-video .media-content { aspect-ratio: 16 / 9; background: #090909; }
.media-audio .media-stage { min-height: 76px; padding: 10px; }
.media-audio .media-content { height: 44px; }
.media-state { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; align-items: center; gap: 9px; padding: 16px; color: var(--muted); text-align: center; }
.media-state[hidden], .media-state [hidden] { display: none; }
.media-status { font-size: 12px; line-height: 20px; }
.media-state .small { min-height: 32px; font-size: 12px; }
.media-spinner { width: 15px; height: 15px; flex-shrink: 0; border: 1.5px solid #555; border-top-color: #dedede; border-radius: 50%; animation: media-turn .8s linear infinite; }
.media-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 1px 2px; color: var(--muted); font-size: 11px; line-height: 18px; }
.media-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-caption .small { flex-shrink: 0; min-height: 36px; padding: 6px 0 6px 8px; font-size: 11px; }
.media-file { margin-top: 14px; }
.media-file .item-row { padding: 7px 0; }
@keyframes media-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .media-spinner { animation: none; } }
.imported-label { color: var(--muted); font-size: 11px; line-height: 17px; }
.approval-card { display: flex; flex-direction: column; gap: 10px; padding: 13px; border: 1px solid #514632; border-radius: 11px; background: var(--amber-wash); }
.approval-card h3 { font-size: 14px; line-height: 21px; }
.approval-card .prewrap { color: var(--secondary-ink); font-size: 13px; line-height: 21px; }
.approval-card .row { flex-wrap: wrap; gap: 7px; }
.composer { position: static; flex-shrink: 0; width: auto; margin: 8px 16px 0; padding: 5px; border: 1px solid #303030; border-radius: 28px; background: #161616; }
.composer-line { display: flex; align-items: flex-end; gap: 3px; min-width: 0; }
.composer textarea { display: block; flex: 1 1 auto; align-self: center; width: 0; min-width: 0; min-height: 24px; height: auto; max-height: 120px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font-size: 16px; font-weight: 400; line-height: 24px; resize: none; }
.composer textarea::placeholder { color: var(--muted); }
.composer textarea:focus-visible { outline: none; }
.composer:focus-within { border-color: #545454; }
.composer-line .icon-button { flex-shrink: 0; width: 36px; min-width: 36px; min-height: 36px; height: 36px; padding: 7px; border-color: transparent; border-radius: 50%; background: transparent; color: #d4d4d4; }
.composer-line .icon-button::after { inset: -4px; }
.composer .send { flex-shrink: 0; width: 36px; min-width: 36px; min-height: 36px; height: 36px; margin: 0; padding: 5px; border: 3px solid transparent; border-radius: 50%; background: #f0f0f0; background-clip: padding-box; color: #171717; font-size: 11px; line-height: 14px; }
.composer .send:disabled { background-color: #3b3b3b; color: #848484; opacity: 1; }
.composer .send .ui-icon { width: 20px; height: 20px; }
.composer-hint { margin: 5px 13px 4px; color: var(--muted); font-size: 11px; line-height: 17px; }

/* Calls and recordings stay attached to their owning session. */
.voice-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px var(--page-gutter) 0; padding: 9px 11px; border: 1px solid #393939; border-radius: 10px; background: #242424; color: var(--ink); }
.app-shell.in-workspace > .voice-banner { flex-shrink: 0; margin-top: 8px; }
.app-shell.in-workspace:has(> .voice-banner:not([hidden])) > #main { padding-top: 6px; }
.voice-indicator { color: var(--ink); font-size: 12px; font-weight: 500; line-height: 19px; }
.voice-banner .hint { font-size: 11px; line-height: 17px; }
.voice-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-left: auto; }
.voice-banner button { min-height: 30px; padding: 5px 8px; border: 1px solid #454545; background: transparent; font-size: 11px; line-height: 18px; }
.voice-transcript { width: 100%; max-height: 57px; overflow: auto; color: var(--secondary-ink); font-size: 12px; line-height: 19px; white-space: pre-wrap; overflow-wrap: anywhere; }
.record-state { padding: 15px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--wash); color: var(--ink); font-size: 13px; font-weight: 400; line-height: 20px; text-align: center; }
.record-timer { display: block; margin-top: 8px; color: var(--ink); font-family: var(--mono); font-size: 23px; font-weight: 400; line-height: 30px; letter-spacing: .5px; font-variant-numeric: tabular-nums; }

/* Task and settings collections. */
.task-list { display: flex; flex-direction: column; max-width: 740px; margin: 0 auto; }
.task-filters { display: flex; align-items: stretch; gap: 6px; max-width: 740px; margin: 0 auto 9px; }
.filter-button { flex: 1; min-width: 0; min-height: 32px; padding: 6px 7px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 18px; white-space: nowrap; }
.filter-button[aria-pressed="true"] { border-color: #363636; background: var(--surface); color: var(--ink); }
.task-card { display: flex; flex-direction: column; gap: 8px; padding: 13px 0; border: 0; border-bottom: 1px solid var(--soft-line); border-radius: 0; background: transparent; }
.task-number { color: var(--muted); font-size: 11px; line-height: 17px; font-variant-numeric: tabular-nums; }
.task-title { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--ink); font-size: 15px; font-weight: 400; line-height: 24px; white-space: normal; overflow-wrap: anywhere; }
.task-preview { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-height: 36px; color: var(--muted); font-size: 12px; line-height: 18px; white-space: normal; overflow-wrap: anywhere; }
.task-session { min-height: auto; padding: 0; color: var(--secondary-ink); font-size: 12px; font-weight: 400; line-height: 18px; text-align: left; }
.task-card > .row { flex-wrap: wrap; gap: 6px; }
.task-card > .row > .grow { flex-basis: 40%; }
.task-footer { gap: 6px; }
.task-footer > .hint { flex: 1; font-size: 11px; line-height: 17px; font-variant-numeric: tabular-nums; }
.task-footer .small { min-height: 30px; padding: 5px 8px; font-size: 11px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.settings-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 15px 0 0; border: 0; border-top: 1px solid var(--soft-line); border-radius: 0; background: transparent; }
.settings-card.full { grid-column: 1 / -1; }
.settings-card h2 { font-size: 15px; font-weight: 500; line-height: 22px; }
.settings-card > button { align-self: flex-start; }
.settings-card .notice { font-size: 12px; }
.settings-section-label { margin-bottom: -3px; }
.setting-description { color: var(--muted); font-size: 12px; line-height: 19px; overflow-wrap: anywhere; }
.metric-value { color: var(--ink); font-size: 20px; font-weight: 400; line-height: 28px; letter-spacing: -.2px; font-variant-numeric: tabular-nums; }
.item-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 10px 0; border-bottom: 1px solid var(--soft-line); font-size: 14px; line-height: 22px; }
.item-row:first-child { padding-top: 0; }
.item-row:last-child { padding-bottom: 0; border-bottom: 0; }
.item-row .grow > p:not(.hint) { overflow-wrap: anywhere; }
.item-row .hint { margin-top: 3px; font-size: 11px; line-height: 17px; }
.item-row > button { flex-shrink: 0; }

/* Text inputs retain 16px text to avoid iPhone focus zoom. */
input, textarea, select { width: 100%; min-width: 0; min-height: 40px; margin: 0; padding: 8px 10px; border: 1px solid #383838; border-radius: 12px; background: var(--raised); color: var(--ink); font-size: 16px; font-weight: 400; line-height: 24px; -webkit-appearance: none; appearance: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: none; }
input[type=checkbox] { flex-shrink: 0; width: 17px; min-width: 17px; height: 17px; min-height: 17px; margin: 2px 0 0; padding: 0; accent-color: #dededb; -webkit-appearance: checkbox; appearance: auto; }
label { color: var(--secondary-ink); font-size: 12px; font-weight: 400; line-height: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; min-height: 38px; padding: 8px 0; font-size: 13px; line-height: 20px; cursor: pointer; }
.check-row .hint { display: block; margin-top: 3px; font-size: 11px; line-height: 17px; }
.file-input { min-height: 38px; padding: 5px; border-color: var(--line); font-size: 12px; }
.file-input::file-selector-button { min-height: 28px; margin-right: 8px; padding: 5px 8px; border: 0; border-radius: 5px; background: #383838; color: var(--ink); font: inherit; }
.resource-editor { min-height: 76px; font-family: var(--mono); font-size: 16px; line-height: 23px; }
.file-name { color: var(--ink); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.connection-scopes { max-height: 95px; overflow: auto; color: var(--muted); font-family: var(--mono); font-size: 11px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.text-block { margin: 0; color: var(--secondary-ink); font-size: 13px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.text-block { font-family: var(--mono); font-size: 11px; line-height: 18px; }
.fork-options { max-height: 220px; overflow: auto; overscroll-behavior: contain; }
.fork-options .check-row { border-bottom: 1px solid var(--soft-line); }
.fork-options .check-row:last-child { border-bottom: 0; }
.disclosure { padding: 0; color: var(--muted); font-size: 12px; line-height: 19px; }
.disclosure summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; padding: 9px 0; color: var(--secondary-ink); font-size: 12px; font-weight: 400; line-height: 18px; list-style: none; cursor: pointer; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: "+"; flex-shrink: 0; width: 17px; color: var(--muted); font-size: 16px; font-weight: 300; line-height: 1; text-align: center; }
.disclosure[open] summary::after { content: "−"; }
.disclosure > :not(summary) { margin-top: 6px; }
.disclosure > :last-child { margin-bottom: 4px; }

/* Dark sheets and an independent compact confirmation dialog. */
.sheet { width: min(480px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 36px); margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid #3a3a3a; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 12px 60px #0005; }
.sheet::backdrop { background: #0008; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet-content { display: flex; flex-direction: column; gap: 15px; min-width: 0; padding: 16px; }
.sheet-content > button { align-self: flex-start; }
.sheet-heading { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: -6px; padding-bottom: 6px; background: var(--surface); }
.sheet-heading h2 { margin: 4px 0 0; font-size: 17px; font-weight: 500; line-height: 24px; }
.sheet-heading .close { position: relative; flex-shrink: 0; width: 32px; min-width: 32px; min-height: 32px; height: 32px; padding: 5px; border: 1px solid #404040; border-radius: 50%; background: transparent; color: var(--secondary-ink); font-size: 19px; font-weight: 300; line-height: 20px; }
.sheet-heading .close::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; }
.sheet section { display: flex; flex-direction: column; gap: 11px; min-width: 0; padding-top: 15px; border-top: 1px solid #363636; }
.sheet section > h3 { font-size: 14px; line-height: 21px; }
.sheet section > button { align-self: flex-start; }
.attachment-options { display: flex; flex-direction: column; gap: 0; }
.attachment-option { justify-content: flex-start; gap: 12px; width: 100%; min-height: 48px; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--soft-line); border-radius: 0; background: transparent; font-size: 15px; line-height: 24px; text-align: left; }
.attachment-option:last-child { border-bottom: 0; }
.sheet-actions, .confirm-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.sheet .settings-card { gap: 9px; padding: 12px; border: 1px solid #3a3a3a; border-radius: 10px; background: #242424; }
.sheet .settings-card .check-row { padding-top: 0; padding-bottom: 0; }
.sheet audio { width: 100%; max-width: 100%; min-height: 40px; color-scheme: dark; }
.sheet-message { margin-top: 0; }
.conflict-message { padding: 9px 11px; border-left: 2px solid #aa9264; background: var(--amber-wash); color: var(--amber); font-size: 12px; line-height: 19px; }
.confirmation-sheet { width: min(360px, calc(100% - 40px)); border-radius: 15px; }
.confirmation-sheet .sheet-content { gap: 15px; padding: 18px; }
.confirmation-sheet h2 { font-size: 17px; line-height: 24px; }
.confirm-copy { color: var(--secondary-ink); font-size: 13px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; }
.confirm-detail { margin-top: 0; color: var(--muted); font-size: 12px; line-height: 19px; white-space: pre-wrap; overflow-wrap: anywhere; }
.confirm-actions > button { flex: 1; min-width: 90px; min-height: 36px; }

/* Empty conversation shares the neutral system typography. */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px; padding: 22px 12px; color: var(--muted); font-size: 13px; line-height: 21px; text-align: center; white-space: pre-line; }
.empty-mark { display: none; }
.friday-avatar { display: block; width: 48px; height: 48px; margin-bottom: 8px; border-radius: 14px; object-fit: cover; }
.empty-title { color: var(--secondary-ink); font-size: 15px; font-weight: 400; line-height: 23px; }
.empty-copy { max-width: 26em; margin-top: 0; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 19px; white-space: pre-line; }
.conversation-content .empty { padding: 16px 0; }
.conversation-content .empty-title { color: var(--ink); font-size: 22px; font-weight: 500; line-height: 32px; letter-spacing: 0; }
.conversation-content .empty-copy { display: none; }
.loading { padding: 36px 12px; color: var(--muted); font-size: 12px; line-height: 19px; text-align: center; }
.toast { position: fixed; z-index: 100; top: calc(12px + env(safe-area-inset-top)); left: 50%; width: max-content; max-width: min(440px, calc(100% - 28px)); padding: 10px 13px; transform: translateX(-50%); border: 1px solid #484848; border-radius: 9px; background: #303030f5; color: var(--ink); box-shadow: 0 8px 24px #0003; font-size: 12px; line-height: 19px; overflow-wrap: anywhere; }
.toast.error { border-color: #765047; background: #392b28f5; color: #f0c6bf; }
.offline-page { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: calc(28px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom)); }
.offline-card { width: 100%; max-width: 320px; }
.offline-card .brand { margin-bottom: 28px; }
.offline-card h1 { font-size: 22px; font-weight: 500; line-height: 30px; }
.offline-card .lead { margin: 10px 0 20px; font-size: 13px; line-height: 21px; }
.offline-card > a.primary { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 8px 13px; border: 1px solid var(--ink); border-radius: 8px; color: #1b1b1b; font-size: 13px; line-height: 18px; text-decoration: none; }

@media (min-width: 720px) {
  :root { --page-gutter: 24px; }
  .session-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .app-shell.in-workspace > #main { padding-top: 8px; }
}
@media (max-width: 719px) {
  .sheet { width: 100%; max-height: calc(100dvh - 22px - env(safe-area-inset-top)); margin: auto 0 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 15px 15px 0 0; }
  .sheet-content { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .confirmation-sheet { width: calc(100% - 40px); max-height: calc(100dvh - 40px); margin: auto; border: 1px solid #3a3a3a; border-radius: 15px; }
  .confirmation-sheet .sheet-content { padding: 18px; }
}
@media (max-width: 359px) {
  .workspace-top { gap: 8px; }
  .composer { margin-right: 8px; margin-left: 8px; }
  .session-card-top { gap: 8px; }
  .session-card-top time { font-size: 10px; }
  .session-card-foot { gap: 4px; font-size: 10px; }
  .voice-actions { width: 100%; margin-left: 0; }
  .voice-actions > button { flex: 1; }
}
@media (hover: hover) and (pointer: fine) {
  .primary:hover:not(:disabled) { background-color: #fff; border-color: #fff; }
  .secondary:hover:not(:disabled), .outline:hover:not(:disabled), .quiet:hover:not(:disabled) { background-color: #303030; }
  .danger:hover:not(:disabled) { background: var(--red-wash); }
  .session-card:hover:not(:disabled) { background: #ffffff03; }
  .tab-bar button:hover { color: var(--ink); }
  .composer .send:hover:not(:disabled) { border-color: transparent; }
}
@media (prefers-reduced-motion: no-preference) {
  button, input, textarea { transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease; }
  dialog[open] { animation: sheet-enter 120ms ease-out; }
  @keyframes sheet-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
