:root {
  color-scheme: dark;
  --bg: #101214;
  --bg-2: #171a1d;
  --surface: #1f2327;
  --surface-2: #272c30;
  --line: #343b40;
  --line-strong: #4b555b;
  --text: #f3f0e8;
  --muted: #a9b0ad;
  --faint: #737d7a;
  --gold: #d7b46a;
  --green: #5fc49b;
  --teal: #63b8c8;
  --red: #d66a5f;
  --ink: #101214;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(215, 180, 106, 0.12), transparent 26rem),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 42px 42px, 42px 42px, auto;
  font-family: "Aptos", "Segoe UI", sans-serif;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  transform: translateY(-160%);
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--gold);
}

.skip-link:focus {
  transform: translateY(0);
}

.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(16, 18, 20, 0.88);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand,
.rail nav a {
  color: var(--text);
  text-decoration: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(215, 180, 106, 0.52);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 34%),
    radial-gradient(circle at 70% 20%, rgba(95, 196, 155, 0.52), transparent 34%),
    linear-gradient(135deg, #f4d88c, #d7b46a 58%, #9f7629);
  box-shadow: 0 14px 34px rgba(215, 180, 106, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.brand-mark svg {
  width: 34px;
  height: 34px;
  overflow: visible;
}

.logo-ring {
  fill: rgba(16, 18, 20, 0.08);
  stroke: rgba(16, 18, 20, 0.82);
  stroke-width: 3;
  stroke-linejoin: round;
}

.logo-route {
  fill: none;
  stroke: rgba(16, 18, 20, 0.86);
  stroke-width: 3.2;
  stroke-linecap: round;
}

.logo-node {
  fill: #101214;
}

.logo-pin {
  fill: #f3f0e8;
  stroke: #101214;
  stroke-width: 1.4;
}

.brand span:last-child {
  display: grid;
  gap: 2px;
}

.brand small,
small,
.eyebrow,
article span,
th {
  color: var(--muted);
}

.rail nav {
  display: grid;
  gap: 7px;
}

.rail nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.rail nav a.active,
.rail nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.rail-meter {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.rail-meter strong {
  font-size: 2rem;
}

.meter,
.health {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #111416;
}

.meter span,
.health span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  min-height: 170px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 22px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 950;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  letter-spacing: 0;
}

h1 {
  max-width: 840px;
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 3.15vw, 3.65rem);
  line-height: 1.06;
}

h2 {
  margin-bottom: 0;
  font-size: 1.4rem;
  line-height: 1.1;
}

h3 {
  margin-bottom: 0;
}

.topbar-actions,
.section-head,
menu {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-actions {
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
}

.action-cluster {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cluster-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.11);
}

.language-switch {
  width: auto;
  min-height: 38px;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 0 5px 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
  font-size: 0.82rem;
}

.language-switch span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.vertical-switch {
  width: max-content;
  min-height: 42px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    rgba(16, 20, 22, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.topbar-mode {
  margin-top: 18px;
}

.vertical-switch button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.vertical-switch button.active {
  color: var(--ink);
  background: linear-gradient(135deg, #f1d58b, var(--gold) 58%, #b98b34);
  box-shadow: 0 8px 22px rgba(215, 180, 106, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.vertical-switch button:not(.active):hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.language-switch select {
  width: 58px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
}

.topbar-actions,
.section-head {
  justify-content: space-between;
}

.primary,
.ghost,
.icon-button {
  min-height: 38px;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.primary {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0 16px;
  color: var(--ink);
  background:
    linear-gradient(135deg, #f7dc91 0%, var(--gold) 54%, #b6852f 100%);
  box-shadow: 0 12px 30px rgba(215, 180, 106, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.52);
  overflow: hidden;
}

.primary::after {
  content: "";
  position: absolute;
  inset: 1px auto 1px 12%;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.32), transparent);
  opacity: 0.55;
  pointer-events: none;
}

.primary:hover,
.ghost:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary:hover {
  box-shadow: 0 16px 36px rgba(215, 180, 106, 0.29), inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.primary:active,
.ghost:active,
.mini-button:active,
.vertical-switch button:active {
  transform: translateY(0) scale(0.98);
}

.primary.compact {
  min-height: 40px;
}

.ghost {
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0 13px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025)),
    rgba(16, 20, 22, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ghost:hover {
  border-color: rgba(215, 180, 106, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04)),
    rgba(16, 20, 22, 0.82);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.icon-button {
  width: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  font-size: 1.5rem;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 16px;
}

.mission-panel,
.onboarding,
.panel,
.rules,
dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(31, 35, 39, 0.92);
  box-shadow: var(--shadow);
}

.mission-panel {
  min-height: 390px;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(280px, 0.72fr);
  gap: 18px;
  align-items: center;
}

.mission-copy p:last-child {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.65;
}

.ops-map {
  position: relative;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(95, 196, 155, 0.15), transparent 52%),
    linear-gradient(160deg, rgba(215, 180, 106, 0.12), transparent 44%),
    #141719;
  overflow: hidden;
}

.ops-map::before {
  content: "";
  position: absolute;
  inset: -35%;
  background:
    repeating-linear-gradient(90deg, transparent 0 30px, rgba(255, 255, 255, 0.05) 30px 31px),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(255, 255, 255, 0.035) 30px 31px);
  transform: rotate(-12deg);
}

.ops-header,
.flow-lanes,
.signal-strip {
  position: relative;
  z-index: 1;
}

.ops-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.ops-header strong {
  color: var(--green);
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}

.flow-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px;
}

.lane {
  min-height: 176px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(16, 20, 22, 0.72);
  display: grid;
  align-content: start;
  gap: 10px;
}

.lane strong {
  padding: 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.spine {
  border-color: rgba(215, 180, 106, 0.5);
  background: rgba(215, 180, 106, 0.08);
}

.spine strong {
  color: var(--ink);
  background: var(--gold);
}

.signal-strip {
  margin: 16px;
  display: grid;
  gap: 7px;
}

.signal-strip span {
  width: var(--w);
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--green), var(--gold));
  animation: signalPulse 2.6s ease-in-out infinite;
}

@keyframes signalPulse {
  0%,
  100% {
    opacity: 0.52;
    transform: scaleX(0.94);
    transform-origin: left;
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

.onboarding,
.panel,
.rules {
  padding: 18px;
  min-width: 0;
}

.steps {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.steps li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171b1e;
}

.steps li > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  background: var(--surface-2);
  font-weight: 950;
}

.steps li.done > span,
.steps li.active > span {
  color: var(--ink);
  background: var(--green);
}

.steps li.active {
  border-color: rgba(215, 180, 106, 0.65);
}

.metrics,
.channel-grid,
.rule-grid,
.plan-grid {
  display: grid;
  gap: 14px;
}

.billing-panel {
  max-width: 100%;
  min-width: 0;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(95, 196, 155, 0.09), transparent 40%),
    rgba(31, 35, 39, 0.92);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(240px, 0.58fr) minmax(0, 1.42fr);
  gap: 16px;
}

.billing-copy p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.billing-copy,
.plan-grid,
.plan-card {
  min-width: 0;
  max-width: 100%;
}

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

.plan-card {
  width: 100%;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15191c;
  display: grid;
  gap: 12px;
  align-content: start;
}

.plan-card.featured {
  border-color: rgba(215, 180, 106, 0.68);
  background:
    linear-gradient(160deg, rgba(215, 180, 106, 0.13), transparent 46%),
    #171b1e;
}

.plan-card > span {
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(95, 196, 155, 0.1);
  font-size: 0.74rem;
  font-weight: 950;
}

.plan-card h3 {
  font-size: 1.2rem;
}

.plan-card strong {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 2rem;
  color: var(--text);
}

.plan-card strong small {
  font-size: 0.86rem;
}

.plan-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.plan-card ul {
  min-height: 84px;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.7;
}

.plan-card button {
  width: 100%;
}

.payment-note {
  display: grid;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 16px 0;
}

.metrics article,
.rule-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(39, 44, 48, 0.9);
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 2.1rem;
  font-variant-numeric: tabular-nums;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 16px;
}

.channel-panel,
.table-panel {
  grid-column: span 2;
}

.channel-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.channel-card,
.store-card,
.order-item,
.empty-state {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171b1e;
}

.channel-card {
  padding: 14px;
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.channel-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--green);
}

.channel-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-button {
  min-height: 36px;
  border: 1px solid rgba(95, 196, 155, 0.32);
  border-radius: 999px;
  padding: 0 12px;
  color: #dff8ec;
  background:
    linear-gradient(180deg, rgba(95, 196, 155, 0.16), rgba(95, 196, 155, 0.06)),
    rgba(16, 20, 22, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  font-weight: 900;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.mini-button:hover {
  border-color: rgba(95, 196, 155, 0.58);
  background:
    linear-gradient(180deg, rgba(95, 196, 155, 0.22), rgba(95, 196, 155, 0.08)),
    rgba(16, 20, 22, 0.92);
  box-shadow: 0 10px 24px rgba(95, 196, 155, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.status,
.tag,
.pill {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 950;
}

.status {
  padding: 5px 8px;
  color: var(--ink);
  background: var(--green);
}

.status.ready {
  color: var(--text);
  background: var(--surface-2);
}

.status.attention,
.status.token {
  color: var(--ink);
  background: var(--gold);
}

.tag,
.pill {
  padding: 6px 9px;
  color: var(--text);
  background: var(--surface-2);
}

.store-list,
.order-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.store-card,
.order-item,
.empty-state {
  padding: 13px;
}

.empty-state {
  min-height: 188px;
  display: grid;
  align-content: center;
  gap: 10px;
  border-style: dashed;
  background:
    linear-gradient(135deg, rgba(95, 196, 155, 0.08), transparent 54%),
    #15191c;
}

.empty-state p {
  max-width: 480px;
  margin-bottom: 4px;
  color: var(--muted);
  line-height: 1.55;
}

.empty-icon {
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(95, 196, 155, 0.11);
  font-size: 0.76rem;
  font-weight: 950;
}

.store-card header,
.order-item strong {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.store-card p,
.order-item p {
  margin: 8px 0 0;
  color: var(--muted);
}

.scope-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.scope-list span {
  padding: 5px 7px;
  border-radius: 999px;
  background: #101416;
  font-size: 0.72rem;
}

.table-wrap {
  max-width: 100%;
  margin-top: 16px;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

td {
  color: #e8e6df;
}

.table-empty {
  min-height: 150px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
  color: var(--text);
}

.table-empty span {
  max-width: 560px;
  color: var(--muted);
  white-space: normal;
  line-height: 1.55;
}

td strong {
  display: block;
}

.sku-cell {
  display: grid;
  gap: 8px;
}

.trend-bars {
  display: grid;
  gap: 4px;
  width: 132px;
}

.trend-bars span {
  width: var(--w);
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.stock-gauge {
  min-width: 92px;
  display: grid;
  gap: 6px;
}

.stock-gauge span {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #111416;
  overflow: hidden;
}

.stock-gauge span::before {
  content: "";
  display: block;
  width: var(--stock);
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
}

.pill.Margin {
  color: var(--ink);
  background: var(--gold);
}

.pill.Restock {
  color: #fff;
  background: var(--red);
}

.scrape-form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 850;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #111416;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(16, 18, 20, 0.95), 0 0 0 6px rgba(215, 180, 106, 0.72);
}

.scrape-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  color: var(--text);
  background: #101416;
  display: grid;
  gap: 7px;
}

.rules {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(0, 1.38fr);
  gap: 18px;
}

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

.rule-grid strong {
  display: block;
  margin-top: 8px;
}

dialog {
  width: min(560px, calc(100vw - 28px));
  padding: 20px;
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.scope-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111416;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.scope-box strong {
  flex-basis: 100%;
}

.scope-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.scope-items span {
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--surface-2);
}

.auth-notice,
.auth-result {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111416;
}

.auth-notice {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
}

.auth-notice p,
.auth-result p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.48;
}

.auth-shield {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--green);
  font-weight: 950;
}

.auth-result {
  border-color: rgba(215, 180, 106, 0.58);
  background: rgba(215, 180, 106, 0.08);
}

.auth-result ul {
  margin: 10px 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.55;
}

.auth-result small {
  color: var(--gold);
  font-weight: 900;
}

.hidden {
  display: none !important;
}

menu {
  justify-content: flex-end;
  padding: 0;
  margin: 18px 0 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: 380px;
  padding: 13px 15px;
  border: 1px solid rgba(215, 180, 106, 0.5);
  border-radius: 8px;
  color: var(--ink);
  background: var(--gold);
  box-shadow: var(--shadow);
  transform: translateY(24px);
  opacity: 0;
  transition: 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.setup-drawer {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 42;
  width: min(380px, calc(100vw - 28px));
  max-height: calc(100dvh - 36px);
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(31, 35, 39, 0.96);
  box-shadow: var(--shadow);
  overflow: auto;
  transform: translateX(calc(100% + 28px));
  opacity: 0;
  transition: transform 260ms ease, opacity 180ms ease;
}

.setup-drawer.open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

.setup-drawer:not(.open) {
  visibility: hidden;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.drawer-progress {
  margin: 16px 0;
  display: grid;
  gap: 8px;
}

.checklist {
  display: grid;
  gap: 10px;
}

.check-item {
  width: 100%;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: #15191c;
  text-align: left;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
}

.check-item:hover,
.check-item.active {
  border-color: rgba(215, 180, 106, 0.7);
  background: #1d2225;
}

.check-dot {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
}

.check-item.done .check-dot {
  background: var(--green);
}

.coachmark {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), transparent 0 120px, rgba(0, 0, 0, 0.72) 121px);
}

.coachmark.hidden {
  display: none;
}

.coachmark-ring {
  position: fixed;
  z-index: 41;
  border: 2px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 0 0 4px rgba(215, 180, 106, 0.18), 0 0 32px rgba(215, 180, 106, 0.36);
  pointer-events: none;
}

.coachmark-box {
  position: fixed;
  z-index: 42;
  width: min(360px, calc(100vw - 28px));
  padding: 15px;
  border: 1px solid rgba(215, 180, 106, 0.58);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.coachmark-box span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.coachmark-box p {
  color: var(--muted);
  line-height: 1.5;
}

.coachmark-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (max-width: 1400px) {
  .topbar {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 1180px) {
  body {
    display: block;
  }

  .rail {
    position: static;
    height: auto;
  }

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

  .command-grid,
  .workspace,
  .rules,
  .mission-panel,
  .billing-panel {
    grid-template-columns: 1fr;
  }

  .channel-panel,
  .table-panel {
    grid-column: span 1;
  }

  .channel-grid,
  .plan-grid,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  main {
    padding: 14px;
  }

  h1 {
    font-size: 1.36rem;
    line-height: 1.16;
  }

  .rail {
    padding: 12px 14px;
    gap: 12px;
  }

  .channel-grid,
  .plan-grid,
  .metrics,
  .rule-grid {
    grid-template-columns: 1fr;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

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

  .rail nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .rail nav::-webkit-scrollbar {
    display: none;
  }

  .rail nav a {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 11px;
    font-size: 0.88rem;
  }

  .rail-meter {
    padding: 10px 12px;
    gap: 6px;
  }

  .rail-meter strong {
    font-size: 1.62rem;
  }

  .rail-meter small {
    line-height: 1.35;
  }

  .topbar-actions,
  .hero-actions,
  .scrape-form button {
    width: 100%;
  }

  .action-cluster {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .topbar-actions button,
  .language-switch {
    width: 100%;
    min-height: 42px;
    justify-content: center;
    border-radius: 12px;
  }

  .language-switch select {
    width: 100%;
    min-height: 34px;
    text-align: center;
  }

  .topbar-mode {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .cluster-divider {
    display: none;
  }

  .language-switch {
    justify-content: space-between;
  }

  .mission-panel,
  .onboarding,
  .panel,
  .billing-panel,
  .rules {
    padding: 14px;
  }

  .plan-card ul {
    min-height: auto;
  }

  .mission-panel {
    min-height: auto;
  }

  .ops-map {
    min-height: auto;
    overflow: visible;
  }

  .flow-lanes {
    grid-template-columns: 1fr;
    padding: 0 12px 12px;
  }

  .ops-header {
    padding: 12px;
  }

  .ops-header strong {
    font-size: 1.45rem;
  }

  .lane {
    min-height: auto;
    padding: 10px;
    gap: 7px;
  }

  .lane strong {
    padding: 8px;
  }

  .signal-strip {
    display: none;
  }
}
