/* Brandpatch workspace: charcoal navigation, crisp paper, compact task panels. */
:root { --workspace-accent: #deec71; --workspace-radius: 14px; }
:root { --workspace-fast: 140ms; --workspace-ease: cubic-bezier(.22, 1, .36, 1); }
body { font-size: 15px; line-height: 1.6; }
body .ap, body .studio { --ap-muted: #5f665f; --st-muted: #5f665f; }
html:not([data-theme="dark"]) body[data-shell="desk"], html:not([data-theme="dark"]) body[data-shell="desk"] .app { --desk-muted: #5f665f; }
html[data-theme="dark"] body[data-shell="desk"], html[data-theme="dark"] body[data-shell="desk"] .app { --desk-muted: #b7bdb4; }
body .app h1, body .app .display { font-family: var(--sans); font-size: clamp(28px, 3vw, 34px); font-weight: 700; line-height: 1.2; letter-spacing: -.025em; text-wrap: balance; }
body .app .topbar h1 { font-size: 20px; }
body .ap-head h1, body .studio-title h1 { text-wrap: balance; }
body .ap-lede, body .studio .lede { font-size: 15px; line-height: 1.65; max-width: 62ch; text-wrap: pretty; }
body .ap-card-blurb { font-size: 13px; line-height: 1.55; -webkit-line-clamp: 3; }
body .ap-meta, body .studio .meta { font-size: 13px; line-height: 1.55; }
body .ap :is(input, textarea), body .studio :is(input, textarea, select) { line-height: 1.55; }
body .ap-fld :is(input, textarea), body .studio :is(#promptInput, .verb input, .media-search input, .select-wrap select), body .studio-start :is(input, select) { border: 1px solid #858d85; border-radius: 9px; }
body :is(.btn-solid, .btn-outline, .btn-quiet) { border-radius: 9px; touch-action: manipulation; }
body :is(.btn-solid, .btn-outline, .btn-quiet, .ap-filters button, .workspace-density) { transition: background-color var(--workspace-fast) var(--workspace-ease), border-color var(--workspace-fast) var(--workspace-ease), color var(--workspace-fast) var(--workspace-ease); }
body :is(.btn-solid, .btn-outline, .btn-quiet):active { transition-duration: 0ms; }
body :is(button, a, input, textarea, select, summary):focus-visible { outline: 2px solid var(--bone, #18201c); outline-offset: 3px; }
body .ap-search input:focus-visible { outline: none; }
body .pbar :is(button, a):focus-visible { outline-color: var(--workspace-accent); }
body :is(input, textarea, select)[aria-invalid="true"] { border-color: #a52c20; outline-color: #a52c20; }
body :is(input, textarea, select)::placeholder { opacity: 1; }
body .ap :is(input, textarea)::placeholder, body .studio :is(input, textarea)::placeholder { color: #686e67; }
body .ap-back { display: inline-flex; margin: 0; }
.ap-title-row { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.ap-title-row h2 { font-size: 24px; line-height: 1.25; letter-spacing: -.02em; text-wrap: balance; }
.ap-title-row button { flex: none; padding-inline: 10px; font-size: 12px; }
.ap-title-row button[aria-pressed="true"] { background: #ecf1d1; border-color: #7b8860; color: #29341a; }
.ap-completion { color: var(--ap-ink-2); font-size: 13px; line-height: 1.5; }
body .ap-form-foot { gap: 10px; padding-top: 16px; border-top: 1px solid var(--ap-field-edge); }
body .ap-fld label { font-size: 14px; font-weight: 600; }
body .ap-run-head { gap: 12px; }
body .ap-run-blurb, body #apRunBlurb { font-size: 14px; line-height: 1.6; }
.studio-start form { display: grid; gap: 14px; }
.studio-start-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
body .thread-pick { display: grid; gap: 8px; min-width: 220px; }
body .thread-pick > label { font-size: 13px; font-weight: 600; color: var(--st-ink-2); }
body .thread-pick button { justify-self: end; min-height: 44px; font-size: 13px; }
body .studio-head { align-items: start; gap: 24px; }
body .studio .tool-head .meta { line-height: 1.55; }
body .studio .error-text { font-size: 14px; line-height: 1.6; color: #982d20; }
body .studio .mode small { font-size: 13px; line-height: 1.5; }
html[data-keyboard-nav] :is(.is-entering, .is-new, .door-panel), html[data-keyboard-nav] :is(button, a) { animation: none !important; transition: none !important; }
@media (max-width: 768px) {
  body .thread-pick { min-width: 0; width: 100%; }
  body .ap-lede, body .studio .lede, body .studio .pick-hint p { font-size: 16px; }
  .ap-title-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  body :is(.btn-solid, .btn-outline, .btn-quiet, .ap-filters button, .workspace-density) { transition: none; transform: none; }
}
body .pbar {
  --pb-card: #252b29; --pb-field: #303734; --pb-ink: #f5f7ed;
  --pb-ink-2: #c3cbc4; --pb-muted: #a3afa7; --pb-on-ink: #18201a;
  --pb-edge: #39423c; --pb-edge-hi: #78877b;
  background: #18201c; border-bottom: 1px solid #354039;
  padding-inline: 20px; box-shadow: none;
}
body .pbar-tile { background: var(--workspace-accent); color: #18201c; border-radius: 8px; }
body .pbar-nav { background: transparent; box-shadow: none; border: 0; border-radius: 8px; gap: 2px; }
body .pbar-nav > a { border-radius: 8px; color: #c3cbc4; }
body .pbar-nav > a:hover { background: #303b33; color: #fff; }
body .pbar-nav > a[aria-current="page"] { background: var(--workspace-accent); color: #18201c; box-shadow: none; }
body .pbar-nav a[aria-current="page"] .door-tile { background: transparent; color: inherit; }
body .pbar-k, body .pbar-host, body .pbar-user { border-radius: 8px; box-shadow: none; }
.workspace-density { display: inline-flex; align-items: center; gap: 6px; background: #252b29; color: #c3cbc4; border: 1px solid #39423c; border-radius: 8px; min-height: 44px; padding: 0 10px; font: 500 12px var(--sans); cursor: pointer; }
.workspace-density:hover { background: #303b33; color: #fff; }
.workspace-density:focus-visible { outline: 2px solid var(--workspace-accent); outline-offset: 2px; }
body .ap, body .studio { width: calc(100% - 24px); max-width: 1840px; margin: 12px auto; border-radius: var(--workspace-radius); }
body .ap { --ap-rail-w: clamp(360px, 35vw, 560px); }
body .ap-catalog { padding: 28px; }
body .ap-catalog > * { max-width: none; margin-inline: 0; }
body .ap-head h1, body .studio-title h1 { font-size: clamp(28px, 2.4vw, 36px); letter-spacing: -.025em; }
body .ap-groups { margin-top: 24px; gap: 24px; }
body .ap-cards { grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 10px; }
body .ap-card { border-radius: 12px; padding: 14px; column-gap: 10px; grid-template-columns: 34px minmax(0, 1fr) 24px; }
body .ap-card-ic { width: 34px; height: 34px; border-radius: 9px; }
body .ap-card-go { width: 24px; height: 24px; border: 0; }
body .ap-card-title { font-size: 14px; line-height: 1.4; }
body .ap-card-blurb { -webkit-line-clamp: 2; font-size: 13px; }
body .ap-card[aria-current="true"] { border-color: #7c8962; background: #f4f7e9; color: var(--ap-ink-2); box-shadow: inset 3px 0 var(--workspace-accent); }
body .ap-card[aria-current="true"] .ap-card-title { color: var(--ap-ink); }
body .ap-card[aria-current="true"] .ap-card-blurb { color: var(--ap-ink-2); }
body .ap-card[aria-current="true"] .ap-card-kind { color: var(--ap-muted); }
body .ap-card[aria-current="true"] .ap-card-ic { color: var(--ap-ink); background: #e2e8c9; }
.ap-discovery { display: grid; gap: 12px; margin-top: 20px !important; }
.ap-search { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--ap-field-edge); border-radius: 10px; background: var(--ap-field); }
.ap-search:focus-within { outline: 2px solid var(--ap-ink); outline-offset: 2px; }
.ap-search input { flex: 1; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ap-ink); font: 400 14px var(--sans); }
.ap-search > span { font-size: 12px; color: var(--ap-ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ap-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-filters button { min-height: 36px; border: 1px solid var(--ap-field-edge); border-radius: 7px; padding: 0 12px; font: 500 12px var(--sans); background: var(--ap-card); color: var(--ap-ink-2); cursor: pointer; }
.ap-filters button:hover { background: var(--ap-field); }
.ap-filters button[aria-pressed="true"] { background: var(--ap-ink); border-color: var(--ap-ink); color: var(--ap-on-ink); }
body .ap-run { border-left: 1px solid var(--ap-hair); }
body .ap-run-head { padding-bottom: 16px; border-bottom: 1px solid var(--ap-hair); }
body .ap-ghost { border-radius: 12px; box-shadow: none; }
.studio-start { display: grid; gap: 14px; padding: 24px; margin: 20px auto; border: 1px solid #c6cfae; border-radius: 14px; background: #f5f7ed; color: #18201c; }
.studio-start-step { font: 500 12px var(--mono); color: #56614c; }
.studio-start h2 { font-size: 24px; line-height: 1.2; letter-spacing: -.025em; }
.studio-start p { max-width: 60ch; line-height: 1.6; font-size: 14px; }
.studio-start label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.studio-start input, .studio-start select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #c5cbb8; background: #fff; color: #18201c; border-radius: 8px; font: 400 16px var(--sans); }
.studio-start > button { justify-self: start; border-radius: 8px; }
.studio-start #studioStartHint { font-size: 12px; color: #56614c; }
html[data-density="compact"] .ap-catalog { padding: 22px; }
html[data-density="compact"] .ap-groups { gap: 20px; }
html[data-density="compact"] .ap-card { padding: 12px; min-height: 106px; }
html[data-density="compact"] .ap-run { padding: 22px; }
body .studio .bench > * { max-width: 960px; }
html[data-density="compact"] .nav-item { min-height: 42px; }
html[data-density="compact"] .thread { padding-block: 8px; }
html[data-density="compact"] .studio .bench { padding: 24px; }
body .app .topbar h1 { letter-spacing: -.025em; }
body .app table { font-variant-numeric: tabular-nums; }
body .app table th { font-size: 12px; font-weight: 600; }
html[data-density="compact"] .app table td { padding-block: 10px; }
@media (min-width: 769px) {
  body .app .sidebar { border-right: 1px solid var(--edge, #d6d9d2); }
}
@media (max-width: 860px) {
  body .pbar { padding-inline: 12px; }
  .workspace-density { display: none; }
  body .pbar-nav.is-open { --pb-ink: #18201c; --pb-ink-2: #56614c; background: #f7f9f1; }
  body .pbar-nav.is-open > a { color: #18201c; }
}
@media (max-width: 768px) {
  body .ap, body .studio { width: calc(100% - 16px); margin: 8px auto; border-radius: 12px; }
  body .ap-catalog, html[data-density="compact"] .ap-catalog { padding: 20px 16px; }
  body .ap-cards { grid-template-columns: minmax(0, 1fr); }
  .ap-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .ap-filters button { flex: none; min-height: 44px; }
  .ap-search input { font-size: 16px; }
  body .ap-run { border-left: 0; }
  .studio-start { padding: 20px; }
  html[data-density="compact"] .studio .bench { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-density, .ap-filters button { transition: none; }
}

.run-recovery { display: block; margin-top: 5px; color: var(--ops-ink-2, var(--bone-dim)); font: 500 12px var(--sans); white-space: normal; }
@media (min-width: 769px) {
  html[data-density="compact"] body[data-shell="desk"] .app { --desk-side-w: 240px; border-radius: 14px; }
  html[data-density="compact"] .chat-list [role="listitem"] { margin-bottom: 4px; }
}
body .ap-card-blurb { -webkit-line-clamp: 3; line-height: 1.55; }
body .ap-run-head .ap-tape { font-size: 13px; line-height: 1.55; }
.drawer-recovery { margin: 20px 0 0; padding: 16px; border: 1px solid var(--edge); border-radius: 10px; color: var(--bone-dim); background: var(--panel-2); font-size: 14px; line-height: 1.65; }
@media (forced-colors: active) {
  body .ap-card[aria-current="true"] { background: Highlight; border-color: Highlight; color: HighlightText; }
  body .ap-card[aria-current="true"] :is(.ap-card-title, .ap-card-blurb, .ap-card-kind, .ap-card-ic) { color: HighlightText; background: transparent; }
}

/* Shared rhythm for the workbench and its recovery controls. */
:root {
  --workspace-space-1: 4px; --workspace-space-2: 8px;
  --workspace-space-3: 12px; --workspace-space-4: 16px;
  --workspace-space-6: 24px; --workspace-space-8: 32px;
  --workspace-control-height: 44px;
  --workspace-text-body: 14px; --workspace-text-small: 13px;
}
body .studio .bench { padding: var(--workspace-space-8); }
body .studio .library { padding: var(--workspace-space-6); }
body .studio .modes { gap: var(--workspace-space-3); margin-block: var(--workspace-space-6); }
body .studio .mode { padding: var(--workspace-space-4); border-radius: 12px; }
body .studio .tool-head { align-items: start; gap: var(--workspace-space-3); }
body .studio .tool-head h3 { font-size: 16px; line-height: 1.4; letter-spacing: -.015em; }
body .studio .tool-head > .meta { max-width: 42ch; }
body .studio #promptInput { padding: var(--workspace-space-4); font-size: 16px; line-height: 1.65; min-height: 130px; resize: vertical; }
body .studio .tool-foot { gap: var(--workspace-space-4); align-items: center; }
body .studio .tool-foot .meta { max-width: 44ch; }
body .studio .receipts { margin-top: var(--workspace-space-8); padding-top: var(--workspace-space-6); border-top: 1px solid #d4d9d0; }
body .studio .receipt-list { gap: var(--workspace-space-4); }
body .studio .receipt { padding: var(--workspace-space-4) var(--workspace-space-4) var(--workspace-space-4) 62px; border: 1px solid #d4d9d0; border-radius: 12px; box-shadow: none; }
body .studio .receipt-ask { line-height: 1.65; max-width: 68ch; overflow-wrap: anywhere; }
body .studio .receipt-line { font-size: 12px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.receipt-actions { grid-column: 1; display: flex; flex-wrap: wrap; gap: var(--workspace-space-2); }
body .studio .receipt-actions a { min-height: var(--workspace-control-height); font-size: var(--workspace-text-small); }
.receipt-uncertain { grid-column: 1; display: grid; gap: var(--workspace-space-3); padding: var(--workspace-space-4); background: #f4f3e8; border: 1px solid #b7b39a; border-radius: 8px; font-size: var(--workspace-text-body); line-height: 1.6; }
.receipt-uncertain button { justify-self: start; }
body .studio .receipt-state.is-unknown { color: #625523; background: #f4f3e8; border-radius: 6px; padding: 4px 8px; }
.library-organize { display: flex; flex-wrap: wrap; align-items: center; gap: var(--workspace-space-2); margin-bottom: var(--workspace-space-4); }
body .studio .library-filter { flex: 1; margin: 0; }
body .studio .library-filter button { min-height: var(--workspace-control-height); }
body .studio #mediaSort { min-height: var(--workspace-control-height); min-width: 128px; border: 1px solid #858d85; border-radius: 8px; background: #fff; padding: 8px; font-size: var(--workspace-text-small); }
.library-problem { display: grid; gap: var(--workspace-space-4); margin-block: var(--workspace-space-4); padding: var(--workspace-space-4); border: 1px solid #b7b39a; border-radius: 10px; font-size: var(--workspace-text-body); line-height: 1.6; }
.library-problem button { justify-self: start; }
@media (max-width: 768px) {
  body .studio .bench, html[data-density="compact"] .studio .bench { padding: 20px 16px; }
  body .studio .library { padding: 20px 16px; }
  body .studio #mediaSort { font-size: 16px; }
  body .studio .tool-head { flex-wrap: wrap; }
  .receipt-uncertain, .receipt-actions { grid-column: 1 / -1; }
}

body .studio .media-search:focus-within { outline: 2px solid var(--st-ink); outline-offset: 3px; }
body .studio .media-search input { border: 0; border-radius: 0; }
body .studio .media-search input:focus-visible { outline: none; }
body .studio .library-organize { margin-bottom: 0; }
body .studio .library-filter { flex: 0 1 auto; }

body .provider-guidance { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--desk-field-edge); border-radius: 10px; background: var(--desk-card); color: var(--desk-ink-2); font-size: 13px; line-height: 1.6; }
body .provider-guidance p { flex: 1 1 32ch; }
body .provider-guidance button { flex: none; min-height: 44px; font-size: 13px; }

/* Every surface shares the same readable secondary text and control rhythm.
   The Admin, Work and reference sheets stay paper even with a dark Desk. */
:root { --pg-muted: #64646e; --pg-ink-2: #55555f; }
body #main.ck { --ck-muted: #64646e; --ck-faint: #64646e; --ck-green: #267745; }
body:has(.runs-table) { --ops-muted: #64646e; }
body :is(.page-frame, .ck, .view) { text-wrap: pretty; }
body :is(.page-frame, .ck, .view) :is(h1, h2, h3) { text-wrap: balance; }
body :is(.page-frame, .ck, .view) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
body .gate :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
body .modal :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-height: var(--workspace-control-height); font-size: 16px; line-height: 1.5;
}
body :is(.page-frame, .ck, .view) :is(input, textarea)::placeholder { color: #64646e; }
body :is(.page-frame, .ck, .view) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { border-color: #85858f; }
body :is(.btn-solid, .btn-outline, .btn-quiet, .btn-danger, .ghost-btn, .nav-item, .admin-nav a, .composer .seg button, .ap-filters button) { min-height: var(--workspace-control-height); }
body :is(.icon-btn, .gate .pass-toggle) { min-width: var(--workspace-control-height); min-height: var(--workspace-control-height); }
body :is(.page-frame, .ck, .view) :is(.tape, .hint, .note, .src, .sub, .auth-hint) { font-size: 13px; line-height: 1.6; }
body .page-frame :is(.intro-lede, .verdict-lede, .land-lede) { max-width: 68ch; font-size: 16px; line-height: 1.7; }
body :is(.page-frame, .ck, .view) :is(code, pre, .mono, .op-path, .drawer-id) { overflow-wrap: anywhere; }
body .ck-head { gap: 16px; align-items: start; }
body .ck-sub { max-width: 65ch; line-height: 1.65; font-size: 15px; }
body .ck-eyebrow { display: none; }
body .ck .ck-hello { font-size: clamp(24px, 2.5vw, 32px); line-height: 1.25; letter-spacing: -.025em; }
body .ck .panel { scroll-margin-top: 100px; }
body .ck .panel > .panel-head { margin-bottom: 16px; }
body :is(.ck .table-wrap, .page-frame .params, .job-rail) { overscroll-behavior-inline: contain; }
body :is(.page-frame, .ck) table { font-variant-numeric: tabular-nums; }
body .page-frame :is(.op, .group, [id]) { scroll-margin-block: 24px; }
body :is(dialog, .drawer, .menu-scroll, .stage-scroll) { overscroll-behavior: contain; }
body .gate :is(.gate-lede, .gate-foot, .gate-hint, .sp-back) { line-height: 1.65; }
body :is(.error-text, .field-error) { overflow-wrap: anywhere; }
body .page-frame :is(.btn-solid, .btn-outline, .btn-quiet):focus-visible,
body .ck :is(button, a, input, select, textarea, summary):focus-visible { outline-color: #18201c; }
body :is(input, textarea) { caret-color: currentColor; }
body ::selection { background: #deec71; color: #18201c; }
.workspace-density svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; flex: none; }
.workspace-connection { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 110; width: max-content; max-width: calc(100% - 32px); padding: 12px 16px; border: 1px solid #85815c; border-radius: 10px; background: #f4f3e8; color: #4e4527; font-size: 14px; line-height: 1.6; box-shadow: 0 8px 24px rgb(0 0 0 / .12); pointer-events: none; }
.workspace-connection[hidden] { display: none; }
html[data-keyboard-nav] body :is(button, a):active { transform: none !important; }
html[data-density="comfortable"] body .ck .panel { padding: 24px; }
html[data-density="comfortable"] body .view { padding: 28px; }
html[data-density="comfortable"] body .app table td { padding-block: 16px; }
html[data-density="comfortable"] body .chat-list .thread { padding-block: 14px; }
html[data-density="comfortable"] body .page-frame :is(.op, .readout) { padding-block: 32px; }
@media (max-width: 860px) {
  body .workspace-density { display: inline-flex; justify-content: center; width: 44px; padding: 0; }
  .workspace-density span { display: none; }
}
@media (max-width: 768px) {
  body .ck-head { flex-wrap: wrap; }
  body .ck .panel, html[data-density="comfortable"] body .ck .panel { padding: 16px; }
  body .view, html[data-density="comfortable"] body .view { padding: 20px 16px; }
  body .ck .table-wrap { margin-inline: -16px; padding-inline: 16px; }
  body .page-frame { --pg-inset: 8px; --pg-r: 14px; }
  body .page-frame .display { font-size: clamp(28px, 8vw, 36px); line-height: 1.2; letter-spacing: -.025em; }
}
@media (prefers-reduced-motion: reduce) {
  body :is(button, a):active { transform: none !important; }
}

body .cron-slab { display: grid; gap: 16px; }
body .cron-slab h2 { font-size: 22px; line-height: 1.3; letter-spacing: -.02em; }
body .cron-slab > label, body .schedule-field > span { font-size: 14px; font-weight: 600; color: var(--ops-ink); }
body .cron-slab textarea { min-height: 112px; padding: 12px; font-size: 16px; line-height: 1.65; }
body .cron-slab .slab-left { align-items: end; flex-wrap: wrap; gap: 16px; }
.schedule-field { display: grid; gap: 8px; min-width: 0; }
body .schedule-field :is(input, select) { width: 100%; min-height: 44px; }
body .cron-slab .seg button { min-height: 44px; }
.schedule-success { font-size: 14px; color: #2c593b; }
.route-empty { padding: 24px; margin: 24px 0; background: var(--pg-side); color: var(--pg-ink-2); border-radius: 12px; font-size: 15px; line-height: 1.65; }
.route-empty button { margin: 12px 0 0; display: flex; }
@media (max-width: 768px) {
  body .cron-slab .slab-left { width: 100%; }
  .schedule-field { width: 100%; }
  body .cron-slab .slab-foot { gap: 16px; }
}

/* Enter with usable content; keep the authored handoff for changing status. */
body .view, body .ck :is(.strip, .panel, .foot), body .gate-col,
body .gate :is(.gate-head > *, .door, .sp-back) { animation: none; }
body .cron-slab { background: transparent; border: 0; box-shadow: none; padding: 0; }
body #cronMessage { min-height: 112px; margin: 0; background: #f5f5f7; color: #141414; border: 1px solid #85858f; border-radius: 9px; }
body .schedule-field :is(input, select) { background: #fff; color: #141414; border: 1px solid #85858f; border-radius: 9px; }
body .cron-slab .seg { background: #f1f1f4; border-color: #85858f; }
body .cron-slab .seg button { color: #55555f; }
body .cron-slab .seg button[aria-checked="true"] { background: #18201c; color: #fff; }
body .cron-slab .slab-foot { align-items: end; }
body .view { --faint: #64646e; }
body .gate { --faint: #64646e; }
html[data-theme="dark"] body .gate { --faint: #b7bdb4; }
body:has(#spTitle) .gate-col { display: flex; flex-direction: column; align-items: start; gap: 24px; max-width: 680px; margin-inline: auto; flex: 0 1 auto; }
body:has(#spTitle) .gate-head { position: static; margin: 0; }
body:has(#spTitle) .gate-kicker { display: none; }
body:has(#spTitle) .sp-view { width: 100%; margin: 0; }
body:has(#spTitle) .sp-back { margin: 0; align-self: start; }
body:has(#spTitle) .gate-lede { margin-bottom: 0; max-width: 60ch; }
body .studio #chatSelect { min-height: 44px; font-size: 16px; }
body .page-frame .side-search { padding-block: 4px; }
body .act-pulse::before { animation: none; }
body #main.ck [data-section-hidden="true"] { display: none !important; }

/* Product craft system. Task groups share rhythm; each surface keeps its own
   composition. Controls have a 44px hit area without oversized pill chrome. */
:root {
  --bar-h: 60px; /* Match the shared navigation height in full-height panes. */
  --workspace-ink: #1b241e;
  --workspace-secondary: #566159;
  --workspace-surface: #ffffff;
  --workspace-soft: #f3f5f2;
  --workspace-edge: #d9dfd7;
  --workspace-field-edge: #a9b3a5;
  --workspace-focus: #546c34;
  --workspace-space-5: 20px;
  --workspace-radius-control: 8px;
  --workspace-radius-panel: 14px;
  --workspace-ease: cubic-bezier(.23, 1, .32, 1);
}
html:not([data-theme="dark"]) body {
  --pg-page: #edf0eb; --pg-side: var(--workspace-soft);
  --pg-ink: var(--workspace-ink); --pg-ink-2: var(--workspace-secondary);
  --pg-muted: var(--workspace-secondary); --pg-hair: var(--workspace-edge);
}
body { text-underline-offset: .2em; }
body :is(.app, .ap, .studio, .ck, .page-frame, .gate) {
  scrollbar-width: thin; scrollbar-color: #b8c2b3 transparent;
}
body :is(h1, h2, h3) { text-wrap: balance; }
body :is(.lede, .intro-lede, .ap-lede, .ck-sub) { text-wrap: pretty; }
body :is(.btn-solid, .btn-outline, .btn-quiet, .btn-danger, .ghost-btn) {
  min-height: 44px; border-radius: var(--workspace-radius-control);
  padding-inline: 16px; font-size: 13px; font-weight: 600;
  letter-spacing: 0; line-height: 1.4; gap: 8px;
}
body :is(.ap, .studio, .view, .ck, .page-frame) .btn-solid {
  background: var(--workspace-ink); color: #fff; border-color: var(--workspace-ink);
  box-shadow: none;
}
body :is(.ap, .studio, .view, .ck, .page-frame) .btn-solid:hover { background: #36462e; border-color: #36462e; }
body :is(.ap, .studio, .view, .ck, .page-frame) .btn-outline {
  border-color: var(--workspace-edge); color: var(--workspace-ink);
  background: var(--workspace-surface); box-shadow: none;
}
body :is(.ap, .studio, .view, .ck, .page-frame) .btn-outline:hover { background: var(--workspace-soft); border-color: var(--workspace-field-edge); }
body :is(.ap, .studio, .view, .ck, .page-frame) .btn-quiet { color: var(--workspace-secondary); background: transparent; }
body :is(.ap, .studio, .view, .ck, .page-frame) .btn-quiet:hover { color: var(--workspace-ink); background: var(--workspace-soft); }
body :is(button, input, select, textarea, a, summary):focus-visible { outline-color: var(--workspace-focus); }
body .pbar :is(button, a):focus-visible { outline-color: var(--workspace-accent); }
body :is(.ap, .studio, .view, .ck, .page-frame) :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
  font-size: 16px; line-height: 1.6; border-radius: 8px;
  border-color: var(--workspace-field-edge); background: var(--workspace-surface);
}
body :is(.ap, .studio, .view, .ck, .page-frame) :is(input, textarea)::placeholder { color: var(--workspace-secondary); }
body :is(.ap, .studio, .view, .ck, .page-frame) :is(input, textarea, select)[aria-invalid="true"] { border-color: #a52c20; }
body :is(.ap, .studio, .view, .ck, .page-frame) :is(input, textarea, select):focus-visible { outline-offset: 2px; }
body :is(button, a)[aria-disabled="true"], body :is(.btn-solid, .btn-outline, .btn-quiet):disabled { opacity: .55; cursor: not-allowed; }
body .pbar { padding-inline: 20px; min-height: 60px; }
body .pbar-nav { gap: 4px; }
body .pbar-nav > a { min-height: 44px; border-radius: 8px; font-size: 13px; gap: 8px; }
body .workspace-density { border-color: transparent; background: transparent; color: #c9d0c5; }
body .workspace-density:hover { background: #303b33; }
body .pbar-who { border-radius: 8px; }
body :is(.app, .ap, .studio, .page-frame) { box-shadow: none; }
html:not([data-theme="dark"]) body[data-shell="desk"] .app {
  --desk-page: #edf0eb; --desk-side: #f3f5f2;
  --desk-field: #f0f3ed; --desk-hair: #e0e5dd;
  --desk-card-edge: #d5ddd0; --desk-ink: var(--workspace-ink);
  --desk-ink-2: var(--workspace-secondary);
}
body[data-shell="desk"] .sidebar { padding: 16px 12px; }
body .chat-list .thread { border-radius: 8px; box-shadow: none; }
body .chat-list .thread.is-active { background: #e5ebdc; }
body[data-shell="desk"] .topbar { padding-inline: 24px; }
body .stage.is-welcome > .composer-wrap { padding-inline: 24px; }
body .stage.is-welcome .slab { min-height: 0; }
body .provider-guidance { margin-top: 12px; border-radius: 8px; padding: 12px 16px; box-shadow: none; }

/* Apps: wider readable entries and a focused task rail. */
body .ap { --ap-rail-w: clamp(350px, 31vw, 460px); --ap-side: var(--workspace-soft); --ap-field: var(--workspace-soft); --ap-ink: var(--workspace-ink); --ap-ink-2: var(--workspace-secondary); --ap-hair: var(--workspace-edge); }
body .ap-catalog, html[data-density="compact"] body .ap-catalog { padding: 32px; }
body .ap-head { display: grid; gap: 8px; }
body .ap-head .ap-meta { margin-top: 4px; font-size: 12px; }
body .ap-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
body .ap-card, html[data-density="compact"] body .ap-card {
  min-height: 150px; padding: 18px; border-radius: 12px;
  grid-template-columns: 36px minmax(0, 1fr) 20px; column-gap: 12px;
  border-color: var(--workspace-edge); box-shadow: none; transform: none;
}
body .ap-card:hover { background: #f6f8f2; border-color: #a9b99c; box-shadow: none; transform: none; }
body .ap-card-ic { width: 36px; height: 36px; background: #edf2e6; color: #4c6239; border-radius: 8px; }
body .ap-card-title { font-size: 15px; font-weight: 600; line-height: 1.5; }
body .ap-card-blurb { font-size: 13px; line-height: 1.65; -webkit-line-clamp: 2; margin-top: 6px; }
body .ap-card-kind { margin-top: 12px; font-size: 12px; }
body .ap-card[aria-current="true"] { border-color: #748963; background: #edf3e1; box-shadow: none; }
body .ap-group-head { margin-bottom: 12px; align-items: baseline; }
body .ap-discovery { gap: 12px; margin-top: 24px !important; }
body .ap-search { min-height: 48px; background: var(--workspace-soft); border-color: var(--workspace-edge); border-radius: 8px; }
body .ap-search input { background: transparent; }
body .ap-filters { gap: 8px; }
body .ap-filters button { padding-inline: 12px; border-radius: 8px; border-color: transparent; background: transparent; font-size: 12px; }
body .ap-filters button:hover { background: var(--workspace-soft); }
body .ap-filters button[aria-pressed="true"] { background: #e8eedb; color: #2b3b1f; border-color: transparent; }
body .ap-run { padding: 28px; background: var(--workspace-soft); }
body .ap-run-empty { min-height: 340px; align-content: center; gap: 24px; }
body .ap-run-empty .ap-ghost { display: none; }
body .ap-run-empty h2 { font-size: 24px; line-height: 1.35; letter-spacing: -.025em; }
body .ap-run-empty p { margin-top: 12px; font-size: 14px; line-height: 1.7; }
.ap-flow-guide { display: grid; gap: 20px; padding: 24px 0 0; border-top: 1px solid var(--workspace-edge); }
.ap-flow-guide li { display: grid; grid-template-columns: 28px 1fr; align-items: start; column-gap: 12px; }
.ap-flow-guide svg { width: 20px; height: 20px; color: #5b713f; }
.ap-flow-guide strong { display: block; font-size: 13px; color: var(--workspace-ink); }
.ap-flow-guide span { font-size: 13px; color: var(--workspace-secondary); line-height: 1.6; }
body .ap-run-head { gap: 12px; padding-bottom: 24px; }
body .ap-fields { gap: 24px; }
body .ap-fld { gap: 8px; }
body .ap-form { gap: 24px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
body .ap-disclosure { border: 0; border-top: 1px solid var(--workspace-edge); border-radius: 0; background: transparent; }
body .ap-disclosure > summary { min-height: 44px; padding-inline: 0; }
body .ap-ask { padding: 16px; background: #fff; border-color: var(--workspace-edge); border-radius: 10px; box-shadow: none; }
body .ap-form-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding-top: 24px; }
body .ap-form-foot #apCompletion { grid-column: 1; grid-row: 1; }
body .ap-form-foot #apRunBtn { grid-column: 2; grid-row: 1; background: var(--workspace-accent); border-color: transparent; color: var(--workspace-ink); }
body .ap-form-foot #apRunHint { grid-column: 1 / -1; line-height: 1.6; }

/* Studio: mode navigation is a tool choice, followed by a single work surface. */
body .studio { --st-side: var(--workspace-soft); --st-ink: var(--workspace-ink); --st-ink-2: var(--workspace-secondary); }
body .studio .bench, html[data-density="compact"] body .studio .bench { padding: 32px; }
body .studio .modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-block: 28px 20px; }
body .studio .mode { min-height: 84px; padding: 16px; border-radius: 10px; border-color: var(--workspace-edge); box-shadow: none; background: transparent; }
body .studio .mode[aria-selected="true"] { background: #edf3e1; border-color: #8b9d78; color: var(--workspace-ink); }
body .studio .mode-ic { width: 32px; height: 32px; border-radius: 8px; background: #e7eddd; color: #4c6239; }
body .studio .mode strong { font-size: 14px; line-height: 1.45; }
body .studio .mode small { font-size: 12px; line-height: 1.6; }
body .studio .tool { padding: 0; border: 0; background: transparent; box-shadow: none; }
body .studio .tool-head { margin-bottom: 12px; }
body .studio #promptInput { min-height: 156px; border-color: var(--workspace-field-edge); background: #fff; border-radius: 12px; }
body .studio .tool-foot { padding-top: 16px; }
body .studio .tool-foot .btn-solid { background: var(--workspace-accent); border-color: transparent; color: var(--workspace-ink); }
body .studio .library { background: var(--workspace-soft); border-color: var(--workspace-edge); padding: 24px; }
body .studio .library-head { margin-bottom: 20px; }
body .studio .library-organize { margin-block: 20px; }
body .studio .library-filter { gap: 8px; }
body .studio .library-empty { border: 1px dashed #a8b69b; border-radius: 12px; background: transparent; }
body .studio .receipt { border-radius: 10px; background: transparent; border-color: var(--workspace-edge); }
body .studio-start { padding: 24px; background: #edf3e1; border: 0; border-radius: 12px; }
body .studio-start-step { display: none; }

/* Work and Admin: scanable controls, grouped facts, predictable form spacing. */
body .view, html[data-density="comfortable"] body .view { padding: 32px; }
body .runs-toolbar { gap: 16px; margin-bottom: 24px; }
body .filters { gap: 8px; }
body .filters .chip { min-height: 44px; border-radius: 8px; padding-inline: 12px; }
body .filters .chip.is-on { background: #e8eedb; color: var(--workspace-ink); border-color: transparent; }
body .host-load { padding: 20px; border: 1px solid var(--workspace-edge); border-radius: 12px; box-shadow: none; margin-bottom: 24px; }
body .cron-slab { gap: 20px; }
body #cronMessage { padding: 16px; background: #fff; border-color: var(--workspace-field-edge); }
body .cron-slab .slab-foot { gap: 20px; }
body .ck { --bone-dim: var(--workspace-secondary); }
body .ck-head { padding-block: 8px 24px; }
body .ck .admin-nav { gap: 8px; margin-bottom: 28px; }
body .ck .admin-nav a { min-height: 44px; padding-inline: 16px; border-radius: 8px; font-size: 13px; }
body .ck .admin-nav a[aria-current="page"] { background: #e8eedb; color: var(--workspace-ink); }
body .ck .strip { border: 1px solid var(--workspace-edge); border-radius: 12px; overflow: hidden; box-shadow: none; margin-bottom: 24px; }
body .ck .cell { padding: 20px; background: transparent; }
body .ck .cell-num { font-size: 28px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
body .ck .cell-tape { font: 500 12px var(--sans); letter-spacing: 0; text-transform: none; margin-bottom: 12px; }
body .ck .cell-sub { font-size: 12px; line-height: 1.6; margin-top: 8px; }
body .ck .panel, html[data-density="comfortable"] body .ck .panel { padding: 24px; border-radius: 12px; border-color: var(--workspace-edge); box-shadow: none; }
body .ck .panel-head { align-items: start; gap: 12px; margin-bottom: 20px; }
body .ck .panel-head h2 { font-size: 17px; line-height: 1.45; }
body .ck table :is(td, th) { padding: 14px 12px; }
body .ck :is(.src, .cell-sub) { overflow-wrap: anywhere; }

/* Read and account surfaces keep an editorial measure and clear next actions. */
body .page-frame { --pg-inset: 12px; --pg-r: 14px; --pg-sh: none; }
body .page-frame .display { font-size: clamp(30px, 3vw, 42px); line-height: 1.2; letter-spacing: -.025em; }
body .page-frame .verdict { gap: 32px; padding-bottom: 32px; }
body .page-frame .verdict-copy { gap: 16px; }
body .page-frame .pulse { padding: 20px; border-radius: 12px; border: 1px solid var(--workspace-edge); background: var(--workspace-soft); box-shadow: none; }
body .page-frame .pulse-row { gap: 12px; }
body .page-frame .fact { padding-block: 18px; column-gap: 16px; }
body .page-frame .intro { max-width: 72ch; }
body .page-frame .op { padding-block: 24px; }
body .page-frame .op-head { gap: 12px; }
body .page-frame .op-path { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
body .page-frame .params :is(th, td) { padding: 12px; line-height: 1.6; }
body .page-frame .side-search { min-height: 48px; border-color: var(--workspace-field-edge); border-radius: 8px; }
body .page-frame .side-search input { background: transparent; }
body .land .land-title { font-size: clamp(38px, 5.4vw, 72px); line-height: 1.08; letter-spacing: -.03em; }
body .land .land-every { color: #536b35; }
body .land .land-now { border-radius: 12px; box-shadow: none; border: 1px solid var(--workspace-edge); padding: 24px; background: var(--workspace-soft); }
body .land .land-actions { gap: 16px; margin-top: 28px; }
body .land .land-go { background: var(--workspace-accent); border-color: transparent; color: var(--workspace-ink); min-height: 48px; padding-inline: 24px; }
body:has(#spTitle) .gate-col { max-width: 520px; gap: 28px; }
body:has(#spTitle) .door { padding: 24px; border-radius: 12px; box-shadow: none; }
body:has(#spTitle) .gate-head h1 { font-size: 36px; line-height: 1.2; }

/* One authored motion: occasional sheets arrive from their invoking control.
   Daily keyboard navigation and reduced motion always render immediately. */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-keyboard-nav]) body :is(.menu, .modal):not([hidden]) {
    animation: workspace-reveal 160ms var(--workspace-ease) both;
  }
  @keyframes workspace-reveal { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
  html:not([data-keyboard-nav]) body :is(.btn-solid, .btn-outline, .btn-quiet, .btn-send):not(:disabled):active { transform: scale(.98); }
}
@media (max-width: 1100px) {
  body .ap-cards { grid-template-columns: minmax(0, 1fr); }
  body .ap-card, html[data-density="compact"] body .ap-card { min-height: 120px; }
}
@media (max-width: 768px) {
  body .pbar { padding-inline: 12px; }
  body .ap-catalog, html[data-density="compact"] body .ap-catalog,
  body .studio .bench, html[data-density="compact"] body .studio .bench,
  body .view, html[data-density="comfortable"] body .view { padding: 24px 16px; }
  body .ap-run { padding: 24px 16px; }
  body .ap-run-empty { min-height: 0; }
  body .ap-run-empty h2 { font-size: 22px; }
  body .ap-run-empty .ap-flow-guide { display: none; }
  body .studio .modes { gap: 8px; }
  body .studio .mode { padding: 12px; }
  body .studio .mode small { display: none; }
  body .studio .library { padding: 24px 16px; }
  body .ck .panel, html[data-density="comfortable"] body .ck .panel { padding: 20px 16px; }
  body .ck .cell { padding: 16px; }
  body .ck .cell-num { font-size: 24px; }
  body .ck table :is(td, th) { padding: 12px; }
  body .page-frame .verdict { gap: 24px; }
  body .land .land-title { font-size: 42px; }
  body:has(#spTitle) .gate-head h1 { font-size: 30px; }
}
@media (forced-colors: active) {
  body :is(.ap-filters button[aria-pressed="true"], .mode[aria-selected="true"], .admin-nav a[aria-current="page"], .filters .chip.is-on) { border: 1px solid Highlight; }
}

/* Resolved against the real rendered controls, including selected children. */
body .studio .mode[aria-selected="true"] :is(strong, .mode-ic, .mode-go) { color: var(--workspace-ink); }
body .studio .mode::after { display: none; }
body .ap #apSearch, body .studio #mediaSearch { background: transparent; border: 0; outline: none; border-radius: 0; }
body .studio .media-search:focus-within { outline: 2px solid var(--workspace-focus); outline-offset: 2px; }
body .studio .media-search input { box-shadow: none; }
body .ck { box-shadow: none; border-radius: 14px; }
body .ck .admin-nav { background: transparent; border: 0; padding: 0; border-radius: 0; }
body .ck .admin-nav a { box-shadow: none; }
body:has(#spTitle) .gate-col { padding: 32px; border-radius: 14px; box-shadow: none; }
body:has(#spTitle) .gate-head, body .app .sidebar, body .app .nav-item,
body .page-frame .verdict, body .gate .gate-head { animation: none; }
body:has(#spTitle) #forgotView { padding: 0; background: transparent; border: 0; min-height: 0; }
body:has(#spTitle) .sp-back { min-height: 44px; margin: 0; align-items: center; display: inline-flex; }
body .studio .mode strong { white-space: normal; }
@media (max-width: 768px) {
  body:has(#spTitle) .gate-col { padding: 24px 16px; }
  body .ck .admin-nav { overflow-x: auto; padding-bottom: 4px; }
  body .ck .admin-nav a { flex: none; }
}
/* Desk appearance follows the saved light/dark preference, including fields. */
html[data-theme="dark"] body[data-shell="desk"] {
  --workspace-ink: #e9eee5; --workspace-secondary: #bcc7b7;
  --workspace-surface: #1e241e; --workspace-soft: #232b22;
  --workspace-edge: #3e4a38; --workspace-field-edge: #66785f;
  --workspace-focus: #deec71;
}
html[data-theme="dark"] body[data-shell="desk"] .chat-list .thread.is-active { background: #293525; }
html[data-theme="dark"] body[data-shell="desk"] .gate {
  --desk-muted: #bcc7b7; --faint: #bcc7b7;
}
html[data-theme="dark"] body[data-shell="desk"] :is(.gate, .modal) :is(input, textarea)::placeholder { color: #bcc7b7; }
html[data-theme="dark"] body[data-shell="desk"] #composerInput::placeholder { color: #bcc7b7; }
body .ap .ap-run-dot, body .ap .ap-wait i { animation: none; }
body .modal { border-radius: 14px; padding: 24px; box-shadow: none; }
body .modal .modal-head { gap: 16px; margin-bottom: 24px; }
body .modal .modal-actions { gap: 12px; padding-top: 20px; }
body .modal .settings-row { padding-block: 16px; }
body .modal :is(.settings-name, .settings-password) { padding-block: 24px; }
body .ap :is(.ap-door-card, .ap-ghost), body .studio .studio-gate .door { box-shadow: none; }
body .app .side-search { padding-block: 8px; }
@media (max-width: 768px) {
  body .modal { padding: 20px 16px; }
}
body .land :is(.land-title, .land-every, .land-lede) { animation: none; }
body:has(#spTitle) #forgotView:has(#forgotForm[hidden]):has(#forgotDone[hidden]) { display: none; }

html[data-keyboard-nav] body :is(.menu, .modal, .door-panel, .stage-preview) { animation: none; }
html[data-keyboard-nav] body .model-btn .chev { transition: none; }

body .empty details.template-row { margin-top: 16px; padding-top: 0; border: 0; }
body .empty details.template-row > summary { min-height: 44px; padding: 12px 0; cursor: pointer; font: 500 13px var(--sans); color: var(--desk-ink-2); }
body .empty details.template-row .template-list { padding-block: 8px 16px; }

/* One task launcher across product surfaces, including the Desk's own list. */
/* Daily page jumps stay immediate; overlapping native reveals can abort. */
@view-transition { navigation: none; }
body :is(.sh-palette, .command-dialog) {
  width: min(92vw, 640px); max-height: 82dvh; margin: 8vh auto 0;
  border-radius: 14px; box-shadow: none; overflow: auto;
}
body .sh-palette[open], body .command-dialog[open] { animation: none; }
body :is(.sh-palette, .command-dialog)::backdrop { background: rgb(18 26 20 / .48); }
body :is(.sh-palette-search, .command-search) { min-height: 64px; padding: 12px 20px; gap: 12px; }
body :is(.sh-palette-search, .command-search) input { font: 500 16px/1.5 var(--sans); }
body :is(.sh-palette-search, .command-search) input::placeholder { color: var(--bone-dim); }
body :is(.sh-palette-list, .command-results) { max-height: 48dvh; padding: 8px; scroll-behavior: auto; }
body :is(.sh-palette-group, .command-group) { padding: 16px 12px 8px; font: 600 12px/1.5 var(--sans); color: var(--bone-dim); }
body :is(.sh-palette-item, .command-option) {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
  min-height: 48px; padding: 10px 12px; gap: 12px; border-radius: 8px;
  font: 500 14px/1.5 var(--sans); transition: none;
}
body .sh-palette-item small, body .command-option .command-meta {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 400 12px/1.5 var(--sans); color: var(--bone-dim);
}
body :is(.sh-palette-item[aria-selected="true"], .command-option.is-active) { background: var(--workspace-accent); color: #192013; }
body :is(.sh-palette-item[aria-selected="true"], .command-option.is-active) :is(b, small, .command-label, .command-meta) { color: #192013; }
body :is(.sh-palette-item, .command-option)::before { display: none; }
body :is(.sh-palette-item, .command-option):active { transform: none; }
body .command-footer { border-top: 1px solid var(--edge); padding: 14px 20px 16px; display: grid; gap: 8px; }
body .command-footer p { margin: 0; font: 400 12px/1.6 var(--sans); color: var(--bone-dim); }
body .command-footer :is(#shPaletteCount, #commandCount) { color: var(--bone); font-weight: 600; }
body .command-footer button { min-height: 44px; justify-self: start; padding: 8px 12px; border: 1px solid var(--edge); border-radius: 8px; background: transparent; color: var(--bone); font: 500 13px var(--sans); cursor: pointer; }
body :is(.sh-palette-empty, .command-empty) { padding: 24px 20px; font: 400 14px/1.7 var(--sans); color: var(--bone-dim); }
@media (max-width: 600px) {
  body :is(.sh-palette, .command-dialog), html[data-kb-open] body :is(.sh-palette, .command-dialog) {
    inset: 24px 16px auto; width: auto; height: auto; margin: 0;
    max-height: calc(100dvh - 48px - var(--vv-keyboard, 0px)); padding-top: 0;
  }
  body :is(.sh-palette-search, .command-search) { padding-inline: 16px; }
  body :is(.sh-palette-search, .command-search) kbd {
    min-width: 44px; min-height: 44px; display: inline-grid; place-items: center;
    font: 500 13px var(--sans); cursor: pointer;
  }
  body :is(.sh-palette-list, .command-results) { flex: 0 1 auto; min-height: 0; }
  body :is(.sh-palette-item, .command-option) { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  body .command-option :is(.command-label, .command-meta) { grid-column: auto; }
  body .sh-palette-item small { padding-inline-start: 0; }
  body .command-footer { padding-inline: 16px; }
  body .command-key-hint { display: none; }
}

/* Short phone viewports need a scrollable work surface: a tall composer,
   account notice or connection message must never hide its final action. */
@media (max-width: 860px) and (max-height: 520px) {
  body[data-shell="desk"] .stage:not(.is-welcome) {
    grid-template-rows: auto auto minmax(96px, 1fr) auto;
    overflow-y: auto; overscroll-behavior-y: contain;
  }
}
@media (max-width: 860px) {
  html[data-kb-open] body[data-shell="desk"] .stage:not(.is-welcome) {
    grid-template-rows: auto auto minmax(96px, 1fr) auto;
    overflow-y: auto; overscroll-behavior-y: contain;
  }
}
@media (max-width: 860px) {
  body[data-shell="desk"] .topbar .top-right { gap: 8px; padding: 0; background: transparent; }
  body[data-shell="desk"] .topbar .top-right .icon-btn {
    width: 44px; height: 44px; min-width: 44px; min-height: 44px;
    box-shadow: none;
  }
  body[data-shell="desk"] .topbar .top-right .icon-btn::after { content: none; }
  body[data-shell="desk"] .chat-row-actions { gap: 8px; }
  body[data-shell="desk"] .chat-row-action,
  body[data-shell="desk"] .later-drop { min-width: 44px; min-height: 44px; }
  body[data-shell="desk"] .later-go { min-height: 44px; }
}

/* Admin is a document, with tables scrolling inside it. Giving both body
   and the document a scrolling box wastes phone width on two gutters. */
body:has(#main.ck) { overflow-x: clip; overflow-y: visible; }
@media (max-width: 480px) {
  body #main.ck, html[data-theme] body #main.ck {
    width: auto; margin: 16px; padding: 0; border: 0;
    background: transparent;
  }
}
/* Task entrances and the common continuation vocabulary. */
.ap-entry-example { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--ap-hair); max-width: 48ch; }
.ap-entry-example h2 { font-size: 18px; margin: 0 0 8px; }
.ap-entry-example p { font-size: 14px; line-height: 1.6; color: #5c5c66; }
.work-start-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.work-active { margin-bottom: 28px; }
.work-active h2 { font-size: 18px; margin: 0 0 12px; }
.work-active ul { list-style: none; margin: 0; padding: 0; }
.work-active-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--edge); }
.work-active-row > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.work-active-status { font-size: 13px; color: var(--bone-dim); }
.workspace-example-status { font-size: 14px; line-height: 1.5; color: var(--bone-dim); margin: 12px 0; }
.workspace-example-status button { margin-left: 12px; }
body[data-shell="studio"] .studio-gate { display: block; max-width: 480px; margin: 32px auto; }
body[data-shell="studio"] .studio-gate .gate-pitch { display: none; }
body[data-shell="studio"] .studio-gate .gate-card { box-sizing: border-box; width: 100%; border-radius: 16px; }
body[data-shell="studio"] .studio-gate .gate-grid { grid-template-columns: 1fr; }
.studio-workspace-options { margin: 20px 0; }
.studio-workspace-options summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 14px; font-weight: 600; }
.studio-workspace-options summary::after { content: "+"; margin-left: auto; }
.studio-workspace-options[open] summary::after { content: "−"; }
.sh-signin .foot a { color: #41414b; text-underline-offset: 3px; }
@media (max-width: 600px) {
  .work-start-actions > * { flex: 1 1 auto; text-align: center; justify-content: center; }
  .work-active-row { flex-wrap: wrap; }
  .work-active-row > span:first-child { flex-basis: 100%; }
  .work-active-row .btn-outline { margin-left: auto; }
  .inbox-filters, .library-filter, .google-task-tabs { flex-wrap: wrap; overflow: visible; gap: 8px; }
  body[data-shell="studio"] .studio-gate { margin: 16px auto; }
  .inbox-actions > *, .receipt-actions > * { min-height: 44px; }
  .workspace-example-status button { display: block; margin: 8px 0 0; }
}

/* Compact recovery entrances use the same visible form rhythm. */
body .sh-signin { border-radius: 16px; box-shadow: none; }
body:has(#secResults) .gate > .sh-signin { animation: none; }
.schedule-repeat-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: start; }
.schedule-repeat-fields > .hint { flex-basis: 100%; margin: 0; }
#cronAdvanced { flex-basis: 100%; }
#cronAdvanced summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.schedule-preview { margin-top: 24px; }
.schedule-preview p { font-size: 14px; }
.schedule-preview ol:empty { display: none; }
@media (max-width: 720px) { body:has(#secResults) .gate > .sh-signin { align-self: start; margin: 24px auto; } .schedule-repeat-fields, .schedule-repeat-fields > label { width: 100%; } }
