/* GSM Guide — "workshop instrument": graphite + ivory, one brass accent.
   Research notes: technicians work at a bench/counter or outdoors (glare, mixed light) → light + dark themes,
   high contrast for the data that matters (model numbers, quantities), model numbers in monospace,
   48px+ touch targets, no web-font download (low data, fast first paint). */
:root {
  --bg: #f5f3ee;
  --surface: #fff;
  --raised: #fbfaf7;
  --ink: #14181c;
  --muted: #5b646c;
  --line: #e4e0d7;
  --soft: #eeebe4;
  --pri: #14181c;
  --pri-ink: #fff;
  --acc: #d9a93a;
  --acc-ink: #1a1405;
  --acc-text: #8a6414;
  --ok: #2f7d5b;
  --ok-soft: #e3f2ea;
  --danger: #b3312b;
  --danger-soft: #fbe8e6;
  --warn: #fff4d6;
  --hero: #14181c;
  --hero-ink: #f3f1ec;
  --hero-mute: #a9b2b9;
  --r: 16px;
  --r-s: 12px;
  --shadow: 0 1px 0 rgba(20, 24, 28, 0.04),
    0 8px 24px -12px rgba(20, 24, 28, 0.18);
  --tab: 64px;
  --side: 264px;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Menlo,
    Consolas, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1013;
    --surface: #151a1e;
    --raised: #1b2126;
    --ink: #eceef0;
    --muted: #98a3ac;
    --line: #262e35;
    --soft: #1b2126;
    --pri: #eceef0;
    --pri-ink: #0d1013;
    --acc: #e4b653;
    --acc-ink: #1a1405;
    --acc-text: #e4b653;
    --ok: #6fcf97;
    --ok-soft: #14261d;
    --danger: #ff8a80;
    --danger-soft: #33201f;
    --warn: #33290f;
    --hero: #1b2126;
    --hero-ink: #eceef0;
    --hero-mute: #98a3ac;
    --shadow: none;
  }
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html {
  background: var(--bg);
  scroll-behavior: smooth;
  overflow-x: hidden;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  max-width: 100vw;
}
a {
  color: var(--ink);
  text-decoration-color: var(--acc);
  text-underline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  letter-spacing: -0.015em;
  font-weight: 700;
}
small,
.muted {
  color: var(--muted);
  font-size: 0.85rem;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.mono,
.model,
.item .m {
  font-family: var(--mono);
  letter-spacing: -0.02em;
}
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
svg.i {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
img {
  max-width: 100%;
  height: auto;
}

/* top loading bar on navigation */
html.nav-loading::before {
  content: '';
  position: fixed;
  left: 0;
  top: 0;
  height: 3px;
  width: 40%;
  background: var(--acc);
  z-index: 100;
  animation: bar 1s ease-in-out infinite;
}
@keyframes bar {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}

/* app shell */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 6px 12px;
  padding-top: calc(6px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.appbar .ttl {
  flex: 1;
  min-width: 0;
}
.appbar h1 {
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.logo img,
.logo svg {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex: none;
}
.logo span {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.logo b {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.logo small {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}
.iconbtn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-decoration: none;
  cursor: pointer;
}
.iconbtn:hover {
  background: var(--soft);
}
main {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 16px 16px calc(var(--tab) + 32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
body.guest main {
  padding-bottom: 32px;
}
main.pubmain {
  width: 100%;
  max-width: none;
  padding: 0;
  display: block;
}
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  position: relative;
}
.tab.on {
  color: var(--ink);
}
.tab.on::after {
  content: '';
  position: absolute;
  top: 0;
  width: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--acc);
}
.tab .badge {
  position: absolute;
  top: 7px;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--acc);
  color: var(--acc-ink);
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tab.add span.fab {
  width: 54px;
  height: 54px;
  margin-top: -24px;
  border-radius: 18px;
  background: var(--acc);
  color: var(--acc-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px -6px rgba(217, 169, 58, 0.55);
  transform: rotate(0);
}
.tab.add svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.6;
}
.tab.add::after {
  display: none;
}

/* desktop sidebar */
.side {
  display: none;
}
@media (min-width: 1000px) {
  body.app {
    padding-left: var(--side);
  }
  .side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--side);
    padding: 20px 14px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    z-index: 40;
  }
  .side .logo {
    padding: 4px 10px 18px;
  }
  .side a.nav {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
  }
  .side a.nav:hover {
    background: var(--soft);
    color: var(--ink);
  }
  .side a.nav.on {
    background: var(--soft);
    color: var(--ink);
  }
  .side a.nav.on svg {
    color: var(--acc-text);
  }
  .side .quick {
    margin: 0 0 10px;
    min-height: 50px;
  }
  .side .spacer {
    flex: 1;
  }
  .side .who {
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--muted);
  }
  .side .owner-nav-label {
    padding: 0 12px 8px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.12em;
  }
  .side .owner-switch {
    border: 1px dashed var(--line);
    margin-bottom: 6px;
  }
  .side .owner-logout {
    margin: 0 0 6px;
  }
  .side .owner-logout .nav {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--danger);
    cursor: pointer;
  }
  .side .owner-logout .nav:hover {
    background: var(--soft);
  }
  .side .nav .badge {
    margin-left: auto;
  }
  .tabbar,
  .appbar .logo {
    display: none;
  }
  .appbar {
    padding-inline: 28px;
  }
  main {
    padding-bottom: 56px;
    max-width: 860px;
  }
  main.pubmain {
    max-width: none;
    padding: 0;
  }
}

/* surfaces */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card.flush {
  padding: 0;
  overflow: hidden;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stack-s {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
  min-width: 0;
}
.between {
  justify-content: space-between;
}
.po-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.po-summary-title {
  flex: 0 0 auto;
  min-width: max-content;
}
.po-summary-title > b {
  font-size: 1.25rem;
  white-space: nowrap;
}
.po-summary-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
@media (max-width: 640px) {
  .po-summary-head {
    flex-direction: column;
    gap: 10px;
  }
  .po-summary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .po-summary-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
.sec-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
}
.sec-h h2 {
  font-size: 0.95rem;
}
.tutorial-header > div {
  min-width: 0;
}
.tutorial-header > .btn {
  flex: none;
}
.tutorial-item-main {
  flex: 1 1 auto;
  min-width: 0;
}
.play-indicator-badge {
  flex: 0 0 36px;
}
.tutorial-item-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}
.tutorial-item > .tut-badge {
  flex: none;
}
@media (max-width: 480px) {
  .tutorial-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .tutorial-item {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 10px;
  }
  .tutorial-item > .tut-badge {
    align-self: flex-end;
  }
}
.cat-actions {
  gap: 6px;
  align-items: center;
  flex: none;
}
@media (max-width: 480px) {
  .cat .sec-h {
    align-items: stretch;
    flex-direction: column;
  }
  .cat .sec-h h2 {
    min-width: 0;
  }
  .cat-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .cat-actions .btn.sm {
    min-width: 0;
    padding: 0 8px;
  }
}
.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
}
.err {
  color: var(--danger);
  font-weight: 600;
}
.hr {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* controls */
label.f {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
input,
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--r-s);
  padding: 0 14px;
  min-height: 50px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  padding: 12px 14px;
  min-height: 130px;
  font-family: var(--mono);
  font-size: 0.9rem;
}
input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 35%, transparent);
}
input[type='checkbox'] {
  width: 22px;
  height: 22px;
  min-height: 0;
  accent-color: var(--pri);
  border-radius: 6px;
}
.attachment-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-s);
  background: var(--bg);
}
.attachment-picker input[type='file'] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}
.attachment-choose,
.attachment-upload { min-height: 42px; padding: 0 18px; }
.attachment-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.86rem;
}
@media (max-width: 560px) {
  .attachment-picker { grid-template-columns: 1fr; }
  .attachment-name { padding: 0 4px; }
  .attachment-choose,
  .attachment-upload { width: 100%; }
}
[aria-invalid='true'] {
  border-color: var(--danger) !important;
  background: var(--danger-soft);
}
.field-err {
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  gap: 6px;
  align-items: center;
}
.btn {
  font: inherit;
  font-weight: 700;
  min-height: 50px;
  padding: 0 20px;
  border-radius: var(--r-s);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.08s, background 0.15s, border-color 0.15s;
  position: relative;
}
.btn:hover {
  border-color: var(--muted);
}
.btn:active {
  transform: scale(0.98);
}
.btn.primary {
  background: var(--pri);
  border-color: var(--pri);
  color: var(--pri-ink);
}
.btn.accent {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--acc-ink);
}
.btn.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--acc);
  text-underline-offset: 4px;
}
.btn.big {
  min-height: 58px;
  font-size: 1.05rem;
  border-radius: 14px;
}
.btn.sm {
  min-height: 42px;
  min-width: 42px;
  padding: 0 14px;
  font-size: 0.9rem;
}
.btn.block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}
.btn.loading {
  color: transparent !important;
  pointer-events: none;
}
.btn.loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.btn.primary.loading::after {
  border-color: var(--pri-ink);
  border-right-color: transparent;
}
.btn.accent.loading::after {
  border-color: var(--acc-ink);
  border-right-color: transparent;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.chips::-webkit-scrollbar {
  height: 4px;
}
.chips::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}
.chips.wrap {
  flex-wrap: wrap;
  overflow: visible;
}
.chips.compact {
  gap: 6px;
}
.chips.max-lines {
  max-height: 70px;
  overflow: hidden;
}
.chip {
  flex: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.chip.compact {
  min-height: 32px;
  font-size: 0.82rem;
  padding: 0 11px;
  border-width: 1px;
}
.chip.sm {
  min-height: 34px;
  font-size: 0.84rem;
  padding: 0 12px;
}
.chip.add-cat {
  border-style: dashed;
  border-color: var(--pri);
  background: var(--soft);
  color: var(--ink);
  font-weight: 700;
}
.chip:hover {
  border-color: var(--muted);
}
.chip.on {
  background: var(--surface);
  border-color: var(--ink);
  border-width: 2.5px;
  color: var(--ink);
  font-weight: 800;
}
.chip.alt {
  background: var(--soft);
  border-color: transparent;
}
.chip.alt.on {
  background: var(--pri);
  color: var(--pri-ink);
}
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--soft);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}
.seg a {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}
.seg a.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.entry-head {
  padding-top: env(safe-area-inset-top);
}
.entry-head .seg a {
  min-height: 38px;
  padding: 0 4px;
  white-space: nowrap;
  /* Four modes share one row; shrink the label slightly on narrow phones instead of scrolling. */
  font-size: clamp(0.76rem, 3.4vw, 0.88rem);
}
.stepper {
  display: inline-flex;
  align-items: center;
  background: var(--soft);
  border-radius: var(--r-s);
}
.stepper button {
  width: 44px;
  height: 48px;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  border-radius: var(--r-s);
}
.stepper button:active {
  background: var(--line);
}
.stepper input {
  width: 54px;
  min-height: 48px;
  text-align: center;
  border: 0;
  background: transparent;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0;
  font-family: var(--mono);
}
.qty-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}
.qty-pill button {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.2rem;
}
.qty-pill b {
  min-width: 24px;
  text-align: center;
}
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--ok-soft);
  color: var(--ok);
}
.tag.none {
  background: var(--danger-soft);
  color: var(--danger);
}
.tag.src {
  background: var(--soft);
  color: var(--muted);
}
.tag.cat {
  background: var(--soft);
  color: var(--ink);
}
.note {
  background: var(--warn);
  border-radius: var(--r-s);
  padding: 10px 14px;
  font-size: 0.9rem;
}
.note.info {
  background: var(--soft);
}
.note.ok {
  background: var(--ok-soft);
  color: var(--ink);
}

/* home */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 112px;
  padding: 20px;
  border-radius: 22px;
  background: var(--hero);
  color: var(--hero-ink);
  text-decoration: none;
  overflow: hidden;
  border: 1px solid var(--line);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
      420px 180px at 100% 0%,
      rgba(228, 182, 83, 0.22),
      transparent 70%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.035) 0 1px,
      transparent 1px 22px
    );
  pointer-events: none;
}
.hero .plus {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--acc);
  color: var(--acc-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.hero .plus svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.8;
}
.hero b {
  display: block;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}
.hero small {
  color: var(--hero-mute);
}
.hero > span {
  position: relative;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 96px;
  min-width: 0;
  padding: 16px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.08s;
}
.tile:hover {
  border-color: var(--muted);
}
.tile:active {
  transform: scale(0.985);
}
.tile {
  position: relative;
}
.tile .badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 20px;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--acc);
  color: var(--acc-ink);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile svg {
  color: var(--acc-text);
  flex: none;
}
.tile-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.tile .title {
  font-size: clamp(0.82rem, 3.4vw, 0.98rem);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile small {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--soft);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--acc);
  border-radius: 3px;
}
.search {
  position: relative;
}
.search svg {
  position: absolute;
  left: 14px;
  top: 14px;
  color: var(--muted);
}
.search input {
  padding-left: 44px;
}

/* lists */
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 62px;
}
.item:last-child {
  border-bottom: 0;
}
.item .grow b {
  display: block;
  font-weight: 700;
}
.item .grow small {
  display: block;
}
.admin-user-item {
  align-items: center;
}
.admin-user-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}
.admin-user-session {
  display: grid;
  justify-items: start;
}
.admin-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  .admin-user-item {
    display: block;
    padding: 12px 14px;
  }
  .admin-user-summary {
    width: 100%;
  }
  .admin-user-session {
    margin-left: auto;
    max-width: 52%;
  }
  .admin-user-actions {
    width: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  .admin-user-actions .btn {
    flex: 1 1 0;
  }
}
@media (max-width: 480px) {
  .admin-user-summary {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
  .admin-user-summary > .grow {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .admin-user-session {
    margin-left: 0;
    max-width: none;
    width: 100%;
  }
  .admin-user-summary > .tag {
    align-self: flex-start;
  }
}
.po-list-item {
  padding: 12px 14px !important;
  min-height: 64px !important;
}
.po-list-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.po-list-top .po-num {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--ink);
}
.po-list-top .po-sup {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
  text-align: right;
}
.po-list-top .po-sup.muted {
  color: var(--muted);
  font-weight: 500;
}
.po-list-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}
.po-list-sub .po-datetime {
  font-variant-numeric: tabular-nums;
}
.po-list-sub .po-items-count {
  font-weight: 600;
}
.item .stepper {
  border-radius: 10px;
}
.item .stepper button {
  width: 34px;
  height: 38px;
  font-size: 1.2rem;
}
.item .stepper input {
  width: 36px;
  min-height: 38px;
  font-size: 0.95rem;
}
.item .grow > .row {
  margin-top: 3px;
}
.item.pick {
  cursor: pointer;
}
.item.pick.sel {
  background: var(--soft);
}
.qty {
  font-weight: 800;
  font-size: 1.05rem;
  min-width: 44px;
  text-align: right;
  font-family: var(--mono);
}
a.item {
  color: inherit;
  text-decoration: none;
}
a.item:hover {
  background: var(--raised);
}
.stat {
  display: flex;
  gap: 10px;
}
.stat div {
  flex: 1;
  text-align: center;
  padding: 14px 6px;
  border-radius: var(--r-s);
  background: var(--soft);
}
.stat b {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--mono);
  letter-spacing: -0.04em;
}
table.t {
  width: 100%;
  border-collapse: collapse;
}
.t th,
.t td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.t th {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.t td + td,
.t th + th {
  text-align: right;
}
.t tr:last-child td {
  border-bottom: 0;
}
.t td + td {
  font-family: var(--mono);
}

.plans-table th,
.plans-table td {
  vertical-align: middle;
}
.plans-table tr:hover td {
  background: color-mix(in srgb, var(--soft) 50%, transparent);
}
.plans-table input[type="number"],
.plans-table input[type="text"],
.plans-table input:not([type="checkbox"]) {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  outline: none;
}
.plans-table input:focus {
  border-color: var(--pri);
}

/* quick add */
.letters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
}
.letters::-webkit-scrollbar {
  display: none;
}
.letters button {
  flex: none;
  min-width: 42px;
  min-height: 42px;
  border-radius: 11px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.letters button.on {
  background: var(--pri);
  color: var(--pri-ink);
  border-color: var(--pri);
}
.models {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px;
}
.models.max-lines {
  max-height: 126px;
  grid-auto-rows: 56px;
  overflow: hidden;
}
.models.max-lines .model {
  height: 56px;
  min-height: 56px;
  box-sizing: border-box;
}
.model {
  min-height: 48px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.model.suggestion,
.chip.suggestion {
  background: var(--soft);
  border: 1.5px solid transparent;
}
.model.suggestion.on,
.chip.suggestion.on {
  background: var(--surface) !important;
  border-color: var(--ink) !important;
  border-width: 2.5px !important;
  color: var(--ink) !important;
  font-weight: 800 !important;
}
.model:hover {
  border-color: var(--muted);
}
.model small {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.2;
}
.model.on {
  background: var(--surface);
  border-color: var(--ink);
  border-width: 2.5px;
  color: var(--ink);
  font-weight: 800;
}
.model.on small {
  color: var(--muted);
}
.skel {
  border-radius: var(--r-s);
  background: linear-gradient(
    90deg,
    var(--soft) 25%,
    var(--raised) 50%,
    var(--soft) 75%
  );
  background-size: 200% 100%;
  animation: sh 1.2s infinite;
  min-height: 60px;
}
@keyframes sh {
  to {
    background-position: -200% 0;
  }
}
.addbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tab) + env(safe-area-inset-bottom));
  z-index: 25;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 30px -18px rgba(0, 0, 0, 0.35);
}
.addbar .in {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.addbar .note {
  max-height: 76px;
  overflow: auto;
  padding: 8px 12px;
  font-size: 0.85rem;
}
.addbar .sel {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-add-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border-radius: 12px;
  background: var(--soft);
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}
.quick-add-summary .summary-lines {
  flex: 1;
  min-width: 0;
}
.quick-add-summary .sel {
  font-size: 0.875rem;
  letter-spacing: -0.01em;
}
.quick-add-summary .sel-category {
  color: var(--acc-text);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quick-add-summary .stepper {
  flex: none;
  background: var(--surface);
}
.quick-add-summary .stepper button {
  width: 34px;
  height: 38px;
  font-size: 1.2rem;
}
.quick-add-summary .stepper input {
  width: 36px;
  min-height: 38px;
  font-size: 0.95rem;
}
.quick-add-summary #bulk-model-summary {
  white-space: normal;
  line-height: 1.2;
}
.quick-add-summary #bulk-model-summary.models-4 {
  font-size: 0.75rem;
}
.quick-add-summary #bulk-model-summary.models-8 {
  font-size: 0.625rem;
}
.entry-footer-tools,
.entry-footer-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.entry-footer-tools {
  justify-content: space-between;
}
.entry-footer-tools .btn.ghost,
.entry-footer-actions .btn.ghost {
  padding-inline: 8px;
}
.entry-footer-actions .btn:not(.ghost) {
  min-height: 42px;
  padding-inline: 9px;
}
.entry-footer-actions .btn.sm {
  min-height: 40px;
}
.pad-addbar {
  height: 140px;
}
@media (min-width: 1000px) {
  .addbar {
    bottom: 0;
    left: var(--side);
  }
}

/* dialog / sheet */
dialog {
  border: 1px solid var(--line);
  padding: 0;
  width: min(520px, 100%);
  max-height: 88dvh;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--ink);
  margin: auto auto 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
}
@media (min-width: 640px) {
  dialog {
    border-radius: 24px;
    margin: auto;
  }
}
dialog::backdrop {
  background: rgba(6, 10, 13, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
dialog .in,
dialog > form {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
}
dialog h2,
dialog h3 {
  font-size: 1.25rem;
  font-weight: 850;
  margin: 0;
  color: var(--ink);
}

#toast {
  position: fixed;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  bottom: calc(var(--tab) + 84px + env(safe-area-inset-bottom));
  transform: translateY(20px);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  max-width: 92%;
  z-index: 60;
  font-weight: 600;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
#toast.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
body:has(.addbar) #toast {
  bottom: calc(var(--tab) + 200px + env(safe-area-inset-bottom));
}
#toast.bad {
  background: var(--danger);
  color: #fff;
}
#toast button {
  background: none;
  border: 0;
  color: var(--acc);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  min-height: 32px;
}
.sticky-act {
  position: sticky;
  bottom: calc(var(--tab) + 12px + env(safe-area-inset-bottom));
  z-index: 15;
  display: flex;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.4);
}
.po-sticky-bar {
  position: sticky;
  bottom: calc(var(--tab) + 12px + env(safe-area-inset-bottom));
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.45);
  margin-top: 14px;
}
.po-sticky-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.po-sticky-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--ink);
}
.po-sticky-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}
.po-sticky-row2 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.po-sticky-row2 .btn {
  flex: 1;
  min-width: 48px;
  justify-content: center;
  padding: 0 8px;
  font-size: 0.82rem;
  height: 34px;
}
.excel-table th {
  user-select: none;
}
.excel-row {
  cursor: pointer;
  transition: background 0.15s ease;
}
.excel-row:hover {
  background: var(--soft);
}
.excel-row.sel {
  background: color-mix(in srgb, var(--pri) 8%, var(--surface));
}
.compact-item-row {
  cursor: pointer;
  transition: background 0.15s ease;
}
.compact-item-row:hover {
  background: var(--soft);
}
.compact-item-row.sel {
  background: color-mix(in srgb, var(--pri) 8%, var(--surface));
}
.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 9px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg-btn.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.draft-sticky-sel {
  position: sticky;
  bottom: calc(var(--tab) + 12px + env(safe-area-inset-bottom));
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.45);
  margin-top: 14px;
}
.draft-sel-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.draft-sel-count-txt {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
}
.draft-sel-row2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.draft-sel-row2 .btn {
  flex: 1;
  justify-content: center;
}
@media (min-width: 680px) {
  .draft-sticky-sel {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .draft-sel-row1 {
    justify-content: flex-start;
    gap: 14px;
  }
  .draft-sel-row2 {
    flex: initial;
    justify-content: flex-end;
  }
  .draft-sel-row2 .btn {
    flex: initial;
  }
}
@media (min-width: 1000px) {
  .sticky-act,
  .draft-sticky-sel {
    bottom: 16px;
  }
  #toast {
    bottom: 32px;
  }
  body:has(.addbar) #toast {
    bottom: 230px;
  }
}
.hide {
  display: none !important;
}

/* success / thank-you */
.success {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.success .tick {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--ok-soft);
  color: var(--ok);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.success .tick svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.6;
}

/* auth */
.auth {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding-top: 5vh;
}
.auth .logo img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.auth .logo b {
  font-size: 1.5rem;
}
.auth-note {
  color: var(--muted);
}

/* public / marketing pages */
.pub {
  display: block;
  background: var(--bg);
}
.pub-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px max(16px, calc((100% - 1120px) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.pub-nav .row {
  gap: 10px;
}
.container {
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
}
.hero-l {
  padding: 56px 0 40px;
  display: grid;
  gap: 36px;
  align-items: center;
}
@media (min-width: 900px) {
  .hero-l {
    grid-template-columns: 1.1fr 0.9fr;
    padding: 88px 0 64px;
  }
}
.hero-l h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.hero-l h1 em {
  font-style: normal;
  color: var(--acc-text);
  text-decoration: underline;
  text-decoration-color: var(--acc);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}
.hero-l p.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34em;
  margin-top: 16px;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.9rem;
}
.proof span::before {
  content: '✓ ';
  color: var(--ok);
  font-weight: 800;
}
.shots {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 16px;
}
.shot {
  width: min(46%, 250px);
  border-radius: 26px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.5);
  background: var(--surface);
  display: block;
}
.shot.b {
  margin-top: 44px;
}
.sec {
  padding: 56px 0;
}
.sec h2 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  letter-spacing: -0.03em;
  max-width: 20em;
}
.sec .lead {
  color: var(--muted);
  margin-top: 10px;
  max-width: 36em;
}
.grid3 {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}
@media (min-width: 760px) {
  .grid3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (min-width: 1000px) {
  .owner-control-tabs { display: none; }
}
.grid2 {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}
.feat {
  padding: 22px;
}
.feat .ic {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--soft);
  color: var(--acc-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.feat h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.feat p {
  color: var(--muted);
  font-size: 0.95rem;
}
.steps {
  counter-reset: s;
  display: grid;
  gap: 14px;
  margin-top: 28px;
}
@media (min-width: 760px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
}
.step {
  counter-increment: s;
  padding: 20px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
}
.step::before {
  content: counter(s, decimal-leading-zero);
  font-family: var(--mono);
  color: var(--acc-text);
  font-weight: 800;
}
.step h3 {
  margin: 8px 0 4px;
  font-size: 1rem;
}
.step p {
  color: var(--muted);
  font-size: 0.92rem;
}
.band {
  background: var(--hero);
  color: var(--hero-ink);
  border-radius: 28px;
  padding: 44px 28px;
  margin: 24px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.band h2 {
  margin: 0 auto;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}
.band p {
  color: var(--hero-mute);
  margin: 10px auto 22px;
  max-width: 34em;
}
details {
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  padding: 0 16px;
  background: var(--surface);
}
details + details {
  margin-top: 10px;
}
summary {
  cursor: pointer;
  min-height: 54px;
  display: flex;
  align-items: center;
  font-weight: 600;
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: '+';
  margin-left: auto;
  font-size: 1.3rem;
  color: var(--muted);
}
details[open] summary::after {
  content: '–';
}
.subscriber-detail summary::after {
  display: none !important;
}
details p {
  padding: 0 0 16px;
  color: var(--muted);
}
.foot {
  border-top: 1px solid var(--line);
  padding: 32px 0 calc(32px + 72px);
  color: var(--muted);
  font-size: 0.9rem;
}
.foot .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: space-between;
}
.foot a {
  color: var(--muted);
}
.foot nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 96px;
}
.doc h1 {
  font-size: 2rem;
  margin-bottom: 6px;
}
.doc h2 {
  font-size: 1.2rem;
  margin: 28px 0 8px;
}
.doc p,
.doc li {
  color: var(--muted);
  margin: 8px 0;
}
.doc li {
  margin-left: 1.1em;
}
.doc strong {
  color: var(--ink);
}
.mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
@media (min-width: 760px) {
  .mobile-cta {
    display: none;
  }
  .foot {
    padding-bottom: 32px;
  }
}
.cookie {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 70;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px -14px rgba(0, 0, 0, 0.45);
  font-size: 0.88rem;
}
body.has-cta .cookie {
  bottom: 84px;
}
@media (min-width: 760px) {
  body.has-cta .cookie {
    bottom: 12px;
  }
}
.notfound {
  text-align: center;
  padding: 12vh 0;
}
.notfound p.big {
  font-family: var(--mono);
  font-size: clamp(4rem, 18vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  color: var(--acc-text);
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Category Grid Boxes for Draft View */
.draft-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}
@media (min-width: 600px) {
  .draft-cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.draft-cat-box {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  transition: all 0.18s ease;
  user-select: none;
}
.draft-cat-box:hover {
  border-color: var(--brand);
  background: var(--raised);
}
.draft-cat-box.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
}
.draft-cat-box .cat-box-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.draft-cat-box .cat-box-cb-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
  flex: 1;
  min-width: 0;
}
.draft-cat-box .cat-box-cb {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
  cursor: pointer;
}
.draft-cat-box.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.draft-cat-box .cat-box-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  max-height: 120px;
}
.draft-cat-box .cat-box-item {
  font-size: 0.82rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}
.draft-cat-box .cat-box-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  flex: none;
  cursor: pointer;
}
.draft-cat-box .cat-box-item input[type="checkbox"]:disabled {
  pointer-events: none;
  cursor: default;
  opacity: 0.65;
}
.draft-item-row {
  align-items: flex-start !important;
  gap: 10px;
  padding: 10px 14px;
}
.draft-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.draft-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.draft-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.stepper.compact {
  border-radius: 8px;
}
.stepper.compact button {
  width: 30px;
  height: 32px;
  font-size: 1.1rem;
}
.stepper.compact input {
  width: 32px;
  min-height: 32px;
  font-size: 0.9rem;
}

.price-tabs-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--soft);
  border-radius: 12px;
  padding: 3px;
  gap: 4px;
}
.price-tabs-seg .chip {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  white-space: nowrap;
}
.price-tabs-seg .chip.on {
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: var(--shadow);
  border: 1px solid var(--line) !important;
  font-weight: 800;
}
.price-suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.price-suggest-chip {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s, border-color 0.15s;
}
.price-suggest-chip:hover {
  background: var(--surface);
  border-color: var(--ink);
}

.price-search-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:680px) {
  .price-search-grid { grid-template-columns:1fr; gap:16px; }
}

.po-toolbar-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 2px;
}
.po-toolbar-bar #filters {
  margin: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.po-toolbar-bar #filters::-webkit-scrollbar {
  display: none;
}
.po-view-toggle {
  display: inline-flex;
  background: var(--soft);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}
.po-view-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.po-view-btn.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-weight: 800;
}
.price-table { width:100%; }
.price-table-row { display:grid; grid-template-columns:1fr 1.2fr 1fr; gap:8px; padding:12px 14px; border-bottom:1px solid var(--line); align-items:center; }
.price-table-row > :last-child { text-align:right; }
@media (max-width:520px) {
  .price-search-grid { grid-template-columns:1fr; gap:14px; }
  .price-table-row { font-size:.82rem; padding:10px 9px; }
}

.draft-suppliers-compact {
  padding: 10px 12px !important;
  background: var(--soft) !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px;
  gap: 8px !important;
}
.draft-sup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.draft-sup-info {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.draft-sup-title {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.draft-sup-meta {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.draft-sup-all-btn {
  min-height: 28px !important;
  padding: 0 10px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  white-space: nowrap;
}
.draft-sup-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.draft-sup-chip {
  flex: 1 1 calc(50% - 4px);
  min-width: 145px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.draft-sup-chip-left {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}
.draft-sup-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.draft-sup-badge {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}
.draft-sup-chip-btn {
  min-height: 26px !important;
  padding: 0 8px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  flex-shrink: 0;
  white-space: nowrap;
}

.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.plan-list { display:grid; gap:10px; margin:0; padding:0; border:0; min-width:0; }
.plan-card { position:relative; display:flex; align-items:center; gap:12px; padding:14px 16px; border:1px solid var(--line); border-radius:14px; background:var(--surface); cursor:pointer; transition:border-color .15s, box-shadow .15s, background .15s; }
.plan-card:hover { border-color:var(--muted); }
.plan-card > input { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; }
.plan-card:has(input:focus-visible) { outline:2px solid var(--acc); outline-offset:2px; }
.plan-card:has(input:checked) { border-color:var(--ink); box-shadow:0 0 0 1px var(--ink), 0 8px 20px rgba(20,24,28,.08); background:var(--raised); }
.plan-card.popular { margin-top:8px; border-color:var(--acc); }
.plan-card.custom { border-style:dashed; }
.plan-card.custom:has(input:checked) { border-style:solid; }
.plan-tab { position:absolute; top:-10px; left:14px; padding:2px 10px; border-radius:999px; background:var(--acc); color:var(--acc-ink); font-size:.64rem; font-weight:900; letter-spacing:.06em; text-transform:uppercase; line-height:1.5; }
.plan-check { flex:none; width:22px; height:22px; border-radius:50%; border:2px solid var(--line); background:var(--surface); transition:all .15s; }
.plan-card:has(input:checked) .plan-check { border-color:var(--ink); background:var(--ink) center/12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .plan-card:has(input:checked) .plan-check { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d1013' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E"); } }
.plan-body { flex:1; min-width:0; display:grid; gap:3px; }
.plan-row { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.plan-row.muted { color:var(--muted); font-size:.8rem; }
.plan-row.meta { margin-top:4px; align-items:center; font-size:.76rem; font-weight:700; color:var(--ink); }
.plan-name { font-size:1rem; font-weight:800; }
.plan-price { font-size:1.2rem; font-weight:900; white-space:nowrap; font-variant-numeric:tabular-nums; }
.plan-price.quote { font-size:.85rem; color:var(--acc-text); }
.plan-save { padding:1px 8px; border-radius:999px; background:var(--ok-soft); color:var(--ok); font-size:.7rem; font-weight:800; }
.compat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.compat-head-text {
  flex: 1 1 240px;
}
.compat-modes {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
@media (max-width: 540px) {
  .compat-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .compat-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .compat-modes .chip {
    width: 100%;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
  }
}

/* Subscriber account row styling (Desktop & Mobile) */
.subscriber-summary {
  padding: 14px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  user-select: none;
}
.subscriber-summary::-webkit-details-marker {
  display: none;
}
.subscriber-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.subscriber-header-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.subscriber-name {
  font-size: 0.98rem;
  color: var(--ink);
}
.subscriber-subline {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.subscriber-expiry {
  font-size: 0.8rem;
  color: var(--muted);
}
.subscriber-action-wrap {
  display: flex;
  align-items: center;
  flex: none;
}
.subscriber-btn {
  pointer-events: none;
  min-height: 32px;
  padding: 0 14px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--soft);
  border-color: var(--line);
  color: var(--ink);
  border-radius: 8px;
}

@media (max-width: 580px) {
  .subscriber-summary {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }
  .subscriber-header-line {
    align-items: center;
    gap: 6px;
  }
  .subscriber-subline {
    flex-direction: column;
    gap: 2px;
  }
  .subscriber-action-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 4px;
  }
  .subscriber-btn {
    width: 100%;
    max-width: 260px;
    justify-content: center;
    text-align: center;
  }

  .quote-form-actions {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .quote-form-actions button {
    width: 100% !important;
    min-height: 44px !important;
  }

  .tiles {
    gap: 10px;
  }
  .tile {
    padding: 12px;
    min-height: 86px;
    gap: 4px;
  }
  .tile .title {
    font-size: 0.88rem;
  }
  .tile small {
    font-size: 0.75rem;
  }
}

@media (max-width: 333px) {
  .tiles {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .tile {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    min-height: 58px;
    padding: 12px 14px;
  }
  .tile svg {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    flex: none;
  }
  .tile .tile-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
  }
  .tile .title {
    font-size: 0.94rem;
    line-height: 1.25;
  }
  .tile small {
    display: block;
    font-size: 0.78rem;
    line-height: 1.3;
    white-space: normal;
  }
}

/* Modal & Sheet System (Help & Info dialog) */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(6, 10, 13, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  padding: 0;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal.hide {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.modal .sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  width: min(540px, 100%);
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.35);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 640px) {
  .modal {
    align-items: center;
    padding: 20px;
  }
  .modal .sheet {
    border-radius: 24px;
    max-height: 85vh;
    animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.sheet-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.sheet-h h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--ink);
}

/* Compatibility Hub Layout Improvements */
.compat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.compat-head-text {
  flex: 1;
  min-width: 0;
}
.compat-modes {
  display: inline-flex;
  gap: 4px;
  background: var(--soft);
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.compat-modes .chip {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.84rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}
.compat-modes .chip.on {
  background: var(--surface) !important;
  color: var(--ink) !important;
  font-weight: 800;
  box-shadow: var(--shadow);
}
@media (max-width: 640px) {
  .compat-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .compat-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .compat-modes .chip {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* Purchase Prices Segmented Bar & Suggestions */
.price-tabs-seg {
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
[data-price-panel] .card,
.price-search-grid,
.price-search-grid > .stack-s {
  min-width: 0;
  max-width: 100%;
}
[data-price-panel] .search,
[data-price-panel] .chip-rows,
[data-price-panel] .models {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
[data-price-panel] .card {
  overflow: hidden;
}
.chips.wrap.compact.max-lines {
  max-height: 84px;
  padding-bottom: 4px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.chips.wrap.compact.max-lines::-webkit-scrollbar {
  width: 3px;
}
.chips.wrap.compact.max-lines::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}
.models.max-lines {
  max-height: 140px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.admin-stat {
  display: grid;
  gap: 4px;
  text-decoration: none;
  color: var(--ink);
}
.admin-stat small,
.admin-stat span { color: var(--muted); }
.admin-stat strong { font-size: clamp(1.6rem, 4vw, 2.25rem); }
.admin-dashboard-grid { display: grid; gap: 14px; }
@media (min-width: 760px) {
  .admin-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Public offers listed with the plans (mirrors the offer rows in src/screens/Lists.tsx Settings). */
.plan-offer { position:relative; display:flex; align-items:stretch; width:100%; padding:0; border-radius:12px; border:1px solid var(--line); background:var(--surface); color:var(--ink); cursor:pointer; font:inherit; text-align:left; overflow:hidden; transition:border-color .15s, box-shadow .15s; }
.plan-offer:hover { border-color:var(--muted); }
.plan-offer:focus-visible { outline:2px solid var(--acc); outline-offset:2px; }
.offer-stub { position:relative; flex:none; display:flex; flex-direction:column; align-items:center; justify-content:center; width:68px; background:var(--acc); color:var(--acc-ink); border-right:2px dashed var(--surface); line-height:1.05; }
.offer-stub b { font-size:1.2rem; font-weight:900; }
.offer-stub small { font-size:.62rem; font-weight:900; letter-spacing:.12em; }
.offer-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; padding:10px 12px; }
.offer-body b { font-size:.9rem; font-weight:800; }
.offer-body small { color:var(--muted); font-size:.75rem; line-height:1.3; }
.offer-code { align-self:flex-start; margin-top:4px; padding:1px 8px; border:1px dashed var(--muted); border-radius:6px; font-family:var(--mono); font-size:.72rem; font-weight:700; letter-spacing:.06em; color:var(--muted); }
.offer-action { flex:none; align-self:center; margin-right:12px; padding:6px 14px; border-radius:999px; border:1.5px solid var(--ink); font-size:.8rem; font-weight:800; white-space:nowrap; transition:all .15s; }
.plan-offer:hover .offer-action { background:var(--ink); color:var(--surface); }
.plan-offer.applied { border-color:var(--ok); box-shadow:0 0 0 1px var(--ok); }
.plan-offer.applied .offer-action, .plan-offer.applied:hover .offer-action { background:var(--ok); border-color:var(--ok); color:#fff; }
.plan-offer.applied .offer-code { border-color:var(--ok); color:var(--ok); }
.plan-terms { display: block; font-size: 0.75rem; line-height: 1.35; }

/* ----- Landing: scroll-linked image sequence (scroll-seq.js) ----- */
.seq {
  position: relative;
  height: 400vh;
  background: #05070a;
  --p: 0;
}
.seq.is-static {
  height: 100vh;
  height: 100svh;
}
.seq-stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  width: 100%;
  overflow: hidden;
}
.seq-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.seq-copy {
  position: absolute;
  left: 0;
  right: 0;
  padding: 0 max(16px, calc((100% - 1120px) / 2));
  color: #f4f6f8;
  pointer-events: none;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}
.seq-copy h2 {
  font-size: clamp(1.7rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 16em;
  margin: 8px 0 0;
}
.seq-copy p {
  margin: 10px 0 0;
  color: rgba(244, 246, 248, 0.78);
  font-size: 1.05rem;
}
.seq-copy .eyebrow {
  color: #7fd4e6;
}
.seq-copy-a {
  top: 14%;
  opacity: clamp(0, calc(1 - (var(--p) - 0.12) * 6), 1);
}
.seq-copy-b {
  bottom: 12%;
  opacity: clamp(0, calc((var(--p) - 0.72) * 6), 1);
}
.seq.is-static .seq-copy-a {
  opacity: 0;
}
.seq-load {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  transition: opacity 0.4s ease;
}
.seq-load span {
  display: block;
  height: 100%;
  background: #7fd4e6;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s linear;
}
.seq.is-loaded .seq-load {
  opacity: 0;
}

/* Landing: full-screen loader while the scroll animation frames download. */
html.site-loading,
html.site-loading body {
  overflow: hidden;
}
.site-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #05070a;
  color: #e8ecef;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  /* Safety net: never block the page if the script fails to load. */
  animation: site-loader-failsafe 0s linear 25s forwards;
}
/* The script is running and closes the loader itself once every frame is in. */
html.site-loader-js .site-loader {
  animation: none;
}
.site-loader-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: contain;
  margin-bottom: 26px;
  transition: transform 0.6s ease;
}
.site-loader-text {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
}
.site-loader-bars {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
}
.site-loader-bars i {
  display: block;
  width: 2px;
  height: 100%;
  background: rgba(232, 236, 239, 0.18);
  transition: background 0.25s ease;
}
/* Two groups of six, like a gauge. */
.site-loader-bars i:nth-child(7) {
  margin-left: 14px;
}
.site-loader-bars i.on {
  background: #e8ecef;
}
.site-loader-bars i.next {
  animation: site-loader-blink 0.8s ease-in-out infinite;
}
.site-loader-pct {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: rgba(232, 236, 239, 0.5);
  font-variant-numeric: tabular-nums;
}
.site-loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.site-loader.done .site-loader-logo {
  transform: scale(1.12);
}
@keyframes site-loader-blink {
  50% { background: rgba(232, 236, 239, 0.6); }
}
@keyframes site-loader-failsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}
@media (prefers-reduced-motion: reduce) {
  .site-loader,
  .site-loader-logo {
    transition: none;
  }
  .site-loader-bars i.next {
    animation: none;
  }
}

/* Landing: floating glass nav over the scroll sequence — no bar, just glass pills. */
.pub-nav.glass {
  position: fixed;
  left: 0;
  right: 0;
  padding-top: 14px;
  padding-bottom: 0;
  background: transparent;
  border-bottom: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;
}
.pub-nav.glass .logo,
.pub-nav.glass .row {
  pointer-events: auto;
  padding: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 42%, transparent);
  border: 1px solid color-mix(in srgb, #fff 18%, transparent);
  box-shadow: 0 8px 32px -12px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}
.pub-nav.glass .logo {
  padding-right: 16px;
}
.pub-nav.glass .logo small {
  display: none;
}
.pub-nav.glass .btn {
  border-radius: 999px;
}
.pub-nav.glass .logo,
.pub-nav.glass .btn {
  white-space: nowrap;
}
@media (max-width: 480px) {
  .pub-nav.glass .btn {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.9rem;
  }
  .pub-nav.glass .logo b {
    font-size: 0.95rem;
  }
}
/* Portrait phones: both captions sit in the top band (they never show at the same time),
   clear of the cookie notice and the bottom "Get started" bar. */
@media (max-aspect-ratio: 3/4) {
  .seq-copy-a {
    top: 13%;
  }
  .seq-copy-b {
    top: 13%;
    bottom: auto;
  }
}
.pub-nav.glass .btn.ghost {
  background: transparent;
  border-color: transparent;
}
.pub-nav.glass,
.pub-nav.glass .logo,
.pub-nav.glass .row {
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}
/* After the sequence: back to the regular solid bar. */
.pub-nav.glass.solid {
  padding-top: 12px;
  padding-bottom: 12px;
  pointer-events: auto;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.pub-nav.glass.solid .logo,
.pub-nav.glass.solid .row {
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.pub-nav.glass.solid .logo small {
  display: block;
}

/* Category pickers: every pill reachable in two rows that slide sideways together.
   app.js (balanceChipRows) sets the inner width so the pills split into two even rows. */
.chip-rows {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  -webkit-overflow-scrolling: touch;
}
.chip-rows::-webkit-scrollbar {
  height: 4px;
}
.chip-rows::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}
.chips.rows-2 {
  flex-wrap: wrap;
  overflow: visible;
  padding: 0;
  max-width: none;
}

/* Wide screens: home tiles read "icon | title" with the description under the title. */
@media (min-width: 600px) {
  .tile {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    min-height: 0;
  }
  .tile svg {
    margin-top: 1px;
  }
  .tile:has(.badge) .tile-copy {
    padding-right: 76px;
  }
}

/* A picker whose pills are hidden (category / brand already chosen) takes no space. */
.chip-rows:has(> .chips.hide) {
  display: none;
}

/* Entry-mode tabs (Quick / Bulk / Manual / Model-wise): the current mode is filled with the accent. */
.entry-head .seg {
  border: 1px solid var(--line);
}
.entry-head .seg a.on {
  background: var(--acc);
  color: var(--acc-ink);
  font-weight: 800;
  outline: 2px solid var(--acc-text);
  outline-offset: -2px;
  box-shadow: 0 2px 7px color-mix(in srgb, var(--acc) 45%, transparent);
}
/* Owner Control → Catalogue: server-side fuzzy search lists (mirrors CatalogFilter / CatalogStatus in src/screens/Admin.tsx) */
.cat-search .sec-h small {
  display: block;
  font-size: 0.8rem;
}
.cs-bar {
  display: grid;
  gap: 8px;
  padding: 14px 14px 12px;
}
.cs-input {
  position: relative;
}
.cs-input .cs-q {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 6px 40px 6px 12px;
  font-size: 0.9rem;
}
.cs-input .cs-q::-webkit-search-cancel-button {
  display: none;
}
.cs-clear {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.cs-clear:hover {
  background: var(--soft);
}
.cs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}
.cs-filter {
  flex: 1 1 140px;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.cs-filter .cs-fq {
  width: 100%;
  box-sizing: border-box;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.85rem;
}
.cs-chip {
  justify-self: start;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  background: var(--pri);
  color: var(--pri-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.cs-sugg {
  display: grid;
}
.cs-sugg:empty {
  display: none;
}
.cs-opt {
  min-height: 40px;
  padding: 0 8px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.cs-opt:hover {
  background: var(--soft);
}
.cs-opt small {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}
.cs-status, .cs-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}
.cs-more .btn {
  flex: 1;
}
.cs-list .item {
  padding: 8px 10px 8px 14px;
  min-height: 52px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.cs-msg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}
.cs-msg.bad {
  color: var(--danger);
  flex-basis: 100%;
}
.cs-spin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid var(--muted);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
.iconbtn.danger {
  color: var(--danger);
}

/* Mobile responsiveness for Admin Catalogue Management */
.admin-cat-head-row {
  display: flex;
  justify-content: space-between;
}
@media (max-width: 600px) {
  .admin-cat-head {
    padding: 12px 14px !important;
  }
  .admin-cat-head-row {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .admin-cat-head-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px !important;
    width: 100%;
  }
  .admin-cat-head-actions .btn {
    padding: 0 4px;
    font-size: 0.78rem;
    white-space: nowrap;
    justify-content: center;
  }
  .cs-bar {
    padding: 10px 10px 8px;
    gap: 6px;
  }
  .cs-filters {
    flex-direction: column;
    gap: 6px;
  }
  .cs-filter {
    flex: 1 1 100%;
    width: 100%;
  }
  .cs-list .item {
    padding: 10px 8px 10px 12px;
    gap: 8px;
  }
  .cs-list .item .grow {
    min-width: 0;
  }
  .cs-list .item b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cs-list .item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
