/* Nexus shell: the Grok-style frame around the assistant chat
   (nexus-shell.js, nexus-shell-panels.js, nexus-shell-cards.js,
   nexus-shell-market.js).

   Tokens only, from dashboard.css :root, and only tokens the scoped light
   surface (.mojo) redefines too for anything that carries text: --bg-*,
   --text-1..3, --accent, --accent-ink, --accent-soft, --border,
   --border-hover. Under .mojo every rule here follows the light values with
   no rule of its own. The status colours (--status-ok, -warn, -bad) are not
   redefined by .mojo and fail small-text contrast on white, so they only ever
   colour dots, edges and soft fills here; text on a toned chip stays
   --text-1. --accent never colours text either (2.47:1 on white): it is a
   fill under --accent-ink, an edge, or a focus ring.

   Panels reuse the chat workbench's asst-workbench-* rules
   (assistant-workspace.css); this file adds only what the shell introduces.
   Variants are data attributes (data-tone, data-state), never computed class
   names, so tools/check-css-classes.js sees every class the scripts apply. */

/* ── hidden means hidden, whatever display a rule set ─────────────────── */
.shell-rail [hidden],
.shell-sections[hidden],
.shell-connect[hidden],
.shell-card [hidden],
.shell-market [hidden],
.shell-panel-body [hidden] {
  display: none !important;
}

/* ── rail: Needs you, Notifications, the Views group ──────────────────── */
/* One list in the chat's rail. The chat's own "Workspace" links open the same
   views, so the shell hides them (the hidden attribute) once it is in place. */
.shell-rail {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.shell-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shell-daily-links {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.shell-daily-link {
  text-decoration: none;
}

.shell-daily-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.shell-nav > .shell-needs {
  margin-bottom: 4px;
}

.shell-views-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin-top: 6px;
}

.shell-views-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 6px 12px;
  font: 500 11px/1.4 var(--font-body);
  color: var(--text-3);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.shell-views-toggle:hover {
  color: var(--text-1);
  background: var(--bg-2);
}

/* A drawn chevron (no glyph): right when folded, down when open. */
.shell-views-caret {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}

.shell-views-toggle[aria-expanded="true"] .shell-views-caret {
  transform: rotate(45deg) translate(-1px, -1px);
}

.shell-views-label {
  flex: 1 1 auto;
  min-width: 0;
}

.shell-needs {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  font: 500 13px/1.4 var(--font-body);
  color: var(--text-1);
  text-align: left;
  background: var(--bg-0);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.shell-needs:hover,
.shell-needs[aria-expanded="true"] {
  background: var(--bg-2);
}

.shell-needs[data-state="attention"] {
  border-color: var(--status-warn);
}

.shell-needs > .i {
  flex: 0 0 auto;
  color: var(--text-2);
}

.shell-needs-label {
  flex: 1 1 auto;
  min-width: 0;
}

.shell-needs:disabled {
  cursor: default;
  opacity: 0.6;
}

.shell-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 20px;
  height: 18px;
  margin-left: auto;
  padding: 0 6px;
  font: 400 11px/1 var(--font-mono);
  color: var(--text-1);
  background: var(--bg-3);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-full);
}

.shell-needs[data-state="attention"] .shell-count {
  background: var(--status-warn-soft);
  border-color: var(--status-warn);
}

.shell-views {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shell-view-link {
  min-height: 34px;
  font-size: 12px;
}

.shell-view-link > span:first-of-type {
  flex: 1 1 auto;
  min-width: 0;
}

/* ── rail: conversations grouped by workspace ─────────────────────────── */
/* Once the sections load they take the place of the chat's own list. */
.asst-rail.shell-rail-ready .asst-list {
  display: none;
}

.shell-sections {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.shell-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shell-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 6px 12px;
  font: 500 11px/1.4 var(--font-body);
  color: var(--text-3);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.shell-section-head:hover {
  color: var(--text-1);
  background: var(--bg-2);
}

.shell-section-head[aria-expanded="true"] {
  color: var(--text-2);
}

.shell-section-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-section-meta {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-3);
}

.shell-section-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shell-thread {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 8px 12px;
  font: 400 12px/1.4 var(--font-body);
  color: var(--text-2);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.shell-thread:hover,
.shell-thread[aria-current="true"] {
  color: var(--text-1);
  background: var(--bg-2);
}

.shell-thread-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.shell-thread-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-1);
}

.shell-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  font: 400 10px/1 var(--font-mono);
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius-full);
}

.shell-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: var(--status-idle);
  border-radius: var(--radius-full);
}

.shell-dot[data-tone="attention"] {
  background: var(--status-warn);
}

.shell-dot[data-tone="working"] {
  background: var(--accent);
}

.shell-thread-sub {
  overflow: hidden;
  font-size: 11px;
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-thread-sub[data-tone="attention"] {
  color: var(--text-1);
}

.shell-thread-sub[data-tone="failed"],
.shell-thread-sub[data-tone="working"] {
  color: var(--text-2);
}

.shell-thread-sub[data-tone="draft"] {
  font-style: italic;
}

.shell-more {
  align-self: flex-start;
  margin: 2px 12px 0;
  padding: 4px 0;
  font: 400 11px/1.4 var(--font-body);
  color: var(--text-3);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.shell-more:hover {
  color: var(--text-1);
}

.shell-section-empty {
  margin: 0;
  padding: 4px 12px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-3);
}

/* ── rail: Connect apps ────────────────────────────────────────────────── */
.shell-connect {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font: 400 13px/1.4 var(--font-body);
  color: var(--text-1);
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.shell-connect:hover {
  background: var(--bg-3);
}

.shell-connect-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.shell-connect-meta {
  display: inline-flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.shell-connect-count {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}

.shell-marks {
  display: inline-flex;
  align-items: center;
}

.shell-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: -4px;
  font: 600 10px/1 var(--font-body);
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--bg-2);
  border-radius: var(--radius-full);
}

.shell-mark:first-child {
  margin-left: 0;
}

/* ── panels ───────────────────────────────────────────────────────────── */
/* Twelve tabs do not fit a 360 px pane: the row scrolls sideways on its own. */
.shell-panel-tabs {
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.shell-panel-full,
.shell-panel-ask {
  flex: 0 0 auto;
  white-space: nowrap;
}

.shell-panel-ask {
  margin-left: auto;
}

.shell-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.shell-group-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.shell-group-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font: 500 13px/1.4 var(--font-display);
  color: var(--text-1);
  overflow-wrap: anywhere;
}

.shell-row-head {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.shell-row-head > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.shell-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

/* "Open in @handle's browser" and "Use <computer> for <workspace> too" can be
   long; let them wrap instead of overflowing. */
.shell-jump,
.shell-lend {
  max-width: 100%;
  white-space: normal;
  text-align: left;
}

.shell-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 1px 7px;
  font: 400 10px/1.6 var(--font-body);
  color: var(--text-2);
  white-space: nowrap;
  background: var(--bg-2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
}

.shell-chip[data-tone="ok"],
.shell-card-state[data-tone="ok"] {
  color: var(--text-1);
  background: var(--status-ok-soft);
  border-color: var(--status-ok);
}

.shell-chip[data-tone="warn"],
.shell-card-state[data-tone="warn"] {
  color: var(--text-1);
  background: var(--status-warn-soft);
  border-color: var(--status-warn);
}

.shell-chip[data-tone="bad"],
.shell-card-state[data-tone="bad"] {
  color: var(--text-1);
  background: var(--status-bad-soft);
  border-color: var(--status-bad);
}

.shell-chip[data-tone="active"],
.shell-card-state[data-tone="active"] {
  color: var(--text-1);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.shell-notice {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.shell-notice:empty {
  display: none;
}

/* A panel's own status line, between its tabs and its body: what the last
   write did, said once the panel read itself again (the row that said it was
   redrawn). Empty, it takes no room. */
.shell-panel-notice {
  flex: 0 0 auto;
  padding: 12px 22px 0;
}

@media (max-width: 600px) {
  .shell-panel-notice {
    padding-inline: 18px;
  }
}

.shell-quote {
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg-0);
  border-left: 2px solid var(--border-hover);
  border-radius: var(--radius-sm);
}

.shell-filter {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 8px;
  font: inherit;
  font-size: 12px;
  color: var(--text-1);
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.shell-source-error {
  gap: 8px;
}

.shell-source-link {
  align-self: flex-start;
  font-size: 12px;
  color: var(--text-1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.shell-apps-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.shell-apps-count {
  font-size: 12px;
  color: var(--text-2);
}

.shell-apps-browse {
  margin-left: auto;
}

/* ── inline cards ─────────────────────────────────────────────────────── */
.shell-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 720px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
}

.shell-card[data-type="setup"][data-state="open"] {
  border-color: var(--accent);
}

.shell-card[data-type="secret_form"]:is(
    [data-state="phone"],
    [data-state="code"],
    [data-state="password"],
    [data-state="mailbox"]
  ),
.shell-card[data-type="qr_login"][data-state="waiting"],
.shell-card[data-type="review"][data-state="open"] {
  border-color: var(--status-warn);
}

.shell-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-1);
}

.shell-card-head > .i {
  flex: 0 0 auto;
  color: var(--text-2);
}

.shell-card-title {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.shell-card-state {
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
}

.shell-card-note,
.shell-card-receipt {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.shell-card-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
}

.shell-card-display {
  margin: 0;
  font: 400 13px/1.5 var(--font-mono);
  color: var(--text-1);
}

.shell-card-count {
  margin: 0;
  font: 400 12px/1.5 var(--font-mono);
  color: var(--text-2);
}

.shell-card-actions,
.shell-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shell-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shell-step {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.shell-step[aria-current="step"] {
  background: var(--bg-0);
  border-color: var(--border-hover);
}

.shell-step-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.shell-step-title {
  flex: 1 1 auto;
  min-width: 0;
  font: 500 13px/1.4 var(--font-body);
  color: var(--text-1);
  overflow-wrap: anywhere;
}

.shell-step-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.shell-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shell-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.shell-field-label {
  font: 500 12px/1.4 var(--font-body);
  color: var(--text-1);
}

.shell-field-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  font: 400 14px/1.4 var(--font-body);
  color: var(--text-1);
  background: var(--bg-0);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
}

.shell-field-input::placeholder {
  color: var(--text-3);
}

.shell-privacy {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
}

.shell-privacy > .i {
  flex: 0 0 auto;
}

/* ── Telegram QR sign-in (nexus-shell-qr.js) ─────────────────────────── */
/* The code is drawn dark on its own white quiet zone, so it scans the same
   in light and dark themes; this only frames it. */
.shell-qr {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
}

.shell-qr-code {
  flex: 0 0 auto;
}

.shell-qr-image,
.shell-qr-wait {
  display: block;
  box-sizing: border-box;
  width: 200px;
  height: 200px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
}

.shell-qr-image {
  image-rendering: pixelated;
}

.shell-qr-wait {
  display: grid;
  place-items: center;
  padding: 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
  text-align: center;
  background: var(--bg-0);
}

.shell-qr-steps {
  flex: 1 1 180px;
  min-width: 0;
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
}

.shell-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: var(--text-2);
  list-style: none;
}

.shell-progress-step {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.shell-progress-state {
  flex: 0 0 auto;
  color: var(--text-3);
}

/* ── Connect Apps ─────────────────────────────────────────────────────── */
.shell-market-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.shell-market-backdrop::before {
  position: absolute;
  inset: 0;
  content: "";
  background: var(--bg-0);
  opacity: 0.72;
}

.shell-market {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
  width: min(720px, 100%);
  max-height: min(86vh, 900px);
  padding: 20px 22px;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--text-1);
  background: var(--bg-1);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
}

.shell-market-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.shell-market-heading {
  flex: 1 1 auto;
  min-width: 0;
}

.shell-market-title {
  margin: 0;
  font: 500 20px/1.25 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text-1);
}

.shell-market-connected {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-2);
}

.shell-market-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.shell-market-close:hover {
  color: var(--text-1);
  background: var(--bg-2);
  border-color: var(--border);
}

.shell-market-search {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  font: 400 13px/1.4 var(--font-body);
  color: var(--text-1);
  background: var(--bg-0);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
}

.shell-market-search::placeholder {
  color: var(--text-3);
}

.shell-market-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shell-market-chip {
  padding: 5px 10px;
  font: 400 12px/1.4 var(--font-body);
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.shell-market-chip:hover {
  color: var(--text-1);
  background: var(--bg-2);
}

.shell-market-chip[aria-pressed="true"] {
  color: var(--text-1);
  background: var(--bg-3);
  border-color: var(--text-3);
}

.shell-market-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
  min-height: 120px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.shell-market-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shell-market-section-title {
  margin: 0;
  font: 500 12px/1.4 var(--font-body);
  color: var(--text-3);
}

.shell-market-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shell-market-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.shell-market-logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  font: 400 13px/1 var(--font-mono);
  color: var(--text-1);
  background: var(--bg-3);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
}

.shell-market-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.shell-market-name {
  font: 500 14px/1.4 var(--font-body);
  color: var(--text-1);
}

.shell-market-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.shell-market-state {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-3);
}

.shell-market-action {
  white-space: nowrap;
}

.shell-market-empty {
  margin: 0;
  padding: 12px 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-3);
}

.shell-market-error {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-2);
}

.shell-market-error p {
  margin: 0;
}

.shell-market-foot {
  margin: 0;
  padding-top: 12px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-3);
  border-top: 1px solid var(--border);
}

/* ── focus ────────────────────────────────────────────────────────────── */
:is(
  .shell-needs,
  .shell-section-head,
  .shell-thread,
  .shell-more,
  .shell-connect,
  .shell-market-close,
  .shell-market-chip,
  .shell-source-link
):focus-visible,
.shell-field-input:focus-visible,
.shell-market-search:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ── phone width: the market fills the screen, rows stack ─────────────── */
@media (max-width: 600px) {
  .shell-market-backdrop {
    align-items: stretch;
    padding: 0;
  }

  .shell-market {
    width: 100%;
    max-height: none;
    padding: 16px;
    border-radius: 0;
  }

  .shell-market-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .shell-market-logo {
    width: 36px;
    height: 36px;
  }

  .shell-market-action {
    grid-column: 2;
    justify-self: start;
  }

  .shell-card {
    padding: 12px;
  }
}
