@import url('./tokens.css');

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink-primary);
  background-color: var(--bg-canvas);
  background-image: radial-gradient(1100px 480px at 50% -100px, #ffffff 0%, rgba(247, 248, 250, 0) 100%);
  line-height: 1.55;
  position: relative;
}

/* 细腻瑞士棉纸微肌理层（避免塑料白感，零网格线） */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

/* ================= Top Architectural Bar ================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 20px;
  border-bottom: 1px solid var(--border-hairline);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #ffffff;
  overflow: hidden;
  color: #ffffff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-button-primary);
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--ink-primary);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--ink-tertiary);
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Segmented Navigation Switcher */
.segmented-nav {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: var(--bg-well);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-well);
  border: 1px solid rgba(15, 23, 42, 0.04);
  gap: 2px;
}

.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 550;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-spring),
              color var(--duration-fast) ease,
              box-shadow var(--duration-fast) var(--ease-spring);
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--ink-primary);
}

.seg-btn.is-active {
  background: #ffffff;
  color: var(--ink-primary);
  box-shadow: var(--shadow-pill-active);
}

.mode-indicator {
  display: none !important;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  color: var(--ink-secondary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-ok-dot);
}

.mode-indicator.is-sandbox .mode-dot {
  background: var(--status-warn-dot);
}

/* ================= Editorial Page Header ================= */
.page-intro {
  padding: 34px 0 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.page-intro-main {
  max-width: 640px;
}

.page-title {
  margin: 0;
  font-size: clamp(1.625rem, 2.5vw, 2.05rem);
  font-weight: 650;
  letter-spacing: -0.028em;
  line-height: 1.2;
  color: var(--ink-primary);
}

.page-lead {
  margin: 9px 0 0;
  font-size: 0.9375rem;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.inline-code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-well);
  color: var(--ink-primary);
}

/* ================= Two-Column Swiss Workspace ================= */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr);
  gap: 26px;
  align-items: start;
}

/* Primary Unified Sheet (No Over-Nested Cards!) */
.workbench-sheet {
  background: var(--bg-sheet);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sheet);
  overflow: hidden;
}

.sheet-section {
  padding: 26px 28px;
  border-bottom: 1px solid var(--border-hairline);
  transition: background-color var(--duration-normal) ease;
}

.sheet-section:last-child {
  border-bottom: 0;
}

.sheet-section.is-muted {
  opacity: 0.56;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cobalt);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 620;
  letter-spacing: -0.012em;
  color: var(--ink-primary);
}

.section-meta {
  font-size: 0.78rem;
  color: var(--ink-tertiary);
}

/* ================= Form Controls & Inputs ================= */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-label {
  font-size: 0.8125rem;
  font-weight: 560;
  color: var(--ink-secondary);
}

.cdk-input-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-well);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 6px 8px 6px 14px;
  box-shadow: var(--shadow-well);
  transition: background var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
}

.cdk-input-shell:focus-within {
  background: #ffffff;
  border-color: var(--accent-cobalt);
  box-shadow: 0 0 0 3px var(--accent-cobalt-ring);
}

.cdk-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--ink-primary);
  padding: 8px 0;
  letter-spacing: 0.01em;
}

.cdk-input::placeholder {
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.code-textarea,
.text-input {
  width: 100%;
  border: 1px solid var(--border-default);
  background: var(--bg-well);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-primary);
  box-shadow: var(--shadow-well);
  transition: background var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
  resize: vertical;
}

.code-textarea:focus,
.text-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--accent-cobalt);
  box-shadow: 0 0 0 3px var(--accent-cobalt-ring);
}

.code-textarea::placeholder,
.text-input::placeholder {
  color: var(--ink-muted);
}

/* ================= Tactile Buttons ================= */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 560;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 120ms ease,
              background-color var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease,
              opacity var(--duration-fast) ease;
  user-select: none;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: translateY(0.5px) scale(0.992);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--action-primary);
  color: var(--ink-on-dark);
  box-shadow: var(--shadow-button-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--action-primary-hover);
}

.btn-cobalt {
  background: var(--accent-cobalt);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 82, 255, 0.24), 0 4px 12px rgba(0, 82, 255, 0.16);
}

.btn-cobalt:hover:not(:disabled) {
  background: var(--accent-cobalt-hover);
}

.btn-secondary {
  background: #ffffff;
  color: var(--ink-primary);
  border-color: var(--border-default);
  box-shadow: var(--shadow-button-secondary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  padding: 6px 10px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.055);
  color: var(--ink-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-full {
  width: 100%;
  padding: 12px 20px;
  font-size: 0.92rem;
}

/* ================= Channel Recognition & Telemetry Strips ================= */
.recognition-bar {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rec-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cobalt);
  flex-shrink: 0;
}

.status-dot.ok { background: var(--status-ok-dot); }
.status-dot.warn { background: var(--status-warn-dot); }
.status-dot.err { background: var(--status-err-dot); }

.rec-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.rec-sub {
  font-size: 0.78rem;
  color: var(--ink-tertiary);
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 550;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-well);
  color: var(--ink-secondary);
}

.tag-badge.ok {
  background: var(--status-ok-bg);
  color: var(--status-ok-ink);
}

.tag-badge.warn {
  background: var(--status-warn-bg);
  color: var(--status-warn-ink);
}

.tag-badge.err {
  background: var(--status-err-bg);
  color: var(--status-err-ink);
}

.tag-badge.info {
  background: var(--status-info-bg);
  color: var(--status-info-ink);
}

/* Preflight Telemetry Strip */
.preflight-strip {
  margin-top: 12px;
  padding: 10px 13px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.78rem;
  color: var(--ink-secondary);
}

.pf-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pf-item > span:nth-child(2) {
  white-space: nowrap;
  flex-shrink: 0;
}

.pf-mono {
  font-family: var(--font-mono);
  color: var(--ink-primary);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

/* Callout Notices */
.notice-banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  line-height: 1.55;
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
}

.notice-banner.ok {
  background: var(--status-ok-bg);
  color: var(--status-ok-ink);
  border-color: rgba(5, 150, 105, 0.16);
}

.notice-banner.warn {
  background: var(--status-warn-bg);
  color: var(--status-warn-ink);
  border-color: rgba(217, 119, 6, 0.18);
}

.notice-banner.err {
  background: var(--status-err-bg);
  color: var(--status-err-ink);
  border-color: rgba(220, 38, 38, 0.16);
}

/* Helper Collapsible Drawer */
.helper-drawer {
  margin-bottom: 12px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  font-size: 0.8125rem;
  color: var(--ink-secondary);
}

.helper-steps {
  margin: 6px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}

/* Sub-tabs inside Grok / Query */
.mini-tabs {
  display: inline-flex;
  padding: 2px;
  background: var(--bg-well);
  border-radius: var(--radius-sm);
  gap: 2px;
}

.mini-tab {
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 550;
  color: var(--ink-secondary);
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.mini-tab.is-active {
  background: #ffffff;
  color: var(--ink-primary);
  box-shadow: var(--shadow-pill-active);
}

/* Organization Radio List (Claude 9.2) */
.org-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.org-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: #ffffff;
  cursor: pointer;
  transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.org-option:hover {
  background: var(--bg-subtle);
}

.org-option.is-selected {
  border-color: var(--ink-primary);
  background: var(--bg-subtle);
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  font-size: 0.8125rem;
  color: var(--ink-secondary);
  cursor: pointer;
}

.consent-row input[type='checkbox'] {
  margin-top: 3px;
  width: 15px;
  height: 15px;
  accent-color: var(--action-primary);
  flex-shrink: 0;
}

/* ================= Live Order Progress Rail & Fulfillment Stage ================= */
.progress-rail {
  display: grid;
  grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 18px;
}

.rail-step {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rail-bar {
  height: 3px;
  border-radius: 99px;
  background: var(--bg-well);
  overflow: hidden;
  position: relative;
}

.rail-step.is-done .rail-bar {
  background: var(--ink-primary);
}

.rail-step.is-current .rail-bar {
  background: var(--accent-cobalt);
}

.rail-step.is-error .rail-bar {
  background: var(--status-err-dot);
}

.rail-label {
  font-size: 0.74rem;
  font-weight: 550;
  color: var(--ink-tertiary);
}

.rail-step.is-done .rail-label,
.rail-step.is-current .rail-label {
  color: var(--ink-primary);
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
}

.telemetry-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.telemetry-k {
  font-size: 0.72rem;
  color: var(--ink-tertiary);
}

.telemetry-v {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 560;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

/* Verification Action Box */
.verification-stage {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--status-warn-bg);
  border: 1px solid rgba(217, 119, 6, 0.22);
}

.verification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.verification-title {
  font-size: 0.92rem;
  font-weight: 640;
  color: var(--ink-primary);
}

.countdown-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--status-warn-ink);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.claude-embed-mount {
  margin-top: 14px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
}

/* Receipt / Completion Ticket */
.receipt-ticket {
  margin-top: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--bg-subtle);
  overflow: hidden;
}

.receipt-header {
  padding: 14px 18px;
  background: #ffffff;
  border-bottom: 1px dashed var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.receipt-rows {
  padding: 14px 18px;
  display: grid;
  gap: 9px;
  font-size: 0.82rem;
}

.receipt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.receipt-row span:first-child {
  color: var(--ink-tertiary);
}

.receipt-row span:last-child {
  font-family: var(--font-mono);
  color: var(--ink-primary);
  text-align: right;
}

/* ================= Right Context Rail ================= */
.side-rail {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rail-panel {
  background: var(--bg-sheet);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sheet);
  padding: 18px 20px;
}

.rail-panel-title {
  margin: 0 0 12px;
  font-size: 0.84rem;
  font-weight: 620;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-mini-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-mini-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.order-mini-item:hover {
  background: #ffffff;
  border-color: var(--border-strong);
}

.order-mini-item.is-active {
  background: #ffffff;
  border-color: var(--ink-primary);
}

.preset-list {
  display: grid;
  gap: 7px;
}

.preset-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.preset-btn:hover {
  background: #ffffff;
  border-color: var(--border-strong);
}

.preset-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-cobalt);
}

.preset-title {
  font-size: 0.8rem;
  font-weight: 560;
  color: var(--ink-primary);
}

.catalog-group {
  padding: 10px 0;
  border-top: 1px solid var(--border-hairline);
}

.catalog-group:first-of-type {
  border-top: 0;
  padding-top: 2px;
}

.catalog-group-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.catalog-group-note {
  font-size: 0.72rem;
  color: var(--ink-tertiary);
  margin: 2px 0 6px;
}

.catalog-kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.74rem;
  padding: 2.5px 0;
}

.catalog-kv span {
  white-space: nowrap;
  flex-shrink: 0;
}

.catalog-kv code {
  font-family: var(--font-mono);
  color: var(--ink-secondary);
  font-size: 0.7rem;
  text-align: right;
}

/* Batch Query Table */
.batch-table-wrap {
  margin-top: 16px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.batch-table th,
.batch-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-hairline);
}

.batch-table th {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-tertiary);
  background: var(--bg-subtle);
}

.batch-table tr:last-child td {
  border-bottom: 0;
}

/* ================= Modal Overlay (Sandbox 3DS / Receipt Viewer) ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-sheet {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-floating);
  padding: 24px 26px;
  animation: modalEnter 200ms var(--ease-out-expo);
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.site-footer {
  margin-top: 52px;
  padding-top: 20px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--ink-tertiary);
}

[hidden] {
  display: none !important;
}

/* ================= Fluid Responsive Adaptation ================= */
@media (max-width: 920px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 580px) {
  .app-shell {
    padding: 0 14px 56px;
  }

  .sheet-section {
    padding: 20px 18px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .segmented-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .seg-btn {
    text-align: center;
    padding: 7px 8px;
  }

  .cdk-input-shell {
    flex-wrap: wrap;
    padding: 8px 10px;
  }

  .input-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--border-hairline);
  }
}
