/* ==========================================================================
   KeyShop - shared design system (storefront + admin)
   ========================================================================== */

:root {
  --bg: #0a0c11;
  --bg-soft: #0f121a;
  --surface: #14171f;
  --surface-2: #191d27;
  --surface-3: #20252f;
  --border: #242a38;
  --border-strong: #323949;
  --text: #e8eaf1;
  --text-dim: #a7aec2;
  --text-faint: #6f778c;
  --accent: #5b6cff;
  --accent-soft: #2a2f5c;
  --accent-text: #b3bcff;
  --mint: #22d3a5;
  --mint-soft: #123a30;
  --warn: #ffc061;
  --warn-soft: #3d2f16;
  --danger: #ff5d6c;
  --danger-soft: #40202a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .3);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --header-h: 76px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 12% -8%, rgba(91, 108, 255, .16), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(34, 211, 165, .09), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.6 var(--sans);
  min-height: 100vh;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
code, kbd, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Layout ---------- */

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.page { padding: 34px 0 90px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-tight { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { margin-left: auto; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(10, 12, 17, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.brand {
  display: flex; align-items: center; gap: 9px;
  font-size: 16.5px; font-weight: 750; color: var(--text); letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand .brand-banner {
  display: block; height: 66px; width: auto; border-radius: 10px;
}
.brand .mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), #8b5cf6);
  border-radius: 9px; font-size: 15px; box-shadow: var(--shadow-sm);
}
.nav {
  display: flex; align-items: center; gap: 4px; margin-left: auto;
  min-width: 0; overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--text-dim); padding: 7px 11px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--surface-2); }
.cart-pill {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 7px 13px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--text);
}
.cart-pill:hover { border-color: var(--border-strong); text-decoration: none; }
.cart-count {
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700;
  display: grid; place-items: center;
}
.cart-count[data-empty="1"] { background: var(--surface-3); color: var(--text-faint); }

.announce {
  background: linear-gradient(90deg, var(--accent-soft), rgba(34, 211, 165, .12));
  border-bottom: 1px solid var(--border);
  padding: 9px 0; font-size: 13.5px; color: var(--accent-text); text-align: center;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 17px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .14s, border-color .14s, transform .06s, opacity .14s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: #3d4658; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(160deg, #6575ff, #4d5ce8);
  border-color: transparent; color: #fff; box-shadow: 0 5px 18px rgba(91, 108, 255, .3);
}
.btn-primary:hover { background: linear-gradient(160deg, #7382ff, #5867f0); border-color: transparent; }
.btn-mint { background: linear-gradient(160deg, #29dcae, #17b78c); border-color: transparent; color: #04231b; }
.btn-mint:hover { background: linear-gradient(160deg, #35e6b8, #1cc294); }
.btn-danger { background: var(--danger-soft); border-color: #5e2b36; color: #ff9ea8; }
.btn-danger:hover { background: #4d2530; border-color: #7a3644; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 24px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn-link {
  background: none; border: none; color: var(--accent-text); padding: 0;
  font: inherit; cursor: pointer; text-decoration: underline;
}

/* ---------- Cards & surfaces ---------- */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card-tight { padding: 14px 16px; }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.panel-head {
  padding: 15px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg-soft);
}
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-body { padding: 18px; }

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.strike { text-decoration: line-through; color: var(--text-faint); }

hr.sep { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ---------- Badges & pills ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .02em;
  background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-accent { background: var(--accent-soft); color: var(--accent-text); border-color: #363c72; }
.badge-mint { background: var(--mint-soft); color: #6ee7bd; border-color: #1c5645; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: #5a451f; }
.badge-danger { background: var(--danger-soft); color: #ff9ea8; border-color: #5e2b36; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Forms ---------- */

label.field { display: block; margin-bottom: 14px; }
label.field > span, .label {
  display: block; font-size: 12.5px; font-weight: 650; color: var(--text-dim);
  margin-bottom: 6px; letter-spacing: .01em;
}
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=search], input[type=datetime-local], input[type=date],
select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 14.5px;
  transition: border-color .14s, background .14s;
}
input:hover, select:hover, textarea:hover { border-color: #3d4658; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: #0d1017;
  box-shadow: 0 0 0 3px rgba(91, 108, 255, .16);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
select {
  appearance: none;
  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 fill='%23a7aec2' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
.hint { font-size: 12.5px; color: var(--text-faint); margin-top: 5px; }
.check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent); flex: none; }
.check span { font-size: 14px; color: var(--text-dim); }
.check strong { color: var(--text); font-weight: 600; display: block; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.inline-form { display: flex; gap: 8px; align-items: stretch; }
.inline-form input, .inline-form select { flex: 1 1 auto; }

/* ---------- Alerts ---------- */

.alert {
  padding: 12px 15px; border-radius: var(--radius-sm); font-size: 14px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-dim);
  display: flex; gap: 10px; align-items: flex-start;
}
.alert strong { color: var(--text); }
.alert-error { background: var(--danger-soft); border-color: #5e2b36; color: #ffb3bb; }
.alert-ok { background: var(--mint-soft); border-color: #1c5645; color: #86efc4; }
.alert-warn { background: var(--warn-soft); border-color: #5a451f; color: #ffd79a; }
.alert-info { background: var(--accent-soft); border-color: #363c72; color: var(--accent-text); }

/* ---------- Toasts ---------- */

#toasts {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  display: grid; gap: 10px; max-width: min(380px, calc(100vw - 40px));
}
.toast {
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 12px 15px; box-shadow: var(--shadow);
  font-size: 14px; animation: toast-in .22s ease-out;
}
.toast.ok { border-left-color: var(--mint); }
.toast.err { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Storefront hero ---------- */

.hero {
  padding: 52px 0 34px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}
.hero h1 {
  font-size: clamp(30px, 5.4vw, 46px); font-weight: 800; letter-spacing: -.03em;
  max-width: 18ch;
  background: linear-gradient(180deg, #fff, #b8bed6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { font-size: 16.5px; color: var(--text-dim); max-width: 56ch; }
.hero-badges { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- Product grid ---------- */

.filters {
  display: flex; gap: 9px; align-items: center; flex-wrap: wrap;
  margin-bottom: 22px;
}
.chip {
  padding: 6.5px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.chip.active { background: var(--accent-soft); border-color: #3c4380; color: var(--accent-text); }

.products {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
}
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.product-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.product-thumb {
  aspect-ratio: 16 / 9; background: linear-gradient(150deg, #1b2030, #12151d);
  display: grid; place-items: center; border-bottom: 1px solid var(--border); position: relative;
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .glyph { font-size: 40px; opacity: .5; }
.product-thumb .ribbon { position: absolute; top: 10px; left: 10px; }
.product-body { padding: 15px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-body h3 { font-size: 15.5px; margin: 0; }
.product-body h3 a { color: var(--text); }
.product-summary {
  color: var(--text-dim); font-size: 13.5px; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-foot {
  margin-top: auto; padding-top: 10px; display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
}
.price { font-size: 19px; font-weight: 750; letter-spacing: -.02em; }
.price small { font-size: 12.5px; font-weight: 500; color: var(--text-faint); }
.price-was { font-size: 13px; margin-left: 6px; }

.empty {
  padding: 54px 20px; text-align: center; color: var(--text-faint);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty .glyph { font-size: 34px; margin-bottom: 10px; }

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 300% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius);
  min-height: 250px;
}
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -150% 0; } }

/* ---------- Product detail ---------- */

.detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 30px; align-items: start; }
.detail-media {
  border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden;
  background: linear-gradient(150deg, #1b2030, #12151d); aspect-ratio: 16 / 9;
  display: grid; place-items: center;
}
.detail-media .glyph { font-size: 64px; opacity: .45; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.buy-box { position: sticky; top: calc(var(--header-h) + 18px); }
.qty { display: flex; align-items: center; gap: 0; }
.qty button {
  width: 38px; height: 38px; background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text); cursor: pointer; font-size: 17px; font-weight: 600;
}
.qty button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.qty button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.qty button:hover { background: var(--surface-3); }
.qty input {
  width: 56px; height: 38px; text-align: center; border-radius: 0;
  border-left: none; border-right: none; padding: 0; font-weight: 650;
}
.spec-list { display: grid; gap: 0; margin: 0; }
.spec-list div {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.spec-list div:last-child { border-bottom: none; }
.spec-list dt { color: var(--text-dim); }
.spec-list dd { margin: 0; font-weight: 600; text-align: right; }
.prose { color: var(--text-dim); font-size: 14.5px; }
.prose h3 { color: var(--text); margin-top: 22px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 5px; }

/* ---------- Cart & checkout ---------- */

.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(310px, .7fr); gap: 26px; align-items: start; }
.line-item {
  display: grid; grid-template-columns: 62px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.line-item:last-child { border-bottom: none; }
.line-thumb {
  width: 62px; height: 46px; border-radius: 8px; overflow: hidden;
  background: linear-gradient(150deg, #1b2030, #12151d); display: grid; place-items: center;
  border: 1px solid var(--border); font-size: 20px;
}
.line-thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-name { font-weight: 620; font-size: 14.5px; }
.totals { display: grid; gap: 9px; font-size: 14.5px; }
.totals .t-row { display: flex; justify-content: space-between; gap: 12px; }
.totals .t-row.grand {
  border-top: 1px solid var(--border); margin-top: 5px; padding-top: 12px;
  font-size: 19px; font-weight: 750;
}
.pay-option {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer; margin-bottom: 10px; transition: border-color .14s, background .14s;
}
.pay-option:hover { border-color: #43506e; background: var(--surface-2); }
.pay-option.selected { border-color: var(--accent); background: rgba(91, 108, 255, .08); }
.pay-option input { margin: 3px 0 0; accent-color: var(--accent); flex: none; width: 17px; height: 17px; }
.pay-option .pay-label { font-weight: 650; font-size: 14.5px; }
.steps { display: flex; gap: 8px; align-items: center; margin-bottom: 22px; font-size: 13px; color: var(--text-faint); }
.steps b { color: var(--text); }

/* ---------- Keys / secrets ---------- */

.key-row {
  display: flex; gap: 10px; align-items: center;
  background: var(--bg-soft); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 8px;
}
.key-value {
  font-family: var(--mono); font-size: 14.5px; letter-spacing: .04em; color: #8ef0c0;
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: thin;
}
.key-value.masked { color: var(--text-faint); letter-spacing: .18em; }
.key-row.revoked .key-value { color: var(--text-faint); text-decoration: line-through; }

.cashapp-box {
  background: linear-gradient(150deg, rgba(34, 211, 165, .1), rgba(34, 211, 165, .02));
  border: 1px solid #1c5645; border-radius: var(--radius); padding: 18px;
}
.cashtag {
  font-family: var(--mono); font-size: 26px; font-weight: 700; color: #6ee7bd;
  letter-spacing: -.01em; word-break: break-all;
}
.big-amount { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
table.data th {
  text-align: left; padding: 10px 12px; color: var(--text-dim); font-weight: 650;
  font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase;
  border-bottom: 1px solid var(--border); background: var(--bg-soft);
  position: sticky; top: 0; white-space: nowrap;
}
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.clickable { cursor: pointer; }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tabs button {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); padding: 10px 14px; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Auth pages ---------- */

.auth-card { max-width: 420px; margin: 40px auto; }
.auth-card .card { padding: 26px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border); margin-top: 60px; padding: 26px 0;
  color: var(--text-faint); font-size: 13px;
}
.site-footer a { color: var(--text-dim); }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 150; background: rgba(4, 6, 10, .72);
  display: grid; place-items: center; padding: 20px; backdrop-filter: blur(3px);
  overflow-y: auto;
}
.modal {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); width: 100%; max-width: 640px;
  box-shadow: var(--shadow); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  margin: auto;
}
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; background: var(--bg-soft);
  border-radius: var(--radius) var(--radius) 0 0;
}
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end; background: var(--bg-soft);
  border-radius: 0 0 var(--radius) var(--radius);
}
.icon-btn {
  background: none; border: none; color: var(--text-faint); cursor: pointer;
  font-size: 20px; line-height: 1; padding: 4px 8px; border-radius: 6px;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .detail, .checkout-grid { grid-template-columns: 1fr; }
  .buy-box { position: static; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 15px; }
  h1 { font-size: 25px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .site-header .wrap {
    flex-wrap: wrap; height: auto; row-gap: 9px;
    padding-top: 11px; padding-bottom: 11px;
  }
  .site-header .brand { order: 1; }
  .brand .brand-banner { height: 46px; }
  .site-header .cart-pill { order: 2; margin-left: auto; }
  .site-header .nav {
    order: 3; flex-basis: 100%; margin-left: 0; justify-content: flex-start;
  }
  .nav a { padding: 7px 9px; font-size: 13.5px; }
  .hero { padding: 34px 0 26px; }
  .line-item { grid-template-columns: 46px 1fr; }
  .line-item .line-price { grid-column: 2; }
  .line-thumb { width: 46px; height: 36px; }
}

/* ---------- Pagination ---------- */

.pager {
  display: flex; gap: 8px; align-items: center; justify-content: center;
  margin: 34px 0 0; flex-wrap: wrap;
}
.pager .page-info { color: var(--text-dim); font-size: 13.5px; padding: 0 6px; }

/* ---------- Back-in-stock ---------- */

.notify-box {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 14px; margin-top: 16px;
}
.notify-box h3 { font-size: 14.5px; margin: 0 0 4px; }

/* ---------------------------------------------------------------- legal pages */
.legal-page { max-width: 760px; padding-top: 34px; padding-bottom: 60px; }
.legal-page > h1 { font-size: 28px; margin: 0 0 6px; }

.legal-body { margin-top: 26px; font-size: 15px; line-height: 1.68; }
.legal-body h2 {
  font-size: 17px; margin: 34px 0 10px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
.legal-body h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.legal-body h3 { font-size: 15px; margin: 24px 0 8px; }
.legal-body p { margin: 0 0 14px; }
.legal-body ul { margin: 0 0 16px; padding-left: 22px; }
.legal-body li { margin-bottom: 7px; }
.legal-body strong { font-weight: 600; }

/* An unfilled [PLACEHOLDER] in the terms. Loud on purpose: it should be
   impossible to leave one sitting on a live shop without noticing. */
.legal-body mark.todo {
  background: #fde68a; color: #713f12; padding: 1px 5px;
  border-radius: 4px; font-weight: 600; font-size: 0.94em;
}

@media print {
  .legal-page { max-width: none; }
  .site-header, .site-footer, .legal-page > p:last-child { display: none; }
  .legal-body { font-size: 11pt; }
  .legal-body mark.todo { background: none; border: 1px solid #000; }
}

/* The terms tickbox on sign-up and checkout. Given a border so it reads as a
   deliberate step rather than another line of small print. */
.check.consent {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 12px 14px; margin-bottom: 16px;
}
.check.consent span { font-size: 13.5px; }
.check.consent a { font-weight: 600; }
.check.consent:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* -------------------------------------------------- non-refundable items */
/* Deliberately the loudest thing on the page short of an error. If someone
   later tells their bank they were not told, this is the answer. */
.norefund-note {
  border: 1px solid var(--danger, #ef4444); border-left-width: 3px;
  border-radius: var(--radius-sm); background: rgba(239, 68, 68, .09);
  padding: 12px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.55;
}
.norefund-note strong { display: block; margin-bottom: 3px; }

.norefund-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: rgba(239, 68, 68, .14); color: #fca5a5;
  font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}

.norefund-consent {
  border: 1px solid var(--danger, #ef4444); border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, .07); padding: 14px 16px; margin-bottom: 16px;
}
.norefund-head { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.norefund-list { margin: 0 0 12px; padding-left: 20px; font-size: 13px; }
.norefund-list li { margin-bottom: 3px; }
.norefund-consent .check { margin-bottom: 0; }
.norefund-consent .check span { font-size: 13.5px; }
/* `.check strong` is a block elsewhere (it titles a checkbox). Here the bold
   runs mid-sentence, so it has to stay inline or the line breaks around it. */
.norefund-consent .check span strong { display: inline; }

/* --------------------------------------------------------------- live chat */
.chat-root { position: fixed; right: 18px; bottom: 18px; z-index: 900; }

.chat-launcher {
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 23px; line-height: 1;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .38);
  display: grid; place-items: center; position: relative;
  transition: transform .15s ease;
}
.chat-launcher:hover { transform: translateY(-2px); }
.chat-launcher:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.chat-badge {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 10px; background: var(--danger, #ef4444);
  color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center;
}

.chat-panel {
  position: absolute; right: 0; bottom: 66px; width: 340px; max-height: 74vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 15px; border-bottom: 1px solid var(--border); flex: none;
}
.chat-head strong { display: block; font-size: 14.5px; }
.chat-sub { font-size: 11.5px; color: var(--text-dim); }
.chat-x {
  background: none; border: 0; color: var(--text-dim); font-size: 21px;
  line-height: 1; cursor: pointer; padding: 0 2px;
}
.chat-x:hover { color: var(--text); }

.chat-log {
  flex: 1; overflow-y: auto; padding: 14px 15px; display: flex;
  flex-direction: column; gap: 11px; min-height: 120px;
}
.chat-msg { display: flex; flex-direction: column; max-width: 88%; }
.chat-customer { align-self: flex-end; align-items: flex-end; }
.chat-staff { align-self: flex-start; align-items: flex-start; }
.chat-from { font-size: 11px; color: var(--text-dim); margin-bottom: 3px; font-weight: 600; }
.chat-bubble {
  padding: 8px 12px; border-radius: 13px; font-size: 13.5px; line-height: 1.5;
  word-break: break-word;
}
.chat-customer .chat-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-staff .chat-bubble { background: var(--surface-2); border-bottom-left-radius: 4px; }
.chat-time { font-size: 10.5px; color: var(--text-dim); margin-top: 3px; opacity: .75; }

.chat-foot { padding: 12px 15px; border-top: 1px solid var(--border); flex: none; }
.chat-foot input, .chat-foot textarea {
  width: 100%; margin-bottom: 8px; font-size: 13.5px; resize: vertical;
}
.chat-foot [data-reply] { display: flex; gap: 8px; align-items: flex-end; }
.chat-foot [data-reply] textarea { margin-bottom: 0; }
.chat-note { margin: 0 0 10px; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.chat-fineprint { margin: 8px 0 0; font-size: 11px; color: var(--text-dim); line-height: 1.45; }

@media (max-width: 480px) {
  .chat-root { right: 12px; bottom: 12px; }
  .chat-panel {
    position: fixed; inset: 10px 10px 78px; width: auto; max-height: none;
  }
}
