/* Tregflix dashboards (customer + administration) and sign-in pages. Usability first, same brand palette. */
@font-face { font-family: "Hanken Grotesk"; src: url("../fonts/hanken-grotesk.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Caslon Display"; src: url("../fonts/caslon-display.woff2") format("woff2"); font-weight: 400; font-display: swap; }
:root {
  --navy: #101820; --forest: #18352b; --ivory: #f5f1e8; --gold: #b49a67; --gold-ink: #8a7246; --charcoal: #252725;
  --bg: #f6f4ef; --panel: #fff; --surface: #fff; --surface-2: #faf9f6; --heading: #101820; --text: #252725; --btn-bg: #101820; --btn-fg: #fff; --btn-hover: #18352b; --link: #18352b; --field-border: var(--line-2); --line: #e4dfd4; --line-2: #d3ccbd; --muted: #62665f; --danger: #9b2c20; --ok: #23613f; --warn: #8a5a00; --info: #24496b;
  --radius: 6px; --f: "Hanken Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.55 var(--f); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { color: var(--gold-ink); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--surface); padding: .5rem 1rem; z-index: 100; }
.skip:focus { top: 1rem; }
.muted { color: var(--muted); } .small { font-size: 13px; } .strong { font-weight: 600; } .num { text-align: right; } .pre { white-space: normal; }
.optional { color: var(--muted); font-weight: 400; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .55rem 1.05rem; font: 500 14px/1.2 var(--f); border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); } .btn-primary:hover { background: var(--btn-hover); color: var(--btn-fg); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); } .btn-ghost:hover { border-color: var(--gold-ink); color: var(--text); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #e2b9b2; } .btn-danger:hover { background: #fbf0ee; color: var(--danger); }
.btn-sm { min-height: 34px; padding: .4rem .8rem; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.link-danger { color: var(--danger); }

/* Forms */
.stack { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; align-content: start; }
.field label { font-weight: 500; font-size: 14px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea { width: 100%; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--field-border); border-radius: var(--radius); padding: .6rem .75rem; min-height: 42px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-ink); box-shadow: 0 0 0 3px rgba(180,154,103,.25); }
input:disabled { background: var(--bg); color: var(--muted); }
input[type=color] { width: 72px; height: 42px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
input[type=file] { font: inherit; font-size: 14px; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }
.check { display: flex; gap: .6rem; align-items: flex-start; }
.check input { margin-top: .25rem; width: 16px; height: 16px; accent-color: var(--navy); flex-shrink: 0; }
.check label { font-weight: 400; }
.prefix-input { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.prefix-input span { display: flex; align-items: center; padding: 0 .3rem 0 .75rem; color: var(--muted); background: var(--bg); border-right: 1px solid var(--line); font-size: 14px; }
.prefix-input input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.prefix-input:focus-within { border-color: var(--gold-ink); box-shadow: 0 0 0 3px rgba(180,154,103,.25); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem; }
.form-grid h2 { margin-top: .5rem; }
.form-grid h2:first-of-type { margin-top: 0; }
.span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .6rem; padding-top: .25rem; }
.inline { display: inline; }

/* Alerts and badges */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; border: 1px solid; font-size: 14px; }
.alert-success { background: #eef6f1; border-color: #bfd9c9; color: var(--ok); }
.alert-error { background: #fbefed; border-color: #ecc4bd; color: var(--danger); }
.alert-info { background: #eef3f8; border-color: #c7d6e6; color: var(--info); }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.5; background: #eceae4; color: #4a4d48; white-space: nowrap; vertical-align: middle; }
.badge-published, .badge-paid, .badge-completed, .badge-active, .badge-replied { background: #e3f0e8; color: var(--ok); }
.badge-draft, .badge-unpaid, .badge-pending, .badge-new { background: #fbf1dc; color: var(--warn); }
.badge-confirmed, .badge-processing, .badge-shipped, .badge-read { background: #e6eef6; color: var(--info); }
.badge-cancelled, .badge-suspended, .badge-refunded, .badge-spam { background: #f7e4e1; color: var(--danger); }
.badge-archived, .badge-soon { background: #eceae4; color: #5d605a; }

/* ---------- Sign-in pages ---------- */
.auth-body { background: var(--ivory); min-height: 100vh; }
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1rem; }
.auth-logo img { width: 190px; height: auto; margin-bottom: 1.75rem; }
.auth-card { width: min(100%, 420px); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2rem; }
.auth-title { font: 400 1.75rem/1.2 "Caslon Display", Georgia, serif; margin-bottom: .4rem; color: var(--heading); }
.auth-sub { color: var(--muted); margin-bottom: 1.5rem; }
.auth-links { display: flex; flex-direction: column; gap: .5rem; margin-top: 1.25rem; font-size: 14px; }
.auth-foot { margin-top: 1.5rem; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--muted); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: rgba(245,241,232,.82); padding: 1.25rem 0 1.5rem; display: flex; flex-direction: column; }
.app-admin .side { background: #0c1f19; }
.side-logo { display: flex; align-items: flex-end; gap: .5rem; padding: 0 1.25rem 1.5rem; text-decoration: none; }
.side-logo img { width: 140px; height: auto; }
.side-logo span { font-size: 11px; letter-spacing: .08em; color: var(--gold); padding-bottom: 2px; }
.side nav { flex: 1; }
.side nav a { display: flex; align-items: center; justify-content: space-between; padding: .55rem 1.25rem; color: inherit; text-decoration: none; font-size: 14px; border-left: 2px solid transparent; }
.side nav a:hover { color: #fff; background: rgba(255,255,255,.04); }
.side nav a[aria-current] { color: #fff; border-left-color: var(--gold); background: rgba(180,154,103,.1); }
.count { background: var(--gold); color: var(--navy); font-size: 11px; font-weight: 600; border-radius: 999px; padding: 0 .45rem; }
.side-store { margin: 1rem 1.25rem 0; padding-top: 1rem; border-top: 1px solid rgba(245,241,232,.12); display: grid; gap: .4rem; font-size: 13px; }
.side-store-name { color: #fff; font-weight: 500; }
.side-site { margin: 1rem 1.25rem 0; font-size: 13px; color: var(--gold); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 2rem; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 60px; }
.topbar-right { display: flex; align-items: center; gap: 1rem; margin-left: auto; font-size: 14px; }
.topbar-user { color: var(--muted); }
.side-toggle { display: none; }
.banner { background: #fbf1dc; color: #6b4700; padding: .6rem 2rem; font-size: 14px; border-bottom: 1px solid #efdcb1; }
.content { padding: 2rem; max-width: 1180px; width: 100%; }

/* Page structure */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -.01em; color: var(--heading); }
.page-head .muted { margin-top: .2rem; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 13px; margin-bottom: .2rem; }
.crumb a { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1.5rem; margin-bottom: 1.25rem; }
.panel h2 { font-size: 16px; font-weight: 600; margin-bottom: .75rem; color: var(--heading); }
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.panel-head a { font-size: 14px; }
.pad { padding: 1.25rem 1.5rem 0; }
.panel-note { border-left: 3px solid var(--gold); }
.small-h { font-size: 14px; font-weight: 600; margin: 1rem 0 .4rem; }
.empty { color: var(--muted); }
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state h2 { font-size: 18px; }
.empty-state p { color: var(--muted); max-width: 30rem; margin: 0 auto 1.25rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.todo li { padding: .35rem 0 .35rem 1.4rem; position: relative; }
.todo li::before { content: ""; position: absolute; left: 0; top: .75rem; width: 10px; height: 10px; border: 1.5px solid var(--gold-ink); border-radius: 50%; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.15rem; display: grid; gap: .2rem; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 600; color: var(--heading); letter-spacing: -.01em; }
.stat-text { font-size: 18px; padding-top: .35rem; }
.stat-sub { font-size: 12px; color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table tfoot td { border-bottom: 0; border-top: 1px solid var(--line); color: var(--muted); }
.table tfoot .total td { color: var(--text); font-weight: 600; font-size: 15px; }
.table th.num, .table td.num { text-align: right; }
.table-compact th, .table-compact td { padding: .5rem .25rem; }
.table tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.table-edit input { min-height: 36px !important; padding: .35rem .5rem !important; min-width: 80px; }
.table-edit th[scope=row] { font-weight: 500; white-space: nowrap; }
.table-title { font-size: 14px; font-weight: 600; margin: .5rem 0 .6rem; }
.w-img { width: 64px; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.thumb-empty { display: block; background: var(--bg); }
.filters { display: flex; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filters input[type=search] { flex: 1 1 260px; width: auto; }
.filters select { width: auto; flex: 0 0 auto; }

/* Lists */
.list li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list li:last-child { border-bottom: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv dt { color: var(--muted); }
.kv-stack > div { flex-direction: column; gap: .1rem; border-bottom: 1px solid var(--line); padding: .55rem 0; }
.kv-stack > div:last-child { border-bottom: 0; }
.timeline li { padding: .4rem 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }

/* Product editor */
.product-form { display: grid; grid-template-columns: 1fr 300px; gap: 0 1.25rem; align-items: start; }
.product-side { }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .9rem; }
.image-grid li { position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg); }
.image-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.image-grid .badge { position: absolute; top: .4rem; left: .4rem; }
.image-actions { display: flex; justify-content: space-between; padding: .4rem .55rem; background: var(--surface); font-size: 13px; }
.row-actions, .stack-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.stack-actions { flex-direction: column; }
.stack-actions .btn { width: 100%; }
.logo-preview { display: flex; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.logo-preview img { max-height: 64px; max-width: 200px; border: 1px solid var(--line); padding: .4rem; border-radius: 4px; background: var(--surface); }
.publish-panel { display: flex; justify-content: space-between; gap: 1.5rem; align-items: center; }
.order-layout { display: grid; grid-template-columns: 1fr 320px; gap: 0 1.25rem; align-items: start; }
.method-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.method-head h2 { margin: 0; }
.method p { margin-bottom: .9rem; max-width: 46rem; }
.method-soon { background: var(--surface-2); }
.method-soon p { color: var(--muted); }
.prose-app h2 { margin-top: 1.25rem; } .prose-app h2:first-child { margin-top: 0; }
.prose-app ol { list-style: decimal; padding-left: 1.25rem; } .prose-app li { margin: .35rem 0; } .prose-app p { max-width: 46rem; }
.add-admin { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.welcome { max-width: 640px; }
.welcome h1 { font: 400 2.25rem/1.15 "Caslon Display", Georgia, serif; color: var(--heading); margin-bottom: .75rem; }
.welcome .lead { color: var(--muted); font-size: 16px; margin-bottom: 1.5rem; }
.steps-list { counter-reset: s; margin-bottom: 1.75rem; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 2.25rem 1fr; column-gap: .5rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.steps-list li::before { content: counter(s); grid-row: span 2; width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.steps-list li.is-next::before { background: var(--navy); color: #fff; border-color: var(--navy); }
.steps-list span { color: var(--muted); font-size: 14px; }

@media (max-width: 1000px) {
  .product-form, .order-layout { grid-template-columns: 1fr; }
  .product-side { position: static; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; overflow-y: auto; transform: translateX(-100%); transition: transform .2s ease; }
  .side-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(16,24,32,.45); }
  .side-toggle { display: inline-flex; min-height: 36px; padding: .4rem .8rem; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); font: 500 14px var(--f); cursor: pointer; }
  .topbar, .content, .banner { padding-left: 1rem; padding-right: 1rem; }
  .topbar-user { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .publish-panel { flex-direction: column; align-items: flex-start; }
  .content { padding-top: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Additions: store type, options, files, zones, menus, plans ---------- */
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.type-card { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 8px; padding: 1rem 1.1rem; cursor: pointer; background: var(--surface); }
.type-card:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); background: var(--surface-2); }
.type-card input { margin-top: .25rem; accent-color: var(--navy); }
.type-card-body { display: grid; gap: .2rem; } .type-card-body span { color: var(--muted); font-size: 14px; }
.option-row { display: grid; grid-template-columns: 170px 1fr 2fr auto; gap: .6rem; align-items: end; padding: .75rem 0; border-top: 1px solid var(--line); }
.option-row[hidden] { display: none; }
.option-row .field label { font-size: 13px; }
.option-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .75rem; }
.file-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.zone { border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin-bottom: .9rem; display: grid; grid-template-columns: 1fr 140px; gap: .8rem 1rem; background: var(--surface-2); }
.zone .countries { grid-column: 1 / -1; }
.zone select[multiple] { min-height: 160px; }
.menu-row { display: grid; grid-template-columns: 70px 1fr 2fr auto; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.notice { background: #fbf1dc; border: 1px solid #efdcb1; color: #6b4700; border-radius: 6px; padding: .7rem .9rem; font-size: 14px; margin-bottom: 1rem; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: .35rem .5rem; display: inline-block; word-break: break-all; user-select: all; }
.steps-mini { list-style: decimal; padding-left: 1.2rem; font-size: 14px; color: var(--muted); margin: .5rem 0 1rem; } .steps-mini li { margin: .25rem 0; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.plan { border: 1px solid var(--line-2); border-radius: 10px; padding: 1.4rem; background: var(--surface); display: flex; flex-direction: column; gap: .6rem; }
.plan.is-current { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.plan-price { font-size: 28px; font-weight: 600; color: var(--heading); } .plan-price small { font-size: 14px; color: var(--muted); font-weight: 400; }
.plan ul { font-size: 14px; } .plan li { padding: .25rem 0 .25rem 1.3rem; position: relative; } .plan li::before { content: ""; position: absolute; left: 0; top: .7rem; width: 8px; height: 4px; border-left: 1.5px solid var(--gold-ink); border-bottom: 1.5px solid var(--gold-ink); transform: rotate(-45deg); }
.plan form { margin-top: auto; }
@media (max-width: 820px) { .type-cards, .plans { grid-template-columns: 1fr; } .option-row, .menu-row { grid-template-columns: 1fr; } .zone { grid-template-columns: 1fr; } }
.label-like { font-weight: 500; font-size: 14px; }
.plan-billing { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; margin-bottom: 1rem; background: var(--surface); }
.plan-toggle { text-decoration: none; padding: .4rem 1rem; border-radius: 999px; font-size: 14px; color: var(--muted); }
.plan-toggle span { font-size: 12px; color: var(--gold-ink); } .plan-toggle.is-on-legacy { background: var(--navy); color: #fff; } .plan-toggle.is-on-legacy span { color: var(--gold); }
.plan-name { font-size: 18px; font-weight: 600; } .plan-note { font-size: 13px; color: var(--muted); }
.plan-chosen { display: flex; justify-content: space-between; gap: 1rem; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .6rem .8rem; font-size: 14px; margin-bottom: 1.25rem; }

/* Billing switch: both prices are in the page; the wrapper's data-billing decides which one shows. */
[data-billing="monthly"] .when-yearly, [data-billing="yearly"] .when-monthly { display: none; }
.plan-toggle[aria-checked="true"] { background: var(--navy); color: var(--ivory); }
.plan-toggle[aria-checked="true"] span { color: var(--gold); }
.plan-toggle { cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.plan-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.plan-price span, .plan-note span { animation: price-in .25s ease; }
@keyframes price-in { from { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .plan-price span, .plan-note span { animation: none; } }
.plan-toggle[aria-checked="true"] { background: var(--navy); color: #fff; }

/* ---------- Icons, Free Premium, welcome and quote ---------- */
.nav-item { display: inline-flex; align-items: center; gap: .7rem; }
.nav-icon { flex-shrink: 0; opacity: .72; transition: opacity .15s; }
.side nav a:hover .nav-icon, .side nav a[aria-current] .nav-icon { opacity: 1; }
.side nav a[aria-current] .nav-icon { color: var(--gold); }
.side-site .nav-icon { opacity: 1; }
.premium-ribbon { display: inline-flex; align-items: center; gap: .4rem; margin: -.6rem 1.25rem 1.1rem; padding: .3rem .7rem; font-size: 12px; font-weight: 500; letter-spacing: .02em; color: #e9dcc0; border: 1px solid rgba(180,154,103,.55); border-radius: 999px; background: linear-gradient(180deg, rgba(180,154,103,.16), rgba(180,154,103,.06)); width: max-content; }
.premium-ribbon svg { color: var(--gold); }
.badge-premium { background: #f4ecdb; color: #7a6338; border: 1px solid #e3d3ae; }
.plan-invite { border-color: #e3d3ae; background: #fbf6ea; }
.welcome-band { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem; align-items: stretch; }
.welcome-text { padding: .5rem 0; align-self: center; }
.welcome-text h1 { font: 400 2.1rem/1.15 "Caslon Display", Georgia, serif; color: var(--heading); margin-bottom: .5rem; }
.welcome-text p { color: var(--muted); font-size: 16px; max-width: 34rem; }
.quote-card { margin: 0; background: var(--navy); color: #efe9dc; border-radius: 10px; padding: 1.35rem 1.5rem; position: relative; overflow: hidden; }
.quote-card::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border: 1px solid rgba(180,154,103,.25); border-radius: 50%; }
.quote-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin-bottom: .6rem; }
.quote-card blockquote { margin: 0; } .quote-card blockquote p { font: 400 1.2rem/1.45 "Caslon Display", Georgia, serif; }
.quote-source { margin-top: .75rem; font-size: 13px; color: #b9b2a3; } .quote-source cite { font-style: italic; }
.welcome-h { font-size: 18px; font-weight: 600; color: var(--heading); margin-bottom: .5rem; }
.page-sub { font-size: 22px; font-weight: 600; color: var(--heading); }
@media (max-width: 900px) { .welcome-band { grid-template-columns: 1fr; } }
.tpl-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1rem 0; }
.tpl-card { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--surface); position: relative; }
.tpl-card input { position: absolute; top: .7rem; left: .7rem; accent-color: var(--navy); width: 18px; height: 18px; }
.tpl-card img { width: 100%; height: auto; display: block; border-bottom: 1px solid var(--line); }
.tpl-card:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy); }
.tpl-card-body { display: grid; gap: .3rem; padding: .85rem 1rem 1rem; font-size: 14px; } .tpl-card-body > span { color: var(--muted); }
.pairs { display: grid; gap: .6rem; } .pair { display: grid; grid-template-columns: 1fr 2fr; gap: .6rem; }
.pair textarea { min-height: 42px; }
@media (max-width: 900px) { .tpl-cards { grid-template-columns: 1fr; } .pair { grid-template-columns: 1fr; } }


/* ================= Light / dark theme =================
   Light is the default. Dark is used when the user chooses it (saved on their account),
   or follows the device setting until they choose. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1419; --panel: #151c22; --surface: #151c22; --surface-2: #1a232b; --line: #26313a; --line-2: #34414c;
  --text: #e7e3da; --muted: #9ea7a3; --heading: #f2ede3; --link: #d3bb8b; --gold-ink: #d3bb8b;
  --btn-bg: #e9e2d0; --btn-fg: #101820; --btn-hover: #f5f1e8; --field-border: #3a4855;
  --danger: #f0a196; --ok: #8fd1a8; --warn: #e8c37a; --info: #9ec3e6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0e1419; --panel: #151c22; --surface: #151c22; --surface-2: #1a232b; --line: #26313a; --line-2: #34414c;
    --text: #e7e3da; --muted: #9ea7a3; --heading: #f2ede3; --link: #d3bb8b; --gold-ink: #d3bb8b;
    --btn-bg: #e9e2d0; --btn-fg: #101820; --btn-hover: #f5f1e8; --field-border: #3a4855;
    --danger: #f0a196; --ok: #8fd1a8; --warn: #e8c37a; --info: #9ec3e6;
  }
}
:root[data-theme="dark"] .app, :root[data-theme="dark"] .side { --x: 0; }
:root[data-theme="dark"] .side, :root[data-theme="dark"] .app-admin .side { background: #0a1015; border-right: 1px solid #1e2830; }
:root[data-theme="dark"] .topbar { background: #11181e; }
:root[data-theme="dark"] .alert-success { background: #12261b; border-color: #24503a; }
:root[data-theme="dark"] .alert-error { background: #2c1714; border-color: #5a2b24; }
:root[data-theme="dark"] .alert-info { background: #132231; border-color: #284660; }
:root[data-theme="dark"] .badge { background: #26303a; color: #cfd5d2; }
:root[data-theme="dark"] .badge-published, :root[data-theme="dark"] .badge-paid, :root[data-theme="dark"] .badge-completed, :root[data-theme="dark"] .badge-active, :root[data-theme="dark"] .badge-replied { background: #163323; color: #8fd1a8; }
:root[data-theme="dark"] .badge-draft, :root[data-theme="dark"] .badge-unpaid, :root[data-theme="dark"] .badge-pending, :root[data-theme="dark"] .badge-new { background: #3a2d12; color: #e8c37a; }
:root[data-theme="dark"] .badge-confirmed, :root[data-theme="dark"] .badge-processing, :root[data-theme="dark"] .badge-shipped, :root[data-theme="dark"] .badge-read { background: #172a3d; color: #9ec3e6; }
:root[data-theme="dark"] .badge-cancelled, :root[data-theme="dark"] .badge-suspended, :root[data-theme="dark"] .badge-refunded, :root[data-theme="dark"] .badge-spam { background: #3a1b17; color: #f0a196; }
:root[data-theme="dark"] .badge-premium { background: #33291a; color: #e3cc9c; border-color: #5c4a2c; }
:root[data-theme="dark"] .banner, :root[data-theme="dark"] .notice { background: #2c2413; border-color: #4f4022; color: #ecd39b; }
:root[data-theme="dark"] .quote-card { background: #0a1015; border: 1px solid #26313a; }
:root[data-theme="dark"] .prefix-input span { background: #1a232b; }
:root[data-theme="dark"] .steps-list li.is-next::before { background: #e9e2d0; color: #101820; border-color: #e9e2d0; }
:root[data-theme="dark"] .type-card:has(input:checked), :root[data-theme="dark"] .tpl-card:has(input:checked), :root[data-theme="dark"] .plan.is-current { border-color: #d3bb8b; box-shadow: 0 0 0 1px #d3bb8b; background: #1a232b; }
:root[data-theme="dark"] .table thead th { background: #1a232b; }
:root[data-theme="dark"] .table tbody tr:hover { background: #18212a; }
:root[data-theme="dark"] .tpl-card img, :root[data-theme="dark"] .logo-preview img { background: #f5f1e8; }
:root[data-theme="dark"] .plan-toggle[aria-checked="true"] { background: #e9e2d0; color: #101820; }
:root[data-theme="dark"] .auth-body { background: #0e1419; }
:root[data-theme="dark"] .auth-logo img { filter: brightness(0) invert(.92) sepia(.15); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .side, :root:not([data-theme]) .app-admin .side { background: #0a1015; border-right: 1px solid #1e2830; }
  :root:not([data-theme]) .topbar { background: #11181e; }
}
body, .panel, .topbar, .side, .stat, .table thead th, input, select, textarea, .btn { transition: background-color .25s ease, color .25s ease, border-color .25s ease; }
@media (prefers-reduced-motion: reduce) { body, .panel, .topbar, .side, .stat, input, select, textarea, .btn { transition: none; } }
/* Theme toggle */
.theme-toggle { display: inline-flex; align-items: center; gap: .45rem; min-height: 34px; padding: .35rem .7rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--text); font: 500 13px var(--f); cursor: pointer; }
.theme-toggle:hover { border-color: var(--gold-ink); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: inline; } :root[data-theme="dark"] .theme-toggle .when-light { display: none; }

/* The text editor keeps a light "paper" so merchants see their real text colors in both themes. */
.rte-area { background: #fff; color: #1d1f1e; border-radius: 0 0 6px 6px; }
/* With the theme following the device in dark, the toggle should show "Light mode" */
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .theme-toggle .when-dark { display: inline; } :root:not([data-theme]) .theme-toggle .when-light { display: none; } }
@media (max-width: 560px) { .theme-label { display: none; } }
/* "More templates coming soon" (informational) */
.soon-note { display: flex; gap: .7rem; align-items: flex-start; margin: 1rem 0 0; padding: .8rem 1rem; border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--gold) 7%, var(--surface)); color: var(--text); font-size: 14px; }
.soon-note svg { color: var(--gold-ink); flex-shrink: 0; margin-top: .1rem; }
form + .soon-note, .soon-note + form { margin-top: 0; }
.page-head + .soon-note { margin: 0 0 1.25rem; }
.btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.stat-of { font-size: 14px; font-weight: 400; color: var(--muted); }
.ai-out { border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.15rem; background: #fff; color: #1d1f1e; margin-bottom: .9rem; }
.ai-plain { white-space: pre-wrap; font: 14px/1.6 var(--f); }
.ai-apply select { width: auto; min-width: 220px; }
.ads-links { display: flex; gap: 1.25rem; flex-wrap: wrap; } .feed-urls { margin: .75rem 0; }

/* ---------- Grouped menu (My store, Settings) ---------- */
.nav-sub { margin: 0 0 .35rem; }
.nav-sub a { padding: .38rem 1.25rem .38rem 3.15rem !important; font-size: 13px !important; color: rgba(245,241,232,.66) !important; }
.nav-sub a:hover, .nav-sub a[aria-current] { color: #fff !important; }
.nav-sub a[aria-current] { border-left-color: var(--gold) !important; background: rgba(180,154,103,.1); }
.nav-group > a.is-open { color: #fff; } .nav-group > a.is-open .nav-icon { opacity: 1; color: var(--gold); }

/* ---------- Top bar: account panel with store status ---------- */
.topbar { padding-top: .6rem; padding-bottom: .6rem; }
.topbar-right { gap: .75rem; }
.topbar-right .premium-ribbon { margin: 0; color: #7a6338; background: #f6efdf; border-color: #e3d3ae; }
.topbar-right .premium-ribbon svg { color: #9a7d45; }
.account-panel { display: grid; gap: .1rem; padding-left: .9rem; margin-left: .15rem; border-left: 1px solid var(--line); min-width: 150px; }
.account-panel p { margin: 0; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.acct-store-name { font-weight: 600; color: var(--heading); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-status { display: inline-flex; align-items: center; gap: .35rem; font-size: 12px; font-weight: 500; color: var(--muted); }
.store-status.status-published { color: var(--ok); }
.store-status.status-suspended { color: var(--danger); }
.live-dot-green { width: 8px; height: 8px; border-radius: 50%; background: #2fa66a; box-shadow: 0 0 0 3px rgba(47,166,106,.18); }
.acct-user { font-size: 13px; color: var(--muted); }
.acct-user .inline { display: inline; }
:root[data-theme="dark"] .topbar-right .premium-ribbon { color: #e3cc9c; background: #33291a; border-color: #5c4a2c; }
:root[data-theme="dark"] .live-dot-green { background: #49c486; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .topbar-right .premium-ribbon { color: #e3cc9c; background: #33291a; border-color: #5c4a2c; } }
@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; }
  .topbar-right { flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
  .account-panel { min-width: 0; }
  .acct-store-name { max-width: 140px; }
}
@media (max-width: 560px) { .topbar-right .btn-sm { padding: .35rem .6rem; } .account-panel { border-left: 0; padding-left: 0; margin-left: 0; width: 100%; justify-items: end; } }

.account-panel .acct-user { display: flex; align-items: center; gap: .4rem; margin: 0; }

/* ---------- Store, status and customer below the menu ---------- */
.side-account { margin: 1.25rem 1.25rem 0; padding-top: 1rem; border-top: 1px solid rgba(245,241,232,.12); display: grid; gap: .3rem; }
.side-account p { margin: 0; }
.side-store-name { color: #fff; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-account .store-status { font-size: 12px; color: rgba(245,241,232,.7); }
.side-account .store-status.status-published { color: #8fd1a8; }
.side-account .store-status.status-suspended { color: #f0a196; }
.side-user { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: 13px; color: rgba(245,241,232,.82); margin-top: .35rem !important; }
.side-user .inline { display: inline; }
.side-logout { color: #d9c49a !important; font-size: 13px; }
/* sections inside My store and Settings */
.dash-section { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-head h2 { font-size: 22px; font-weight: 600; color: var(--heading); }
.app:not(.app-admin) .side nav { flex: 0 0 auto; }

/* ---------- Tab boxes (Payments, Shipping, Tracking & feeds) ---------- */
.tab-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 1.25rem; }
.tab-box .tab-bar { display: none; }
.tabs-ready .tab-bar { display: flex; gap: .25rem; flex-wrap: wrap; padding: .5rem; margin: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: 10px 10px 0 0; }
.tab { appearance: none; border: 1px solid transparent; background: none; padding: .55rem 1rem; border-radius: 999px; font: 500 14px var(--f); color: var(--muted); cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.tab:hover { color: var(--text); background: color-mix(in srgb, var(--heading) 6%, transparent); }
.tab[aria-selected="true"] { background: var(--btn-bg); color: var(--btn-fg); }
.tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tab-panel { padding: 1.4rem 1.5rem; }
.tab-panel + .tab-panel { border-top: 1px solid var(--line); }
.tabs-ready .tab-panel + .tab-panel { border-top: 0; }
.tabs-ready .tab-panel[hidden] { display: none; }
.tab-panel > h2:first-child, .tab-panel > .method-head:first-child h2 { font-size: 18px; }
.tab-actions { padding: 0 1.5rem 1.4rem; }
@media (max-width: 560px) { .tab { padding: .5rem .8rem; font-size: 13px; } .tab-panel { padding: 1.1rem 1rem; } .tab-actions { padding: 0 1rem 1.1rem; } }

/* ---------- Store status below the menu: pulsing green when Live, red when Unpublished ---------- */
.side-account .store-status { display: inline-flex; align-items: center; gap: .55rem; font-size: 14px; font-weight: 500; color: rgba(245,241,232,.9); }
.side-account .store-status.status-published { color: #8fd1a8; }
.side-account .store-status.status-draft { color: #f3b2a8; }
.status-dot { position: relative; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-live { background: #34c77b; }
.dot-live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #34c77b; animation: live-pulse 1.8s ease-out infinite; }
.dot-off { background: #e5534b; }
@keyframes live-pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dot-live::after { animation: none; opacity: 0; } .dot-live { box-shadow: 0 0 0 3px rgba(52,199,123,.3); } }
.topbar-right .inline { display: inline; }
.feeds-accounts { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

/* ---------- Shipping zones: country picker ---------- */
.zone .countries { grid-column: 1 / -1; }
.zone-label { font-weight: 600; font-size: 14px; margin-bottom: .4rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: .4rem; min-height: 2rem; margin-bottom: .6rem; }
.chip-list:empty::before { content: "No countries selected yet."; color: var(--muted); font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: 500 13px var(--f); cursor: pointer; }
.chip:hover { border-color: var(--danger); color: var(--danger); }
.country-search { margin-bottom: .5rem; }
.country-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .3rem; max-height: 260px; overflow-y: auto; padding: .4rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.country-opt { display: flex; align-items: center; gap: .45rem; padding: .35rem .55rem; border-radius: 6px; font-size: 13.5px; cursor: pointer; user-select: none; border: 1px solid transparent; }
.country-opt:hover { background: var(--surface-2); }
.country-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.country-opt::before { content: ""; width: 14px; height: 14px; flex-shrink: 0; border: 1.5px solid var(--line-2); border-radius: 4px; }
.country-opt.is-on, .country-opt:has(input:checked) { background: color-mix(in srgb, var(--gold) 14%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); font-weight: 600; }
.country-opt.is-on::before, .country-opt:has(input:checked)::before { background: var(--btn-bg); border-color: var(--btn-bg); box-shadow: inset 0 0 0 3px var(--surface); }
.country-opt:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 1px; }
.country-opt[hidden] { display: none; }
.tab-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; } .tab-panel .table-wrap { border: 1px solid var(--line); border-radius: 8px; } .label-like { font-weight: 600; font-size: 14px; }
/* Unpublished: pulsing red dot (Live keeps its pulsing green dot) */
.dot-off::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #e5534b; animation: live-pulse 1.8s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .dot-off::after { animation: none; opacity: 0; } .dot-off { box-shadow: 0 0 0 3px rgba(229,83,75,.3); } }
.tpl-links { display: flex; gap: .9rem; flex-wrap: wrap; } .demo-flag { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .65; margin-bottom: .75rem; }

/* ---------- Top bar items: icon + label ---------- */
.top-item { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.topbar-right > *, .topbar-right .theme-toggle, .topbar-right .premium-ribbon { white-space: nowrap; flex-shrink: 0; }

/* ---------- Mobile: the four top items on one line, icons and labels ---------- */
@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; row-gap: .5rem; padding: .55rem .75rem; }
  .topbar-right { width: 100%; flex-wrap: nowrap; justify-content: space-between; gap: .35rem; margin-left: 0; }
  .topbar-right .premium-ribbon, .topbar-right .theme-toggle, .topbar-right .top-item { min-height: 34px; padding: .3rem .55rem; font-size: 12px; gap: .3rem; border-radius: 999px; }
  .topbar-right .theme-label { display: inline !important; }
  .topbar-right .theme-toggle svg, .topbar-right .top-item svg, .topbar-right .premium-ribbon svg { width: 14px; height: 14px; }
  .topbar-right form.inline { display: contents; }
}
@media (max-width: 380px) {
  .topbar-right { gap: .2rem; }
  .topbar-right .premium-ribbon, .topbar-right .theme-toggle, .topbar-right .top-item { padding: .28rem .42rem; font-size: 11px; gap: .25rem; letter-spacing: -.01em; }
  .topbar-right .theme-toggle svg, .topbar-right .top-item svg, .topbar-right .premium-ribbon svg { width: 12px; height: 12px; }
}

/* ---------- Tabs on mobile: never cut off; the tab row scrolls sideways when space is short ---------- */
.tabs-ready .tab-bar { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs-ready .tab-bar::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; }
@media (max-width: 560px) {
  .tabs-ready .tab-bar { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 1.5rem; }
  .tabs-ready .tab-bar.at-end { -webkit-mask-image: none; mask-image: none; }
}
.plan-billing { flex-wrap: nowrap; } .plan-toggle { white-space: nowrap; }

/* ---------- Desktop: the menu stays in place; only the main content scrolls ---------- */
@media (min-width: 821px) {
  .app { align-items: start; }
  .side { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .main { min-width: 0; }
}

/* ---------- Top bar controls: icon + label, one line on phones ---------- */
.top-item { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.topbar-right .premium-ribbon, .theme-toggle, .top-item { white-space: nowrap; }
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; row-gap: .5rem; }
  .topbar-right { order: 3; flex: 1 0 100%; flex-wrap: nowrap !important; justify-content: space-between; gap: .3rem !important; }
  .topbar-right > * { flex: 1 1 0; min-width: 0; }
  .topbar-right .inline { display: flex; }
  .topbar-right .premium-ribbon, .topbar-right .theme-toggle, .topbar-right .top-item { width: 100%; justify-content: center; padding: .4rem .3rem !important; font-size: 11.5px; gap: .3rem; min-height: 34px; letter-spacing: 0; }
  .topbar-right .theme-label { display: inline !important; }
  .topbar-right svg { flex-shrink: 0; width: 14px; height: 14px; }
}
@media (max-width: 360px) { .topbar-right .premium-ribbon, .topbar-right .theme-toggle, .topbar-right .top-item { font-size: 10.5px; } }

/* ---------- Desktop: dashboard menu stays in place; only the main content scrolls ---------- */
@media (min-width: 821px) {
  .side { position: sticky; top: 0; height: 100vh; align-self: start; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .app { align-items: start; }
}

/* ---------- Tabs on phones: one swipeable row, every tab reachable, nothing cut off ---------- */
@media (max-width: 640px) {
  .tabs-ready .tab-bar { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: .45rem; gap: .3rem; }
  .tabs-ready .tab-bar::-webkit-scrollbar { display: none; }
  .tab { flex: 1 0 auto; scroll-snap-align: start; white-space: nowrap; text-align: center; min-height: 40px; }
}

/* ================= Visual editor ================= */
.content:has(.ed) { padding: 0; max-width: none; }
.ed { display: flex; flex-direction: column; height: calc(100vh - 64px); min-height: 560px; }
.ed-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .6rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.ed-bar-left, .ed-bar-right { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.ed-status { font-size: 12.5px; color: var(--muted); } .ed-status.is-dirty { color: var(--warn, #b7791f); } .ed-status.is-saved { color: var(--ok, #2f855a); } .ed-status.is-error { color: var(--danger); }
.ed-devices { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; }
.ed-devices button { border: 0; background: none; padding: .35rem .8rem; border-radius: 999px; font: 500 12.5px var(--f); color: var(--muted); cursor: pointer; }
.ed-devices button.is-on { background: var(--btn-bg); color: var(--btn-fg); }
.ed-body { flex: 1; display: grid; grid-template-columns: 360px 1fr; min-height: 0; }
.ed-panel { overflow-y: auto; border-right: 1px solid var(--line); background: var(--surface); padding: 1rem; }
.ed-tabs { display: flex; gap: .25rem; margin-bottom: .9rem; padding: .25rem; background: var(--surface-2); border-radius: 999px; }
.ed-tabs button { flex: 1; border: 0; background: none; padding: .45rem; border-radius: 999px; font: 600 13px var(--f); color: var(--muted); cursor: pointer; }
.ed-tabs button[aria-selected="true"] { background: var(--btn-bg); color: var(--btn-fg); }
.ed-blocks { display: grid; gap: .3rem; margin: .5rem 0 1rem; }
.ed-block { display: flex; align-items: center; gap: .4rem; padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13.5px; }
.ed-block[draggable="true"] { cursor: grab; }
.ed-block.is-dragging { opacity: .5; border-style: dashed; }
.ed-block.is-selected { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.18); }
.ed-block.is-hidden .ed-name { opacity: .45; text-decoration: line-through; }
.ed-block.is-fixed { background: var(--surface-2); }
.ed-handle { color: var(--muted); letter-spacing: -2px; cursor: grab; user-select: none; }
.ed-name { flex: 1; text-align: left; background: none; border: 0; padding: .2rem; font: 500 13.5px var(--f); color: var(--text); cursor: pointer; }
.ed-tools { display: inline-flex; gap: .15rem; } .ed-tools button { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 12px; line-height: 1; }
.ed-tools button:hover { border-color: var(--gold-ink); }
.ed-lock { font-size: 12px; opacity: .7; } .ed-lock-key { white-space: nowrap; }
.ed-library { margin-bottom: 1rem; } .ed-library ul { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.ed-group { border: 0; padding: 0; margin: 0; } .ed-group legend { font-weight: 700; font-size: 15px; margin-bottom: .6rem; color: var(--heading); }
.ed-field { display: grid; gap: .3rem; margin-bottom: .8rem; } .ed-label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.ed-pairs { border: 0; padding: 0; } .ed-pair { display: grid; gap: .3rem; padding: .5rem; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .4rem; }
.ed-pair textarea { min-height: 52px; }
.ed-thumb { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; border: 1px dashed var(--line-2); display: grid; place-items: center; overflow: hidden; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.ed-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ed-row { display: flex; align-items: center; gap: .75rem; }
.ed-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; } .ed-gallery li { position: relative; } .ed-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.ed-gallery button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.ed-colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; } .ed-colors input[type=color] { width: 100%; height: 38px; padding: 2px; }
.ed-stage { background: var(--surface-2); overflow: auto; display: flex; justify-content: center; padding: 1rem; }
.ed-frame-wrap { width: 100%; height: 100%; transition: width .25s ease; box-shadow: 0 10px 30px -15px rgba(0,0,0,.3); border-radius: 8px; overflow: hidden; background: #fff; }
.ed-frame-wrap[data-size="tablet"] { width: 820px; } .ed-frame-wrap[data-size="mobile"] { width: 390px; }
.ed-frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 1000px) { .ed { height: auto; } .ed-body { grid-template-columns: 1fr; } .ed-panel { border-right: 0; max-height: none; } .ed-stage { height: 80vh; } }
/* Store design: draft status */
.draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-radius: 10px; margin-bottom: 1.25rem; border: 1px solid var(--line); background: var(--surface); }
.draft-bar.has-draft { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.draft-bar .row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
/* Editor: the side panel shows either the section list or the selected section's fields */
[data-ed-pane="sections"] .ed-fields { display: none; }
[data-ed-pane="sections"].is-editing .ed-fields { display: block; }
[data-ed-pane="sections"].is-editing > .hint, [data-ed-pane="sections"].is-editing .ed-blocks, [data-ed-pane="sections"].is-editing .ed-library { display: none; }
.ed-back { margin-bottom: .75rem; display: inline-block; }
/* Phones: the four top-bar controls share one row equally (forms are real boxes, not display: contents) */
@media (max-width: 560px) {
  .topbar-right > * { display: flex !important; flex: 1 1 0 !important; min-width: 0 !important; }
  .topbar-right > form > button, .topbar-right > a, .topbar-right > .premium-ribbon { width: 100% !important; min-width: 0; justify-content: center; padding: .35rem .2rem !important; gap: .22rem !important; font-size: 11px !important; letter-spacing: -.01em; overflow: hidden; }
  .topbar-right svg { width: 13px !important; height: 13px !important; }
  .topbar-right .theme-label, .topbar-right span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 360px) { .topbar-right > form > button, .topbar-right > a, .topbar-right > .premium-ribbon { font-size: 10.2px !important; } .topbar-right svg { width: 12px !important; height: 12px !important; } }
.ed-stage { padding: .5rem; }
.ed-frame-wrap[data-size="tablet"] { width: 820px; flex: 0 0 820px; } .ed-frame-wrap[data-size="mobile"] { flex: 0 0 390px; }
@media (max-width: 560px) {
  .topbar-right > .premium-ribbon { flex: 1.25 1 0 !important; } .topbar-right > .theme-form { flex: 1.12 1 0 !important; }
  .topbar-right > a { flex: 1.08 1 0 !important; } .topbar-right > form:not(.theme-form) { flex: .9 1 0 !important; }
}
@media (max-width: 400px) { .topbar-right > form > button, .topbar-right > a, .topbar-right > .premium-ribbon { font-size: 10.4px !important; padding: .35rem .12rem !important; gap: .18rem !important; } .topbar-right { gap: .2rem !important; } }
@media (max-width: 340px) { .topbar-right > form > button, .topbar-right > a, .topbar-right > .premium-ribbon { font-size: 9.4px !important; } .topbar-right svg { width: 11px !important; height: 11px !important; } }

/* =====================================================================
   MOBILE DASHBOARD (≤ 820 px) — mobile-first navigation
   Top: logo + store status, then the four actions on one line.
   Bottom: fixed navigation (Overview, My store, Products, Orders, More).
   "More" opens a sheet with the remaining sections. Desktop is unchanged.
   ===================================================================== */
.m-brand, .m-status, .m-nav, .m-more { display: none; }
@media (max-width: 820px) {
  .app { display: block; }
  .side, .side-toggle { display: none !important; }
  .main { min-width: 0; }
  .topbar { display: grid !important; grid-template-columns: 1fr auto; grid-template-areas: "brand status" "actions actions"; align-items: center; gap: .6rem .75rem !important; padding: .65rem .85rem .7rem !important; position: sticky; top: 0; z-index: 30; }
  .m-brand { display: inline-flex; grid-area: brand; align-items: center; min-height: 32px; }
  .m-brand img { height: 20px; width: auto; } .m-logo-dark { display: none !important; }
  :root[data-theme="dark"] .m-logo-light { display: none !important; } :root[data-theme="dark"] .m-logo-dark { display: inline !important; }
  .m-status { display: inline-flex; grid-area: status; align-items: center; gap: .45rem; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--text); text-decoration: none; background: var(--surface); }
  .m-status.status-published { color: #1f8a55; border-color: color-mix(in srgb, #2fa66a 40%, var(--line)); }
  .m-status.status-draft { color: #c0392b; border-color: color-mix(in srgb, #e5534b 40%, var(--line)); }
  .topbar-right { grid-area: actions; display: grid !important; grid-template-columns: repeat(var(--acts, 4), minmax(0, 1fr)); gap: .4rem !important; width: 100%; margin: 0 !important; flex-wrap: nowrap !important; }
  .topbar-right:not(:has(.premium-ribbon)) { --acts: 3; }
  .topbar-right > * { display: flex !important; min-width: 0 !important; flex: none !important; width: auto !important; }
  .topbar-right > form > button, .topbar-right > a, .topbar-right > .premium-ribbon {
    width: 100% !important; min-height: 40px; display: inline-flex !important; align-items: center; justify-content: center; gap: .3rem !important;
    padding: .3rem .25rem !important; border-radius: 10px !important; font-size: 11.5px !important; font-weight: 600; letter-spacing: 0; white-space: nowrap; overflow: hidden; margin: 0 !important; }
  .topbar-right .theme-label, .topbar-right span { white-space: nowrap; overflow: hidden; text-overflow: clip; }
  .topbar-right .theme-label { display: inline !important; }
  .topbar-right svg { width: 15px !important; height: 15px !important; flex-shrink: 0; }
  .content { padding: 1.1rem .9rem calc(84px + env(safe-area-inset-bottom)) !important; }
  .banner { margin: .6rem .9rem 0; }

  .m-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -18px rgba(0,0,0,.35); }
  .m-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; min-height: 54px; padding: .3rem .1rem; border: 0; background: none; border-radius: 12px; color: var(--muted); font: 600 11px var(--f); text-decoration: none; cursor: pointer; position: relative; }
  .m-nav-item svg { width: 22px; height: 22px; opacity: .85; }
  .m-nav-item span { white-space: nowrap; }
  .m-nav-item[aria-current="page"] { color: var(--heading); }
  .m-nav-item[aria-current="page"]::before { content: ""; position: absolute; top: 2px; width: 28px; height: 3px; border-radius: 3px; background: var(--gold); }
  .m-nav-item[aria-current="page"] svg { opacity: 1; color: var(--gold-ink); }
  .m-nav-item:active { background: var(--surface-2); }

  .m-more:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 60; }
  .m-more-backdrop { position: absolute; inset: 0; background: rgba(10,15,20,.45); animation: fade-in .2s ease; }
  .m-more-sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 18px 18px 0 0; padding: .9rem 1rem calc(1.2rem + env(safe-area-inset-bottom)); animation: sheet-up .25s ease; box-shadow: 0 -20px 40px -20px rgba(0,0,0,.4); }
  .m-more-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
  .m-more-head h2 { font-size: 17px; color: var(--heading); }
  .m-more-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
  .m-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
  .m-more-grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; min-height: 84px; padding: .6rem .3rem; border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; text-align: center; background: var(--surface); }
  .m-more-grid a svg { width: 24px; height: 24px; }
  .m-more-grid a[aria-current="page"] { border-color: var(--gold-ink); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
  body.more-open { overflow: hidden; }
}
@media (max-width: 359px) { .topbar-right > form > button, .topbar-right > a, .topbar-right > .premium-ribbon { font-size: 10.4px !important; gap: .2rem !important; } .topbar-right svg { width: 13px !important; height: 13px !important; } .m-nav-item { font-size: 10px; } }
@keyframes sheet-up { from { transform: translateY(100%); } } @keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .m-more-sheet, .m-more-backdrop { animation: none; } }

/* Tabs on phones: every tab visible as a grid of full-width buttons (no sideways scrolling, nothing cut off) */
@media (max-width: 640px) {
  .tabs-ready .tab-bar { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: .35rem !important; overflow: visible !important; flex-wrap: wrap !important; padding: .45rem !important; }
  .tabs-ready .tab-bar[data-count="2"], .tabs-ready .tab-bar[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab { white-space: normal !important; min-height: 42px; padding: .5rem .4rem !important; border: 1px solid var(--line) !important; border-radius: 10px !important; font-size: 13.5px !important; line-height: 1.2; text-align: center; }
  .tab[aria-selected="true"] { border-color: var(--btn-bg) !important; box-shadow: 0 2px 0 0 var(--gold) inset; }
}
/* Phones: the four actions share one row in proportion to their labels (nothing cut off) */
@media (max-width: 820px) {
  .topbar-right { display: flex !important; gap: .3rem !important; }
  .topbar-right > * { flex: 1 1 auto !important; min-width: 0 !important; }
  .topbar-right > form > button, .topbar-right > a, .topbar-right > .premium-ribbon { font-size: clamp(9.6px, 2.95vw, 12.5px) !important; padding: .3rem clamp(.12rem, .9vw, .5rem) !important; gap: clamp(.15rem, .8vw, .35rem) !important; overflow: visible; }
  .topbar-right svg { width: clamp(11px, 3.4vw, 15px) !important; height: clamp(11px, 3.4vw, 15px) !important; }
  .topbar-right span, .topbar-right .theme-label { overflow: visible; text-overflow: clip; }
}
@media (max-width: 820px) {
  .topbar-right { align-items: stretch !important; }
  .topbar-right > form > button, .topbar-right > a, .topbar-right > .premium-ribbon { height: 40px !important; min-height: 40px !important; box-sizing: border-box; line-height: 1; margin: 0 !important; }
}
/* Editor: collapsible side panel — the preview takes the space */
.ed-collapse .when-closed { display: none; } .ed.is-collapsed .ed-collapse .when-open { display: none; } .ed.is-collapsed .ed-collapse .when-closed { display: inline; }
.ed-body { transition: grid-template-columns .25s ease; }
.ed.is-collapsed .ed-body { grid-template-columns: 0 1fr; }
.ed.is-collapsed .ed-panel { visibility: hidden; padding: 0; border: 0; overflow: hidden; }
@media (max-width: 1000px) { .ed.is-collapsed .ed-body { grid-template-columns: 1fr; } .ed.is-collapsed .ed-panel { display: none; } .ed.is-collapsed .ed-stage { height: calc(100vh - 220px); } }
@media (prefers-reduced-motion: reduce) { .ed-body { transition: none; } }

/* ---------- AI credits (customer and admin) ---------- */
.ai-wallet .stat-primary, .stats .stat-primary { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); background: color-mix(in srgb, var(--gold) 7%, var(--surface)); }
.ai-shared { margin: -.25rem 0 1.25rem; }
.ai-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; margin-top: .75rem; }
.ai-pack form { display: grid; gap: .3rem; height: 100%; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ai-pack-name { font-weight: 700; color: var(--heading); } .ai-pack-credits { font-size: 1.5rem; font-weight: 700; color: var(--heading); } .ai-pack-credits small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.ai-pack-price { color: var(--muted); font-weight: 600; } .ai-pack-buy { display: flex; gap: .4rem; margin-top: .4rem; } .ai-pack-buy select { flex: 0 0 auto; width: auto; min-width: 68px; } .ai-pack-buy .btn { flex: 1; }
.table td.num.neg { color: var(--danger); } .table td.num.pos { color: #1f8a55; }
h2.sub { font-size: 1rem; margin: 1.4rem 0 .6rem; color: var(--heading); }
.ai-series { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; } @media (max-width: 1100px) { .ai-series { grid-template-columns: 1fr; } }
.table-compact td, .table-compact th { padding: .4rem .5rem; font-size: 13px; }
.input-xs { width: 4.5rem !important; } .input-sm { width: 8rem !important; }

/* Terms of Use acceptance notice in the dashboard (sits above the phone navigation bar) */
.terms-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); background: var(--surface); color: var(--text); border-top: 1px solid color-mix(in srgb, var(--gold) 50%, var(--line)); box-shadow: 0 -12px 30px -18px rgba(0,0,0,.35); }
.terms-banner-in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; flex-wrap: wrap; }
.terms-banner p { flex: 1 1 420px; margin: 0; font-size: 14px; line-height: 1.5; } .terms-banner a { color: var(--gold-ink); text-decoration: underline; }
.terms-banner-actions { display: flex; gap: .5rem; } .terms-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .5rem 1.1rem; border-radius: 999px; border: 1px solid var(--btn-bg); background: var(--btn-bg); color: var(--btn-fg) !important; font: 600 14px var(--f); text-decoration: none !important; cursor: pointer; }
.terms-btn-ghost { background: transparent; color: var(--text) !important; border-color: var(--line-2); }
body:has(.terms-banner) .content { padding-bottom: 120px; }
@media (max-width: 820px) { .terms-banner { bottom: calc(66px + env(safe-area-inset-bottom)); padding-bottom: .75rem; } .terms-banner-actions { width: 100%; } .terms-btn { flex: 1; } body:has(.terms-banner) .content { padding-bottom: calc(230px + env(safe-area-inset-bottom)) !important; } }
.publish-box { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.25rem; margin-top: .5rem; } .publish-box legend { font-weight: 700; padding: 0 .4rem; }
.filters-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; } .filters-row .field { min-width: 150px; margin: 0; }
.legal-admin-view h2 { margin-top: 1.5rem; } .pager { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: 1rem; } .pager a { padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 6px; } .pager a[aria-current] { background: var(--btn-bg); color: var(--btn-fg); }

/* ---------- Collapsible account options (Free Premium, Dark mode, View store, Log out) ---------- */
.acct-bar { margin-left: auto; display: flex; align-items: center; }
.acct-summary { list-style: none; display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; padding: .3rem .6rem .3rem .3rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: 600 13px var(--f); user-select: none; }
.acct-summary::-webkit-details-marker { display: none; }
.acct-avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-fg); font-size: 12px; }
.acct-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-caret { transition: transform .2s ease; color: var(--muted); }
.acct-bar[open] .acct-caret { transform: rotate(180deg); }
.acct-bar .topbar-right { display: none !important; }
.acct-bar[open] .topbar-right { display: flex !important; align-items: center; gap: .5rem; margin-left: .6rem; }
@media (max-width: 820px) {
  .acct-bar { grid-area: actions; margin: 0; display: block; width: 100%; }
  .acct-summary { width: 100%; justify-content: space-between; border-radius: 10px; padding: .35rem .6rem .35rem .35rem; min-height: 40px; }
  .acct-summary .acct-name { flex: 1; max-width: none; }
  .acct-bar[open] .topbar-right { display: flex !important; margin: .5rem 0 0 !important; }
}
@media (prefers-reduced-motion: reduce) { .acct-caret { transition: none; } }

/* Tabs on phones: the same tab row as on desktop (wraps onto a second line instead of being cut off) */
@media (max-width: 640px) {
  .tabs-ready .tab-bar { display: flex !important; flex-wrap: wrap !important; overflow: visible !important; gap: .3rem !important; padding: .4rem !important; grid-template-columns: none !important; }
  .tabs-ready .tab-bar .tab { flex: 1 1 auto !important; border: 0 !important; border-radius: 999px !important; box-shadow: none !important; white-space: nowrap !important; min-height: 40px; padding: .5rem .8rem !important; font-size: 13.5px !important; }
  .tabs-ready .tab-bar .tab[aria-selected="true"] { background: var(--btn-bg); color: var(--btn-fg); }
}
.locked-value { display: inline-flex; align-items: center; gap: .45rem; margin: .2rem 0 0; padding: .55rem .8rem; border: 1px dashed var(--line-2); border-radius: 8px; background: var(--surface-2); font-weight: 600; color: var(--text); }
.plan-table-wrap { overflow-x: auto; margin: 0 0 1.25rem; } .plan-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.plan-table th, .plan-table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; } .plan-table .num { text-align: right; }
.plan-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); } .plan-users { font-weight: 600; } .plan-users-line { font-weight: 600; }
/* Social media content planner */
.ai-platforms { border: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; } .ai-platforms legend { font-weight: 600; font-size: 14px; margin-bottom: .4rem; }
.ai-plan-overview { font-size: 15px; line-height: 1.6; } .ai-plan-sub { font-size: 15px; margin: 1.2rem 0 .6rem; }
.ai-plan-platforms { list-style: none; padding: 0; display: grid; gap: .4rem; } .ai-plan-platforms strong { margin-right: .3rem; }
.ai-plan-posts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem; }
.ai-post { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; background: var(--surface); }
.ai-post-head { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .5rem; } .ai-post-date { font-weight: 700; margin-right: .2rem; } .ai-post-copy { margin-left: auto; }
.ai-post-topic { font-weight: 600; margin: 0 0 .3rem; } .ai-post-caption { margin: 0 0 .5rem; line-height: 1.55; white-space: normal; } .ai-post-cta { margin: 0 0 .3rem; font-size: 14px; } .ai-post-tags { margin: 0; color: var(--gold-ink); font-size: 13.5px; word-break: break-word; }
.badge-soft { background: var(--surface-2); color: var(--text); }

/* Phones: no customer dropdown in the top bar (its items are in More); More is a clean list */
@media (max-width: 820px) {
  .acct-bar { display: none !important; }
  .topbar { grid-template-areas: "brand status" !important; }
  .m-more-head { gap: .6rem; } .m-more-head h2 { margin-right: auto; } .m-more-badge { font-size: 12px; padding: .25rem .6rem; }
  .m-more-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 70vh; overflow-y: auto; }
  .m-more-list a, .m-more-list button { display: flex; align-items: center; gap: .9rem; width: 100%; min-height: 50px; padding: .6rem .7rem; border: 0; border-radius: 10px; background: none; color: var(--text); font: 500 15.5px var(--f); text-align: left; text-decoration: none; cursor: pointer; }
  .m-more-list a:active, .m-more-list button:active, .m-more-list a:hover, .m-more-list button:hover { background: var(--surface-2); }
  .m-more-list a[aria-current="page"] { background: color-mix(in srgb, var(--gold) 12%, var(--surface)); font-weight: 600; }
  .m-more-list svg { width: 21px; height: 21px; color: var(--muted); flex: 0 0 auto; }
  .m-more-list li:last-child { border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .35rem; }
  .m-more-list form { margin: 0; }
}
/* Settings → Appearance */
.appearance-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.appearance-row .theme-toggle { min-height: 40px; }
/* Team */
.team-count { margin: 0 0 1rem; } .team-list { list-style: none; margin: 0 0 1.25rem; padding: 0; border-top: 1px solid var(--line); }
.team-list li { display: grid; grid-template-columns: 36px 1fr auto auto; gap: .8rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.team-list li > div { display: grid; min-width: 0; } .team-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); color: var(--text); font-weight: 700; }
.team-actions { display: flex; gap: .8rem; } .team-invite label { font-weight: 600; display: block; margin-bottom: .4rem; }
.team-invite-row { display: flex; gap: .5rem; flex-wrap: wrap; } .team-invite-row input { flex: 1 1 240px; }
@media (max-width: 560px) { .team-list li { grid-template-columns: 36px 1fr; } .team-list li .badge, .team-actions { grid-column: 2; justify-self: start; } }

/* Start Now: package and billing choice on the sign-up page */
.reg-choice { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; } .reg-choice legend { font-weight: 600; font-size: .9375rem; margin-bottom: .45rem; }
.reg-billing { grid-template-columns: 1fr 1fr; }
.reg-option { position: relative; display: block; cursor: pointer; }
.reg-option input { position: absolute; opacity: 0; pointer-events: none; }
.reg-option-body { display: grid; gap: .15rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease; }
.reg-option-body span { color: var(--muted); font-size: .9rem; }
.reg-option input:checked + .reg-option-body { border-color: var(--btn-bg); box-shadow: 0 0 0 1px var(--btn-bg); }
.reg-option input:focus-visible + .reg-option-body { outline: 2px solid var(--gold); outline-offset: 2px; }
.reg-option-sm .reg-option-body { padding: .65rem .9rem; }
.home-page-cell { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; } .badge-front { white-space: nowrap; }

/* Desktop top bar: Free Premium, View Store and Log out always shown (static) */
@media (min-width: 821px) {
  .acct-bar { margin-left: auto; display: flex; align-items: center; }
  .acct-bar .topbar-right { display: flex !important; align-items: center; gap: .5rem; margin-left: 0; }
}
/* Settings: Appearance and Tregflix branding on one line, at the bottom */
.settings-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: stretch; margin-top: 1rem; }
.settings-pair > .panel { margin: 0; }
/* Sign-up page: each package shows only the price of the selected billing period */
.reg-form .when-yearly { display: none; }
.reg-form[data-billing="yearly"] .when-monthly { display: none; } .reg-form[data-billing="yearly"] .when-yearly { display: inline; }
.reg-form:has(input[name="billing"][value="yearly"]:checked) .when-monthly { display: none; }
.reg-form:has(input[name="billing"][value="yearly"]:checked) .when-yearly { display: inline; }
.reg-form:has(input[name="billing"][value="monthly"]:checked) .when-monthly { display: inline; }
.reg-form:has(input[name="billing"][value="monthly"]:checked) .when-yearly { display: none; }
.reg-price { color: var(--text) !important; font-weight: 600; }
/* Book editor */
.edition-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: .75rem; }
.edition-card { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem 1rem; margin: 0; display: grid; gap: .6rem; }
.edition-card legend { padding: 0 .3rem; } .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.book-acc { border-top: 1px solid var(--line); padding: .7rem 0; } .book-acc summary { cursor: pointer; font-weight: 600; } .book-acc[open] summary { margin-bottom: .6rem; }
.book-order td { vertical-align: middle; } .input-xs { width: 3.5rem; } .thumb-sm { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; vertical-align: middle; }
.thumb-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .5rem 0; } .thumb-pick { display: grid; gap: .25rem; font-size: 13px; } .thumb-pick img { width: 84px; height: 110px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.tpl-group-title { font-size: 15px; margin: 1.5rem 0 .75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
/* Notebook reminder badges in the dashboard navigation */
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #B4443C; color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.m-nav-item { position: relative; } .m-nav-dot { position: absolute; top: 6px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: #B4443C; box-shadow: 0 0 0 2px var(--surface); }

/* ---- Visual editor: replacing sample products and categories; click-to-edit ---- */
.ed-howto { margin: 0 0 .6rem; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 13px; line-height: 1.5; color: var(--text); }
.ed-picks { margin: .2rem 0 1rem; padding: .75rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ed-picks .hint { margin: .2rem 0 .6rem; }
.ed-pick-list { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .35rem; }
.ed-pick-list li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: .55rem; padding: .35rem; border: 1px solid var(--line); border-radius: 10px; }
.ed-pick-list li.is-sample { background: var(--surface-2); border-style: dashed; }
.ed-pick-list img, .ed-pick-noimg, .ed-picker-list img { width: 40px; height: 40px; border-radius: 7px; object-fit: cover; background: var(--surface-2); display: block; }
.ed-pick-name { display: grid; min-width: 0; font-size: 13px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; }
.ed-pick-name small { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.ed-pick-list .is-real small { color: var(--ok, #2f7a4a); font-weight: 600; }
.ed-picks .ed-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; }
.ed-picker { width: min(520px, calc(100vw - 2rem)); max-height: min(640px, calc(100vh - 3rem)); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); }
.ed-picker[open] { display: flex; flex-direction: column; } .ed-picker::backdrop { background: rgba(15, 20, 25, .45); }
.ed-picker-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem .4rem; } .ed-picker-head h2 { font-size: 1.05rem; margin: 0; }
.ed-picker-x { border: 0; background: none; font-size: 1.4rem; color: var(--muted); cursor: pointer; width: 32px; height: 32px; border-radius: 8px; } .ed-picker-x:hover { background: var(--surface-2); }
.ed-picker-q { margin: 0 1rem .3rem; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 .75rem; background: var(--surface); color: var(--text); font: inherit; }
.ed-picker-note { margin: 0 1rem .5rem; font-size: 12.5px; color: var(--muted); }
.ed-picker-list { list-style: none; margin: 0; padding: 0 .6rem; overflow-y: auto; flex: 1; min-height: 120px; }
.ed-picker-list button { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: .65rem; width: 100%; padding: .45rem .5rem; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.ed-picker-list button[data-pick-cat] { grid-template-columns: minmax(0, 1fr); }
.ed-picker-list button:hover, .ed-picker-list button:focus-visible { background: var(--surface-2); outline: none; }
.ed-picker-list button[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--text); }
.ed-pick-tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; }
[aria-pressed="true"] .ed-pick-tick { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); }
.ed-picker-empty { padding: 1rem .5rem; color: var(--muted); font-size: 13.5px; }
.ed-picker-foot { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--line); } .ed-picker-foot span { margin-right: auto; font-size: 13px; color: var(--muted); }
.ed-flash { animation: ed-flash 1.6s ease; } @keyframes ed-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--gold, #b49a67); } 100% { box-shadow: 0 0 0 0 transparent; } }
.ed-intro { display: grid; gap: .5rem; justify-items: start; } .ed-intro h2 { margin: 0; } .ed-intro .hint { margin: 0; max-width: 62ch; }
@media (prefers-reduced-motion: reduce) { .ed-flash { animation: none; outline: 2px solid var(--gold, #b49a67); } }
.badge-sale { background: #FBEAE7; color: #8E2F27; border-color: #F1C9C2; font-weight: 600; }
[data-theme="dark"] .badge-sale { background: #3d2522; color: #f3c9c2; border-color: #5a332e; }
/* Product editor: grid items may shrink, so wide tables (option prices) scroll inside their own box instead of widening the page */
.product-form > *, .product-main, .product-side, .product-main > .panel { min-width: 0; }
.product-main .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Tables that scroll sideways: hidden screen-reader labels stay inside the scroll box (they otherwise widened the page on phones) */
.table-wrap { position: relative; }
.ce-mode-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; } .ce-mode-actions form { margin: 0; } .ce-mode-panel h2 { display: flex; align-items: center; gap: .5rem; }
