/* DENTAL NEXUS — application shell (six sections) and the personal Home. */
:root { --side-w: 244px; --side-wc: 74px; --bottom-h: 62px; --bottom-space: 0px; }

/* ---------- layout ---------- */
.app-shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; transition: grid-template-columns var(--t-slow) var(--ease); }
html.side-collapsed .app-shell { grid-template-columns: var(--side-wc) minmax(0, 1fr); }
.shell-main { min-width: 0; display: flex; flex-direction: column; }
#app { flex: 1; min-width: 0; }
/* opacity only: a transform here would trap the Explorer's fixed mobile panels */
#app.page-in > * { animation: page-fade .32s var(--ease) both; }
@keyframes page-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 22px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 12px 14px;
  background: var(--surface); border-inline-end: 1px solid var(--border); z-index: 55; overflow: hidden;
}
.side-brand { height: 40px; padding: 0 10px; }
.side-nav { display: grid; gap: 3px; }
.side-nav a, .side-sub {
  position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px;
  border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast);
}
.side-nav a svg, .side-sub svg { flex: none; width: 20px; height: 20px; }
.side-nav a:hover, .side-sub:hover { background: var(--surface-2); color: var(--text); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--primary); }
.side-nav a[aria-current="page"]::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--primary);
}
.side-foot { margin-top: auto; display: grid; gap: 6px; }
.side-sub { height: 38px; font-size: 13px; font-weight: 500; }
.side-collapse {
  justify-self: end; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer;
}
html[dir="ltr"] .side-collapse svg { transform: rotate(0deg); }
html[dir="rtl"] .side-collapse svg { transform: rotate(180deg); }
html.side-collapsed[dir="ltr"] .side-collapse svg { transform: rotate(180deg); }
html.side-collapsed[dir="rtl"] .side-collapse svg { transform: rotate(0deg); }
html.side-collapsed .side-nav a span, html.side-collapsed .side-sub span, html.side-collapsed .side-brand .brand-word { display: none; }
html.side-collapsed .side-nav a, html.side-collapsed .side-sub { justify-content: center; padding: 0; }
html.side-collapsed .side-collapse { justify-self: center; }
html.side-collapsed .side-brand { justify-content: center; padding: 0; }

/* ---------- top bar ---------- */
.topbar { gap: 14px; padding-inline: clamp(14px, 2.4vw, 32px); }
.top-brand { display: none; }
.gsearch { position: relative; flex: 1; max-width: 560px; }
.gs-field {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid transparent; color: var(--muted); transition: border-color var(--t-fast), background var(--t-fast);
}
.gs-field:focus-within { border-color: var(--secondary); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.gs-field input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; outline: none; }
.gs-field kbd { font: 600 11px var(--font-en); color: var(--faint); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }
.gs-results {
  position: absolute; inset-inline: 0; top: calc(100% + 6px); max-height: min(60vh, 460px); overflow: auto; z-index: 70;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px; box-shadow: 0 24px 60px -30px var(--shadow);
  animation: pop .18s var(--ease);
}
.gs-group { font-size: 11.5px; font-weight: 700; color: var(--faint); padding: 8px 10px 4px; }
.gs-results a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; }
.gs-results a[aria-selected="true"], .gs-results a:hover { background: var(--surface-2); }
.gs-results a i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.gs-results a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-results a em { font-style: normal; font-size: 12px; color: var(--muted); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-empty { padding: 14px; color: var(--muted); font-size: 13.5px; }
.gs-open { display: none; }
.qc-btn { gap: 8px; }
.qc-btn svg { width: 17px; height: 17px; }
.nt-wrap { position: relative; }
.nt-count {
  position: absolute; top: 4px; inset-inline-end: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--primary); color: var(--on-primary); font: 700 10px/16px var(--font-en); text-align: center;
}
.nt-panel {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: min(340px, 86vw); z-index: 70;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 8px; box-shadow: 0 24px 60px -30px var(--shadow);
  animation: pop .18s var(--ease);
}
.nt-head { font-weight: 700; font-size: 13px; padding: 8px 10px; }
.nt-panel ul { list-style: none; margin: 0; padding: 0; }
.nt-panel a { display: grid; gap: 2px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--text); font-size: 13.5px; }
.nt-panel a:hover { background: var(--surface-2); }
.nt-panel b { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.nt-overdue b { color: var(--danger); }
.nt-panel em { font-style: normal; font-size: 12px; color: var(--faint); }
.nt-empty { padding: 12px 10px 14px; color: var(--muted); font-size: 13.5px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- bottom bar (mobile) ---------- */
.bottom-nav { display: none; }

@media (max-width: 900px) {
  :root { --bottom-space: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px)); }
  .app-shell, html.side-collapsed .app-shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top-brand { display: inline-flex; }
  .top-brand .brand-word { display: none; }
  .gsearch { display: none; }
  html.gs-mobile .gsearch {
    display: block; position: fixed; inset: calc(env(safe-area-inset-top, 0px) + 8px) 10px auto; max-width: none; z-index: 80;
  }
  html.gs-mobile .gs-field { background: var(--surface); border-color: var(--secondary); height: 46px; box-shadow: 0 20px 60px -20px var(--shadow); }
  html.gs-mobile .gs-field kbd { display: none; }
  .gs-open { display: inline-grid; }
  .top-only, .qc-btn .lbl-full { display: none; }
  .header-end { gap: 2px; }
  #app { padding-bottom: var(--bottom-space); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0; z-index: 60;
    height: var(--bottom-space); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border-top: 1px solid var(--border);
  }
  .bottom-nav a, .bottom-nav button {
    display: grid; place-items: center; align-content: center; gap: 3px; min-height: 48px; border: 0; background: none;
    color: var(--muted); text-decoration: none; font: 600 11px var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav svg { width: 22px; height: 22px; transition: transform var(--t-fast) var(--ease); }
  .bottom-nav [aria-current="page"] { color: var(--primary); }
  .bottom-nav [aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }
  .sub-banner { position: sticky; top: var(--header-h); z-index: 40; }
}

/* "More" sheet */
dialog.sheet { margin: auto auto 0; width: 100%; max-width: min(560px, 100vw); box-sizing: border-box; border-radius: 22px 22px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 901px) { dialog.sheet { margin: auto; border-radius: 22px; } }
.more-sheet h2 { font-size: 1rem; margin-bottom: 10px; }
.more-list { display: grid; gap: 4px; }
.more-list a { display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 14px; border-radius: 14px; color: var(--text); text-decoration: none; font-weight: 600; }
.more-list a:hover { background: var(--surface-2); }
.more-list svg { width: 20px; height: 20px; color: var(--primary); }
.more-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.more-toggles .btn { gap: 8px; min-width: 0; padding-inline: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- section pages ---------- */
.ms { max-width: 1120px; }
.sec-lead { color: var(--muted); max-width: 62ch; margin-top: 6px; }
.sec-note { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.sec-filter { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; margin-bottom: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.sec-filter input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; outline: none; }
.ref-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.ref-list li { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; padding: 16px 18px; background: var(--surface); }
.ref-short { font: 700 13px var(--font-en); color: var(--primary); }
.ref-title { font-size: 14.5px; margin: 2px 0 4px; }
.ref-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.ref-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.ref-actions .meta { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; }
.ref-actions .meta svg { width: 14px; height: 14px; color: var(--accent); }
@media (max-width: 640px) { .ref-list li { flex-direction: column; } .ref-actions { flex-direction: row; align-items: center; } }

.pg-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-bottom: 16px; }
.pg-stat { background: var(--surface); padding: 18px; display: grid; gap: 4px; }
.pg-stat strong { font: 700 1.6rem/1 var(--font-en); color: var(--primary); font-variant-numeric: tabular-nums; }
.pg-stat span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
@media (max-width: 640px) { .pg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pg-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pg-bars li { display: grid; grid-template-columns: minmax(120px, 200px) 1fr 64px; align-items: center; gap: 12px; font-size: 13.5px; }
.pg-name { display: flex; align-items: center; gap: 8px; }
.pg-name i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.pg-bars em { font-style: normal; color: var(--muted); font-size: 12px; text-align: end; font-variant-numeric: tabular-nums; }
.pg-bar { display: block; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.pg-bar i { display: block; height: 100%; width: var(--p); background: var(--c, var(--secondary)); border-radius: inherit; animation: grow .9s var(--ease) both; transform-origin: left; }
html[dir="rtl"] .pg-bar i { transform-origin: right; }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
.acct-profile { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.acct-profile p { margin-top: 4px; }

/* academy */
.ac-systems { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ac-systems li { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); position: relative; animation: page-in .5s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.ac-systems li .tag { position: absolute; top: 18px; inset-inline-end: 18px; }
.ac-systems h2 { font-size: 1.02rem; margin-bottom: 6px; padding-inline-end: 90px; }
.ac-systems p { color: var(--muted); font-size: 13.5px; }
.ac-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--primary); }
.ac-ico svg { width: 21px; height: 21px; }
.ac-policy { margin-top: 28px; padding: 22px; border-radius: 18px; background: var(--surface-2); }
.ac-policy h2 { font-size: 1rem; margin-bottom: 6px; }
.ac-policy > p { color: var(--muted); font-size: 13.5px; max-width: 70ch; }
.ac-states { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: s; }
.ac-states li { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.ac-states b { color: var(--text); font-size: 13px; }
@media (max-width: 760px) { .ac-systems, .ac-states { grid-template-columns: 1fr; } }

/* ---------- personal Home ---------- */
.dash-page { max-width: 1120px; margin: 0 auto; padding: clamp(20px, 3.2vw, 44px) clamp(16px, 3vw, 40px) 56px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.dash-head h1 { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.3rem); letter-spacing: -0.01em; }
.dash-who { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.dash-who > span:first-child { color: var(--text); font-weight: 600; }
.dot-label { display: inline-flex; align-items: center; gap: 6px; }
.dot-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.exp-switch { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.exp-lbl { font-size: 12px; color: var(--faint); padding-inline: 8px 4px; font-weight: 600; }
.exp-switch button { height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: 600 13px var(--font); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.exp-switch button[aria-checked="true"] { background: var(--primary); color: var(--on-primary); }
.dash-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.dash-flow .blk { animation: page-in .45s var(--ease) both; }
.dash-flow .blk:nth-child(2) { animation-delay: 50ms; } .dash-flow .blk:nth-child(3) { animation-delay: 100ms; }
.dash-flow .blk:nth-child(4) { animation-delay: 150ms; } .dash-flow .blk:nth-child(5) { animation-delay: 200ms; }
.dash-hero, .dash-progress, .dash-shortcuts { grid-column: 1 / -1; }
.dash-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 380px); align-items: center; gap: 24px;
  padding: clamp(20px, 3vw, 34px); border-radius: 22px; border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--surface);
}
.dh-k { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.dash-hero h2 { font-size: clamp(1.3rem, 1rem + 1vw, 1.8rem); margin: 6px 0 8px; }
.dh-d { color: var(--muted); max-width: 46ch; }
.dh-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.dh-actions .btn { gap: 8px; }
.dh-graph { aspect-ratio: 1; width: 100%; max-width: 380px; justify-self: center; }
.dh-graph svg { width: 100%; height: 100%; }
.dash-list { padding: 20px 4px 4px; border-top: 1px solid var(--border); }
.dash-list header, .dash-progress header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.dash-list h2, .dash-progress h2 { font-size: .95rem; }
.dash-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dash-list li { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; }
.dash-list li.note { align-items: flex-start; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.dash-list li.note:last-child { border-bottom: 0; }
.dash-list .tx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dash-list em { font-style: normal; font-size: 12px; color: var(--muted); }
.dash-list em.late { color: var(--danger); }
.tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: transparent; cursor: pointer; flex: none; transition: border-color var(--t-fast), background var(--t-fast); }
.tick:hover { border-color: var(--secondary); background: var(--accent-soft); }
.ring { --p: 0; width: 20px; height: 20px; border-radius: 50%; flex: none; background: conic-gradient(var(--secondary) calc(var(--p) * 1%), var(--surface-2) 0); mask: radial-gradient(circle, transparent 5px, #000 6px); -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); }
.dash-progress { padding: 20px 22px; border-radius: 18px; background: var(--surface-2); display: grid; gap: 12px; }
.dp-row { display: grid; grid-template-columns: minmax(0, 220px) 1fr auto; gap: 14px; align-items: center; font-size: 13.5px; color: var(--muted); }
.dp-row em { font-style: normal; font-size: 12px; }
.dash-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dash-shortcuts a {
  display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px;
  transition: border-color var(--t-fast), transform var(--t-fast) var(--ease);
}
.dash-shortcuts a:hover { border-color: var(--secondary); transform: translateY(-1px); }
.dash-shortcuts svg { width: 19px; height: 19px; color: var(--primary); flex: none; }
.dash-foot { margin-top: 28px; display: grid; justify-items: start; gap: 10px; }
.dash-foot .link-btn { display: inline-flex; align-items: center; gap: 6px; }
.dash-custom { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { accent-color: var(--primary); width: 16px; height: 16px; }
@media (max-width: 960px) { .dash-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .dash-flow { grid-template-columns: minmax(0, 1fr); }
  .dash-hero { grid-template-columns: 1fr; }
  .dh-graph { max-width: 260px; order: -1; }
  .dash-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exp-switch { width: 100%; overflow-x: auto; }
  .exp-lbl { display: none; }
  .exp-switch button { flex: 1; white-space: nowrap; }
  .dp-row { grid-template-columns: 1fr auto; } .dp-row .pg-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* explorer: layer label */
.lens-lbl { position: relative; z-index: 1; font-size: 11.5px; font-weight: 700; color: var(--faint); padding-inline: 8px 6px; align-self: center; }
@media (max-width: 640px) { .lens-lbl { display: none; } }

@media (prefers-reduced-motion: reduce) {
  #app.page-in > *, .dash-flow .blk, .ac-systems li, .pg-bar i, .gs-results, .nt-panel { animation: none !important; }
  .app-shell { transition: none; }
}

/* ---------- Academy: Exam Lab ---------- */
.ac-systems li.ready { border-color: var(--secondary); background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--surface); }
.ac-start { margin-top: 14px; }
.ac-recent { margin-top: 26px; }
.ac-recent:empty { display: none; }
.ac-recent h2 { font-size: 1rem; margin-bottom: 10px; }
.ac-recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ac-recent-list li { display: grid; grid-template-columns: 70px minmax(0, 1fr) 60px minmax(80px, 160px); gap: 12px; align-items: center; font-size: 13.5px; color: var(--muted); }
.ac-recent-list strong { color: var(--text); font-variant-numeric: tabular-nums; }
.ac-focus { max-width: 760px; margin-inline: auto; }
.ex-run-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.ex-run-head .link-btn { display: inline-flex; align-items: center; gap: 6px; }
.ex-count { font-weight: 700; font-size: 14px; }
.ex-timer { font: 700 15px var(--font-en); font-variant-numeric: tabular-nums; color: var(--primary); padding: 4px 10px; border-radius: 8px; background: var(--accent-soft); }
.ex-timer.low { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.ex-progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-bottom: 24px; }
.ex-progress i { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .4s var(--ease); }
.ac-setup h1 { margin: 4px 0 8px; }
.ac-form { display: grid; gap: 18px; margin-top: 22px; padding: 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.ac-form fieldset { border: 0; padding: 0; margin: 0; }
.ac-form legend { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.ac-form select { height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; }
.ex-q { padding: clamp(20px, 3vw, 32px); border-radius: 22px; background: var(--surface); border: 1px solid var(--border); animation: page-fade .3s var(--ease); }
.ex-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.ex-meta > span:not(.tag) + span:not(.tag)::before { content: "·"; margin-inline-end: 8px; }
.ex-prompt { font-size: clamp(1.08rem, .95rem + .6vw, 1.32rem); line-height: 1.65; margin-bottom: 20px; }
.ex-opts, .ex-tf { display: grid; gap: 10px; }
.ex-tf { grid-template-columns: 1fr 1fr; }
.ex-opt { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid var(--border); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.ex-opt:hover { border-color: var(--secondary); }
.ex-opt input { accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.ex-opt:has(input:checked) { border-color: var(--primary); background: var(--accent-soft); }
.ex-opt:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-soft); }
.ex-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ex-order li { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); }
.ex-order .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font: 700 12px var(--font-en); flex: none; }
.ex-order .tx { flex: 1; }
.ex-order .icon-btn { width: 36px; height: 36px; font-size: 11px; }
.ex-match { display: grid; gap: 10px; }
.ex-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); }
.ex-pair select { height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; min-width: 0; }
.ex-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.ex-score { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 18px; }
.ex-ring { --p: 0; width: 116px; height: 116px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(circle, var(--surface) 62%, transparent 63%), conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-2) 0); animation: page-fade .6s var(--ease); }
.ex-ring strong { font: 800 1.6rem var(--font-en); color: var(--primary); }
.ex-review { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ex-review li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ex-review li > span { flex: 1; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.ex-review li > span i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.ex-answers { display: grid; gap: 12px; margin: 18px 0; }
.ex-ans { padding: 18px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--border); }
.ex-ans.ok { border-inline-start-color: #2FA37A; } .ex-ans.bad { border-inline-start-color: var(--danger); }
.ex-ans header { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ex-ans .n { font: 700 12px var(--font-en); color: var(--muted); }
.ex-ans .badge { font-size: 12px; font-weight: 700; } .ex-ans.ok .badge { color: #2FA37A; } .ex-ans.bad .badge { color: var(--danger); }
.ex-ans h3 { font-size: 15px; margin-bottom: 8px; line-height: 1.6; }
.ex-ans p { font-size: 14px; margin-top: 4px; }
.ex-expl { color: var(--muted); padding: 10px 12px; border-radius: 12px; background: var(--surface-2); margin-top: 10px !important; }
@media (max-width: 640px) {
  .ex-tf, .ex-pair { grid-template-columns: 1fr; }
  .ex-nav { position: sticky; bottom: calc(var(--bottom-space) + 8px); background: var(--bg); padding: 10px 0; }
  .ac-recent-list li { grid-template-columns: 60px minmax(0, 1fr) 50px; } .ac-recent-list .pg-bar { display: none; }
}

/* ---------- learning tools ---------- */
.ac-list { margin-top: 18px; }
.ac-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ac-items button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; text-align: start; padding: 18px 20px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; transition: border-color var(--t-fast), transform var(--t-fast) var(--ease); }
.ac-items button:hover { border-color: var(--secondary); transform: translateY(-1px); }
.ac-item-t { font-weight: 700; font-size: 15.5px; }
.ac-items .ex-meta { grid-column: 1; margin: 0; }
.ac-go { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--primary); }
html[dir="rtl"] .ac-go svg { transform: scaleX(-1); }
.sim-note { margin-top: 14px; }
.case-file { margin-bottom: 14px; padding: 14px 18px; border-radius: 16px; background: var(--surface-2); }
.case-file summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.case-file dl { display: grid; gap: 10px; margin: 12px 0 0; }
.case-file dt { font-size: 12px; color: var(--muted); font-weight: 700; } .case-file dd { margin: 2px 0 0; font-size: 14.5px; line-height: 1.7; }
.case-info { line-height: 1.8; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); }
.ex-opt.is-right { border-color: #2FA37A; background: rgba(47,163,122,.12); }
.ex-opt.is-wrong { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); }
button.ex-opt { width: 100%; text-align: start; font: inherit; color: var(--text); background: var(--surface); }
.flowchart { list-style: none; margin: 0; padding: 0; position: relative; }
.flowchart li { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 14px; padding-bottom: 18px; }
.flowchart li::before { content: ""; position: absolute; inset-inline-start: 10px; top: 22px; bottom: 0; width: 2px; background: var(--border); }
.flowchart li:last-child::before { display: none; }
.fc-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--secondary); background: var(--surface); margin-top: 2px; }
.fc-done .fc-dot { background: var(--secondary); }
.fc-current .fc-dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 5px var(--accent-soft); }
.flowchart b { font-size: 12.5px; color: var(--accent); }
.flowchart p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.fc-current > div { padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); animation: page-fade .3s var(--ease); }
.fc-current .fc-text { color: var(--text); font-size: 15.5px; line-height: 1.7; margin-bottom: 14px; }
.fc-choice { display: flex; gap: 6px; align-items: center; color: var(--text) !important; font-weight: 600; }
.fc-choice svg { width: 14px; height: 14px; color: var(--primary); } html[dir="rtl"] .fc-choice svg { transform: scaleX(-1); }
.fc-opts { display: grid; gap: 8px; margin-bottom: 4px; }
.fc-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fc-compare h3 { font-size: 13px; margin-bottom: 8px; }
.fc-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fc-mini li { padding: 8px 10px; border-radius: 10px; font-size: 12.5px; display: grid; gap: 2px; border: 1px solid var(--border); }
.fc-mini li.match { border-color: color-mix(in srgb, #2FA37A 50%, transparent); background: rgba(47,163,122,.07); }
.fc-mini li.diff { border-style: dashed; }
.fc-mini span { color: var(--muted); }
.spot { display: grid; gap: 12px; }
.spot-tools { display: flex; gap: 6px; justify-content: flex-end; }
.spot-frame { overflow: auto; max-height: 70vh; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); touch-action: pan-x pan-y; }
.spot-canvas { margin: 0 auto; max-width: none; min-width: 100%; transition: width .25s var(--ease); }
.spot-canvas svg { display: block; width: 100%; height: auto; max-height: none; }
.spot-mark { fill: var(--primary); stroke: #fff; stroke-width: 3; }
.spot-mark.ok { fill: #2FA37A; } .spot-mark.bad { fill: var(--danger); }
.spot-target { fill: rgba(47,163,122,.18); stroke: #2FA37A; stroke-width: 3; stroke-dasharray: 6 4; }
:root { --sp-bone: #EADFC9; --sp-bone-line: #C9B79A; --sp-pdl: #F6EFE2; --sp-dentin: #F2E3B8; --sp-cementum: #B9A06A; --sp-enamel: #FBFCFD; --sp-outline: #8FA3B3; --sp-pulp: #E58A8A; --sp-gingiva: #EFA7A7; }
:root[data-theme="dark"] { --sp-bone: #4A4436; --sp-bone-line: #6B624E; --sp-pdl: #2C3A46; --sp-dentin: #8F8159; --sp-cementum: #B9A06A; --sp-enamel: #DDE6EC; --sp-outline: #9FB4C4; --sp-pulp: #C66A6A; --sp-gingiva: #B9787A; }
.cq-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.cq-bar .sec-filter { flex: 1 1 240px; margin: 0; }
.cq-bar select { height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.cq-form { display: grid; gap: 12px; margin-bottom: 14px; }
.cq-form input, .cq-form textarea, .cq-form select { width: 100%; }
.cq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cq-list li { display: flex; gap: 14px; justify-content: space-between; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.cq-main h3 { font-size: 15.5px; margin: 6px 0 4px; } .cq-main p { margin: 4px 0; font-size: 14px; color: var(--muted); }
.cq-ans { color: var(--text) !important; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.cq-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cq-act { display: flex; flex-direction: column; gap: 6px; flex: none; }
.cq-st { display: inline-flex; height: 22px; align-items: center; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.cq-researching { background: var(--warn-soft); color: var(--warn); } .cq-answered { background: rgba(47,163,122,.14); color: #1F8A63; } .cq-review { background: var(--accent-soft); color: var(--primary); }
.tm-letters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.tm-letters button { min-width: 34px; height: 32px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 600 13px var(--font); cursor: pointer; }
.tm-letters button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tm-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.tm-list button { width: 100%; text-align: start; display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color var(--t-fast); }
.tm-list button:hover { border-color: var(--secondary); }
.tm-main { font-weight: 700; } .tm-sub { font-size: 12.5px; color: var(--muted); text-align: start; }
.tm-card h2 { font-size: 1.4rem; margin: 6px 0 2px; } .tm-alt { color: var(--muted); }
.tm-def { font-size: 15px; line-height: 1.8; margin: 14px 0; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.cd-levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.cd-level { display: grid; gap: 4px; text-align: start; padding: 16px; border-radius: 16px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.cd-level span { font-size: 13px; color: var(--muted); }
.cd-level[aria-pressed="true"] { border-color: var(--primary); background: var(--accent-soft); }
.cd-pair { display: grid; grid-template-columns: 1fr minmax(120px, 2fr) 1fr; align-items: center; gap: 8px; text-align: center; font-weight: 700; margin-bottom: 10px; }
.cd-mini { width: 100%; height: auto; }
.cd-edge { fill: none; stroke: var(--border-strong); stroke-width: 3; stroke-dasharray: 6 6; transition: stroke .4s; }
.cd-mini.lit .cd-edge { stroke: var(--primary); stroke-dasharray: none; animation: dash .8s var(--ease); }
@keyframes dash { from { stroke-dashoffset: 300; stroke-dasharray: 300; } to { stroke-dashoffset: 0; stroke-dasharray: 300; } }
.cd-explain { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.cd-explain.ok b { color: #2FA37A; } .cd-explain.bad b { color: var(--danger); }
.un-wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr); gap: 20px; align-items: start; }
.un-graph { aspect-ratio: 1; width: 100%; max-width: 560px; justify-self: center; }
.un-graph svg { width: 100%; height: 100%; }
.un-legend { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.un-legend li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.un-legend b { font-variant-numeric: tabular-nums; }
.un-dot { width: 12px; height: 12px; border-radius: 50%; }
.un-unexplored { background: var(--surface-3); border: 1px solid var(--border-strong); } .un-visited { background: #9BB7C9; } .un-studied { background: #65B8BB; }
.un-passed { background: #2FA37A; } .un-review { background: #E0A63B; } .un-mastered { background: #0D5364; }
:root[data-theme="dark"] .un-mastered { background: #64D6C7; }
.un-rules { font-size: 13px; margin-bottom: 12px; } .un-rules summary { cursor: pointer; font-weight: 700; } .un-rules ul { margin: 8px 0 0; padding-inline-start: 18px; color: var(--muted); display: grid; gap: 6px; }
svg.nx.has-status g.node:not([class*="st-"]) .bar, svg.nx.has-status g.node:not([class*="st-"]) .glyph { opacity: .35; }
g.node[class*="st-"] .bar, g.node[class*="st-"] .glyph { transition: fill .4s, stroke .4s; }
g.node.st-visited .bar, g.node.st-visited .glyph { fill: #9BB7C9 !important; stroke: #9BB7C9 !important; }
g.node.st-studied .bar, g.node.st-studied .glyph { fill: #65B8BB !important; stroke: #65B8BB !important; }
g.node.st-passed .bar, g.node.st-passed .glyph { fill: #2FA37A !important; stroke: #2FA37A !important; }
g.node.st-review .bar, g.node.st-review .glyph { fill: #E0A63B !important; stroke: #E0A63B !important; }
g.node.st-mastered .bar, g.node.st-mastered .glyph, g.node.st-done .bar, g.node.st-done .glyph { fill: var(--primary) !important; stroke: var(--primary) !important; }
g.node.st-current .bar, g.node.st-current .glyph { fill: #E0A63B !important; stroke: #E0A63B !important; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .45; } }
.rv-card { padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--c, var(--secondary)); display: grid; gap: 10px; max-width: 680px; }
.rv-card h2 { font-size: 1.4rem; } .rv-desc { line-height: 1.8; } .rv-actions { margin-top: 8px; }
.rv-empty { padding: 26px; border-radius: 20px; background: var(--surface-2); display: grid; gap: 10px; justify-items: start; }
.pg-mini { display: flex; flex-wrap: wrap; gap: 18px; color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.tb-missions { gap: 6px; } .tb-missions span { font-size: 12.5px; font-weight: 700; }
.mission-layer { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.mission-layer > * { pointer-events: auto; }
.ms-drawer { position: absolute; top: 12px; inset-inline-start: 12px; width: min(360px, calc(100% - 24px)); max-height: calc(100% - 90px); overflow: auto; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 24px 60px -30px var(--shadow); animation: pop .2s var(--ease); }
.ms-drawer header { display: flex; justify-content: space-between; align-items: center; } .ms-drawer h2 { font-size: 1rem; }
.ms-drawer ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.ms-drawer li button { width: 100%; text-align: start; display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.ms-drawer li button:hover { border-color: var(--secondary); }
.ms-drawer li span { font-size: 12.5px; color: var(--muted); }
.ms-prog { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; } .ms-prog em { font-style: normal; font-size: 12px; }
.ms-card { position: absolute; inset-inline: 12px; bottom: 70px; margin: 0 auto; max-width: 560px; padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--c, var(--secondary)); box-shadow: 0 30px 70px -30px var(--shadow); max-height: 62%; overflow: auto; animation: page-fade .3s var(--ease); }
.ms-card header { display: flex; align-items: center; gap: 10px; } .ms-card header b { flex: 1; font-size: 13px; color: var(--accent); }
.ms-step { font-size: 12px; color: var(--muted); }
.ms-dots { display: flex; gap: 4px; margin: 10px 0; } .ms-dots i { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-2); } .ms-dots i.done { background: var(--secondary); } .ms-dots i.cur { background: var(--primary); }
.ms-card h3 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; } .ms-card h3 i { width: 10px; height: 10px; border-radius: 50%; }
.ms-desc { color: var(--muted); font-size: 13.5px; line-height: 1.7; margin: 6px 0 10px; }
.ms-q { font-weight: 700; font-size: 14px; margin-bottom: 8px; } .ms-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.ms-opts .ex-opt { min-height: 44px; padding: 8px 12px; font-size: 13.5px; }
.dash-daily { grid-column: 1 / -1; padding: clamp(18px, 2.6vw, 28px); border-radius: 22px; background: var(--surface); border: 1px solid var(--border); }
.dn-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.dn-head h2 { font-size: 1.2rem; margin-top: 4px; }
.ex-ring.sm { width: 62px; height: 62px; } .ex-ring.sm strong { font-size: .95rem; }
.dn-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dn-part { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.dn-part:first-child { border-top: 0; }
.dn-part b { font-size: 12.5px; color: var(--accent); } .dn-part p { margin: 4px 0 8px; font-size: 14px; }
.dn-check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: var(--on-primary); }
.dn-part.is-done .dn-check { background: #2FA37A; border-color: #2FA37A; } .dn-check svg { width: 14px; height: 14px; }
.dn-part.is-done p { color: var(--muted); }
.dn-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.dn-complete { display: flex; align-items: center; gap: 8px; color: #1F8A63; font-weight: 700; margin-top: 10px; } .dn-complete svg { width: 18px; height: 18px; }
@media (max-width: 760px) { .fc-compare, .un-wrap, .cd-levels { grid-template-columns: 1fr; } .ms-opts { grid-template-columns: 1fr; } .ms-card { bottom: 64px; max-height: 70%; } .cq-list li { flex-direction: column; } .cq-act { flex-direction: row; } }

/* ---------- shell modes: visitors and members without a subscription see no platform navigation ---------- */
.pub-nav { display: none; gap: 4px; }
.pub-nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.pub-nav a:hover { color: var(--text); background: var(--surface-2); }
html[data-shell="public"] .app-shell, html[data-shell="member"] .app-shell { grid-template-columns: minmax(0, 1fr); }
html[data-shell="public"] .side, html[data-shell="member"] .side, html[data-shell="public"] .bottom-nav, html[data-shell="member"] .bottom-nav { display: none !important; }
html[data-shell="public"] .top-brand, html[data-shell="member"] .top-brand { display: inline-flex; }
html[data-shell="public"] .top-brand .brand-word, html[data-shell="member"] .top-brand .brand-word { display: inline; }
html[data-shell="public"] .pub-nav, html[data-shell="member"] .pub-nav { display: flex; margin-inline-start: 12px; flex: 1; }
html[data-shell="public"] .gsearch, html[data-shell="member"] .gsearch, html[data-shell="public"] .gs-open, html[data-shell="member"] .gs-open,
html[data-shell="public"] .qc-btn, html[data-shell="member"] .qc-btn, html[data-shell="public"] .nt-wrap { display: none !important; }
html[data-shell="public"] #app, html[data-shell="member"] #app { padding-bottom: 0; }
.pub-activate { text-decoration: none; font-weight: 700; }
@media (max-width: 900px) {
  html[data-shell="public"] .pub-nav, html[data-shell="member"] .pub-nav { display: none; }
  html[data-shell="public"] .top-brand .brand-word, html[data-shell="member"] .top-brand .brand-word { display: none; }
  html[data-shell="public"] .top-only, html[data-shell="member"] .top-only { display: inline-grid; }
  .pub-activate { font-size: 12.5px; padding-inline: 10px; }
}

/* ---------- public pages ---------- */
.pub-page { max-width: 880px; margin: 0 auto; padding: clamp(24px, 4vw, 56px) clamp(16px, 3vw, 32px) 40px; }
.pub-page h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); margin-bottom: 12px; }
.faq { display: grid; gap: 10px; margin-top: 18px; }
.faq details, .pp-faq details { padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.faq summary, .pp-faq summary { cursor: pointer; font-weight: 700; } .faq p, .pp-faq p { margin-top: 10px; color: var(--muted); line-height: 1.8; }
.lg-sec { margin-top: 22px; } .lg-sec h2 { font-size: 1.05rem; margin-bottom: 6px; } .lg-sec p { color: var(--muted); line-height: 1.9; }
.pub-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 18px; }
.pub-card { display: grid; gap: 6px; padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.pub-card svg { width: 22px; height: 22px; color: var(--primary); } .pub-card span { color: var(--muted); font-size: 14px; }
.pub-footer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); display: grid; gap: 10px; justify-items: center; text-align: center; }
.pub-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.pub-footer a { color: var(--muted); text-decoration: none; font-size: 13.5px; } .pub-footer a:hover { color: var(--primary); }
.member-gate { display: grid; align-content: start; min-height: calc(100dvh - var(--header-h)); }
.mg-card { text-align: center; display: grid; gap: 12px; justify-items: center; padding: clamp(28px, 4vw, 44px); border-radius: 26px; background: linear-gradient(170deg, var(--accent-soft), transparent 60%), var(--surface); border: 1px solid var(--border); margin-top: 6vh; }
.mg-card .row { justify-content: center; gap: 18px; }

/* ---------- landing additions ---------- */
.showcase, .try, .pub-price { padding: clamp(40px, 6vw, 80px) var(--gutter); max-width: 1200px; margin: 0 auto; }
.showcase h2, .try h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); margin-bottom: 8px; }
.sc-grid { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sc-grid li { padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 8px; animation: page-in .5s var(--ease) both; animation-delay: calc(var(--i) * 70ms); transition: transform var(--t-fast) var(--ease), border-color var(--t-fast); }
.sc-grid li:hover { transform: translateY(-2px); border-color: var(--secondary); }
.sc-grid h3 { font-size: 1.02rem; } .sc-grid p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.try { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.try-copy p { color: var(--muted); line-height: 1.8; }
.try-card { padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 30px 70px -50px var(--shadow); display: grid; gap: 12px; }
.try-card h3 { font-size: 1.1rem; } .try-ex { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); line-height: 1.7; }
.pub-price { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.pp-card { padding: clamp(24px, 3vw, 36px); border-radius: 26px; border: 1px solid var(--secondary); background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--surface); display: grid; gap: 14px; }
.pp-card h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.pp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pp-faq { display: grid; gap: 10px; } .pp-faq h3 { font-size: 1.05rem; }
@media (max-width: 860px) { .sc-grid { grid-template-columns: 1fr 1fr; } .try, .pub-price { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .sc-grid { grid-template-columns: 1fr; } }

/* ---------- avatars ---------- */
.av { position: relative; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none; background: linear-gradient(140deg, var(--primary), var(--secondary)); color: #fff; font-weight: 800; font-family: var(--font-en); }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; } .av.has-img img { opacity: 1; } .av.has-img b { opacity: 0; }
.av-sm { width: 32px; height: 32px; font-size: 12px; } .av-md { width: 40px; height: 40px; font-size: 14px; } .av-lg { width: 56px; height: 56px; font-size: 19px; } .av-xl { width: 96px; height: 96px; font-size: 30px; }
.av-preset { background: var(--accent-soft); } .av-preset svg { width: 60%; height: 60%; fill: none; stroke: var(--primary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.acct-btn { padding: 2px !important; } .acct-btn .av { pointer-events: none; }
.dash-hello { display: flex; align-items: center; gap: 14px; } .dash-sub { color: var(--muted); margin-top: 4px; }
.dash-nudge { margin-top: 22px; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 14px; }

/* ---------- profile editor + onboarding ---------- */
.pf-edit { display: grid; gap: 14px; margin: 10px 0 16px; }
.pf-photo { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.pf-photo-act { display: grid; gap: 8px; justify-items: start; }
.pf-upload { cursor: pointer; }
.pf-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.av-pick { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.av-pick svg { width: 20px; height: 20px; fill: none; stroke: var(--primary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.av-pick.on { border-color: var(--primary); background: var(--accent-soft); }
.pf-crop { grid-column: 1 / -1; display: grid; gap: 8px; justify-items: center; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.pf-crop canvas { width: 200px; height: 200px; border-radius: 50%; cursor: grab; touch-action: none; background: var(--surface); }
.segmented.wrap { flex-wrap: wrap; }
.chip-check input { position: absolute; opacity: 0; } .chip-check span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.chip-check span i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); } .chip-check input:checked + span { border-color: var(--primary); background: var(--accent-soft); }
dialog.onb-dialog { width: min(640px, 100vw); max-width: 100vw; padding: 0; overflow: hidden; }
.onb { position: relative; }
.onb-step { display: none; padding: clamp(24px, 4vw, 40px); text-align: center; animation: page-fade .45s var(--ease); }
.onb[data-step="1"] .s1, .onb[data-step="2"] .s2, .onb[data-step="3"] .s3 { display: grid; gap: 12px; justify-items: center; }
.onb .s2 { text-align: start; justify-items: stretch !important; max-height: 82vh; overflow: auto; }
.onb-rings { width: 170px; height: 170px; }
.onb-rings circle { fill: none; stroke: var(--secondary); stroke-width: 1.4; opacity: 0; transform-origin: 100px 100px; animation: ring-in 1s var(--ease) forwards; animation-delay: var(--d); }
.onb-rings .dot { fill: var(--primary); stroke: none; animation-name: dot-in; }
@keyframes ring-in { from { opacity: 0; transform: scale(.6) rotate(-30deg); } to { opacity: .8; transform: none; } }
@keyframes dot-in { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: none; } }
.onb-sub { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--primary); font-weight: 700; font-size: 13.5px; }
.onb-sub svg { width: 16px; height: 16px; }
.onb-av { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.onb-halo { position: absolute; inset: 0; } .onb-halo circle { fill: none; stroke: var(--secondary); stroke-width: 2.5; stroke-dasharray: 352; stroke-dashoffset: 352; animation: halo 1.4s var(--ease) forwards; transform: rotate(-90deg); transform-origin: 60px 60px; }
@keyframes halo { to { stroke-dashoffset: 0; } }

/* ---------- identity + devices ---------- */
.id-card { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(200px, 260px); gap: 22px; align-items: center; padding: clamp(20px, 3vw, 30px); border-radius: 24px; background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--surface); border: 1px solid var(--border); margin-bottom: 16px; }
.id-main h2 { font-size: 1.5rem; } .id-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); margin: 4px 0 10px; } .id-meta span + span::before { content: "·"; margin-inline-end: 8px; }
.id-main .row { margin-top: 10px; }
.id-sub { display: grid; gap: 4px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.id-sub.on { border-color: color-mix(in srgb, #2FA37A 40%, transparent); } .id-sub .lbl { font-size: 12px; color: var(--accent); font-weight: 700; } .id-sub strong { font-size: 1.1rem; }
@media (max-width: 760px) { .id-card { grid-template-columns: 1fr; text-align: center; justify-items: center; } .id-main .row, .id-main .chips { justify-content: center; } }
.dv-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.dv-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); }
.dv-list li > div { flex: 1; } .dv-ico { font-size: 22px; }
.dv-events { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.dv-events li { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.dv-events em { font-style: normal; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ss-dlg { text-align: center; display: grid; gap: 10px; justify-items: center; } .ss-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--primary); }
.ss-devices { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; text-align: start; }
.ss-devices li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); } .btn-mini.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

/* ---------- admin ---------- */
.adm2 { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; max-width: 1320px; }
.adm-side { position: sticky; top: calc(var(--header-h) + 16px); align-self: start; display: grid; gap: 10px; }
.adm-side nav { display: grid; gap: 3px; }
.adm-side nav button { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: 600 14px var(--font); cursor: pointer; text-align: start; }
.adm-side nav button svg { width: 18px; height: 18px; flex: none; }
.adm-side nav button:hover { background: var(--surface-2); color: var(--text); }
.adm-side nav button[aria-current="page"] { background: var(--accent-soft); color: var(--primary); }
.adm-main { min-width: 0; } .adm2 .adm-head h1 { font-family: var(--font); font-size: 1.6rem; } .adm2 .adm-head { margin-bottom: 14px; }
.hm-card { text-align: start; cursor: pointer; font: inherit; color: var(--text); } .hm-card:hover { border-color: var(--secondary); }
.help { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font: 700 11px var(--font-en); cursor: pointer; vertical-align: middle; margin-inline-start: 4px; }
.help:hover { color: var(--primary); border-color: var(--primary); }
.adm-empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 16px; }
.adm-loading { display: grid; justify-items: center; gap: 10px; padding: 36px; } .adm-error code { display: block; margin-top: 10px; font-size: 12px; color: var(--muted); word-break: break-all; }
.ms-table.hover tbody tr { cursor: pointer; } .ms-table.hover tbody tr:hover td, .ms-table.hover tbody tr:focus td { background: var(--surface-2); }
.th-sort { border: 0; background: none; font: inherit; font-weight: 800; color: inherit; cursor: pointer; padding: 0; }
.ud h3 { font-size: .95rem; margin: 16px 0 8px; } .ud-actions { display: flex; flex-wrap: wrap; gap: 8px; }
dialog.user-detail { width: min(620px, 100vw); }
.rv-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.rv-groups button { display: grid; gap: 2px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: start; }
.rv-groups b { font-size: 1.3rem; font-family: var(--font-en); } .rv-groups span { font-size: 12.5px; color: var(--muted); }
.rv-groups button[aria-pressed="true"] { border-color: var(--primary); background: var(--accent-soft); }
.rq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rq-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); }
.rq-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.sg-toggle { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
dialog.wizard { width: min(760px, 100vw); } .wz-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.wz-opts { display: grid; gap: 6px; } .wz-opts .row { flex-wrap: nowrap; } .wz-opts input[type=text], .wz-opts input:not([type]) { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; }
.wz-bi .fld { flex: 1; min-width: 0; } .wz-preview { max-height: 260px; overflow: auto; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 12px; }
@media (max-width: 900px) {
  .adm2 { grid-template-columns: 1fr; }
  .adm-side { position: static; } .adm-side .ms-kicker { display: none; }
  .adm-side nav { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; } .adm-side nav button { white-space: nowrap; flex: none; border: 1px solid var(--border); }
  .rv-groups { grid-template-columns: 1fr 1fr; } .wz-kinds { grid-template-columns: 1fr 1fr; } .rq-list li { flex-direction: column; align-items: flex-start; } .wz-opts .row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .onb-rings circle, .onb-halo circle, .sc-grid li { animation: none !important; opacity: 1; stroke-dashoffset: 0; } }

/* ---------- quiz results, share, challenge, sources ---------- */
.tq-cta { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px 20px; border-radius: 18px; background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--surface); border: 1px solid var(--border); margin-bottom: 14px; }
.tq-cta h2 { font-size: 1.05rem; }
.tm-src { margin-top: 12px; font-size: 13.5px; } .tm-src a { color: var(--primary); }
.rs-card { padding: clamp(20px, 3vw, 32px); border-radius: 24px; background: linear-gradient(160deg, var(--accent-soft), transparent 60%), var(--surface); border: 1px solid var(--border); display: grid; gap: 18px; margin-bottom: 16px; animation: page-fade .4s var(--ease); }
.rs-who { display: flex; align-items: center; gap: 12px; } .rs-who b { display: block; } .rs-who .meta { font-size: 12.5px; }
.rs-main { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; } .rs-ring { width: 132px; height: 132px; } .rs-ring strong { font-size: 1.9rem; }
.rs-main h1 { font-size: clamp(1.3rem, 1rem + 1vw, 1.8rem); margin: 4px 0 8px; }
.rs-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 13px; justify-content: inherit; } .rs-meta span + span::before { content: "·"; margin-inline-end: 6px; }
.rs-split { display: flex; gap: 14px; margin-top: 8px; font-weight: 700; font-size: 14px; } .rs-split .ok { color: #1F8A63; } .rs-split .bad { color: var(--danger); }
.rs-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-wrong { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } .rs-wrong li { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); }
.chip-static.ok i { background: #2FA37A; }
.sh-canvas { width: 100%; max-width: 360px; aspect-ratio: 1; border-radius: 16px; border: 1px solid var(--border); display: block; margin: 12px auto; }
.ch-link { width: 100%; height: 42px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); margin-bottom: 8px; }
.cmp { text-align: center; display: grid; gap: 16px; } .cmp h1 { font-size: 1.6rem; }
.cmp-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.cmp-side { display: grid; gap: 4px; padding: 20px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--surface); }
.cmp-side.win { border-color: #2FA37A; box-shadow: 0 20px 50px -30px rgba(47,163,122,.5); } .cmp-side strong { font: 800 2rem var(--font-en); color: var(--primary); } .cmp-side .lbl { font-size: 12px; color: var(--muted); font-weight: 700; }
.cmp-vs { font: 800 1.1rem var(--font-en); color: var(--faint); }
@media (max-width: 560px) { .cmp-grid { grid-template-columns: 1fr; } }
.rv-groups.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.src-list li.flag { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 6%, transparent); }
.src-list select { height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; padding: 0 8px; }
.pub-toggle { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font: 700 12.5px var(--font); cursor: pointer; }
.pub-toggle.on { background: rgba(47,163,122,.14); color: #1F8A63; border-color: transparent; }
.soon { text-align: center; display: grid; gap: 10px; justify-items: center; }

/* ---------- colour palettes (Platform appearance). Status and specialty colours are not overridden. ---------- */
:root[data-palette="sage"]:not([data-theme="dark"]) { --primary: #4F6F52; --primary-hover: #3F5B42; --on-primary: #FFFFFF; --secondary: #8FAE8B; --accent: #5E8C61; --accent-soft: rgba(94,140,97,.13); --bg: #F5F8F3; --surface-2: #ECF2E9; --border: #DDE7D8; --bg-wash: none; }
:root[data-palette="sage"][data-theme="dark"] { --primary: #9CCB9A; --primary-hover: #B3D9B1; --on-primary: #10151C; --secondary: #6F9A6C; --accent: #9CCB9A; --accent-soft: rgba(156,203,154,.14); --bg: #0F1712; --surface: #17221B; --surface-2: #1D2B22; --border: #2C4033; --bg-wash: none; }
:root[data-palette="sand"]:not([data-theme="dark"]) { --primary: #8A6A3B; --primary-hover: #73582F; --on-primary: #FFFFFF; --secondary: #C8A96A; --accent: #A07D45; --accent-soft: rgba(160,125,69,.13); --bg: #FAF7F1; --surface-2: #F3EDE1; --border: #E7DDCB; --bg-wash: none; }
:root[data-palette="sand"][data-theme="dark"] { --primary: #E2C48C; --primary-hover: #EBD3A6; --on-primary: #10151C; --secondary: #B8995C; --accent: #E2C48C; --accent-soft: rgba(226,196,140,.14); --bg: #17140E; --surface: #221D15; --surface-2: #2A241A; --border: #42392A; --bg-wash: none; }
:root[data-palette="lavender"]:not([data-theme="dark"]) { --primary: #5E4E8C; --primary-hover: #4C3F74; --on-primary: #FFFFFF; --secondary: #A898D0; --accent: #7666AE; --accent-soft: rgba(118,102,174,.13); --bg: #F7F6FC; --surface-2: #EFEDF8; --border: #E1DDF0; --bg-wash: none; }
:root[data-palette="lavender"][data-theme="dark"] { --primary: #C3B6F0; --primary-hover: #D3C9F5; --on-primary: #10151C; --secondary: #9585C8; --accent: #C3B6F0; --accent-soft: rgba(195,182,240,.14); --bg: #13111C; --surface: #1C1929; --surface-2: #242036; --border: #383252; --bg-wash: none; }
:root[data-palette="peach"]:not([data-theme="dark"]) { --primary: #A0583A; --primary-hover: #86482F; --on-primary: #FFFFFF; --secondary: #E2A07F; --accent: #C0704E; --accent-soft: rgba(192,112,78,.13); --bg: #FCF7F4; --surface-2: #F7ECE6; --border: #EEDDD3; --bg-wash: none; }
:root[data-palette="peach"][data-theme="dark"] { --primary: #F2B293; --primary-hover: #F6C6AE; --on-primary: #10151C; --secondary: #C9876A; --accent: #F2B293; --accent-soft: rgba(242,178,147,.14); --bg: #19120F; --surface: #241A16; --surface-2: #2D211C; --border: #46332B; --bg-wash: none; }
:root[data-palette="classic"]:not([data-theme="dark"]) { --primary: #2C3E63; --primary-hover: #22314F; --on-primary: #FFFFFF; --secondary: #7A8450; --accent: #3F5482; --accent-soft: rgba(63,84,130,.12); --bg: #F7F6F2; --surface-2: #EEEDE6; --border: #E0DED4; --bg-wash: none; }
:root[data-palette="classic"][data-theme="dark"] { --primary: #A9B9E0; --primary-hover: #BFCBEA; --on-primary: #10151C; --secondary: #B3BC80; --accent: #A9B9E0; --accent-soft: rgba(169,185,224,.14); --bg: #0E1320; --surface: #161D2E; --surface-2: #1D2639; --border: #2E3A55; --bg-wash: none; }
html[data-palette] body { transition: background-color .25s ease; }
.pal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; max-height: 58vh; overflow: auto; padding: 2px; }
.pal-card { position: relative; display: grid; gap: 6px; text-align: start; padding: 12px; border-radius: 18px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .2s, transform .2s var(--ease); }
.pal-card:hover { transform: translateY(-1px); } .pal-card.on { border-color: var(--text); box-shadow: 0 0 0 1px var(--text) inset; }
.pal-card b { font-size: 15px; } .pal-card .meta { font-size: 12.5px; }
.pal-preview { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--p3); position: relative; }
.pal-preview .bar { display: block; height: 6px; width: 70%; border-radius: 6px; background: rgba(0,0,0,.12); } .pal-preview .dot { position: absolute; top: 8px; inset-inline-end: 10px; width: 14px; height: 14px; border-radius: 50%; background: var(--p1); }
.pal-body { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; border-radius: 10px; background: #fff; } .pal-body i { height: 8px; border-radius: 6px; background: color-mix(in srgb, var(--p2) 35%, #fff); }
.pal-body .btn { grid-column: 1 / -1; height: 12px; width: 60%; justify-self: end; background: var(--p1); }
.pal-sw { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; } .pal-sw i { height: 6px; border-radius: 6px; background: var(--p1); } .pal-sw i:nth-child(2) { background: var(--p2); } .pal-sw i:nth-child(3) { background: color-mix(in srgb, var(--p1) 40%, var(--p2)); }
.pal-check { position: absolute; top: 8px; inset-inline-start: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--surface); } .pal-check svg { width: 14px; height: 14px; }
.pal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .pal-actions .btn { gap: 6px; }
dialog.pal-dialog { width: min(640px, 100vw); }
.dash-dua { margin-top: 4px; font-size: 14px; color: var(--accent); font-weight: 500; letter-spacing: .1px; }
@media (max-width: 520px) { .pal-grid { gap: 8px; } .pal-card { padding: 8px; } }

/* ---------- single-page landing ---------- */
.lp { --lp-w: 1160px; }
.lp-sec, .lp-hero { max-width: var(--lp-w); margin: 0 auto; padding: clamp(56px, 8vw, 110px) clamp(18px, 4vw, 40px); }
.lp-kicker { font: 700 12.5px var(--font-en); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.lp h2 { font-size: clamp(1.6rem, 1.15rem + 1.8vw, 2.5rem); line-height: 1.25; letter-spacing: -0.01em; max-width: 22ch; margin-bottom: 14px; }
.lp-text { color: var(--muted); font-size: 1.06rem; line-height: 1.9; max-width: 64ch; }
.lp-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(24px, 4vw, 60px); align-items: center; min-height: calc(100dvh - var(--header-h)); padding-top: clamp(28px, 4vw, 60px); }
.lp-hero h1 { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.5rem); line-height: 1.18; letter-spacing: -0.02em; margin-bottom: 18px; }
.lp-lead { font-size: clamp(1.02rem, .95rem + .4vw, 1.2rem); color: var(--muted); line-height: 1.85; max-width: 52ch; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; } .lp-cta.center { justify-content: center; }
.lp-cta .link-btn { display: inline-flex; gap: 6px; align-items: center; } .lp-cta .link-btn svg { width: 16px; height: 16px; } html[dir="rtl"] .lp-cta .link-btn svg { transform: scaleX(-1); }
.lp-hero-art { position: relative; aspect-ratio: 1; }
.lp-graph { position: relative; z-index: 1; width: 100%; height: 100%; } .lp-graph svg { width: 100%; height: 100%; }
.lp-rings { position: absolute; inset: 4%; display: grid; place-items: center; pointer-events: none; }
.lp-rings i { position: absolute; border-radius: 50%; border: 1px solid var(--accent-soft); animation: lp-breathe 7s ease-in-out infinite; }
.lp-rings i:nth-child(1) { inset: 0; } .lp-rings i:nth-child(2) { inset: 9%; animation-delay: -2.3s; } .lp-rings i:nth-child(3) { inset: 18%; animation-delay: -4.6s; }
@keyframes lp-breathe { 50% { transform: scale(1.025); opacity: .55; } }
.lp-for { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.lp-for li { display: inline-flex; gap: 8px; align-items: center; padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.lp-for svg { width: 16px; height: 16px; color: var(--accent); }
.lp-benefits { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 0; max-width: 820px; }
.lp-benefits li { display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding: 22px 0; border-top: 1px solid var(--border); }
.lp-benefits .n, .lp-start .n { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 800 15px var(--font-en); color: var(--primary); background: var(--accent-soft); }
.lp-benefits h3 { font-size: 1.12rem; margin-bottom: 4px; } .lp-benefits p { color: var(--muted); line-height: 1.8; }
.lp-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 18px; }
.lp-tabs button { display: inline-flex; gap: 8px; align-items: center; height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 600 14px var(--font); cursor: pointer; transition: all .2s; }
.lp-tabs button svg { width: 17px; height: 17px; } .lp-tabs button[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.lp-feature { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 48px); align-items: center; padding: clamp(22px, 3vw, 36px); border-radius: 28px; background: linear-gradient(160deg, var(--accent-soft), transparent 55%), var(--surface); border: 1px solid var(--border); animation: page-fade .35s var(--ease); }
.lp-f-copy h3 { font-size: 1.4rem; margin-bottom: 10px; } .lp-f-copy p { color: var(--muted); line-height: 1.9; }
.mk { --c0: var(--primary); --c1: var(--secondary); --c2: #E0A63B; --c3: #9B7BD1; display: grid; gap: 10px; padding: 18px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); box-shadow: 0 30px 60px -40px var(--shadow); min-height: 240px; }
.mk-line { display: block; height: 9px; width: var(--w); border-radius: 6px; background: var(--surface-3, var(--border)); }
.mk-top { display: flex; align-items: center; gap: 12px; } .mk-pill { font-size: 12px; font-weight: 700; color: var(--accent); } .mk-bar { flex: 1; height: 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; } .mk-bar i { display: block; height: 100%; background: var(--primary); }
.mk-opt { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); } .mk-opt > i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; }
.mk-opt.on { border-color: var(--primary); background: var(--accent-soft); } .mk-opt.on > i { background: var(--primary); border-color: var(--primary); } .mk-opt .mk-line { flex: 1; }
.mk-search { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 13px; } .mk-search svg { width: 16px; height: 16px; }
.mk-row { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--surface); } .mk-row b.mk-line { background: var(--accent-soft); }
.mk-flow { display: flex; gap: 6px; } .mk-flow span { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-2); } .mk-flow .done { background: var(--secondary); } .mk-flow .cur { background: var(--primary); }
.mk-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .mk-cols > div { display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: 12px; background: var(--surface); }
.mk-chip { display: inline-block; height: 20px; width: 70px; border-radius: 999px; background: var(--accent-soft); margin-inline-end: 6px; }
.mk-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .mk-cards > div { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--surface); } .mk-ico { width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft); }
.mk-graph { place-items: center; } .mk-graph svg { width: min(100%, 260px); } .mk-graph circle { opacity: .9; } .mk-graph path { fill: none; stroke-width: 1; opacity: .45; }
.lp-try-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 18px; margin-top: 26px; align-items: stretch; }
.lp-result-demo { display: grid; justify-items: center; align-content: center; gap: 8px; text-align: center; padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); }
.lp-start { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: s; }
.lp-start li { display: grid; gap: 8px; align-content: start; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); } .lp-start p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.lp-price { display: grid; justify-items: center; } .lp-price .pp-card { max-width: 560px; width: 100%; text-align: center; justify-items: center; } .lp-price .sub-badges { justify-content: center; }
.lp-faq .faq { max-width: 820px; } .lp-contact { text-align: center; display: grid; justify-items: center; } .lp-contact h2 { max-width: none; } .lp-contact .pub-cards { width: min(640px, 100%); }
.lp-foot { padding: 36px 20px 48px; text-align: center; display: grid; gap: 8px; border-top: 1px solid var(--border); }
html.lp-anim .rv { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); } html.lp-anim .rv.in { opacity: 1; transform: none; }
html { scroll-behavior: smooth; }
@media (max-width: 900px) {
  .lp-hero { grid-template-columns: 1fr; min-height: auto; text-align: start; } .lp-hero-art { max-width: 420px; justify-self: center; width: 100%; order: -1; }
  .lp-feature, .lp-try-grid { grid-template-columns: 1fr; } .lp-start { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .lp-start { grid-template-columns: 1fr; } .lp-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; } .lp-tabs button { flex: none; } }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } .lp-rings i { animation: none; } html { scroll-behavior: auto; } }
.ud-head { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; } .ud-head h2 { margin: 0; }
.adm-av { vertical-align: middle; } .ap-list { display: flex; flex-wrap: wrap; gap: 8px 18px; } .ap-sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.mk-opt.on .mk-line { background: color-mix(in srgb, var(--primary) 30%, transparent); } .mk-line { background: color-mix(in srgb, var(--text) 10%, transparent); }

.su-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; } .dlg-msg.neutral { line-height: 1.8; }
.rc-card form { width: min(420px, 100%); text-align: start; } .pw-ico.ok { background: rgba(47,163,122,.14); color: #1F8A63; }

/* ---------- Home top: today's dose + side column ---------- */
.dash-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.dash-main .dash-daily { margin: 0; }
.dash-side { display: grid; gap: 14px; }
.dash-hero.compact { grid-template-columns: 1fr; padding: 18px; gap: 10px; text-align: start; }
.dash-hero.compact .dh-graph { max-width: 190px; justify-self: center; order: -1; }
.dash-hero.compact h2 { font-size: 1.15rem; margin: 2px 0 4px; } .dash-hero.compact .dh-d { font-size: 13.5px; }
.dash-hero.compact .dh-actions { margin-top: 10px; } .dash-hero.compact .dh-actions .btn { height: 40px; padding: 0 14px; font-size: 14px; }
.dash-streak { padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.dash-streak:empty { display: none; }
@media (max-width: 960px) { .dash-top { grid-template-columns: 1fr; } .dash-side { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .dash-side { grid-template-columns: 1fr; } }
/* streak */
.streak { display: grid; gap: 12px; }
.sk-top { display: flex; align-items: center; gap: 12px; } .sk-top strong { display: block; font-size: 1.15rem; }
.sk-flame { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, #E0A63B 15%, transparent); color: #C98A1E; flex: none; }
.sk-flame svg { width: 24px; height: 24px; fill: currentColor; } .streak.today .sk-flame { background: #E0A63B; color: #fff; }
.sk-goal { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.sk-goal-t { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; } .sk-goal-t em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.sk-goal .pg-bar i { background: #E0A63B; } .sk-claim { justify-self: start; } .sk-best { font-size: 12.5px; }
.pg-streak { margin-bottom: 16px; }
/* admin offers */
.of-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.of-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.of-grid .fld input, .of-grid .fld select, .of-grid .fld textarea { width: 100%; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.switch input { width: 38px; height: 22px; appearance: none; -webkit-appearance: none; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked { background: #2FA37A; } .switch input:checked::after { transform: translateX(16px); } html[dir="rtl"] .switch input:checked::after { transform: translateX(-16px); }
.of-banner { padding: 14px 0; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.lp-offers .lp-offer-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.lp-offer { padding: 20px; border-radius: 20px; border: 1px solid color-mix(in srgb, #E0A63B 40%, var(--border)); background: linear-gradient(160deg, color-mix(in srgb, #E0A63B 10%, transparent), transparent 60%), var(--surface); }
.lp-offer h3 { font-size: 1.1rem; margin-bottom: 6px; } .lp-offer p { color: var(--muted); line-height: 1.8; }
/* profile: clearer title option and visible interest selection */
.pf-title { align-items: flex-start; } .pf-title span { display: grid; gap: 2px; } .pf-help { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.chip-check { position: relative; } .chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip-check input:checked + span::after { content: "✓"; margin-inline-start: 4px; font-weight: 800; color: var(--primary); }
/* Daily Nexus answers: readable option buttons instead of squeezed chips */
.dn-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0 4px; }
.dn-opts .chip { width: 100%; display: flex; justify-content: flex-start; text-align: start; white-space: normal; min-height: 44px; height: auto; padding: 10px 14px; border-radius: 12px; line-height: 1.5; border: 1.5px solid var(--border); background: var(--surface); font-size: 14px; }
.dn-opts .chip:hover { border-color: var(--secondary); background: var(--accent-soft); }
@media (max-width: 560px) { .dn-opts { grid-template-columns: 1fr; } }
.dash-daily .dn-part p { line-height: 1.7; }

/* ---------- full-page profile editor ---------- */
.pe { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 18px; align-items: start; padding-bottom: 90px; }
.pe-photo { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 12px; text-align: center; justify-items: center; }
.pe-photo .pf-photo { grid-template-columns: 1fr; justify-items: center; gap: 14px; }
.pe-photo .pf-photo-act { justify-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pe-photo .av-xl { width: 128px; height: 128px; font-size: 40px; }
.pe-photo .pf-presets { justify-content: center; } .pe-sub { margin-top: 4px; }
.pe-main { display: grid; gap: 14px; }
.pe-sec { display: grid; gap: 12px; } .pe-sec h2 { font-size: 1rem; }
.pe-sec .fld input, .pe-sec .fld select { width: 100%; }
.pe-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.pe-choice { position: relative; } .pe-choice input { position: absolute; opacity: 0; pointer-events: none; }
.pe-choice span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 12px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 600; cursor: pointer; transition: all .15s; text-align: center; }
.pe-choice input:checked + span { border-color: var(--primary); background: var(--accent-soft); color: var(--primary); }
.pe-choice input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.pe-chips { gap: 8px; }
.pe-bar { position: fixed; inset-inline: 0; bottom: var(--bottom-space, 0px); z-index: 40; display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px clamp(16px, 4vw, 40px) calc(12px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
html:not(.side-collapsed) .app-shell .pe-bar { inset-inline-start: var(--side-w); } html.side-collapsed .pe-bar { inset-inline-start: var(--side-wc); }
.pe-bar .dlg-msg { margin: 0; margin-inline-end: auto; }
@media (max-width: 900px) { .pe { grid-template-columns: 1fr; } .pe-photo { position: static; } .pe-bar { inset-inline-start: 0 !important; } }
.av-missing { box-shadow: 0 0 0 2px #E0A63B; }

/* ---------- SUTRA DENTIS identity ---------- */
:root { --brand-navy: #163E66; --brand-teal: #2BB3A3; --brand-blue: #2C5FA0; --font-brand: "Cinzel", "Times New Roman", serif; }
html[data-theme="dark"] { --brand-navy: #E6F1F8; }
.brand-mark { position: relative; display: inline-grid; width: 32px; height: 32px; flex: none; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.bm-dark { display: none !important; }
html[data-theme="dark"] .bm-light { display: none !important; }
html[data-theme="dark"] .bm-dark { display: inline-block !important; }
.brand-word { display: inline-flex; align-items: baseline; gap: .38em; font-family: var(--font-brand); font-weight: 600; font-size: 1.02rem; letter-spacing: .14em; white-space: nowrap; direction: ltr; color: var(--brand-navy); }
.brand-word b { font-weight: 600; } .brand-word > span { font-weight: 500; opacity: 1; color: var(--brand-teal); letter-spacing: .2em; font-size: .86em; }
.brand-tooth { width: 15px; height: 15px; align-self: center; margin-inline-start: .1em; }
.brand { animation: brand-in .7s var(--ease) both; }
.brand-mark img { animation: mark-in 1s var(--ease) both; }
@keyframes brand-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@keyframes mark-in { from { opacity: 0; transform: rotate(-12deg) scale(.85); } to { opacity: 1; transform: none; } }
.dlg-brand { display: flex; justify-content: center; margin: -4px 0 10px; } .dlg-brand .brand-word { font-size: .98rem; }
.adm-brand { padding: 0 6px 6px; } .adm-brand .brand-word > span { color: var(--muted); letter-spacing: .18em; }
.lp-brand { margin-bottom: 14px; } .lp-logo { width: 150px; height: auto; display: block; animation: logo-in 1.1s var(--ease) both; }
@keyframes logo-in { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.lp-foot-brand { justify-content: center; } .lp-foot-brand .brand-mark { width: 28px; height: 28px; }
.onb-logo { width: 130px; height: auto; margin: 0 auto 4px; animation: logo-in 1s var(--ease) both; }
/* a quiet thread motif behind the landing hero (decorative only) */
.lp-hero { position: relative; isolation: isolate; }
.lp-hero::before { content: ""; position: absolute; inset: 6% -4% auto -4%; height: 70%; z-index: -1; pointer-events: none; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 400' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%232BB3A3' stop-opacity='.35'/%3E%3Cstop offset='1' stop-color='%232C5FA0' stop-opacity='.25'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23g)' stroke-width='1'%3E%3Cpath d='M0 300 C300 180 500 360 800 220 S1100 120 1200 180'/%3E%3Cpath d='M0 310 C300 192 500 372 800 232 S1100 132 1200 192'/%3E%3Cpath d='M0 320 C300 204 500 384 800 244 S1100 144 1200 204'/%3E%3Cpath d='M0 330 C300 216 500 396 800 256 S1100 156 1200 216'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.lp-kicker { letter-spacing: .12em; }
@media (max-width: 900px) { .lp-brand { display: flex; justify-content: center; } .lp-logo { width: 128px; } .top-brand .brand-word { display: none; } }
@media (max-width: 380px) { .side-brand .brand-word, .dlg-brand .brand-word { font-size: .9rem; } }
@media (prefers-reduced-motion: reduce) { .brand, .brand-mark img, .lp-logo, .onb-logo { animation: none !important; } }
.lp-hero { overflow: clip; }
.lp-hero::before { inset: 6% 0 auto 0; }
@media (max-width: 900px) { .lp-hero-art { order: 1 !important; max-width: 340px; } .lp-hero-copy { text-align: center; } .lp-hero-copy .lp-cta { justify-content: center; } }
.brand-word > span { margin-left: .38em; } .brand-word b + span { margin-left: .38em; }
