:root {
  color-scheme: dark;
  --bg: #0b0e13;
  --bg-raise: #0f131a;
  --panel: #11161e;
  --panel-2: #141a23;
  --line: #1d242f;
  --line-bright: #2a3340;
  --ink: #eef2f7;
  --ink-soft: #bac4d1;
  --muted: #76828f;
  --faint: #4d5765;
  --amber: #ffb224;
  --amber-deep: #d98f0a;
  --amber-glow: rgba(255, 178, 36, 0.12);
  --live: #34d99b;
  --live-soft: rgba(52, 217, 155, 0.11);
  --danger: #ff6e61;
  --danger-soft: rgba(255, 110, 97, 0.11);
  --info: #6aa6ff;
  --info-soft: rgba(106, 166, 255, 0.11);
  --display: "Bricolage Grotesque", sans-serif;
  --body: "Hanken Grotesk", sans-serif;
  --mono: "Spline Sans Mono", monospace;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(1100px 500px at 28% -8%, rgba(255, 178, 36, 0.045), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(26px, 2.6vw, 33px);
  font-weight: 650;
  line-height: 1.08;
}

h2 {
  font-size: 18px;
  font-weight: 650;
}

h3 {
  font-size: 15px;
  font-weight: 650;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--amber);
  color: #181104;
  cursor: pointer;
  padding: 9px 16px;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

button:not(:disabled):hover {
  background: #ffc14a;
}

button.secondary {
  background: var(--panel);
  color: var(--ink-soft);
  border: 1px solid var(--line-bright);
  box-shadow: none;
}

button.secondary:not(:disabled):hover {
  background: var(--panel);
  border-color: var(--faint);
  color: var(--ink);
}

button.danger {
  background: var(--danger);
  color: #1c0b09;
}

button.compact {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12.5px;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: var(--bg-raise);
  color: var(--ink);
  padding: 9px 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.55;
  font-family: var(--mono);
  font-size: 12.5px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--faint);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 178, 36, 0.5);
  box-shadow: 0 0 0 3px var(--amber-glow);
  outline: none;
}

select {
  cursor: pointer;
}

select option {
  background: var(--panel);
  color: var(--ink);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #10151c;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13.5px;
  text-align: left;
  vertical-align: top;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.018);
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- shell ---------- */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(13, 17, 23, 0.6);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px;
  margin-bottom: 30px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(165deg, #ffc14a, var(--amber));
  color: #181104;
  flex: none;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand-name {
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-name small {
  display: block;
  font-family: var(--body);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 2px;
}

.nav-label {
  padding: 0 12px;
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--faint);
  text-transform: uppercase;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  text-align: left;
  transition: color 140ms ease, background 140ms ease;
}

.nav button svg {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.85;
}

.nav button:not(:disabled):hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
}

.nav button.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--line-bright);
}

.nav button.active svg {
  color: var(--amber);
  opacity: 1;
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  min-width: 0;
}

.user-chip .avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 99px;
  background: #1c2530;
  border: 1px solid var(--line-bright);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.user-chip > div {
  min-width: 0;
}

.user-chip b {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip small {
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------- content ---------- */
.content {
  min-width: 0;
  padding: 34px 38px 60px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 26px;
}

.subtitle {
  margin: 7px 0 0;
  font-size: 14.5px;
  color: var(--muted);
}

.subtitle b {
  color: var(--ink-soft);
  font-weight: 600;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.toolbar > * {
  width: auto;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel,
.card {
  background: linear-gradient(170deg, var(--panel-2), var(--panel) 75%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.card {
  padding: 18px;
}

/* ---------- stats ---------- */
.stat {
  position: relative;
  overflow: hidden;
  padding: 19px 20px 17px;
  transition: border-color 160ms ease;
}

.stat:hover {
  border-color: var(--line-bright);
}

.stat .label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat .value {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- section heads / launch queue ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 0 14px;
}

.section-head .link {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 140ms ease;
}

.section-head .link:hover {
  color: var(--amber);
}

.launch-queue {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.launch-card {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, var(--panel-2), var(--panel) 75%);
  box-shadow: var(--shadow);
  transition: border-color 160ms ease;
}

.launch-card:hover {
  border-color: var(--line-bright);
}

.launch-card.imminent {
  border-color: rgba(255, 178, 36, 0.28);
}

.next-pill {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--amber-glow);
  border: 1px solid rgba(255, 178, 36, 0.3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--amber);
}

.launch-top {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 18px;
}

.launch-thumb {
  width: 50px;
  height: 50px;
  flex: none;
  overflow: hidden;
  border-radius: 11px;
  border: 1px solid var(--line-bright);
  background: #161e28;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.launch-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.launch-top b {
  display: block;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.launch-top .sku {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.countdown {
  display: flex;
  gap: 18px;
  margin-bottom: 17px;
}

.cd-unit b {
  display: block;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.launch-card.imminent .cd-unit b {
  color: var(--amber);
}

.cd-unit span {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.launch-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.market-stack {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.mpill {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid var(--line-bright);
  background: var(--bg-raise);
  color: var(--ink-soft);
}

.subs-count {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.subs-count b {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- products ---------- */
.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.product-header h2 {
  margin: 0 0 5px;
  font-size: 22px;
}

.product-header p {
  margin: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 16px;
  background: linear-gradient(170deg, var(--panel-2), var(--panel) 75%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-field {
  grid-column: span 2;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.list-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.list-meta label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.list-meta select {
  width: 94px;
}

.table-panel {
  padding: 0;
  overflow: auto;
}

.table-wrap {
  max-height: calc(100vh - 340px);
  min-height: 320px;
  overflow: auto;
}

.products-table {
  min-width: 1040px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-actions select {
  min-width: 138px;
}

.log-table {
  min-width: 980px;
}

.log-table code {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
}

.log-details {
  min-width: 210px;
}

.log-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 650;
  user-select: none;
}

.log-details[open] summary {
  margin-bottom: 10px;
  color: var(--ink);
}

.log-details dl {
  display: grid;
  gap: 7px;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.log-details dl div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
}

.log-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.log-details dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.log-details pre {
  max-width: min(680px, 72vw);
  max-height: 320px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-raise);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.product-cell {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 280px;
}

.product-cell strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: -0.01em;
}

.product-cell small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
}

.product-thumb {
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: #161e28;
}

.product-thumb:empty::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #161e28, #1c2530);
}

.product-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.switch-lines,
.date-line {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.date-line {
  grid-template-columns: 34px minmax(0, 1fr);
  margin-top: 0;
  font-family: var(--mono);
  font-size: 11.5px;
}

.date-line strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.market-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 6px 6px 0;
  padding: 3px 9px;
  border: 1px solid var(--line-bright);
  border-radius: 7px;
  background: var(--bg-raise);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.market-pill small {
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  background: rgba(11, 14, 19, 0.45);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.empty-state {
  padding: 34px;
  color: var(--muted);
  text-align: center;
  font-weight: 500;
}

/* ---------- forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.market-editor {
  display: grid;
  gap: 14px;
}

.market-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, var(--panel-2), var(--panel) 75%);
  box-shadow: var(--shadow);
}

.market-row h3 {
  grid-column: 1 / -1;
  margin: 0;
}

/* ---------- login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(255, 178, 36, 0.06), transparent 60%),
    var(--bg);
}

.login form {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(170deg, var(--panel-2), var(--panel) 75%);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
}

.login h1 {
  font-size: 22px;
}

.login-sub {
  margin: -6px 0 6px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- badges / messages ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: currentColor;
}

.badge.ok {
  background: var(--live-soft);
  color: var(--live);
}

.badge.warn {
  background: var(--amber-glow);
  color: var(--amber);
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.message {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.toast-stack {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid rgba(52, 217, 155, 0.34);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 90%, var(--live) 10%);
  color: var(--ink);
  box-shadow: var(--shadow);
  pointer-events: auto;
  transform: translateY(-8px);
  opacity: 0;
  animation: toast-in 180ms ease-out forwards;
}

.toast.error {
  border-color: rgba(255, 110, 97, 0.38);
  background: color-mix(in srgb, var(--panel) 90%, var(--danger) 10%);
}

.toast.leaving {
  animation: toast-out 180ms ease-in forwards;
}

.toast-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--live);
  box-shadow: 0 0 0 5px var(--live-soft);
}

.toast.error .toast-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px var(--danger-soft);
}

.toast span:nth-child(2) {
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 650;
}

.toast button {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-soft);
  box-shadow: none;
}

.toast button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.hidden {
  display: none;
}

/* ---------- interaction and shared states ---------- */
.menu-toggle {
  display: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

button.is-loading {
  position: relative;
  color: transparent !important;
}

button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 15px;
  height: 15px;
  margin: auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: var(--ink-soft);
  animation: spin 0.65s linear infinite;
}

.loading-state {
  min-height: 320px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--line-bright);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.load-error {
  min-height: 320px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.load-error p {
  max-width: 480px;
  margin: 0 0 8px;
  color: var(--muted);
}

.load-error-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- dashboard actions ---------- */
.stat-note {
  margin-top: 8px;
  color: var(--faint);
  font-size: 11.5px;
}

.status-callout {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 110, 97, 0.25);
  background: var(--danger-soft);
  color: var(--ink);
  box-shadow: none;
  text-align: left;
}

.status-callout:not(:disabled):hover {
  border-color: rgba(255, 110, 97, 0.45);
  background: rgba(255, 110, 97, 0.14);
}

.status-callout b,
.status-callout small {
  display: block;
}

.status-callout small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 500;
}

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

button.action-card {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line-bright);
  background: var(--bg-raise);
  color: var(--ink);
  box-shadow: none;
  text-align: left;
}

button.action-card:not(:disabled):hover {
  border-color: rgba(255, 178, 36, 0.4);
  background: var(--panel-2);
}

.action-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--amber-glow);
  color: var(--amber);
  font-size: 19px;
}

.action-card b,
.action-card small {
  display: block;
}

.action-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

/* ---------- page sections ---------- */
.page-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}

.page-intro h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

.page-intro p {
  margin-top: 0;
  margin-bottom: 0;
}

.split-intro {
  align-items: flex-end;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading .eyebrow,
.editor-section-head .eyebrow {
  margin-bottom: 4px;
}

.section-description {
  max-width: 820px;
  margin: -7px 0 15px;
  color: var(--muted);
  font-size: 13px;
}

.field-help {
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 500;
}

.primary-cell {
  color: var(--ink);
}

.code-pill {
  display: inline-flex;
  padding: 3px 8px;
  border: 1px solid var(--line-bright);
  border-radius: 7px;
  background: var(--bg-raise);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 650;
}

.compact-filters {
  grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
}

.log-filters {
  grid-template-columns: minmax(260px, 1fr) 180px auto;
}

.subscriptions-table {
  min-width: 900px;
}

.subscriptions-wrap {
  max-height: calc(100vh - 370px);
}

.product-mini {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
}

.product-mini img {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  object-fit: cover;
}

.date-line span small {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-family: var(--body);
  font-size: 10.5px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 260px;
}

.empty-state > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 3px;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  color: var(--faint);
}

.empty-state b {
  color: var(--ink-soft);
  font-size: 14px;
}

.empty-state p {
  max-width: 440px;
  margin: 0;
  font-size: 12.5px;
}

/* ---------- product editor and accordions ---------- */
.product-editor,
.settings-layout {
  display: grid;
  gap: 16px;
}

.editor-bar {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  background: rgba(15, 19, 26, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.editor-actions,
.test-inline,
.save-inline,
.config-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.editor-section-head {
  margin-top: 6px;
  margin-bottom: 14px;
}

.market-editor-section {
  min-width: 0;
}

.market-row,
.template-card,
.config-card {
  display: block;
  padding: 0;
  overflow: hidden;
}

.market-row > summary,
.template-card > summary,
.config-card > summary {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 17px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.market-row > summary::-webkit-details-marker,
.template-card > summary::-webkit-details-marker,
.config-card > summary::-webkit-details-marker {
  display: none;
}

.market-row > summary:hover,
.template-card > summary:hover,
.config-card > summary:hover {
  background: rgba(255, 255, 255, 0.018);
}

.market-row[open] > summary,
.template-card[open] > summary,
.config-card[open] > summary {
  border-bottom: 1px solid var(--line);
}

.market-identity,
.market-state {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.market-identity > b {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  background: var(--bg-raise);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.market-identity strong,
.market-identity small {
  display: block;
}

.market-identity strong {
  color: var(--ink);
  font-size: 14px;
}

.market-identity small,
.market-state > span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.market-state i {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translate(-2px, 2px);
  transition: transform 150ms ease;
}

details[open] > summary .market-state i {
  transform: rotate(225deg) translate(-2px, 2px);
}

.market-row-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  padding: 18px;
}

.wide-field {
  grid-column: span 2;
}

.market-test {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(210px, 0.7fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: rgba(11, 14, 19, 0.38);
}

.market-test b,
.market-test small {
  display: block;
}

.market-test b {
  color: var(--ink-soft);
  font-size: 12.5px;
}

.market-test small {
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------- templates, markets, settings ---------- */
.template-list,
.market-list {
  display: grid;
  gap: 12px;
}

.variable-legend {
  max-width: 620px;
}

.variable-legend > small {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
}

.variable-legend > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.variable-legend code {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-raise);
  color: var(--ink-soft);
  font-size: 10px;
}

.templateForm,
.marketForm {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.template-meta {
  grid-template-columns: minmax(0, 2fr) minmax(180px, 0.5fr);
}

.template-bodies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.template-bodies textarea {
  min-height: 300px;
}

.template-footer,
.config-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.test-inline input {
  min-width: 240px;
}

.marketForm .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-section {
  min-width: 0;
}

.settings-section.panel {
  padding: 20px;
}

.settings-savebar {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  background: rgba(15, 19, 26, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.widget-copy-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  padding: 18px;
}

.widget-copy-fields textarea {
  min-height: 92px;
  font-family: var(--body);
  font-size: 14px;
}

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: rise 0.4s ease-out forwards;
}

.d1 { animation-delay: 0.03s; }
.d2 { animation-delay: 0.07s; }
.d3 { animation-delay: 0.11s; }
.d4 { animation-delay: 0.15s; }
.d5 { animation-delay: 0.19s; }
.d6 { animation-delay: 0.24s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #232d3a;
  border-radius: 99px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-track {
  background: transparent;
}

::selection {
  background: rgba(255, 178, 36, 0.28);
}

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .grid.cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .launch-queue {
    grid-template-columns: 1fr;
  }

  .market-row-fields,
  .marketForm .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    z-index: 3;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(13, 17, 23, 0.92);
  }

  .brand {
    margin-bottom: 0;
    margin-right: auto;
  }

  .menu-toggle {
    display: grid;
    place-content: center;
    gap: 4px;
    width: 42px;
    min-width: 42px;
    padding: 0;
  }

  .menu-toggle span {
    width: 17px;
    height: 1.5px;
    border-radius: 2px;
    background: currentColor;
  }

  .nav {
    display: none;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    order: 3;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .menu-open .nav {
    display: grid;
  }

  .nav-label {
    display: none;
  }

  .nav button span {
    display: block;
  }

  .sidebar-foot {
    display: none;
    order: 4;
    width: 100%;
    margin-top: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .menu-open .sidebar-foot {
    display: grid;
  }

  .content {
    padding: 20px 18px 50px;
  }

  .toast-stack {
    top: 14px;
    right: 14px;
    width: calc(100vw - 28px);
  }

  .topbar,
  .page-intro,
  .product-header,
  .list-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .grid.cols,
  .form-grid,
  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .filter-actions {
    align-items: stretch;
  }

  .filter-actions button {
    flex: 1;
  }

  .row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .row-actions select,
  .row-actions button {
    width: 100%;
  }

  .table-wrap {
    max-height: none;
  }

  .split-intro {
    align-items: stretch;
  }

  .variable-legend {
    max-width: none;
  }

  .variable-legend > div {
    justify-content: flex-start;
  }

  .template-bodies,
  .widget-copy-fields {
    grid-template-columns: 1fr;
  }

  .market-test {
    grid-template-columns: 1fr auto;
  }

  .market-test > div {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .content {
    padding: 18px 12px 42px;
  }

  .topbar {
    margin-bottom: 20px;
  }

  .grid.cols,
  .form-grid,
  .filter-bar,
  .market-row-fields,
  .marketForm .form-grid,
  .template-meta,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .search-field,
  .wide-field {
    grid-column: auto;
  }

  .countdown {
    justify-content: space-between;
    gap: 8px;
  }

  .cd-unit b {
    font-size: 23px;
  }

  .launch-meta,
  .editor-bar,
  .template-footer,
  .settings-savebar {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-bar {
    position: static;
  }

  .editor-actions,
  .editor-actions button,
  .template-footer > *,
  .save-inline,
  .save-inline button,
  .settings-savebar button {
    width: 100%;
  }

  .editor-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .market-row > summary,
  .template-card > summary,
  .config-card > summary {
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
  }

  .market-state > span,
  .market-state .badge {
    display: none;
  }

  .market-row-fields,
  .widget-copy-fields,
  .templateForm,
  .marketForm {
    padding: 14px;
  }

  .market-test {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .market-test > div {
    grid-column: auto;
  }

  .test-inline {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .test-inline input {
    min-width: 0;
  }

  .filter-actions {
    grid-column: 1 / -1;
  }

  .status-callout {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .status-callout > :last-child {
    display: none;
  }
}

@media (max-width: 460px) {
  .brand-name small,
  .user-chip {
    display: none;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .sidebar-foot {
    grid-template-columns: 1fr;
  }

  .sidebar-foot button {
    width: 100%;
  }

  .launch-card {
    padding: 16px;
  }

  .next-pill {
    display: none;
  }

  .pagination {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
