/* Qwiks Shop 1.0 — Waves UI kit (flat, Plus Jakarta Sans, radius 8/16, 44 px touch targets). */
@font-face { font-family: "Plus Jakarta Sans"; src: url("fonts/plus-jakarta-sans.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --accent: #4A3FCB; --accent-ink: #fff; --tint: rgba(74, 63, 203, .10); --softer: rgba(74, 63, 203, .05);
  --surface: #FFFFFF; --surface-2: #F4F2FA; --line: #E4E1EF; --control: #CFCBE3; --ink: #1A0F50; --muted: #5E5880;
  --good-bg: #E8F6EC; --good: #166534; --good-dot: #16A34A;
  --info-bg: #E6F0FE; --info: #1E40AF; --info-dot: #2563EB;
  --wait-bg: #FDF3D7; --wait: #92400E; --wait-dot: #D97706;
  --late-bg: #FDECEA; --late: #B42318; --late-dot: #DC2626;
  --note-bg: #FDF3D7; --note: #7A3A0B;
  --yellow: #FDCB33;
  --menu-w: 216px; --gutter: 16px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #8F86F0; --accent-ink: #0D0828; --tint: rgba(143, 134, 240, .16); --softer: rgba(143, 134, 240, .08);
    --surface: #0D0828; --surface-2: #1A0F50; --line: #2E2566; --control: #3A3075; --ink: #FFFFFF; --muted: #BDB8DA;
    --good-bg: rgba(22, 163, 74, .16); --good: #86EFAC; --info-bg: rgba(59, 130, 246, .16); --info: #93C5FD;
    --wait-bg: rgba(245, 158, 11, .16); --wait: #FCD34D; --late-bg: rgba(239, 68, 68, .16); --late: #FCA5A5;
    --note-bg: rgba(245, 158, 11, .14); --note: #FCD34D; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: #8F86F0; --accent-ink: #0D0828; --tint: rgba(143, 134, 240, .16); --softer: rgba(143, 134, 240, .08);
  --surface: #0D0828; --surface-2: #1A0F50; --line: #2E2566; --control: #3A3075; --ink: #FFFFFF; --muted: #BDB8DA;
  --good-bg: rgba(22, 163, 74, .16); --good: #86EFAC; --info-bg: rgba(59, 130, 246, .16); --info: #93C5FD;
  --wait-bg: rgba(245, 158, 11, .16); --wait: #FCD34D; --late-bg: rgba(239, 68, 68, .16); --late: #FCA5A5;
  --note-bg: rgba(245, 158, 11, .14); --note: #FCD34D; color-scheme: dark;
}
@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1200px) { :root { --gutter: 44px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 500 14px/1.55 var(--font); color: var(--ink); background: var(--surface); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.2; }
h1 { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 8px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--tint); border-color: var(--accent) !important; border-radius: 8px; }
@media (max-width: 1023px) { h1 { font-size: 28px; } h2 { font-size: 22px; } }
@media (max-width: 599px) { h1 { font-size: 24px; } }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--menu-w) minmax(0, 1fr); min-height: 100vh; }
.menu { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.menu .brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 16px; }
.menu .brand img { height: 28px; width: auto; }
.menu .group { height: 1px; background: var(--line); margin: 10px 8px; }
.menu a.item { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: 8px; color: var(--ink); font-weight: 600; text-decoration: none; }
.menu a.item .ic { color: var(--muted); }
.menu a.item:hover { background: var(--surface-2); }
.menu a.item.active { background: var(--surface-2); }
.menu a.item.active .ic { color: var(--accent); }
.menu a.item .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--tint); color: var(--accent); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.menu .foot { margin-top: auto; padding-top: 12px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line); }
.search { flex: 0 1 360px; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.search input, .search input[type=search] { flex: 1; min-width: 0; width: auto; padding: 0; min-height: 0; border: 0; background: transparent; height: 44px; font: inherit; color: var(--ink); outline: none; box-shadow: none; }
.search kbd { font: 600 12px var(--font); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; background: var(--surface); }
.topbar .spacer { flex: 1; }
.topbar .show-phone { display: none; }
.show-phone-flex { display: none !important; }
.menu button.item { width: 100%; background: none; border: 0; font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: 8px; }
.menu button.item .ic { color: var(--muted); }
.menu button.item:hover { background: var(--surface-2); }
.menu form.show-phone-flex { margin: 0; }
.iconbtn.active { background: var(--tint); color: var(--accent); border-color: transparent; }
.iconbtn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; position: relative; }
.iconbtn:hover { background: var(--surface-2); text-decoration: none; }
.iconbtn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--late); }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--tint); color: var(--accent); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.page-wrap { width: 100%; padding: 28px var(--gutter) 64px; container-type: inline-size; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 24px; scrollbar-width: none; }
.tabs a { white-space: nowrap; padding: 12px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a .count { font-size: 12px; color: var(--accent); background: var(--tint); border-radius: 999px; padding: 0 7px; }
.bottombar { display: none; }

/* Tablet: icon rail */
@media (max-width: 1199px) and (min-width: 768px) {
  .shell { grid-template-columns: 72px minmax(0, 1fr); }
  .menu { padding: 12px 8px; align-items: center; }
  .menu .brand { padding: 4px 0 12px; }
  .menu .brand img { content: url("favicon.svg"); height: 36px; width: 36px; }
  .menu a.item { width: 52px; justify-content: center; padding: 0; }
  .menu a.item span:not(.count) { display: none; }
  .menu a.item .count { position: absolute; margin: -22px -26px 0 0; }
  .menu a.item { position: relative; }
  .menu .group { width: 36px; }
}
/* Phone: bottom bar */
@media (max-width: 767px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu { display: none; }
  .menu.open { display: flex; position: fixed; inset: 0 0 56px 0; z-index: 40; height: auto; width: 100%; }
  .save-bar { bottom: calc(56px + env(safe-area-inset-bottom)); }
  .bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(56px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); justify-content: space-around; align-items: center; padding-bottom: env(safe-area-inset-bottom); }
  .bottombar a, .bottombar button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px; color: var(--muted); font: 600 12px var(--font); background: none; border: 0; text-decoration: none; cursor: pointer; }
  .bottombar .navpill { width: 52px; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
  .bottombar .active { color: var(--ink); }
  .bottombar .active .navpill { background: var(--tint); color: var(--accent); }
  .page-wrap { padding-bottom: 96px; }
  .topbar .search { flex: 1; }
  .topbar .hide-phone { display: none; }
  .topbar .show-phone { display: inline-flex; }
  .menu .show-phone-flex { display: flex !important; }
  .menu form.show-phone-flex { display: block !important; }
}

/* ---------- Settings list (SectionList) ---------- */
.section-list { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 32px; align-items: start; }
.section-list nav { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; }
.section-list nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--ink); font-weight: 600; text-decoration: none; }
.section-list nav a .ic { color: var(--muted); }
.section-list nav a:hover { background: var(--surface-2); }
.section-list nav a.active { background: var(--tint); }
.section-list nav a.active .ic { color: var(--accent); }
@media (max-width: 899px) {
  .section-list { grid-template-columns: minmax(0, 1fr); }
  .section-list.has-page nav { display: none; }
  .section-list:not(.has-page) .section-body { display: none; }
  .section-list nav { position: static; }
  .section-list nav a { min-height: 52px; border-bottom: 1px solid var(--line); border-radius: 0; }
}
.back-link, .btn.back-link { display: none; }
@media (max-width: 899px) { .back-link, .btn.back-link { display: inline-flex; margin-bottom: 12px; } }

/* ---------- Cards, grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head p { margin: 4px 0 0; color: var(--muted); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 20px 0; }
.card.alt { background: var(--surface-2); border-color: transparent; }
.grid, .grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; }
/* Items laid out by a grid never get the stacking margin of ".card + .card". */
:is(.grid, .grid-2, .grid-3, .grid-4, .split) > .card + .card, :is(.grid, .grid-2, .grid-3, .grid-4, .split) > * + * { margin-top: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@container (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: minmax(0, 1fr); } }
@container (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.stat .value { font-size: 28px; font-weight: 800; letter-spacing: -.01em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--muted); font-size: 13px; margin-top: 2px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.right { margin-left: auto; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; min-width: 0; word-break: break-word; }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.good::before { background: var(--good-dot); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.info::before { background: var(--info-dot); opacity: 1; }
.pill.wait::before { background: var(--wait-dot); opacity: 1; }
.pill.late::before { background: var(--late-dot); opacity: 1; }
.pill.closed { background: var(--surface-2); color: var(--muted); }
.pill.wait { background: var(--wait-bg); color: var(--wait); }
.pill.late { background: var(--late-bg); color: var(--late); }
.pill.plain::before { display: none; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 8px; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--ink); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; font: 700 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; background: var(--accent); color: var(--accent-ink); }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.outline { background: var(--surface); color: var(--ink); border-color: var(--control); }
.btn.outline:hover { background: var(--surface-2); filter: none; }
.btn.soft { background: var(--tint); color: var(--accent); }
.btn.quiet { background: transparent; color: var(--muted); padding: 0 12px; }
.btn.quiet:hover { color: var(--ink); background: var(--surface-2); filter: none; }
.btn.danger { background: transparent; color: var(--late); padding: 0 12px; }
.btn.danger:hover { background: var(--late-bg); filter: none; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.lg { min-height: 48px; padding: 0 24px; font-size: 15px; }
.btn:active:not(:disabled), .chips a:active, .choice:active { transform: scale(.98); }
.btn, .chips a, .choice, .product-card, .tile { transition: transform .12s ease, border-color .15s ease, background-color .15s ease; }
form.inline { display: inline; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field > label { font-weight: 700; font-size: 13px; }
.field .help { color: var(--muted); font-size: 12px; }
.field .error, span.error { color: var(--late); font-size: 13px; font-weight: 600; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], input[type=datetime-local], input[type=search], input[type=tel], input[type=file], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--control); border-radius: 8px; background: var(--surface); color: var(--ink); font: 500 14px var(--font);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--tint); }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: 10px; min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 600; line-height: 24px; }
.check > small { grid-column: 2; display: block; line-height: 1.5; font-weight: 500; color: var(--muted); }
.stack > input[type=hidden] + :not(input) { margin-top: 0; }
input[type=color] { width: 64px; height: 44px; padding: 4px; border: 1px solid var(--control); border-radius: 8px; background: var(--surface); }
.codes code { display: inline-block; margin: 2px 2px 2px 0; white-space: nowrap; }
.row > input, .row > select { width: auto; flex: 1 1 160px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
@container (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--control); border-radius: 8px; cursor: pointer; min-height: 56px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--softer); }
.choice + .choice { margin-top: 8px; }
.choice .meta { margin-left: auto; color: var(--muted); font-size: 13px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { height: 56px; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--softer); }
.table .num { text-align: right; white-space: nowrap; }
.table td.actions { text-align: right; white-space: nowrap; }
.table a.rowlink { color: var(--ink); font-weight: 700; }
.table .sub { color: var(--muted); font-size: 13px; }
/* ---------- Messages ---------- */
.toast-stack { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100% - 32px)); }
@media (max-width: 767px) { .toast-stack { bottom: 80px; } }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; animation: rise .34s ease-out both; }
.toast.good { border-color: var(--good-dot); }
.toast.late { border-color: var(--late); color: var(--late); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; min-width: 44px; min-height: 44px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; margin-bottom: 16px; background: var(--info-bg); color: var(--info); font-weight: 600; }
.notice.wait { background: var(--wait-bg); color: var(--wait); }
.notice.late { background: var(--late-bg); color: var(--late); }
.notice.good { background: var(--good-bg); color: var(--good); }
.notice p { margin: 4px 0 0; font-weight: 500; }
.internal { background: var(--note-bg); color: var(--note); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { width: 32px; height: 32px; color: var(--accent); margin-bottom: 8px; }
.empty h3 { margin-bottom: 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Lists, timeline, chips ---------- */
.list { display: flex; flex-direction: column; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 52px; }
.list .item:last-child { border-bottom: 0; }
.list .item .grow { flex: 1; min-width: 0; }
.list .item .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chips a { display: inline-flex; align-items: center; flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-weight: 600; text-decoration: none; }
.chips a.active { background: var(--tint); border-color: transparent; color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.msg { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.msg + .msg { margin-top: 12px; }
.msg.staff { background: var(--surface-2); border-color: transparent; }
.msg.internal { border-color: transparent; }
.msg .who { display: flex; gap: 8px; align-items: center; font-weight: 700; margin-bottom: 6px; }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.keybox { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; word-break: break-all; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .col span.b { width: 100%; max-width: 36px; background: var(--line); border-radius: 8px 8px 0 0; min-height: 2px; }
.chart .col.now span.b { background: var(--accent); }
.chart .col small { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- Dialog ---------- */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(560px, calc(100% - 32px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(13, 8, 40, .45); }
dialog .dialog-body { padding: 24px; }
dialog h3 { margin-bottom: 12px; font-size: 20px; }

/* ---------- Public store ---------- */
.store-top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.store-top .in { max-width: 1200px; margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; gap: 16px; }
.store-top .brand img { height: 30px; width: auto; display: block; }
.store-top nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.store-top nav a.link { padding: 10px 12px; color: var(--ink); font-weight: 600; border-radius: 8px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); container-type: inline-size; }
.product-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; color: var(--ink); text-decoration: none; background: var(--surface); }
.product-card:hover { border-color: var(--control); text-decoration: none; }
.prose { max-width: 760px; }
.prose h1 { font-size: 32px; margin-bottom: 16px; }
.prose h2 { font-size: 22px; margin: 28px 0 10px; }
.prose h3 { margin: 20px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.store-foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
.store-foot a { display: inline-flex; align-items: center; min-height: 44px; }
.store-foot .in { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: var(--surface-2); }
.auth .card { width: min(440px, 100%); padding: 28px; }
.auth .logo { display: flex; justify-content: center; margin-bottom: 20px; }
.auth .logo img { height: 34px; width: auto; }
.auth h1 { font-size: 24px; text-align: center; margin-bottom: 6px; }
.auth .sub { text-align: center; color: var(--muted); margin-bottom: 20px; }
.qr svg { width: 200px; height: 200px; background: #fff; border-radius: 8px; }

/* ---------- Print (invoices) ---------- */
@media print {
  .menu, .topbar, .bottombar, .no-print, .toast-stack, .tabs { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
  .card { border: 0; padding: 0; }
}
.list a.item { color: inherit; text-decoration: none; border-radius: 8px; }
.list a.item:hover { background: var(--softer); }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; }
.kpi-row { display: flex; flex-wrap: wrap; gap: 24px; }

/* ================= 1.0.1: UI kit boards (strict) ================= */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.filters { margin-bottom: 16px; }
.filters .chips { margin-bottom: 0; }
.filters .row { flex-wrap: nowrap; }
.filters .row > input, .filters .row > select { flex: 0 1 200px; min-width: 0; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--tint); color: var(--accent); font-size: 12px; font-weight: 700; }
.list-row { padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 56px; }
.list-row:last-child { border-bottom: 0; }
.sub { color: var(--muted); font-size: 13px; }
.choice .sub { display: block; font-weight: 500; }
.choice > span { display: flex; flex-direction: column; }
.stat .sub, .stat .hint { display: block; }
.kpi-row { margin-bottom: 20px; }
.kpi-row .stat { flex: 1 1 160px; }
@media (min-width: 600px) and (max-width: 1199px) { .kpi-row .stat { flex: 1 1 calc(50% - 24px); } }
@media (max-width: 767px) { .kpi-row { gap: 12px; } .kpi-row .stat .value { font-size: 22px; } }
.ic.flip { transform: scaleX(-1); }
.phone-only, .topbar .phone-logo { display: none; }
a.product-card:hover, a.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
code.secret, code.otp { font-size: 16px; font-weight: 700; letter-spacing: .02em; background: transparent; padding: 0; }
code.otp { font-size: 22px; letter-spacing: .12em; }
fieldset { border: 0; margin: 0; min-width: 0; }
fieldset.card { border: 1px solid transparent; }
legend { padding: 0; }

/* Tablet drops the two least useful columns; phone shows one row per record. */
@media (min-width: 768px) and (max-width: 1199px) { .hide-tablet { display: none !important; } }
@media (max-width: 767px) {
  .hide-phone { display: none !important; }
  table.table.rows-phone thead, table.table.stack-phone thead { display: none; }
  table.table.rows-phone, table.table.stack-phone, .rows-phone tbody, .stack-phone tbody { display: block; }
  table.table.rows-phone tr, table.table.stack-phone tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: center;
    min-height: 68px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: relative;
  }
  table.table.rows-phone tr:last-child, table.table.stack-phone tr:last-child { border-bottom: 0; }
  table.table.rows-phone td, table.table.stack-phone td { display: none; height: auto; padding: 0; border: 0; }
  /* left: the record (name + "number · due" line); right: amount over status */
  table.table.rows-phone td:first-child, table.table.stack-phone td:first-child { display: block; grid-column: 1; grid-row: 1 / span 2; min-width: 0; }
  table.table.rows-phone td:first-child a, table.table.stack-phone td:first-child a { display: inline-flex; min-height: 44px; align-items: center; }
  table.table:is(.rows-phone, .stack-phone) td.num:not(.num ~ .num), table.table:is(.rows-phone, .stack-phone) td.phone-amount { display: block; grid-column: 2; grid-row: 1; text-align: right; font-weight: 700; }
  table.table:is(.rows-phone, .stack-phone) tr:has(.phone-amount) td.num:not(.phone-amount) { display: none; }
  table.table:is(.rows-phone, .stack-phone) td:has(> .pill):not(:has(~ td > .pill)) { display: block; grid-column: 2; grid-row: 2; text-align: right; }
  :is(.rows-phone, .stack-phone) td:has(> .pill) .sub { display: none; }
  .phone-only { display: inline; }
  div.phone-only { display: block; }
  .topbar .phone-logo { display: flex; }
  .topbar .phone-logo img { height: 28px; width: auto; }
  table.table.rows-phone td.actions, table.table.stack-phone td.actions { display: flex; grid-column: 1 / -1; justify-content: flex-start; gap: 8px; margin-top: 8px; }
  table.table.rows-phone td.actions:empty, table.table.stack-phone td.actions:empty { display: none; }
  table.table.rows-phone td.keep-phone, table.table.stack-phone td.keep-phone { display: block; grid-column: 1; font-size: 13px; color: var(--muted); }
  table.table.rows-phone a.rowlink::after, table.table.stack-phone a.rowlink::after { content: ""; position: absolute; inset: 0; }
  table.table.rows-phone td.actions, table.table.stack-phone td.actions, table.table td :is(form, button) { position: relative; z-index: 1; }
  .table tbody tr:hover td { background: transparent; }
  .filters .row { width: 100%; }
  .filters .row > input, .filters .row > select { flex: 1 1 140px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
  .chips a { flex: none; }
}

/* ---------- Loading: preloader on reload only, skeleton while the next page loads ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }
.preloader { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: var(--surface); transition: opacity .25s ease; }
.preloader img { width: 132px; height: auto; animation: breathe 1.2s ease-in-out infinite; }
.preloader.done { opacity: 0; pointer-events: none; }
html:not(.reload) .preloader { display: none; }
@keyframes breathe { 50% { opacity: .55; } }
.skeleton-page { display: none; }
html.leaving .page-wrap > :not(.skeleton-page), html.leaving main.store-main > :not(.container:has(> .skeleton-page)) { display: none; }
html.leaving .skeleton-page { display: block; }
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.2s ease infinite; }
.sk.h1 { height: 40px; width: min(320px, 70%); margin-bottom: 12px; }
.sk.line { height: 14px; width: 45%; margin-bottom: 24px; }
.sk.block { height: 120px; border-radius: 16px; }
.sk.row { height: 56px; margin-top: 8px; }
.skeleton-page .grid-3 { margin-bottom: 16px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .sk, .preloader img { animation: none; } ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }

/* ---------- Store (boards: header, hero, product cards, product page, checkout, account) ---------- */
.store-top .in { min-height: 72px; padding-top: 8px; padding-bottom: 8px; }
.store-top .brand img, .store-top .logo img { height: 32px; width: auto; min-width: 126px; object-fit: contain; object-position: left; }
.store-top nav { gap: 6px; }
.store-top nav a.link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; white-space: nowrap; }
.store-top nav a.link:hover { background: var(--surface-2); text-decoration: none; }
.store-top nav .btn { white-space: nowrap; }
@media (max-width: 767px) { .store-top .in { gap: 8px; } .store-top nav .btn { padding: 0 14px; } }
main.store-main { min-height: 60vh; }
.hero2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; padding: 64px 0 48px; }
.hero2 h1 { margin-top: 10px; }
.hero2 p.lead { font-size: 16px; color: var(--muted); margin-top: 14px; max-width: 560px; }
.hero2 .panel { background: var(--surface-2); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.hero2 .feature { display: flex; gap: 14px; align-items: flex-start; }
.hero2 .feature .mk { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--surface); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.hero2 .feature strong { display: block; }
.hero2 .feature span { color: var(--muted); font-size: 13px; }
@container (max-width: 860px) { .hero2 { grid-template-columns: minmax(0, 1fr); padding-top: 32px; gap: 24px; } }
.section-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.section-h h2 { font-size: 24px; font-weight: 800; }
.products4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-bottom: 48px; }
@container (max-width: 1000px) { .products4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 760px) { .products4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 480px) { .products4 { grid-template-columns: minmax(0, 1fr); } }
a.product-card { padding: 20px; gap: 10px; }
.product-card .mark { width: 48px; height: 48px; border-radius: 12px; background: var(--tint); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; overflow: hidden; }
.product-card .mark img { width: 100%; height: 100%; object-fit: cover; }
.product-card .name { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.product-card .one { color: var(--muted); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card .from { margin-top: auto; padding-top: 6px; font-weight: 700; }
.product-card .from span { color: var(--muted); font-weight: 500; }
.services2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-bottom: 64px; }
@container (max-width: 640px) { .services2 { grid-template-columns: minmax(0, 1fr); } }
.service-card { border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; gap: 16px; align-items: flex-start; }
.service-card .mark { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.service-card .grow { flex: 1; min-width: 0; }
.service-card h3 { font-size: 18px; font-weight: 800; }
.product-page { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 40px; align-items: start; padding: 32px 0 64px; }
.product-page aside { position: sticky; top: 96px; }
@container (max-width: 960px) { .product-page { grid-template-columns: minmax(0, 1fr); } .product-page aside { position: static; } }
.picker { border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.picker .plan-opt { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--control); border-radius: 12px; cursor: pointer; }
.picker .plan-opt + .plan-opt { margin-top: 10px; }
.picker .plan-opt:has(input:checked) { border: 2px solid var(--accent); padding: 15px; background: var(--softer); }
.picker .plan-opt input { margin-top: 3px; }
.picker .plan-opt .grow { flex: 1; min-width: 0; }
.picker .plan-opt .amt { font-weight: 800; white-space: nowrap; text-align: right; }
.picker .plan-opt .amt .sub { font-weight: 500; }
.picker .plan-opt ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.ptabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 28px 0 20px; overflow-x: auto; scrollbar-width: none; }
.ptabs a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; color: var(--muted); font-weight: 700; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.ptabs a.active, .ptabs a:target { color: var(--ink); border-bottom-color: var(--accent); }
.ptab { display: none; }
.ptab.active { display: block; }
.feature-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; }
.feature-list li .ic { color: var(--good-dot); }
@container (max-width: 560px) { .feature-list { grid-template-columns: minmax(0, 1fr); } }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 16px 0 24px; flex-wrap: wrap; }
.steps li { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 13px; }
.steps li b { width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--control); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.steps li.on { color: var(--ink); }
.steps li.on b { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps li + li::before { content: ""; width: 24px; height: 1px; background: var(--line); }
.checkout2 { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; padding-bottom: 64px; }
.checkout2 aside { background: var(--surface-2); border-radius: 16px; padding: 24px; position: sticky; top: 96px; }
.checkout2 .totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 0; margin: 16px 0; font-variant-numeric: tabular-nums; }
.checkout2 .totals > :nth-child(even) { text-align: right; padding-left: 16px; }
.checkout2 .totals .grand { font-size: 20px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 10px; }
.paybar { display: none; }
@container (max-width: 900px) { .checkout2 { grid-template-columns: minmax(0, 1fr); } .checkout2 aside { position: static; } }
@media (max-width: 767px) {
  .paybar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .paybar .t { flex: 1; } .paybar .t strong { display: block; font-size: 18px; }
  .has-paybar { padding-bottom: 150px; }
  .checkout2 aside .pay-main { display: none; }
}
.balance { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--surface-2); border-radius: 16px; padding: 24px; margin-bottom: 16px; }
.balance .value { font-size: 32px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.balance .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
a.tile { display: flex; flex-direction: column; gap: 8px; min-height: 96px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); font-weight: 700; text-decoration: none; }
a.tile .ic { color: var(--accent); }
@media (min-width: 768px) { .hide-tablet-up { display: none !important; } }

.table td.actions > form, .table td.actions > a { display: inline-flex; vertical-align: middle; margin-left: 4px; }

/* ---------- 1.0.2 ---------- */
.stat strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tiles:has(> .stat:nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (max-width: 640px) { .tiles:has(> .stat:nth-child(3)) { grid-template-columns: minmax(0, 1fr); } }

/* Settings menu: groups and search */
.settings-search { margin-bottom: 8px; }
.settings-search input { min-height: 40px; background: var(--surface-2); border-color: transparent; }
.settings-group { display: flex; flex-direction: column; gap: 2px; }
.settings-group + .settings-group { margin-top: 12px; }
.group-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 6px 12px 4px; }
.section-list nav a[hidden], .settings-group[hidden] { display: none; }

/* Save bar that sticks to the bottom of long settings forms */
.save-bar { scroll-margin-bottom: 80px; position: sticky; bottom: 0; z-index: 5; margin: 20px -20px -20px; padding: 14px 20px; background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; }
.save-note { display: none; margin-right: auto; }
form.dirty .save-note { display: inline; color: var(--wait); font-weight: 700; }
form.dirty .save-bar { border-top-color: var(--wait); }

/* Payment gateway cards */
.gw-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.gw-card + .gw-card { margin-top: 12px; }
.gw-card[open] { border-color: var(--control); }
.gw-card > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 72px; color: var(--ink); font-weight: 500; width: 100%; }
.gw-card > summary::-webkit-details-marker { display: none; }
.gw-card > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 6px 4px 4px; transition: transform .15s ease; flex: none; }
.gw-card[open] > summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
.gw-logo { width: 44px; height: 44px; flex: none; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gw-logo img { width: 30px; height: 30px; object-fit: contain; }
.gw-logo b { font-size: 20px; font-weight: 800; color: #1A0F50; }
.gw-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gw-name strong { font-size: 15px; }
.gw-state { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.gw-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.gw-body > .switch { margin: 12px 0 8px; }
.gw-body .help.full { grid-column: 1 / -1; margin: -4px 0 12px; }
.gw-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px dashed var(--line); }
@container (max-width: 560px) { .gw-card > summary { flex-wrap: wrap; } .gw-state { width: 100%; justify-content: flex-start; padding-left: 58px; } }

/* Switch (a checkbox that looks like a toggle) */
.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 600; }

/* Sub-cards, chips that are checkboxes or radios */
.sub-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 0 0 16px; min-width: 0; }
.sub-card > legend { padding: 0 6px; margin-left: -6px; font-weight: 600; }
.sub-card > legend.label { font-weight: 700; }
.cur-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.cur-grid .sub-card { margin: 0; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (max-width: 700px) { .form-grid.three { grid-template-columns: minmax(0, 1fr); } }
.chips:has(.chip-check, .chip-radio) { margin-bottom: 0; }
.chip-check, .chip-radio { position: relative; display: inline-flex; cursor: pointer; }
.chip-check input, .chip-radio input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip-check span, .chip-radio span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--control); font-weight: 600; font-size: 13px; color: var(--ink); background: var(--surface); transition: background-color .15s ease, border-color .15s ease; }
.chip-check input:checked + span, .chip-radio input:checked + span { background: var(--tint); border-color: var(--accent); color: var(--accent); }
.chip-check input:focus-visible + span, .chip-radio input:focus-visible + span { box-shadow: 0 0 0 4px var(--tint); }

/* Plan renewals grid */
.renew-grid { display: grid; gap: 0; }
.rg-head, .rg-row { display: grid; grid-template-columns: minmax(180px, 1.6fr) 1fr .8fr 1fr 90px; gap: 10px; align-items: center; }
.rg-head { font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.rg-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.rg-row:last-child { border-bottom: 0; }
.rg-row .check { padding: 6px 0; }
.rg-row:not(:has(input[name$="[on]"]:checked)) > input { opacity: .55; }
@container (max-width: 760px) {
  .rg-head { display: none; }
  .rg-row { grid-template-columns: 1fr 1fr; padding: 10px 0; }
  .rg-row > .check:first-child { grid-column: 1 / -1; }
  .rg-row > input::placeholder { color: var(--muted); }
}

/* Licence periods */
.periods { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.period { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.period .sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.period.good, .period.life { border-left-color: var(--good-dot); }
.period.wait { border-left-color: var(--wait-dot); background: var(--wait-bg); }
.period.late { border-left-color: var(--late-dot); background: var(--late-bg); }
@container (max-width: 640px) { .periods { grid-template-columns: minmax(0, 1fr); } }

/* Branding previews */
.brand-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.brand-preview > div { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; background: #fff; min-height: 96px; }
.brand-preview > div.dark { background: #1A0F50; border-color: #1A0F50; }
.brand-preview .label { color: #5E5880; }
.brand-preview > div.dark .label { color: #BDB8DA; }
.brand-preview img { max-width: 100%; height: 34px; width: auto; }
@container (max-width: 560px) { .brand-preview { grid-template-columns: minmax(0, 1fr); } }

/* Health */
.list.health .item { align-items: flex-start; }
.list.health .item .sub { color: var(--muted); font-size: 13px; }

/* Two-factor setup */
.wizard { display: flex; gap: 8px 18px; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: st; flex-wrap: wrap; }
.wizard li { counter-increment: st; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); padding-right: 10px; }
.wizard li::before { content: counter(st); width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--control); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.wizard li.now { color: var(--ink); }
.wizard li.now::before { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.wizard li.done { color: var(--good); }
.wizard li.done::before { content: "✓"; background: var(--good-bg); border-color: transparent; color: var(--good); }
.qr-row { display: flex; gap: 24px; align-items: center; margin: 16px 0 20px; flex-wrap: wrap; }
.qr { width: 200px; height: 200px; padding: 8px; border-radius: 12px; background: #fff; border: 1px solid var(--line); flex: none; }
.qr svg { width: 100%; height: 100%; display: block; border-radius: 0; }
.qr-key { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; flex: 1 1 220px; }
.setup-key { font-size: 15px; letter-spacing: .06em; padding: 8px 12px; word-break: break-word; }
.otp { position: relative; }
.otp .otp-boxes { display: none; }
.otp.ready .otp-value { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.otp.ready .otp-boxes { display: flex; gap: 8px; }
.otp-boxes input { width: 48px; height: 56px; padding: 0; text-align: center; font: 800 22px var(--font); font-variant-numeric: tabular-nums; border-radius: 12px; }
.otp-boxes input:nth-child(3) { margin-right: 10px; }
@media (max-width: 400px) { .otp-boxes input { width: 40px; height: 50px; } .otp.ready .otp-boxes { gap: 6px; } }
.code-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.code-list code { display: block; text-align: center; padding: 10px; font-size: 15px; letter-spacing: .08em; }
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: auto; }
@media print {
  body * { visibility: hidden; }
  .codes-card, .codes-card * { visibility: visible; }
  .codes-card { position: absolute; inset: 0 auto auto 0; border: 0; }
  .codes-card .row, .codes-card hr, .codes-card .check, .codes-card .form-actions, .codes-card .wizard { display: none; }
}

/* Skeleton kinds */
.sk-kind { display: none; }
html:not([data-sk]) .sk-list, html[data-sk="list"] .sk-list, html[data-sk="detail"] .sk-detail, html[data-sk="form"] .sk-form, html[data-sk="dashboard"] .sk-dashboard { display: block; }
.sk.pill-sk { width: 84px; height: 32px; border-radius: 999px; }
.sk.block.tall { height: 240px; }
.sk.block.small { height: 96px; }
.sk-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.sk-split > div { display: flex; flex-direction: column; gap: 12px; }
.sk-card { border: 1px solid var(--line); border-radius: 16px; padding: 20px; max-width: 720px; display: flex; flex-direction: column; }
.sk.label { height: 12px; width: 120px; margin: 4px 0 8px; }
.sk.input { height: 44px; margin-bottom: 16px; }
.sk.input.area { height: 110px; }
.sk.btn-sk { height: 44px; width: 120px; border-radius: 999px; }
@container (max-width: 760px) { .sk-split { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Store 1.0.2: featured, badges, offers, footer ---------- */
main.store-main { padding-bottom: 64px; }
.featured { display: grid; gap: 16px; margin: 0 0 48px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.featured.n1 { grid-template-columns: minmax(0, 1fr); }
.featured.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.featured.n1 .feature-card.has-media { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.feature-card .media { display: block; background: var(--surface-2); aspect-ratio: 16 / 9; }
.featured.n1 .feature-card .media { aspect-ratio: auto; min-height: 300px; }
.feature-card .media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature-card .body { padding: 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.featured.n1 .feature-card .body { padding: 32px; justify-content: center; }
.feature-card .mark { width: 44px; height: 44px; border-radius: 12px; background: var(--tint); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; flex: none; }
.feature-card h2 { font-size: 24px; font-weight: 800; }
.featured.n1 .feature-card h2 { font-size: 28px; }
.feature-card h2 a { color: var(--ink); display: inline-flex; align-items: center; min-height: 44px; }
.feature-card .body > p { margin: 0; }
.feature-card .price { font-size: 22px; font-weight: 800; margin-top: 8px !important; font-variant-numeric: tabular-nums; }
.feature-card .price span { font-size: 14px; color: var(--muted); font-weight: 500; }
.feature-card .price s, .product-card .from s, s.was { color: var(--muted); font-weight: 500; margin-right: 4px; }
.feature-card .body > .row:last-child { margin-top: auto !important; padding-top: 16px; }
@container (max-width: 980px) { .featured, .featured.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 640px) { .featured, .featured.n2 { grid-template-columns: minmax(0, 1fr); } .featured.n1 .feature-card.has-media { display: flex; } .featured.n1 .feature-card .media { min-height: 0; aspect-ratio: 16 / 9; } .feature-card .body, .featured.n1 .feature-card .body { padding: 20px; } }
.offer-line { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--wait-bg); color: var(--wait); font-weight: 700; font-size: 13px; }
.mark.big { width: 96px; height: 96px; border-radius: 24px; background: var(--tint); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--surface-2); color: var(--muted); }
.badge.new { background: var(--info-bg); color: var(--info); }
.badge.popular { background: var(--wait-bg); color: var(--wait); }
.badge.updated { background: var(--good-bg); color: var(--good); }
.offer-box { border: 1px solid var(--line); background: var(--wait-bg); color: var(--ink); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.offer-box .label { color: var(--wait); }
.offer-box p { margin: 4px 0 0; }
.offer-box .sub { color: var(--muted); font-size: 13px; }
#products, #services { padding-bottom: 16px; }
.products4 { padding-bottom: 16px; }

.store-foot { padding: 48px 0 24px; margin-top: 0; background: var(--surface-2); border-top: 0; }
.store-foot .foot-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); gap: 32px; }
.store-foot h4 { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin: 0 0 8px; }
.store-foot nav, .store-foot .foot-grid > div:not(.foot-brand) { display: flex; flex-direction: column; align-items: flex-start; }
.store-foot .foot-grid a { min-height: 32px; color: var(--muted); font-weight: 600; }
.store-foot .foot-grid a:hover { color: var(--ink); text-decoration: none; }
.foot-brand p { margin: 12px 0 0; max-width: 320px; line-height: 1.6; }
.foot-brand .logo img, .foot-brand img { height: 32px; width: auto; }
.foot-bottom { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; }
@media (max-width: 900px) { .store-foot .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .store-foot .foot-grid { gap: 20px 16px; } .store-foot .foot-grid a { overflow-wrap: anywhere; } }
.checklist .meter { width: 160px; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.checklist .meter span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.checklist .tick { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); flex: none; }
.checklist .tick .ic { width: 16px; height: 16px; }
.checklist .is-done .tick { background: var(--good-bg); color: var(--good); }
.checklist .is-done .grow { color: var(--muted); }
.keybox code { flex: 1; min-width: 0; background: none; padding: 0; }
.keybox .btn { flex: none; }
.chip-check span, .chip-radio span { white-space: nowrap; }
@container (max-width: 560px) {
  .gw-card > summary { flex-wrap: nowrap; align-items: flex-start; }
  .gw-name { gap: 6px; }
  .gw-state { width: auto; padding-left: 0; }
  .gw-card > summary { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; }
  .gw-card > summary .gw-state { grid-column: 2; justify-content: flex-start; }
  .gw-card > summary::after { grid-column: 3; grid-row: 1; margin-top: 16px; }
}

/* ---------- 1.0.2 review fixes ---------- */
.nowrap { white-space: nowrap; }
.product-card .one { white-space: normal; overflow: visible; text-overflow: clip; }
.picker .plan-opt .plan-lines { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.field .help, .check small, small { font-size: 12px; }

/* Tick boxes and radio buttons: 24 px drawn, 44 px tap area */
input[type=checkbox], input[type=radio] { appearance: none; -webkit-appearance: none; flex: none; margin: 0; width: 24px; height: 24px; border: 1.5px solid var(--control); background: var(--surface); border-radius: 6px; position: relative; cursor: pointer; display: inline-grid; place-content: center; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]::before, input[type=radio]::before { content: ""; position: absolute; inset: -11px; }
input[type=checkbox]:checked, input[type=radio]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { content: ""; width: 11px; height: 6px; border-left: 2.5px solid var(--accent-ink); border-bottom: 2.5px solid var(--accent-ink); transform: rotate(-45deg) translateY(-1px); }
input[type=radio]:checked::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-ink); }
input[type=checkbox]:disabled, input[type=radio]:disabled { opacity: .5; cursor: not-allowed; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { box-shadow: 0 0 0 4px var(--tint); }
.switch input[type=checkbox] { width: 44px; height: 26px; border: 0; border-radius: 999px; background: var(--control); display: inline-block; }
.switch input[type=checkbox]::before { inset: -9px 0; }
.switch input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; transform: none; transition: transform .15s ease; }
.switch input[type=checkbox]:checked { background: var(--accent); }
.switch input[type=checkbox]:checked::after { transform: translateX(18px); }
.chip-check input[type=checkbox], .chip-radio input[type=radio] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; }
.chip-check span, .chip-radio span { min-height: 44px; padding: 0 16px; }

/* 44 px touch targets */
.avatar { width: 44px; height: 44px; }
.logo, .brand, a.logo { display: inline-flex; align-items: center; min-height: 44px; }
.store-foot .foot-grid a { min-height: 44px; }
.auth-links a, p.row.between.small a { display: inline-flex; align-items: center; min-height: 44px; }
.check a { display: inline-block; padding: 14px 0; margin: -14px 0; }
.list.installs .item, .card.flush .list .item { padding-left: 20px; padding-right: 20px; }
.list .item .mark { width: 40px; height: 40px; border-radius: 12px; background: var(--tint); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.list.installs .item { align-items: flex-start; flex-wrap: wrap; }
.list.installs .title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; white-space: normal; }
.list.installs .sub { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.list.installs .sub.mono { font-size: 12px; }
.list.installs .item-actions { gap: 4px; margin-left: auto; }
@media (max-width: 1199px) {
  .list .item .title a, .list-row a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
}

/* Store menu on phones */
.store-menu { display: none; position: relative; }
.store-menu summary { list-style: none; width: 44px; height: 44px; min-height: 44px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); border: 1px solid var(--line); }
.store-menu summary::-webkit-details-marker { display: none; }
.store-menu[open] summary { background: var(--surface-2); }
.store-menu-panel { position: absolute; right: 0; top: 52px; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px; display: flex; flex-direction: column; z-index: 40; }
.store-menu-panel a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 8px; color: var(--ink); font-weight: 600; }
.store-menu-panel a:hover { background: var(--surface-2); text-decoration: none; }
@media (max-width: 767px) { .store-menu { display: block; } .store-top nav > a.link { display: none; } }

/* Checkout on phones: the agreement sits right above the pinned Pay bar */
.check.need { outline: 2px solid var(--late-dot); outline-offset: 6px; border-radius: 8px; }
.paybar .why { display: none; }
@media (max-width: 899px) { .paybar.blocked .why { display: block; color: var(--late); font-size: 12px; font-weight: 700; } }
[hidden] { display: none !important; }
.paybar .pb-terms { display: none; }
@media (max-width: 899px) {
  .paybar { flex-wrap: wrap; }
  .paybar .pb-terms { display: flex; width: 100%; min-height: 44px; padding: 0 0 4px; align-items: center; }
  .checkout2 aside .terms-row { display: none; }
}

/* ---------- Emails ---------- */
.kind-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; background: var(--surface); }
.kind-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.late-text { color: var(--late); }
.tpl-section + .tpl-section { margin-top: 32px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
@media (max-width: 599px) { .tpl-mini { height: auto; padding: 16px; } .tpl-mini .m-line { display: none; } }
.tpl-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.tpl-card:hover { border-color: var(--control); }
.tpl-mini { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px; height: 176px; background: var(--tint); border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); overflow: hidden; }
.tpl-mini .m-logo { width: 56px; height: 10px; border-radius: 4px; background: var(--accent); opacity: .5; }
.tpl-mini .m-eyebrow { font: 700 12px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.tpl-mini .m-title { font: 700 16px/1.3 var(--font); }
.tpl-mini .m-line { height: 8px; border-radius: 4px; background: var(--line); width: 90%; }
.tpl-mini .m-line.short { width: 60%; }
.tpl-mini .m-btn { align-self: flex-start; margin-top: 4px; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: #fff; font: 700 12px var(--font); }
.tpl-mini.promotion .m-eyebrow { color: var(--good); }
.tpl-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.tpl-body strong a { color: var(--ink); }
.preview-split, .compose-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@container (max-width: 1000px) { .preview-split, .compose-split { grid-template-columns: minmax(0, 1fr); } }
.mail-stage { background: #F4F2FA; border-radius: 12px; border: 1px solid var(--line); padding: 0; overflow: hidden; display: flex; justify-content: center; }
.mail-frame { width: 100%; height: 760px; border: 0; display: block; background: transparent; transition: width .2s ease; }
.mail-stage.phone .mail-frame { width: 390px; max-width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--control); border-radius: 999px; padding: 2px; background: var(--surface); }
.seg button { min-height: 36px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 13px var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.seg button.on { background: var(--tint); color: var(--accent); }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; min-height: 420px; white-space: pre; background: var(--surface-2); }
.kind-pick { display: grid; gap: 8px; }
.kind-pick .choice { align-items: flex-start; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 0 0 8px; }
.progress span { display: block; height: 100%; background: var(--accent); }
.list.recips .item { padding-left: 20px; padding-right: 20px; }
.list.recips .sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.unsub-card { max-width: 560px; margin: 64px auto; text-align: center; padding: 40px 28px; }
.unsub-card h1 { font-size: 28px; margin: 16px 0 8px; }
.unsub-card p { margin-left: auto; margin-right: auto; max-width: 440px; }
.unsub-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--tint); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.unsub-mark.good { background: var(--good-bg); color: var(--good); }
.unsub-mark .ic { width: 26px; height: 26px; }
.kind-sub { display: block; margin-top: 2px; font-weight: 500; }
.unsub-card .btn { white-space: normal; height: auto; min-height: 44px; padding: 10px 20px; text-align: center; max-width: 100%; }
@media (max-width: 480px) { .unsub-card { margin: 32px auto; padding: 32px 20px; } .unsub-card h1 { font-size: 24px; } }

/* ---------- 1.0.3 ---------- */
.auth .card.wide { width: min(580px, 100%); }
.type-pick { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.type-pick legend { margin-bottom: 8px; padding: 0; }
.type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.type-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--control); border-radius: 12px; cursor: pointer; min-height: 72px; background: var(--surface); transition: border-color .15s ease, background-color .15s ease; }
.type-card input[type=radio] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; border: 0; }
.type-card:has(input:checked) { border: 2px solid var(--accent); padding: 13px; background: var(--softer); }
.type-card:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--tint); }
.tc-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.type-card:has(input:checked) .tc-ic { background: var(--accent); color: var(--accent-ink); }
.tc-text strong { display: block; font-size: 14px; }
.tc-text span { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 2px; }
.billing-step { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
@media (max-width: 420px) { .type-grid { grid-template-columns: minmax(0, 1fr); } .type-card { min-height: 60px; } }
.links-list .field input { flex: 1; }

.verify-bar { background: var(--wait-bg); color: var(--wait); border-bottom: 1px solid var(--line); }
.verify-bar .in { max-width: 1200px; margin: 0 auto; padding: 8px var(--gutter); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 600; font-size: 13px; }
.verify-bar .in span { flex: 1; min-width: 200px; }
.inline-label summary { color: var(--accent); font-weight: 600; min-height: 32px; }
.inline-label[open] summary { color: var(--muted); }
.dl-buttons { gap: 8px; flex-wrap: wrap; }
.update-notice .btn { margin-top: 0; }

.viewas-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin: -8px 0 16px; border-radius: 12px; background: var(--info-bg); color: var(--info); font-size: 13px; font-weight: 600; }
.viewas-bar span { flex: 1; min-width: 200px; }

.rate-card { margin-bottom: 16px; }
.rate-card h3 { margin-bottom: 8px; }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 30px; color: var(--control); }
.star input[type=radio] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; border: 0; cursor: pointer; }
.star:has(input:checked), .star:has(input:checked) ~ .star, .stars:not(:has(input:checked)) .star:hover, .stars:not(:has(input:checked)) .star:hover ~ .star { color: var(--yellow); }
.star:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--tint); border-radius: 8px; }
.rating-inline { color: #D97706; letter-spacing: 1px; }

/* Text links that are tapped on their own get a 44 px target (1.0.4). */
a.tap, .tap { display: inline-flex; align-items: center; min-height: 44px; }
button.item.item-btn { width: 100%; text-align: left; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.portal-foot { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.portal-foot a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
.portal-foot a:hover { color: var(--ink); }
/* 1.0.4: every control is at least 44 px tall on tablets, phones and touch screens (UI review). */
@media (max-width: 1199px), (pointer: coarse) {
  table.table td a:not(.btn), table.table a.rowlink { display: inline-flex; align-items: center; min-height: 44px; }
  details > summary { min-height: 44px !important; display: flex; align-items: center; }
  label.check { min-height: 44px !important; align-items: center; }
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select { min-height: 44px !important; }
  .seg button, .preview-tools button { min-height: 44px; min-width: 44px; }
}
.glance { margin-top: 28px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; }
.glance h3 { margin-bottom: 12px; }
/* 1.0.5: fields use 16 px text on phones and tablets, so iPhone Safari does not zoom in when a field is tapped. */
@media (max-width: 1199px), (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
}

/* 1.0.5: logo follows the app's own light/dark switch, not only the device */
:root .brand img.logo-dark { display: none; }
:root[data-theme="dark"] .brand img.logo-light { display: none; }
:root[data-theme="dark"] .brand img.logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand img.logo-light { display: none; }
  :root:not([data-theme="light"]) .brand img.logo-dark { display: block; }
}
input[type=file] { max-width: 100%; min-width: 0; }
.row > input[type=file] { flex: 1 1 200px; }
ul.list, ol.list { padding-left: 0; list-style: none; }
@media (max-width: 1199px) { .section-list nav a { min-height: 44px; display: flex; align-items: center; } }
.auth .logo.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 599px) { .form-grid.pw-pair { grid-template-columns: minmax(0, 1fr); } }
/* 1.0.5: bigger tap areas for text links on touch screens, without moving the layout */
@media (max-width: 1199px), (pointer: coarse) {
  .help > a, .facts dd > a, .help a, .notice a, .card p > a, .stat .sub > a, .empty p > a, p.muted > a, .page-head p > a, .auth .sub a, .auth p a { display: inline-block; padding-block: 12px; margin-block: -12px; }
  .btn.sm { min-height: 44px; }
  .modal .close, dialog .close, button[aria-label="Close"] { min-width: 44px; min-height: 44px; }
}
select { max-width: 100%; }
.field select, .field input:not([type=checkbox]):not([type=radio]) { min-width: 0; }

/* ================= 1.0.6: layout and page organisation ================= */
.card > h3 + :is(.form-grid, .field) { margin-top: 12px; }
.title-row { gap: 12px; }
.sub-card > legend { font-size: 16px; font-weight: 700; }
.sub-card > legend.label { font-size: 12px; }
.sub-card[id] { scroll-margin-top: 88px; }
.sub-card > :last-child, .sub-card > .form-grid:last-child > .field:last-child { margin-bottom: 0; }
.sub-lead { margin: 0 0 12px; }
.sub-label { margin: 4px 0 6px; }
.check + .sub-label { margin-top: 16px; }
.unit { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.unit input { width: 96px; flex: none; }
.type-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.type-row .check { padding: 0; align-items: center; }
.type-row:last-child { border: 0; }
@container (max-width: 560px) { .type-row { grid-template-columns: auto auto 1fr; } .type-row > [name=name] { grid-column: 1 / -1; } .type-row > .btn { justify-self: end; } }
.needs .pill { min-width: 76px; }
.checklist.compact .fold-go { display: none; }
@media (max-width: 767px) {
  .checklist.compact .list { display: none; }
  .checklist.compact .card-head { margin: 0; }
  .checklist.compact .fold-go { display: inline-flex; }
  .checklist.compact .meter { display: none; }
  .page-head:has(+ .section-list.has-page) { display: none; }
}
@container (max-width: 560px) {
  .grid-4.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stats .stat { padding: 14px; }
  .stats .stat .value { font-size: 20px; overflow-wrap: anywhere; }
}

/* Totals sit in the table foot, under the Amount column */
.table tfoot td { height: auto; padding: 4px 16px; border: 0; color: var(--muted); }
.table tfoot td:first-child { text-align: right; }
.table tfoot td + td { color: var(--ink); font-weight: 600; }
.table tfoot tr:first-child td { padding-top: 16px; border-top: 1px solid var(--line); }
.table tfoot tr:last-child td { padding-bottom: 16px; }
.table tfoot tr.grand td { color: var(--ink); font-weight: 800; font-size: 16px; padding-top: 8px; }
@media (max-width: 767px) {
  table.table.stack-phone tfoot { display: block; padding: 12px 0; border-top: 1px solid var(--line); }
  table.table.stack-phone tfoot tr { min-height: 0; padding: 3px 16px; border: 0; }
  table.table.stack-phone tfoot td, table.table.stack-phone tfoot tr:first-child td { padding: 0; border: 0; }
  table.table.stack-phone tfoot td:first-child { grid-row: 1; }
}

/* Licence key: one line, never broken at a hyphen; Copy beside it, under it on phones */
.keybox .btn { margin-left: auto; }
.keyline { white-space: nowrap; word-break: normal; overflow-x: auto; scrollbar-width: none; font-size: clamp(12px, 3.5cqi, 15px); font-weight: 600; letter-spacing: .02em; }
@container (max-width: 560px) {
  .keybox { flex-wrap: wrap; }
  .keybox.key { flex-direction: column; align-items: stretch; text-align: center; gap: 10px; }
  .keybox.key .btn { margin: 0; }
}

/* Phone bar: the open "More" sheet takes the pill */
.bottombar:has([aria-expanded="true"]) a.active { color: var(--muted); }
.bottombar:has([aria-expanded="true"]) a.active .navpill { background: none; color: inherit; }
.bottombar [aria-expanded="true"] { color: var(--ink); }
.bottombar [aria-expanded="true"] .navpill { background: var(--tint); color: var(--accent); }
@media (max-width: 767px) { .menu.open .group { margin: 6px 8px; } .chips:has(.chip-check, .chip-radio) { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; } }

/* Chip and tab strips: 44 px on touch; a fade marks the side that scrolls (classes set by shop.js) */
@media (max-width: 1199px), (pointer: coarse) { .chips a { height: 44px; } }
.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.fade-l { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 48px), transparent); }
.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.page-index { margin-bottom: 16px; }

/* Tick boxes, radios and switches: a 44 px box on touch, drawn exactly as before */
@media (max-width: 1199px), (pointer: coarse) {
  :is(input[type=checkbox], input[type=radio]):not(.chip-check *, .chip-radio *, .type-card *, .star *) { width: 44px; height: 44px; margin: -10px; border: 0; background: none; }
  :is(input[type=checkbox], input[type=radio]):not(.chip-check *, .chip-radio *, .type-card *, .star *, .switch *)::before { inset: 10px; border: 1.5px solid var(--control); border-radius: 6px; background: var(--surface); }
  input[type=radio]:not(.chip-radio *, .type-card *, .star *)::before { border-radius: 50%; }
  :is(input[type=checkbox], input[type=radio]):not(.chip-check *, .chip-radio *, .type-card *, .star *, .switch *):checked::before { background: var(--accent); border-color: var(--accent); }
  :is(input[type=checkbox], input[type=radio]):not(.chip-check *, .chip-radio *, .type-card *, .star *)::after { position: relative; }
  .switch input[type=checkbox] { margin: -9px 0; background: none; border-radius: 0; }
  .switch input[type=checkbox]::before { inset: 9px 0; border-radius: 999px; background: var(--control); transition: background-color .15s ease; }
  .switch input[type=checkbox]:checked { background: none; }
  .switch input[type=checkbox]:checked::before { background: var(--accent); }
  .switch input[type=checkbox]::after { position: absolute; top: 12px; }
  .picker .plan-opt input { margin-top: -7px; }
  .menu a.item { min-height: 44px; }
  .iconbtn { min-width: 44px; min-height: 44px; }
}

/* File and date fields look like the other fields */
input[type=file] { padding: 5px 6px; color: var(--muted); cursor: pointer; }
input[type=file]::file-selector-button { height: 32px; margin-right: 12px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--tint); color: var(--accent); font: 700 13px var(--font); cursor: pointer; }
input[type=date], input[type=datetime-local] { -webkit-appearance: none; appearance: none; display: block; text-align: left; }
input::-webkit-date-and-time-value { text-align: left; }
input::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }

form:has(.save-bar) .field:last-of-type, form:has(.save-bar) > :nth-last-child(2) { margin-bottom: 24px; }
.list-search{margin:0 0 12px}.list-search input{width:100%;max-width:360px}
/* 1.0.7 vault lock */
.wait-text{color:var(--wait)}
.vault-unlock{margin-bottom:16px}.vault-unlock-head{display:flex;gap:12px;align-items:flex-start;margin-bottom:12px}.vault-unlock-head>.ic{width:22px;height:22px;flex:none;margin-top:2px}.vault-unlock-head h3{margin:0}.vault-unlock-head p{margin:4px 0 0}
.vault-unlock-fields{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end}.vault-unlock-fields .field{margin:0;flex:1 1 220px;max-width:320px}
.vault-actions{white-space:nowrap}.vault-actions form{display:inline}
@media (max-width:640px){.vault-actions{white-space:normal;display:flex;flex-wrap:wrap;gap:8px}.vault-unlock-fields .field{max-width:none}.vault-unlock-fields .btn{width:100%}}
.keybox code.otp{white-space:nowrap;word-break:normal}
@media (max-width:640px){.vault-reveal .facts{grid-template-columns:1fr;gap:4px}.vault-reveal .facts dd{margin-bottom:8px}.vault-reveal .keybox{flex-wrap:wrap}}
.vault-table td:first-child{min-width:200px}
