:root {
  color-scheme: light;
  --bg: oklch(0.94 0.007 250);
  --panel: #fff;
  --detail: oklch(0.965 0.006 260);
  --line: oklch(0.9 0.006 260);
  --control-line: oklch(0.78 0.01 260);
  --text: oklch(0.28 0.02 260);
  --muted: oklch(0.48 0.01 260);
  --accent: oklch(0.45 0.16 262);
  --accent-hover: oklch(0.4 0.16 262);
  --danger: oklch(0.5 0.16 25);
  --warning: oklch(0.44 0.11 60);
  --success: oklch(0.42 0.12 152);
  --nav: rgb(0 20 36);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip-link { position: absolute; left: 16px; top: -100px; padding: 10px 16px; background: white; z-index: 10; }
.skip-link:focus { top: 8px; }
header {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px max(24px, calc((100vw - 1280px)/2));
  background: var(--nav);
  color: white;
}
.brand { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 5px 7px; border-radius: 7px; background: white; }
.brand img { display: block; width: 30px; height: 34px; }
header a, header a:hover { color: white; }
header :focus-visible { outline-color: #a8c7ff; }
.header-actions { display: flex; align-items: center; gap: 24px; }
.shop-switcher { display: block; }
.shop-switcher label { display: flex; align-items: center; gap: 8px; color: white; }
.shop-switcher select { max-width: 340px; padding: 6px 10px; }
nav { display: flex; gap: 16px; }
header nav a { padding: 7px 10px; border-radius: 6px; text-decoration: none; }
header nav a:hover, header nav a[aria-current] { background: #243a4d; }
main { max-width: 1280px; margin: 0 auto; padding: 24px 24px 48px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.heading h1 { font-size: 24px; line-height: 1.25; margin: 0 0 6px; }
.heading p { margin: 0; color: var(--muted); }
h2 { font-size: 14px; line-height: 1.5; }
p { margin: 8px 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .05em; font-size: 11px; font-weight: 700; color: var(--muted); }
.tabs { gap: 4px; border-bottom: 1px solid var(--control-line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { font-weight: 650; padding: 10px 16px; text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.active { border-color: var(--accent); }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid.two > * { min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 1px 2px oklch(0.2 0 0 / .05); }
.card h2 { margin: 0 0 12px; }
.card.compact { padding: 12px 16px; }
form { display: grid; gap: 14px; }
form.inline { display: flex; align-items: end; }
label { display: grid; gap: 6px; font-weight: 600; }
input, select, button, .button {
  font: inherit;
  border-radius: 7px;
  border: 1px solid var(--control-line);
  padding: 8px 12px;
  background: white;
  color: var(--text);
  min-height: 36px;
  max-width: 100%;
}
input::placeholder { color: var(--muted); }
button, .button { cursor: pointer; font-weight: 650; text-align: center; text-decoration: none; }
button:hover, .button:hover { background: var(--detail); color: var(--text); }
button.primary { background: var(--accent); border-color: var(--accent); color: white; }
button.primary:hover { background: var(--accent-hover); }
button.danger { color: var(--danger); border-color: oklch(0.87 0.03 25); background: white; }
button.danger:hover { background: oklch(0.98 0.01 25); }
button:disabled { cursor: not-allowed; opacity: .6; }
small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.row, .item-title, .row-heading, .section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-title { margin: 24px 0 12px; }
.section-title h2, .section-title p { margin: 0; }
.stack { display: grid; gap: 0; }
.row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row > div, .item-title > div { min-width: 0; overflow-wrap: anywhere; }
.badge, .status { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 650; background: oklch(0.93 0.006 260); color: var(--muted); white-space: nowrap; }
.status.succeeded { background: oklch(0.95 0.03 150); color: var(--success); }
.status.failed { background: oklch(0.96 0.02 25); color: var(--danger); }
.status.uncertain, .status.queued { background: oklch(0.96 0.04 80); color: var(--warning); }
.status.running, .status.fetching { background: oklch(0.95 0.03 255); color: oklch(0.42 0.13 255); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.empty { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stats > a { display: block; background: white; border: 1px solid var(--line); padding: 12px 16px; border-radius: 8px; text-decoration: none; color: var(--text); }
.stats > a:hover { border-color: var(--control-line); }
.stats > a[aria-current] { outline: 2px solid var(--accent); outline-offset: -2px; }
.stats strong, .stats span { display: block; }
.stats strong { font-size: 24px; line-height: 1.2; }
.stats span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.stats .success strong { color: var(--success); }
.stats .pending strong { color: var(--warning); }
.stats .failure strong { color: var(--danger); }
.item-title { align-items: flex-start; margin-bottom: 12px; }
.item-title h2 { margin: 2px 0; }
.subscription-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.subscription-actions form { display: block; }
.failed-record { border-left: 3px solid var(--danger); }
.error-group { border-left: 3px solid oklch(0.88 0.05 75); }
.error-group > details > article { box-shadow: none; border-radius: 8px; margin-top: 12px; }
.success-empty p { margin-bottom: 0; }
.history { margin-top: 12px; }
.history-try { margin-top: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--detail); }
.migration-actions { margin-bottom: 20px; }
.action-grid { align-items: stretch; }
.action-grid form { align-content: space-between; }
.action-grid form + form { border-left: 1px solid var(--line); padding-left: 20px; }
.action-grid button { justify-self: end; }
.notice { background: oklch(0.97 0.02 255); border-color: oklch(0.88 0.03 255); }
.notice p { margin: 0 0 6px; }
details { margin-top: 8px; min-width: 0; }
summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 4px 0; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--detail); padding: 12px; border-radius: 8px; overflow: auto; max-height: 440px; font-size: 12px; }
.snapshots { margin-top: 8px; }
@media (max-width: 900px) {
  header { align-items: flex-start; flex-direction: column; gap: 10px; }
  .header-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
}
@media (max-width: 640px) {
  header { padding: 12px 16px; }
  main { padding: 20px 16px 40px; }
  .grid.two { grid-template-columns: 1fr; gap: 12px; }
  .heading, .item-title { align-items: flex-start; flex-direction: column; }
  .subscription-actions { justify-content: flex-start; }
  form.inline { flex-direction: column; align-items: stretch; }
  .shop-switcher, .shop-switcher label { width: 100%; }
  .shop-switcher select { min-width: 0; flex: 1; }
  .stats { gap: 8px; }
  .stats > a { padding: 10px; }
  .card { padding: 14px; }
  .action-grid form + form { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; }
}

.warning { background: oklch(0.995 0.008 80); border-color: oklch(0.88 0.05 75); color: var(--warning); }

.login-page { max-width: 440px; padding-top: 64px; }
.login-page form { display: grid; gap: 10px; }
.login-page input { width: 100%; }
.login-page button { margin-top: 8px; }
.login-page .error { color: var(--danger); }
