/* ==========================================================================
   Nitriv Commerce — design system
   Hand-written, no CDN: the CSP blocks third-party stylesheets and fonts, and
   a shared-host deployment should not depend on a network fetch to look right.
   ========================================================================== */

:root {
  color-scheme: light;
  --ink-900: #0f1419;
  --ink-800: #161d25;
  --ink-700: #1f2933;
  --ink-600: #2c3945;
  --ink-400: #56646f;
  --ink-300: #8a97a1;

  --paper: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --line: #e4dfd5;

  --gold-600: #9a7b2f;
  --gold-500: #bb9440;
  --gold-100: #f3e9d2;

  --green: #1f7a55;
  --green-bg: #e3f3ec;
  --amber: #a46a12;
  --amber-bg: #fbeed7;
  --red: #a8342c;
  --red-bg: #fae6e4;
  --blue: #29557f;
  --blue-bg: #e4eefa;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 20, 25, .06), 0 8px 24px rgba(15, 20, 25, .06);
  --shadow-sm: 0 1px 2px rgba(15, 20, 25, .08);

  --btn-solid-bg: #14161a;
  --btn-solid-bg-hover: #24272e;
  --btn-solid-fg: #ffffff;

  --sans: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink-800);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  letter-spacing: -.005em;
}

a {
  color: var(--gold-600);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  margin: 0 0 .4em;
  font-weight: 600;
  letter-spacing: -.01em;
}

h1 {
  font-size: 1.55rem;
}

h2 {
  font-size: 1.15rem;
}

h3 {
  font-size: 1rem;
}

.serif {
  font-family: var(--serif);
}

.muted {
  color: var(--ink-400);
}

.small {
  font-size: .85rem;
}

.tiny {
  font-size: .78rem;
}

.mono {
  font-family: var(--mono);
  font-size: .85em;
}

.right {
  text-align: right;
}

.center {
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.grow {
  flex: 1;
}

/* ---------------------------------------------------------------- layout */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--ink-900);
  color: #cfd6dc;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--gold-500), var(--gold-600));
  color: var(--ink-900);
  font-weight: 700;
  font-size: .85rem;
  display: grid;
  place-items: center;
}

.brand-name {
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: -.01em;
}

.brand-sub {
  color: var(--ink-300);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-label {
  color: #6f7c88;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 12px 10px 4px;
}

.nav a {
  color: #cfd6dc;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.nav a:hover {
  background: var(--ink-700);
  color: #fff;
  text-decoration: none;
}

.nav a.active {
  background: var(--ink-700);
  color: #fff;
  box-shadow: inset 2px 0 0 var(--gold-500);
}

.nav .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-500);
  margin-left: auto;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--ink-700);
  padding-top: 12px;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  margin: 0;
  font-size: 1.1rem;
}

.content {
  padding: 24px 26px 60px;
  max-width: 1180px;
  width: 100%;
}

/* ---------------------------------------------------------------- cards */
.card {
    position: relative;
    overflow: hidden;

    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;

    box-shadow:
        0 1px 2px rgba(0, 0, 0, .04),
        0 10px 30px rgba(0, 0, 0, .05);

    transition:
        transform .25s cubic-bezier(.22, 1, .36, 1),
        border-color .25s ease,
        box-shadow .25s ease;
}

.card:hover {
    transform: translateY(-0.5px);
    box-shadow:
        0 12px 34px rgba(0, 0, 0, .08);
}

.card.highlight {
    border-color: color-mix(
        in srgb,
        var(--btn-solid-bg) 35%,
        var(--line)
    );
}

.card.muted {
    opacity: .58;
}

.card.muted:hover {
    opacity: .85;
}

.card.highlight::before {
    content: "";

    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;

    height: 2px;

    background: var(--btn-solid-bg);
    border-radius: 0 0 999px 999px;
}

.card-head {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 15px 18px;

    border-bottom: 1px solid var(--line);
}

.card-head h2 {
    margin: 0;

    font-size: .96rem;
    font-weight: 650;
    letter-spacing: -.01em;
}

.card-body {
    padding: 20px;
}

.card-body.tight {
    padding: 13px 18px;
}



.plan-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.plan-card .plan-top {
    margin-bottom: 18px;
}

.plan-card .plan-name {
    margin: 0;

    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -.02em;
}

.plan-card .plan-description {
    margin-top: 5px;

    font-size: .84rem;
    line-height: 1.5;

    color: var(--ink-400);
}

.plan-card .plan-price {
    display: flex;
    align-items: baseline;
    gap: 4px;

    margin-top: 16px;

    font-size: 1.65rem;
    font-weight: 750;
    letter-spacing: -.04em;
}

.plan-card .plan-price span {
    font-size: .78rem;
    font-weight: 500;
    color: var(--ink-400);
    letter-spacing: 0;
}

.plan-card .plan-features {
    margin: 0 0 20px;
    padding: 15px 0 0;

    border-top: 1px solid var(--line);

    list-style: none;
}

.plan-card .plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    padding: 5px 0;

    font-size: .83rem;
    line-height: 1.45;

    color: var(--ink);
}

.plan-card .plan-features li::before {
    content: "✓";

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 18px;
    width: 18px;
    height: 18px;

    margin-top: 1px;

    border-radius: 50%;

     background: color-mix(
        in srgb,
        var(--btn-solid-bg) 14%,
        var(--surface)
    );

    color: color-mix(
        in srgb,
        var(--btn-solid-bg) 72%,
        var(--ink) 28%
    );

    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
}

.plan-card .plan-action {
    margin-top: auto;
}

.plan-card .plan-action .btn {
    width: 100%;
}




.grid {
  display: grid;
  gap: 16px;
}

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

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

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

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

.stat {
  padding: 16px 18px;
}

.stat .label {
  color: var(--ink-400);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.stat .value {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-top: 4px;
  font-family: var(--serif);
}

.stat .delta {
  font-size: .8rem;
  color: var(--ink-400);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wrap {
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- forms */

label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-600);
  margin-bottom: 5px;
}

.field {
  margin-bottom: 14px;
}

.hint {
  font-size: .78rem;
  color: var(--ink-400);
  margin-top: 5px;
}

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=date], select, textarea {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  font-size: .92rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-800);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(187, 148, 64, .16);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input[disabled], select[disabled] {
  background: var(--surface-2);
  color: var(--ink-400);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
}

.check input {
  width: auto;
}

.check label {
  margin: 0;
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: .89rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--btn-solid-bg);
  color: var(--btn-solid-fg);
  text-decoration: none;
}

.btn:hover {
  background: var(--btn-solid-bg-hover);
  text-decoration: none;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn.gold {
  background: var(--gold-600);
}

.btn.gold:hover {
  background: var(--gold-500);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-700);
}

.btn.ghost:hover {
  background: var(--surface-2);
}

.btn.danger {
  background: var(--red);
}

.btn.small {
  padding: 8px 11px;
  font-size: .82rem;
}

.btn.block {
  width: 100%;
}

/* ---------------------------------------------------------------- tables */

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-400);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-2);
}

.table-wrap {
  overflow-x: auto;
}

.thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-600);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.badge.green {
  background: var(--green-bg);
  color: var(--green);
  border-color: transparent;
}

.badge.amber {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: transparent;
}

.badge.red {
  background: var(--red-bg);
  color: var(--red);
  border-color: transparent;
}

.badge.blue {
  background: var(--blue-bg);
  color: var(--blue);
  border-color: transparent;
}

.badge.gold {
  background: var(--gold-100);
  color: var(--gold-600);
  border-color: transparent;
}

/* ---------------------------------------------------------------- misc */

.notice {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  border: 1px solid transparent;
  margin-bottom: 14px;
}

.notice.error {
  background: var(--red-bg);
  color: var(--red);
}

.notice.ok {
  background: var(--green-bg);
  color: var(--green);
}

.notice.info {
  background: var(--blue-bg);
  color: var(--blue);
}

.notice.warn {
  background: var(--amber-bg);
  color: var(--amber);
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-400);
}

.empty .title {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink-600);
  margin-bottom: 6px;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--gold-500);
  animation: spin .7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.toast {
  background: var(--btn-solid-bg);
  color: var(--btn-solid-fg);
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  font-size: .89rem;
  max-width: 360px;
  font-weight: 500;
  animation: slideInUp .3s ease-out;
  word-wrap: break-word;
}

.toast.error {
  background: var(--red);
  color: #fff;
  border-left: 4px solid rgba(255, 255, 255, .3);
}

.toast.ok {
  background: var(--green);
  color: #fff;
  border-left: 4px solid rgba(255, 255, 255, .3);
}

@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.success-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 100%;
  text-align: center;
}

.success-icon {
  font-size: 3.2rem;
  margin-bottom: 16px;
  display: block;
  animation: scaleIn .4s cubic-bezier(.68, -0.55, .265, 1.55);
}

.success-message h2 {
  font-size: 1.35rem;
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--green);
}

.order-code {
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--ink-400);
  margin: 12px 0 8px;
  background: var(--surface-2);
  padding: 8px 12px;
  border-radius: 8px;
  letter-spacing: .05em;
}

.order-message {
  font-size: .92rem;
  color: var(--ink-600);
  margin: 12px 0 0;
  max-width: 300px;
  line-height: 1.5;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-host {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 25, .5);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 90;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: min(560px, 100%);
  box-shadow: var(--shadow);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist .item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .89rem;
}

.checklist .tick {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .7rem;
  border: 1px solid var(--line);
  color: var(--ink-300);
}

.checklist .item.done .tick {
  background: var(--green-bg);
  color: var(--green);
  border-color: transparent;
}

.checklist .item.done span {
  color: var(--ink-400);
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 90px;
}

.bars .bar {
  flex: 1;
  background: var(--gold-100);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  position: relative;
}

.bars .bar span {
  position: absolute;
  inset: auto 0 -18px;
  text-align: center;
  font-size: .62rem;
  color: var(--ink-300);
}

.bars .bar.strong {
  background: var(--gold-500);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.image-tile {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}

.image-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.image-tile .remove {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(15, 20, 25, .78);
  color: #fff;
  border: none;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: .8rem;
  line-height: 1;
}

.image-tile.primary::after {
  content: "Cover";
  position: absolute;
  left: 5px;
  bottom: 5px;
  background: var(--gold-600);
  color: #fff;
  font-size: .66rem;
  padding: 2px 7px;
  border-radius: 999px;
}

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  color: var(--ink-400);
  font-size: .88rem;
  cursor: pointer;
  background: var(--surface-2);
}

.dropzone.hot {
  border-color: var(--gold-500);
  background: var(--gold-100);
  color: var(--gold-600);
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.bubble {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: .88rem;
  max-width: 78%;
  white-space: pre-wrap;
  word-break: break-word;
}

.bubble.customer {
  background: var(--surface-2);
  border: 1px solid var(--line);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.bubble.ai, .bubble.bot {
  background: var(--btn-solid-bg);
  color: var(--btn-solid-fg);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.bubble.seller {
  background: var(--gold-100);
  color: var(--ink-800);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.bubble .who {
  display: block;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .6;
  margin-bottom: 3px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline .entry {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  font-size: .86rem;
}

.timeline .when {
  color: var(--ink-400);
  font-size: .78rem;
  min-width: 118px;
}

/* ---------------------------------------------------------------- auth */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-side {
  background: var(--btn-solid-bg);
  color: var(--btn-solid-fg);
  padding: 46px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-side h2 {
  font-family: var(--serif);
  font-size: 1.9rem;
  color: var(--btn-solid-fg);
  max-width: 440px;
  line-height: 1.25;
}

.auth-side p {
  color: #9aa6b1;
  max-width: 420px;
}

.auth-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 26px;
}

.auth-points div {
  color: #cfd6dc;
  font-size: .92rem;
  display: flex;
  gap: 10px;
}

.auth-points b {
  color: var(--gold-500);
}

.auth-form {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.auth-card {
  width: min(410px, 100%);
}

.auth-card h1 {
  font-family: var(--serif);
}

/* ---------------------------------------------------------------- storefront */

.store {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 14px 110px;
  background: var(--paper);
  color: var(--ink-800);
}

.store-head {
  padding: 6px 2px 14px;
}

.store-head h1 {
  font-family: var(--serif);
  margin-bottom: 2px;
}

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 4px 0 10px;
}

.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .84rem;
  white-space: nowrap;
  cursor: pointer;
}

.chip.on {
  background: var(--btn-solid-bg);
  color: var(--btn-solid-fg);
  border-color: var(--btn-solid-bg);
}

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

.product {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.product img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--surface-2);
}

.product .noimg {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--ink-300);
  background: var(--surface-2);
  font-size: .8rem;
}

.product .meta {
  padding: 6px 8px;
}

.product .name {
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.25;
}

.product .price {
  font-family: var(--serif);
  font-size: .95rem;
  margin-top: 2px;
}

.product .out {
  color: var(--red);
  font-size: .76rem;
}

.sheet {
  position: fixed;
  inset: 0;
  background: var(--paper);
  overflow-y: auto;
  z-index: 80;
  padding: 16px 14px 120px;
}

.sheet .back {
  background: none;
  border: none;
  font: inherit;
  color: var(--ink-400);
  cursor: pointer;
  padding: 10px 8px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.gallery img {
  width: 78%;
  flex: 0 0 auto;
  border-radius: var(--radius);
  aspect-ratio: 1;
  object-fit: cover;
}

.qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: fit-content;
}

.qty button {
  background: var(--surface);
  border: none;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
}

.qty input {
  width: 58px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.tierlist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.tierlist .t {
  display: flex;
  justify-content: space-between;
  font-size: .84rem;
  padding: 6px 10px;
  background: var(--gold-100);
  border-radius: var(--radius-sm);
}

.bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 70;
}

.bottombar .total {
  font-family: var(--serif);
  font-size: 1.05rem;
}

.cart-line {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.cart-line:last-child {
  border-bottom: none;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 960px) {
  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .auth-wrap {
    grid-template-columns: 1fr;
  }

  .auth-side {
    display: none;
  }
}

@media (max-width: 760px) {
  .shell {
    flex-direction: column;
  }

  .sidebar {
    display: none;
  }

  /* replaced on mobile by the fixed bottom tab bar */
  .content {
    padding: 16px 14px 90px;
  }

  /* extra bottom space so the tabbar never covers content */
  .grid.cols-2, .grid.cols-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar {
    padding: 12px 14px;
  }
}

/* ---------------------------------------------------------------- mobile tab bar */
.mobile-tabbar {
  display: none;
}

@media (max-width: 760px) {
  .mobile-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(15, 20, 25, .05);
  }

  .mobile-tabbar a, .mobile-tabbar button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 2px;
    border: none;
    background: none;
    color: var(--ink-400);
    font-size: .66rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
  }

  .mobile-tabbar a.active, .mobile-tabbar button.active {
    color: var(--gold-600);
  }

  .mobile-tabbar .nav-icon {
    width: 21px;
    height: 21px;
  }
}

@media print {
  .sidebar, .topbar, .btn {
    display: none !important;
  }

  .card {
    box-shadow: none;
  }
}

/* NITRIV V3 VISUAL SYSTEM */
:root {
  --ink-900: #111216;
  --ink-800: #1b1c21;
  --ink-700: #30323a;
  --ink-600: #50535d;
  --ink-400: #777b86;
  --ink-300: #a0a4ad;
  --paper: #f4f5f7;
  --surface: #fff;
  --surface-2: #f8f9fb;
  --line: #e5e7eb;
  --gold-600: #6c4df6;
  --gold-500: #8067ff;
  --gold-100: #efecff;
  --green: #138a63;
  --green-bg: #e4f7f0;
  --amber: #a96a00;
  --amber-bg: #fff2d5;
  --red: #c63e4b;
  --red-bg: #ffe8ec;
  --blue: #3e65ad;
  --blue-bg: #e9efff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 16px 45px rgba(23, 27, 38, .09);
  --shadow-sm: 0 1px 2px rgba(23, 27, 38, .04), 0 5px 18px rgba(23, 27, 38, .035);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: var(--sans)
}

html[data-theme=dark] {
  --ink-900: #f6f6f8;
  --ink-800: #ededf0;
  --ink-700: #d5d6dc;
  --ink-600: #b6b8c1;
  --ink-400: #92959f;
  --ink-300: #727681;
  --paper: #0d0e11;
  --surface: #17181c;
  --surface-2: #1e2025;
  --line: #2a2c33;
  --gold-600: #8b72ff;
  --gold-500: #a08cff;
  --gold-100: #282340;
  --green-bg: #16372e;
  --amber-bg: #3a2d13;
  --red-bg: #3a1e24;
  --blue-bg: #1c2840;
  --shadow: 0 18px 55px rgba(0, 0, 0, .3)
}

html, body {
  background: var(--paper);
  font-family: var(--sans);
  transition: background .2s, color .2s
}

.serif {
  font-family: var(--sans)
}

.sidebar {
  width: 248px;
  flex-basis: 248px;
  background: var(--surface);
  color: var(--ink-600);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  box-shadow: none
}

.brand {
  padding: 0 10px 16px
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gold-600);
  color: #fff
}

.brand-name {
  color: var(--ink-900);
  font-size: 1rem
}

.brand-sub {
  color: var(--ink-400)
}

.nav {
  gap: 4px
}

.nav-label {
  color: var(--ink-300);
  font-size: .65rem;
  font-weight: 700
}

.nav a {
  color: var(--ink-600);
  padding: 10px 12px;
  border-radius: 10px
}

.nav a:hover {
  background: var(--surface-2);
  color: var(--ink-900)
}

.nav a.active {
  background: var(--gold-100);
  color: var(--gold-600);
  box-shadow: none;
  font-weight: 700
}

.sidebar-footer {
  border-color: var(--line)
}

.main {
  background: var(--paper)
}

.topbar {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
  border-color: var(--line);
  padding: 15px 30px
}

.topbar h1 {
  font-size: 1.12rem;
  font-weight: 750;
  color: var(--ink-900)
}

.content {
  max-width: 1320px;
  padding: 28px 30px 70px
}

.card {
  border-color: var(--line);
  box-shadow: var(--shadow);
  border-radius: 14px;
  transition: box-shadow .2s ease, transform .2s ease;
}

.card:hover {
  box-shadow: 0 20px 55px rgba(23, 27, 38, .13);
}

.stat {
  padding: 19px
}

.stat .label {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 550
}

.stat .value {
  font-family: var(--sans);
  font-size: 1.8rem;
  font-weight: 750
}

.grid {
  gap: 14px
}

.btn {
  border-radius: 10px;
  padding: 9px 15px
}

.btn.gold {
  background: var(--gold-600)
}

.btn.ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-700)
}

.btn.ghost:hover {
  background: var(--surface-2)
}

input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
  background: var(--surface);
  border-color: var(--line);
  border-radius: 10px
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-600);
  cursor: pointer;
  font-size: 17px
}

.theme-moon {
  display: none
}

html[data-theme=dark] .theme-sun {
  display: none
}

html[data-theme=dark] .theme-moon {
  display: inline
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--paper);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 13px;
  transition: opacity .4s, visibility .4s
}

.app-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none
}

.loader-word {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -.045em
}

.loader-orbit {
  position: relative;
  width: 44px;
  height: 44px
}

.loader-orbit span {
  position: absolute;
  inset: 5px;
  border: 2px solid transparent;
  border-top-color: var(--gold-600);
  border-radius: 50%;
  animation: spin 1s linear infinite
}

.loader-orbit span:nth-child(2) {
  inset: 11px;
  border-right-color: var(--gold-500);
  animation-direction: reverse;
  animation-duration: .72s
}

.loader-orbit span:nth-child(3) {
  inset: 17px;
  border-bottom-color: var(--gold-600);
  animation-duration: .5s
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 20px
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 12, .55);
  backdrop-filter: blur(7px)
}

.confirm-dialog {
  position: relative;
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .2);
  padding: 22px
}

.confirm-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--red-bg);
  color: var(--red);
  font-weight: 800;
  float: left;
  margin-right: 12px
}

.confirm-icon.info {
  background: var(--blue-bg);
  color: var(--blue);
  font-style: italic;
  font-family: var(--serif)
}

.confirm-copy h2 {
  margin: 2px 0 4px;
  font-size: 1.05rem
}

.confirm-copy p {
  margin: 0;
  color: var(--ink-400);
  font-size: .88rem
}

.confirm-actions {
  clear: both;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 22px
}

.button-loader {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite
}

.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: grid;
  align-items: end;
  justify-content: center
}

.bottom-sheet.hidden {
  display: none
}

.bottom-sheet [data-sheet-backdrop] {
  opacity: 0;
  transition: opacity .22s ease
}

.bottom-sheet.show [data-sheet-backdrop] {
  opacity: 1;
  transition: ease-in-out .22s;
}

.bottom-sheet-panel {
  position: relative;
  /* top: -80%; */
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .2);
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32, .72, 0, 1)
}

.bottom-sheet.show .bottom-sheet-panel {
  transform: translateY(0)
}

.bottom-sheet-panel.dragging {
  transition: none
}

.bottom-sheet-panel:before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin: 2px auto 14px
}

.bottom-sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
  padding: 0 4px
}

.bottom-sheet-head h2 {
  margin: 0;
  font-size: 1.02rem
}

.bottom-sheet-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--ink-400);
  cursor: pointer;
  line-height: 1;
  padding: 4px
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 0 4px
}

.sheet-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: 12px;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
  color: var(--ink-800);
  font: inherit;
  cursor: pointer
}

.sheet-action:hover {
  background: var(--surface-2);
  text-decoration: none
}

.sheet-action .icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gold-100);
  color: var(--gold-600);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex: 0 0 auto
}

.sheet-action .icon.blue {
  background: var(--blue-bg);
  color: var(--blue)
}

.sheet-action .icon.green {
  background: var(--green-bg);
  color: var(--green)
}

.sheet-action .label {
  font-weight: 650;
  font-size: .92rem;
  display: block
}

.sheet-action .sub {
  font-size: .78rem;
  color: var(--ink-400);
  display: block
}

@media(min-width:761px) {
  .bottom-sheet {
    align-items: center;
  }
  .bottom-sheet-panel {
    border-radius: 20px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0;
    transform: translateY(12px);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
  }
  .bottom-sheet.show .bottom-sheet-panel {
    transform: translateY(0);
    opacity: 1;
  }
  .bottom-sheet-panel:before {
    display: none; /* the drag handle only makes sense on a mobile slide-up sheet */
  }
}

/* storefront */
.store {
  max-width: 980px;
  min-height: 100vh;
  padding: 28px 20px 110px;
  background: var(--paper);
  color: var(--ink-800);
  font-family: var(--sans)
}

.store-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 2px 20px
}

.store-head h1 {
  font-family: var(--sans);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -.045em
}

.store [data-search] {
  height: 46px;
  border-radius: 14px;
  padding-left: 15px;
  margin-bottom: 10px !important;
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .04)
}

.store-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto
}

.store-profile>div:last-child {
  min-width: 0;
  flex: 1 1 auto
}

.store-head h1 {
  white-space: normal;
  overflow-wrap: anywhere
}

.store-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto
}

.store-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink-900);
  color: var(--surface);
  font-weight: 800;
  font-size: 1.05rem
}

.store-head .muted {
  margin: 2px 0 0
}

.store-cart-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-900);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
  max-width: 124px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap
}

.store-search {
  position: relative
}

.store-search>span {
  position: absolute;
  left: 14px;
  top: 10px;
  color: var(--ink-400);
  font-size: 20px;
  z-index: 1
}

.store-search input {
  padding-left: 38px !important
}

.store .product {
  cursor: pointer
}

.store .product:active {
  transform: scale(.985)
}

@media(max-width:760px) {
  .store-head {
    padding-bottom: 16px
  }

  .store-cart-pill {
    font-size: .72rem;
    padding: 8px 10px;
    max-width: 112px
  }

  .store-avatar {
    width: 42px;
    height: 42px
  }

  .store-head h1 {
    font-size: 1.25rem
  }

  .store-search input {
    height: 44px
  }

  .store .products {
    gap: 16px 12px
  }

  .store .product .name {
    font-size: .86rem
  }

  .store .product .price {
    font-size: .9rem
  }

  .store .product .meta {
    padding-top: 8px
  }
}

/* storefront v4 polish */
.store-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  transition: box-shadow .2s
}

.store-head.scrolled {
  box-shadow: 0 6px 18px rgba(20, 20, 30, .06)
}

.product {
  position: relative
}

.product-media {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2)
}

.product-media img, .product-media .noimg {
  aspect-ratio: 4/5;
  display: block;
  width: 100%
}

.product-media .noimg {
  display: grid;
  place-items: center;
  color: var(--ink-300);
  font-size: .78rem
}

.product.is-out img {
  filter: grayscale(.5) opacity(.6)
}

.product-media.has-fallback img {
  display: none
}

.product-media.has-fallback .noimg {
  display: grid
}

/* ---- header ---------------------------------------------------------- */

.store-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.store-theme-toggle {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-600);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}

.store-theme-toggle .icon {
  width: 18px;
  height: 18px;
  display: block;
}

.store-theme-toggle .theme-moon {
  display: none;
}

html[data-theme=dark] .store-theme-toggle .theme-sun {
  display: none;
}

html[data-theme=dark] .store-theme-toggle .theme-moon {
  display: inline;
}

.store-cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  max-width: 124px;
  min-width: 0;
  background: var(--btn-solid-bg);
  color: var(--btn-solid-fg);
  border: 1px solid var(--btn-solid-bg);
  border-radius: 999px;
  padding: 10px 12px 10px 10px;
  font-weight: 700;
  font-size: .74rem;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease;
}

.store-cart-pill .cart-pill-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex: 0 0 auto;
}

.store-cart-pill .cart-pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-cart-pill:active {
  transform: scale(.95);
}

.cart-pill-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--gold-500);
  color: #fff;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
}

.cart-pill-badge.bump {
  animation: pillBump .3s ease;
}

@keyframes pillBump {
  0% {
    transform: scale(1)
  }

  40% {
    transform: scale(1.35)
  }

  100% {
    transform: scale(1)
  }
}

/* ---- forms inside sheets ------------------------------------------------ */

.sheet .field label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-500, var(--ink-400));
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.sheet input[type=text], .sheet input[type=tel], .sheet select {
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  font-size: .95rem;
  color: var(--ink-900);
  caret-color: var(--gold-600);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

html[data-theme=dark] .sheet input[type=text], html[data-theme=dark] .sheet input[type=tel], html[data-theme=dark] .sheet select {
  caret-color: var(--gold-400);
}

.sheet input:focus, .sheet select:focus {
  outline: none;
  border-color: var(--gold-500);
  background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold-500) 18%, transparent);
}

/* drag handle affordance for the mobile bottom sheet */
.sheet.dragging {
  transition: none !important;
}

/* ---- bottom bar --------------------------------------------------------- */

.bottombar {
  background: var(--surface);
}

.bottombar .total {
  color: var(--ink-900);
  font-weight: 800;
}

.bottombar .btn.small.gold {
  border-radius: 999px;
  padding: 10px 18px;
}

@media (max-width: 760px) {
  .products {
    gap: 14px 10px;
  }

  .quick-add {
    width: 32px;
    height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-media img, .product:hover .product-media img {
    transition: none !important;
    transform: none !important;
  }
}

/* ---------------------------------------------------------------- storefront: skeleton loader */
.skel-img {
  aspect-ratio: 4/5;
  border-radius: 16px;
  background: linear-gradient(100deg, var(--surface-2) 25%, var(--line) 45%, var(--surface-2) 65%);
  background-size: 250% 100%;
  animation: skelShimmer 1.25s ease-in-out infinite;
}

.skel-line {
  height: 10px;
  border-radius: 6px;
  margin-top: 9px;
  background: linear-gradient(100deg, var(--surface-2) 25%, var(--line) 45%, var(--surface-2) 65%);
  background-size: 250% 100%;
  animation: skelShimmer 1.25s ease-in-out infinite;
}

.skel-line.w70 {
  width: 70%;
}

.skel-line.w40 {
  width: 40%;
  margin-top: 7px;
}

.product.skel {
  pointer-events: none;
  border-color: transparent;
  box-shadow: none;
}

@keyframes skelShimmer {
  0% {
    background-position: 250% 0;
  }

  100% {
    background-position: -250% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skel-img, .skel-line {
    animation: none;
    opacity: .6;
  }
}

/* ---------------------------------------------------------------- storefront: bottom sheet, redone */
/* Previously .sheet was position:fixed;inset:0 with no transition at all, so
   the basket/detail view just popped in instantly full-screen. This makes it
   a real docked bottom sheet with a slide-up entrance and slide-down exit,
   the pattern already promised (but never defined) by the portal's own
   `sheetIn` reference — that animation name was used and never declared. */
@keyframes sheetSlideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes sheetSlideDown {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(100%);
  }
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(10, 10, 14, .5);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  display: none !important;
}

html[data-theme=dark] .sheet-backdrop {
  background: rgba(0, 0, 0, .7);
}

.sheet-backdrop.hidden {
  display: none;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 60;
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  color: var(--ink-800);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -24px 70px rgba(15, 20, 25, .25);
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  animation: sheetSlideUp .3s cubic-bezier(.32, .72, 0, 1);
}

html[data-theme=dark] .sheet {
  box-shadow: 0 -24px 70px rgba(0, 0, 0, .55);
}

.sheet.hidden {
  display: none;
}

.sheet.dragging {
  animation: none !important;
  transition: none !important;
}

.sheet.closing {
  animation: sheetSlideDown .22s ease forwards;
}

.sheet::before {
  content: "";
  display: block;
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
  margin: 2px auto 14px;
  flex-shrink: 0;
}

@media (min-width:761px) {
  .sheet {
    left: 50%;
    right: auto;
    bottom: 24px;
    transform: translateX(-50%);
    width: min(480px, calc(100% - 32px));
    border-radius: 20px;
    max-height: 82vh;
  }

  @keyframes sheetSlideUp {
    from {
      opacity: 0;
      transform: translate(-50%, 18px);
    }

    to {
      opacity: 1;
      transform: translate(-50%, 0);
    }
  }

  @keyframes sheetSlideDown {
    from {
      opacity: 1;
      transform: translate(-50%, 0);
    }

    to {
      opacity: 0;
      transform: translate(-50%, 18px);
    }
  }
}
/* ---------------------------------------------------------------- toggle switch (billing: auto-renew) */
.switch{ position:relative; display:inline-block; width:44px; height:26px; cursor:pointer; }
.switch input{ position:absolute; opacity:0; width:100%; height:100%; margin:0; cursor:pointer; }
.switch-track{
  position:absolute; inset:0; background:var(--surface-2); border:1px solid var(--line);
  border-radius:999px; transition:background .18s ease, border-color .18s ease;
}
.switch-thumb{
  position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%;
  background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:transform .18s ease;
}
.switch input:checked ~ .switch-track{ background:var(--gold-600); border-color:var(--gold-600); }
.switch input:checked ~ .switch-track .switch-thumb{ transform:translateX(18px); }
.switch input:disabled ~ .switch-track{ opacity:.5; cursor:not-allowed; }
.switch input:focus-visible ~ .switch-track{ box-shadow:0 0 0 3px rgba(154,123,47,.25); }
