/* ==========================================================================
   Design tokens — change the look here.
   ========================================================================== */
/* Monochrome: black, white and greys. Red is kept only for errors and failed orders. */
:root {
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --bg: #F4F4F4;          /* page */
  --surface: #FFFFFF;     /* cards */
  --surface-2: #FAFAFA;   /* table heads, insets */
  --ink: #0B0B0B;         /* main text */
  --ink-2: #3B3B3B;
  --muted: #5E5E5E;       /* secondary text (6:1 on white) */
  --line: #E2E2E2;
  --line-2: #EDEDED;
  --field: #C9C9C9;

  --accent: #0B0B0B;
  --accent-ink: #000000;
  --accent-soft: #E9E9E9;
  --accent-tint: #F5F5F5;

  --dark: #0B0B0B;        /* sidebar, dark bands */
  --dark-2: #171717;
  --dark-3: #232323;
  --dark-line: #262626;
  --dark-ink: #F2F2F2;
  --dark-muted: #9A9A9A;

  --ok-bg: #E6E6E6;   --ok: #0B0B0B;
  --warn-bg: #F1F1F1; --warn: #3B3B3B;
  --bad-bg: #FCE8E6;  --bad: #A1261B;
  --neutral-bg: #EFEFEF;

  --link: #0B0B0B;
  --link-hover: #000000;
  --accent-hover: #2A2A2A;
  --accent-soft-ink: #0B0B0B;   /* text on --accent-soft */
  --on-accent: #FFFFFF;
  --pill-on-bg: #0B0B0B;        /* selected pill */
  --pill-on-ink: #FFFFFF;
  --toast-bg: #0B0B0B;
  --toast-ink: #FFFFFF;
  --disabled-bg: #D6D6D6;
  --border-strong: #CFCFCF;
  --hover-line: #9E9E9E;
  --dot: rgba(11, 11, 11, .10);   /* dot-grid texture */

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, .22);
  color-scheme: light;
}

/* Dark theme: applied when the user picks Dark, or when they're on System and the device is dark. */
:root[data-theme="dark"] {
  --bg: #0B0B0B; --surface: #141414; --surface-2: #191919;
  --ink: #F2F2F2; --ink-2: #CFCFCF; --muted: #A0A0A0;
  --line: #282828; --line-2: #1F1F1F; --field: #3A3A3A;
  --accent: #F2F2F2; --accent-ink: #FFFFFF; --accent-soft: #262626; --accent-tint: #1C1C1C;
  --dark: #000000; --dark-2: #121212; --dark-3: #1E1E1E; --dark-line: #222222; --dark-ink: #F2F2F2; --dark-muted: #9A9A9A;
  --ok-bg: #242424; --ok: #E6E6E6; --warn-bg: #1E1E1E; --warn: #BDBDBD; --bad-bg: #3A1614; --bad: #FF8A7E; --neutral-bg: #232323;
  --link: #F2F2F2; --link-hover: #FFFFFF; --accent-hover: #FFFFFF; --accent-soft-ink: #F2F2F2; --on-accent: #0B0B0B;
  --pill-on-bg: #F2F2F2; --pill-on-ink: #0B0B0B; --toast-bg: #F2F2F2; --toast-ink: #0B0B0B;
  --disabled-bg: #262626; --border-strong: #3A3A3A; --hover-line: #555555;
  --dot: rgba(255, 255, 255, .09);
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0B0B; --surface: #141414; --surface-2: #191919;
    --ink: #F2F2F2; --ink-2: #CFCFCF; --muted: #A0A0A0;
    --line: #282828; --line-2: #1F1F1F; --field: #3A3A3A;
    --accent: #F2F2F2; --accent-ink: #FFFFFF; --accent-soft: #262626; --accent-tint: #1C1C1C;
    --dark: #000000; --dark-2: #121212; --dark-3: #1E1E1E; --dark-line: #222222; --dark-ink: #F2F2F2; --dark-muted: #9A9A9A;
    --ok-bg: #242424; --ok: #E6E6E6; --warn-bg: #1E1E1E; --warn: #BDBDBD; --bad-bg: #3A1614; --bad: #FF8A7E; --neutral-bg: #232323;
    --link: #F2F2F2; --link-hover: #FFFFFF; --accent-hover: #FFFFFF; --accent-soft-ink: #F2F2F2; --on-accent: #0B0B0B;
    --pill-on-bg: #F2F2F2; --pill-on-ink: #0B0B0B; --toast-bg: #F2F2F2; --toast-ink: #0B0B0B;
    --disabled-bg: #262626; --border-strong: #3A3A3A; --hover-line: #555555;
    --dot: rgba(255, 255, 255, .09);
    --shadow: 0 24px 48px -24px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

/* ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
img, svg { display: block; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; margin: 0; line-height: 1.1; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-primary:disabled { background: var(--disabled-bg); color: var(--muted); cursor: not-allowed; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-ghost { background: none; color: var(--ink); }
.btn-outline-accent { background: var(--surface); color: var(--link); border-color: var(--link); min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 16px; border-radius: 12px; }

/* Pills / chips */
.pill {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.pill[aria-pressed="true"] { background: var(--pill-on-bg); border-color: var(--pill-on-bg); color: var(--pill-on-ink); font-weight: 600; }
.pill-round { border-radius: 999px; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge-basic { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hover-line); }
.badge-hq { background: var(--ink); color: var(--surface); }
.badge-ph { background: var(--neutral-bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.badge-nd { background: var(--ink); color: var(--surface); box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 3px var(--surface); }   /* black with an inner ring: distinct from solid HQ */
.badge-pending { background: var(--neutral-bg); color: var(--ink-2); }
.badge-progress { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.badge-completed { background: var(--ink); color: var(--surface); }
.badge-partial { background: var(--neutral-bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hover-line); }
.badge-canceled, .badge-failed { background: var(--bad-bg); color: var(--bad); }
.badge-review { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* Cards & fields */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field .label { font-size: 14px; font-weight: 600; }
.input, .textarea, .select {
  width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--field);
  border-radius: 10px; background: var(--surface); font-size: 16px; /* 16px stops iOS zoom */
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.select:disabled { opacity: .55; cursor: not-allowed; }
.input:focus, .textarea:focus, .select:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); }
.hint.error { color: var(--bad); font-weight: 600; }
.alert { padding: 14px 16px; border-radius: var(--radius); font-size: 15px; display: flex; gap: 12px; align-items: flex-start; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-bad { background: var(--bad-bg); color: var(--bad); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-info { background: var(--accent-soft); color: var(--accent-soft-ink); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--toast-bg); color: var(--toast-ink); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 15px;
  opacity: 0; pointer-events: none; transition: .2s ease; z-index: 100; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad); }

/* Brand */
.brand { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }

/* ==========================================================================
   Landing
   ========================================================================== */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { height: 68px; display: flex; align-items: center; gap: 28px; }
.site-nav { display: flex; gap: 24px; flex: 1; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; }
.site-nav a:hover { color: var(--ink); }
.header-actions { display: flex; gap: 8px; }

.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; align-items: center; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent-soft-ink); background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; }
.hero h1 { font-size: clamp(38px, 5.2vw, 60px); line-height: 1.04; letter-spacing: -0.02em; margin: 18px 0; }
.hero p.lead { font-size: 19px; color: var(--ink-2); max-width: 520px; }
.hero-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.pay-row { display: flex; gap: 10px; align-items: center; margin-top: 24px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.pay-chip { font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 4px 10px; border-radius: 8px; }
.hero-card { padding: 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.svc-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.svc-row .grow { flex: 1; min-width: 0; }
.svc-row .t { font-weight: 600; font-size: 15px; }
.svc-row .s { font-size: 13px; color: var(--muted); }
.svc-row .p { font-weight: 700; font-size: 15px; text-align: right; white-space: nowrap; }

section.block { padding: 72px 0; }
section.block h2 { font-size: clamp(30px, 3.4vw, 40px); }
.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; max-width: 720px; }
.section-head p { font-size: 17px; color: var(--ink-2); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.step { padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.step .n { font-family: var(--font-display); font-weight: 700; color: var(--link); font-size: 20px; }
.step h3 { font-family: var(--font-body); font-size: 19px; font-weight: 700; }
.step p { color: var(--ink-2); }

.dark-band { background: var(--dark); color: var(--dark-ink); }
.dark-band h2 { color: #fff; }
.dark-band .section-head p { color: #B9BCC4; }
.tier-card { background: var(--dark-2); border-radius: var(--radius-lg); padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.tier-card p { color: #D6D8DD; }
.kv { display: flex; flex-direction: column; gap: 9px; border-top: 1px solid #33363F; padding-top: 14px; font-size: 15px; }
.kv div { display: flex; justify-content: space-between; gap: 12px; }
.kv dt, .kv .k { color: var(--dark-muted); }
.kv .v { font-weight: 600; }

.price-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; background: var(--surface-2); padding: 12px 18px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line-2); font-size: 15px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table-card { overflow: hidden; }
.more-services { margin-top: 14px; font-size: 15px; color: var(--ink-2); }
.more-services a { font-weight: 600; }
.table-scroll { overflow-x: auto; }

.notice { padding: 24px 26px; display: flex; gap: 16px; align-items: flex-start; }
.notice h3 { font-family: var(--font-body); font-size: 18px; margin-bottom: 8px; }
.notice p { color: var(--ink-2); }

.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { font-weight: 600; font-size: 17px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 10px; color: var(--ink-2); }

.site-footer { background: var(--dark); color: #B9BCC4; padding: 44px 0; }
.site-footer .wrap { display: flex; gap: 40px; flex-wrap: wrap; }
.site-footer .brand { color: #fff; }
.site-footer a { color: #D6D8DD; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }

/* ==========================================================================
   Auth page
   ========================================================================== */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.tabs button { min-height: 42px; border: 0; border-radius: 9px; background: none; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--dark); color: #E9E8E3;
  display: flex; flex-direction: column; gap: 22px; padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { color: #fff; padding: 0 8px; }
.balance-card { background: var(--dark-2); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.balance-card .k { font-size: 13px; color: var(--dark-muted); }
.balance-card .v { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: #fff; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  color: #C4C7CE; text-decoration: none; font-size: 15px; font-weight: 500;
}
.side-nav a:hover { color: #fff; background: #1D2027; }
.side-nav a[aria-current="page"] { background: var(--dark-3); color: #fff; font-weight: 600; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 6px 0; border-top: 1px solid var(--dark-line); }
.avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 999px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.side-user .email { font-size: 13px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.icon-btn { width: 44px; height: 44px; border: 0; background: none; color: var(--dark-muted); cursor: pointer; display: grid; place-items: center; border-radius: 10px; }
.icon-btn:hover { color: #fff; background: #1D2027; }

.main { flex: 1; min-width: 0; padding: 30px 36px 60px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; flex: 1; }

.two-col { display: flex; gap: 22px; align-items: flex-start; }
.two-col > .primary { flex: 1; min-width: 0; }
.two-col > .aside { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.panel { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

.pill-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.pill-row::-webkit-scrollbar { display: none; }

.svc-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 2px; }
.svc-option {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 13px 14px;
  border-radius: 12px; border: 2px solid var(--line); background: var(--surface); text-align: left; cursor: pointer;
}
.svc-option:hover { border-color: var(--hover-line); }
.svc-option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); }
.svc-option .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.svc-option .t { font-weight: 600; font-size: 15px; }
.svc-option .s { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.svc-option .p { font-weight: 700; font-size: 14px; white-space: nowrap; text-align: right; min-width: 88px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.charge-box { display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: var(--bg); border-radius: 12px; flex-wrap: wrap; }
.charge-box .k { font-size: 13px; color: var(--muted); }
.charge-box .v { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }

.details { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.details h3 { font-family: var(--font-body); font-size: 16px; font-weight: 700; flex: 1; }
.details .kv { border-top-color: var(--line-2); font-size: 14px; }
.details .kv .k { color: var(--muted); }

.orders-toolbar { display: flex; gap: 12px; align-items: center; }
.orders-toolbar .pill-row { flex: 1; min-width: 0; }
.orders-toolbar .input { max-width: 280px; }
.orders-table th, .orders-table td { padding: 12px 14px; }
.orders-table td { font-size: 14px; }
.orders-table td[data-col="refill"] { white-space: nowrap; }
.orders-table .svc { font-weight: 600; }
.orders-table .link { font-size: 13px; color: var(--muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.open-link { min-height: 32px; padding: 4px 11px; margin-top: 6px; gap: 6px; font-size: 13px; border-radius: 8px; background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.open-link:hover { border-color: var(--ink); color: var(--ink); }
/* orders table → cards whenever the card is too narrow for 8 columns (phones, and iPads beside the sidebar) */
.orders-card { container: orders / inline-size; }
@media (max-width: 1100px) {
  .orders-toolbar { flex-direction: column; align-items: stretch; }
  .orders-toolbar .input { max-width: none; }
}
@container orders (max-width: 900px) {
  .orders-scroll { overflow-x: visible; }

  .orders-table thead { display: none; }
  .orders-table, .orders-table tbody, .orders-table tr, .orders-table td { display: block; width: 100%; }
  .orders-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  .orders-table td { border: 0; padding: 0; }
  .orders-table td[data-col="svc"] { grid-column: 1 / -1; }
  .orders-table td[data-col="id"], .orders-table td[data-col="date"] { font-size: 12px; color: var(--muted); }
  .orders-table td[data-col="date"] { text-align: right; }
  .orders-table td[data-col="qty"]::before { content: "Qty "; color: var(--muted); }
  .orders-table td[data-col="remains"]::before { content: "Remains "; color: var(--muted); }
  .orders-table .num { text-align: left; }
  .orders-table td[data-col="remains"], .orders-table td[data-col="status"] { text-align: right; }
  .orders-table td[data-col="charge"] { font-size: 16px; }
  .orders-table td[data-col="refill"] { grid-column: 1 / -1; }
  .orders-table td[data-col="refill"]:has(.refill-none) { display: none; }
  .orders-table .link { max-width: none; }
}
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.method { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; }
.method[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); }
.method .mark { width: 40px; height: 40px; border-radius: 10px; color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.amount-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.amount-input { flex: 1; min-width: 140px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--field); border-radius: 10px; background: var(--surface); padding: 0 14px; }
.amount-input:focus-within { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
.amount-input input { border: 0; outline: 0; flex: 1; min-width: 0; min-height: 44px; font-size: 16px; background: transparent; }
.summary { background: var(--bg); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; }
.topup-item { padding: 13px 0; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 5px; }
.topup-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-ghost.btn-sm { border-color: var(--line); }
.btn-ghost.btn-sm:hover { border-color: var(--ink); }
.order-cancel { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.order-cancel:hover { border-color: var(--ink); }
.order-cancel.armed { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }

/* Mobile top bar + bottom tabs (hidden on desktop) */
.topbar, .tabbar { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; }
  .grid-3 { grid-template-columns: 1fr; }
  .two-col { flex-direction: column; }
  .two-col > .aside { width: 100%; }
}
@media (max-width: 760px) {
  .site-nav { display: none; }
  .header-actions .btn-ghost { display: none; }
  .hero { padding: 44px 0 36px; }
  section.block { padding: 52px 0; }
  .table th, .table td { padding: 12px 14px; }

  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
    background: var(--dark); color: #fff; padding: 10px 16px; min-height: 60px;
  }
  .topbar .brand { color: #fff; font-size: 19px; flex: 1; }
  .topbar .bal { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
  .topbar .icon-btn { color: #C4C7CE; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--link); }
  .app { flex-direction: column; }
  .main { padding: 20px 16px 96px; gap: 18px; }
  .page-head h1 { font-size: 26px; }
  .panel { padding: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .svc-list { max-height: 360px; }

  .hide-mobile { display: none !important; }
}

/* Logo */
.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand img { height: 44px; width: auto; }
.brand-lg img { height: 64px; }
.sidebar .brand { padding: 0 6px; }
.sidebar .brand img { height: 50px; }
.site-footer .brand img { height: 48px; }
@media (max-width: 760px) {
  .site-header .brand img { height: 38px; }
  .topbar .brand img { height: 34px; }
}

/* Theme toggle */
.theme-btn {
  width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.theme-btn:hover { color: var(--ink); border-color: var(--border-strong); }
.sidebar .theme-btn, .topbar .theme-btn { background: none; border-color: transparent; color: var(--dark-muted); }
.sidebar .theme-btn:hover, .topbar .theme-btn:hover { color: #fff; background: #1D2027; }
.theme-corner { position: fixed; top: calc(16px + var(--announce-h, 0px)); right: 16px; }   /* sits below the announcement bar */

/* The dark "ink" logo becomes white in dark mode (the white logo on dark chrome stays as is) */
:root[data-theme="dark"] .logo-ink { filter: invert(1) brightness(1.1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-ink { filter: invert(1) brightness(1.1); } }

/* Mass order */
.mass-input { font-family: var(--font-mono); font-size: 14px; min-height: 220px; white-space: pre; overflow-x: auto; }
.mass-preview td, .mass-preview th { padding: 9px 12px; font-size: 13px; }
.mass-preview .link { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; margin-top: 2px; }
.mass-preview tr.bad:not(.err-row) td { border-bottom: 0; padding-bottom: 4px; }
.mass-preview tr.err-row td { padding-top: 0; }
.mass-preview tr.bad td { background: var(--bad-bg); }
.mass-preview .err { color: var(--bad); font-weight: 600; }
.id-list { display: flex; flex-direction: column; max-height: 520px; overflow-y: auto; margin: 0 -6px; }
.id-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border: 0; border-bottom: 1px solid var(--line-2); background: none; text-align: left; cursor: pointer; border-radius: 8px; width: 100%; color: var(--ink); }
.id-row:hover { background: var(--surface-2); }
.id-row .id { font-family: var(--font-mono); font-size: 13px; color: var(--muted); width: 44px; flex-shrink: 0; }
.id-row .d { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.id-row .n { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.id-row .p { font-size: 13px; font-weight: 700; white-space: nowrap; }
@media (max-width: 760px) { .mass-preview .link { max-width: 150px; } }
.panel > * { min-width: 0; }
@media (max-width: 980px) { .two-col > .primary, .two-col > .aside { width: 100%; } }
@media (max-width: 760px) {
  .mass-preview td, .mass-preview th { padding: 8px 6px; font-size: 12px; }
  .mass-preview td:first-child, .mass-preview th:first-child { padding-left: 10px; }
  .mass-preview td:last-child, .mass-preview th:last-child { padding-right: 10px; }
}

/* ==========================================================================
   Custom dropdown (enhanceSelect): same look on every device and browser
   ========================================================================== */
.dd { position: relative; }
.dd-native { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.dd-btn {
  width: 100%; min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border: 1px solid var(--field); border-radius: 10px; background: var(--surface); color: var(--ink);
  font-size: 16px; text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease;
}
.dd-btn:hover:not(:disabled) { border-color: var(--hover-line); }
.dd-btn[aria-expanded="true"] { border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.dd-btn:disabled { opacity: .5; cursor: not-allowed; }
.dd-btn .dd-text, .dd-list .dd-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dd-count {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  background: var(--neutral-bg); border-radius: 999px; padding: 2px 8px;
}
.dd-chev { flex-shrink: 0; color: var(--muted); transition: transform .18s ease; }
.dd-btn[aria-expanded="true"] .dd-chev { transform: rotate(180deg); }
.dd-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; margin: 0; padding: 6px;
  list-style: none; max-height: 320px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .28); animation: dd-in .14s ease-out;
}
.dd-up .dd-list { top: auto; bottom: calc(100% + 6px); }
.dd-list [role="option"] {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px;
  border-radius: 8px; cursor: pointer; font-size: 15px;
}
.dd-list [role="option"] .dd-text { font-weight: 500; }
.dd-list [role="option"].active { background: var(--neutral-bg); }
.dd-list [role="option"][aria-selected="true"] .dd-text { font-weight: 700; }
.dd-tick { flex-shrink: 0; visibility: hidden; }
.dd-list [aria-selected="true"] .dd-tick { visibility: visible; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }

/* ==========================================================================
   Design layer: texture, type details, motion (monochrome)
   ========================================================================== */
a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline-color: var(--ink); }
.input:focus, .textarea:focus { outline-color: var(--accent-soft); border-color: var(--ink); }
.check input { accent-color: var(--ink); }
.avatar { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--dark-line); }
.btn { transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-outline-accent { color: var(--ink); border-color: var(--ink); }
.btn-outline-accent:hover { background: var(--ink); color: var(--surface); }

/* mono eyebrow labels */
.eyebrow, .kicker {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); background: none; padding: 0; border-radius: 0;
}
.eyebrow::before, .kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dark-band .kicker { color: var(--dark-muted); }

/* hero: dot-grid texture that fades out, big type, headline accent */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.3px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 30%, transparent 75%);
}
.hero h1 em { font-style: normal; background: var(--ink); color: var(--bg); padding: 0 .14em; border-radius: 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero-card { position: relative; }
.hero-card::after {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; z-index: -1; border-radius: var(--radius-lg);
  background: repeating-linear-gradient(135deg, var(--ink) 0 1px, transparent 1px 9px); opacity: .18;
}

/* platform ticker */
.ticker { border-block: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.ticker-track { display: flex; width: max-content; animation: ticker 38s linear infinite; }
.ticker span {
  display: inline-flex; align-items: center; gap: 22px; padding: 16px 11px; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; color: var(--ink);
}
.ticker span::after { content: "✦"; font-size: 12px; color: var(--muted); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* key facts */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.fact { padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; }
.fact + .fact { border-left: 1px solid var(--line); }
.fact .big { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1; letter-spacing: -0.02em; }
.fact .small { font-size: 14px; color: var(--muted); }

/* steps: outlined numerals, lift on hover */
.step { position: relative; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--hover-line); }
.step .n {
  font-size: 56px; line-height: .9; color: transparent; -webkit-text-stroke: 1.5px var(--ink); letter-spacing: -0.03em;
}

/* dark band: dotted texture, 4 tiers */
.dark-band { position: relative; isolation: isolate; }
.dark-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1.2px, transparent 1.3px); background-size: 22px 22px;
}
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tier-card { border: 1px solid var(--dark-line); transition: border-color .2s ease, transform .2s ease; }
.tier-card:hover { border-color: #555; transform: translateY(-3px); }
.dark-band .badge-hq { background: #F2F2F2; color: #0B0B0B; }
.dark-band .badge-basic { color: #D6D6D6; box-shadow: inset 0 0 0 1px #6B6B6B; }
.dark-band .badge-ph { background: #2A2A2A; color: #F2F2F2; box-shadow: inset 0 0 0 1px #3F3F3F; }
.dark-band .badge-nd { background: #F2F2F2; color: #0B0B0B; box-shadow: inset 0 0 0 2px #F2F2F2, inset 0 0 0 3px #0B0B0B; }

/* price table rows */
.table tbody tr { transition: background .12s ease; }
@media (hover: hover) { .table tbody tr:hover td { background: var(--surface-2); } }
@container orders (max-width: 900px) { .orders-table tbody tr:hover td { background: transparent; } }

/* closing call to action */
.cta-band { background: var(--dark); color: var(--dark-ink); border-radius: 24px; padding: 48px; display: flex; gap: 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; overflow: hidden; isolation: isolate; }
.cta-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1.2px, transparent 1.3px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000); mask-image: linear-gradient(90deg, transparent 20%, #000);
}
.cta-band h2 { color: #fff; max-width: 560px; }
.cta-band p { color: var(--dark-muted); margin-top: 10px; }
.cta-band .btn-primary { background: #F2F2F2; color: #0B0B0B; }
.cta-band .btn-primary:hover { background: #fff; color: #000; }

/* dashboard touches */
.balance-card { position: relative; overflow: hidden; isolation: isolate; border: 1px solid var(--dark-line); }
.balance-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1.2px, transparent 1.3px); background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(200deg, #000, transparent 70%); mask-image: linear-gradient(200deg, #000, transparent 70%);
}
.sidebar .btn-primary { background: #F2F2F2; color: #0B0B0B; }
.sidebar .btn-primary:hover { background: #fff; color: #000; }
.side-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 #F2F2F2; }
.page-head h1 { letter-spacing: -0.02em; }
.charge-box { background: var(--ink); color: var(--surface); }
.charge-box .k { color: var(--surface); opacity: .65; }
.charge-box .hint.error, .charge-box a { color: #FF8A7E !important; }
.svc-option { transition: border-color .12s ease, background .12s ease; }
.svc-option[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink); }
.method[aria-pressed="true"] { border-color: var(--ink); background: var(--surface-2); }
.method .mark { background: var(--ink) !important; color: var(--surface) !important; }
@media (max-width: 760px) {
  .tabbar a { position: relative; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; background: var(--ink); border-radius: 0 0 2px 2px; }
}

@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .fact .big { font-size: 28px; }
  .fact { padding: 18px; }
  .cta-band { padding: 32px 22px; border-radius: 18px; }
  .hero-card::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .dd-list { animation: none; }
  .step, .tier-card, .btn, .dd-chev { transition: none; }
}

/* ==========================================================================
   Control panel (/admin)
   ========================================================================== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat .v.small { font-size: 18px; }
.stat .s { font-size: 13px; color: var(--muted); }
.adjust-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.adjust-form .input { min-height: 40px; flex: 1; min-width: 160px; }
.adjust-form .input[name="note"] { flex: 3; }
.adjust-form .btn.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
@media (max-width: 760px) { .tabbar.tabbar-5 { grid-template-columns: repeat(5, 1fr); } .tabbar-5 a { font-size: 11px; } }

/* Support page */
.support-card { gap: 14px; }
.support-email { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 4vw, 34px); letter-spacing: -0.02em; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.support-email:hover { text-decoration: underline; }
.support-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.support-tips { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--ink-2); }

/* ==========================================================================
   Server-rendered public pages: legal text, platform price pages
   ========================================================================== */
.prose { max-width: 780px; display: flex; flex-direction: column; gap: 14px; }
.prose h1 { font-size: clamp(32px, 4vw, 44px); letter-spacing: -0.02em; }
section.block .prose h2 { font-size: 22px; margin-top: 18px; }
.prose p, .prose li { color: var(--ink-2); font-size: 16px; line-height: 1.65; }
.prose ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose strong { color: var(--ink); }
.prose code { font-family: var(--font-mono, monospace); font-size: 14px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.prose .updated { font-size: 14px; color: var(--muted); }
.prose .legal-nav { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; }
.seo-hero .wrap { grid-template-columns: minmax(0, 1fr); max-width: 1180px; }
.seo-hero h1 { max-width: 820px; }
.seo-hero .lead { max-width: 720px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--ink-2); }
.seo-sections { display: flex; flex-direction: column; gap: 40px; }
.seo-sections h2 { font-size: clamp(24px, 2.6vw, 30px); margin-bottom: 6px; }
.muted-p { color: var(--muted); margin-bottom: 14px; }
.seo-table .t { font-weight: 600; font-size: 14px; line-height: 1.35; }
.seo-table .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
@media (max-width: 760px) {
  .seo-table th:nth-child(4), .seo-table td:nth-child(4) { display: none; }
  .seo-table th:first-child, .seo-table td:first-child { display: none; }
}

/* Dashboard: More (phones), Affiliate, API */
.more-list { display: flex; flex-direction: column; gap: 10px; }
.more-item { display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none; color: var(--ink); }
.more-item .grow { display: flex; flex-direction: column; gap: 2px; }
.more-item .t { font-weight: 700; }
.more-item .s { font-size: 14px; color: var(--muted); }
.more-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.aff-headline { font-size: clamp(22px, 3vw, 28px); }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; min-width: 0; font-size: 14px; }
.aff-kv, .api-kv { border-top-color: var(--line); }
.aff-kv .k, .api-kv .k { color: var(--muted); }
.api-kv .v { overflow-wrap: anywhere; text-align: right; }
.api-docs { gap: 10px; }
.api-docs h4 { font-size: 15px; margin: 10px 0 0; }
.api-ex { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; align-items: start; }
.api-params { font-family: var(--font-mono); font-size: 13px; color: var(--ink); line-height: 1.6; }
.api-out { margin: 0; font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) { .api-ex { grid-template-columns: 1fr; } .copy-row { flex-direction: column; } }

/* 404 page */
.nf-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 760px; }
.nf-code { font-family: var(--font-display); font-weight: 700; font-size: clamp(96px, 18vw, 180px); line-height: .9; letter-spacing: -0.04em;
  color: transparent; -webkit-text-stroke: 2px var(--ink); }
.nf h1 { font-size: clamp(30px, 4vw, 44px); }
.nf .lead { font-size: 18px; color: var(--ink-2); max-width: 560px; }
.nf-cta { margin-top: 8px; }
a.pill { text-decoration: none; }

/* Welcome guide (tour.js) */
.tour { position: fixed; inset: 0; z-index: 100; }
.tour-block { position: absolute; inset: 0; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .62); pointer-events: none;
  transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; }
.tour-hole::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px #fff; }
.tour-card { position: fixed; width: min(360px, calc(100vw - 32px)); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; gap: 10px; outline: none; transition: top .25s ease, left .25s ease; }
.tour-card.centered { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); padding: 26px; }
.tour-card h3 { font-family: var(--font-display); font-size: 22px; }
.tour-card.centered h3 { font-size: 28px; }
.tour-card p { color: var(--ink-2); font-size: 15px; line-height: 1.55; margin: 0; }
.tour-card p strong { color: var(--ink); }
.tour-step { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.tour-note { font-size: 13px; font-weight: 600; background: var(--neutral-bg); color: var(--ink); border-radius: 10px; padding: 8px 10px; }
.tour-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.tour-actions .grow { flex: 1; }
.tour-actions .tour-skip { padding-left: 0; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-card { transition: none; } }

/* Recently completed */
.recent-table .svc { font-weight: 600; }
@media (max-width: 760px) {
  .recent-table thead { display: none; }
  .recent-table, .recent-table tbody, .recent-table tr, .recent-table td { display: block; width: 100%; }
  .recent-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
  .recent-table td { border: 0; padding: 0; }
  .recent-table td[data-col="svc"] { grid-column: 1 / -1; }
  .recent-table .num { text-align: left; }
  .recent-table td[data-col="qty"]::before { content: "Qty "; color: var(--muted); }
  .recent-table td[data-col="took"]::before { content: "Delivered in "; color: var(--muted); }
  .recent-table td[data-col="when"] { grid-column: 1 / -1; font-size: 13px; }
}

/* Announcement bar (set from /admin) */
:root { --announce-bg: #D9D9D9; --announce-ink: #0B0B0B; }
:root[data-theme="dark"] { --announce-bg: #2E2E2E; --announce-ink: #EDEDED; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --announce-bg: #2E2E2E; --announce-ink: #EDEDED; } }
.announce { position: relative; background: var(--announce-bg); color: var(--announce-ink); font-size: 14px; font-weight: 600;
  line-height: 1.4; text-align: center; padding: 9px 48px; }
.announce-text { overflow-wrap: anywhere; }
.announce-x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; opacity: .6; }
.announce-x:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
@media (max-width: 760px) { .announce { font-size: 13px; padding: 8px 44px 8px 16px; text-align: left; } }

/* ==========================================================================
   Tier badges + the animated badge introduction (badges.js)
   ========================================================================== */
.tier-badge { display: inline-block; vertical-align: middle; flex: none; }
.bi { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 16px; }
.bi-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); animation: bi-fade .25s ease both; }
.bi-card { position: relative; width: min(400px, 100%); background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 22px; padding: 26px 26px 22px; box-shadow: 0 30px 70px rgba(0, 0, 0, .4); text-align: center; outline: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px; animation: bi-pop .45s cubic-bezier(.2, .9, .25, 1.15) both; }
.bi-card .tour-note { align-self: stretch; margin-bottom: 4px; }
.bi-stage { position: relative; width: 150px; height: 150px; display: grid; place-items: center; margin: 6px 0 8px; }
.bi-badge { width: 118px; height: 118px; position: relative; z-index: 1; animation: bi-settle .5s ease 1.3s both; }
.bi .bi-outline { stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: bi-draw .8s cubic-bezier(.65, 0, .35, 1) .25s forwards, bi-solid 1ms linear 1.06s forwards; }   /* then a plain line: no seam where it started */
.bi .bi-mark { transform-box: fill-box; transform-origin: center; opacity: 0; }
.bi-member .bi-mark { animation: bi-rise .5s cubic-bezier(.2, .9, .25, 1.4) .95s forwards; }
.bi-pro .bi-mark { animation: bi-gem .55s cubic-bezier(.2, .9, .25, 1.4) .95s forwards; }
.bi-elite .bi-mark { animation: bi-star .75s cubic-bezier(.2, .9, .25, 1.2) .95s forwards; }
.bi-glow { position: absolute; inset: 0; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--ink) 16%, transparent) 0%, transparent 68%); }
.bi-pro .bi-glow { animation: bi-glow .9s ease-out 1.1s both; }
.bi-elite .bi-glow { animation: bi-glow .9s ease-out 1.1s both, bi-breathe 2.6s ease-in-out 2s infinite; }
.bi-sparks { position: absolute; inset: 0; pointer-events: none; }
.bi-sparks i { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--ink);
  transform: rotate(var(--a)) translateY(0) rotate(45deg) scale(0); opacity: 0; animation: bi-spark .75s cubic-bezier(.2, .7, .3, 1) 1.2s forwards; }
.bi-elite .bi-sparks i:nth-child(even) { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; animation-delay: 1.3s; }
.bi-kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  animation: bi-up .4s ease 1.35s both; }
.bi-card h2 { font-size: 32px; letter-spacing: -.02em; animation: bi-up .4s ease 1.45s both; }
.bi-card h2 em { font-style: normal; background: var(--ink); color: var(--surface); border-radius: 10px; padding: 0 .16em; }
.bi-perks { list-style: none; padding: 0; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.bi-perks li { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: 15px; color: var(--ink-2); line-height: 1.45;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; animation: bi-up .4s ease both; animation-delay: calc(1.6s + var(--i) * .12s); }
.bi-perks li::before { content: ""; flex: none; width: 7px; height: 7px; margin-top: 7px; background: var(--ink); transform: rotate(45deg); }
.bi-perks strong { color: var(--ink); }
.bi-close { align-self: stretch; animation: bi-up .4s ease 2.1s both; }
.bi-out .bi-card { animation: bi-leave .2s ease forwards; }
.bi-out .bi-backdrop { animation: bi-fade .2s ease reverse forwards; }

@keyframes bi-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bi-pop { from { opacity: 0; transform: translateY(14px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes bi-leave { to { opacity: 0; transform: scale(.96); } }
@keyframes bi-draw { to { stroke-dashoffset: 0; } }
@keyframes bi-solid { to { stroke-dasharray: none; stroke-dashoffset: 0; } }
@keyframes bi-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bi-gem { 0% { opacity: 0; transform: scale(0) rotate(-90deg); } 70% { opacity: 1; transform: scale(1.12) rotate(6deg); } 100% { opacity: 1; transform: none; } }
@keyframes bi-star { 0% { opacity: 0; transform: scale(0) rotate(-180deg); } 70% { opacity: 1; transform: scale(1.05) rotate(6deg); } 100% { opacity: 1; transform: none; } }
@keyframes bi-settle { 0%, 100% { transform: none; } 45% { transform: scale(1.06); } }
@keyframes bi-glow { 0% { opacity: 0; transform: scale(.5); } 50% { opacity: 1; } 100% { opacity: .55; transform: scale(1.15); } }
@keyframes bi-breathe { 0%, 100% { opacity: .55; transform: scale(1.15); } 50% { opacity: .9; transform: scale(1.25); } }
@keyframes bi-spark { 0% { opacity: 0; transform: rotate(var(--a)) translateY(0) rotate(45deg) scale(.3); }
  25% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-78px) rotate(45deg) scale(1); } }
@keyframes bi-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .bi *, .bi { animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .bi-sparks { display: none; }
}

/* Tier chip (sidebar balance card) and badge (phone top bar) */
.tier-chip { margin-top: 12px; width: 100%; display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: #fff; text-align: left; cursor: pointer; font: inherit; }
.tier-chip:hover { background: rgba(255, 255, 255, .1); }
.tier-chip:empty { display: none; }
.tc-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tc-off { margin-left: auto; font-size: 12px; font-weight: 700; background: #fff; color: #0B0B0B; border-radius: 999px; padding: 1px 8px; }
.tc-bar { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.tc-bar i { display: block; height: 100%; background: #fff; border-radius: inherit; }
.tc-text { font-size: 12px; color: #B9BCC4; }
.tier-top { display: none; }
@media (max-width: 760px) {
  .tier-top { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer; padding: 0; }
  .tier-top:empty { display: none; }
  .topbar .tier-top + .bal { margin-left: -4px; }
}
#charge-note { margin-top: 2px; }
.more-tier { width: 100%; margin-bottom: 10px; border: 1px solid var(--line); background: var(--surface); font: inherit; text-align: left; cursor: pointer; }
.more-tier .grow { gap: 6px; }
.more-bar { background: var(--line); display: block; }
.more-bar i { background: var(--ink); }

/* Sidebar on short screens (iPad landscape is ~690px tall): never squeeze its parts (the balance card
   clips its content), scroll instead, and tighten the spacing so it usually fits. */
.sidebar > * { flex-shrink: 0; }
.sidebar { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }
@media (max-height: 820px) {
  .sidebar { gap: 14px; padding-top: 16px; padding-bottom: 14px; }
  .sidebar .brand img { height: 42px; }
  .balance-card { padding: 12px 14px; gap: 8px; }
  .balance-card .v { font-size: 24px; }
  .side-nav a { padding: 8px 12px; }
  .tier-chip { margin-top: 6px; padding: 8px 10px; gap: 5px; }
}

/* email verification (login page) */
.vf-step { display: flex; flex-direction: column; gap: 14px; }
.vf-step h1 { font-size: 24px; margin: 0; text-align: center; }
.vf-text { margin: 0; color: var(--muted); line-height: 1.5; text-align: center; }
.vf-text strong { color: var(--ink); overflow-wrap: anywhere; }
.vf-code { font-family: var(--font-mono); font-size: 28px; letter-spacing: .35em; text-align: center; padding: 12px 8px; width: 100%; }
.vf-msg { min-height: 20px; font-size: 14px; font-weight: 600; color: var(--bad); text-align: center; }
.vf-msg.ok { color: var(--muted); font-weight: 500; }
.vf-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.vf-change { display: flex; gap: 8px; }
.vf-change .input { flex: 1; min-width: 0; }

/* account settings */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.set-card { display: flex; flex-direction: column; gap: 14px; }
.set-card h3 { margin: 0; }
.set-card > .btn { align-self: flex-start; }
.set-current { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow-wrap: anywhere; }
.set-form { display: flex; flex-direction: column; gap: 14px; }
.set-note { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.set-note strong { color: var(--ink); }
.set-code { font-family: var(--font-mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
.set-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.set-msg { min-height: 20px; font-size: 14px; font-weight: 600; color: var(--bad); }
.set-msg:empty { min-height: 0; }
.set-msg.ok { color: var(--muted); font-weight: 500; }

/* admin authenticator setup */
.setup-card { width: min(460px, 100%); }
.setup-body { display: flex; flex-direction: column; gap: 14px; }
.setup-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; color: var(--muted); }
.setup-steps strong { color: var(--ink); }
.setup-qr { align-self: center; background: #fff; border-radius: 12px; padding: 6px; line-height: 0; }
.setup-qr svg { width: 220px; height: 220px; }
.setup-key { display: flex; align-items: center; gap: 8px; background: var(--field, var(--line)); border-radius: 10px; padding: 8px 10px; }
.setup-key code { flex: 1; font-family: var(--font-mono); font-size: 14px; overflow-wrap: anywhere; }
.setup-backups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.setup-backups code { font-family: var(--font-mono); font-size: 16px; text-align: center; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }

/* control panel: pause sending orders */
.sending-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.sending-card.paused { border-color: var(--bad); }
.sending-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sending-head h3 { margin: 0; }

/* control panel: cancellations */
.cv-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--bad); color: #fff;
  font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.nav-count.hidden { display: none; }

/* control panel: Messenger bot */
.bot-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .bot-grid { grid-template-columns: 1fr; } }
.bot-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.bot-card { display: flex; flex-direction: column; gap: 12px; }
.bot-card h3 { margin: 0; }
.bot-log { height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.bot-empty { margin: auto; text-align: center; font-size: 14px; }
.bot-msg { display: flex; flex-direction: column; max-width: 85%; }
.bot-msg.in { align-self: flex-end; align-items: flex-end; }
.bot-msg.out { align-self: flex-start; }
.bot-msg .bubble { padding: 8px 12px; border-radius: 16px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.bot-msg.in .bubble { background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; }
.bot-msg.out .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bot-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.bot-send { display: flex; gap: 8px; }
.bot-send .input { flex: 1; min-width: 0; }
.bot-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.bot-setup { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.bot-setup li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.bot-setup li.ok { color: var(--ink); }
.bot-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.bot-stats .k { display: block; font-size: 12px; color: var(--muted); }
.bot-stats .v { font-size: 20px; font-weight: 700; }
.bot-chat { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.bot-chat .grow { flex: 1; min-width: 0; }
.bot-transcript { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; max-height: 360px; overflow-y: auto; }

.menu-form { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.menu-fields { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 10px; }
@media (max-width: 760px) { .menu-fields { grid-template-columns: 1fr 1fr; } }
.menu-table tr.muted td { opacity: .6; }
@media (max-width: 640px) {
  .menu-table thead { display: none; }
  .menu-table, .menu-table tbody, .menu-table tr, .menu-table td { display: block; width: auto; }
  .menu-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .menu-table td { border: 0; padding: 2px 0; text-align: left; }
  .menu-table td.menu-n { display: none; }
  .menu-table td.menu-name { font-size: 16px; padding-bottom: 4px; }
  .menu-table td[data-k] { text-align: right; }
  .menu-table td[data-k]::before { content: attr(data-k); color: var(--muted); float: left; margin-right: 12px; }
  .menu-table td[data-k] .hint { max-width: none !important; }
  .menu-table td.menu-acts { padding-top: 6px; }
  .menu-table td.menu-acts .btn { margin-right: 6px; }
}

/* Messenger bot panel (botfb.smmshiro.com) */
.bf { max-width: 1240px; margin: 0 auto; padding: 0 24px 40px; }
.bf-head { display: flex; align-items: center; gap: 12px; padding: 18px 0 20px; }
.bf-head h1 { flex: 1; margin: 0 0 0 8px; font-size: 26px; }
.bf-head .icon-btn { color: var(--muted); }
@media (max-width: 640px) {
  .bf { padding: 0 16px 32px; }
  .bf-head { padding: 12px 0 14px; gap: 6px; }
  .bf-head .brand img { width: 96px; height: auto; }
  .bf-head h1 { font-size: 18px; margin-left: 4px; white-space: nowrap; }
}
.ai-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; flex: none; font-weight: 600; font-size: 13px; }
.ai-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ai-switch .track { width: 38px; height: 22px; border-radius: 999px; background: var(--field); position: relative; transition: background .15s; }
.ai-switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.ai-switch input:checked + .track { background: var(--ink); }
.ai-switch input:checked + .track::after { transform: translateX(16px); }
.ai-switch input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }
.ai-switch input:disabled + .track { opacity: .5; }

.menu-fields-2 { grid-template-columns: 2fr 1fr; }
.price-rows { display: flex; flex-direction: column; gap: 8px; }
.price-row { display: grid; grid-template-columns: 130px 130px 1fr auto; gap: 8px; align-items: center; }
.pl-row { display: flex; gap: 10px; align-items: baseline; white-space: nowrap; }
.pl-row > span:first-child { min-width: 44px; color: var(--muted); }
.pl-row .muted, .pl-row .pl-bad { font-size: 12px; }
.pl-bad { color: var(--bad); font-weight: 600; }
@media (max-width: 640px) {
  .menu-fields-2 { grid-template-columns: 1fr; }
  .price-row { grid-template-columns: 1fr 1fr auto; }
  .price-row .pr-profit { grid-column: 1 / -1; grid-row: 2; margin-top: -4px; }
  .menu-table td.menu-prices { padding: 4px 0; }
}
.opt-row { grid-template-columns: 1fr 130px 0 auto; }
.menu-opts { margin: 4px 0 0; max-width: 340px; line-height: 1.6; }
@media (max-width: 640px) { .opt-row { grid-template-columns: 1fr 110px auto; } .opt-row .hint { display: none; } }
