:root {
  color-scheme: light;
  --color-blue: #1769e0;
  --color-blue-hover: #115bc7;
  --color-navy: #10243e;
  --color-navy-2: #18365d;
  --color-green: #168a56;
  --color-green-soft: #eaf7f0;
  --color-steel: #53657d;
  --color-black: #111827;
  --color-white: #ffffff;
  --color-page: #f5f8fc;
  --color-panel: #ffffff;
  --color-line: #d9e2ee;
  --color-muted: #68778b;
  --color-warning: #a65f00;
  --shadow-soft: 0 10px 28px rgba(16, 36, 62, 0.08);
  --shadow-button: 0 2px 5px rgba(16, 36, 62, 0.18);
  --radius-card: 8px;
  --radius-button: 7px;
  --page-max: 1180px;
}

.transit-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.transit-steps article {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: #f7fbff;
}

.transit-steps strong {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--color-blue);
  color: var(--color-white);
  font-size: 14px;
}

.transit-steps span {
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.destination-list {
  min-width: 260px;
}

.destination-list summary {
  cursor: pointer;
  color: var(--color-navy);
  font-weight: 800;
}

.destination-list__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.destination-list__grid span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef5ff;
  color: var(--color-navy);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

@media (max-width: 900px) {
  .transit-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .transit-steps {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--color-page);
  color: var(--color-black);
}

.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--color-navy) 0%, #173b68 58%, #0f4f91 100%);
}

a {
  color: inherit;
}

.app-header {
  background: linear-gradient(135deg, var(--color-navy) 0%, #173b68 62%, #0f4f91 100%);
  color: var(--color-white);
}

.app-header__inner {
  width: min(100%, var(--page-max));
  margin: 0 auto;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto) minmax(260px, 0.9fr);
  align-items: center;
  gap: 18px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand > div:last-child {
  min-width: 0;
}

.brand__mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h2 {
  color: var(--color-navy);
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.brand p,
.section-heading p {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.4;
}

.brand--login p {
  color: var(--color-muted);
}

.section-heading p {
  color: var(--color-muted);
}

.header-side,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-side {
  justify-content: flex-end;
}

.nav-tabs {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.09);
  max-width: 100%;
}

.nav-tab {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 9px 13px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.nav-tab--active {
  background: var(--color-white);
  color: var(--color-navy);
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.14);
}

.sync-card {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.1);
}

.sync-card span,
.sync-card strong {
  display: block;
  line-height: 1.25;
}

.sync-card span {
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 700;
}

.sync-card strong {
  color: var(--color-white);
  font-size: 13px;
}

.sync-card .button {
  min-height: 34px;
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
}

.button--logout {
  min-width: 74px;
}

.inline-form {
  margin: 0;
}

.button {
  min-height: 40px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-button);
  padding: 10px 14px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-button);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:focus-visible {
  outline: 3px solid rgba(23, 105, 224, 0.28);
  outline-offset: 2px;
}

.button--primary {
  background: var(--color-blue);
  border-color: #0e57c3;
  color: var(--color-white);
}

.button--primary:hover {
  background: var(--color-blue-hover);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.42);
  color: var(--color-white);
}

.button--ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.button--secondary {
  background: var(--color-white);
  border-color: var(--color-line);
  color: var(--color-navy);
}

.button--secondary:hover {
  border-color: #b8c7da;
  background: #f8fbff;
}

.page-shell {
  width: min(100%, var(--page-max));
  margin: 0 auto;
  padding: 24px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(100%, 430px);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius-card);
  background: var(--color-white);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.22);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.api-key-form,
.payout-editor-fields,
.payout-lookup-form,
.settings-form,
.upload-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.upload-form {
  min-width: min(100%, 420px);
  grid-template-columns: minmax(210px, 1fr) auto;
  align-items: end;
  margin-top: 0;
}

.settings-form {
  grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.3fr) minmax(100px, 0.6fr) minmax(100px, 0.6fr) auto;
  align-items: end;
}

.payout-lookup-form {
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  margin-top: 14px;
}

.inline-notice {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #d9e2ee;
  border-radius: var(--radius-button);
  background: #fbfdff;
  color: var(--color-navy);
}

.inline-notice--success {
  border-color: #b7dcc9;
  background: var(--color-green-soft);
  color: var(--color-green);
}

.inline-notice--warning {
  border-color: #f0c36a;
  background: #fff8e8;
  color: var(--color-warning);
}

.inline-notice strong,
.inline-notice span {
  display: block;
  line-height: 1.35;
}

.inline-notice span {
  margin-top: 4px;
  font-size: 13px;
}

.payout-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.payout-editor-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: #fbfdff;
}

.payout-editor-card__head,
.payout-editor-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.payout-editor-card__head strong {
  color: var(--color-navy);
  font-size: 16px;
}

.payout-editor-card__meta {
  display: grid;
  gap: 3px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.35;
}

.payout-editor-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}

.payout-editor-card__footer span {
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.35;
}

.login-form label,
.filter-bar label,
.api-key-form label,
.payout-editor-fields label,
.payout-lookup-form label,
.settings-form label,
.upload-form label {
  display: grid;
  gap: 7px;
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 800;
}

.token-slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.token-slot-grid legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 800;
}

.token-slot-card {
  min-height: 84px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: #fbfdff;
  cursor: pointer;
}

.token-slot-card input {
  margin-top: 4px;
}

.token-slot-card strong {
  display: block;
  color: var(--color-navy);
  font-size: 14px;
}

.token-slot-card small {
  display: block;
  margin-top: 4px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.35;
}

.token-slot-card:has(input:checked) {
  border-color: #b7dcc9;
  background: var(--color-green-soft);
}

.login-form input,
.filter-bar input,
.filter-bar select,
.api-key-form textarea,
.api-key-form select,
.payout-editor-fields input,
.payout-lookup-form input,
.settings-form input,
.settings-form select,
.upload-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-button);
  padding: 9px 11px;
  background: var(--color-white);
  color: var(--color-black);
  font-size: 15px;
}

.login-form input:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.api-key-form textarea:focus,
.api-key-form select:focus,
.payout-editor-fields input:focus,
.payout-lookup-form input:focus,
.settings-form input:focus,
.settings-form select:focus,
.upload-form input:focus {
  border-color: var(--color-blue);
  outline: 3px solid rgba(23, 105, 224, 0.18);
}

.login-error {
  margin-top: 18px;
  padding: 11px 12px;
  border: 1px solid #f0c36a;
  border-radius: var(--radius-button);
  background: #fff8e8;
  color: var(--color-warning);
  font-size: 14px;
  line-height: 1.35;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.status-strip > div,
.metric-card,
.panel,
.notice {
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.notice--success {
  border-color: #b7dcc9;
  background: var(--color-green-soft);
  color: var(--color-green);
}

.status-strip > div {
  min-height: 78px;
  padding: 14px 16px;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-strip strong {
  color: var(--color-navy);
  font-size: 18px;
  line-height: 1.2;
  word-break: break-word;
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-color: #f0c36a;
  background: #fff8e8;
  color: var(--color-warning);
}

.notice strong,
.notice span {
  display: block;
  line-height: 1.35;
}

.notice span {
  margin-top: 4px;
  font-size: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  min-height: 132px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--metric-color, var(--color-blue));
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--color-muted);
  line-height: 1.35;
}

.metric-card span {
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin: 12px 0 6px;
  color: var(--color-navy);
  font-size: 30px;
  line-height: 1;
  word-break: break-word;
}

.metric-card small {
  font-size: 13px;
}

.metric-card--blue {
  --metric-color: var(--color-blue);
}

.metric-card--green {
  --metric-color: var(--color-green);
}

.metric-card--navy {
  --metric-color: var(--color-navy);
}

.metric-card--steel {
  --metric-color: var(--color-steel);
}

.metric-card--black {
  --metric-color: var(--color-black);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.85fr);
  gap: 18px;
  margin-bottom: 18px;
}

.content-grid--wide-left {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 16px;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.region-card {
  min-width: 0;
  display: block;
  padding: 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: #fbfdff;
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.region-card:hover {
  border-color: #aac0d9;
  box-shadow: 0 12px 26px rgba(16, 36, 62, 0.1);
  transform: translateY(-1px);
}

.region-card:active {
  transform: translateY(0);
}

.region-card div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.region-card strong,
.region-card span,
.region-card small {
  line-height: 1.35;
}

.region-card strong {
  color: var(--color-navy);
  font-size: 14px;
}

.region-card span,
.region-card small {
  color: var(--color-muted);
  font-size: 12px;
}

.region-card__qty {
  margin-top: 10px;
  color: var(--color-green);
  font-size: 24px;
  font-weight: 800;
}

.bar {
  height: 9px;
  margin: 9px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8f3;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-green);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 12px;
  align-items: end;
}

.filter-bar .button {
  align-self: end;
}

.chart-panel {
  display: grid;
  gap: 14px;
}

.chart-panel__top,
.chart-summary,
.chart-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.chart-tabs {
  display: inline-flex;
  gap: 18px;
  border-bottom: 1px solid var(--color-line);
}

.chart-tab {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--color-navy);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.chart-tab--active {
  border-color: var(--color-black);
  color: var(--color-black);
}

.chart-ranges {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.chart-range {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #f8fbff;
  color: var(--color-navy);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.chart-range--active,
.chart-range:hover {
  border-color: #b8c7da;
  background: #edf3fa;
}

.chart-period-form {
  display: grid;
  grid-template-columns: minmax(130px, 170px) minmax(130px, 170px) auto;
  gap: 10px;
  align-items: end;
}

.chart-period-form label {
  display: grid;
  gap: 6px;
  color: var(--color-navy);
  font-size: 12px;
  font-weight: 800;
}

.chart-period-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-button);
  padding: 8px 10px;
  color: var(--color-black);
  font-size: 14px;
}

.chart-updated {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-summary {
  justify-content: flex-start;
}

.chart-summary > div {
  min-width: 170px;
  display: grid;
  gap: 5px;
}

.chart-summary span,
.chart-summary small {
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.3;
}

.chart-summary strong {
  color: var(--color-black);
  font-size: 24px;
  line-height: 1.1;
}

.trend-up {
  color: var(--color-green) !important;
}

.trend-down {
  color: #c62b36 !important;
}

.chart-canvas {
  width: 100%;
  overflow-x: auto;
}

.chart-canvas svg {
  width: 100%;
  min-width: 760px;
  height: auto;
  display: block;
}

.chart-axis {
  stroke: #cfd8e6;
  stroke-width: 1.5;
}

.chart-grid {
  stroke: #e7edf5;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line--current {
  stroke: #4f6bed;
  stroke-width: 4;
}

.chart-line--previous {
  stroke: #ff5ac8;
  stroke-width: 2.5;
}

.chart-labels text {
  fill: var(--color-muted);
  font-size: 11px;
}

.chart-legend {
  justify-content: flex-start;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend b {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-current {
  background: #4f6bed;
}

.legend-previous {
  background: #ff5ac8;
}

.chart-empty {
  padding: 26px;
  color: var(--color-muted);
  text-align: center;
}

.api-key-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.api-key-card {
  padding: 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: #fbfdff;
}

.api-key-card strong,
.api-key-card span {
  display: block;
  line-height: 1.35;
}

.api-key-card strong {
  color: var(--color-navy);
}

.api-key-card span {
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 13px;
}

.api-key-card dl {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 14px 0 0;
  font-size: 13px;
}

.api-key-card dt {
  color: var(--color-muted);
}

.api-key-card dd {
  margin: 0;
  color: var(--color-navy);
  word-break: break-word;
}

.token-guide {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 18px;
}

.token-guide__headline {
  padding: 12px 14px;
  border: 2px solid #e5484d;
  border-radius: var(--radius-card);
  background: #fff5f5;
  color: #9f1d22;
  font-weight: 800;
  line-height: 1.35;
}

.token-guide__layout {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.token-guide__screenshot {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.token-guide__screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

.token-guide__steps {
  display: grid;
  gap: 10px;
}

.token-guide__step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: #fbfdff;
}

.token-guide__step p {
  color: var(--color-navy);
  font-size: 14px;
  line-height: 1.45;
}

.token-guide__number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e5484d;
  color: var(--color-white);
  font-size: 14px;
  font-weight: 800;
}

.token-guide__row {
  display: grid;
  grid-template-columns: 130px repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.token-guide__row--simple {
  grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1.2fr);
}

.token-guide__label {
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 800;
}

.token-guide__label b {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  margin-right: 6px;
  border-radius: 50%;
  background: #e5484d;
  color: var(--color-white);
  font-size: 13px;
}

.token-choice,
.token-check,
.token-guide__input-demo,
.token-guide__button-demo,
.token-guide__copy-demo {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-button);
  padding: 9px 11px;
  background: var(--color-white);
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.token-choice--active,
.token-check--active {
  border-color: #b7dcc9;
  background: var(--color-green-soft);
  color: var(--color-green);
}

.token-check--required {
  border: 2px solid #e5484d;
  background: #fff5f5;
  color: #9f1d22;
}

.token-check--optional {
  border-style: dashed;
  color: var(--color-muted);
}

.token-choice--muted {
  background: #f1f4f8;
  color: var(--color-muted);
}

.token-check--muted {
  background: #f1f4f8;
  color: var(--color-muted);
}

.token-choice--danger {
  border-color: #f0c36a;
  background: #fff8e8;
  color: var(--color-warning);
}

.token-guide__input-demo {
  background: var(--color-white);
  color: var(--color-muted);
}

.token-guide__button-demo {
  max-width: 190px;
  justify-content: center;
  border-color: #c49af7;
  background: #ead8ff;
  color: #6d31bf;
  font-weight: 800;
}

.token-guide__copy-demo {
  border-color: #b8c7da;
  background: #f8fbff;
  color: var(--color-navy);
}

.token-guide__note {
  padding: 12px 14px;
  border: 1px solid #b8c7da;
  border-radius: var(--radius-card);
  background: #f8fbff;
  color: var(--color-navy);
  font-size: 14px;
  line-height: 1.45;
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.collapsible-panel {
  padding: 0;
}

.collapsible-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}

.collapsible-panel summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel summary span {
  flex: 0 0 auto;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  padding: 6px 12px;
  background: #f8fbff;
  color: var(--color-navy);
  font-size: 12px;
  font-weight: 800;
}

.collapsible-panel[open] summary span {
  background: var(--color-green-soft);
  color: var(--color-green);
}

.collapsible-panel[open] summary span::before {
  content: "Закрыть";
}

.collapsible-panel[open] summary span {
  font-size: 0;
}

.collapsible-panel[open] summary span::before {
  font-size: 12px;
}

.collapsible-panel .settings-form,
.collapsible-panel .table-wrap {
  margin-left: 18px;
  margin-right: 18px;
}

.collapsible-panel .table-wrap {
  margin-bottom: 18px;
}

.panel--accent {
  background: linear-gradient(180deg, #ffffff 0%, #edf6f1 100%);
}

.focus-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.focus-list div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.focus-list span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--color-green);
  color: var(--color-white);
  font-weight: 800;
}

.focus-list p {
  color: var(--color-navy);
  font-size: 14px;
  line-height: 1.45;
}

.table-wrap {
  width: 100%;
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: var(--color-white);
}

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

.wide-table {
  min-width: 1080px;
}

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

.dynamics-table {
  min-width: 1540px;
}

.safe-load-table {
  min-width: 1280px;
}

.cashback-table {
  min-width: 1180px;
}

.cashback-action-table {
  min-width: 1040px;
}

.cashback-compact-table {
  min-width: 420px;
}

.payout-schedule-table {
  min-width: 760px;
}

.payment-report-action-table {
  min-width: 860px;
}

.payment-report-table {
  min-width: 780px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  font-size: 13px;
  line-height: 1.35;
  vertical-align: middle;
}

th {
  background: #edf3fa;
  color: var(--color-navy);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.plan-table th,
.plan-table td {
  padding: 10px 11px;
  font-size: 13px;
}

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

tbody tr:hover {
  background: #f8fbff;
}

td small {
  display: block;
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.25;
}

.diagnostic-panel {
  margin-top: 18px;
}

.diagnostic-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.diagnostic-panel summary::-webkit-details-marker {
  display: none;
}

.diagnostic-panel summary strong,
.diagnostic-panel summary small {
  display: block;
}

.diagnostic-panel summary small {
  margin-top: 4px;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.35;
}

.diagnostic-panel[open] summary {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line);
}

.stream-name {
  color: var(--color-navy);
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  max-width: 100%;
  min-height: 26px;
  align-items: center;
  border: 1px solid #b7dcc9;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--color-green-soft);
  color: var(--color-green);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.status-pill--warning {
  border-color: #f0c36a;
  background: #fff8e8;
  color: var(--color-warning);
}

.center-cell {
  text-align: center;
}

.center-cell .status-pill {
  justify-content: center;
}

.warehouse-tariff {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.tariff-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #d9e2ee;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f8fbff;
  color: var(--color-navy);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.tariff-chip b {
  margin-right: 4px;
  color: var(--color-muted);
}

.tariff-chip--type {
  border-color: #b8c7da;
  background: #eef4fb;
  gap: 6px;
}

.tariff-chip--coef {
  border-color: #ffb3b8;
  background: #ffe9eb;
  color: #c62b36;
}

.tariff-chip__percent {
  margin-right: 0;
  border-radius: 999px;
  padding: 2px 6px;
  background: #ffe9eb;
  color: #c62b36;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.tariff-metric {
  display: inline-grid;
  gap: 4px;
  justify-items: start;
}

.tariff-metric strong {
  color: var(--color-black);
  font-size: 14px;
  line-height: 1.2;
}

.tariff-metric span {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  background: #ffe9eb;
  color: #c62b36;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.empty-cell {
  color: var(--color-muted);
  text-align: center;
}

@media (max-width: 1040px) {
  .app-header__inner {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .nav-tabs,
  .header-side {
    width: 100%;
  }

  .nav-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
  }

  .nav-tab {
    min-width: 0;
    flex: 1 1 auto;
  }

  .header-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
    align-items: stretch;
  }

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

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

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

  .api-key-grid {
    grid-template-columns: 1fr;
  }

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

  .token-guide__layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-header__inner,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .header-side {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .sync-card {
    min-width: 0;
  }

  .button {
    width: 100%;
  }

  .inline-form {
    width: 100%;
  }

  .page-shell {
    padding: 16px;
  }

  .status-strip,
  .metric-grid,
  .region-grid,
  .filter-bar,
  .payout-editor-fields,
  .payout-lookup-form,
  .token-slot-grid,
  .settings-form,
  .upload-form,
  .token-guide__row {
    grid-template-columns: 1fr;
  }

  .chart-panel__top,
  .chart-summary,
  .chart-legend {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-tabs {
    width: 100%;
  }

  .chart-ranges {
    justify-content: flex-start;
  }

  .chart-period-form {
    grid-template-columns: 1fr;
  }

  .chart-tab {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .app-header__inner {
    padding: 18px 16px;
  }

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

  .brand {
    align-items: flex-start;
  }

  .brand__mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  h1 {
    font-size: 21px;
  }

  .metric-card strong {
    font-size: 27px;
  }

  th,
  td {
    padding: 10px 12px;
  }
}
