:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #172033;
  --muted: #65748b;
  --surface: rgba(255, 255, 255, .66);
  --surface-strong: rgba(255, 255, 255, .84);
  --surface-border: rgba(255, 255, 255, .86);
  --line: rgba(101, 116, 139, .16);
  --field: rgba(255, 255, 255, .72);
  --accent: #2459d3;
  --accent-hover: #1948b4;
  --button-bg: #2459d3;
  --button-hover: #1948b4;
  --accent-soft: rgba(36, 89, 211, .11);
  --shadow: 0 18px 55px rgba(31, 51, 91, .11), 0 2px 8px rgba(31, 51, 91, .05);
  --warning-ink: #76500d;
  --warning-bg: rgba(255, 248, 233, .76);
  --warning-border: #dc9a22;
  color: var(--ink);
  background: #edf3fa;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7edf8;
  --muted: #a1afc5;
  --surface: rgba(25, 36, 57, .68);
  --surface-strong: rgba(29, 42, 66, .88);
  --surface-border: rgba(198, 215, 245, .16);
  --line: rgba(198, 215, 245, .12);
  --field: rgba(15, 24, 41, .68);
  --accent: #82a9ff;
  --accent-hover: #a5c0ff;
  --button-bg: #3768c8;
  --button-hover: #4678da;
  --accent-soft: rgba(130, 169, 255, .16);
  --shadow: 0 22px 65px rgba(0, 0, 0, .28), 0 2px 10px rgba(0, 0, 0, .16);
  --warning-ink: #f3d28e;
  --warning-bg: rgba(92, 63, 18, .28);
  --warning-border: #d59b37;
  background: #101827;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ink: #e7edf8;
    --muted: #a1afc5;
    --surface: rgba(25, 36, 57, .68);
    --surface-strong: rgba(29, 42, 66, .88);
    --surface-border: rgba(198, 215, 245, .16);
    --line: rgba(198, 215, 245, .12);
    --field: rgba(15, 24, 41, .68);
    --accent: #82a9ff;
    --accent-hover: #a5c0ff;
    --button-bg: #3768c8;
    --button-hover: #4678da;
    --accent-soft: rgba(130, 169, 255, .16);
    --shadow: 0 22px 65px rgba(0, 0, 0, .28), 0 2px 10px rgba(0, 0, 0, .16);
    --warning-ink: #f3d28e;
    --warning-bg: rgba(92, 63, 18, .28);
    --warning-border: #d59b37;
    background: #101827;
  }
}

* { box-sizing: border-box; }
body {
  position: relative;
  isolation: isolate;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 9% 4%, rgba(84, 139, 255, .19), transparent 34rem),
    radial-gradient(ellipse at 92% 10%, rgba(83, 211, 199, .17), transparent 31rem),
    linear-gradient(145deg, #f3f7fd 0%, #e8eef8 50%, #f5f7fb 100%);
  background-attachment: fixed;
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 8% 2%, rgba(66, 104, 194, .24), transparent 34rem),
    radial-gradient(ellipse at 92% 8%, rgba(31, 140, 148, .15), transparent 31rem),
    linear-gradient(145deg, #101827 0%, #151f32 52%, #111a2a 100%);
  background-attachment: fixed;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) body {
    background:
      radial-gradient(ellipse at 8% 2%, rgba(66, 104, 194, .24), transparent 34rem),
      radial-gradient(ellipse at 92% 8%, rgba(31, 140, 148, .15), transparent 31rem),
      linear-gradient(145deg, #101827 0%, #151f32 52%, #111a2a 100%);
    background-attachment: fixed;
  }
}
button, input, select { font: inherit; }
button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 16px;
  color: white;
  background: linear-gradient(135deg, var(--button-bg), #4c77e9);
  box-shadow: 0 8px 18px rgba(36, 89, 211, .17);
  font-weight: 680;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
button:hover { background: linear-gradient(135deg, var(--button-hover), #587fe0); box-shadow: 0 10px 24px rgba(36, 89, 211, .23); transform: translateY(-1px); }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(112, 155, 255, .75); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.shell { max-width: 1240px; margin: 0 auto; padding: 34px 24px 64px; }
.topbar, .section-heading, .pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.login-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 12px; }
.topbar { margin-bottom: 30px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: .75rem; font-weight: 800; letter-spacing: .14em; }
h1 {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.035em;
}
h2 { margin: 0; font-size: 1.15rem; }
h3 { color: var(--ink); }
.muted { color: var(--muted); }
.topbar .muted, .section-heading .muted { margin: 6px 0 0; font-size: .9rem; }
.read-only { border: 1px solid var(--surface-border); border-radius: 999px; padding: 8px 13px; color: var(--muted); background: var(--surface); backdrop-filter: blur(14px); font-size: .8rem; font-weight: 700; }
.panel, .card {
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
}
.panel { margin-top: 20px; padding: 24px; }
.login-panel { max-width: 580px; }
.login-panel h2 { margin-bottom: 8px; }
.login-panel p { line-height: 1.55; }
label { display: block; margin: 18px 0 8px; color: var(--ink); font-size: .88rem; font-weight: 650; }
.login-row input {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 15px;
  color: var(--ink);
  background: linear-gradient(145deg, var(--surface-strong), var(--field));
  box-shadow: inset 0 1px 2px rgba(31, 51, 91, .05);
  font-size: .92rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.login-row input::placeholder { color: var(--muted); opacity: .8; }
.login-row input:focus { border-color: var(--accent); background: var(--surface-strong); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
.login-row input[aria-invalid="true"] { border-color: #c94f5d; box-shadow: 0 0 0 3px rgba(201, 79, 93, .12); }
.login-row button { min-width: 120px; }
.login-hint { margin: 9px 2px 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.section-heading { margin-bottom: 20px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.card { min-height: 130px; padding: 19px; }
.card-label { display: block; margin-bottom: 12px; color: var(--muted); font-size: .82rem; font-weight: 650; }
.card strong { display: block; overflow-wrap: anywhere; font-size: 1.15rem; }
.card .muted { display: block; margin-top: 7px; font-size: .78rem; }
.queue-card .queue-toggle { align-self: flex-start; margin-top: 12px; }
.queue-card .queue-toggle[hidden] { display: none; }
.worker-card { min-width: 0; }
.worker-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.worker-actions button { min-height: 36px; padding: 0 11px; font-size: .78rem; }
.worker-card #worker-control-status { line-height: 1.45; }
.state-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.count-chip { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; color: var(--muted); background: var(--surface-strong); font-size: .78rem; font-weight: 650; }
.flow-warning { border-left: 3px solid var(--warning-border); margin: 0 0 18px; border-radius: 0 12px 12px 0; padding: 11px 14px; color: var(--warning-ink); background: var(--warning-bg); font-size: .86rem; line-height: 1.55; }
.flow-grid { display: grid; gap: 10px; }
.flow-accordion > summary { position: relative; padding-right: 30px; cursor: pointer; list-style: none; }
.flow-accordion > summary::-webkit-details-marker { display: none; }
.flow-accordion > summary h2 { margin: 0; }
.flow-accordion > summary .muted { display: block; margin-top: 6px; font-size: .86rem; }
.flow-accordion > summary::after { content: ""; position: absolute; top: 7px; right: 4px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
.flow-accordion[open] > summary::after { transform: rotate(225deg); }
.flow-accordion > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 6px; }
.flow-accordion-content { margin-top: 20px; }
.flow-row { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(180px, 1fr) minmax(220px, 1.3fr); align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 11px 0; }
.flow-row:first-child, .flow-row:nth-child(2), .flow-row:nth-child(3), .flow-row:nth-child(4) { grid-template-columns: minmax(160px, .7fr) 120px minmax(220px, 1.3fr); }
.flow-row strong { font-size: .86rem; }
.flow-row label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .78rem; }
.flow-row input { width: 100%; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 11px; padding: 0 10px; color: var(--ink); background: var(--field); }
.locked-value { color: var(--muted); font-size: .83rem; }
.flow-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.reconcile-panel { margin-top: 20px; border: 1px solid var(--warning-border); border-radius: 16px; padding: 19px; background: var(--warning-bg); backdrop-filter: blur(16px); }
.reconcile-panel h3 { margin: 0 0 10px; }
.reconcile-panel form > label { display: block; max-width: 640px; margin: 14px 0; color: var(--ink); font-size: .86rem; font-weight: 650; }
.reconcile-panel input:not([type="checkbox"]), .reconcile-panel select { display: block; width: 100%; height: 42px; margin-top: 7px; border: 1px solid var(--line); border-radius: 11px; padding: 0 10px; color: var(--ink); background: var(--field); }
.reconcile-panel .confirm-label { display: flex; align-items: center; gap: 9px; }
.reconcile-panel .confirm-label input { width: 18px; height: 18px; accent-color: var(--accent); }
.history-filter { display: flex; align-items: center; gap: 10px; max-width: 360px; margin: 0 0 16px; color: var(--ink); }
.history-filter select { min-width: 170px; height: 40px; border: 1px solid var(--line); border-radius: 11px; padding: 0 10px; color: var(--ink); background: var(--field); }
.history-filters {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(125px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin: 0 0 18px;
}
.history-filters label {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}
.history-filters input, .history-filters select {
  display: block;
  width: 100%;
  min-width: 0;
  height: 40px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--field);
  font-size: .82rem;
}
.history-filters button { min-height: 40px; padding: 0 12px; font-size: .78rem; white-space: nowrap; }
.history-filter select, .history-filters select, .reconcile-panel select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0 40px 0 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2373859e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.history-filter select:hover, .history-filters select:hover, .reconcile-panel select:hover {
  border-color: var(--accent);
}
.history-filter select:focus, .history-filters select:focus, .reconcile-panel select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
@media (forced-colors: active) {
  .history-filter select, .history-filters select, .reconcile-panel select {
    appearance: auto;
    -webkit-appearance: auto;
    background-image: none;
    padding-right: 14px;
  }
}
.transfer-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  overflow: auto;
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 22px;
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(150%);
}
.transfer-dialog::backdrop { background: rgba(18, 30, 48, .42); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dialog-heading .eyebrow { margin-bottom: 6px; }
.dialog-heading h2 { font-size: 1.15rem; }
.transfer-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.transfer-detail-list > div { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: var(--surface); }
.transfer-detail-list dt { margin-bottom: 5px; color: var(--muted); font-size: .7rem; font-weight: 700; }
.transfer-detail-list dd { overflow-wrap: anywhere; margin: 0; color: var(--ink); font-size: .84rem; font-weight: 650; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .16); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { color: var(--muted); font-size: .75rem; font-weight: 750; }
td { color: var(--ink); font-size: .86rem; }
td.detail { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: normal; }
.status { display: inline-block; border-radius: 999px; padding: 5px 9px; color: var(--muted); background: var(--accent-soft); font-size: .75rem; font-weight: 750; }
.status.succeeded, .status.simulated { color: #176844; background: rgba(62, 190, 123, .16); }
.status.failed, .status.uncertain { color: #a82f35; background: rgba(238, 92, 92, .15); }
.status.queued, .status.claimed, .status.navigating, .status.pin_authorized { color: #956100; background: rgba(244, 184, 61, .18); }
:root[data-theme="dark"] .status.succeeded, :root[data-theme="dark"] .status.simulated { color: #88e0b0; }
:root[data-theme="dark"] .status.failed, :root[data-theme="dark"] .status.uncertain { color: #ff9a9e; }
:root[data-theme="dark"] .status.queued, :root[data-theme="dark"] .status.claimed, :root[data-theme="dark"] .status.navigating, :root[data-theme="dark"] .status.pin_authorized { color: #f4cf7c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .status.succeeded, :root:not([data-theme]) .status.simulated { color: #88e0b0; }
  :root:not([data-theme]) .status.failed, :root:not([data-theme]) .status.uncertain { color: #ff9a9e; }
  :root:not([data-theme]) .status.queued, :root:not([data-theme]) .status.claimed, :root:not([data-theme]) .status.navigating, :root:not([data-theme]) .status.pin_authorized { color: #f4cf7c; }
}
.pagination { justify-content: flex-end; margin-top: 16px; }
.secondary { border-color: var(--line); color: var(--ink); background: var(--surface-strong); box-shadow: none; backdrop-filter: blur(12px); }
.secondary:hover { color: var(--ink); background: var(--accent-soft); box-shadow: none; }
.theme-toggle { min-width: 100px; }
.message { min-height: 1.2em; color: #a13333; font-size: .88rem; }
.login-panel .message { margin-bottom: 0; }
:root[data-theme="dark"] .message { color: #ff9a9e; }
.footnote { color: var(--muted); font-size: .82rem; line-height: 1.55; }
[hidden] { display: none !important; }
@media (max-width: 800px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { align-items: flex-start; }
  .history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-search { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .shell { padding: 22px 14px 42px; }
}

body {
    background:
      radial-gradient(ellipse at 12% 18%, rgba(107, 182, 191, .28), transparent 31rem),
      radial-gradient(ellipse at 84% 8%, rgba(244, 202, 166, .35), transparent 34rem),
      radial-gradient(ellipse at 76% 88%, rgba(95, 134, 181, .2), transparent 35rem),
      linear-gradient(135deg, #dce8e7 0%, #e8e5df 50%, #d4dfeb 100%);
  }
  :root[data-theme="dark"] body {
    background:
      radial-gradient(ellipse at 12% 18%, rgba(38, 133, 148, .22), transparent 31rem),
      radial-gradient(ellipse at 84% 8%, rgba(176, 120, 75, .16), transparent 34rem),
      linear-gradient(135deg, #111b29 0%, #1b2533 50%, #101a28 100%);
  }
  .shell { max-width: 1180px; padding-top: 24px; }
  .topbar {
    position: relative;
    min-height: 92px;
    gap: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--surface-border);
    border-radius: 18px;
    padding: 14px 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px) saturate(150%);
  }
  .topbar > div:first-child { min-width: 0; }
  .topbar .eyebrow { margin-bottom: 4px; }
  .topbar .muted { margin-top: 3px; }
  .header-actions { flex-shrink: 0; }
  .theme-toggle { white-space: nowrap; }
  .workspace-hero {
    position: relative;
    display: flex;
    min-height: 210px;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    margin-top: 0;
    padding: 26px 34px;
    background:
      radial-gradient(ellipse at 80% 45%, rgba(77, 201, 202, .2), transparent 19rem),
      linear-gradient(115deg, var(--surface-strong), var(--surface));
  }
  .workspace-copy { position: relative; z-index: 1; }
  .workspace-copy .eyebrow { margin-bottom: 10px; }
  .workspace-copy h2 {
    font-size: clamp(1.25rem, 2.1vw, 1.65rem);
    line-height: 1.25;
    letter-spacing: -.025em;
  }
  .workspace-copy > .muted { margin: 10px 0 20px; line-height: 1.5; }
  .workspace-nav { display: flex; flex-wrap: wrap; gap: 8px; }
  .workspace-nav a {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--ink);
    background: var(--surface);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
  }
  .workspace-nav a:hover { border-color: var(--accent); color: var(--accent); }
  .workspace-robot { position: relative; width: 185px; height: 170px; flex: 0 0 185px; }
  .robot-orbit {
    position: absolute;
    inset: 18px 4px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    border-radius: 50%;
    transform: rotate(-18deg);
  }
  .robot-head {
    position: absolute;
    top: 28px;
    left: 48px;
    display: flex;
    width: 90px;
    height: 66px;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: 3px solid rgba(255,255,255,.82);
    border-radius: 46% 46% 42% 42%;
    background: linear-gradient(145deg, #effcff, #829eaf 58%, #526a7c);
    box-shadow: 0 15px 25px rgba(22, 48, 70, .2), inset 0 2px 6px white;
  }
  .robot-head::before, .robot-head::after {
    position: absolute;
    top: 21px;
    width: 10px;
    height: 22px;
    border-radius: 8px;
    background: linear-gradient(#71e8f4, #246d91);
    content: "";
  }
  .robot-head::before { left: -9px; }
  .robot-head::after { right: -9px; }
  .robot-head i { width: 7px; height: 13px; border-radius: 8px; background: #0c374a; }
  .robot-head b { position: absolute; bottom: 13px; left: 36px; width: 17px; height: 7px; border-bottom: 2px solid #23b8c2; border-radius: 0 0 14px 14px; }
  .robot-body {
    position: absolute;
    top: 91px;
    left: 62px;
    width: 62px;
    height: 48px;
    border: 3px solid rgba(255,255,255,.8);
    border-radius: 17px 17px 22px 22px;
    background: linear-gradient(145deg, #fbffff, #a4bcc9 70%, #7590a0);
    box-shadow: 0 12px 20px rgba(22, 48, 70, .17);
  }
  .robot-body::before, .robot-body::after { position: absolute; top: 8px; width: 10px; height: 29px; border-radius: 8px; background: linear-gradient(#f7ffff, #86a6b6); content: ""; }
  .robot-body::before { left: -10px; transform: rotate(12deg); }
  .robot-body::after { right: -10px; transform: rotate(-12deg); }
  .robot-body i { position: absolute; top: 13px; left: 21px; width: 17px; height: 17px; border: 2px solid #18788d; border-radius: 50%; background: radial-gradient(circle, #60e7e8 0 2px, #173749 3px); }
  #runtime-panel { margin-top: 28px; scroll-margin-top: 18px; }
  #flow-panel, #history-panel { margin-top: 28px; }
  #flow-panel, #history-panel { scroll-margin-top: 18px; }
  .section-heading > div { min-width: 0; }
  .cards { gap: 14px; }
  .card { min-height: 128px; border-radius: 16px; padding: 20px; }
  #runtime-panel > .flow-warning { margin: 14px 0 0; }
  .panel { border-radius: 18px; }
  .history-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    background: var(--surface);
  }
  .history-toolbar label { margin: 0; }
  .history-toolbar .select-all-label, .history-toolbar .archived-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: .8rem;
  }
  .history-toolbar .select-all-label { margin-right: auto; }
  .history-toolbar input[type="checkbox"], .transfer-select {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
  }
  .history-toolbar button { min-height: 36px; border-radius: 10px; padding: 0 12px; font-size: .78rem; }
  .danger { color: #a63e47; }
  .danger:hover { color: #8d2933; background: rgba(215, 72, 81, .1); }
  .transfer-select:disabled { cursor: not-allowed; opacity: .35; }
  .archived-badge { display: block; margin-top: 5px; color: var(--muted); font-size: .68rem; }
  th:first-child, td:first-child { width: 44px; text-align: center; }
  .table-wrap { background: var(--surface); }
  thead { position: sticky; top: 0; z-index: 1; background: var(--surface-strong); }
  tbody tr:hover { background: var(--accent-soft); }
  .flow-row { border-color: var(--line); }
  .reconcile-panel { border-radius: 18px; }
  .transfer-events { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 15px; }
  .transfer-events h3 { margin: 0 0 10px; font-size: .95rem; }
  .transfer-events ol { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
  .transfer-events li { display: grid; grid-template-columns: minmax(130px, auto) 1fr; gap: 10px; color: var(--muted); font-size: .82rem; }
  .transfer-events time { color: var(--text); font-variant-numeric: tabular-nums; }
  #webhook-form { max-width: 720px; }
  #webhook-form input { display: block; width: 100%; height: 44px; margin: 7px 0 12px; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; color: var(--ink); background: var(--field); }
  #webhook-form > .muted { font-size: .82rem; }
  @media (max-width: 700px) {
    .shell { padding: 14px 12px 36px; }
    .topbar { align-items: center; padding: 12px 14px; }
    .workspace-hero { min-height: 184px; padding: 20px; }
    .workspace-robot { width: 120px; height: 140px; flex-basis: 120px; transform: scale(.78); transform-origin: center right; }
    .workspace-nav a { padding: 7px 9px; }
    .history-toolbar .select-all-label { margin-right: 0; }
  }
  @media (max-width: 480px) {
    .workspace-hero { align-items: flex-start; }
    .workspace-robot { position: absolute; right: 12px; bottom: 4px; opacity: .48; }
    .workspace-copy { max-width: 80%; }
    .workspace-nav { max-width: 240px; }
    .history-toolbar { gap: 8px; }
    .history-toolbar .select-all-label { flex: 1 1 42%; }
    .history-toolbar #selection-count { flex: 1 1 40%; text-align: right; }
    .history-toolbar button { flex: 1 1 42%; }
    .history-toolbar .archived-toggle { flex: 1 1 100%; }
  }
@media (max-width: 520px) {
  .cards { gap: 9px; }
  .card { min-height: 116px; padding: 14px; }
  .panel { padding: 17px; border-radius: 17px; }
  .login-row { grid-template-columns: 1fr; }
  .login-row button { width: 100%; }
  .topbar { gap: 10px; }
  .topbar .eyebrow { margin-bottom: 3px; font-size: .62rem; }
  .topbar h1 { font-size: 1.1rem; }
  .topbar .muted { font-size: .76rem; }
  .header-actions { flex-wrap: nowrap; }
  .header-actions button { min-height: 36px; padding: 0 10px; font-size: .74rem; }
  .read-only { display: none; }
  .flow-row, .flow-row:first-child, .flow-row:nth-child(2), .flow-row:nth-child(3), .flow-row:nth-child(4) { grid-template-columns: 1fr; gap: 8px; }
  .flow-row label { display: grid; grid-template-columns: 110px 1fr; }
  .flow-actions { align-items: stretch; flex-direction: column; }
  .history-filters { grid-template-columns: 1fr 1fr; gap: 10px; }
  .history-filters .history-search { grid-column: 1 / -1; }
  .history-filters button { grid-column: 1 / -1; }
  .transfer-dialog { padding: 17px; }
  .transfer-detail-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
