/* The supermux desktop app, rebuilt in HTML. Every value comes from the app's source:
   palette apps/shared/.../ui/Theme.kt, roles ui/theme/SupermuxTheme.kt, type ui/theme/Type.kt
   (desktop scale), spacing ui/theme/Tokens.kt, and the composables named beside each block.
   Sizes are CSS px = dp. Colours are the hex the app's own OKLCH conversion produces. */

.sm-app {
  --bg: #080A07;
  --fg: #EAECE6;            /* onSurface */
  --fg-var: #969A8E;        /* onSurfaceVariant */
  --primary: #4BBAA7;
  --error: #FF6F6B;
  --success: #53BE70;
  --warning: #EBB25F;
  --outline: #272A25;
  --outline-var: #171915;
  --sc-lowest: #040503;
  --sc-low: #0B0D09;        /* chat panel, tab strip */
  --sc: #10120F;            /* surfaceContainer */
  --sc-high: #161814;       /* sidebar */
  --sc-highest: #1E201C;
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --code: "JetBrains Mono", "Geist Mono", ui-monospace, monospace;
  position: relative;
  display: flex;
  overflow: hidden;
  color: var(--fg);
  background: var(--sc-low);
  font: 400 14px/20px var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  cursor: default;
}
.sm-app svg { display: block; fill: currentColor; flex: none; }
.sm-app .ib { display: grid; place-items: center; flex: none; color: var(--fg-var); }

/* ── sidebar (SessionListScreen, WorkspaceRow, SessionRow) ───────────── */
.sm-side { width: 320px; flex: none; display: flex; flex-direction: column; min-height: 0; background: var(--sc-high); }
.sm-new { margin: 16px 12px 4px; padding: 12px; gap: 12px; display: flex; align-items: center; border-radius: 12px; background: var(--sc); }
.sm-new-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in oklab, var(--primary) 12%, transparent); color: var(--primary); }
.sm-new-icon svg { width: 18px; height: 18px; }
.sm-new div b { display: block; font-size: 14px; line-height: 18px; font-weight: 500; }
.sm-new div span { display: block; margin-top: 4px; font-size: 11px; line-height: 15px; color: var(--fg-var); }
.sm-ws-head { display: flex; align-items: center; padding: 10px 4px 4px 14px; font-size: 11px; line-height: 14px; color: var(--fg-var); }
.sm-ws-head .sp { flex: 1; }
.sm-ws-head .ib { width: 28px; height: 28px; }
.sm-ws-head .ib svg { width: 15px; height: 15px; }
.sm-ws-head .ib.on { color: var(--primary); }
.sm-ws-head .ib.more { width: 48px; height: 48px; }
.sm-ws-head .ib.more svg { width: 20px; height: 20px; }
.sm-list { flex: 1; min-height: 0; overflow: hidden; padding-bottom: 8px; }
.sm-proj { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin-top: 2px; font-size: 12px; line-height: 16px; font-weight: 500; }
.sm-proj .av { width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; font-size: 10px; font-weight: 600; color: #fff; }
.sm-proj .sp { flex: 1; }
.sm-proj .cnt { display: flex; align-items: center; gap: 4px; color: var(--success); font-size: 11px; font-weight: 600; margin-right: 6px; }
.sm-proj .cnt::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.sm-proj .ib { width: 24px; height: 24px; }
.sm-proj .ib svg { width: 16px; height: 16px; }
.sm-proj .ib.chev { color: color-mix(in oklab, var(--fg-var) 50%, transparent); }
.sm-proj .ib.chev svg { width: 14px; height: 14px; }

.sm-row { display: flex; gap: 10px; margin: 2px 8px 4px; padding: 7px 12px 9px; border-radius: 6px; }
.sm-row.sel { background: var(--sc); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.sm-row .st { width: 14px; height: 14px; margin-top: 23px; display: grid; place-items: center; flex: none; }
.sm-row .tx { flex: 1; min-width: 0; }
.sm-row .t { display: flex; align-items: center; gap: 6px; }
.sm-row .t b { flex: 1; min-width: 0; font-size: 13px; line-height: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-row .t .grp { color: var(--primary); }
.sm-row .t .grp svg { width: 16px; height: 16px; }
.sm-row .t time { font: 400 10px/13px var(--mono); color: var(--fg-var); }
.sm-row .pv { margin-top: 7.5px; font-size: 11px; line-height: 15px; color: var(--fg-var); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-row .br { margin-top: 7.5px; font: 400 10px/13px var(--mono); color: var(--fg-var); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 1.5px var(--sc-high), 0 0 0 3px color-mix(in oklab, var(--success) 35%, transparent); }
.sm-fork { color: var(--warning); }
.sm-fork svg { width: 14px; height: 14px; }
.sm-idle { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in oklab, var(--fg-var) 30%, transparent); }

.sm-kids { margin: 4px 8px 5px; }
.sm-kid { display: flex; align-items: center; gap: 8px; height: 32px; padding-left: 31px; font-size: 12px; color: var(--fg-var); white-space: nowrap; overflow: hidden; }
.sm-kid .k { min-width: 6px; height: 14px; display: grid; place-items: center; flex: none; }
.sm-kid span:last-child { overflow: hidden; text-overflow: ellipsis; }
.sm-archived { display: flex; align-items: center; height: 36px; padding: 0 20px; font-size: 12px; color: var(--fg-var); }

.sm-host { flex: none; display: flex; align-items: center; gap: 2px; padding: 4px; border-top: 1px solid color-mix(in oklab, var(--fg) 14%, transparent); }
.sm-host .pill { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 500; }
.sm-host .pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #F48684; }
.sm-host .pill svg { width: 16px; height: 16px; color: var(--fg-var); }
.sm-host .sp { flex: 1; }
.sm-host .ib { width: 30px; height: 30px; }
.sm-host .ib svg { width: 15px; height: 15px; }

/* the app's CircularProgressIndicator: an arc that turns */
.sm-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--primary); border-right-color: var(--primary); animation: sm-turn .9s linear infinite; }
.sm-spin.sm { width: 11px; height: 11px; border-width: 1.5px; border-top-color: color-mix(in oklab, var(--fg-var) 70%, transparent); border-right-color: transparent; }
@keyframes sm-turn { to { transform: rotate(360deg); } }

/* ── workspace: the layout tree (PaneHost, SplitSeam) ───────────────── */
/* seams are overlays (SplitSeam.kt): panes sit edge to edge and keep their full share */
.sm-work { position: relative; flex: 1; min-width: 0; display: grid; background: var(--sc-low); }
.sm-work.split-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.sm-seam { position: absolute; z-index: 2; background: color-mix(in oklab, var(--fg) 18%, transparent); pointer-events: none; }
.sm-seam.v { top: 0; bottom: 0; width: 1px; }
.sm-seam.h { left: 0; right: 0; height: 1px; }

.sm-pane { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--sc-low); }
.sm-tabs { flex: none; height: 32px; display: flex; align-items: stretch; }
.sm-tab { display: flex; align-items: center; gap: 4px; min-width: 56px; padding: 0 8px 0 14px; background: color-mix(in oklab, var(--primary) 14%, var(--sc-low)); color: var(--primary); font: 500 11px/14px var(--mono); white-space: nowrap; }
.sm-tab .ti { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.sm-tab .x { width: 16px; height: 16px; display: grid; place-items: center; opacity: .85; }
.sm-tab .x svg { width: 12px; height: 12px; }
.sm-tabs .add { width: 36px; display: grid; place-items: center; color: var(--fg-var); }
.sm-tabs .add svg { width: 16px; height: 16px; }

/* ChatPanel header */
.sm-crumb { position: relative; z-index: 1; flex: none; height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 8px 0 16px; font-size: 13px; line-height: 17px; white-space: nowrap; }
.sm-crumb::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 28px; pointer-events: none;
  background: linear-gradient(var(--sc-low) 0%, color-mix(in oklab, var(--sc-low) 72%, transparent) 45%, color-mix(in oklab, var(--sc-low) 28%, transparent) 75%, transparent); }
.sm-crumb .fold svg { width: 17px; height: 17px; color: var(--fg-var); }
.sm-crumb .dir { color: var(--fg-var); }
.sm-crumb .sl { color: var(--outline); }
.sm-crumb .ti { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.sm-crumb .busy { display: none; align-items: center; gap: 6px; margin-left: 4px; font: 400 11px/14px var(--mono); color: var(--fg-var); }
.sm-crumb .busy::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); flex: none; }
.sm-pane.working .sm-crumb .busy { display: flex; }
.sm-crumb .sp { flex: 1; }
.sm-crumb .ib { width: 40px; height: 40px; }
.sm-crumb .ib svg { width: 20px; height: 20px; }
.sm-pane.n560 .sm-crumb .fold, .sm-pane.n560 .sm-crumb .dir, .sm-pane.n560 .sm-crumb .sl { display: none; }
.sm-pane.n460 .sm-crumb .busy .w { display: none; }

/* transcript (Timeline) */
.sm-chat { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; position: relative; }
.sm-chat-in { max-width: 860px; margin: 0 auto; padding: 12px 16px 12px; }
.sm-chat-in > * { animation: sm-in .26s ease-out both; }
@keyframes sm-in { from { opacity: 0; } }
.sm-user { display: flex; justify-content: flex-end; padding: 8px 0; }
.sm-user div { max-width: 75%; padding: 8px 12px; border-radius: 12px 12px 4px 12px; background: color-mix(in oklab, var(--sc) 92%, transparent); border: 1px solid var(--outline-var); font-size: 13px; line-height: 18px; white-space: pre-wrap; }
.sm-tool { display: flex; align-items: center; padding: 9px 0; font-size: 11px; line-height: 14px; font-weight: 500; }
.sm-tool .d { width: 11px; display: grid; place-items: center; font-size: 14px; line-height: 14px; color: color-mix(in oklab, var(--fg-var) 55%, transparent); flex: none; }
.sm-tool.failed .d { color: color-mix(in oklab, var(--error) 70%, transparent); }
.sm-tool .v { margin-left: 6px; color: color-mix(in oklab, var(--fg-var) 90%, transparent); flex: none; }
.sm-tool .a { flex: 1; min-width: 0; padding-left: 4px; color: color-mix(in oklab, var(--fg-var) 65%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-tool .f { display: none; padding-left: 8px; font-size: 10px; color: color-mix(in oklab, var(--error) 80%, transparent); }
.sm-tool.failed .f { display: block; }
.sm-think { display: flex; align-items: center; gap: 6px; padding: 9px 0; font-size: 11px; line-height: 14px; font-weight: 500; color: var(--fg-var); }
.sm-pane.tool-running .sm-think { display: none; }
.sm-asst { padding: 8px 0 0; font-size: 14px; line-height: 20px; }
.sm-asst p { margin: 0 0 8px; }
.sm-asst ul { margin: 0 0 8px; padding: 0 0 0 30px; list-style: none; }
.sm-asst li { position: relative; margin: 0 0 4px; }
.sm-asst li > ul { margin: 4px 0 0; }
.sm-asst li li::before { background: transparent; border: 1px solid var(--primary); width: 3px; height: 3px; }
.sm-asst li::before { content: ""; position: absolute; left: -12px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.sm-asst strong { font-weight: 600; }
.sm-asst code { font: 400 0.9em/1 var(--mono); background: color-mix(in oklab, var(--fg) 8%, transparent); }
.sm-asst a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.sm-asst pre { position: relative; margin: 4px 0 10px; padding: 6px 36px 6px 20px; border-left: 2px solid color-mix(in oklab, var(--primary) 45%, transparent); font: 400 12px/18px var(--code); font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; white-space: pre; overflow: hidden; }
.sm-asst pre svg { position: absolute; right: 6px; top: 6px; width: 16px; height: 16px; color: var(--fg-var); }
.sm-meta { display: flex; align-items: center; gap: 2px; margin-top: 4px; padding-bottom: 8px; }
.sm-meta span { font: 500 11px/14px var(--mono); color: color-mix(in oklab, var(--fg-var) 55%, transparent); margin-right: 4px; }
.sm-meta i { width: 28px; height: 28px; display: grid; place-items: center; color: color-mix(in oklab, var(--fg-var) 65%, transparent); }
.sm-meta i svg { width: 14px; height: 14px; }

/* composer (Composer.kt) and status bar (ComposerFooter.kt) */
.sm-dock { flex: none; padding: 0 16px 4px; }
.sm-composer { border-radius: 24px; background: color-mix(in oklab, var(--sc-high) 72%, var(--sc-low)); border: 1px solid color-mix(in oklab, var(--outline-var) 65%, transparent); padding: 11px 14px 10.5px; }
.sm-composer .ph { min-height: 20px; font-size: 14px; line-height: 20px; color: color-mix(in oklab, var(--fg-var) 72%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-composer .row { display: flex; align-items: center; gap: 2px; margin-top: 17px; height: 48px; }
.sm-composer .plus { width: 32px; height: 32px; }
.sm-composer .plus svg { width: 18px; height: 18px; }
.sm-chip { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 999px; font-size: 12px; line-height: 16px; color: var(--fg-var); white-space: nowrap; }
.sm-chip .lg svg { width: 12px; height: 12px; color: #EDEDED; }
.sm-chip .ch svg { width: 14px; height: 14px; }
.sm-chip .bolt svg { width: 13px; height: 13px; }
.sm-chip .gauge svg { width: 14px; height: 14px; fill: none; }
.sm-composer .sp { flex: 1; min-width: 0; }
.sm-mic { width: 48px; height: 48px; display: grid; place-items: center; flex: none; }
.sm-mic i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--sc); color: var(--fg-var); }
.sm-mic svg { width: 16px; height: 16px; }
.sm-send { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--sc-highest); color: color-mix(in oklab, var(--fg-var) 60%, transparent); margin: 0 6px 0 2px; }
.sm-send svg { width: 14px; height: 14px; }
.sm-send b { display: none; width: 10px; height: 10px; border-radius: 2px; background: #fff; }
.sm-pane.working .sm-send { background: var(--error); }
.sm-pane.working .sm-send svg { display: none; }
.sm-pane.working .sm-send b { display: block; }
.sm-status { flex: none; height: 24px; margin: 0 16px 7px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; line-height: 14px; color: var(--fg-var); white-space: nowrap; }
.sm-status > span { display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 6px; min-width: 0; }
.sm-status svg { width: 12px; height: 12px; }
.sm-status .br { overflow: hidden; text-overflow: ellipsis; }
.sm-pane.n460 .sm-chip.perm .w { display: none; }

/* ── phone: one view at a time, the touch type scale ────────────────── */
.sm-app.phone { display: block; }
.sm-app.phone .sm-pane { height: 100%; }
.sm-phead { position: relative; z-index: 1; flex: none; height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 4px 0 12px; }
.sm-phead::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 28px; pointer-events: none;
  background: linear-gradient(var(--sc-low) 0%, color-mix(in oklab, var(--sc-low) 72%, transparent) 45%, color-mix(in oklab, var(--sc-low) 28%, transparent) 75%, transparent); }
.sm-phead .ti { font-size: 13px; line-height: 17px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-phead .busy { display: none; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); flex: none; }
.sm-pane.working .sm-phead .busy { display: block; }
.sm-phead .sp { flex: 1; }
.sm-phead .ib { width: 32px; height: 32px; }
.sm-phead .ib svg { width: 17px; height: 17px; }
.sm-phead .ib.more svg { width: 18px; height: 18px; }
.sm-tc { position: relative; width: 40px; height: 40px; flex: none; }
.sm-tc::before { content: ""; position: absolute; left: 14px; top: 9px; width: 16px; height: 16px; border-radius: 4.5px; border: 1.25px solid color-mix(in oklab, var(--fg-var) 45%, transparent); box-sizing: border-box; }
.sm-tc b { position: absolute; left: 10px; top: 13px; width: 18px; height: 18px; box-sizing: border-box; border-radius: 5px; border: 1.5px solid var(--fg); background: var(--sc-low); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; line-height: 1; }
.sm-pane.phone .sm-chat-in { padding: 12px 12px; }
.sm-pane.phone .sm-user div { font-size: 14px; line-height: 20px; }
.sm-pane.phone .sm-asst { font-size: 16px; line-height: 24px; }
.sm-pane.phone .sm-asst li::before { top: 10px; }
.sm-pane.phone .sm-tool, .sm-pane.phone .sm-think { font-size: 12px; line-height: 16px; }
.sm-pane.phone .sm-dock { padding: 0 8px; }
.sm-pane.phone .sm-composer .ph { white-space: normal; max-height: 40px; }
.sm-pane.phone .sm-composer .plus { width: 48px; height: 48px; margin: -8px -4px -8px -10px; }
.sm-pane.phone .sm-composer .plus i { width: 34px; height: 34px; border-radius: 9px; background: var(--sc-high); display: grid; place-items: center; }
.sm-pane.phone .sm-composer .plus svg { width: 19px; height: 19px; }
.sm-pane.phone .sm-chip.fast { display: none; }
.sm-pane.phone .sm-composer .row { overflow: hidden; }
.sm-pane.phone .sm-chip { font-size: 14px; flex: none; }
.sm-pane.phone .sm-chip.perm { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.sm-pane.phone .sm-chip .lg { width: 16px; height: 16px; border-radius: 4px; background: #F7F4EE; display: grid; place-items: center; }
.sm-pane.phone .sm-chip .lg svg { width: 11px; height: 11px; color: #1A1A1A; }
.sm-pane.phone .sm-chip .gauge svg { width: 17px; height: 17px; }
.sm-pane.phone .sm-status { margin: 3px 8px 6px; }

/* ── code colours: editor-compose EditorTheme.kt (dark) ─────────────── */
.sm-app .c-kw { color: #C678DD; font-style: normal; }
.sm-app .c-str { color: #98C379; font-style: normal; }
.sm-app .c-op { color: #56B6C2; font-style: normal; }
.sm-app .c-num { color: #D19A66; font-style: normal; }
.sm-app .c-com { color: #7F848E; }
.sm-app .c-fn { color: #5CC8B4; font-style: normal; }
.sm-app .c-meth { color: #61AFEF; font-style: normal; }
.sm-app .c-type { color: #E5C07B; font-style: normal; }
.sm-app .c-red { color: #E06C75; font-style: normal; }
.sm-app .c-par { color: #E5A36C; font-style: normal; }
.sm-app .c-pun { color: #A3AAA0; font-style: normal; }
.sm-app .c-b { font-weight: 700; font-style: normal; }

/* ── Changes pane (DiffView.kt) ─────────────────────────────────────── */
.sm-changes { background: #0A0B09; }
.sm-dhead { flex: none; min-height: 48px; display: flex; align-items: center; gap: 4px; padding: 0 8px; background: var(--sc); font-size: 12px; line-height: 16px; white-space: nowrap; }
.sm-dhead b { font-weight: 500; }
.sm-dhead .sp { flex: 1; }
.sm-dhead .base { margin-right: 6px; padding: 4px 8px; border-radius: 8px; background: var(--sc-highest); font-size: 11px; line-height: 14px; color: var(--fg-var); }
.sm-dhead .base em { font-style: normal; font-weight: 500; color: var(--primary); }
.sm-dhead .ib { width: 40px; height: 40px; }
.sm-dhead .ib svg { width: 18px; height: 18px; }
.sm-dhead .ib.on { color: var(--primary); }
.sm-dhead .wrap { padding: 0 12px; font-size: 13px; color: var(--fg-var); cursor: pointer; }
.sm-dhead .wrap.on { color: var(--primary); }
.sm-dbody { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; }
.sm-dtree { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 12px 0 14px; font: 400 13.5px/18px var(--code); border-bottom: 1px solid var(--outline-var); }
.sm-dtree .ch { width: 14px; display: grid; place-items: center; color: var(--fg-var); }
.sm-dtree .ch svg { width: 16px; height: 16px; }
.sm-dtree .fo { color: var(--warning); margin: 0 2px; }
.sm-dtree .fo svg { width: 15px; height: 15px; }
.sm-dtree .sp { flex: 1; }
.sm-dtree .st { font: 500 11px/14px var(--sans); color: var(--warning); margin-right: 2px; }
.sm-dtree .pl { font: 400 11px/14px var(--sans); color: var(--success); }
.sm-dtree .mi { font: 400 11px/14px var(--sans); color: var(--error); }
.sm-dtree.file { margin-left: 14px; padding-left: 16px; background: var(--sc); cursor: pointer; }
.sm-dtree.file.shut .ch svg { transform: rotate(-90deg); }
.sm-diff { font: 400 13px/18.85px var(--code); font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; color: #D8DED3; padding: 2px 0 12px; }
.sm-drow { position: relative; display: flex; min-height: 18.85px; }
.sm-drow .dn { flex: none; width: 34px; padding-right: 10px; text-align: right; color: #5E6359; user-select: none; }
.sm-drow .dg { flex: none; position: relative; width: 26px; }
.sm-drow .dg .bar { position: absolute; left: 3px; top: 0; bottom: 0; width: 3px; }
.sm-drow .dg svg { position: absolute; left: 11px; top: 3px; width: 13px; height: 13px; color: var(--fg-var); }
.sm-drow .dc { flex: 1; min-width: 0; padding-right: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sm-changes.nowrap .sm-drow .dc { white-space: pre; overflow: hidden; }
.sm-drow.add .dc, .sm-drow.add .dg .bar + svg { background: transparent; }
.sm-drow.add .dc { background: rgba(63, 185, 80, .18); }
.sm-drow.add .dg .bar { background: #6BBF59; }
.sm-drow.chg .dc { background: rgba(210, 153, 34, .15); }
.sm-drow.chg .dg .bar { background: #61AFEF; }
.sm-drow.del .dc { background: rgba(248, 81, 73, .18); color: #D8DED3; font-family: var(--mono); font-variant-ligatures: normal; font-feature-settings: normal; }
.sm-drow b.mk-del { font-weight: 400; background: rgba(248, 81, 73, .35); }
.sm-drow b.mk-add { font-weight: 400; background: rgba(63, 185, 80, .35); }
.sm-drow.fold .dn { color: #B9BFB3; }
.sm-drow .fold { display: inline-flex; align-items: center; gap: 12px; padding: 0 8px; margin: 2px 0; border-radius: 4px; background: color-mix(in oklab, var(--primary) 16%, transparent); font: 400 12px/17px var(--code); color: #7DA999; }
.sm-drow .fold em { font-style: normal; color: var(--primary); }

/* ── editor view ────────────────────────────────────────────────────── */
.sm-editor { background: #0A0B09; }
.sm-code { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 6px 0; font: 400 13px/18.85px var(--code); font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; color: #D8DED3; }
.sm-crow { display: flex; }
.sm-crow .dn { flex: none; width: 44px; padding-right: 14px; text-align: right; color: #5E6359; }
.sm-crow .dc { flex: 1; min-width: 0; padding-right: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sm-crow.cur { background: #151713; }
.sm-crow.cur .dn { color: #B9BFB3; }
.sm-code { position: relative; }
.sm-crow .fd { flex: none; width: 18px; display: flex; align-items: flex-start; padding-top: 5px; justify-content: center; color: #5E6359; }
.sm-crow .fd svg { width: 9px; height: 9px; }
.sm-crow b.occ { font-weight: 400; background: rgba(152, 195, 121, .16); border-radius: 2px; }
.sm-hover { position: absolute; left: 0; right: 0; margin: 0; padding: 6px 30px 6px 10px; border-radius: 6px; background: #0A0B09; border: 1px solid rgba(94, 99, 89, .35); box-shadow: 0 6px 16px rgba(0, 0, 0, .45); font: 400 12.5px/18px var(--code); color: #D8DED3; white-space: pre-wrap; }
.sm-hover .x { position: absolute; right: 8px; top: 5px; color: var(--fg-var); }

/* ── terminal (terminal-compose) and the phone key bar ──────────────── */
.sm-term { background: #050605; }
.sm-screen { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 6px 0; font: 400 13px/21px var(--code); color: #D8DED3; white-space: pre-wrap; overflow-wrap: anywhere; }
.sm-screen .cur { display: inline-block; width: 8px; height: 17px; vertical-align: -3px; background: #C2E58C; animation: sm-blink 1.06s steps(1) infinite; }
@keyframes sm-blink { 50% { opacity: 0; } }
.sm-screen .a1 { color: #CD0000; } .sm-screen .a2 { color: #00CD00; } .sm-screen .a3 { color: #CDCD00; } .sm-screen .a4 { color: #5C5CFF; }
.sm-screen .a5 { color: #CD00CD; } .sm-screen .a6 { color: #00CDCD; } .sm-screen .a9 { color: #FF0000; } .sm-screen .a10 { color: #00FF00; }
.sm-screen .a11 { color: #FFFF00; } .sm-screen .a14 { color: #00FFFF; } .sm-screen .bo { font-weight: 700; }
.sm-keys { flex: none; display: flex; gap: 4px; padding: 6px 8px; background: var(--sc-high); overflow: hidden; }
.sm-keys span { flex: none; min-width: 44px; height: 40px; padding: 0 12px; border-radius: 8px; display: grid; place-items: center; background: var(--sc-highest); font: 500 15px/1 system-ui, sans-serif; color: var(--fg); }

/* phone views other than chat: a 44dp bar with the kind icon and the title in Geist Mono */
.sm-vhead { flex: none; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 12px; }
.sm-vhead .kind { color: var(--fg-var); }
.sm-vhead .kind svg { width: 16px; height: 16px; }
.sm-vhead .ti { font: 400 14px/20px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-vhead .sp { flex: 1; }
.sm-editor.phone .sm-code { font-size: 13px; }
.sm-editor.phone .sm-crow .dn { width: 34px; padding-right: 10px; }

/* a scene: some panes of the app, framed on their own */
.sm-scene { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.sm-scene.sm-row2 { display: grid; grid-template-columns: 1fr 1fr; }
.sm-scene.sm-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; }

.sm-editor.phone .sm-crow .dn { width: 30px; padding-right: 6px; }
.sm-editor.phone .sm-crow .fd { width: 22px; }
.sm-editor.phone .sm-code { padding-top: 2px; }

/* three phones; the frame is a drawing of a phone, the screen is the app */
.sm-scene.sm-phones { display: flex; gap: 36px; background: transparent; }
.sm-phone { flex: none; width: 410px; height: 884px; padding: 10px; border-radius: 62px; background: #0c0d0c; box-shadow: inset 0 0 0 1.5px #2b2e2a, 0 30px 80px -20px rgba(0,0,0,.8); }
.sm-phone .scr { position: relative; height: 100%; border-radius: 52px; overflow: hidden; background: var(--sc-low); display: flex; flex-direction: column; }
.sm-phone .sb { flex: none; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 6px 30px 0 44px; font: 600 16px/1 -apple-system, "SF Pro Text", system-ui, sans-serif; color: var(--fg); }
.sm-phone .sb .isl { position: absolute; left: 50%; top: 11px; width: 120px; height: 34px; margin-left: -60px; border-radius: 20px; background: #000; }
.sm-phone .sb i { display: flex; align-items: center; gap: 6px; }
.sm-phone .sb svg { height: 12px; width: auto; fill: var(--fg); }
.sm-phone .sb svg.bat { height: 13px; color: var(--fg); }
.sm-phone .app { position: relative; flex: 1; min-height: 0; display: flex; }
.sm-phone .app > .sm-pane { flex: 1; min-width: 0; }
.sm-phone .home { position: absolute; left: 50%; bottom: 8px; width: 134px; height: 5px; margin-left: -67px; border-radius: 3px; background: var(--fg); opacity: .85; }
.sm-phone .sm-term .sm-keys { padding-bottom: 26px; }
.sm-phone .sm-pane.phone .sm-status { margin-bottom: 22px; }

/* memory scene: Claude Code on the left; the memory file on the right, split when Codex starts */
.sm-scene.sm-memscene { display: grid; grid-template-columns: 1fr 1fr; }
.sm-memscene .sm-col { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.sm-memscene .sm-col > .sm-pane { flex: 1 1 0; min-height: 0; }
.sm-memscene .sm-col.split > .sm-editor { flex: 0.9 1 0; border-bottom: 1px solid color-mix(in oklab, var(--fg) 18%, transparent); }
.sm-memscene .sm-col.split > .sm-pane:not(.sm-editor) { flex: 1.1 1 0; animation: sm-in .25s ease-out both; }

/* the panes scroll; like the app's, their scrollbars stay out of sight */
.sm-chat, .sm-dbody, .sm-code, .sm-screen { scrollbar-width: none; }
.sm-chat::-webkit-scrollbar, .sm-dbody::-webkit-scrollbar, .sm-code::-webkit-scrollbar, .sm-screen::-webkit-scrollbar { display: none; }

/* phone-sized page: whole phones in a row you swipe, scaled together like a screenshot (--s) */
.scene.phones { height: auto !important; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 10px; }
.scene.phones::-webkit-scrollbar { display: none; }
.sm-prow { --s: .66; display: flex; gap: 14px; width: max-content; }
.sm-prow::after { content: ""; flex: none; width: 2px; }
.sm-pslot { flex: none; width: calc(410px * var(--s)); height: calc(884px * var(--s)); scroll-snap-align: center; }
.sm-pslot > .sm-phone { transform: scale(var(--s)); transform-origin: 0 0; box-shadow: inset 0 0 0 1.5px #2b2e2a; }

/* the phone app's Changes view: the header row keeps every control and shortens the count */
.sm-changes.phone .sm-dhead { gap: 2px; padding: 0 4px 0 8px; }
.sm-changes.phone .sm-dhead > b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; margin-right: 8px; }
.sm-changes.phone .sm-dhead .base { flex: none; font-size: 13px; padding: 6px 8px; margin-right: 4px; }
.sm-changes.phone .sm-dhead .ib { width: 46px; height: 46px; }
.sm-changes.phone .sm-dhead .ib svg { width: 20px; height: 20px; }
.sm-changes.phone .sm-dhead .wrap { color: var(--primary); padding: 0; }
.sm-changes.phone .sm-dtree { height: 48px; font-size: 14px; }
.sm-changes.phone .sm-dtree .pl, .sm-changes.phone .sm-dtree .mi, .sm-changes.phone .sm-dtree .st { font-size: 12px; }
.sm-changes.phone .sm-dtree.file { margin-left: 16px; }
