/* ==========================================================================
   DigiSell — Design System (Neo-Fintech Creator Matrix)
   Token mengikuti DESIGN.md: kanvas #F0F0F0, kartu putih 24px, aksen lime,
   jangkar hijau hutan #174A1E, font Plus Jakarta Sans.
   ========================================================================== */

:root {
  --canvas: #F0F0F0;
  --surface: #FFFFFF;
  --surface-2: #F7F7F7;
  --surface-3: #F0F0F0;
  --line: #E8E8E8;
  --line-strong: #D9D9D9;
  --ink: #111111;
  --ink-2: #3A3A3A;
  --muted: #8A8A8A;
  --primary: #174A1E;
  --primary-hover: #1F5C28;
  --on-primary: #FFFFFF;
  --lime: #B6F26B;
  --lime-hover: #A6E85A;
  --on-lime: #174A1E;
  --lime-soft: #DDF7C4;
  --forest-ink: #174A1E;
  --hero-dark: #0F2A13;

  --ok-bg: #DDF7C4;   --ok-fg: #174A1E;
  --warn-bg: #FFE9DC; --warn-fg: #B84A12;
  --bad-bg: #FDE2E0;  --bad-fg: #B3261E;
  --draft-bg: #ECECEC; --draft-fg: #555555;
  --info-bg: #E3ECFB; --info-fg: #1D4ED8;
  --danger: #B3261E;

  --shadow-float: 0 2px 12px rgba(0,0,0,.04);
  --shadow-pop: 0 4px 6px -1px rgba(0,0,0,.03), 0 20px 24px -4px rgba(23,74,30,.06);
  --shadow-modal: 0 4px 6px -1px rgba(0,0,0,.05), 0 30px 60px -12px rgba(23,74,30,.22);

  --r-card: 24px;
  --r-input: 14px;
  --r-sm: 10px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0E1410; --surface: #182019; --surface-2: #1D261E; --surface-3: #141B15;
    --line: #233026; --line-strong: #2E3E31;
    --ink: #F5F5F5; --ink-2: #CBD3CC; --muted: #7C8B7F;
    --primary: #B6F26B; --primary-hover: #C6F78A; --on-primary: #0E1410;
    --forest-ink: #B6F26B; --hero-dark: #0A120C;
    --lime-soft: #23361F;
    --ok-bg: #22381F; --ok-fg: #B6F26B;
    --warn-bg: #3A2416; --warn-fg: #FFB38A;
    --bad-bg: #3A1B19; --bad-fg: #FF9C94;
    --draft-bg: #262E27; --draft-fg: #B4BDB5;
    --info-bg: #19253D; --info-fg: #9DB8FF;
    --danger: #FF8A80;
    --shadow-float: 0 2px 12px rgba(0,0,0,.3);
    --shadow-pop: 0 20px 40px -10px rgba(0,0,0,.5);
    --shadow-modal: 0 30px 60px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #0E1410; --surface: #182019; --surface-2: #1D261E; --surface-3: #141B15;
  --line: #233026; --line-strong: #2E3E31;
  --ink: #F5F5F5; --ink-2: #CBD3CC; --muted: #7C8B7F;
  --primary: #B6F26B; --primary-hover: #C6F78A; --on-primary: #0E1410;
  --forest-ink: #B6F26B; --hero-dark: #0A120C;
  --lime-soft: #23361F;
  --ok-bg: #22381F; --ok-fg: #B6F26B;
  --warn-bg: #3A2416; --warn-fg: #FFB38A;
  --bad-bg: #3A1B19; --bad-fg: #FF9C94;
  --draft-bg: #262E27; --draft-fg: #B4BDB5;
  --info-bg: #19253D; --info-fg: #9DB8FF;
  --danger: #FF8A80;
  --shadow-float: 0 2px 12px rgba(0,0,0,.3);
  --shadow-pop: 0 20px 40px -10px rgba(0,0,0,.5);
  --shadow-modal: 0 30px 60px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 80px); -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); font-size: 15px; line-height: 22px; letter-spacing: -.005em;
  color: var(--ink); background: var(--canvas);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 13px; line-height: 18px; }
.xs { font-size: 12px; line-height: 16px; }
.strong { font-weight: 700; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-4{margin-top:4px}.mt-8{margin-top:8px}.mt-12{margin-top:12px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}.mt-32{margin-top:32px}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Typography scale */
.t-stat { font-size: 44px; line-height: 52px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.t-h1 { font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -.025em; }
.t-h2 { font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -.02em; }
.t-h3 { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.015em; }
.t-label { font-size: 14px; line-height: 18px; font-weight: 600; }
.t-cap { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .01em; }
@media (max-width: 767px) {
  .t-stat { font-size: 32px; line-height: 38px; letter-spacing: -.02em; }
  .t-h1 { font-size: 28px; line-height: 34px; letter-spacing: -.02em; }
  .t-h2 { font-size: 22px; line-height: 30px; }
}

:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 24px; border-radius: 9999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .08s, border-color .15s, color .15s, filter .15s;
  background: var(--surface); color: var(--ink); user-select: none;
}
.btn:active:not([disabled]) { transform: scale(.98); }
.btn svg { flex: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not([disabled]) { background: var(--primary-hover); }
.btn-accent { background: var(--lime); color: var(--on-lime); font-weight: 700; }
.btn-accent:hover:not([disabled]) { background: var(--lime-hover); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not([disabled]) { background: var(--surface-3); }
.btn-soft { background: var(--surface-3); color: var(--ink); }
.btn-soft:hover:not([disabled]) { background: var(--line); }
.btn-danger { background: var(--bad-fg); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #1a0a09; }
.btn-danger:hover:not([disabled]) { filter: brightness(1.08); }
.btn-danger-ghost { background: transparent; border-color: var(--bad-bg); color: var(--bad-fg); }
.btn-danger-ghost:hover:not([disabled]) { background: var(--bad-bg); }
.btn-link { background: none; border: none; padding: 0; height: auto; color: var(--forest-ink); font-weight: 600; }
.btn-link:hover { text-decoration: underline; }
.btn-sm { --h: 36px; padding: 0 16px; font-size: 14px; }
.btn-xs { --h: 30px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-lg { --h: 56px; padding: 0 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: var(--h); padding: 0; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading .btn-label { opacity: .7; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px;
  border-radius: 9999px; font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
  background: var(--draft-bg); color: var(--draft-fg);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-sm { height: 22px; padding: 0 9px; font-size: 11px; }
.b-ok { background: var(--ok-bg); color: var(--ok-fg); }
.b-warn { background: var(--warn-bg); color: var(--warn-fg); }
.b-bad { background: var(--bad-bg); color: var(--bad-fg); }
.b-draft { background: var(--draft-bg); color: var(--draft-fg); }
.b-info { background: var(--info-bg); color: var(--info-fg); }
.b-lime { background: var(--lime); color: #174A1E; }
.b-forest { background: #174A1E; color: #fff; }
.b-outline { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
.micro { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; position: relative; }
.card-sm { padding: 16px; border-radius: 20px; }
.card-flush { padding: 0; overflow: hidden; }
.card-hl { background: var(--lime); border-color: var(--lime); color: #174A1E; }
.card-hl .muted { color: rgba(23,74,30,.72); }
.card-forest { background: #174A1E; border-color: #174A1E; color: #fff; }
.card-forest .muted { color: rgba(255,255,255,.66); }
:root[data-theme="dark"] .card-forest { background: #12301A; border-color: #1E4527; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 17px; line-height: 24px; font-weight: 700; letter-spacing: -.01em; }
.card-head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.star-orn { position: absolute; top: 18px; right: 18px; opacity: .9; pointer-events: none; }
.star-orn.s2 { top: 44px; right: 46px; transform: scale(.55); opacity: .6; }

.grid { display: grid; gap: 24px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.g-side { grid-template-columns: minmax(0,1fr) 360px; }
.g-side-l { grid-template-columns: 320px minmax(0,1fr); }
.g-mod { grid-template-columns: minmax(0,380px) minmax(0,1fr); }
@media (max-width: 1180px) { .g-5 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-side, .g-side-l, .g-mod { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 860px) { .g-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 767px) { .grid { gap: 16px; } .g-2, .g-3 { grid-template-columns: minmax(0,1fr); } .g-5 { grid-template-columns: repeat(2, minmax(0,1fr)); } .card { padding: 18px; border-radius: 20px; } }
@media (max-width: 420px) { .g-4 { grid-template-columns: minmax(0,1fr); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.field .hint { font-size: 12px; color: var(--muted); line-height: 16px; }
.field .err { font-size: 12px; color: var(--bad-fg); display: none; line-height: 16px; }
.field.has-error .err { display: block; }
.input, .select, .textarea {
  width: 100%; height: 48px; border-radius: var(--r-input); border: 1px solid var(--line);
  background: var(--surface); padding: 0 16px; outline: none; transition: border-color .15s, box-shadow .15s;
  font-size: 15px; color: var(--ink);
}
.textarea { height: auto; min-height: 112px; padding: 12px 16px; resize: vertical; line-height: 22px; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A8A8A' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; cursor: pointer; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .85; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--forest-ink); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--lime); }
.field.has-error .input, .field.has-error .textarea, .field.has-error .select { border-color: var(--bad-fg); background: color-mix(in srgb, var(--bad-bg) 40%, var(--surface)); }
.field.has-error .input:focus { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--bad-bg); }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.input-sm { height: 40px; font-size: 14px; border-radius: 12px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-wrap.lead .input { padding-left: 44px; padding-right: 16px; }
.input-wrap .lead-ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-wrap .trail { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .02em; }
.code-input { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0,1fr); } }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { appearance: none; width: 20px; height: 20px; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--surface); display: grid; place-items: center; margin: 0; cursor: pointer; flex: none; transition: background .15s, border-color .15s; }
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--on-primary); border-bottom: 2px solid var(--on-primary); transform: rotate(-45deg) translate(1px,-1px); }
.check input[type="radio"]:checked::after { width: 8px; height: 8px; border: none; border-radius: 50%; background: var(--on-primary); transform: none; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line-strong); margin: 0; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); background: var(--surface); }
:root[data-theme="dark"] .switch input:checked::after { background: #0E1410; }

.range { width: 100%; accent-color: #174A1E; }

/* Segmented pill switcher */
.seg { display: inline-flex; gap: 4px; padding: 5px; background: var(--surface-3); border-radius: 9999px; border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; height: 36px; padding: 0 16px; border-radius: 9999px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--lime); color: #174A1E; }
.seg.dark button.on { background: var(--primary); color: var(--on-primary); }
.seg .count { font-size: 11px; background: rgba(0,0,0,.08); padding: 2px 7px; border-radius: 99px; }
.seg-sm button { height: 30px; padding: 0 12px; font-size: 13px; }

/* Tabs underline */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 12px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 14px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--forest-ink); }

/* Dropzone */
.dropzone { border: 1.5px dashed var(--line-strong); background: var(--surface-2); border-radius: var(--r-input); padding: 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dropzone:hover, .dropzone.drag { border-color: var(--forest-ink); background: var(--lime-soft); }
.dz-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--lime); color: #174A1E; display: grid; place-items: center; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb-prev { width: 84px; height: 84px; border-radius: 14px; overflow: hidden; position: relative; border: 1px solid var(--line); background: var(--surface-2); }
.thumb-prev img { width: 100%; height: 100%; object-fit: cover; }
.thumb-prev button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }

/* ---------- Tables ---------- */
.table-shell { border: 1px solid var(--line); border-radius: var(--r-input); overflow: auto; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.tbl-empty { text-align: center; padding: 40px 16px !important; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pager .pg { display: flex; gap: 6px; }
.pager .pg button { min-width: 34px; height: 34px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; }
.pager .pg button.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.pager .pg button[disabled] { opacity: .4; cursor: default; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input-wrap { flex: 1 1 240px; }

/* list rows */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.ic-box { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--ink-2); }
.ic-box.lime { background: var(--lime); color: #174A1E; }
.ic-box.forest { background: #174A1E; color: #B6F26B; }
.ic-box.soft { background: var(--lime-soft); color: var(--forest-ink); }

/* Avatars */
.avatar { border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex: none; color: #174A1E; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; z-index: 3000; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-pop); animation: toastIn .25s ease; }
.toast.out { animation: toastOut .2s ease forwards; }
.toast .t-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.toast.success .t-ic { background: var(--ok-bg); color: var(--ok-fg); }
.toast.error .t-ic { background: var(--bad-bg); color: var(--bad-fg); }
.toast.warn .t-ic { background: var(--warn-bg); color: var(--warn-fg); }
.toast.info .t-ic, .toast.loading .t-ic { background: var(--info-bg); color: var(--info-fg); }
.toast .t-title { font-weight: 700; font-size: 14px; line-height: 20px; }
.toast .t-msg { font-size: 13px; color: var(--muted); line-height: 18px; margin-top: 1px; word-break: break-word; }
.toast .t-x { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }
@media (max-width: 767px) { .toast-stack { right: 16px; left: 16px; width: auto; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }

/* ---------- Skeleton ---------- */
.skel { background: linear-gradient(90deg, var(--surface-3) 25%, var(--line) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skel-line { height: 12px; margin: 8px 0; }
.skel-thumb { aspect-ratio: 4/3; border-radius: 16px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(10,18,12,.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .18s ease; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-modal); animation: popIn .22s cubic-bezier(.2,.9,.3,1.2); position: relative; }
.modal.lg { width: min(960px, 100%); }
.modal.md { width: min(720px, 100%); }
.modal.sm { width: min(440px, 100%); }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 0; }
.modal-h h3 { font-size: 19px; line-height: 26px; font-weight: 700; letter-spacing: -.015em; }
.modal-b { padding: 18px 24px 24px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 24px; flex-wrap: wrap; }
.modal-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); flex: none; }
.modal-x:hover { background: var(--surface-3); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.lg, .modal.md, .modal.sm { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheetIn .25s ease; }
  @keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } }
}
.danger-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--bad-bg); color: var(--bad-fg); display: grid; place-items: center; flex: none; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 2500; background: rgba(6,10,7,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px 40px; animation: fadeIn .2s; color: #fff; }
.lightbox img { max-height: calc(100vh - 160px); max-width: min(1100px, 100%); border-radius: 18px; object-fit: contain; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lb-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-prev { left: 20px; } .lb-next { right: 20px; }
.lb-close { position: absolute; top: calc(16px + env(safe-area-inset-top,0px)); right: 16px; transform: none; }
.lb-count { position: absolute; top: calc(24px + env(safe-area-inset-top,0px)); left: 50%; transform: translateX(-50%); font-weight: 600; font-size: 14px; background: rgba(255,255,255,.1); padding: 6px 14px; border-radius: 99px; }
.lb-cap { margin-top: 16px; font-size: 14px; opacity: .8; text-align: center; }
@media (max-width: 640px) { .lb-prev { left: 8px; } .lb-next { right: 8px; } .lb-btn { width: 40px; height: 40px; } }

/* Empty state */
.empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .e-ic { width: 72px; height: 72px; border-radius: 50%; background: var(--lime-soft); color: var(--forest-ink); display: grid; place-items: center; position: relative; margin-bottom: 6px; }
.empty .e-ic .sp { position: absolute; top: -4px; right: -6px; color: var(--forest-ink); }
.empty h3 { font-size: 18px; font-weight: 700; }
.empty p { color: var(--muted); max-width: 380px; font-size: 14px; }

/* Ticker marquee */
.ticker { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); overflow: hidden; white-space: nowrap; font-size: 13px; font-weight: 500; height: 36px; display: flex; align-items: center; }
.ticker-track { display: inline-flex; gap: 32px; animation: marq 60s linear infinite; padding-left: 32px; }
.ticker-track span:nth-child(even) { color: var(--muted); }
.ticker .lv { color: var(--forest-ink); font-weight: 700; }
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- Progress ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s ease; }
.bar.lime > i { background: var(--lime); }

/* Stars */
.stars { display: inline-flex; gap: 2px; color: #F2A900; }
.stars .off { color: var(--line-strong); }
.star-input { display: inline-flex; gap: 4px; }
.star-input button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--line-strong); transition: transform .1s; }
.star-input button.on { color: #F2A900; }
.star-input button:hover { transform: scale(1.12); }

/* Alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 13px; line-height: 19px; }
.alert svg { flex: none; margin-top: 1px; }
.alert.ok { background: var(--ok-bg); color: var(--ok-fg); }
.alert.warn { background: var(--warn-bg); color: var(--warn-fg); }
.alert.bad { background: var(--bad-bg); color: var(--bad-fg); }
.alert.info { background: var(--info-bg); color: var(--info-fg); }
.alert b { font-weight: 700; }

/* Chips (variable inserter) */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--forest-ink); color: var(--forest-ink); }
.chip.on { background: var(--lime); border-color: var(--lime); color: #174A1E; }

/* Dropdown menu */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 900; animation: popIn .15s; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 12px; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--ink); text-align: left; font-weight: 500; }
.menu button:hover, .menu a:hover { background: var(--surface-3); }
.menu .danger { color: var(--bad-fg); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ==========================================================================
   AUTH LAYOUT
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0; }
.auth-art { background: var(--hero-dark); color: #fff; position: relative; overflow: hidden; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; }
.auth-art .glow { position: absolute; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(circle, rgba(182,242,107,.22), transparent 62%); right: -180px; top: -160px; pointer-events: none; }
.auth-art .glow.g2 { left: -220px; bottom: -260px; right: auto; top: auto; background: radial-gradient(circle, rgba(182,242,107,.12), transparent 60%); }
.auth-art h2 { font-size: 40px; line-height: 46px; font-weight: 700; letter-spacing: -.03em; max-width: 520px; }
.auth-art p { color: rgba(255,255,255,.7); max-width: 460px; }
.auth-stat { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 22px; padding: 18px; backdrop-filter: blur(4px); }
.auth-stat .t-h3 { color: #fff; }
.auth-stat.lime { background: var(--lime); color: #174A1E; border-color: var(--lime); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: min(460px, 100%); }
.auth-card .card { padding: 32px; }
.auth-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-foot .btn { padding: 0 12px; white-space: normal; text-align: center; line-height: 1.2; min-width: 0; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 600; margin: 20px 0 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-box { border: 1px dashed var(--line-strong); border-radius: 16px; padding: 12px 14px; font-size: 13px; background: var(--surface-2); }
.demo-box button { border: 0; background: none; padding: 0; color: var(--forest-ink); font-weight: 700; cursor: pointer; font-size: 13px; }
.stepper { display: flex; gap: 8px; margin-bottom: 22px; }
.stepper .st { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.stepper .st i { height: 4px; border-radius: 99px; background: var(--line); display: block; }
.stepper .st.on { color: var(--ink); } .stepper .st.on i { background: var(--primary); }
.stepper .st.done i { background: var(--lime); }
.req-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12.5px; color: var(--muted); }
.req-list span { display: flex; align-items: center; gap: 6px; }
.req-list span.ok { color: var(--ok-fg); font-weight: 600; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pw-meter i { height: 4px; border-radius: 9px; background: var(--line); }
.pw-meter.s1 i:nth-child(-n+1) { background: var(--bad-fg); }
.pw-meter.s2 i:nth-child(-n+2) { background: var(--warn-fg); }
.pw-meter.s3 i:nth-child(-n+3) { background: #7DBB3A; }
.pw-meter.s4 i { background: var(--primary); }
.temp-pass { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: .06em; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; word-break: break-all; }
.success-ic { width: 72px; height: 72px; border-radius: 50%; background: var(--lime); color: #174A1E; display: grid; place-items: center; margin: 0 auto 14px; position: relative; }
@media (max-width: 980px) {
  .auth { grid-template-columns: minmax(0,1fr); }
  .auth-art { min-height: auto; padding: 24px 20px 28px; }
  .auth-art .art-extra { display: none; }
  .auth-art h2 { font-size: 26px; line-height: 32px; }
  .auth-form { padding: 20px 16px 40px; align-items: flex-start; margin-top: -20px; }
  .auth-card .card { padding: 22px; }
}

/* ==========================================================================
   PUBLIC SHOWCASE
   ========================================================================== */
.wrap:not(.row) { width: min(1240px, 100% - 64px); margin: 0 auto; }
@media (max-width: 767px) { .wrap:not(.row) { width: calc(100% - 32px); } }
.pub-nav { position: sticky; top: 0; z-index: 800; padding: 12px 0; background: color-mix(in srgb, var(--canvas) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.nav-bar { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 9999px; padding: 8px 8px 8px 18px; box-shadow: var(--shadow-float); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.03em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; background: #174A1E; display: grid; place-items: center; color: var(--lime); flex: none; }
.pill-nav { display: flex; gap: 2px; margin: 0 auto; padding: 4px; background: var(--surface-3); border-radius: 99px; }
.pill-nav a, .pill-nav button { text-decoration: none; padding: 8px 15px; border-radius: 99px; font-size: 14px; font-weight: 600; color: var(--muted); border: 0; background: none; cursor: pointer; white-space: nowrap; }
.pill-nav a:hover, .pill-nav button:hover { color: var(--ink); }
.pill-nav a.on, .pill-nav button.on { background: var(--lime); color: #174A1E; }
.nav-burger { display: none; }
.mobile-menu { display: none; }
@media (max-width: 980px) {
  .pub-nav .pill-nav { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-bar .hide-m { display: none; }
  .nav-bar { justify-content: space-between; }
  .mobile-menu.open { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 10px; box-shadow: var(--shadow-pop); }
  .mobile-menu a, .mobile-menu button { padding: 12px 14px; border-radius: 14px; text-decoration: none; font-weight: 600; border: 0; background: none; text-align: left; cursor: pointer; font-size: 15px; }
  .mobile-menu a:hover { background: var(--surface-3); }
}
.section { padding: 36px 0; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--forest-ink); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: center; padding: 22px 0 10px; }
.hero h1 { font-size: 54px; line-height: 58px; letter-spacing: -.04em; font-weight: 700; }
.hero p.lead { font-size: 17px; line-height: 27px; color: var(--ink-2); margin-top: 18px; max-width: 520px; }
.trust-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; font-size: 13px; color: var(--muted); }
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row svg { color: var(--forest-ink); }
.slider { position: relative; border-radius: 28px; overflow: hidden; background: var(--hero-dark); aspect-ratio: 5/4; border: 1px solid var(--line); }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.slide.on { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-cap { position: absolute; left: 18px; bottom: 18px; right: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.slide-cap .cap-card { background: rgba(255,255,255,.94); color: #111; border-radius: 18px; padding: 12px 16px; max-width: 70%; backdrop-filter: blur(6px); }
.slide-cap .cap-card b { display: block; font-size: 14px; }
.slide-cap .cap-card span { font-size: 12px; color: #666; }
.slider-dots { display: flex; gap: 6px; }
.slider-dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; background: rgba(255,255,255,.45); cursor: pointer; padding: 0; transition: width .25s, background .25s; }
.slider-dots button.on { width: 24px; background: var(--lime); }
.slider-arrows { position: absolute; top: 16px; right: 16px; display: flex; gap: 6px; }
.slider-arrows button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: #111; display: grid; place-items: center; cursor: pointer; }
.float-chip { position: absolute; top: 18px; left: 18px; background: var(--lime); color: #174A1E; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 99px; display: inline-flex; gap: 6px; align-items: center; }
.hero-fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: rgba(255,255,255,.75); padding: 30px; }
@media (max-width: 980px) { .hero { grid-template-columns: minmax(0,1fr); } .hero h1 { font-size: 36px; line-height: 42px; } }
@media (max-width: 420px) { .hero h1 { font-size: 30px; line-height: 36px; } .hero p.lead { font-size: 15px; line-height: 24px; } }

.feat-card { display: flex; flex-direction: column; gap: 10px; }
.feat-card .ic-box { width: 44px; height: 44px; }
.feat-card h4 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.feat-card p { font-size: 14px; color: var(--muted); line-height: 21px; }

/* Product rail */
.rail-wrap { position: relative; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; scrollbar-width: thin; scroll-behavior: smooth; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 1200px) { .rail { grid-auto-columns: calc((100% - 60px) / 4); } }
@media (max-width: 767px) { .rail { grid-auto-columns: 80%; gap: 14px; } }
.p-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 12px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: box-shadow .2s, transform .2s, border-color .2s; text-align: left; }
.p-card:hover { box-shadow: var(--shadow-pop); border-color: var(--line-strong); }
.p-thumb { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 4/3; background: var(--surface-3); }
.p-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.p-card:hover .p-thumb img { transform: scale(1.03); }
.p-thumb .badge { position: absolute; top: 10px; left: 10px; }
.p-thumb .type-pill { position: absolute; bottom: 10px; right: 10px; background: rgba(17,17,17,.75); color: #fff; font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 99px; display: inline-flex; gap: 5px; align-items: center; backdrop-filter: blur(4px); }
.p-body { padding: 0 4px 4px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.p-cat { font-size: 12px; color: var(--muted); font-weight: 500; }
.p-name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; line-height: 22px; }
.p-desc { font-size: 13px; color: var(--muted); line-height: 19px; }
.p-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.price { font-weight: 700; font-size: 17px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.price-old { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.rail-arrows { display: flex; gap: 8px; }

/* Testimonial marquee */
.marquee { overflow: hidden; position: relative; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee + .marquee { margin-top: 16px; }
.m-track { display: flex; gap: 16px; width: max-content; animation: marq var(--speed, 50s) linear infinite; }
.marquee.rev .m-track { animation-direction: reverse; }
.marquee:hover .m-track, .marquee.paused .m-track { animation-play-state: paused; }
.t-card { width: 340px; flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.t-card p { font-size: 14px; line-height: 21px; color: var(--ink-2); }
.proof { width: 300px; flex: none; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); cursor: zoom-in; position: relative; background: var(--surface); padding: 0; }
.proof img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.proof .pcap { position: absolute; left: 10px; bottom: 10px; right: 10px; background: rgba(255,255,255,.95); color: #111; font-size: 12px; font-weight: 600; padding: 7px 10px; border-radius: 12px; text-align: left; display: flex; gap: 6px; align-items: center; }
@media (max-width: 767px) { .t-card { width: 280px; } .proof { width: 240px; } }
@media (prefers-reduced-motion: reduce) { .m-track, .ticker-track { animation: none !important; } .slide { transition: none; } }

.stats-strip .card { display: flex; flex-direction: column; gap: 4px; }
.closing { background: #174A1E; color: #fff; border-radius: 32px; padding: 48px; position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: center; }
.closing h2 { font-size: 34px; line-height: 40px; letter-spacing: -.03em; font-weight: 700; max-width: 640px; }
.closing p { color: rgba(255,255,255,.72); margin-top: 10px; max-width: 560px; }
.closing .glow { position: absolute; right: -120px; top: -140px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(182,242,107,.25), transparent 62%); }
@media (max-width: 767px) { .closing { grid-template-columns: 1fr; padding: 28px 22px; border-radius: 24px; } .closing h2 { font-size: 24px; line-height: 30px; } }
.footer { padding: 40px 0 calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); margin-top: 40px; background: var(--surface); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.foot-grid h5 { font-size: 13px; font-weight: 700; margin: 0 0 12px; }
.foot-grid a, .foot-grid button.lnk { display: block; color: var(--muted); text-decoration: none; font-size: 14px; padding: 4px 0; background: none; border: 0; cursor: pointer; text-align: left; }
.foot-grid a:hover, .foot-grid button.lnk:hover { color: var(--ink); }
@media (max-width: 767px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }

/* Quick view */
.qv { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 24px; }
.qv-main { border-radius: 18px; overflow: hidden; aspect-ratio: 4/3; background: var(--surface-3); position: relative; cursor: zoom-in; }
.qv-main img { width: 100%; height: 100%; object-fit: cover; }
.qv-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.qv-thumbs button { border: 2px solid transparent; border-radius: 12px; overflow: hidden; padding: 0; cursor: pointer; aspect-ratio: 4/3; background: none; }
.qv-thumbs button.on { border-color: var(--forest-ink); }
.qv-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.feat-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.feat-list li { display: flex; gap: 10px; font-size: 14px; line-height: 20px; }
.feat-list li > svg, .feat-list li > span { color: var(--forest-ink); flex: none; margin-top: 1px; }
.card-forest .feat-list li > span { color: inherit; }
@media (max-width: 760px) { .qv { grid-template-columns: minmax(0,1fr); } }

/* ==========================================================================
   MEMBER AREA
   ========================================================================== */
.m-head { position: sticky; top: 0; z-index: 700; background: color-mix(in srgb, var(--canvas) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: calc(12px + env(safe-area-inset-top, 0px)) 0 12px; }
.m-main { padding: 12px 0 60px; }
.dock { display: none; }
@media (max-width: 860px) {
  .m-head .pill-nav, .m-head .hide-m { display: none; }
  .m-main { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
  .dock { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 800; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 6px; box-shadow: var(--shadow-pop); }
  .dock a, .dock button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 16px; text-decoration: none; font-size: 11px; font-weight: 600; color: var(--muted); border: 0; background: none; cursor: pointer; }
  .dock a.on { background: var(--lime); color: #174A1E; }
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 22px; }
.page-head .t-h2 + p { color: var(--muted); margin-top: 4px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; margin-bottom: 10px; }
.crumb:hover { color: var(--ink); }
.redeem { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,420px); gap: 20px; align-items: center; overflow: hidden; }
.redeem form { display: flex; gap: 8px; background: rgba(255,255,255,.55); padding: 6px; border-radius: 99px; }
.redeem .input { border: 0; background: #fff; border-radius: 99px; height: 46px; color: #111; }
.redeem .input:focus { box-shadow: 0 0 0 2px #174A1E; }
@media (min-width: 861px) { .redeem { padding-right: 60px; } }
@media (max-width: 860px) { .redeem { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 420px) { .redeem form { flex-direction: column; border-radius: 22px; } }
.own-card { display: flex; flex-direction: column; gap: 12px; padding: 12px; cursor: default; }
.own-card .p-foot { flex-direction: column; align-items: stretch; gap: 10px; }

/* LMS player */
.lms { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 24px; align-items: start; }
@media (max-width: 1080px) { .lms { grid-template-columns: minmax(0,1fr); } }
.player { position: relative; border-radius: 22px; overflow: hidden; background: #0A120C; aspect-ratio: 16/9; color: #fff; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.player .play-big { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 76px; height: 76px; border-radius: 50%; background: var(--lime); color: #174A1E; border: 0; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 40px rgba(182,242,107,.35); transition: transform .15s; }
.player .play-big:hover { transform: translate(-50%,-50%) scale(1.06); }
.player .p-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; gap: 8px; }
.player .p-ctrl { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; background: linear-gradient(transparent, rgba(0,0,0,.75)); display: flex; flex-direction: column; gap: 8px; }
.player .p-ctrl .tl { height: 5px; border-radius: 9px; background: rgba(255,255,255,.25); cursor: pointer; position: relative; }
.player .p-ctrl .tl i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--lime); border-radius: 9px; }
.player .p-ctrl .row { font-size: 13px; }
.player .p-ctrl button { background: none; border: 0; color: #fff; cursor: pointer; padding: 4px; display: grid; place-items: center; }
.playlist { position: sticky; top: 90px; }
.pl-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 16px; cursor: pointer; border: 1px solid transparent; transition: background .15s; }
.pl-item:hover { background: var(--surface-2); }
.pl-item.on { background: var(--lime-soft); border-color: color-mix(in srgb, var(--forest-ink) 25%, transparent); }
.pl-num { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; color: var(--muted); background: var(--surface); cursor: pointer; }
.pl-num.done { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pl-item.on .pl-num:not(.done) { border-color: var(--forest-ink); color: var(--forest-ink); }
.pl-scroll { max-height: 520px; overflow: auto; margin: 0 -8px; padding: 0 8px; }
@media (max-width: 1080px) { .playlist { position: static; } .pl-scroll { max-height: none; } }
.res-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* file list */
.file-row { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.file-row + .file-row { margin-top: 10px; }
.file-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; letter-spacing: .02em; }
.file-ic.zip { background: #174A1E; color: #B6F26B; }
.file-ic.pdf { background: var(--bad-bg); color: var(--bad-fg); }
.file-ic.fig { background: var(--info-bg); color: var(--info-fg); }
.file-ic.other { background: var(--lime-soft); color: var(--forest-ink); }
@media (max-width: 520px) { .file-row { flex-wrap: wrap; } .file-row .btn { width: 100%; } }

/* ==========================================================================
   ADMIN SUITE
   ========================================================================== */
.admin { display: grid; grid-template-columns: 272px minmax(0,1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); padding: calc(20px + env(safe-area-inset-top, 0px)) 16px 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; z-index: 1200; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav .grp { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; padding: 14px 12px 6px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 99px; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .15s; }
.side-nav a:hover { background: var(--surface-3); }
.side-nav a.on { background: #174A1E; color: #fff; }
:root[data-theme="dark"] .side-nav a.on { background: var(--lime); color: #0E1410; }
.side-nav a .cnt { margin-left: auto; background: var(--warn-bg); color: var(--warn-fg); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.side-nav a.on .cnt { background: var(--lime); color: #174A1E; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.a-top { position: sticky; top: 0; z-index: 600; display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top, 0px)) 32px 14px; background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.a-main { padding: 24px 32px 60px; min-width: 0; }
.a-burger { display: none; }
.side-scrim { display: none; }
@media (max-width: 1080px) {
  .admin { grid-template-columns: minmax(0,1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 288px; transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow-modal); }
  .admin.drawer-open .side { transform: none; }
  .admin.drawer-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.35); }
  .a-burger { display: inline-flex; }
  .a-top { padding-left: 16px; padding-right: 16px; }
  .a-main { padding: 18px 16px calc(60px + env(safe-area-inset-bottom, 0px)); }
  .a-top .hide-m { display: none; }
}
.kpi { display: flex; flex-direction: column; gap: 6px; min-height: 140px; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .k-lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi.card-hl .k-lbl { color: rgba(23,74,30,.75); }
.kpi .k-val { font-size: 36px; line-height: 42px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: auto; }
.delta { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 99px; background: var(--ok-bg); color: var(--ok-fg); }
.delta.down { background: var(--bad-bg); color: var(--bad-fg); }
.card-hl .delta { background: rgba(23,74,30,.12); color: #174A1E; }
.chart { width: 100%; overflow: visible; }
.chart .b { fill: var(--line-strong); transition: fill .15s; }
.chart .b.hl { fill: var(--primary); }
.chart .b2 { fill: var(--lime); }
.chart g.col:hover .b { fill: var(--primary); }
.chart g.col:hover .b2 { fill: #8CCB46; }
.chart text { fill: var(--muted); font-size: 13px; font-family: var(--font); }
.chart .grid-l { stroke: var(--line); stroke-dasharray: 3 4; }
.chart-tip { position: absolute; pointer-events: none; background: #111; color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 10px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .12s; z-index: 5; }
:root[data-theme="dark"] .chart-tip { background: #F5F5F5; color: #111; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.donut-wrap .dv { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.hbar { display: grid; grid-template-columns: 160px minmax(0,1fr) 54px; gap: 12px; align-items: center; font-size: 13px; padding: 7px 0; }
@media (max-width: 560px) { .hbar { grid-template-columns: 100px minmax(0,1fr) 44px; } }
.lesson-ed { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.lesson-ed + .lesson-ed { margin-top: 10px; }
.lesson-ed .le-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; }
.lesson-ed .le-b { padding: 4px 16px 16px; border-top: 1px solid var(--line); display: none; }
.lesson-ed.open .le-b { display: block; }
.lesson-ed.open .le-h .chev { transform: rotate(180deg); }
.res-row { display: grid; grid-template-columns: minmax(0,1.2fr) 130px minmax(0,1.6fr) 36px; gap: 8px; margin-top: 8px; }
@media (max-width: 640px) { .res-row { grid-template-columns: 1fr 1fr; } .res-row > :nth-child(3) { grid-column: 1 / -1; } }
.sticky-actions { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 8px 8px 8px 20px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-pop); z-index: 50; }
@media (max-width: 640px) { .sticky-actions { border-radius: 22px; flex-wrap: wrap; padding: 10px; } .sticky-actions .grow { flex-basis: 100%; } .sticky-actions .btn { flex: 1; } }
.mod-item { padding: 14px; border-radius: 18px; border: 1px solid var(--line); cursor: pointer; display: flex; gap: 12px; background: var(--surface); transition: border-color .15s; }
.mod-item + .mod-item { margin-top: 10px; }
.mod-item.on { border-color: var(--forest-ink); box-shadow: 0 0 0 1px var(--forest-ink) inset; }
.private-box { background: var(--warn-bg); color: var(--warn-fg); border-radius: 16px; padding: 14px; font-size: 14px; }
.phone-prev { background: #E9F0E4; border-radius: 22px; padding: 16px; min-height: 160px; }
:root[data-theme="dark"] .phone-prev { background: #121A13; }
.bubble { background: #fff; color: #111; border-radius: 4px 16px 16px 16px; padding: 10px 12px; font-size: 13.5px; line-height: 20px; white-space: pre-wrap; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,.06); word-break: break-word; }
.preview-frame { width: 360px; height: min(720px, calc(100vh - 140px)); border: 10px solid #111; border-radius: 40px; overflow: hidden; background: var(--canvas); margin: 0 auto; }
.preview-frame iframe { width: 100%; height: 100%; border: 0; }
.ds-sec + .ds-sec { margin-top: 24px; }
.swatch { border-radius: 18px; height: 92px; border: 1px solid var(--line); position: relative; padding: 12px; display: flex; align-items: flex-end; font-size: 12px; font-weight: 700; }
noscript .ns { padding: 20px; margin: 20px; border-radius: 16px; background: #FFE9DC; color: #B84A12; font-family: system-ui, sans-serif; }
@media print { .side, .a-top, .dock, .toast-stack { display: none !important; } }
.in-frame [data-preview]{display:none !important}
.table td .mono, .table td.mono { white-space: nowrap; }
