/*
  Stratum Mind phone app. Always the design system's dark theme, the same as the Mac app.
  Every colour below is copied from ~/stratum/stratum-design-system/tokens/tokens.css
  (the data-theme="dark" block and the primitives it reads). Do not add a colour here
  that is not in that file.
*/

@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 400; font-display: swap; src: url('/fonts/BarlowSemiCondensed-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 500; font-display: swap; src: url('/fonts/BarlowSemiCondensed-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 600; font-display: swap; src: url('/fonts/BarlowSemiCondensed-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 700; font-display: swap; src: url('/fonts/BarlowSemiCondensed-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Anton'; font-weight: 400; font-display: swap; src: url('/fonts/Anton-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Spline Sans Mono'; font-weight: 400; font-display: swap; src: url('/fonts/SplineSansMono-Regular.ttf') format('truetype'); }
/* Spline Sans Mono has no box-drawing glyphs, which Claude Code draws its boxes with. They
   fall back to Menlo, shrunk to Spline's exact column width so the boxes line up. */
@font-face { font-family: 'Mind Box'; src: local('Menlo-Regular'), local('Menlo'); size-adjust: 99.65%; }
@font-face { font-family: 'Spline Sans Mono'; font-weight: 500; font-display: swap; src: url('/fonts/SplineSansMono-Medium.ttf') format('truetype'); }

:root {
  color-scheme: dark;

  /* Dark theme values from the design system. */
  --bg: #15181D;            /* iron-2 */
  --surface: #1A1D23;       /* iron */
  --sunken: #15181D;        /* iron-2 */
  --rule: #2D3240;          /* steel */
  --rule-strong: #3D4456;   /* slate */
  --control-bg: #23272F;    /* graphite */
  --control-border: #6A7286;
  --control-disabled: #2D3240;
  --text: #E8EBF2;
  --text-muted: #A7AEBD;
  --text-subtle: #8B93A1;
  --text-display: #FFFFFF;
  --brand: #335C83;         /* Blue 600, primary action on dark */
  --brand-hover: #264562;   /* Blue 700 */
  --interactive: #8DABC9;   /* Blue 300 */
  --interactive-tint: #1A2E42;
  --focus: #678FB7;         /* Blue 400 */
  --signal: #678FB7;        /* Working, the same blue as the Mac's working mark */
  --pass: #5FBF95;
  --pass-bg: #173A2B;
  --fail: #FF7A63;
  --fail-bg: #4A1D17;
  --caution: #E8B013;
  --caution-bg: #3D3109;
  --on-status: #15181D;
  --scrim: rgba(8, 10, 14, 0.6);
  --shadow-float: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.45);

  --font-display: 'Anton', 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
  --font-ui: 'Barlow Semi Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font-data: 'Spline Sans Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-screen: 'Spline Sans Mono', 'Mind Box', Menlo, ui-monospace, monospace;

  --radius-press: 5px;
  --radius-chip: 3px;
  --hit: 44px;
  --main-h: 48px;
  --gutter: 16px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --vvh: 100vh;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.4;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.mono { font-family: var(--font-data); }
[hidden] { display: none !important; }

/* The whole app is one column the height of the visible screen, so the text box and keys
   sit right above the keyboard without position: fixed. */
#app {
  display: flex;
  flex-direction: column;
  height: var(--vvh);
  width: 100%;
  overflow: hidden;
  will-change: transform;
}

/* Header */
#bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  /* 12px more than the safe area: iOS blurs the strip just under the status bar. */
  min-height: calc(68px + var(--safe-top));
  padding: calc(var(--safe-top) + 12px) calc(var(--gutter) + var(--safe-right)) 0 calc(var(--gutter) + var(--safe-left));
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
#bar:empty { display: none; }
.screen-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: var(--text-display);
  text-transform: uppercase;
  flex: 1;
}
.bar-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.bar-title h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-title .status { font-size: 12px; }
.bar-side { flex: none; display: flex; align-items: center; gap: 8px; }

/* Banner when the Mac does not answer */
#banner {
  flex: none;
  padding: 10px calc(var(--gutter) + var(--safe-right)) 10px calc(var(--gutter) + var(--safe-left));
  background: var(--caution-bg);
  border-bottom: 1px solid var(--caution);
  color: var(--text);
  font-size: 15px;
}
#banner-age { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Bar when the Mac has a new version of the phone app */
#update {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px calc(var(--gutter) + var(--safe-right)) 8px calc(var(--gutter) + var(--safe-left));
  background: var(--interactive-tint);
  border-bottom: 1px solid var(--brand);
  color: var(--text);
  font-size: 15px;
}
#update p { flex: 1; min-width: 0; }
#update .btn { flex: none; }

/* Content */
#view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px calc(var(--gutter) + var(--safe-right)) 24px calc(var(--gutter) + var(--safe-left));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#view.flush { padding: 0; gap: 0; overflow: hidden; }
#view.gate { padding-top: calc(24px + var(--safe-top)); padding-bottom: calc(24px + var(--safe-bottom)); }
.loading { color: var(--text-muted); }
#wait { flex: none; padding: 16px calc(var(--gutter) + var(--safe-right)) 0 calc(var(--gutter) + var(--safe-left)); }

/* Tabs: flat and square, the same colour as the page so the status bar tint does not jump. */
#tabs {
  flex: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--bg);
  border-top: 1px solid var(--rule);
  padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
}
body.keyboard #tabs { display: none; }
.tab {
  appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-subtle);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  border-top: 2px solid transparent;
  margin-top: -1px;
  cursor: pointer;
}
.tab svg { width: 22px; height: 22px; }
.tab .tab-icon { display: flex; align-items: center; gap: 4px; height: 22px; }
.tab .tab-count { font-family: var(--font-data); font-size: 14px; font-weight: 500; color: var(--caution); }
.tab[aria-current="page"] { color: var(--text-display); border-top-color: var(--focus); }
.tab[aria-current="page"] svg { color: var(--focus); }

/* Buttons. Things you press have a 5px corner. */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--hit);
  padding: 0 16px;
  border-radius: var(--radius-press);
  border: 1px solid var(--control-border);
  background: var(--control-bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--text-display); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--interactive); }
.btn.danger { background: var(--fail-bg); border-color: var(--fail); color: var(--fail); }
.btn.wide { width: 100%; min-height: var(--main-h); }
.btn.small { min-height: var(--hit); padding: 0 12px; font-size: 15px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: default; }
/* A Send button reads Sending until the Mac answers. */
.btn.says-sending.sending { position: relative; color: transparent; opacity: 0.7; }
.btn.says-sending.sending > * { visibility: hidden; }
.btn.says-sending.sending::after {
  content: 'Sending';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-display);
}
.btn:focus-visible, .tab:focus-visible, .choice:focus-visible, .row:focus-visible, .key:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.btn .send-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: var(--hit); padding: 0; }
.icon-btn svg { width: 22px; height: 22px; }
.back { padding: 0 10px 0 4px; gap: 2px; margin-left: -6px; }
.back svg { width: 22px; height: 22px; }

/* Everything that needs the Mac is off while the Mac does not answer. */
body.offline .needs-mac { opacity: 0.45; pointer-events: none; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions .spacer { flex: 1; }

/* Panels are square. */
.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel.blocking { border-color: rgba(232, 176, 19, 0.6); }
.panel.target { border-color: var(--focus); }

.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.small-text { font-size: 14px; }
.problem { color: var(--fail); font-weight: 500; font-size: 15px; }
.note { color: var(--text-muted); font-size: 15px; }

.notice {
  border: 1px solid var(--rule-strong);
  background: var(--interactive-tint);
  padding: 10px 12px;
  font-size: 15px;
}

/* Status: always a shape and a word. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.shape { flex: none; display: inline-block; width: 9px; height: 9px; }
.shape.circle { border-radius: 50%; background: currentColor; }
.shape.ring { border-radius: 50%; border: 1.5px solid currentColor; }
.shape.square { background: currentColor; }
.shape.box { border: 1.5px solid currentColor; }
.shape.diamond { background: currentColor; transform: rotate(45deg) scale(0.8); }
.shape.diamond-o { border: 1.5px solid currentColor; transform: rotate(45deg) scale(0.8); }
.shape.line { height: 1.5px; background: currentColor; }
.shape.bars { width: 8px; background: linear-gradient(90deg, currentColor 0 2.5px, transparent 2.5px 5.5px, currentColor 5.5px 8px); }
.tone-interactive { color: var(--interactive); }
.shape.triangle { width: 10px; height: 9px; background: currentColor; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.tone-caution { color: var(--caution); }
.tone-pass { color: var(--pass); }
.tone-fail { color: var(--fail); }
.tone-signal { color: var(--signal); }
.tone-text { color: var(--text); }
.tone-subtle { color: var(--text-subtle); }

.counts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; color: var(--text-muted); }
.count { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.count .n { font-family: var(--font-data); font-weight: 500; color: var(--text); }

/* Needs you cards */
.card-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card-head .status { flex: none; }
.card-head .age { margin-left: auto; font-family: var(--font-data); font-size: 12px; color: var(--text-subtle); flex: none; }
.card-where { font-size: 15px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-where b { font-weight: 600; color: var(--text-muted); }
.card-title { font-size: 19px; font-weight: 500; line-height: 1.3; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.card-context { font-size: 16px; color: var(--text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.card-context.clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { align-self: flex-start; padding: 0; }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: var(--main-h);
  padding: 11px 12px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--control-bg);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-press);
  cursor: pointer;
}
.choice.static { cursor: default; background: transparent; border-color: var(--rule); }
/* A card Mind is rechecking: greyed out, with a small loader. */
.panel.rechecking .card-title, .panel.rechecking .card-context, .panel.rechecking .choices { opacity: 0.5; }
.spinner {
  display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid var(--rule-strong); border-top-color: var(--text-muted); border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.naming { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--text-subtle); white-space: nowrap; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
/* While a tap is on its way to the Mac: the tapped choice says Sending, the others wait. */
.choice:disabled { opacity: 0.45; cursor: default; }
.choice.sending { opacity: 1; border-color: var(--focus); }
.choice.sending::after {
  content: 'Sending';
  flex: none;
  margin-left: auto;
  align-self: center;
  font-size: 14px;
  color: var(--text-muted);
}
.choice[aria-pressed="true"] { border-color: var(--focus); background: var(--interactive-tint); }
.choice .ring {
  flex: none;
  width: 18px; height: 18px; margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid var(--control-border);
  display: flex; align-items: center; justify-content: center;
}
.choice[aria-pressed="true"] .ring { border-color: var(--focus); }
.choice[aria-pressed="true"] .ring::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--focus); }
/* A tick box, for a question that takes several choices. */
.ring.box, .choice[aria-pressed="true"] .ring.box::after { border-radius: 0; }
.choice .num { flex: none; font-family: var(--font-data); font-size: 14px; color: var(--text-subtle); margin-top: 2px; min-width: 18px; }
.choice-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-label { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.choice-meaning { font-size: 15px; color: var(--text-muted); overflow-wrap: anywhere; }
.chip {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: var(--radius-chip);
  vertical-align: 2px;
  margin-left: 6px;
}
.chip.rec { color: var(--pass); border: 1px solid var(--pass); }
.chip.sugg { color: var(--text-subtle); border: 1px solid var(--rule-strong); }

.reply-wrap { display: flex; flex-direction: column; gap: 6px; }
.reply-label { display: flex; align-items: center; gap: 4px; }
.reply-label .spacer { flex: 1; }
/* Images added to a message, before it is sent. */
.image-tray { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 56px; height: 56px; border: 1px solid var(--rule-strong); background: var(--sunken); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb-x {
  position: absolute; top: -10px; right: -10px;
  width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--rule-strong); border-radius: var(--radius-press);
  background: var(--bg); color: var(--text); font-size: 16px; line-height: 1;
}
textarea, input[type="text"], input[type="search"] {
  font-family: var(--font-ui);
  font-size: 17px;
  color: var(--text);
  background: var(--control-bg);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-press);
  padding: 10px 12px;
  width: 100%;
  min-height: var(--main-h);
  line-height: 1.35;
  resize: none;
  -webkit-appearance: none;
}
textarea:focus, input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
textarea::placeholder, input::placeholder { color: var(--text-subtle); }

.empty { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.empty-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 500; }

/* Lists of rows (workspaces, tiles, AWS) */
.list { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.list:first-child { border-top: 0; }
.row {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row-name { font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-line { font-size: 15px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row-top .status { flex: none; }
.row-top .age { margin-left: auto; font-family: var(--font-data); font-size: 12px; color: var(--text-subtle); flex: none; }
.row-top .mem { margin-left: auto; font-family: var(--font-data); font-size: 12px; color: var(--text-subtle); flex: none; }
.row-top .mem + .age { margin-left: 0; }
.chev { flex: none; width: 18px; height: 18px; color: var(--text-subtle); }
.section-gap { height: 4px; }
.bottom-action { margin-top: auto; padding-top: 12px; }

/* Tile screen */
.tile-view { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.card-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--hit);
  padding: 6px calc(var(--gutter) + var(--safe-right)) 6px calc(var(--gutter) + var(--safe-left));
  background: var(--caution-bg);
  border: 0;
  border-bottom: 1px solid var(--rule);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-align: left;
  width: 100%;
  cursor: pointer;
}
.card-bar .grow { flex: 1; min-width: 0; }
.card-bar .go { color: var(--interactive); font-weight: 600; flex: none; }
.screen-tools {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px calc(var(--gutter) + var(--safe-right)) 4px calc(var(--gutter) + var(--safe-left));
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  color: var(--text-subtle);
}
.screen-tools .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.keyboard .screen-tools { display: none; }
.toggle[aria-pressed="true"] { border-color: var(--focus); color: var(--text-display); background: var(--interactive-tint); }
.screen {
  flex: 1;
  min-height: 0;
  margin: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--sunken);
  color: var(--text);
  font-family: var(--font-screen);
  font-size: 13px;
  line-height: 1.3;
  white-space: pre;
  padding: 10px 12px;
  tab-size: 8;
}
.screen.fit { overflow-x: hidden; }
.screen.wrap { overflow-x: hidden; white-space: normal; }
.screen.wrap .line {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding-left: var(--hang, 0);
  text-indent: calc(-1 * var(--hang, 0));
}
.screen.wrap .line-rule { display: block; white-space: pre; overflow: hidden; }
.screen.wrap .line-table { display: block; white-space: pre; overflow-x: auto; }
.screen.wrap .line-row { display: block; }
.keys {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px calc(var(--gutter) + var(--safe-right)) 0 calc(var(--gutter) + var(--safe-left));
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.key-row { display: grid; gap: 6px; }
.key-row.r1 { grid-template-columns: repeat(7, 1fr); }
.key-row.r2 { grid-template-columns: 1fr 1fr 1fr 1.6fr; }
.key {
  appearance: none;
  min-height: var(--hit);
  min-width: 0;
  padding: 0 4px;
  border-radius: var(--radius-press);
  border: 1px solid var(--rule-strong);
  background: var(--control-bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.key.stop { grid-column: 4; border-color: var(--fail); color: var(--fail); background: var(--fail-bg); }
.dock { flex: none; background: var(--bg); padding-bottom: var(--safe-bottom); }
body.keyboard .dock { padding-bottom: 0; }
.type-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 8px calc(var(--gutter) + var(--safe-right)) 8px calc(var(--gutter) + var(--safe-left));
}
.type-row textarea { flex: 1; min-height: var(--hit); max-height: 120px; padding: 10px 12px; }
.type-row .btn { flex: none; min-height: var(--hit); }
.type-row .btn.small { padding: 0 10px; }
.dock .image-tray { padding: 8px calc(var(--gutter) + var(--safe-right)) 0 calc(var(--gutter) + var(--safe-left)); }
.type-msg {
  flex: none;
  padding: 0 calc(var(--gutter) + var(--safe-right)) 4px calc(var(--gutter) + var(--safe-left));
  background: var(--bg);
}
.type-msg:empty { display: none; }

/* AWS */
.aws-row { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.aws-top { display: flex; align-items: flex-start; gap: 12px; }
.aws-top .row-main { gap: 4px; }
.aws-top .btn { flex: none; }
.profiles { font-family: var(--font-data); font-size: 13px; color: var(--text-subtle); overflow-wrap: anywhere; }
.aws-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.aws-meta .mono { font-size: 12.5px; color: var(--text-subtle); }
.code-panel { background: var(--surface); border: 1px solid var(--caution); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.code-big {
  font-family: var(--font-data);
  font-weight: 500;
  font-size: 36px;
  letter-spacing: 0.08em;
  color: var(--text-display);
  text-align: center;
  user-select: all;
  -webkit-user-select: all;
}

/* Settings */
.facts { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.facts:first-child { border-top: 0; }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.fact .value { font-size: 17px; overflow-wrap: anywhere; }
.fact .value.mono { font-size: 14px; }

/* Install and Pair */
.intro { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.intro h1 { font-size: 28px; font-weight: 600; line-height: 1.15; color: var(--text-display); }
.intro .lead { font-size: 17px; color: var(--text-muted); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.steps li { counter-increment: step; display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 17px; }
.steps li::before { content: counter(step); font-family: var(--font-data); font-weight: 500; color: var(--interactive); min-width: 16px; }
.code-input {
  font-family: var(--font-data) !important;
  font-size: 28px !important;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-align: center;
  min-height: 64px !important;
  padding-left: 0.35em !important;
}

/* Dialogs and menus float, so they are the only things with a shadow. */
#layer:empty { display: none; }
.scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px calc(16px + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(16px + var(--safe-left));
  z-index: 40;
}
.scrim.clear { background: transparent; align-items: flex-start; justify-content: flex-end; padding-top: calc(52px + var(--safe-top)); }
.dialog {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  box-shadow: var(--shadow-float);
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dialog h2 { font-size: 20px; font-weight: 600; color: var(--text-display); overflow-wrap: anywhere; }
.dialog p { font-size: 16px; color: var(--text-muted); overflow-wrap: anywhere; }
.dialog .buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.menu {
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  padding: 4px;
}
.menu .btn { justify-content: flex-start; border: 0; background: transparent; }
.menu .btn.danger-text { color: var(--fail); }

/* The Pause all line, under the header on every tab while a pause runs. */
#strip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--hit);
  padding: 6px calc(var(--gutter) + var(--safe-right)) 6px calc(var(--gutter) + var(--safe-left));
  background: var(--interactive-tint);
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  border-radius: 0;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
#strip .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#strip .go { flex: none; color: var(--interactive); }
#strip:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Find an agent: pinned to the top of the Workspaces tab while the list scrolls. */
.search-pin {
  position: sticky;
  top: -16px;
  margin-top: -16px;
  padding: 16px 0 8px;
  background: var(--bg);
  z-index: 2;
}
.search-row { display: flex; gap: 8px; align-items: center; }
.search-row input { flex: 1; min-width: 0; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.section-head {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 14px 0 6px;
  overflow-wrap: anywhere;
}
.results, .all-work { display: flex; flex-direction: column; }
.ws-group { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule-strong); }
.ws-group .ws-row { border-bottom: 1px solid var(--rule); }
.ws-agents .row { padding-left: 14px; border-left: 2px solid var(--rule); }
.ws-agents .row:last-child { border-bottom: 0; }
.row-where { font-size: 14px; color: var(--text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-line.goal { color: var(--text); }
.row-line.wrap { white-space: normal; overflow-wrap: anywhere; }
.row-name.small { font-size: 16px; }
.closed-row, .update-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.closed-row .btn { flex: none; }
.update-panel { gap: 8px; }
.memory-panel { gap: 8px; }
.memory-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.memory-line { font-family: var(--font-data); font-size: 13px; color: var(--text-muted); }
.memory-auto { display: flex; align-items: center; gap: 10px; }
.memory-auto .grow { flex: 1; min-width: 0; }
.memory-panel .memory-most { align-self: flex-start; }
.update-list { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.update-row .status { flex: none; }
.reopen-line {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  padding: 6px 6px 6px 12px;
  font-size: 15px;
}
.reopen-line .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bottom-action { display: flex; flex-direction: column; gap: 8px; }
.bottom-action.sticky { position: sticky; bottom: -24px; margin-bottom: -24px; padding: 12px 0 24px; background: var(--bg); }
.chev-inline { width: 16px; height: 16px; }
.lead { font-size: 17px; color: var(--text-muted); }
.name-list { margin: 0; padding: 0 0 4px; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 16px; }
.name-list b { font-weight: 600; }
.pause-body { display: flex; flex-direction: column; gap: 12px; }
.danger-zone { margin-top: 28px; display: flex; flex-direction: column; gap: 8px; }
.fact .actions { margin-top: 6px; }
.fact > .btn { margin-top: 6px; }
.fact input { margin-top: 4px; }
.fact .choices { margin-top: 6px; }

/* The folder browser's path: one line, scrolling sideways, never wrapping. */
.crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 4px;
  scrollbar-width: none;
}
.crumbs::-webkit-scrollbar { display: none; }
.crumb {
  flex: none;
  appearance: none;
  min-height: var(--hit);
  padding: 0 6px;
  border: 0;
  border-radius: var(--radius-press);
  background: transparent;
  color: var(--interactive);
  font: inherit;
  font-family: var(--font-data);
  font-size: 14px;
  cursor: pointer;
}
span.crumb { display: inline-flex; align-items: center; color: var(--text); cursor: default; }
.crumbs .sep { flex: none; color: var(--text-subtle); font-family: var(--font-data); }
.browse, .name-step { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.folder-list { flex: 1; }

/* A card's whole message. */
.msg-body { display: flex; flex-direction: column; gap: 10px; font-size: 17px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.msg-body p { white-space: pre-wrap; }
.msg-body h3 { font-size: 18px; color: var(--text-display); }
.msg-body ul, .msg-body ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.msg-body code { font-family: var(--font-data); font-size: 14.5px; background: var(--control-bg); padding: 0 3px; }
.msg-body pre.code {
  margin: 0;
  font-family: var(--font-data);
  font-size: 14px;
  line-height: 1.4;
  white-space: pre;
  overflow-x: auto;
  background: var(--sunken);
  border: 1px solid var(--rule);
  padding: 10px 12px;
}
.msg-answer { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--rule-strong); }

/* A Show me page, in its locked frame. */
.opts-view { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.opts-holder { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--text-display); }
.opts-wait { flex: 1; background: var(--bg); padding: 16px calc(var(--gutter) + var(--safe-right)) 16px calc(var(--gutter) + var(--safe-left)); }
.opts-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: var(--text-display); }
.opts-dock { flex: none; padding: 8px calc(var(--gutter) + var(--safe-right)) calc(8px + var(--safe-bottom)) calc(var(--gutter) + var(--safe-left)); border-top: 1px solid var(--rule); background: var(--bg); }

@media (prefers-reduced-motion: no-preference) {
  /* Nothing moves for attention. No animations are defined on purpose. */
}

/* Inbox: three piles, rows that open in place, and a bar of actions in thumb reach. */
.inbox { display: flex; flex-direction: column; gap: 12px; }
.seg { display: flex; border: 1px solid var(--rule-strong); }
.seg-btn {
  appearance: none; flex: 1; min-height: var(--hit); border: 0; border-right: 1px solid var(--rule-strong);
  background: transparent; color: var(--text-muted); font: inherit; font-size: 15px; display: flex;
  align-items: center; justify-content: center; gap: 4px; cursor: pointer;
}
.seg-btn:last-child { border-right: 0; }
.seg-btn[aria-selected="true"] { background: var(--interactive-tint); color: var(--text-display); font-weight: 600; }
.seg-n { font-size: 12px; color: var(--text-subtle); }
.mail-list { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.mail-row {
  appearance: none; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--rule);
  color: var(--text); font: inherit; padding: 10px 0; display: flex; flex-direction: column; gap: 2px; cursor: pointer;
}
.mail-row.open { border-bottom: 0; }
.open-wrap { background: var(--surface); border-left: 3px solid var(--focus); padding: 0 12px 12px 10px; border-bottom: 1px solid var(--rule); }
.mail-top { display: flex; justify-content: space-between; align-items: center; }
.when { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; }
.age { font-size: 12px; color: var(--text-subtle); }
.mail-who { font-size: 17px; font-weight: 600; color: var(--text-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-ask { font-size: 16px; color: var(--text); overflow-wrap: anywhere; }
.mail-row:not(.open) .mail-ask { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row.open .mail-ask { font-size: 18px; font-weight: 500; color: var(--text-display); }
.mail-meta { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-top: 2px; }
.mail-meta .chip { color: var(--interactive); background: var(--interactive-tint); text-transform: none; letter-spacing: 0; margin-left: 0; font-size: 12.5px; }
.mail-open { display: flex; flex-direction: column; gap: 8px; }
.mail-addr { font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.mail-subject { font-size: 14px; color: var(--text-subtle); overflow-wrap: anywhere; }
.mail-text { font-size: 15px; color: var(--text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.files { font-size: 12px; overflow-wrap: anywhere; }
.ws-pick {
  appearance: none; width: 100%; min-height: var(--hit); display: flex; justify-content: space-between; align-items: center;
  padding: 0 12px; background: var(--control-bg); border: 1px solid var(--control-border); border-radius: var(--radius-press);
  color: var(--text); font: inherit; font-size: 16px; cursor: pointer;
}
.words {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--control-border); border-radius: var(--radius-press);
  font: inherit; font-size: 16px; padding: 8px 10px; resize: vertical;
}
.small-link { color: var(--interactive); font-size: 14px; align-self: flex-start; }
.move-row { display: flex; gap: 8px; flex-wrap: wrap; }
.section-toggle { align-self: flex-start; }
.inbox-msg { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inbox-bar {
  position: sticky; bottom: -24px; margin: 0 calc(-1 * var(--gutter)) -24px; padding: 10px var(--gutter) 12px;
  background: var(--bg); border-top: 1px solid var(--rule); display: flex; gap: 8px; z-index: 5;
}
.inbox-bar[hidden] { display: none; }
.inbox-bar .btn { flex: 1; min-height: var(--main-h); }
.inbox-bar .btn.start { flex: 2; }
.sheet { max-height: 75vh; overflow-y: auto; gap: 8px; }
.sheet .label { margin-top: 4px; }
.sheet-row { justify-content: flex-start; }
.sheet-row[aria-pressed="true"] { border-color: var(--focus); background: var(--interactive-tint); }
.tab .inbox-count { color: var(--interactive); }
.allow-row { display: flex; gap: 8px; }
.allow-row .btn { flex: 1; min-height: var(--main-h); }

/* Parked work: the next step is the biggest text, the cue to get going again. */
.parked-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 0 14px 12px;
  border-bottom: 1px solid var(--rule);
  border-left: 2px solid var(--interactive);
}
.parked-row.due { border-left-color: var(--caution); }
.parked-title { min-width: 0; font-size: 15px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parked-back { margin-left: auto; font-family: var(--font-data); font-size: 12px; color: var(--text-subtle); flex: none; }
.parked-back + .age { margin-left: 0; }
.parked-next { font-size: 19px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; line-height: 1.3; }
.parked-summary { font-size: 15.5px; color: var(--text-muted); overflow-wrap: anywhere; line-height: 1.4; }
.parked-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.parked-freed { margin-left: auto; font-family: var(--font-data); font-size: 12px; color: var(--text-subtle); }

/* Mockups: tabs and the chosen option's words above the page, Pick below it. */
.mock-head { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 8px calc(var(--gutter) + var(--safe-right)) 8px calc(var(--gutter) + var(--safe-left)); border-bottom: 1px solid var(--rule); background: var(--bg); }
.mock-head .seg-btn { font-size: 17px; font-weight: 600; }
.mock-rec { color: var(--pass); font-weight: 600; }
.mock-caption .choice-meaning { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mock-question { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-pages { font: inherit; min-height: var(--hit); background: var(--bg); color: var(--text); border: 1px solid var(--rule-strong); }
.opts-dock { display: flex; flex-direction: column; gap: 8px; }
.view-mockups { margin-top: 4px; gap: 8px; }
.view-mockups svg { width: 20px; height: 20px; flex: none; }
