/* Commerce Spine Console: SellerPlex brand system
   Montserrat (brand) + Spline Sans Mono (machine names, metrics)
   Light theme, navy rail, blue-tinted neutrals. */

:root {
  --blue: #0D4BB8;
  --blue-mid: #1E65D9;
  --navy: #15264C;
  --navy-2: #1B2F5C;
  --navy-3: #24396B;
  --mint: #2CDBA1;
  --mint-deep: #0FA87A;
  --sky: #65D2FF;
  --orange: #FF8B00;
  --red: #D6455D;

  --ink: #15264C;
  --ink-2: #3A4A6E;
  --ink-3: #6B7A9C;
  --hairline: #D9E0EF;
  --hairline-soft: #E7ECF7;
  --paper: #FBFCFF;
  --panel: #FFFFFF;
  --wash: #F0F4FF;
  --wash-2: #F6F8FE;

  --mono: 'Spline Sans Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Montserrat', system-ui, -apple-system, sans-serif;

  --rail-w: 232px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}

::selection { background: rgba(30, 101, 217, .18); }

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------- App frame ---------- */

.app { display: flex; min-height: 100vh; }

/* ---------- Rail (sidebar) ---------- */

.rail {
  width: var(--rail-w);
  flex: 0 0 var(--rail-w);
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
}

.rail-brand .mark { flex: 0 0 auto; }

.rail-brand .word {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.015em;
  color: #fff;
  line-height: 1.1;
}
.rail-brand .word small {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 9.5px;
  letter-spacing: .14em;
  color: #8FA3CE;
  margin-top: 3px;
  text-transform: uppercase;
}

.rail-nav { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }

.rail-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #6E82B2;
  padding: 16px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: #C4D0EA;
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: background .15s ease, color .15s ease;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .8; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(30,101,217,.35); color: #fff; font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--mint);
  background: rgba(44,219,161,.12);
  padding: 1px 7px;
  border-radius: 99px;
}

.rail-foot {
  margin-top: auto;
  padding: 16px 20px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rail-version {
  font-family: var(--mono);
  font-size: 10.5px;
  color: #6E82B2;
  letter-spacing: .06em;
}
.rail-powered {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8FA3CE;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}
.rail-powered:hover { color: #fff; }
.rail-powered img { height: 18px; width: 18px; object-fit: contain; opacity: .9; }

/* ---------- Main column ---------- */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.preview-banner {
  background: var(--orange);
  color: #2A1600;
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  padding: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 41;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 36px;
  border-bottom: 1px solid var(--hairline-soft);
  background: rgba(251,252,255,.92);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 33px;
  z-index: 40;
}

.crumb { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.crumb b { color: var(--ink); font-weight: 700; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.org-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--hairline);
  background: #fff;
  border-radius: 99px;
  padding: 5px 14px 5px 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.org-switch:hover { border-color: var(--blue-mid); }
.org-switch .org-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.org-switch svg { width: 12px; height: 12px; color: var(--ink-3); }

.doc-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--r-sm);
}
.doc-link:hover { background: var(--wash); }

.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- Content ---------- */

.content { padding: 32px 36px 72px; max-width: 1220px; width: 100%; }

.page-head { margin-bottom: 26px; }
.page-title { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.page-sub { color: var(--ink-3); font-size: 13.5px; margin-top: 5px; max-width: 68ch; }

.head-row { display: flex; align-items: flex-start; gap: 20px; }
.head-row .page-head { margin-bottom: 0; }
.head-actions { margin-left: auto; display: flex; gap: 10px; flex: 0 0 auto; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-mid); }
.btn-ghost { background: transparent; color: var(--blue); border: 1px solid var(--hairline); }
.btn-ghost:hover { border-color: var(--blue-mid); background: var(--wash-2); }
.btn-quiet { background: transparent; color: var(--ink-3); padding: 6px 10px; font-weight: 600; }
.btn-quiet:hover { color: var(--blue); background: var(--wash-2); }
.btn-danger-quiet { background: transparent; color: var(--red); padding: 6px 10px; font-weight: 600; }
.btn-danger-quiet:hover { background: #FBEEF1; }
.btn svg { width: 14px; height: 14px; }

/* ---------- Chips, badges, pulses ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 99px;
  padding: 2px 9px;
  white-space: nowrap;
}
.chip-mono { font-family: var(--mono); font-weight: 500; letter-spacing: .02em; }
.chip-blue { background: rgba(30,101,217,.10); color: var(--blue); }
.chip-navy { background: rgba(21,38,76,.08); color: var(--navy); }
.chip-mint { background: rgba(44,219,161,.14); color: var(--mint-deep); }
.chip-amber { background: rgba(255,139,0,.13); color: #B36200; }
.chip-red { background: rgba(214,69,93,.11); color: var(--red); }
.chip-gray { background: var(--wash); color: var(--ink-3); }
.chip-outline { border: 1px solid var(--hairline); color: var(--ink-2); background: #fff; }

.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mint);
  position: relative;
  flex: 0 0 auto;
}
.pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--mint);
  opacity: 0;
  animation: pulse-ring 2.6s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(.4); opacity: .8; }
  70% { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(1.15); opacity: 0; }
}
.pulse.idle { background: #B9C6E2; }
.pulse.idle::after { display: none; }
.pulse.warn { background: var(--orange); }
.pulse.warn::after { border-color: var(--orange); }

/* ---------- Panels & stat band ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
}

.statband {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  background: #fff;
  overflow: hidden;
  margin-bottom: 28px;
}
.stat {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat + .stat { border-left: 1px solid var(--hairline-soft); }
.stat .v {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.stat .v .sub { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.stat .k { font-size: 11.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; }
.stat .meter {
  margin-top: 8px;
  height: 4px;
  border-radius: 99px;
  background: var(--wash);
  overflow: hidden;
}
.stat .meter i { display: block; height: 100%; background: var(--blue-mid); border-radius: 99px; }

/* ---------- Section titles ---------- */

.sec {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 34px 0 14px;
}
.sec:first-child { margin-top: 0; }
.sec h2 { font-size: 15.5px; font-weight: 700; letter-spacing: -0.005em; }
.sec .sec-note { font-size: 12.5px; color: var(--ink-3); }
.sec .sec-link { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--blue); text-decoration: none; }
.sec .sec-link:hover { text-decoration: underline; }

/* ---------- Data tables ---------- */

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  white-space: nowrap;
}
.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover { background: var(--wash-2); }
.tbl .num { font-variant-numeric: tabular-nums; text-align: right; }
.tbl .mono { font-family: var(--mono); font-size: 12px; letter-spacing: .01em; }
.tbl .right { text-align: right; }
.tbl-wrap { overflow-x: auto; }

/* ---------- Entity rows (Data page) ---------- */

.entity-list { display: flex; flex-direction: column; }
.entity {
  display: grid;
  grid-template-columns: minmax(230px, 1.35fr) minmax(240px, 2fr) 130px 150px 90px;
  gap: 18px;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--hairline-soft);
  cursor: pointer;
  transition: background .12s ease;
}
.entity:last-child { border-bottom: 0; }
.entity:hover { background: var(--wash-2); }
.entity:focus-visible, .tbl tr:focus-visible {
  outline: 2px solid var(--blue-mid);
  outline-offset: -2px;
  background: var(--wash-2);
}
.entity .e-name { font-weight: 700; font-size: 13.5px; letter-spacing: -0.005em; }
.entity .e-asset {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 3px;
  letter-spacing: .01em;
}
.entity .e-desc {
  font-size: 12.5px;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entity .e-fresh { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.entity .e-fresh small { display: block; font-weight: 500; color: var(--ink-3); font-size: 11px; }
.entity .e-cols { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); text-align: right; }

.l1-group { border-bottom: 1px solid var(--hairline-soft); }
.l1-group:last-child { border-bottom: 0; }
.l1-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: 0;
  text-align: left;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.l1-head:hover { background: var(--wash-2); }
.l1-head .cnt { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-weight: 500; }
.l1-head .note { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.l1-head .tw { margin-left: auto; transition: transform .18s ease; color: var(--ink-3); }
.l1-group.open .l1-head .tw { transform: rotate(90deg); }
.l1-tables {
  display: none;
  padding: 4px 20px 16px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 6px 24px;
}
.l1-group.open .l1-tables { display: grid; }
.l1-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  padding: 5px 8px;
  border-radius: var(--r-sm);
  min-width: 0;
}
.l1-row:hover { background: var(--wash-2); }
.l1-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.l1-row .c { margin-left: auto; color: var(--ink-3); font-size: 10.5px; white-space: nowrap; flex: 0 0 auto; }

/* ---------- Filter/search bar ---------- */

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--hairline);
  background: #fff;
  border-radius: var(--r-sm);
  padding: 8px 12px;
  min-width: 260px;
  flex: 0 1 320px;
}
.search svg { width: 14px; height: 14px; color: var(--ink-3); flex: 0 0 auto; }
.search input { border: 0; outline: 0; font-size: 13px; width: 100%; background: transparent; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }
.search:focus-within { border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(30,101,217,.10); }

.seg { display: inline-flex; border: 1px solid var(--hairline); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.seg button {
  border: 0;
  background: none;
  padding: 8px 15px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
}
.seg button + button { border-left: 1px solid var(--hairline-soft); }
.seg button.active { background: var(--navy); color: #fff; }

.seg-dark { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.06); }
.seg-dark button { color: #B9C6E2; }
.seg-dark button + button { border-left-color: rgba(255,255,255,.12); }
.seg-dark button.active { background: #fff; color: var(--navy); }

/* ---------- Layer strip (Overview) ---------- */

.layerstrip {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}
.layercard {
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  background: #fff;
  padding: 18px 20px 16px;
  position: relative;
  overflow: hidden;
}
.layercard.live { border-color: rgba(44,219,161,.45); background: linear-gradient(180deg, rgba(44,219,161,.05), #fff 55%); }
.layercard .lc-top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.layercard .lc-id {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-3);
}
.layercard.live .lc-id { color: var(--mint-deep); }
.layercard h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; }
.layercard p { font-size: 12.5px; color: var(--ink-2); }
.layercard .lc-meta { margin-top: 12px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); display: flex; gap: 14px; font-variant-numeric: tabular-nums; }

/* ---------- Snippet block ---------- */

.snippet {
  background: var(--navy);
  color: #DCE6FA;
  border-radius: var(--r-md);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  padding: 16px 18px;
  position: relative;
  overflow-x: auto;
  white-space: pre;
}
.snippet .cm { color: #7C90BE; }
.snippet .hl { color: var(--sky); }
.snippet .mint { color: var(--mint); }
.snippet-copy {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: #C4D0EA;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  font-family: var(--sans);
}
.snippet-copy:hover { background: rgba(255,255,255,.16); color: #fff; }

/* ---------- Drawer ---------- */

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(21,38,76,.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  z-index: 90;
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 94vw);
  background: #fff;
  z-index: 100;
  transform: translateX(103%);
  transition: transform .28s cubic-bezier(.2,.75,.25,1);
  box-shadow: -18px 0 50px rgba(21,38,76,.14);
  display: flex;
  flex-direction: column;
}
body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer { transform: translateX(0); }

.drawer-head {
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--hairline-soft);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.drawer-head h3 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.drawer-head .d-asset { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.drawer-close {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--ink-3);
  padding: 4px;
  border-radius: var(--r-sm);
}
.drawer-close:hover { color: var(--ink); background: var(--wash); }
.drawer-body { overflow-y: auto; padding: 20px 26px 40px; }

.d-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin-bottom: 20px; }
.d-meta .dm { font-size: 12px; color: var(--ink-3); }
.d-meta .dm b { display: block; color: var(--ink); font-size: 13px; font-weight: 600; margin-top: 1px; font-variant-numeric: tabular-nums; }

.d-sec { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 22px 0 10px; }

.fieldrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline-soft);
  font-family: var(--mono);
  font-size: 12px;
}
.fieldrow:last-child { border-bottom: 0; }
.fieldrow .ft {
  margin-left: auto;
  font-size: 10px;
  color: var(--blue);
  background: rgba(30,101,217,.08);
  padding: 1px 8px;
  border-radius: 99px;
  letter-spacing: .04em;
}

.sample-tbl { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11.5px; }
.sample-tbl th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-3);
  border-bottom: 1px solid var(--hairline);
  padding: 6px 10px 6px 0;
  white-space: nowrap;
}
.sample-tbl td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--hairline-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sample-wrap { overflow-x: auto; }

/* ---------- Skills ---------- */

.plugin-hero {
  display: grid;
  grid-template-columns: minmax(300px, 1.1fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: center;
  padding: 26px 28px;
  margin-bottom: 30px;
  background: var(--navy);
  border-radius: var(--r-lg);
  color: #fff;
}
.plugin-hero h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; }
.plugin-hero p { color: #B9C6E2; font-size: 13px; margin-top: 8px; max-width: 46ch; }
.plugin-hero .snippet { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}
.skill {
  border: 1px solid var(--hairline-soft);
  background: #fff;
  border-radius: var(--r-lg);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skill .s-top { display: flex; align-items: center; gap: 10px; }
.skill h3 { font-size: 14px; font-weight: 700; }
.skill p { font-size: 12.5px; color: var(--ink-2); flex: 1; }
.skill .s-foot { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.skill.soon { background: var(--wash-2); }
.skill.soon h3 { color: var(--ink-2); }

/* ---------- Toggle ---------- */

.toggle {
  margin-left: auto;
  width: 34px; height: 20px;
  border-radius: 99px;
  border: 0;
  background: #C7D2E8;
  position: relative;
  transition: background .18s ease;
  flex: 0 0 auto;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2.5px; left: 3px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
  box-shadow: 0 1px 2px rgba(21,38,76,.25);
}
.toggle.on { background: var(--mint-deep); }
.toggle.on::after { transform: translateX(13px); }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.field input, .field select {
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(30,101,217,.10); }
.field .hint { font-size: 11.5px; color: var(--ink-3); }

.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill {
  border: 1px solid var(--hairline);
  background: #fff;
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.radio-pill.active { border-color: var(--blue); color: var(--blue); background: rgba(30,101,217,.07); }

/* ---------- Connect stepper ---------- */

.steps { display: flex; gap: 0; margin-bottom: 22px; }
.step { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.step .n {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--hairline);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: #fff;
}
.step.done .n { background: var(--mint-deep); border-color: var(--mint-deep); color: #fff; }
.step.now { color: var(--ink); }
.step.now .n { border-color: var(--blue); color: var(--blue); }
.step-sep { flex: 0 0 34px; height: 1.5px; background: var(--hairline); margin: 0 10px; align-self: center; }

.amazon-mock {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 22px;
  background: #fff;
  text-align: center;
}
.amazon-mock .az { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.amazon-mock .az i { color: var(--orange); font-style: normal; }
.amazon-mock p { font-size: 12.5px; color: var(--ink-2); margin: 8px auto 14px; max-width: 40ch; }

/* ---------- Token reveal ---------- */

.token-reveal {
  border: 1px solid rgba(44,219,161,.5);
  background: linear-gradient(180deg, rgba(44,219,161,.07), #fff 70%);
  border-radius: var(--r-md);
  padding: 20px;
}
.token-reveal .tr-label { font-size: 12px; font-weight: 700; color: var(--mint-deep); display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.token-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  background: var(--navy);
  color: var(--mint);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  overflow-x: auto;
  white-space: nowrap;
}
.token-box button { margin-left: auto; flex: 0 0 auto; }
.token-warn { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 12px; color: #B36200; font-weight: 500; }

/* ---------- Limits strip ---------- */

.limits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #fff;
  margin-bottom: 26px;
}
.limit { padding: 14px 18px; }
.limit + .limit { border-left: 1px solid var(--hairline-soft); }
.limit .lv { font-family: var(--mono); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.limit .lk { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-top: 2px; }

/* ---------- Status dots in tables ---------- */

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }

/* ---------- Empty / helper ---------- */

.helper-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--wash);
  border-radius: var(--r-md);
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 18px;
}
.helper-note svg { flex: 0 0 auto; width: 15px; height: 15px; color: var(--blue); margin-top: 1px; }

/* ---------- Roles legend ---------- */

.roles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.role-card { border: 1px solid var(--hairline-soft); border-radius: var(--r-md); background: #fff; padding: 14px 16px; }
.role-card b { font-size: 13px; display: block; margin-bottom: 3px; }
.role-card span { font-size: 12px; color: var(--ink-3); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 16px);
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 99px;
  padding: 10px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- View transitions ---------- */

.view { display: none; animation: view-in .3s cubic-bezier(.2,.7,.3,1); }
.view.active { display: block; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .entity { grid-template-columns: minmax(200px, 1.3fr) 120px 80px; }
  .entity .e-desc, .entity .e-domain { display: none; }
  .plugin-hero { grid-template-columns: 1fr; }
  .layerstrip { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .rail {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding-right: 12px;
  }
  .rail-brand { padding: 14px 16px; flex: 0 0 auto; }
  .rail-brand .word small { display: none; }
  .rail-nav { flex-direction: row; padding: 0 8px; gap: 2px; }
  .rail-section, .rail-foot { display: none; }
  .nav-item { padding: 8px 10px; font-size: 12.5px; white-space: nowrap; }
  .nav-item svg { display: none; }
  .nav-item .nav-badge { display: none; }
  .topbar { padding: 12px 18px; }
  .crumb { display: none; }
  .content { padding: 22px 18px 60px; }
  .head-row { flex-direction: column; }
  .head-actions { margin-left: 0; }
  .statband { grid-template-columns: 1fr 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--hairline-soft); }
  .stat:nth-child(2) { border-top: 0; border-left: 1px solid var(--hairline-soft); }
  .d-meta { grid-template-columns: 1fr; }
  .entity { grid-template-columns: 1fr 110px; gap: 10px; }
  .entity .e-cols { display: none; }
  .limits { grid-template-columns: 1fr 1fr; }
  .limit + .limit { border-left: 0; border-top: 1px solid var(--hairline-soft); }
  .limit:nth-child(even) { border-left: 1px solid var(--hairline-soft); }

  .tbl--freshness th:nth-child(2), .tbl--freshness td:nth-child(2),
  .tbl--freshness th:nth-child(5), .tbl--freshness td:nth-child(5) { display: none; }
  .tbl--activity th:nth-child(2), .tbl--activity td:nth-child(2),
  .tbl--activity th:nth-child(6), .tbl--activity td:nth-child(6) { display: none; }
}

/* account switcher menu */
.acct-menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 230px; background: #fff; border: 1px solid var(--hairline); border-radius: 10px; box-shadow: 0 10px 30px rgba(13, 27, 62, .14); padding: 6px; max-height: 320px; overflow-y: auto; }
.acct-menu.open { display: block; }
.acct-opt { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.acct-opt:hover { background: #eef2fa; }
.acct-opt.sel { color: var(--blue); font-weight: 700; }
