/* ================================================================
components.css  —  RepoPatch Studio
Load order: base.css -> components.css -> panels.css
Responsive strategy:
  > 900px  : full three-column desktop layout (unchanged)
  ≤ 900px  : tablet — rails stack, workflow bar 4 cols
  ≤ 600px  : phone  — single column, workflow bar 2 cols
================================================================ */

@import url('https://api.fontshare.com/v2/css?f[]=satoshi@300,400,500,700&display=swap');

/* ================================================================
   STAGE WORKFLOW BAR
================================================================ */

.workflow-bar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.stage-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
  text-align: left;
  transition:
    background var(--t),
    border-color var(--t),
    color var(--t),
    opacity var(--t);
}

.stage-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stage-button.stage-done {
  border-color: var(--success);
  color: var(--success);
}
.stage-button.stage-done .stage-state {
  color: var(--success);
  opacity: 0.8;
}

.stage-button.stage-error {
  border-color: var(--danger);
  color: var(--danger);
}
.stage-button.stage-error .stage-state {
  color: var(--danger);
  opacity: 0.8;
}

.tab-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.stage-button.stage-available {
  border-color: var(--accent);
}
.stage-button.stage-available:not(.stage-current):not(:disabled):hover {
  background: var(--surface-2);
  border-color: var(--accent-hover);
}

.stage-button.stage-current {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.stage-button.stage-current .stage-state {
  color: var(--on-accent);
  opacity: 0.7;
}

.stage-name {
  font-weight: 600;
  font-size: 13px;
}
.stage-state {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ================================================================
   GHOST BUTTON
================================================================ */

.ghost-button {
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: color var(--t), background var(--t);
}
.ghost-button:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* ================================================================
   LISTS / STATE CARDS
================================================================ */

.state-list,
.accordion-list,
.simple-list {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.state-item,
.detail-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: border-color var(--t);
}
.state-item:last-child,
.detail-card:last-child {
  margin-bottom: 0;
}
.state-item:hover {
  border-color: var(--accent);
}

.item-path {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
  word-break: break-all;
}
.item-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.detail-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.detail-card p {
  font-size: 12px;
  line-height: 1.5;
}

/* ================================================================
   EMPTY / PLACEHOLDER STATE
================================================================ */

.placeholder-block {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  gap: 8px;
}
.placeholder-block h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.placeholder-block p {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.7;
  max-width: 36ch;
}

/* ================================================================
   TABS (center workspace)
================================================================ */

.tab-bar {
  display: flex;
  gap: 2px;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  /* tablet/phone: horizontal scroll so all tabs stay accessible */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-button {
  background: none;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color var(--t), border-color var(--t), background var(--t);
  white-space: nowrap;
  flex-shrink: 0;
}
.tab-button:hover {
  color: var(--text);
  background: var(--surface-2);
}
.tab-button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}
.tab-pane {
  display: none;
}
.tab-pane--active {
  display: block;
}

/* ================================================================
   SUB-TABS
================================================================ */

.stage-subtabs {
  display: flex;
  gap: 2px;
  padding: 6px 12px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.stage-subtabs::-webkit-scrollbar { display: none; }

.subtab-button {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  transition: color var(--t), background var(--t), border-color var(--t);
  white-space: nowrap;
  flex-shrink: 0;
}
.subtab-button:hover {
  color: var(--text);
  background: var(--bg-deep);
}
.subtab-button--active {
  color: var(--accent);
  background: var(--bg);
  border-color: var(--border);
  position: relative;
}
.subtab-button--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--bg);
}
.subtab-pane {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.subtab-pane--active {
  display: flex;
  flex-direction: column;
}

/* ================================================================
   SCROLLBARS (webkit)
================================================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ================================================================
   FOCUS RING (accessibility)
================================================================ */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ================================================================
   WORKSPACE GRID — RAIL COLLAPSE SYSTEM
   Desktop default: left | left-handle | center | right-handle | right
================================================================ */

#workspace-grid {
  grid-template-columns:
    var(--left-rail-width, 280px)
    18px
    minmax(0, 1fr)
    18px
    var(--right-rail-width, 320px);
  transition: grid-template-columns 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

#workspace-grid.left-collapsed  { --left-rail-width: 0px; }
#workspace-grid.right-collapsed { --right-rail-width: 0px; }

#workspace-grid.left-collapsed  .left-rail  { overflow: hidden; opacity: 0; pointer-events: none; }
#workspace-grid.right-collapsed .right-rail { overflow: hidden; opacity: 0; pointer-events: none; }

.left-rail,
.right-rail {
  transition: opacity 180ms ease;
  min-height: 0;
}

/* Rail collapse handle — vertical strip */
.rail-handle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  width: 18px;
  background: var(--surface);
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: background var(--t), color var(--t);
  position: relative;
  z-index: 1;
}
.rail-handle:hover {
  background: var(--surface-2);
  color: var(--accent);
}
.rail-handle-icon {
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 10px;
  margin-bottom: 6px;
}
.rail-handle-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  white-space: nowrap;
  color: var(--faint);
  flex-shrink: 1;
  flex-grow: 0;
  overflow: hidden;
  max-height: none;
  transition: opacity 180ms ease;
}
.left-collapsed  .rail-handle-left  .rail-handle-label,
.right-collapsed .rail-handle-right .rail-handle-label { opacity: 0; }

/* On tablet/phone the handles are hidden — rails stack naturally */
/* (set in the responsive section below) */

/* ================================================================
   PREVIEW TOOLBAR
================================================================ */

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.preview-toolbar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-right: 6px;
}
.preview-toolbar-file {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 180px;
}
.preview-file-select {
  flex: 1;
  max-width: 360px;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  appearance: none;
  cursor: pointer;
  transition: border-color var(--t);
}
.preview-file-select:focus {
  outline: none;
  border-color: var(--accent);
}
.preview-toolbar-ops {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.preview-op-counter {
  font-size: 12px;
  color: var(--muted);
  min-width: 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.preview-toolbar-actions {
  flex-shrink: 0;
}
.preview-content-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg-deep);
}

/* ================================================================
   STUB / SCAFFOLD COMPONENTS
================================================================ */

/* Workspace placeholder */
.workspace-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 120px;
}
.workspace-placeholder-label {
  color: var(--muted);
  font-size: 13px;
}

/* Stub badge */
.stub-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-2);
  vertical-align: middle;
  white-space: nowrap;
}
.stub-badge--pending {
  border-color: var(--warning);
  color: var(--warning);
  background: rgba(245, 158, 11, 0.08);
}

/* Tab button stub */
.tab-button--stub {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Empty state in left rail */
.stub-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 16px;
  flex: 1;
  text-align: center;
}
.stub-empty-icon  { font-size: 28px; color: var(--border); }
.stub-empty-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.stub-empty-hint  { font-size: 12px; color: var(--muted); opacity: 0.65; }

/* Item badge state variants */
.item-badge--modified { color: var(--warning); }
.item-badge--added    { color: var(--success); }
.item-badge--deleted  { color: var(--danger); }
.item-badge--idle     { color: var(--muted); }

/* Stage-stamped badge colours */
.item-badge--conform-blocked  { color: var(--danger); }
.item-badge--conform-warning  { color: var(--warning); }
.item-badge--conform-clean    { color: var(--success); }
.item-badge--validate-blocked { color: var(--danger); }
.item-badge--validate-warning { color: var(--warning); }
.item-badge--validate-info    { color: var(--info); }
.item-badge--proof-clean      { color: var(--success); }
.item-badge--proof-failed     { color: var(--danger); }

/* Diagnostics file block */
.diag-file-block--applied  { border-color: var(--success); opacity: 0.75; }
.diag-file-block--failed   { border-color: var(--danger); }
.diag-file-header--applied { color: var(--success); }
.diag-file-header--failed  { color: var(--danger); }

/* Working-state filter toolbar */
.state-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.state-filter-bar select {
  flex: 1;
  min-width: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 11px;
  padding: 3px 6px;
  cursor: pointer;
}
.state-filter-bar select:focus { outline: none; border-color: var(--accent); }

/* Stub layout containers */
.stub-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.stub-layout--columns {
  flex-direction: row;
  gap: 0;
  height: 100%;
  min-height: 480px;
}
.stub-layout--stack {
  flex-direction: column;
  gap: 0;
}

/* Notice banner */
.stub-notice {
  background: rgba(245, 158, 11, 0.07);
  border-left: 3px solid var(--warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  margin: 12px 12px 0;
  font-size: 12px;
  color: var(--text);
  flex-shrink: 0;
}
.stub-notice-sub {
  color: var(--muted);
  margin-top: 4px;
}

/* ── File viewer stub ────────────────────────────── */

.stub-file-tree {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stub-file-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  flex-shrink: 0;
}
.stub-tree-list {
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
  list-style: none;
}
.stub-tree-item {
  padding: 5px 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: default;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.stub-tree-item ul {
  width: 100%;
  padding-left: 16px;
  list-style: none;
  margin-top: 2px;
}
.stub-tree-item--folder {
  font-weight: 600;
  color: var(--text);
  flex-direction: column;
  align-items: flex-start;
}
.stub-tree-item--active {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  color: var(--accent);
  cursor: pointer;
}
.stub-tree-item[role="button"] { cursor: pointer; }
.stub-tree-item[role="button"]:hover {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.stub-tree-icon  { font-size: 13px; }
.stub-tree-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.stub-tree-badge--add {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
}
.stub-tree-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 5px 10px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  outline: none;
  flex-shrink: 0;
}
.stub-file-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.stub-file-content-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}
.stub-file-content-path {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stub-toolbar-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.stub-code-preview {
  display: flex;
  flex: 1;
  overflow: auto;
  background: var(--bg-deep);
  min-height: 0;
}
.stub-gutter {
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  min-width: 40px;
  text-align: right;
  background: var(--surface);
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--border);
  flex-shrink: 0;
  line-height: 1.6;
  user-select: none;
}
.stub-gutter span { display: block; }
.stub-code-area {
  flex: 1;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre;
  background: transparent;
  margin: 0;
  border: none;
  overflow: visible;
}
.stub-code-area--wrap {
  white-space: pre-wrap;
  word-break: break-all;
}

/* File viewer pane */
#subtab-summary-file-viewer {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

/* ── Diff proof stub ─────────────────────────────── */

.stub-diff-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.stub-diff-toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  flex: 1;
}
.stub-diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  min-height: 260px;
  overflow: auto;
  border-top: 1px solid var(--border);
  margin: 12px 12px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.stub-diff-col {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  overflow: hidden;
}
.stub-diff-col--before { border-right: none; }
.stub-diff-col-header {
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.stub-diff-lines {
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-y: auto;
  flex: 1;
  background: var(--bg-deep);
}
.stub-diff-line {
  display: flex;
  gap: 10px;
  padding: 2px 12px;
  line-height: 1.7;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.stub-diff-line--removed { background: rgba(239,68,68,0.1); }
.stub-diff-line--added   { background: rgba(16,185,129,0.1); }
.stub-diff-ln {
  color: var(--border);
  min-width: 28px;
  text-align: right;
  user-select: none;
  flex-shrink: 0;
}
.stub-diff-text { color: var(--text); }
.stub-diff-line--removed .stub-diff-text { color: #fca5a5; }
.stub-diff-line--added   .stub-diff-text { color: #6ee7b7; }

/* ── Right-rail stub cards ──────────────────────── */

.stub-card { border-color: var(--border); opacity: 0.85; }
.stub-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}
.stub-card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.stub-card-body  { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 8px; }
.stub-card-preview {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}
.stub-card-preview li {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stub-item-icon       { font-size: 12px; color: var(--muted); }
.stub-item-icon--ok   { color: var(--success); }
.stub-item-icon--warn { color: var(--warning); }
.stub-item-icon--err  { color: var(--danger); }

/* ================================================================
   LOAD DIALOG — REPOSITORY SUMMARY PANEL
================================================================ */

.summary-panel {
  margin-top: 10px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: grid;
  gap: 12px;
}
.summary-panel--hidden { display: none; }
.summary-panel-header  { display: grid; gap: 4px; }
.summary-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.summary-panel-subtitle {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.summary-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 12px;
}
.summary-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--t), background var(--t), transform var(--t);
}
.summary-check:hover { border-color: var(--accent); }
.summary-check input[type="checkbox"] { accent-color: var(--accent); flex: 0 0 auto; }
.summary-check span { font-size: 13px; line-height: 1.3; }
.summary-actions-row {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}
.summary-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--bg-deep);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.summary-result--hidden { display: none; }
.summary-result-file    { display: flex; align-items: center; gap: 8px; min-width: 0; }
.summary-result-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.summary-result-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

/* ================================================================
   UNIFIED DIFF VIEW
================================================================ */

.diff-view {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 12px 0;
}
.diff-line {
  display: flex;
  align-items: baseline;
  padding: 0 12px;
  min-height: 20px;
  white-space: pre;
}
.diff-line--header {
  color: var(--muted);
  font-style: italic;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  padding-bottom: 4px;
}
.diff-line--hunk {
  color: var(--accent);
  font-style: italic;
  opacity: 0.8;
  padding-top: 6px;
}
.diff-line--removed {
  background: color-mix(in srgb, #fc8181 8%, transparent);
  color: #fc8181;
}
.diff-line--added {
  background: color-mix(in srgb, #68d391 8%, transparent);
  color: #68d391;
}
.diff-line--context { color: var(--text); }
.diff-line-prefix {
  width: 14px;
  flex-shrink: 0;
  user-select: none;
  color: var(--muted);
}
.diff-line--removed .diff-line-prefix { color: #fc8181; }
.diff-line--added   .diff-line-prefix { color: #68d391; }
.diff-line-text { flex: 1; white-space: pre; overflow: hidden; }

/* ================================================================
   SUMMARY OUTPUT BOX
================================================================ */

.summary-output-box {
  padding: 14px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ================================================================
   BADGE / ITEM STATE VARIANTS (misc)
================================================================ */

.stub-layout--columns .stub-file-tree { min-width: 200px; }

/* File-viewer selection bar */
.file-viewer-selection-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

/* After-view toggle bar */
.after-view-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.after-view-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.after-view-toggle input { accent-color: var(--accent); }

/* Apply / conform result blocks */
.conform-result        { padding: 10px 12px; font-size: 13px; }
.conform-result--hidden { display: none; }
.apply-result          { padding: 10px 12px; font-size: 13px; }

.apply-auto-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--info) 8%, var(--surface-2));
  border: 1px solid var(--info);
  border-radius: var(--radius-sm);
  margin: 0 14px 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.apply-auto-notice-icon    { font-size: 18px; flex-shrink: 0; }
.apply-auto-notice-message { font-size: 13px; color: var(--text); flex: 1; }

.next-step-prompt-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  transition: background var(--t), border-color var(--t);
}
.next-step-prompt-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.next-step-prompt-btn--ghost {
  background: transparent;
  color: var(--accent);
}
.next-step-prompt-btn--ghost:hover { background: var(--accent-highlight); }

/* Conform fix list */
.conform-fix-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.conform-issues-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Apply file list */
.apply-file-list  { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.apply-results-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Stage issues pane */
.stage-issues-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }

/* ================================================================
   LOAD DIALOG — SUMMARY RESULT PANEL  (responsive tweak)
================================================================ */

@media (max-width: 640px) {
  .summary-options-grid { grid-template-columns: 1fr; }
  .summary-result { align-items: flex-start; flex-direction: column; }
  .summary-actions-row { width: 100%; }
}

/* ================================================================
   RESPONSIVE — TABLET  (≤ 900px)
================================================================ */

@media (max-width: 900px) {

  /* ── Workspace grid: single column, rails stack vertically ── */
  .workspace-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto;
  }

  /* Hide the rail collapse handles — not needed when stacked */
  .rail-handle {
    display: none;
  }

  /* Rails become normal block panels */
  .left-rail,
  .right-rail,
  .center-workspace {
    overflow: visible;
    opacity: 1 !important;
    pointer-events: auto !important;
    min-height: 0;
  }

  /* Left rail: working-state auto height, terminal bounded */
  .left-rail {
    display: grid;
    grid-template-rows: auto minmax(160px, 240px);
    gap: 10px;
  }

  /* Right rail: horizontal card grid instead of vertical column */
  .right-rail {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    height: auto;
    max-height: none;
    overflow-y: visible;
    align-self: auto;
  }

  /* Workflow bar: 4 columns */
  .workflow-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  /* Stage buttons: tighter padding */
  .stage-button {
    padding: 9px 8px;
  }

  /* Top info cards: 2 columns */
  .top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Preview toolbar */
  .preview-toolbar {
    gap: 10px;
  }
  .preview-file-select { max-width: 100%; }
  .preview-toolbar-ops { width: 100%; justify-content: space-between; }

  /* Diff grid stays 2-col but can scroll */
  .stub-diff-grid {
    min-height: 200px;
  }

  /* File-viewer tree pane: narrower on tablet */
  .stub-file-tree {
    width: 220px;
  }

  /* Stub column layout: allow stacking if very tight */
  .stub-layout--columns {
    min-height: 360px;
  }

  /* Apply / conform toolbars wrap neatly */
  .apply-results-toolbar,
  .conform-issues-toolbar {
    flex-wrap: wrap;
  }
}

/* ================================================================
   RESPONSIVE — PHONE  (≤ 600px)
================================================================ */

@media (max-width: 600px) {

  /* ── App shell: tighten overall padding ── */
  .app-shell {
    padding: 8px;
    gap: 8px;
  }

  /* ── Top band: reduce padding ── */
  .top-band {
    padding: 12px;
  }

  /* ── Brand h1 ── */
  .brand-block h1 {
    font-size: 20px;
  }

  /* ── Top info cards: single column ── */
  .top-grid {
    grid-template-columns: 1fr;
    margin-top: 10px;
    gap: 8px;
  }

  /* ── Panel headers: allow wrapping ── */
  .panel-header {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
  }

  /* ── Workflow bar: 2 columns ── */
  .workflow-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .stage-button {
    padding: 8px 8px;
  }
  .stage-name  { font-size: 12px; }
  .stage-state { font-size: 10px; }

  /* ── Center tab bar: scrollable strip ── */
  .tab-bar {
    padding: 6px 8px 0;
    gap: 1px;
  }
  .tab-button {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* ── Sub-tabs ── */
  .stage-subtabs {
    padding: 4px 8px 0;
  }
  .subtab-button {
    padding: 5px 10px;
    font-size: 11px;
  }

  /* ── File viewer: stack tree above content ── */
  .stub-layout--columns {
    flex-direction: column;
    min-height: 0;
    height: auto;
  }
  .stub-file-tree {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  /* ── Diff grid: stack before/after vertically ── */
  .stub-diff-grid {
    grid-template-columns: 1fr;
    min-height: 160px;
  }
  .stub-diff-col--before { border-right: 1px solid var(--border); border-bottom: none; }

  /* ── Preview toolbar: stack all rows ── */
  .preview-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
  }
  .preview-toolbar-file  { min-width: 0; }
  .preview-file-select   { max-width: 100%; }
  .preview-toolbar-ops   { width: 100%; justify-content: space-between; }
  .preview-toolbar-actions { width: 100%; }
  .preview-toolbar-actions .load-browse-btn { width: 100%; text-align: center; }

  /* ── After-view toolbar: wrap ── */
  .after-view-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* ── Apply / conform toolbars: stack ── */
  .apply-results-toolbar,
  .conform-issues-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .apply-results-toolbar .load-browse-btn,
  .conform-issues-toolbar .load-browse-btn {
    width: 100%;
    text-align: center;
    padding: 8px;
  }

  /* ── Load-section: reduce padding ── */
  .load-section { padding: 10px; gap: 12px; }

  /* ── Load file row: stack input above button ── */
  .load-file-row {
    flex-wrap: wrap;
  }
  .load-file-row input[type="text"],
  .load-file-row .load-input {
    width: 100%;
    flex: none;
  }
  .load-file-row .load-browse-btn {
    width: 100%;
    text-align: center;
    padding: 8px;
  }

  /* ── Summary options: single col (also catches > 640px override) ── */
  .summary-options-grid { grid-template-columns: 1fr; }

  /* ── State-filter bar: stack selects ── */
  .state-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .state-filter-bar select { width: 100%; }

  /* ── Right-rail card grid: force single column ── */
  .right-rail {
    grid-template-columns: 1fr;
  }

  /* ── Stub notice: tighten ── */
  .stub-notice { margin: 8px 8px 0; padding: 8px 12px; }

  /* ── Code/preview areas: tighten padding ── */
  .preview-content-area { padding: 10px 8px; }
  .stub-code-area       { padding: 8px; }
  .stub-gutter          { padding: 8px 6px; min-width: 32px; }

  /* ── Workflow stage header: allow wrapping ── */
  .workflow-stage-header {
    flex-direction: column;
    gap: 8px;
  }

  /* ── Summary panel: tighten ── */
  .summary-panel { padding: 10px; }

  /* ── Auto-notice: stack ── */
  .apply-auto-notice {
    flex-direction: column;
    align-items: flex-start;
    margin: 0 8px 10px;
  }
}

/* ================================================================
   MOBILE SECTION DRAWERS
   Only left-rail and right-rail get the drawer treatment.
   Top header is excluded — it uses its own collapse/expand buttons.
================================================================ */

/* Toggle bar injected by JS above each collapsible rail */
.mobile-section-toggle {
  display: none; /* inert on desktop */
  width: 100%;
  background: var(--surface-2);
  border: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-align: left;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background var(--t), color var(--t);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.mobile-section-toggle:hover {
  background: var(--surface);
  color: var(--accent);
}
.mst-label   { flex: 1; }
.mst-chevron { font-size: 10px; color: var(--muted); flex-shrink: 0; }

/* Hidden section body */
.mobile-section--collapsed {
  display: none !important;
}

/* Activate on tablet/phone */
@media (max-width: 900px) {
  .mobile-section-toggle {
    display: flex;
  }
}

/* ================================================================
   HORIZONTAL SCROLL FIX — Load / Preview / Conform / Apply stages
   Append to the END of components.css (after all existing rules).

   Root causes addressed:
   1. .center-workspace / .workspace-panel have no explicit max-width
      constraint — children can blow out the column.
   2. .diff-editors-grid and .diff-analysis-grid use 1fr 1fr with no
      overflow guard on the columns.
   3. .preview-file-select has min-width: 180px which prevents shrink.
   4. .preview-toolbar-file flex child doesn't clamp on small screens.
   5. .load-file-row uses flex with nowrap browse btn.
   6. .code-block / pre / .diff-preview use white-space:pre — they need
      a containing scroll box, not the whole page.
   7. .stage-subtabs and .workspace-tabs have no overflow guard.
   8. .preview-ops-table / .ops-table-wrap need a clamped container.
   9. .load-paste-area and .load-summary-pane can exceed viewport.
  10. .stub-layout--columns has min-height:480px which forces width.
================================================================ */

/* ── 1. Clamp the center column itself ── */
.center-workspace,
.workspace-panel {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* Every tab pane and subtab pane must stay inside the column */
.tab-pane,
.subtab-pane,
.tab-pane--active,
.subtab-pane--active {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* ── 2. Stage subtab bar + workspace tab bar: scroll not overflow ── */
.stage-subtabs,
.workspace-tabs,
#center-tab-bar {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;      /* keep single row, scroll rather than wrap */
  /* hide scrollbar visually but keep it functional */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.stage-subtabs::-webkit-scrollbar,
.workspace-tabs::-webkit-scrollbar,
#center-tab-bar::-webkit-scrollbar {
  display: none;
}

/* ── 3. Load section + load fields: no blowout ── */
.load-section,
.load-field,
.load-summary-pane,
.load-dialog-body {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* ── 4. load-file-row: stack on mobile, no overflow ── */
.load-file-row {
  min-width: 0;
  flex-wrap: wrap;          /* allow browse btn to wrap below input */
}
.load-file-row input[type="text"],
.load-file-row input[type="file"],
.load-input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.load-browse-btn {
  white-space: normal;       /* allow button label to wrap */
  word-break: break-word;
  min-width: 0;
  flex-shrink: 1;
}

/* ── 5. load-paste-area / diff textareas: always box-sizing ── */
.load-paste-area,
.load-textarea,
.diff-textarea,
.diff-analysis-area {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* ── 6. code-block / pre: contained horizontal scroll ── */
.code-block,
pre.code-block,
#patch-review-content,
#diff-proof-content,
.diff-preview,
.stub-code-area {
  overflow-x: auto;         /* scroll the code, not the page */
  max-width: 100%;
  box-sizing: border-box;
  word-break: normal;       /* keep code as-is inside its own scroll box */
}

/* ── 7. Preview content areas: contained ── */
.preview-content-area {
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
}

/* ── 8. Preview toolbar: wrap on narrow screens ── */
.preview-toolbar {
  flex-wrap: wrap;
  min-width: 0;
}
.preview-toolbar-file {
  min-width: 0;
  flex: 1 1 160px;        /* allow shrinking below 180px */
}
.preview-file-select {
  min-width: 0;           /* override the 180px min-width */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.preview-toolbar-ops {
  flex-shrink: 1;
  min-width: 0;
}
.preview-toolbar-actions {
  flex-shrink: 1;
  min-width: 0;
}

/* ── 9. Ops table: always in a scroll wrapper ── */
.ops-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.preview-ops-table {
  min-width: 480px;       /* keeps table readable; scrolls if needed */
}

/* ── 10. Diff editors and analysis grids: single column on mobile ── */
@media (max-width: 900px) {
  .diff-editors-grid,
  .diff-analysis-grid {
    grid-template-columns: 1fr;
  }
  .diff-editor-col,
  .diff-analysis-col {
    min-width: 0;
  }
}

/* ── 11. Stub layout: remove fixed min-height that forces width ── */
.stub-layout--columns {
  min-height: 0;       /* was 480px — caused the layout to be wider than viewport */
  height: auto;
  min-height: 300px;   /* keep a reasonable minimum without forcing overflow */
  overflow: hidden;
  max-width: 100%;
}

/* ── 12. Conform / apply toolbars: wrap buttons on mobile ── */
.conform-issues-toolbar,
.apply-results-toolbar {
  flex-wrap: wrap;
  min-width: 0;
}
.conform-issues-toolbar .load-browse-btn,
.apply-results-toolbar .load-browse-btn {
  flex-shrink: 1;
  min-width: 0;
}

/* ── 13. Workflow stage grid and cards: no blowout ── */
.workflow-stage-pane,
.workflow-stage-grid,
.workflow-card,
.workflow-stage-header,
.stage-issues-pane {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* ── 14. Apply results file list ── */
.apply-file-list,
.conform-fix-list {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.conform-fix-item {
  min-width: 0;
  word-break: break-word;
}
.conform-fix-item-path,
.conform-fix-item-kind {
  white-space: normal;   /* allow long paths to wrap */
  word-break: break-all;
}

/* ── 15. Global safety net: nothing wider than the viewport ── */
@media (max-width: 900px) {
  .app-shell,
  .app-shell > * {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Ensure the workspace grid column doesn't escape */
  #workspace-grid {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Issue / apply result rows: stack badges */
  .load-summary-file-item {
    flex-wrap: wrap;
    gap: 6px;
  }
  .load-summary-file-item-path {
    word-break: break-all;
  }
}

/* ================================================================
   PROCESS TILE DECK
   State-aware guide. One tile visible at a time. Lives below the
   top region, above the workspace grid.
   Theme-token only — adapts across Light/Dark/Vibrant/Modern.
================================================================ */

.process-tile-deck {
    margin: 0 0 10px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.process-tile-deck[hidden] { display: none; }

.process-tile-deck.is-collapsed .process-progress-bar,
.process-tile-deck.is-collapsed .process-progress-crumbs,
.process-tile-deck.is-collapsed .process-tile-stage { display: none; }

/* ── Progress strip ── */

.process-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.process-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 24px;
}

.process-progress-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

.process-deck-reset {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--t), border-color var(--t);
}
.process-deck-reset:hover {
    color: var(--text);
    border-color: var(--accent);
}

.process-progress-counter {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.02em;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.process-deck-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: color var(--t), border-color var(--t);
}
.process-deck-toggle:hover { color: var(--text); border-color: var(--accent); }

.process-progress-bar {
    height: 4px;
    background: var(--bg-deep);
    border-radius: 999px;
    overflow: hidden;
}
.process-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    width: 0%;
    transition: width var(--t);
}

.process-progress-crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.process-crumb {
    background: transparent;
    border: none;
    padding: 2px 4px;
    color: inherit;
    font: inherit;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.process-crumb:hover { color: var(--text); }
.process-crumb.is-current {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.process-crumb-sep { color: var(--faint); }

/* ── Tile card ── */

.process-tile-stage { display: flex; flex-direction: column; }

.process-tile {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.process-tile[hidden] { display: none; }

.process-tile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.process-tile-heading {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.process-tile-num {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.process-tile-emoji {
    font-size: 16px;
    line-height: 1;
}

.process-tile-heading h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.005em;
}

.process-tile-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.process-go-btn,
.process-next-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--t), color var(--t), border-color var(--t);
}
.process-go-btn {
    background: transparent;
    color: var(--text);
}
.process-go-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.process-next-btn {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
}
.process-next-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.process-prev-btn {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--t), color var(--t), border-color var(--t);
}
.process-prev-btn:hover {
    color: var(--text);
    border-color: var(--accent);
}

.process-tile-kicker {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    font-style: normal;
}
.process-tile-kicker em {
    font-style: italic;
    color: var(--accent);
}

.process-tile-body p {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text);
}
.process-tile-body p:last-child { margin-bottom: 0; }
.process-tile-body em {
    font-style: italic;
    font-weight: 600;
    color: var(--text);
}

/* ── Go-to target pulse (when Open ↗ is clicked) ── */

.process-target-pulse {
    animation: process-pulse 1.5s ease-out;
    position: relative;
    z-index: 1;
}
@keyframes process-pulse {
    0%   { box-shadow: 0 0 0 0   var(--accent-highlight, rgba(0, 212, 255, 0.4)); }
    70%  { box-shadow: 0 0 0 12px transparent; }
    100% { box-shadow: 0 0 0 0   transparent; }
}

/* ── Mobile / tablet (≤ 900px) ── */

@media (max-width: 900px) {
    .process-tile-deck { padding: 10px 12px; }
    .process-progress-crumbs { display: none; }
    .process-tile-head { flex-direction: column; align-items: stretch; }
    .process-tile-actions { justify-content: stretch; }
    .process-go-btn, .process-next-btn { flex: 1; text-align: center; }
}

/* ── Phone (≤ 600px) ── */

@media (max-width: 600px) {
    .process-tile-deck { padding: 8px 10px; gap: 10px; }
    .process-tile { padding: 12px; }
    .process-tile-heading h3 { font-size: 14px; }
    .process-tile-body p { font-size: 12px; }
    .process-progress-counter { font-size: 11px; }
}
