/* ===== Design tokens (brand colors will be overridable from the panel in phase 7) ===== */
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

/* App theme: deep indigo/violet, soft cards, big numbers. Light + dark (follows system, toggle in header). */
:root {
  --color-primary: #5b4cf0;
  --color-primary-hover: #4a3bdc;
  --color-primary-soft: #ecebff;
  --color-on-primary: #ffffff;
  --color-accent: #f5a524;
  --grad: linear-gradient(135deg, #6c5cff 0%, #3b82f6 100%);
  --color-bg: #eef0f6;
  --color-surface: #ffffff;
  --color-surface-2: #f4f5fa;
  --color-border: #e3e5ef;
  --color-text: #0f1222;
  --color-text-muted: #6b7088;
  --color-success: #15803d;
  --color-success-soft: #e3f6ea;
  --color-warning: #a16207;
  --color-warning-soft: #fdf3dc;
  --color-danger: #be123c;
  --color-danger-soft: #fde7ec;
  --color-up: #16a34a;
  --color-down: #e11d48;
  --glass: rgba(255, 255, 255, .78);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --radius-sm: 10px; --radius: 16px; --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(20, 22, 50, .04), 0 6px 20px rgba(20, 22, 50, .06);
  --font: Vazirmatn, Tahoma, sans-serif;
  --fs-sm: .8125rem; --fs: .9375rem; --fs-lg: 1.0625rem; --fs-xl: 1.25rem; --fs-2xl: 1.5rem;
  --nav-h: 64px;
  --content-w: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary: #8b7dff; --color-primary-hover: #a094ff; --color-primary-soft: #232048; --color-on-primary: #ffffff;
    --color-bg: #0a0c16; --color-surface: #141726; --color-surface-2: #1b1f33; --color-border: #262a40;
    --color-text: #eef0fa; --color-text-muted: #9196b0;
    --color-success-soft: #10291c; --color-warning-soft: #2e2410; --color-danger-soft: #34141d;
    --color-success: #34d399; --color-warning: #fbbf24; --color-danger: #fb7185;
    --color-up: #22c55e; --color-down: #fb4d6d; --glass: rgba(20, 23, 38, .78);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  --color-primary: #8b7dff; --color-primary-hover: #a094ff; --color-primary-soft: #232048; --color-on-primary: #ffffff;
  --color-bg: #0a0c16; --color-surface: #141726; --color-surface-2: #1b1f33; --color-border: #262a40;
  --color-text: #eef0fa; --color-text-muted: #9196b0;
  --color-success-soft: #10291c; --color-warning-soft: #2e2410; --color-danger-soft: #34141d;
  --color-success: #34d399; --color-warning: #fbbf24; --color-danger: #fb7185;
  --color-up: #22c55e; --color-down: #fb4d6d; --glass: rgba(20, 23, 38, .78);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs); line-height: 1.75;
  color: var(--color-text); background: var(--color-bg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
h1, h2, h3 { line-height: 1.4; margin: 0 0 var(--space-3); }
h1 { font-size: var(--fs-2xl); } h2 { font-size: var(--fs-xl); } h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; border-radius: 4px; }
.ltr { direction: ltr; unicode-bidi: plaintext; text-align: left; }
.muted { color: var(--color-text-muted); }
.small { font-size: var(--fs-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: var(--space-3); top: -60px; background: var(--color-surface); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: var(--space-3); }

/* ===== Layout ===== */
.container { width: 100%; max-width: var(--content-w); margin-inline: auto; padding-inline: var(--space-4); }
.page { padding-block: var(--space-5); }
.stack > * + * { margin-top: var(--space-4); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* ===== Header ===== */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: var(--space-4); }
.brand { font-weight: 700; font-size: var(--fs-lg); color: var(--color-text); display: flex; align-items: center; gap: var(--space-2); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--color-primary); color: var(--color-on-primary); display: grid; place-items: center; font-size: 15px; }
.top-nav { display: none; gap: var(--space-1); }
.top-nav a { color: var(--color-text-muted); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-weight: 500; }
.top-nav a[aria-current="page"], .top-nav a:hover { color: var(--color-primary); background: var(--color-primary-soft); text-decoration: none; }
@media (min-width: 900px) { .top-nav { display: flex; } }

/* ===== Bottom navigation (mobile) ===== */
.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--color-surface); border-top: 1px solid var(--color-border);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--color-text-muted); font-size: 11px; font-weight: 500; }
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav a[aria-current="page"] { color: var(--color-primary); }
.bottom-nav svg { width: 22px; height: 22px; }
@media (min-width: 900px) { .bottom-nav { display: none; } body { padding-bottom: 0; } }

/* ===== Card ===== */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-4); box-shadow: var(--shadow); }
.card-title { font-size: var(--fs-lg); font-weight: 700; margin: 0 0 var(--space-2); }
.card-narrow { max-width: 420px; margin-inline: auto; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-5);
  border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-surface-2); }
.btn-ghost { background: transparent; color: var(--color-primary); }
.btn-ghost:hover { background: var(--color-primary-soft); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 var(--space-3); font-size: var(--fs-sm); }
.btn[disabled], .btn.htmx-request { opacity: .6; pointer-events: none; }
.btn .spinner { display: none; }
.btn.htmx-request .spinner, form.htmx-request .btn .spinner { display: inline-block; }

.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Forms ===== */
.field { margin-bottom: var(--space-4); }
.field label, .label { display: block; font-weight: 500; margin-bottom: var(--space-1); }
.input, .field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=number], .field input[type=password], .field input[type=url], .field input[type=search], .field textarea, .field select {
  width: 100%; min-height: 46px; padding: var(--space-2) var(--space-3); font: inherit; color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }
.field .help { color: var(--color-text-muted); font-size: var(--fs-sm); margin-top: var(--space-1); }
.field .error, .errorlist { color: var(--color-danger); font-size: var(--fs-sm); margin: var(--space-1) 0 0; padding: 0; list-style: none; }
.field.has-error input, .field.has-error textarea { border-color: var(--color-danger); }
.check { display: flex; gap: var(--space-2); align-items: center; }
.check input { width: 18px; height: 18px; accent-color: var(--color-primary); }
.otp-input { text-align: center; letter-spacing: .6em; font-size: var(--fs-xl) !important; font-weight: 700; }

/* ===== Alerts / toasts ===== */
.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); margin-bottom: var(--space-4); border: 1px solid transparent; }
.alert-success { background: var(--color-success-soft); color: var(--color-success); }
.alert-error { background: var(--color-danger-soft); color: var(--color-danger); }
.alert-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.alert-info { background: var(--color-primary-soft); color: var(--color-primary); }
.toasts { position: fixed; inset-inline: var(--space-4); bottom: calc(var(--nav-h) + var(--space-4)); z-index: 60; display: grid; gap: var(--space-2); pointer-events: none; }
.toasts .alert { box-shadow: var(--shadow); pointer-events: auto; margin: 0; animation: toast-in .25s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (min-width: 900px) { .toasts { inset-inline: auto var(--space-5); bottom: var(--space-5); width: 360px; } }

/* ===== Badge ===== */
.badge { display: inline-flex; align-items: center; padding: 0 var(--space-2); border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 22px; background: var(--color-surface-2); color: var(--color-text-muted); }
.badge-success { background: var(--color-success-soft); color: var(--color-success); }
.badge-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-soft); color: var(--color-danger); }
.badge-primary { background: var(--color-primary-soft); color: var(--color-primary); }

/* ===== Table → cards on mobile ===== */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: var(--space-3); text-align: start; border-bottom: 1px solid var(--color-border); }
.table th { color: var(--color-text-muted); font-weight: 500; font-size: var(--fs-sm); }
@media (max-width: 639px) {
  .table-responsive thead { display: none; }
  .table-responsive tr { display: block; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
  .table-responsive td { display: flex; justify-content: space-between; gap: var(--space-3); border: 0; padding: var(--space-1) 0; }
  .table-responsive td::before { content: attr(data-label); color: var(--color-text-muted); font-size: var(--fs-sm); }
}

/* ===== List menu (account sections) ===== */
.menu-list { list-style: none; margin: 0; padding: 0; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.menu-list li + li { border-top: 1px solid var(--color-border); }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: var(--space-4); color: var(--color-text); background: none; border: 0; font: inherit; cursor: pointer; text-align: start; }
.menu-list a:hover, .menu-list button:hover { background: var(--color-surface-2); text-decoration: none; }
.menu-list .chev { margin-inline-start: auto; color: var(--color-text-muted); }

/* ===== Empty state / skeleton ===== */
.empty { text-align: center; padding: var(--space-6) var(--space-4); color: var(--color-text-muted); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto var(--space-3); border-radius: 50%; background: var(--color-surface-2); display: grid; place-items: center; }
.empty h3 { color: var(--color-text); }
.skeleton { background: linear-gradient(90deg, var(--color-surface-2) 25%, var(--color-border) 50%, var(--color-surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-sm); min-height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ===== Tabs ===== */
.tabs { display: flex; gap: var(--space-1); overflow-x: auto; border-bottom: 1px solid var(--color-border); margin-bottom: var(--space-4); scrollbar-width: none; }
.tabs a { padding: var(--space-3) var(--space-4); color: var(--color-text-muted); white-space: nowrap; border-bottom: 2px solid transparent; font-weight: 500; }
.tabs a[aria-current="page"] { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tabs a:hover { text-decoration: none; color: var(--color-primary); }

/* ===== Hero (home placeholder until CMS) ===== */
.hero { padding: var(--space-7) 0 var(--space-6); }
.hero h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
.hero p { color: var(--color-text-muted); font-size: var(--fs-lg); max-width: 640px; }

.offline-banner { display: none; background: var(--color-warning-soft); color: var(--color-warning); text-align: center; padding: var(--space-2); font-size: var(--fs-sm); }
body.is-offline .offline-banner { display: block; }

/* ===== Panel ===== */
.panel-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.panel-nav nav { display: flex; gap: var(--space-1); overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--color-border); }
.panel-nav a { padding: var(--space-2) var(--space-3); white-space: nowrap; color: var(--color-text-muted); border-radius: var(--radius-sm); font-weight: 500; }
.panel-nav a[aria-current="page"] { color: var(--color-primary); background: var(--color-primary-soft); }
.panel-nav a:hover { text-decoration: none; color: var(--color-primary); }
.panel-nav-title { display: none; }
@media (min-width: 960px) {
  .panel-layout { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .panel-nav { position: sticky; top: 72px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-3); }
  .panel-nav nav { flex-direction: column; border: 0; }
  .panel-nav-title { display: block; padding: 0 var(--space-3) var(--space-2); }
}
.panel-main, .panel-nav { min-width: 0; }
.be-input, .input { max-width: 100%; }
.editor-layout { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .editor-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.action-card { display: flex; align-items: center; gap: var(--space-3); color: var(--color-text); }
.action-card:hover { text-decoration: none; border-color: var(--color-primary); }
.action-card .chev { margin-inline-start: auto; }
.action-count { min-width: 44px; height: 44px; border-radius: 12px; background: var(--color-warning-soft); color: var(--color-warning); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-lg); }
.stat { font-size: var(--fs-2xl); font-weight: 700; }
.check-list { display: grid; gap: var(--space-2); }
.check-list > div, .check-list label { display: flex; gap: var(--space-2); align-items: center; }
.check-list ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.check-list input { width: 18px; height: 18px; accent-color: var(--color-primary); }
details.card > summary { list-style: none; } details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: " ▾"; color: var(--color-text-muted); }
.be-list { display: grid; gap: var(--space-3); margin-bottom: var(--space-3); }
.be-block { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: var(--space-3); background: var(--color-surface); display: grid; gap: var(--space-2); }
.be-head { display: flex; align-items: center; gap: var(--space-2); }
.be-handle { cursor: grab; color: var(--color-text-muted); letter-spacing: -2px; padding: 0 var(--space-1); }
.be-tools { margin-inline-start: auto; display: flex; }
.be-input { width: 100%; padding: var(--space-2) var(--space-3); line-height: 1.8; }
textarea.be-input { min-height: 90px; resize: vertical; }
.be-add { display: flex; flex-wrap: wrap; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px dashed var(--color-border); }
.be-thumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.be-thumb { display: grid; gap: 2px; justify-items: center; }
.be-thumb img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; }
.stack[style*="--gap"] > * + * { margin-top: var(--gap); }

/* ===== Academy ===== */
.progress { height: 8px; border-radius: 99px; background: var(--color-surface-2); overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: var(--color-primary); border-radius: 99px; }
.session-list { list-style: none; margin: var(--space-3) 0; padding: 0; display: grid; gap: var(--space-1); min-height: 8px; }
.session-row { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg); flex-wrap: wrap; }
.chapter-tools summary { list-style: none; } .chapter-tools summary::-webkit-details-marker { display: none; }
.syllabus { list-style: none; padding: 0; margin: 0; }
.syllabus-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); color: var(--color-text); }
.syllabus-row:hover { text-decoration: none; }
a.syllabus-row:hover .s-title { color: var(--color-primary); }
.s-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--color-surface-2); flex: none; font-size: 14px; }
.s-icon.done { background: var(--color-success-soft); color: var(--color-success); }
.s-icon.open { background: var(--color-primary-soft); color: var(--color-primary); }
.s-title { flex: 1; min-width: 0; }
.course-hero { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); margin-bottom: var(--space-5); }
@media (min-width: 900px) { .course-hero { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.course-cover { width: 100%; border-radius: var(--radius); aspect-ratio: 16/9; object-fit: cover; background: var(--color-primary-soft); }
.price { font-size: var(--fs-xl); font-weight: 700; }
.player-nav { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); }
.cond { display: flex; gap: var(--space-2); align-items: center; font-size: var(--fs-sm); }
.quiz-q { margin-bottom: var(--space-4); }
.quiz-q label { display: flex; gap: var(--space-2); align-items: center; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin-top: var(--space-2); cursor: pointer; }
.quiz-q label:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-soft); }

/* ===== Feed ===== */
.feed-search { display: grid; grid-template-columns: 1fr; gap: var(--space-2); margin-bottom: var(--space-3); }
.input { min-height: 44px; padding: 0 var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text); font: inherit; }
@media (min-width: 640px) { .feed-search { grid-template-columns: 1fr auto auto auto; } }
.chips { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-2); margin-bottom: var(--space-3); scrollbar-width: none; flex-wrap: nowrap; }
.chips-select { flex-wrap: wrap; overflow: visible; }
.chip { display: inline-flex; align-items: center; gap: var(--space-1); white-space: nowrap; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font-size: var(--fs-sm); cursor: pointer; }
.chip:hover { text-decoration: none; border-color: var(--color-primary); }
.chip[aria-current="page"], .chip:has(input:checked) { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.chip input { accent-color: var(--color-primary); }
.a-list { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 720px) { .a-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .a-list { grid-template-columns: repeat(3, 1fr); } }
.a-list .load-more { grid-column: 1 / -1; }
.a-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.a-card-link { display: grid; grid-template-columns: 96px 1fr; gap: var(--space-3); padding: var(--space-3); color: inherit; height: 100%; }
.a-card-link:hover { text-decoration: none; }
.a-card-link:hover .a-card-title { color: var(--color-primary); }
.a-card-img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-sm); background: var(--color-surface-2); }
.a-card-img-empty { display: grid; place-items: center; font-size: 28px; font-weight: 700; color: var(--color-primary); background: var(--color-primary-soft); }
@media (min-width: 720px) {
  .a-card-link { grid-template-columns: 1fr; padding: 0; }
  .a-card-img { width: 100%; height: 170px; border-radius: 0; }
  .a-card-body { padding: 0 var(--space-4) var(--space-4); }
}
.a-card-meta { display: flex; gap: var(--space-1); margin-bottom: 2px; }
.a-card-title { font-size: var(--fs); margin: 0 0 2px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.a-card-summary { font-size: var(--fs-sm); color: var(--color-text-muted); margin: 0 0 var(--space-1); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.a-card-foot { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.pagination { justify-content: center; margin-top: var(--space-5); }

/* ===== Article ===== */
.prose-wrap { max-width: 760px; margin-inline: auto; }
.article-title { font-size: clamp(1.35rem, 3.5vw, 2rem); margin-top: var(--space-2); }
.article-meta { border-bottom: 1px solid var(--color-border); padding-bottom: var(--space-3); margin-bottom: var(--space-4); }
.article-cover { width: 100%; border-radius: var(--radius); margin-bottom: var(--space-4); }
.article-lead { font-size: var(--fs-lg); font-weight: 500; }
.prose { font-size: 1.0625rem; line-height: 2; }
.prose h2 { margin-top: var(--space-6); } .prose h3 { margin-top: var(--space-5); }
.prose p { margin-bottom: var(--space-4); }
.prose figure { margin: var(--space-5) 0; } .prose figure img, .prose video { width: 100%; border-radius: var(--radius-sm); }
.prose figcaption { color: var(--color-text-muted); font-size: var(--fs-sm); text-align: center; margin-top: var(--space-2); }
.prose audio { width: 100%; }
.prose blockquote { margin: var(--space-5) 0; padding: var(--space-3) var(--space-4); border-inline-start: 4px solid var(--color-accent); background: var(--color-surface-2); border-radius: var(--radius-sm); }
.prose ul, .prose ol { padding-inline-start: var(--space-5); }
.prose hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-6) 0; }
.prose .gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
.prose .embed { position: relative; aspect-ratio: 16 / 9; } .prose .embed iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius-sm); }
.table-scroll { overflow-x: auto; margin: var(--space-4) 0; }
.link-card, .file-card { display: block; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); }
.locked { position: relative; text-align: center; padding: var(--space-6) var(--space-4); }
.locked-fade { position: absolute; inset-inline: 0; top: -80px; height: 80px; background: linear-gradient(to bottom, transparent, var(--color-bg)); }

/* ===== Auth pages ===== */
.auth-body {
  padding: 0; min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(900px 500px at 85% -10%, color-mix(in srgb, var(--color-primary) 16%, transparent), transparent 60%),
    radial-gradient(700px 420px at 0% 110%, color-mix(in srgb, var(--color-accent) 14%, transparent), transparent 60%),
    var(--color-bg);
}
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--space-6) var(--space-4); }
.auth-card {
  width: 100%; max-width: 440px; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 28px; padding: var(--space-6) var(--space-5) var(--space-5);
  box-shadow: 0 1px 2px rgba(16, 24, 20, .04), 0 24px 60px -24px rgba(15, 92, 77, .28);
}
@media (min-width: 480px) { .auth-card { padding: var(--space-7) var(--space-6) var(--space-5); } }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--color-text); margin-bottom: var(--space-5); }
.auth-brand:hover { text-decoration: none; }
.auth-logo {
  width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; color: #fff; margin-bottom: var(--space-2);
  background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 60%, #3fb39a));
  box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--color-primary) 70%, transparent);
}
.auth-site { font-size: var(--fs-xl); font-weight: 700; color: var(--color-primary); }
.auth-tagline { font-size: 12px; color: var(--color-text-muted); }
.auth-title { font-size: 1.5rem; text-align: center; margin: 0 0 var(--space-2); }
.auth-sub { text-align: center; color: var(--color-text-muted); font-size: var(--fs-sm); margin-bottom: var(--space-5); }
.auth-input { position: relative; }
.auth-input input { padding-left: 44px !important; padding-right: 14px !important; border-radius: 14px !important; min-height: 52px !important; background: var(--color-surface) !important; }
.auth-input input:focus { border-color: var(--color-primary) !important; box-shadow: 0 0 0 4px var(--color-primary-soft) !important; }
.auth-input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--color-text-muted); pointer-events: none; }
.auth-input-icon svg { width: 20px; height: 20px; }
.auth-input:focus-within .auth-input-icon { color: var(--color-primary); }
.auth-btn {
  min-height: 54px; border-radius: 14px; font-size: var(--fs-lg); font-weight: 700; margin-top: var(--space-2);
  background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 65%, #3fb39a));
  box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--color-primary) 80%, transparent);
}
.auth-btn:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 65%, #3fb39a)); }
.auth-card .otp-input { width: 100%; min-height: 56px; border: 1px solid var(--color-border); border-radius: 14px; background: var(--color-surface); color: var(--color-text); }
.auth-card .otp-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-soft); }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin: calc(-1 * var(--space-2)) 0 var(--space-3); }
.auth-divider { display: flex; align-items: center; gap: var(--space-3); color: var(--color-text-muted); font-size: var(--fs-sm); margin: var(--space-5) 0 var(--space-3); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.auth-links { text-align: center; font-size: var(--fs-sm); color: var(--color-text-muted); margin-top: var(--space-4); }
.auth-links p { margin: 0 0 var(--space-2); }
.auth-links a { font-weight: 500; }
.auth-resend { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-3); }
.auth-back { text-align: center; margin: var(--space-4) 0 0; font-size: 12px; }
.auth-back a { color: var(--color-text-muted); }
.auth-body .toasts { bottom: var(--space-4); }

@media (max-width: 480px) { .hide-sm { display: none; } }

/* ===== Support ===== */
.bell { position: relative; padding: 0 var(--space-2); }
.bell-count { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; border-radius: 9px; background: var(--color-danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; padding: 0 4px; }
.thread { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.msg { padding: var(--space-3) var(--space-4); border-radius: var(--radius); border: 1px solid var(--color-border); background: var(--color-surface); max-width: 92%; }
.msg-user { justify-self: start; }
.msg-staff { justify-self: end; background: var(--color-primary-soft); border-color: transparent; }
.msg-internal { background: var(--color-warning-soft); border-style: dashed; }
.qa-item { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.qa-item .msg { max-width: 100%; margin-top: 6px; }
.stars { color: var(--color-accent); letter-spacing: 1px; }

/* ===== Lesson page ===== */
.lesson-layout { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .lesson-layout { grid-template-columns: 300px minmax(0, 1fr); } }
.lesson-outline { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-4); }
@media (min-width: 1000px) { .lesson-outline { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow-y: auto; } }
.lesson-back { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); font-weight: 500; margin-bottom: var(--space-2); }
.lesson-course { font-weight: 700; }
.outline-toggle { margin-top: var(--space-3); }
.outline-toggle > summary { cursor: pointer; font-weight: 500; font-size: var(--fs-sm); color: var(--color-text-muted); list-style: none; }
.outline-toggle > summary::-webkit-details-marker { display: none; }
.outline-toggle > summary::after { content: " ▾"; }
@media (min-width: 1000px) { .outline-toggle > summary { display: none; } }
.outline-chapter { font-size: 12px; font-weight: 700; color: var(--color-text-muted); margin: var(--space-3) 0 var(--space-1); }
.outline-list { list-style: none; margin: 0; padding: 0; }
.outline-item { display: flex; align-items: center; gap: var(--space-2); padding: 8px; border-radius: var(--radius-sm); color: var(--color-text); font-size: var(--fs-sm); }
a.outline-item:hover { background: var(--color-surface-2); text-decoration: none; }
.outline-item.is-current { background: var(--color-primary-soft); font-weight: 700; }
.outline-item.is-locked { color: var(--color-text-muted); cursor: not-allowed; }
.outline-item .s-icon { width: 26px; height: 26px; font-size: 12px; }
.outline-title { flex: 1; min-width: 0; }
.lesson-main { min-width: 0; }
.lesson-body video, .lesson-body .embed { border-radius: var(--radius); overflow: hidden; background: #000; }
.lesson-progress { margin-top: var(--space-4); }
.cond-list { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; gap: var(--space-2); }
.cond { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); color: var(--color-text-muted); }
.cond-box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--color-border); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; transition: all .2s; }
.cond.is-ok { color: var(--color-text); }
.cond.is-ok .cond-box { background: var(--color-success); border-color: var(--color-success); }
.lesson-nav { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); }
@media (max-width: 899px) {
  .lesson-nav { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); background: var(--color-surface); padding: var(--space-2); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--color-border); z-index: 20; }
}
.btn.is-disabled { opacity: .45; cursor: not-allowed; }
.lesson-next-hint { text-align: end; margin-top: 4px; }
.btn.pulse { animation: pulse 1.2s ease-out 3; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }

/* ===== Course page ===== */
.course-page { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .course-page { grid-template-columns: minmax(0, 1fr) 340px; } }
.course-main { min-width: 0; }
.course-aside { order: -1; }
@media (min-width: 960px) { .course-aside { order: 0; position: sticky; top: 76px; } }
.price-card .price { font-size: 1.6rem; }
.price-facts { list-style: none; margin: var(--space-4) 0 0; padding: var(--space-3) 0 0; border-top: 1px solid var(--color-border); display: grid; gap: var(--space-2); font-size: var(--fs-sm); }
.price-facts li { display: flex; justify-content: space-between; gap: var(--space-2); color: var(--color-text-muted); }
.price-facts strong { color: var(--color-text); font-weight: 500; }
.chip-static { cursor: default; background: var(--color-surface-2); }
.wish-btn { color: var(--color-text-muted); }
.wish-btn.is-on { color: var(--color-danger); }

/* ===== File picker ===== */
.dz-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--space-4); border: 2px dashed var(--color-border); border-radius: var(--radius); background: var(--color-surface-2); color: var(--color-text-muted); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary); }
.dropzone .dz-title { font-weight: 700; color: var(--color-text); }
.dropzone .dz-hint { font-size: 12px; }
.dz-files { display: grid; gap: var(--space-2); margin-top: var(--space-2); }
.dz-file { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); }
.dz-file img, .dz-file video { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: #000; }
.dz-icon { width: 48px; text-align: center; font-size: 22px; }
.dz-meta { font-size: var(--fs-sm); word-break: break-all; }
.be-bar { height: 6px; border-radius: 99px; background: var(--color-surface-2); overflow: hidden; margin-top: 6px; }
.be-bar > span { display: block; height: 100%; width: 0; background: var(--color-primary); transition: width .2s; }
.be-video { width: 100%; max-width: 360px; border-radius: 8px; background: #000; }
.be-thumbs audio { width: 100%; max-width: 360px; }

/* ===== Card-to-card ===== */
.steps { padding-inline-start: var(--space-5); margin: 0 0 var(--space-4); }
.copy-row { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); font: inherit; color: inherit; cursor: pointer; text-align: start; }
.copy-row .price { margin-inline-start: auto; font-size: var(--fs-xl); }
.copy-row:hover { border-color: var(--color-primary); }
.copy-hint { font-size: 12px; color: var(--color-primary); font-weight: 500; }
.copied .copy-hint::after { content: " ✓"; }
.bank-card { color: #fff; border-radius: 18px; padding: var(--space-4) var(--space-5); display: grid; gap: var(--space-3); margin-bottom: var(--space-3);
  background: linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 55%, #1d2b64)); box-shadow: 0 16px 32px -16px color-mix(in srgb, var(--color-primary) 80%, transparent); }
.bank-card-number { display: grid; gap: 2px; justify-items: center; background: rgba(255,255,255,.12); border: 1px dashed rgba(255,255,255,.5); border-radius: 12px; padding: var(--space-3); color: #fff; font: inherit; cursor: pointer; }
.bank-card-number span[dir] { font-size: 1.45rem; font-weight: 700; letter-spacing: 2px; }
.bank-card-number .copy-hint { color: rgba(255,255,255,.85); }
.bank-card-number:hover { background: rgba(255,255,255,.2); }

[hidden] { display: none !important; }

.ribbon { flex: none; font-size: 11px; font-weight: 700; line-height: 1; padding: 4px 8px; border-radius: 6px 0 0 6px; margin-inline-end: -8px; background: var(--color-warning-soft); color: var(--color-warning); }
.plan-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin: var(--space-2) 0; }
.plan-table th, .plan-table td { padding: 6px 8px; border-bottom: 1px solid var(--color-border); text-align: start; }
.plan-table th { color: var(--color-text-muted); font-weight: 500; }
.plan-card { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: var(--space-3); margin-bottom: var(--space-3); }
.step-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: var(--space-2); align-items: end; margin-bottom: var(--space-2); }
.step-row label { font-size: 12px; color: var(--color-text-muted); }
.step-row .input { width: 100%; min-height: 40px; }
@media (max-width: 520px) { .step-row { grid-template-columns: 1fr 1fr; } }

.qa-thread { display: grid; gap: 6px; }
.qa-reply { margin-top: 6px; }
.qa-reply > summary { cursor: pointer; color: var(--color-primary); list-style: none; display: inline-block; }
.qa-reply > summary::-webkit-details-marker { display: none; }
.qa-reply[open] > summary { margin-bottom: 6px; }

.plan-builder > summary { cursor: pointer; list-style: none; margin: 0; color: var(--color-primary); }
.plan-builder > summary::-webkit-details-marker { display: none; }
.plan-builder[open] > summary { margin-bottom: var(--space-3); color: var(--color-text); }
.plan-preview { background: var(--color-surface-2); border-radius: var(--radius-sm); padding: var(--space-3); margin: var(--space-3) 0; }
.plan-advanced { margin: var(--space-2) 0; }
.plan-advanced > summary { cursor: pointer; color: var(--color-primary); }
.plan-advanced[open] > summary { margin-bottom: var(--space-2); }

.panel-nav a { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.nav-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--color-danger); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

/* ===== Market & dashboard widgets ===== */
.widgets { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 760px) { .widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .widgets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.widget-wide { grid-column: 1 / -1; }
.widget .card-title { margin-bottom: var(--space-2); }
.widget-row-link { display: block; padding: 8px 0; border-bottom: 1px solid var(--color-border); color: var(--color-text); }
.widget-row-link:last-child { border-bottom: 0; }
.widget-row-link:hover { text-decoration: none; color: var(--color-primary); }
.price-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--space-2); align-items: center; padding: 8px 0; border-bottom: 1px solid var(--color-border); color: var(--color-text); }
.price-row:hover { text-decoration: none; background: var(--color-surface-2); }
.price-row .badge { grid-column: 1 / -1; justify-self: start; }
.price-val, .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.price-chg { font-size: var(--fs-sm); font-weight: 700; direction: ltr; unicode-bidi: plaintext; }
.price-chg.up { color: var(--color-up); } .price-chg.down { color: var(--color-down); } .price-chg.flat { color: var(--color-text-muted); }
.spark { width: 100%; height: 200px; display: block; background: var(--color-surface-2); border-radius: var(--radius-sm); }
.widget-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.widget-row { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); }
.market-grid { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mrow { padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.mrow:last-child { border-bottom: 0; }
.mrow-main { display: grid; grid-template-columns: 1fr auto auto; gap: var(--space-3); align-items: center; color: var(--color-text); }
.mrow-main:hover { text-decoration: none; }
.mrow-main:hover strong { color: var(--color-primary); }
.mrow-name { display: flex; flex-direction: column; }
.mrow-price { font-weight: 700; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.mrow-meta { display: flex; align-items: center; gap: var(--space-2); margin-top: 4px; }
.mrow-meta .btn { min-height: 28px; }

/* ===== CMS sections ===== */
.cms-main { padding: 0; }
.cms-sec { background-size: cover; background-position: center; position: relative; }
.cms-sec.pad-s { padding: var(--space-5) 0; } .cms-sec.pad-m { padding: var(--space-7) 0; } .cms-sec.pad-l { padding: calc(var(--space-7) * 1.8) 0; }
.cms-sec.bg-soft { background-color: var(--color-primary-soft); } .cms-sec.bg-surface { background-color: var(--color-surface); }
.cms-sec.bg-primary { background-color: var(--color-primary); color: var(--color-on-primary); }
.cms-sec.bg-accent { background-color: var(--color-accent); color: #fff; }
.cms-sec.bg-dark { background-color: #13201c; color: #e6ece9; }
.cms-sec.bg-primary .cms-lead, .cms-sec.bg-dark .cms-lead, .cms-sec.bg-accent .cms-lead { color: inherit; opacity: .9; }
.cms-sec.bg-primary .btn-primary, .cms-sec.bg-accent .btn-primary { background: #fff; color: var(--color-primary); }
.cms-sec.align-center { text-align: center; } .cms-sec.align-center .row { justify-content: center; }
.cms-title { font-size: clamp(1.3rem, 3vw, 1.8rem); }
.cms-lead { color: var(--color-text-muted); font-size: var(--fs-lg); max-width: 720px; }
.align-center .cms-lead { margin-inline: auto; }
.cms-hero { display: grid; gap: var(--space-5); align-items: center; }
.cms-hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.6rem); }
.cms-hero-img { width: 100%; border-radius: var(--radius-lg); }
@media (min-width: 860px) {
  .cms-hero.has-img.layout-2 { grid-template-columns: 1.1fr 1fr; }
  .cms-hero.has-img.layout-3 { grid-template-columns: 1fr 1.1fr; } .cms-hero.has-img.layout-3 .cms-hero-img { order: -1; }
}
.cms-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.align-center .cms-cta { flex-direction: column; justify-content: center; }
.cms-cols { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .cms-cols.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cms-cols.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cms-col img { width: 100%; border-radius: var(--radius); margin-bottom: var(--space-3); }
.cms-figure img { width: 100%; border-radius: var(--radius); }
.cms-gallery { display: grid; gap: var(--space-2); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .cms-gallery { grid-template-columns: repeat(4, 1fr); } }
.cms-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }
.cms-cards { display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .cms-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
a.cms-card { color: inherit; } a.cms-card:hover { text-decoration: none; border-color: var(--color-primary); }
.cms-sec[class*="bg-primary"] .card, .cms-sec[class*="bg-dark"] .card { color: var(--color-text); }
.cms-faq { display: grid; gap: var(--space-2); max-width: 820px; } .align-center .cms-faq { margin-inline: auto; text-align: start; }
.cms-faq summary { cursor: pointer; }
.cms-quote { margin: 0; }
.cms-countdown { display: inline-flex; align-items: baseline; gap: 6px; font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cms-countdown small { font-size: var(--fs-sm); font-weight: 400; opacity: .8; margin-inline-end: 10px; }
.cms-contact { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cms-contact .card { display: grid; gap: 4px; color: var(--color-text); }
.is-hidden-preview { opacity: .45; outline: 2px dashed var(--color-warning); }
.cms-hidden-note { position: absolute; top: 6px; inset-inline-start: 6px; font-size: 12px; background: var(--color-warning-soft); color: var(--color-warning); padding: 2px 8px; border-radius: 6px; z-index: 2; }
.preview-bar { position: sticky; top: 56px; z-index: 25; background: var(--color-warning-soft); color: var(--color-warning); text-align: center; padding: 6px; font-size: var(--fs-sm); }
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: var(--space-6) 0 var(--space-5); margin-top: var(--space-6); font-size: var(--fs-sm); }
.site-footer .footer-grid { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .site-footer .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer a { color: var(--color-text-muted); } .site-footer a:hover { color: var(--color-primary); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

.site-footer .footer-links { display: grid; gap: 6px; align-content: start; }
.brand-logo { height: 32px; width: auto; border-radius: 6px; }
/* page builder editor */
.pb-list { display: grid; gap: var(--space-3); }
.pb-sec { border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); }
.pb-sec.is-hidden { opacity: .6; }
.pb-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; }
.pb-head .pb-grip { cursor: grab; color: var(--color-text-muted); touch-action: none; }
.pb-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-body { padding: 0 12px 12px; display: grid; gap: 10px; }
.pb-sec:not(.open) .pb-body { display: none; }
.pb-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.pb-seg { display: inline-flex; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.pb-seg button { border: 0; background: none; padding: 6px 10px; font: inherit; cursor: pointer; }
.pb-seg button[aria-pressed="true"] { background: var(--color-primary); color: var(--color-on-primary); }
.pb-item { border: 1px dashed var(--color-border); border-radius: 8px; padding: 8px; display: grid; gap: 6px; }
.pb-thumb { max-height: 80px; border-radius: 6px; }
.pb-add { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pb-add button { text-align: start; }

/* ================= App shell ================= */
.site-header { background: var(--glass); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--color-border); }
.brand-mark { background: var(--grad); border-radius: 10px; color: #fff; }
.btn { border-radius: 999px; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; }
.card { border-radius: var(--radius-lg); }
.theme-toggle { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); cursor: pointer; padding: 0; }
.theme-toggle svg { width: 18px; height: 18px; }

/* floating glass bottom bar */
.bottom-nav {
  inset-inline: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 62px; padding: 0 6px;
  border-radius: 22px; border: 1px solid var(--color-border); background: var(--glass);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); box-shadow: 0 10px 30px rgba(10, 12, 30, .18);
}
.bottom-nav a { border-radius: 16px; margin: 6px 2px; transition: background .15s, color .15s; }
.bottom-nav a[aria-current="page"] { color: var(--color-primary); background: var(--color-primary-soft); }
body { padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body { padding-bottom: 0; } }

/* ================= Home ================= */
.app-main { padding: 0; }
.app-wrap { max-width: var(--content-w); margin: 0 auto; padding: var(--space-4) var(--space-4) var(--space-6); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
.app-wrap > * { min-width: 0; }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-hello { font-size: 1.5rem; font-weight: 700; margin: 0; line-height: 1.3; }
.home-date { margin: 2px 0 0; color: var(--color-text-muted); font-size: var(--fs-sm); }
.chip-btn { padding: 8px 14px; border-radius: 999px; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text); font-weight: 500; font-size: var(--fs-sm); white-space: nowrap; }
.chip-btn:hover { text-decoration: none; border-color: var(--color-primary); }
.chip-primary { background: var(--grad); color: #fff; border-color: transparent; }

.hero-card { position: relative; border-radius: 26px; padding: 18px 18px 6px; color: #fff; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, #7c6cff 0%, #4f46e5 45%, #1e1b4b 100%); box-shadow: 0 18px 40px rgba(79, 70, 229, .35); }
.hero-card::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .08); pointer-events: none; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: relative; z-index: 1; }
.hero-name { opacity: .85; font-size: var(--fs-sm); }
.hero-price { font-size: 2.3rem; font-weight: 700; line-height: 1.2; letter-spacing: -.5px; }
.hero-price small { font-size: 1rem; margin-inline-start: 2px; opacity: .85; }
.hero-unit { font-size: .85rem; font-weight: 400; opacity: .75; }
.hero-chg { display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 999px; font-size: var(--fs-sm); background: rgba(255, 255, 255, .16); direction: ltr; }
.hero-chg.up { color: #86efac; } .hero-chg.down { color: #fda4af; }
.seg { display: inline-flex; background: rgba(255, 255, 255, .14); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; color: #fff; padding: 5px 12px; border-radius: 999px; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: #312e81; font-weight: 700; }
.hero-chart { position: relative; height: 170px; margin: 8px -18px 0; color: #fff; --color-up: #86efac; --color-down: #fda4af; }
.hero-chart svg { width: 100%; height: 100%; display: block; touch-action: pan-y; }
.hero-empty { text-align: center; opacity: .75; padding-top: 60px; margin: 0; font-size: var(--fs-sm); }
.hero-tip { position: absolute; top: 4px; transform: translateX(-50%); background: rgba(15, 18, 34, .85); color: #fff; padding: 3px 8px; border-radius: 8px; font-size: 12px; white-space: nowrap; pointer-events: none; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-3); }
.sec-head h2 { font-size: 1.15rem; margin: 0; }
.sec-head a { font-size: var(--fs-sm); color: var(--color-text-muted); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { position: relative; text-align: start; font: inherit; color: var(--color-text); cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 148px;
  padding: 14px; border-radius: 22px; background: var(--color-surface); border: 1.5px solid transparent; box-shadow: var(--shadow); transition: transform .12s, border-color .15s; }
.tile:active { transform: scale(.98); }
.tile.is-active { border-color: var(--color-primary); }
.tile-top { display: flex; align-items: center; gap: 8px; margin-bottom: auto; min-width: 0; }
.coin { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 10px; font-weight: 700; letter-spacing: .3px; color: #fff; background: var(--c); direction: ltr; box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .15); }
.tile-name { font-weight: 700; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-chg { font-size: 12px; direction: ltr; text-align: right; font-weight: 500; }
.up { color: var(--color-up); } .down { color: var(--color-down); }
.tile-price { font-size: 1.65rem; font-weight: 700; line-height: 1.15; direction: ltr; text-align: right; letter-spacing: -.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-price small { font-size: .8rem; margin-inline-start: 2px; color: var(--color-text-muted); }
.tile-stale { position: absolute; top: 10px; inset-inline-end: 10px; font-size: 10px; padding: 1px 6px; border-radius: 999px; background: var(--color-warning-soft); color: var(--color-warning); }

.cta-strip { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding: 14px 16px; border-radius: 18px; background: var(--color-primary-soft); color: var(--color-text); border: 1px dashed var(--color-primary); }
.cta-strip:hover { text-decoration: none; }
.cta-strip span { font-size: var(--fs-sm); color: var(--color-text-muted); }

.h-scroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; margin: 0 calc(-1 * var(--space-4)); padding-inline: var(--space-4); scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }
.today-card { flex: 0 0 min(72%, 240px); scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 20px; background: var(--color-surface); box-shadow: var(--shadow); color: var(--color-text); }
.today-card:hover { text-decoration: none; }
.today-card.is-danger { background: var(--color-danger-soft); }
.today-ico { width: 34px; height: 34px; border-radius: 12px; background: var(--grad); margin-bottom: 4px; position: relative; }
.today-ico::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; background: #fff; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.ico-play { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4v16l13-8z'/%3E%3C/svg%3E"); }
.ico-card { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 6h20v12H2zM2 10h20' stroke='black' stroke-width='3' fill='none'/%3E%3C/svg%3E"); }
.ico-check { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m4 12 5 5L20 6' stroke='black' stroke-width='3.5' fill='none'/%3E%3C/svg%3E"); }
.ico-chat { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h18v12H8l-5 4z'/%3E%3C/svg%3E"); }
.today-card .bar { height: 6px; border-radius: 99px; background: var(--color-surface-2); overflow: hidden; margin-top: 4px; }
.today-card .bar span { display: block; height: 100%; background: var(--grad); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--space-4)) 12px; padding-inline: var(--space-4); }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: none; padding: 6px 14px; border-radius: 999px; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text-muted); font-size: var(--fs-sm); font-weight: 500; }
.chips a:hover { text-decoration: none; color: var(--color-text); }
.chips a[aria-current] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }

.feed-list { display: grid; gap: 10px; }
@media (min-width: 760px) { .feed-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feed-item { display: flex; gap: 12px; padding: 10px; border-radius: 20px; background: var(--color-surface); box-shadow: var(--shadow); color: var(--color-text); align-items: center; }
.feed-item:hover { text-decoration: none; }
.feed-item img, .feed-ph { width: 92px; height: 92px; border-radius: 14px; object-fit: cover; flex: none; }
.feed-ph { display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 1.6rem; font-weight: 700; }
.feed-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feed-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--color-primary-soft); color: var(--color-primary); font-weight: 500; }
.pill-gold { background: var(--color-warning-soft); color: var(--color-warning); }
.feed-title { font-size: .98rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-time { font-size: 12px; color: var(--color-text-muted); }
@media (min-width: 900px) { .hero-card { padding: 24px 24px 8px; } .hero-chart { height: 220px; margin: 8px -24px 0; } .hero-price { font-size: 2.8rem; } }
.tile-spark { display: block; height: 28px; margin: 2px 0; direction: ltr; }
.tile-spark svg { width: 100%; height: 100%; display: block; }
.tile { min-height: 170px; }
@media (max-width: 899px) { .site-footer { display: none; } }

/* ================= App layer: every page speaks the same visual language ================= */
.page h1 { font-size: 1.45rem; font-weight: 700; }
.card { border-color: transparent; box-shadow: var(--shadow); }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .a-card { border-color: var(--color-border); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card, :root:not([data-theme="light"]) .a-card { border-color: var(--color-border); } }
.input, select.input, textarea.input { border-radius: 14px; background: var(--color-surface-2); border-color: var(--color-border); }
.input:focus { background: var(--color-surface); }
.badge { border-radius: 999px; }

/* tabs → segmented pills */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; border: 0; padding: 4px; background: var(--color-surface-2); border-radius: 999px; margin-bottom: var(--space-4); width: max-content; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 6px 14px; border-radius: 999px; border: 0; color: var(--color-text-muted); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--color-text); }
.tabs a[aria-current="page"] { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow); border: 0; }

/* chips (feed, catalog filters) */
.chip { padding: 6px 14px; font-weight: 500; color: var(--color-text-muted); }
.chip[aria-current="page"], .chip[aria-current="true"] { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }

/* article cards everywhere */
.a-card { border: 1px solid transparent; border-radius: 20px; }
.a-card-link { grid-template-columns: 92px 1fr; padding: 10px; align-items: center; }
.a-card-img { width: 92px; height: 92px; border-radius: 14px; }
.a-card-img-empty { background: var(--grad); color: #fff; }
.a-card-title { font-size: .98rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0; }
.a-card-summary { display: none; }
@media (min-width: 720px) { .a-card-summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } }
.badge-primary { background: var(--color-primary-soft); color: var(--color-primary); }

/* search bar */
.search-bar { position: relative; display: flex; align-items: center; gap: 8px; background: var(--color-surface); border-radius: 18px; padding: 6px 12px; box-shadow: var(--shadow); }
.search-bar > svg { width: 18px; height: 18px; color: var(--color-text-muted); flex: none; }
.search-bar input[type=search] { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--color-text); padding: 8px 0; outline: none; }
.filter-pop summary { list-style: none; cursor: pointer; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--color-surface-2); color: var(--color-text); }
.filter-pop summary::-webkit-details-marker { display: none; }
.filter-pop summary svg { width: 18px; height: 18px; }
.filter-pop[open] summary { background: var(--color-primary); color: #fff; }
.filter-body { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 20; display: grid; gap: 8px; padding: 12px; border-radius: 18px; background: var(--color-surface); box-shadow: 0 12px 30px rgba(10, 12, 30, .18); }

/* menu list (account, settings) */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 24px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #7c6cff 0%, #4f46e5 50%, #1e1b4b 100%); box-shadow: 0 14px 34px rgba(79, 70, 229, .3); }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; background: rgba(255, 255, 255, .18); flex: none; }
.profile-card .small { opacity: .85; }
.menu-group { background: var(--color-surface); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.menu-group + .menu-group { margin-top: var(--space-3); }
.menu-title { font-size: var(--fs-sm); color: var(--color-text-muted); margin: var(--space-4) 6px var(--space-2); font-weight: 500; }
.menu-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--color-text); border: 0; background: none; width: 100%; font: inherit; text-align: start; cursor: pointer; }
.menu-row + .menu-row { border-top: 1px solid var(--color-border); }
.menu-row:hover { text-decoration: none; background: var(--color-surface-2); }
.menu-ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--color-primary-soft); color: var(--color-primary); }
.menu-ico svg { width: 18px; height: 18px; }
.menu-row .grow { flex: 1; min-width: 0; }
.menu-row .grow small { display: block; color: var(--color-text-muted); font-size: 12px; }
.menu-row .chev { color: var(--color-text-muted); }
.menu-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--color-danger); color: #fff; font-size: 12px; display: grid; place-items: center; }
.menu-row.danger { color: var(--color-danger); }
.menu-row.danger .menu-ico { background: var(--color-danger-soft); color: var(--color-danger); }

/* course cards */
.c-card { border-radius: 22px !important; overflow: hidden; border: 1px solid transparent !important; box-shadow: var(--shadow); }

.course-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .course-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.course-tile { display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; background: var(--color-surface); box-shadow: var(--shadow); color: var(--color-text); }
.course-tile:hover { text-decoration: none; transform: translateY(-2px); transition: transform .15s; }
.course-cover { position: relative; aspect-ratio: 16 / 9; display: block; background: var(--grad); }
.course-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-cover-ph { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 3rem; font-weight: 700; }
.course-level { position: absolute; top: 10px; inset-inline-start: 10px; padding: 2px 10px; border-radius: 999px; background: rgba(15, 18, 34, .6); color: #fff; font-size: 12px; backdrop-filter: blur(6px); }
.course-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.course-title { font-size: 1.05rem; line-height: 1.6; }
.course-desc { font-size: var(--fs-sm); color: var(--color-text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; }
.course-price { font-weight: 700; color: var(--color-primary); }
.course-go { font-size: var(--fs-sm); color: var(--color-text-muted); }

/* ===== Panel: grouped sidebar ===== */
.panel-nav { background: var(--color-surface); border-radius: 22px; box-shadow: var(--shadow); padding: 8px; }
.panel-nav .pnav { display: none; flex-direction: column; gap: 2px; border: 0; overflow: visible; }
.panel-nav .pnav.is-open { display: flex; }
.pnav-mobile summary { list-style: none; cursor: pointer; padding: 10px 12px; font-weight: 700; border-radius: 14px; }
.pnav-mobile summary::-webkit-details-marker { display: none; }
.pnav a, .pnav-group summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 12px; color: var(--color-text-muted); font-weight: 500; font-size: var(--fs-sm); }
.pnav a:hover { text-decoration: none; background: var(--color-surface-2); color: var(--color-text); }
.pnav a[aria-current="page"] { background: var(--color-primary-soft); color: var(--color-primary); }
.pnav-group summary { list-style: none; cursor: pointer; color: var(--color-text); font-weight: 700; }
.pnav-group summary::-webkit-details-marker { display: none; }
.pnav-group summary::after { content: "‹"; transition: transform .15s; color: var(--color-text-muted); }
.pnav-group[open] summary::after { transform: rotate(-90deg); }
.pnav-group[open] summary .nav-count { display: none; }
.pnav-group a { padding-inline-start: 22px; }
.pnav-top { color: var(--color-text) !important; font-weight: 700 !important; }
@media (min-width: 900px) {
  .panel-nav { border: 0; padding: 10px; }
  .pnav-mobile { display: none; }
  .panel-nav .pnav { display: flex; }
}

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 20px; background: var(--color-surface); box-shadow: var(--shadow); color: var(--color-text); }
.kpi:hover { text-decoration: none; }
.kpi:first-child { background: radial-gradient(120% 140% at 100% 0%, #7c6cff 0%, #4f46e5 50%, #1e1b4b 100%); color: #fff; }
.kpi:first-child .kpi-label, .kpi:first-child .kpi-sub { color: rgba(255, 255, 255, .8); }
.kpi-label { font-size: 12px; color: var(--color-text-muted); }
.kpi-value { font-size: 1.35rem; font-weight: 700; }
.kpi-sub { font-size: 12px; color: var(--color-text-muted); }
.kpi-warn .kpi-value { color: var(--color-warning); }
.kpi-bad .kpi-value { color: var(--color-danger); }
.kpi-good .kpi-value { color: var(--color-success); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; margin-top: 12px; }
.bars span { flex: 1; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--grad); opacity: .85; }
.bars span:hover { opacity: 1; }

/* ===== Footer (desktop only, compact) ===== */
.app-footer { max-width: var(--content-w); margin: var(--space-6) auto var(--space-5); padding: 0 var(--space-4); }
.app-footer-in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; padding: 18px 22px; border-radius: 22px; background: var(--color-surface); box-shadow: var(--shadow); }
.app-footer-brand { display: flex; align-items: center; gap: 10px; }
.app-footer-brand span:not(.brand-mark) { display: block; font-size: 12px; color: var(--color-text-muted); }
.app-footer-links, .app-footer-social { display: flex; gap: 18px; flex-wrap: wrap; font-size: var(--fs-sm); }
.app-footer a { color: var(--color-text-muted); }
.app-footer a:hover { color: var(--color-primary); text-decoration: none; }
.app-footer-social { color: var(--color-text-muted); }
.app-footer-copy { text-align: center; font-size: 12px; color: var(--color-text-muted); margin: 10px 0 0; }
@media (max-width: 899px) { .app-footer { display: none; } }

/* ===== Mobile tab bar pinned to the screen edge (no gap, no bounce) ===== */
html { background: var(--color-bg); }
body { overscroll-behavior-y: none; }
.bottom-nav { inset-inline: 0; bottom: 0; height: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; border-width: 1px 0 0; box-shadow: 0 -6px 24px rgba(10, 12, 30, .10); }
.bottom-nav a { margin: 0 2px; padding: 6px 0; min-height: 52px; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body { padding-bottom: 0; } }
.hero-note { position: relative; z-index: 1; margin: 0 0 10px; font-size: 12px; opacity: .8; }
.pick-list { display: grid; gap: 8px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--color-surface); box-shadow: var(--shadow); }
.pick-row .pb-grip { cursor: grab; }
.save-bar { position: sticky; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 5; }
@media (min-width: 900px) { .save-bar { bottom: 16px; } }
.section-tabs { margin-bottom: var(--space-4); }
.tabs-sub { background: none; padding: 0; gap: 18px; border-bottom: 1px solid var(--color-border); border-radius: 0; width: 100%; }
.tabs-sub a { padding: 8px 2px; border-radius: 0; border-bottom: 2px solid transparent !important; }
.tabs-sub a[aria-current="page"] { background: none; box-shadow: none; color: var(--color-primary); border-bottom-color: var(--color-primary) !important; }

/* ===== Page builder: column sections + blocks ===== */
.cms-sec.bg-gradient { background: radial-gradient(120% 140% at 100% 0%, #7c6cff 0%, #4f46e5 45%, #1e1b4b 100%); color: #fff; }
.cms-sec.bg-gradient .cms-lead { color: inherit; opacity: .85; }
.cms-sec.bg-dark { background-color: #0f1222; }
.cms-w-narrow { max-width: 760px; } .cms-w-wide { max-width: 1320px; } .cms-w-full { max-width: none; }
.cms-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.cms-grid.m-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cms-grid.gap-s { gap: 12px; } .cms-grid.gap-m { gap: 24px; } .cms-grid.gap-l { gap: 40px; }
.cms-grid.va-center { align-items: center; } .cms-grid.va-end { align-items: end; }
@media (min-width: 760px) {
  .cms-grid.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cms-grid.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cms-grid.g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cms-grid.g-5, .cms-grid.g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1040px) {
  .cms-grid.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cms-grid.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cms-grid.g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.cms-gcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cms-gcol.col-bg-card { background: var(--color-surface); color: var(--color-text); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.cms-gcol.col-bg-soft { background: var(--color-primary-soft); color: var(--color-text); border-radius: 22px; padding: 20px; }
.cb-a-center { text-align: center; } .cb-a-end { text-align: end; }
.cb h2, .cb h3, .cb h4 { margin: 0; }
.cb h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
.cb-text p { margin: 0 0 .7em; } .cb-text p:last-child { margin-bottom: 0; }
.cb-text.size-s { font-size: var(--fs-sm); } .cb-text.size-l { font-size: 1.15rem; }
.cb-fig { margin: 0; } .cb-fig img { width: 100%; display: block; }
.cb-fig.shape-round img { border-radius: 20px; } .cb-fig.shape-circle img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; }
.cb-fig figcaption { font-size: 12px; color: var(--color-text-muted); margin-top: 6px; text-align: center; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.cb-list { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; }
.cb-list-check { list-style: none; padding: 0; } .cb-list-check li::before { content: "✓"; color: var(--color-success); font-weight: 700; margin-inline-end: 8px; }
.cb-quote { margin: 0; padding: 16px 20px; border-inline-start: 4px solid var(--color-primary); background: var(--color-primary-soft); color: var(--color-text); border-radius: 14px; }
.cb-quote cite { display: block; margin-top: 8px; font-size: var(--fs-sm); color: var(--color-text-muted); font-style: normal; }
.cb-stat { display: flex; flex-direction: column; } .cb-stat strong { font-size: 2.2rem; line-height: 1.2; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cb-stat span { color: inherit; opacity: .75; }
.cb-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 20px; background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow); height: 100%; }
a.cb-card:hover { text-decoration: none; transform: translateY(-2px); transition: transform .15s; }
.cb-card img { width: 100%; border-radius: 14px; aspect-ratio: 16 / 10; object-fit: cover; }
.cb-card p { margin: 0; color: var(--color-text-muted); font-size: var(--fs-sm); }
.cb-contact { display: grid; gap: 10px; }
.cms-contact-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.cb-contact > a, .cb-contact > div { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 18px; background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow); }
.cb-contact > a:hover { text-decoration: none; }
.cb-contact span { font-size: 12px; color: var(--color-text-muted); }
.cb-social { display: flex; flex-wrap: wrap; gap: 8px; }
.cb-a-center .cb-social { justify-content: center; }
.cb-social a { padding: 8px 16px; border-radius: 999px; background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow); font-size: var(--fs-sm); font-weight: 500; }
.cb-social a:hover { text-decoration: none; color: var(--color-primary); }
.cb-video { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #000; }
.cb-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cb-price { display: flex; flex-direction: column; padding: 16px; border-radius: 20px; background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow); }
.cb-price:hover { text-decoration: none; }
.cb-price span { font-size: var(--fs-sm); color: var(--color-text-muted); } .cb-price strong { font-size: 1.5rem; }
.cb-space-s { height: 12px; } .cb-space-m { height: 32px; } .cb-space-l { height: 64px; }
.cb-hr { border: 0; border-top: 1px solid var(--color-border); margin: 4px 0; }
.cb-empty { padding: 18px; border: 2px dashed var(--color-border); border-radius: 14px; text-align: center; color: var(--color-text-muted); font-size: var(--fs-sm); }

/* ===== Page builder editor ===== */
.pb-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; background: var(--color-surface); border-radius: 18px; box-shadow: var(--shadow); position: sticky; top: 64px; z-index: 6; }
.pb-toolbar button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.pb-toolbar button:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pb-toolbar .pb-more { position: relative; }
.pb-menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 20; min-width: 220px; display: grid; gap: 2px; padding: 6px; border-radius: 16px; background: var(--color-surface); box-shadow: 0 12px 30px rgba(10, 12, 30, .2); }
.pb-menu button { border: 0; text-align: start; border-radius: 10px; }
.pb-menu button:hover { background: var(--color-surface-2); }
.pb-empty-page { padding: 40px 20px; border: 2px dashed var(--color-border); border-radius: 20px; text-align: center; color: var(--color-text-muted); }
.pb-gcols { display: grid; gap: 10px; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
@media (max-width: 760px) { .pb-gcols { grid-template-columns: minmax(0, 1fr); } }
.pb-gcol { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: var(--color-surface-2); border: 1px dashed var(--color-border); min-height: 90px; }
.pb-gcol-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--color-text-muted); }
.pb-block { background: var(--color-surface); border-radius: 12px; border: 1px solid var(--color-border); }
.pb-block-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; cursor: pointer; font-size: 13px; }
.pb-block-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pb-block-head .pb-grip { cursor: grab; color: var(--color-text-muted); }
.pb-block-body { padding: 0 10px 10px; display: grid; gap: 8px; }
.pb-block:not(.open) .pb-block-body { display: none; }
.pb-iconbtn { border: 0; background: none; color: var(--color-text-muted); cursor: pointer; padding: 2px 5px; border-radius: 6px; font: inherit; font-size: 13px; }
.pb-iconbtn:hover { background: var(--color-surface-2); color: var(--color-text); }
.pb-iconbtn.danger:hover { color: var(--color-danger); }
.pb-add-block { position: relative; }
.pb-add-block > button { width: 100%; padding: 6px; border-radius: 10px; border: 1px dashed var(--color-primary); background: none; color: var(--color-primary); font: inherit; font-size: 13px; cursor: pointer; }
.pb-fmt { display: flex; gap: 4px; }
.pb-fmt button { border: 1px solid var(--color-border); background: var(--color-surface); border-radius: 8px; padding: 2px 9px; font: inherit; font-size: 12px; cursor: pointer; }
.pb-thumb-lg { width: 100%; max-height: 160px; object-fit: cover; border-radius: 10px; }
.pb-preview-wrap { position: sticky; top: 72px; }
.pb-preview { width: 100%; height: 70vh; border: 1px solid var(--color-border); border-radius: 18px; background: #fff; }
.pb-device { display: inline-flex; gap: 4px; }
.pb-workspace { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1200px) { .pb-workspace.with-preview { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
body.pb-wide main.container { max-width: none; }
body.pb-wide .panel-layout { grid-template-columns: minmax(0, 1fr); }
body.pb-wide .panel-nav { display: none; }
@media (min-width: 1100px) { body.pb-wide .pb-workspace.with-preview { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.pb-mini-select { font: inherit; font-size: 11px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); color: var(--color-text); padding: 1px 4px; max-width: 90px; }

/* ===== Contact with icons ===== */
.contact-card { display: grid; gap: 18px; max-width: 720px; padding: 22px; border-radius: 24px; background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow); }
.align-center .contact-card { margin-inline: auto; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.contact-list li { display: flex; align-items: center; gap: 14px; text-align: start; }
.contact-list .ci { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--color-primary-soft); color: var(--color-primary); }
.contact-list small { display: block; font-size: 12px; color: var(--color-text-muted); }
.contact-list a, .contact-list strong { color: var(--color-text); font-weight: 600; }
.soc-row { display: flex; flex-wrap: wrap; gap: 10px; }
.align-center .soc-row, .cb-a-center .soc-row { justify-content: center; }
.soc { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--color-surface-2); color: var(--color-text); transition: transform .15s, background .15s, color .15s; }
.soc:hover { transform: translateY(-2px); color: #fff; text-decoration: none; background: var(--color-primary); }
.soc-instagram:hover { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.soc-telegram:hover { background: #229ed9; } .soc-youtube:hover { background: #ff0000; } .soc-whatsapp:hover { background: #25d366; }
.soc-linkedin:hover { background: #0a66c2; } .soc-x:hover { background: #000; } .soc-aparat:hover { background: #ea1d5d; }
.app-footer .soc { width: 36px; height: 36px; color: var(--color-text-muted); }
.app-footer-social { align-items: center; gap: 8px; }
.contact-form-wrap { max-width: 720px; }
.align-center .contact-form-wrap { margin-inline: auto; }
.contact-form { display: grid; gap: 12px; padding: 22px; border-radius: 24px; background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow); text-align: start; }
.cf-row { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .cf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact-form .btn { justify-self: start; display: inline-flex; gap: 8px; align-items: center; }
.cf-status.ok { color: var(--color-success); font-weight: 600; } .cf-status.err { color: var(--color-danger); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ================= Motion: smooth, calm, respects reduced-motion ================= */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s ease both; }
::view-transition-new(root) { animation: vt-in .28s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
.site-header { view-transition-name: hdr; } .bottom-nav { view-transition-name: tabbar; }
::view-transition-old(hdr), ::view-transition-new(hdr), ::view-transition-old(tabbar), ::view-transition-new(tabbar) { animation: none; }
main { animation: page-in .35s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }
.app-wrap > section, .app-wrap > header, .kpis > *, .tiles > *, .feed-list > *, .course-grid > *, .menu-group { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.tiles > *:nth-child(2), .kpis > *:nth-child(2), .feed-list > *:nth-child(2) { animation-delay: .04s; }
.tiles > *:nth-child(3), .kpis > *:nth-child(3), .feed-list > *:nth-child(3) { animation-delay: .08s; }
.tiles > *:nth-child(4), .kpis > *:nth-child(4), .feed-list > *:nth-child(4) { animation-delay: .12s; }
.tiles > *:nth-child(n+5), .kpis > *:nth-child(n+5), .feed-list > *:nth-child(n+5) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.btn, .chip, .chip-btn, .tile, .feed-item, .course-tile, .menu-row, .kpi, .today-card, .tabs a, .pnav a, .soc, .bottom-nav a, .card {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease, opacity .2s ease;
}
.feed-item:hover, .tile:hover, .kpi:hover, .today-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(20, 22, 50, .1); }
.btn:active, .chip:active, .tile:active, .menu-row:active, .bottom-nav a:active { transform: scale(.97); }
.hero-chart svg { transition: opacity .3s ease; }
.seg { position: relative; isolation: isolate; }
.seg button { position: relative; z-index: 1; transition: color .25s ease; }
.seg button[aria-pressed="true"] { background: none; }
.seg-pill { position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 999px; background: #fff; z-index: 0; transition: transform .35s cubic-bezier(.2, .8, .2, 1), width .35s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.hero-tip { transition: left .08s linear; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.tx-in { animation: tx-in .35s ease both; }
@keyframes tx-in { from { opacity: 0; transform: translateY(6px); } }
.spark-reveal { animation: spark .9s cubic-bezier(.2, .7, .2, 1) both; transform-origin: left; }
@keyframes spark { from { width: 0; } to { width: 100px; } }
details > summary { transition: color .2s; }
details[open] > :not(summary) { animation: rise .25s ease both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; transition: none !important; }
}

/* ===== Panel dashboard ===== */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.dash-sec { margin-bottom: var(--space-4); }
.action-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.action-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--color-surface); box-shadow: var(--shadow); color: var(--color-text); border-inline-start: 4px solid var(--color-warning); }
.action-tile:hover { text-decoration: none; transform: translateY(-2px); }
.action-tile .action-count { min-width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--color-warning-soft); color: var(--color-warning); font-weight: 700; }
.action-label { flex: 1; font-size: var(--fs-sm); font-weight: 500; }
.all-clear { padding: 14px 18px; border-radius: 18px; background: var(--color-success-soft); color: var(--color-success); font-weight: 600; }
.kpi-delta { font-weight: 700; } .kpi-delta.up { color: var(--color-up); } .kpi-delta.down { color: var(--color-down); }
.kpi:first-child .kpi-delta { color: #fff; }
.dash-grid-2 { display: grid; gap: 14px; margin: var(--space-4) 0; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .dash-grid-2 { grid-template-columns: 1.3fr 1fr; } }
.dash-grid-3 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .dash-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1250px) { .dash-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.big-num { font-size: 1.6rem; font-weight: 700; margin-top: 4px; }
.bars { position: relative; }
.bars span { position: relative; cursor: default; }
.bars span:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 3px 8px; border-radius: 8px; background: #0f1222; color: #fff; font-size: 11px; z-index: 5; direction: rtl; }
.bars-alt span { background: linear-gradient(180deg, #10b981, #0ea5e9); }
.bars span { animation: bar-up .6s cubic-bezier(.2, .7, .2, 1) both; transform-origin: bottom; }
@keyframes bar-up { from { transform: scaleY(0); } }
.mini-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; font-size: var(--fs-sm); color: var(--color-text-muted); }
.mini-stats b { color: var(--color-text); font-size: 1.1rem; margin-inline-end: 3px; }
.dash-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--color-border); color: var(--color-text); font-size: var(--fs-sm); }
.dash-row:last-child { border-bottom: 0; }
.dash-row:hover { text-decoration: none; color: var(--color-primary); }
.dash-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row small { display: block; font-size: 11px; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; }
.rank { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--color-primary-soft); color: var(--color-primary); font-size: 12px; font-weight: 700; flex: none; }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 13px; font-weight: 700; flex: none; }
.dash-line { padding: 6px 0; border-bottom: 1px solid var(--color-border); }
.dash-line:last-child { border-bottom: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-bottom: 8px; }
.stat-grid a { display: flex; flex-direction: column; padding: 10px; border-radius: 14px; background: var(--color-surface-2); color: var(--color-text); }
.stat-grid a:hover { text-decoration: none; background: var(--color-primary-soft); }
.stat-grid b { font-size: 1.25rem; } .stat-grid span { font-size: 11px; color: var(--color-text-muted); }
.stat-grid a.warn b { color: var(--color-warning); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; }
.dot-good { background: var(--color-success); } .dot-bad { background: var(--color-danger); }
.super-box { margin-top: var(--space-4); padding: 14px 16px; border-radius: 16px; border: 1px dashed var(--color-warning); background: var(--color-warning-soft); }

/* ===== Builder v2: column ratios, blocks fill their column ===== */
@media (min-width: 760px) { .cms-grid[style*="--gtc"] { grid-template-columns: var(--gtc); } }
@media (min-width: 760px) and (max-width: 1039px) { .cms-grid.g-4[style*="--gtc"], .cms-grid.g-5[style*="--gtc"], .cms-grid.g-6[style*="--gtc"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact-card, .contact-form-wrap { max-width: none; }
.cms-gcol .contact-form, .cms-gcol .contact-card { box-shadow: none; padding: 0; background: none; }
.cms-gcol.col-bg-none .contact-form { padding: 0; }
@media (min-width: 900px) { .cms-sec > .container > .contact-card .contact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cf-title { margin: 0 0 6px; font-size: 1.15rem; }
.cb-gallery { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .cb-gallery.gc-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cb-gallery.gc-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cb-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; }
.cb-prices { background: var(--color-surface); border-radius: 16px; padding: 4px 14px; color: var(--color-text); }
.cb-faq details { border-bottom: 1px solid var(--color-border); padding: 12px 0; }
.cb-faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.cb-faq summary::after { content: "+"; font-weight: 400; color: var(--color-text-muted); transition: transform .2s; }
.cb-faq details[open] summary::after { transform: rotate(45deg); }
.cb-faq p { margin: 8px 0 0; color: var(--color-text-muted); }
.cb-testi { display: grid; gap: 12px; }
.cb-testi figure { margin: 0; padding: 16px; border-radius: 16px; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.cb-testi blockquote { margin: 0 0 10px; } .cb-testi figcaption span { color: var(--color-text-muted); font-size: 12px; }
.cb-countdown .cd-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cb-a-center .cb-countdown .cd-row { justify-content: center; }
.cb-countdown .cd-row span { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 10px; border-radius: 14px; background: var(--color-surface); color: var(--color-text); font-size: 12px; }
.cb-countdown b { font-size: 1.6rem; }
.cb-table { overflow-x: auto; background: var(--color-surface); border-radius: 14px; }

/* ===== Builder v2 editor ===== */
body.pb-page main.container { max-width: 1680px; }
body.pb-page .panel-layout { grid-template-columns: minmax(0, 1fr); }
body.pb-page .panel-nav, body.pb-page .section-tabs { display: none; }
.pb-topbar { position: sticky; top: 56px; z-index: 8; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; border-radius: 16px; background: var(--color-surface); border: 1px solid var(--color-border); }
.pb-back { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--color-surface-2); color: var(--color-text); }
.pb-back:hover { text-decoration: none; background: var(--color-primary-soft); }
.pb-title-input { font: inherit; font-weight: 700; font-size: 1.05rem; border: 1px solid transparent; background: none; color: var(--color-text); border-radius: 10px; padding: 6px 8px; min-width: 160px; }
.pb-title-input:hover, .pb-title-input:focus { border-color: var(--color-border); outline: none; background: var(--color-surface-2); }
.pb-topbar .grow { flex: 1; }
.pb-drop { position: relative; }
.pb-drop > summary { list-style: none; } .pb-drop > summary::-webkit-details-marker { display: none; }
.pb-drop-body { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); width: 320px; max-height: 70vh; overflow: auto; padding: 14px; border-radius: 16px; background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: 0 16px 40px rgba(10, 12, 30, .18); z-index: 30; }
.pb-toolbar { top: 118px; align-items: center; }
.pb-tb-btn { padding: 7px 14px; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pb-tb-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pb-tb-hint { margin-inline-start: auto; }
.pb-workspace { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .pb-workspace { grid-template-columns: 200px minmax(0, 1fr); } }
@media (min-width: 1200px) { .pb-workspace.with-preview { grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1fr); } }
body.pb-wide .pb-workspace.with-preview { grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1199px) { .pb-workspace.with-preview .pb-preview-wrap { grid-column: 1 / -1; } }
.pb-palette { position: sticky; top: 176px; align-self: start; max-height: calc(100vh - 190px); overflow: auto; padding: 10px; border-radius: 16px; background: var(--color-surface); border: 1px solid var(--color-border); }
@media (max-width: 899px) { .pb-palette { position: static; max-height: none; } .pb-pal-list { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
.pb-pal-head { margin: 0 0 4px; font-weight: 700; font-size: 13px; }
.pb-pal-title { margin: 10px 0 4px; font-size: 11px; color: var(--color-text-muted); }
.pb-pal-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.pb-pal-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-surface-2); font-size: 11px; text-align: center; cursor: grab; user-select: none; }
.pb-pal-item:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pb-pal-item:active { cursor: grabbing; }
.pb-bicon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--color-primary-soft); color: var(--color-primary); font-size: 12px; font-weight: 700; flex: none; }
.pb-block-head .pb-bicon { width: 20px; height: 20px; font-size: 11px; }
.pb-blocks { display: flex; flex-direction: column; gap: 6px; min-height: 56px; }
.pb-drop-hint { padding: 16px 8px; border: 2px dashed var(--color-border); border-radius: 10px; text-align: center; color: var(--color-text-muted); font-size: 12px; }
.pb-gcol.is-focus { border-color: var(--color-primary); border-style: solid; }
.pb-ghost { opacity: .45; border: 2px dashed var(--color-primary) !important; }
.pb-blocks .pb-pal-item { width: 100%; flex-direction: row; justify-content: center; }
.pb-ratio { display: inline-flex; gap: 2px; width: 46px; height: 18px; flex: none; }
.pb-ratio i { display: block; background: var(--color-primary); opacity: .55; border-radius: 3px; }
.pb-head .pb-ratio { width: 34px; height: 14px; }
.pb-ratios { display: flex; flex-wrap: wrap; gap: 6px; }
.pb-ratios button { padding: 6px; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-surface); cursor: pointer; }
.pb-ratios button[aria-pressed="true"] { border-color: var(--color-primary); background: var(--color-primary-soft); }
.pb-ratios button[aria-pressed="true"] .pb-ratio i { opacity: 1; }
.pb-menu-ratios { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 320px; }
.pb-menu-ratios button { display: flex; align-items: center; gap: 8px; }
.pb-menu-ratios .pb-menu-title { grid-column: 1 / -1; }
.pb-menu-title { font-size: 11px; color: var(--color-text-muted); padding: 6px 8px 2px; }
.pb-menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 300px; max-height: 360px; overflow: auto; inset-inline-start: auto; inset-inline-end: 0; }
.pb-menu-grid .pb-menu-title { grid-column: 1 / -1; }
.pb-menu-grid button { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 6px; }
.pb-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.pb-thumb-item { position: relative; } .pb-thumb-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.pb-thumb-item button { position: absolute; top: 2px; inset-inline-end: 2px; background: var(--color-surface); }
.pb-gcols { grid-template-columns: none; }
@media (max-width: 760px) { .pb-gcols { grid-template-columns: minmax(0, 1fr) !important; } }

/* ===== Notification dropdown ===== */
.bell-wrap { position: relative; }
.bell { position: relative; border: 0; cursor: pointer; }
.bell-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: -8px; width: min(360px, calc(100vw - 24px)); border-radius: 16px; background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: 0 18px 44px rgba(10, 12, 30, .18); z-index: 60; overflow: hidden; animation: rise .18s ease both; }
.bm-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
.bm-list { max-height: 360px; overflow: auto; }
.bm-item { display: flex; gap: 10px; padding: 10px 14px; color: var(--color-text); border-bottom: 1px solid var(--color-border); }
.bm-item:hover { text-decoration: none; background: var(--color-surface-2); }
.bm-item b { display: block; font-size: 13px; font-weight: 600; }
.bm-item small { display: block; color: var(--color-text-muted); font-size: 12px; line-height: 1.6; }
.bm-item time { display: block; color: var(--color-text-muted); font-size: 11px; margin-top: 2px; }
.bm-item:not(.is-new) b { font-weight: 500; color: var(--color-text-muted); }
.bm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); margin-top: 7px; flex: none; }
.bm-empty { padding: 26px 14px; margin: 0; text-align: center; color: var(--color-text-muted); font-size: 13px; }
.bm-foot { display: flex; gap: 6px; justify-content: flex-end; padding: 10px; background: var(--color-surface-2); }
.guide ol { margin: 0; padding-inline-start: 1.3em; display: grid; gap: 12px; font-size: var(--fs-sm); line-height: 1.9; }
.guide ul { margin: 6px 0 0; padding-inline-start: 1.2em; }
.guide code { background: var(--color-surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; }

/* ===== Bundles ===== */
.bundle-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .bundle-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } .bundle-buy { position: sticky; top: 76px; } }
.bundle-courses { display: grid; gap: 8px; }
.bundle-course { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text); }
.bundle-course:hover { text-decoration: none; border-color: var(--color-primary); }
.bundle-course img, .bundle-course .feed-ph { width: 72px; height: 54px; border-radius: 10px; object-fit: cover; flex: none; font-size: 1.2rem; }
.bundle-course b { display: block; } .bundle-course small { color: var(--color-text-muted); font-size: 12px; }
.bundle-buy { display: grid; gap: 10px; }
.bundle-save { justify-self: start; padding: 3px 10px; border-radius: 999px; background: var(--color-success-soft); color: var(--color-success); font-weight: 700; font-size: 13px; }
.bundle-total { font-size: 1.7rem; font-weight: 800; }
.bundle-strip { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.bundle-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 18px; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text); }
.bundle-card:hover { text-decoration: none; border-color: var(--color-primary); }
.err-row summary { cursor: pointer; list-style: none; }
.err-row.is-done { opacity: .6; }
.err-trace { max-height: 280px; overflow: auto; font-size: 11px; background: var(--color-surface-2); padding: 10px; border-radius: 10px; white-space: pre-wrap; margin: 10px 0 0; }
.teach-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.teach-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text); }
.teach-card:hover { text-decoration: none; border-color: var(--color-primary); }
html { font-size: calc(100% * var(--font-scale, 1)); }
h1, h2, h3, .home-hello, .cms-title { font-weight: var(--heading-weight, 700); }
.menu-edit { display: grid; gap: 6px; }
.menu-edit-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; border-radius: 12px; border: 1px solid var(--color-border); background: var(--color-surface-2); }
.menu-edit-row .pb-grip { cursor: grab; color: var(--color-text-muted); }

/* ================= Editorial pass: fewer "template" tells =================
   Solid colors instead of gradients, hairline borders instead of soft glows,
   tabular figures for prices, tighter radii, a terminal-like chart card. */
:root {
  --grad: var(--color-primary);
  --ink: #12142a;
  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px;
  --shadow: 0 1px 0 rgba(15, 18, 34, .04);
  --line: var(--color-border);
}
:root[data-theme="dark"] { --ink: #0d0f1e; --shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ink: #0d0f1e; --shadow: none; } }

body { font-feature-settings: "ss01", "tnum"; letter-spacing: 0; }
.tile-price, .hero-price, .kpi-value, .big-num, .bundle-total, .cb-stat strong, .mrow-price, .stat-grid b { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* buttons & chips: solid, honest */
.btn-primary { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); box-shadow: none; }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn { border-radius: 10px; }
.chip-primary { background: var(--color-primary); }
.chip-btn, .chips a, .chip { border-radius: 8px; }
.chips a[aria-current], .chip[aria-current] { background: var(--color-primary-soft); color: var(--color-primary); border-color: var(--color-primary); }

/* surfaces: hairlines, no floating glow */
.card, .tile, .feed-item, .today-card, .course-tile, .kpi, .menu-group, .contact-form, .contact-card, .a-card, .teach-card, .action-tile, .bundle-course, .bundle-card, .cb-card, .cb-price, .search-bar {
  border: 1px solid var(--line) !important; box-shadow: none !important;
}
.feed-item:hover, .tile:hover, .kpi:hover, .today-card:hover, .course-tile:hover { transform: none; box-shadow: none !important; border-color: var(--color-text-muted) !important; }
.tile.is-active { border-color: var(--color-primary) !important; box-shadow: inset 0 0 0 1px var(--color-primary) !important; }
.site-header { background: var(--color-surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
.bottom-nav { background: var(--color-surface); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 -1px 0 var(--line); border-radius: 0; }
.bottom-nav a[aria-current="page"] { background: none; color: var(--color-primary); position: relative; }
.bottom-nav a[aria-current="page"]::before { content: ""; position: absolute; top: -6px; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: var(--color-primary); }
.brand-mark { background: var(--color-primary); border-radius: 8px; }
.avatar-sm, .rank, .today-ico, .feed-ph, .course-cover-ph, .a-card-img-empty { background: var(--color-surface-2) !important; color: var(--color-text-muted) !important; }
.course-cover { background: var(--color-surface-2); }
.today-ico::after { background: var(--color-text); }
.coin { box-shadow: none; }

/* the price card reads like a terminal, not a poster */
.hero-card { background: var(--ink) !important; box-shadow: none; border-radius: 16px; }
.hero-card::after { display: none; }
.hero-chart { background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 100% 25%; background-position: 0 0; }
.seg { background: rgba(255, 255, 255, .08); border-radius: 8px; }
.seg-pill { border-radius: 6px; box-shadow: none; }
.seg button { border-radius: 6px; }
.hero-chg { border-radius: 6px; background: rgba(255, 255, 255, .08); }
.hero-axis { position: absolute; inset-inline-start: 10px; font-size: 10px; color: rgba(255, 255, 255, .45); pointer-events: none; direction: ltr; font-variant-numeric: tabular-nums; }
.hero-axis.top { top: 18px; } .hero-axis.bottom { bottom: 6px; }
.profile-card { background: var(--ink); box-shadow: none; border-radius: 16px; }
.kpi:first-child { background: var(--ink); border-color: var(--ink) !important; }

/* section headers: small label + rule, like a newspaper */
.sec-head { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.sec-head h2 { font-size: 1rem; }
.home-hello { font-size: 1.35rem; }

/* calmer motion */
.app-wrap > section, .app-wrap > header, .kpis > *, .tiles > *, .feed-list > *, .course-grid > *, .menu-group { animation-duration: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

/* ===== Jalali date-time picker ===== */
.jdp-wrap { position: relative; }
.jdp-wrap input { cursor: pointer; padding-inline-end: 34px; text-align: right; }
.jdp-clear { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--color-surface-2); color: var(--color-text-muted); cursor: pointer; line-height: 1; }
.jdp-pop { position: absolute; z-index: 70; top: calc(100% + 6px); inset-inline-start: 0; width: 290px; padding: 12px; border-radius: 14px; background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: 0 16px 40px rgba(10, 12, 30, .2); }
.jdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.jdp-head button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); cursor: pointer; font-size: 16px; }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jdp-w { text-align: center; font-size: 11px; color: var(--color-text-muted); padding: 4px 0; }
.jdp-day { height: 34px; border: 0; border-radius: 8px; background: none; color: var(--color-text); cursor: pointer; font: inherit; font-size: 13px; }
.jdp-day:hover { background: var(--color-surface-2); }
.jdp-day.is-today { box-shadow: inset 0 0 0 1px var(--color-primary); }
.jdp-day.is-sel { background: var(--color-primary); color: #fff; }
.jdp-day.is-past { opacity: .3; cursor: default; }
.jdp-time { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--color-border); direction: ltr; justify-content: flex-end; }
.jdp-time select { width: 70px; padding: 4px 6px; }
.jdp-foot { display: flex; gap: 6px; margin-top: 10px; justify-content: space-between; }
.jdp-foot button { border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); border-radius: 8px; padding: 5px 10px; cursor: pointer; font: inherit; font-size: 12px; }
.jdp-foot .jdp-ok { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ===== Price card views ===== */
.view-switch { display: inline-flex; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.view-switch button { border: 0; background: var(--color-surface); color: var(--color-text-muted); padding: 4px 8px; cursor: pointer; display: grid; place-items: center; }
.view-switch button + button { border-inline-start: 1px solid var(--color-border); }
.view-switch button[aria-pressed="true"] { background: var(--color-primary-soft); color: var(--color-primary); }
.tiles.view-small { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 760px) { .tiles.view-small { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tiles.view-small .tile { min-height: 0; padding: 10px; gap: 2px; border-radius: 12px; }
.tiles.view-small .coin { width: 26px; height: 26px; font-size: 8px; }
.tiles.view-small .tile-top { gap: 6px; }
.tiles.view-small .tile-name { font-size: 11px; }
.tiles.view-small .tile-spark { height: 16px; }
.tiles.view-small .tile-price { font-size: 1.05rem; }
.tiles.view-small .tile-chg { font-size: 10px; }
.tiles.view-list { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--color-surface); }
.tiles.view-list .tile { flex-direction: row; align-items: center; min-height: 0; border-radius: 0; border: 0 !important; border-bottom: 1px solid var(--line) !important; padding: 10px 14px; gap: 10px; }
.tiles.view-list .tile:last-child { border-bottom: 0 !important; }
.tiles.view-list .tile.is-active { box-shadow: inset 3px 0 0 var(--color-primary) !important; }
.tiles.view-list .tile-top { margin: 0; flex: 1; min-width: 0; }
.tiles.view-list .coin { width: 30px; height: 30px; font-size: 9px; }
.tiles.view-list .tile-spark { width: 70px; height: 24px; flex: none; margin: 0; }
.tiles.view-list .tile-price { font-size: 1.05rem; min-width: 92px; }
.tiles.view-list .tile-chg { min-width: 62px; order: 5; }
.tiles.view-list .tile-stale { position: static; }
@media (max-width: 420px) { .tiles.view-list .tile-spark { display: none; } }

/* ===== Option cards (article access etc.) ===== */
.opt-cards { display: grid; gap: 8px; }
.opt-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 12px; cursor: pointer; }
.opt-card:hover { border-color: var(--color-text-muted); }
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.opt-card:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-soft); }
.opt-card:has(input:focus-visible) { outline: 2px solid var(--color-primary); }
.opt-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--color-surface-2); flex: none; }
.opt-text b { display: block; font-size: 14px; } .opt-text small { color: var(--color-text-muted); font-size: 12px; }
.access-more, .access-locked { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--color-border); }
.pill-checks ul, .pill-checks > div { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pill-checks label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--color-border); border-radius: 999px; font-size: 13px; cursor: pointer; }
.pill-checks label:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary); }
.seg-radio { display: grid; gap: 6px; }
.seg-radio label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 10px; font-size: 13px; cursor: pointer; }
.seg-radio label:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-soft); }
.pb-blocks:empty { min-height: 64px; border: 2px dashed var(--color-border); border-radius: 10px; display: grid; place-items: center; }
.pb-blocks:empty::before { content: attr(data-empty); color: var(--color-text-muted); font-size: 12px; }
.pb-block-head { cursor: grab; touch-action: none; }
.pb-head { cursor: grab; }
.pb-chosen { box-shadow: 0 0 0 2px var(--color-primary) !important; }
.pb-dragging { opacity: .95 !important; transform: rotate(1deg); box-shadow: 0 14px 30px rgba(10, 12, 30, .25) !important; background: var(--color-surface) !important; }
.pb-ghost { opacity: .35 !important; background: var(--color-primary-soft) !important; border: 2px dashed var(--color-primary) !important; }
.pb-pal-item.pb-ghost { width: 100%; }

/* ===== Footer stays at the bottom on short pages ===== */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body > main { flex: 1 0 auto; width: 100%; }
.app-footer { flex-shrink: 0; width: 100%; box-sizing: border-box; }

/* ===== Mobile: floating glass dock (Apple-style) ===== */
@media (max-width: 899px) {
  .bottom-nav {
    inset-inline: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); height: 64px; padding: 6px;
    border-radius: 26px; border: 1px solid rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .62);
    backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
    box-shadow: 0 10px 34px rgba(10, 12, 30, .18), inset 0 1px 0 rgba(255, 255, 255, .6);
  }
  .bottom-nav a { border-radius: 20px; margin: 0 2px; min-height: 0; padding: 4px 0; }
  .bottom-nav a[aria-current="page"] { background: rgba(91, 76, 240, .14); color: var(--color-primary); }
  .bottom-nav a[aria-current="page"]::before { display: none; }
  .bottom-nav a:active { transform: scale(.92); }
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
}
@media (max-width: 899px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bottom-nav { background: rgba(22, 24, 40, .62); border-color: rgba(255, 255, 255, .1); box-shadow: 0 10px 34px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06); }
}
@media (max-width: 899px) {
  :root[data-theme="dark"] .bottom-nav { background: rgba(22, 24, 40, .62); border-color: rgba(255, 255, 255, .1); box-shadow: 0 10px 34px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06); }
}

/* ===== Brand page ===== */
.brand-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .brand-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } .brand-preview { position: sticky; top: 76px; } }
.brand-row { display: flex; gap: 12px; flex-wrap: wrap; }
.brand-row > .field { min-width: 180px; }
.brand-row input, .brand-row textarea, .brand-layout textarea, .brand-layout input[type=text], .brand-layout input[type=email], .brand-layout input[type=url] { width: 100%; }
.brand-layout .field input:not([type=color]):not([type=radio]):not([type=file]), .brand-layout .field textarea { font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-surface-2); color: var(--color-text); }
.upload-tile { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 240px; padding: 12px; border: 1px dashed var(--color-border); border-radius: 12px; }
.upload-prev { width: 56px; height: 56px; border-radius: 12px; background: var(--color-surface-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.upload-prev img { width: 100%; height: 100%; object-fit: contain; }
.color-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.color-item { display: grid; gap: 6px; }
.color-input { display: flex; gap: 6px; align-items: center; }
.color-input input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface); cursor: pointer; flex: none; }
.color-input .input { flex: 1; min-width: 0; }
.seg-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-cards label { cursor: pointer; }
.seg-cards input { position: absolute; opacity: 0; pointer-events: none; }
.seg-cards span { display: inline-block; padding: 8px 14px; border: 1px solid var(--color-border); border-radius: 10px; font-size: 13px; }
.seg-cards input:checked + span { border-color: var(--color-primary); background: var(--color-primary-soft); color: var(--color-primary); font-weight: 600; }
.seg-cards input:focus-visible + span { outline: 2px solid var(--color-primary); }
.bp { --p: #5b4cf0; --a: #f5a524; --bg: #eef0f6; --tx: #0f1222; --r: 12px; --fs: 1; --hw: 700; background: var(--bg); color: var(--tx); border-radius: calc(var(--r) + 4px); overflow: hidden; border: 1px solid var(--color-border); font-size: calc(14px * var(--fs)); }
.bp-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; color: #0f1222; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.bp-mark { width: 22px; height: 22px; border-radius: calc(var(--r) / 2); background: var(--p); }
.bp-body { padding: 14px; display: grid; gap: 10px; }
.bp-body h3 { margin: 0; font-size: calc(17px * var(--fs)); font-weight: var(--hw); }
.bp-body p { margin: 0; line-height: 1.8; }
.bp-card { display: flex; justify-content: space-between; padding: 10px 12px; background: #fff; color: #0f1222; border-radius: var(--r); border: 1px solid rgba(0, 0, 0, .06); }
.bp-btn { padding: 7px 14px; border-radius: var(--r); background: var(--p); color: #fff; font-weight: 600; }
.bp-pill { padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--a) 18%, transparent); color: var(--a); font-weight: 600; }

/* ===== Menus page ===== */
.menu-preview { display: flex; gap: 4px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--color-surface-2); border: 1px solid var(--color-border); }
.menu-preview span { padding: 5px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--color-text-muted); }
.menu-preview span:first-child { background: var(--color-primary-soft); color: var(--color-primary); }
.menu-preview.is-footer span:first-child { background: none; color: var(--color-text-muted); }
.menu-preview em { font-size: 12px; color: var(--color-text-muted); }
.mrow-list { display: grid; gap: 0; border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; }
.mrow-edit, .mrow-add { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.4fr) auto auto auto; gap: 8px; align-items: center; padding: 8px 10px; background: var(--color-surface); }
.mrow-edit + .mrow-edit { border-top: 1px solid var(--color-border); }
.mrow-edit.is-off .mi-label, .mrow-edit.is-off .mi-url { opacity: .45; }
.mrow-add { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.4fr) auto; border: 1px dashed var(--color-border); border-radius: 12px; }
.mi-label, .mi-url { font: inherit; font-size: 14px; border: 1px solid transparent; background: transparent; color: var(--color-text); border-radius: 8px; padding: 7px 8px; min-width: 0; }
.mi-url { font-size: 13px; color: var(--color-text-muted); }
.mi-label:hover, .mi-url:hover, .mi-label:focus, .mi-url:focus { border-color: var(--color-border); background: var(--color-surface-2); outline: none; }
.mrow-edit .pb-grip { cursor: grab; color: var(--color-text-muted); text-align: center; }
.switch { position: relative; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--color-border); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--color-primary); }
.switch input:checked + span::after { transform: translateX(-16px); }
[dir="ltr"] .switch input:checked + span::after { transform: translateX(16px); }
.mi-tab { cursor: pointer; } .mi-tab input { position: absolute; opacity: 0; }
.mi-tab span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--color-border); color: var(--color-text-muted); font-size: 13px; }
.mi-tab input:checked + span { background: var(--color-primary-soft); color: var(--color-primary); border-color: var(--color-primary); }
@media (max-width: 640px) { .mrow-edit { grid-template-columns: 22px minmax(0, 1fr) auto auto auto; } .mrow-edit .mi-url { grid-column: 2 / -1; grid-row: 2; } .mrow-add { grid-template-columns: minmax(0, 1fr) auto; } .mrow-add .pb-grip { display: none; } .mrow-add .mi-url { grid-column: 1; grid-row: 2; } }
.bank-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--color-border); font-size: 13px; cursor: pointer; }
.bank-row small { display: block; color: var(--color-text-muted); font-size: 11px; }

/* ===== Brand «متن و ظاهر» applied site-wide ===== */
html[data-scale="90"] body { zoom: .92; }
html[data-scale="110"] body { zoom: 1.08; }
html[data-scale="120"] body { zoom: 1.16; }
html { font-size: 100% !important; }
html[data-hw="500"] :is(h1, h2, h3, h4, .home-hello, .card-title, .cms-title, .sec-head h2, .tile-name, .feed-title, .course-title, .kpi-value) { font-weight: 500 !important; }
html[data-hw="700"] :is(h1, h2, h3, .home-hello, .card-title, .cms-title) { font-weight: 700; }
/* sharp corners: everything square-ish except true circles (avatars, dots, switches, counters, coins) */
html[data-radius="sharp"] :is(.card, .tile, .btn, .input, select, textarea, input:not([type=checkbox]):not([type=radio]), .chip, .chip-btn, .chips a, .tabs, .tabs a, .feed-item, .feed-item img, .feed-ph, .course-tile, .course-cover img, .a-card, .a-card-img, .kpi, .menu-group, .profile-card, .hero-card, .today-card, .contact-form, .contact-card, .cb-card, .cb-price, .search-bar, .bell-menu, .bm-item, .pb-sec, .pb-block, .pb-gcol, .panel-nav, .pnav a, .pnav-group summary, .action-tile, .teach-card, .bundle-course, .bundle-card, .cms-gcol, .cb-quote, .cb-video, .cb-fig img, .contact-list .ci, .opt-card, .seg-cards span, .seg, .seg button, .seg-pill, .pill, .badge, .alert, .menu-preview, .mrow-list, .mrow-add, .app-footer-in, .search-bar, .filter-body, .jdp-pop, .jdp-day, .view-switch, .tiles.view-list, .pb-toolbar, .pb-topbar, .pb-palette, .pb-pal-item, .pb-menu, .upload-tile, .bp) { border-radius: 4px !important; }
html[data-radius="round"] :is(.card, .tile, .feed-item, .course-tile, .a-card, .kpi, .menu-group, .profile-card, .hero-card, .today-card, .contact-form, .contact-card, .cb-card, .cb-price, .bell-menu, .panel-nav, .action-tile, .teach-card, .bundle-card, .app-footer-in, .pb-sec, .pb-palette, .pb-toolbar, .pb-topbar, .search-bar) { border-radius: 26px !important; }
html[data-radius="round"] :is(.btn, .input, select, textarea, .chip, .chip-btn, .chips a, .pnav a, .seg-cards span, .opt-card, .bm-item) { border-radius: 999px !important; }
html[data-radius="round"] :is(textarea, .opt-card) { border-radius: 18px !important; }

/* ===== Contact & social icons (redesign) ===== */
.soc { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; background: transparent; color: var(--color-text-muted) !important; border: 1px solid var(--color-border); transition: color .15s, border-color .15s, background .15s; }
.soc:hover, .app-footer a.soc:hover { transform: none; text-decoration: none; background: var(--color-primary-soft) !important; color: var(--color-primary) !important; border-color: var(--color-primary); }
.soc .ico { display: block; }
.app-footer .soc { width: 36px; height: 36px; }
.soc-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 12px; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text) !important; font-size: 13px; font-weight: 500; text-decoration: none !important; transition: border-color .15s, background .15s; }
.soc-chip .ico { color: var(--color-text-muted); }
.soc-chip:hover { border-color: var(--color-primary); background: var(--color-primary-soft); }
.soc-chip:hover .ico { color: var(--color-primary); }
.soc-row { gap: 8px; }
.contact-list { gap: 0 !important; }
.contact-list li { padding: 12px 0; border-bottom: 1px solid var(--color-border); gap: 12px !important; }
.contact-list li:last-child { border-bottom: 0; }
.contact-list .ci { width: 40px !important; height: 40px !important; border-radius: 10px !important; background: var(--color-surface-2) !important; color: var(--color-primary) !important; border: 1px solid var(--color-border); }
.contact-list .ci .ico { width: 18px; height: 18px; }
.contact-list a, .contact-list strong { font-weight: 600; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.contact-list span:last-child { min-width: 0; }

/* ===== Contact form: no overflow, no double frame, calmer spacing ===== */
.contact-form { position: relative; }
.hp { position: absolute !important; left: auto !important; right: auto !important; inset-inline-start: 0 !important; top: 0 !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; opacity: 0 !important; pointer-events: none !important; }
html, body { overflow-x: clip; }
.cms-gcol .contact-form, .cms-gcol .contact-card { border: 0 !important; padding: 0 !important; background: none !important; }
.contact-form { gap: 14px; }
.contact-form .field { gap: 6px; margin: 0; }
.contact-form .label { font-size: 13px; font-weight: 600; }
.contact-form .input, .contact-form textarea { width: 100%; }
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form .btn { margin-top: 4px; padding: 10px 22px; align-self: start; }
.cf-title { margin: 0 0 4px !important; font-size: 1.1rem; }
.cms-gcol.col-bg-card { padding: 24px !important; gap: 16px; }
.cms-gcol .cb-contact, .cms-gcol .contact-list { margin: 0; }
.cms-gcol .soc-row { margin-top: 4px; }
@media (max-width: 640px) { .cms-gcol.col-bg-card { padding: 16px !important; } .cf-row { grid-template-columns: minmax(0, 1fr) !important; } }

/* ===== Support page ===== */
.support-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .support-grid { grid-template-columns: minmax(0, 1fr) 320px; } .support-grid > aside { position: sticky; top: 76px; } }
.opt-cards-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-row-2 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .form-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form-row-2 .field { margin: 0; }
.support-page .field select, .support-page .field input[type=text], .support-page .field textarea { width: 100%; }
.ticket-list { display: grid; }
.ticket-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--color-border); color: var(--color-text); }
.ticket-row:first-child { border-top: 0; }
.ticket-row:hover { text-decoration: none; background: var(--color-surface-2); }
.ticket-row b { display: block; font-size: 14px; } .ticket-row small { display: block; color: var(--color-text-muted); font-size: 12px; margin-top: 2px; }
.t-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); flex: none; }
.t-dot.t-waiting_user { background: var(--color-warning); } .t-dot.t-resolved, .t-dot.t-closed { background: var(--color-border); }
.t-status { font-size: 11px; padding: 3px 10px; border-radius: 999px; background: var(--color-primary-soft); color: var(--color-primary); white-space: nowrap; font-weight: 600; }
.t-status.t-waiting_user { background: var(--color-warning-soft); color: var(--color-warning); }
.t-status.t-resolved, .t-status.t-closed { background: var(--color-surface-2); color: var(--color-text-muted); }
.pb-block-head, .pb-head, .pb-pal-item, .pb-grip { user-select: none; -webkit-user-select: none; }
body.pb-is-dragging, body.pb-is-dragging * { user-select: none !important; -webkit-user-select: none !important; cursor: grabbing !important; }
.sortable-fallback { opacity: .9 !important; box-shadow: 0 14px 30px rgba(10, 12, 30, .25); }

/* hero chart tooltip: price on top, date | time below */
.hero-tip { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.35; white-space: nowrap; }
.hero-tip .tip-price { font-size: 13px; font-weight: 800; direction: ltr; }
.hero-tip .tip-when { display: flex; gap: 8px; font-size: 11px; opacity: .8; }
.hero-tip .tip-when span + span { padding-inline-start: 8px; border-inline-start: 1px solid currentColor; }
.hero-tip[hidden] { display: none; }
.hero-tip { padding: 5px 10px; }

/* install / notification nudge card */
.nudge { position: fixed; z-index: 90; inset-inline: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); margin-inline: auto; max-width: 440px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: start; padding: 14px; border-radius: 18px;
  background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); box-shadow: 0 18px 40px rgba(10, 12, 30, .18);
  opacity: 0; transform: translateY(16px); transition: opacity .25s, transform .25s; }
.nudge.in { opacity: 1; transform: none; }
.nudge-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--color-primary-soft); color: var(--color-primary); }
.nudge-txt b { display: block; font-size: 14px; margin-bottom: 2px; }
.nudge-txt p { margin: 0; font-size: 12.5px; line-height: 1.7; opacity: .8; }
.nudge-act { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
@media (min-width: 900px) { .nudge { bottom: 20px; inset-inline-start: auto; inset-inline-end: 20px; margin: 0; } }

/* panel menu on phones/tablets: button + slide-up sheet */
.pnav-mobile { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--color-text); cursor: pointer; border-radius: 14px; text-align: start; }
.pnav-burger { display: grid; gap: 3px; width: 18px; }
.pnav-burger i { display: block; height: 2px; border-radius: 2px; background: currentColor; }
.pnav-here { font-size: var(--fs-sm); font-weight: 600; color: var(--color-primary); background: var(--color-primary-soft); padding: 3px 10px; border-radius: 999px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 899.98px) {
  .panel-nav .pnav.is-open { position: fixed; z-index: 120; inset-inline: 0; bottom: 0; max-height: 78vh; overflow-y: auto; overscroll-behavior: contain;
    background: var(--color-surface); border-radius: 22px 22px 0 0; padding: 14px 12px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -18px 40px rgba(10, 12, 30, .2); animation: pnav-up .22s ease-out; }
  .panel-nav .pnav.is-open::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--color-border); margin: 0 auto 10px; flex: none; }
  .pnav-backdrop { position: fixed; inset: 0; z-index: 110; background: rgba(10, 12, 30, .4); backdrop-filter: blur(2px); }
  html.pnav-locked { overflow: hidden; }
  .pnav a, .pnav-group summary { padding: 12px 14px; font-size: var(--fs); }
  .section-tabs { margin-inline: calc(-1 * var(--space-4, 16px)); padding-inline: var(--space-4, 16px); }
}
@media (min-width: 900px) { .pnav-backdrop { display: none !important; } }
@keyframes pnav-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
html.pnav-locked main { transform: none !important; animation: none !important; }
@media (max-width: 899px) { .pb-palette { max-height: 220px; overflow-y: auto; overscroll-behavior: contain; } .pb-pal-list { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } .pb-pal-item { padding: 6px 2px; } }

/* asset icons */
img.coin-img { background: none !important; padding: 0; object-fit: cover; box-shadow: 0 0 0 1px rgba(10, 12, 30, .06); }

/* market page: personal list editing */
.market-page .home-head { align-items: center; }
.mk-edit-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.mk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; position: sticky; top: 64px; z-index: 5; padding: 10px; border-radius: 16px; background: var(--glass); backdrop-filter: blur(12px); }
.mk-toolbar .input { flex: 1 1 200px; min-width: 0; }
.mk-tile { position: relative; }
.mk-toggle { display: none; }
.is-editing .mk-toggle { display: grid; place-items: center; position: absolute; inset: 0; z-index: 2; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.is-editing .mk-toggle span { position: absolute; top: 8px; inset-inline-end: 8px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--color-border); background: var(--color-surface); transition: .15s; }
.is-editing .mk-toggle[aria-pressed="true"] span { background: var(--color-primary); border-color: var(--color-primary); }
.is-editing .mk-toggle[aria-pressed="true"] span::after { content: ""; position: absolute; inset: 4px 6px 6px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.is-editing .mk-toggle:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.is-editing .mk-tile { transition: opacity .15s, transform .15s; }
.is-editing .mk-tile.is-off { opacity: .5; }
.is-editing .mk-tile:not(.is-off) { box-shadow: 0 0 0 2px var(--color-primary); }
.mk-sec[hidden] { display: none; }
.mk-tile[hidden] { display: none !important; }
