@font-face {
  font-family: "Geist";
  src: url("/static/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f6f6f5;
  --surface: #ffffff;
  --surface-2: #f4f4f3;
  --border: #e4e4e2;
  --border-strong: #cfcfcc;
  --text: #1a1a19;
  --text-2: #62625e;
  --mark: #244b62;
  --primary: #1a1a19;
  --primary-text: #ffffff;
  --focus: #1a1a19;
  --ok-text: #17663a;
  --ok-bg: #e7f4ec;
  --warn-text: #8a5300;
  --warn-bg: #fbf1dd;
  --bad-text: #a4261d;
  --bad-bg: #fbeae8;
  --radius: 12px;
  --radius-sm: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110;
    --surface: #191918;
    --surface-2: #222221;
    --border: #2c2c2a;
    --border-strong: #41413e;
    --text: #efefed;
    --text-2: #a4a49f;
    --mark: #efefed;
    --primary: #efefed;
    --primary-text: #161615;
    --focus: #efefed;
    --ok-text: #72d39a;
    --ok-bg: #16301f;
    --warn-text: #e8b95f;
    --warn-bg: #352810;
    --bad-text: #f59a92;
    --bad-bg: #3a1a17;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110;
  --surface: #191918;
  --surface-2: #222221;
  --border: #2c2c2a;
  --border-strong: #41413e;
  --text: #efefed;
  --text-2: #a4a49f;
  --mark: #efefed;
  --primary: #efefed;
  --primary-text: #161615;
  --focus: #efefed;
  --ok-text: #72d39a;
  --ok-bg: #16301f;
  --warn-text: #e8b95f;
  --warn-bg: #352810;
  --bad-text: #f59a92;
  --bad-bg: #3a1a17;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 "Geist", ui-sans-serif, system-ui, sans-serif;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; }
h2 { font-size: 16px; line-height: 1.35; font-weight: 600; }
code { font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
a { color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#view:focus, h1:focus { outline: none; }

.muted { color: var(--text-2); }
.small { font-size: 13px; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-strong);
}
.skip-link:focus { top: 12px; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.mark {
  width: 26px;
  height: 16px;
  flex: none;
  background: var(--mark);
  -webkit-mask: url("/static/sellbird-mark.svg") center / contain no-repeat;
  mask: url("/static/sellbird-mark.svg") center / contain no-repeat;
}

/* Controls */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--surface-2); }
.button:disabled { color: var(--text-2); cursor: not-allowed; background: var(--surface-2); }
.button-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.button-primary:hover { background: var(--primary); opacity: 0.88; }
.button-primary:disabled { background: var(--surface-2); border-color: var(--border-strong); opacity: 1; }
.button-quiet { border-color: transparent; background: transparent; color: var(--text-2); }

input, select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.field { display: grid; gap: 6px; }
.field > span, .field > label, .reason-bar label { font-size: 13px; font-weight: 500; }

/* Sign-in and authenticator pages */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 16px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.auth-card .button { width: 100%; }
.auth-secondary { padding-top: 4px; }
.stack { display: grid; gap: 12px; }
.steps { margin: 0; padding-left: 20px; }
.qr-frame { display: grid; place-items: center; padding: 16px; background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.qr { display: block; max-width: 100%; height: auto; }
.secret { display: block; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); user-select: all; }
.code-input { font-size: 20px; letter-spacing: 0.25em; font-variant-numeric: tabular-nums; }

.notice { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.notice-error { background: var(--bad-bg); border-color: transparent; color: var(--bad-text); }

/* Console layout */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar { padding: 16px 0 16px 16px; }
.sidebar-card {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 16px;
  padding: 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sidebar-brand { display: flex; align-items: center; min-height: 44px; padding: 0 8px; text-decoration: none; border-radius: var(--radius-sm); }
.nav { display: grid; gap: 4px; }
.nav-group { display: grid; gap: 4px; margin-top: 12px; }
.nav-links { display: grid; gap: 4px; }
.nav-label { padding: 0 10px 4px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.nav-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--surface-2); color: var(--text); }

.column { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
  padding: 16px 24px;
  background: var(--bg);
}
.topbar-title { min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex: 1; display: grid; align-content: start; gap: 20px; width: 100%; max-width: 1120px; padding: 0 24px 40px; }

/* Account menu */
.menu { position: relative; flex: none; }
.menu-button { max-width: 260px; }
.menu-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); flex: none; }
.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 6;
  width: 260px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.menu-header { display: grid; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; overflow-wrap: anywhere; }
.menu-section { display: grid; gap: 2px; padding-bottom: 6px; margin: 0; }
.menu-section + .menu-section { border-top: 1px solid var(--border); padding-top: 6px; padding-bottom: 0; }
.menu-meta { padding: 2px 10px; font-size: 12px; color: var(--text-2); }
.menu-header .menu-meta { padding: 0; }
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover, .menu-item:focus { background: var(--surface-2); }
.menu-item[aria-checked="true"]::after { content: "✓"; color: var(--text-2); }

/* Reason */
.reason-bar {
  display: grid;
  grid-template-columns: auto minmax(180px, 280px) 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.reason-bar p { font-size: 13px; }

/* Content */
#view { display: grid; gap: 20px; min-width: 0; }
.stack-lg { display: grid; gap: 20px; min-width: 0; }
.page-head { display: grid; gap: 4px; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.lookup-form { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.tabs { display: none; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; margin: 0; }
.facts div { min-width: 0; display: grid; gap: 2px; }
.facts dt { font-size: 13px; color: var(--text-2); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.facts dd.big { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-ok { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.badge-bad { background: var(--bad-bg); color: var(--bad-text); border-color: transparent; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { padding: 8px 12px 8px 0; font-size: 13px; font-weight: 500; color: var(--text-2); text-align: left; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.table tr:last-child td { border-bottom: 0; }
.table a { font-weight: 500; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager-buttons { display: flex; gap: 8px; }

.state { display: grid; gap: 12px; justify-items: start; padding: 8px 0; }
.state-title { font-weight: 600; }
.skeleton { display: grid; gap: 10px; }
.skeleton span { display: block; height: 16px; border-radius: 6px; background: var(--surface-2); }
.skeleton span:nth-child(2) { width: 80%; }
.skeleton span:nth-child(3) { width: 60%; }
.reference { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--text-2); }

/* Inspection */
.copy {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}
.copy:hover { background: var(--surface-2); color: var(--text); }
.copy-value { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 4px; max-width: 100%; }
.table-scroll { overflow-x: auto; }
.table-wide { min-width: 860px; }
.table-wide td, .table-wide code { overflow-wrap: break-word; }
.freshness:empty { display: none; }
.cell-stack { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.read-note { display: grid; gap: 2px; font-size: 13px; color: var(--text-2); }
.tally-list { display: grid; gap: 12px; margin: 0; }
.tally { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.tally:last-child { padding-bottom: 0; border-bottom: 0; }
.tally dt { font-weight: 500; }
.tally dd { margin: 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tally .tally-note { grid-column: 1 / -1; font-size: 13px; font-weight: 400; color: var(--text-2); }
.units { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.units > div { display: grid; gap: 2px; align-content: start; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.units dt { font-size: 13px; color: var(--text-2); }
.units dd { margin: 0; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.units dd.units-none { font-size: 15px; font-weight: 500; color: var(--text-2); }

@media (max-width: 899px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { padding: 12px 12px 0; }
  .sidebar-card { position: static; gap: 8px; padding: 8px; }
  .sidebar-brand { min-height: 36px; }
  .nav { display: block; }
  .nav > .nav-item { display: flex; }
  .nav-group { margin-top: 4px; }
  .nav-label { padding: 4px 10px 0; }
  .nav-links { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .nav-links .nav-item { flex: none; }
  .topbar { min-height: 68px; padding: 12px; }
  .main { padding: 0 12px 32px; gap: 16px; }
  .reason-bar { grid-template-columns: 1fr; gap: 6px; }
  .grid-2 { grid-template-columns: 1fr; }
  .lookup-form { grid-template-columns: 1fr; }
  .lookup-form .button { width: 100%; }
  .menu-button { max-width: 190px; }
  .card { padding: 16px; }
  h1 { font-size: 21px; }

  /* Rows become labeled blocks instead of a table that scrolls sideways. */
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; padding: 3px 0; border: 0; }
  .table td::before { content: attr(data-label); color: var(--text-2); font-size: 13px; }
  .table-scroll { overflow-x: visible; }
  .table-wide { min-width: 0; }
  .table-wide td, .table-wide code { overflow-wrap: anywhere; }
  .units { grid-template-columns: 1fr; }
  .pager-buttons, .pager-buttons .button { flex: 1; }
}

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