/* BAZILIQ · Theme layer v2: Jade (default) + Ink + Light + Premium, декор, сайдбар, темы-пикер */
::selection{background:rgba(63,191,166,.35);color:#EAF2EF}
:focus-visible{outline:2px solid var(--gold,#3FBFA6);outline-offset:2px}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-track{background:var(--bg,#07110F)}
::-webkit-scrollbar-thumb{background:var(--line2,#2E5350);border-radius:99px;border:2px solid var(--bg,#07110F)}
::-webkit-scrollbar-thumb:hover{background:var(--gold,#3FBFA6)}

/* ---------- hieroglyph decor layer ---------- */
#jadeDecor{position:fixed;inset:0;z-index:-1;pointer-events:none;overflow:hidden}
#jadeDecor .jd{position:absolute;font-family:'Noto Serif TC',serif;line-height:1;user-select:none;animation:jdBreathe 9s ease-in-out infinite}
#jadeDecor .jd.brass{color:#B98A3E}
#jadeDecor .jd.jade{color:#3FBFA6}
#jadeDecor .st{position:absolute;color:#8FD4C4;user-select:none}
@keyframes jdBreathe{0%,100%{opacity:var(--o,.06);transform:translateY(0)}50%{opacity:calc(var(--o,.06)*1.6);transform:translateY(-6px)}}
@media(prefers-reduced-motion:reduce){#jadeDecor .jd{animation:none}}
body{position:relative}
#jadeDecor::before{content:'';position:absolute;top:-220px;left:50%;transform:translateX(-50%);
  width:820px;height:560px;border-radius:50%;
  background:radial-gradient(closest-side,rgba(63,191,166,.10),transparent 70%);filter:blur(30px)}

/* ---------- THEMES (переопределяют переменные страниц) ---------- */
/* INK — чёрный минимал, серебряный акцент */
html[data-bz-theme="ink"]{
  --bg:#0A0A0B;--bg2:#101012;--bg-deep:#060607;--panel:#161618;--panel2:#1C1C1F;--panel-2:#1C1C1F;--panel3:#232327;
  --gold:#C7CFCC;--gold2:#E6ECEA;--gold-soft:#3A3F3E;--line-gold:#3A3F3E;
  --silver:#9AA4A1;--water:#6E8B85;--water2:#9CBDB5;
  --coral:#C05A50;--coral-soft:#7E3B34;
  --text:#F2F4F3;--text-mute:#98A09E;--muted:#8A9290;--text-dim:#5C6462;--dim:#3A3F3E;
  --line:#242628;--line2:#37393C;
}
html[data-bz-theme="ink"] body{background:#0A0A0B!important}
html[data-bz-theme="ink"] #jadeDecor{display:none}
html[data-bz-theme="ink"] ::selection{background:rgba(199,207,204,.3);color:#0A0A0B}

/* LIGHT — бумага + тёмный нефрит */
html[data-bz-theme="light"]{
  --bg:#F4F6F5;--bg2:#ECF0EE;--bg-deep:#E4EAE7;--panel:#FFFFFF;--panel2:#F1F5F3;--panel-2:#F1F5F3;--panel3:#E7EEEB;
  --gold:#1E8C74;--gold2:#17705D;--gold-soft:#BFE3DA;--line-gold:#9CCFC2;
  --silver:#5E6B67;--water:#2E7D9A;--water2:#1F657E;
  --coral:#B0483E;--coral-soft:#D9A79F;
  --text:#15211E;--text-mute:#54635E;--muted:#5F6E6A;--text-dim:#8A9692;--dim:#B9C4C0;
  --line:#D8E2DE;--line2:#B9C9C3;
}
html[data-bz-theme="light"] body{background:linear-gradient(180deg,#F8FAF9,#EDF2F0)!important;color:#15211E}
html[data-bz-theme="light"] #jadeDecor .jd{color:#15211E}
html[data-bz-theme="light"] #jadeDecor .st{color:#1E8C74}
html[data-bz-theme="light"] #jadeDecor::before{background:radial-gradient(closest-side,rgba(30,140,116,.08),transparent 70%)}
html[data-bz-theme="light"] ::selection{background:rgba(30,140,116,.25);color:#15211E}
html[data-bz-theme="light"] .top-bar,html[data-bz-theme="light"] nav.topnav{background:rgba(248,250,249,.92)!important}
html[data-bz-theme="light"] .modal-bg{background:rgba(21,33,30,.45)!important}
html[data-bz-theme="light"] .modal{box-shadow:0 30px 80px rgba(21,33,30,.25)}
html[data-bz-theme="light"] img,html[data-bz-theme="light"] .demo-btn{filter:none}

/* PREMIUM — классический BAZIST: фиолет + золото (для подписчиков) */
html[data-bz-theme="premium"]{
  --bg:#080611;--bg2:#0f0b1a;--bg-deep:#07050C;--panel:#141020;--panel2:#1c1630;--panel-2:#221733;--panel3:#241a3a;
  --gold:#C9993A;--gold2:#e8bb6a;--gold-soft:#7A6128;--line-gold:#7A6128;
  --silver:#8a9bb0;--water:#3a6b8a;--water2:#5a9abe;
  --coral:#b84a52;--coral-soft:#8B3A41;
  --text:#ede8e0;--text-mute:#9B8FA8;--muted:#7a6f85;--text-dim:#6B5F78;--dim:#3d3550;
  --line:#2a2040;--line2:#4a3f60;
  --wood:#4a7a38;--earth:#7a6030;--metal:#a8a8a8;--fire:#D85A2E;
}
html[data-bz-theme="premium"] body{background:radial-gradient(ellipse 1000px 600px at 70% 0%,rgba(58,107,138,.12) 0%,transparent 60%),radial-gradient(ellipse 600px 400px at 10% 100%,rgba(201,153,58,.06) 0%,transparent 60%),#080611!important}
html[data-bz-theme="premium"] #jadeDecor .jd{color:#C9993A}
html[data-bz-theme="premium"] #jadeDecor .st{color:#e8bb6a}
html[data-bz-theme="premium"] #jadeDecor::before{background:radial-gradient(closest-side,rgba(201,153,58,.10),transparent 70%)}
html[data-bz-theme="premium"] ::selection{background:rgba(201,153,58,.35);color:#ede8e0}

/* ---------- THEME PICKER (онбординг) ---------- */
.theme-pick-title{font-family:'Noto Serif TC',serif;font-size:26px;color:var(--text);text-align:center;margin:6px 0 6px}
.theme-pick-sub{text-align:center;color:var(--muted);font-size:12px;letter-spacing:.08em;margin-bottom:20px}
.theme-cards{display:grid;grid-template-columns:1fr;gap:10px;margin-bottom:8px}
/* Детерминированная раскладка через grid-areas — одинаково в Chrome и mobile Safari */
.theme-card{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"dots name" "dots desc";
  column-gap:14px;row-gap:2px;align-items:center;
  text-align:left;background:var(--panel);border:1px solid var(--line2);border-radius:14px;padding:14px 16px;cursor:pointer;
  color:var(--text);font-family:inherit;transition:all .15s;width:100%;-webkit-appearance:none;appearance:none}
.theme-card:hover{border-color:var(--gold)}
.theme-card.selected{border-color:var(--gold);box-shadow:0 0 0 1px var(--gold), 0 6px 24px rgba(0,0,0,.25)}
.theme-card .tc-dots{grid-area:dots;align-self:center;display:flex;gap:5px;flex:none}
.theme-card .tc-dots i{width:18px;height:18px;border-radius:50%;display:block;flex:none;box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
.theme-card .tc-name{grid-area:name;align-self:end;font-size:13px;font-weight:600;letter-spacing:.04em;line-height:1.25}
.theme-card .tc-desc{grid-area:desc;align-self:start;font-size:11px;color:var(--muted);letter-spacing:.01em;line-height:1.35;white-space:normal;word-break:break-word}
.theme-card.locked{opacity:.55;cursor:not-allowed}
.theme-card.locked:hover{border-color:var(--line2)}
/* ---------- ОНБОРДИНГ: мобильные правила (тема, вопросы, модалка) ---------- */
@media(max-width:560px){
  .theme-pick-title{font-size:22px}
  .theme-pick-sub{font-size:11.5px;margin-bottom:16px}
  .theme-card{padding:12px 13px;column-gap:11px;border-radius:12px}
  .theme-card .tc-dots i{width:15px;height:15px}
  .theme-card .tc-name{font-size:12.5px;letter-spacing:.02em}
  .theme-card .tc-desc{font-size:10.5px;letter-spacing:0}
}

/* ---------- SIDEBAR: дружелюбнее (фидбек Yunis) ---------- */
.sidebar{font-size:13px;line-height:1.55}
.sidebar .brand{font-size:13px;letter-spacing:.42em}
.sidebar .brand-sub{font-size:9.5px;letter-spacing:.3em;opacity:.75}
.sidebar .day-master-pill{font-size:11px;padding:7px 12px;border-radius:999px;letter-spacing:.08em}
.sidebar .month-nav-label,.sidebar .energy-label,.sidebar .deficit-title,.sidebar .rem-label{
  font-size:9.5px;letter-spacing:.22em;color:var(--gold);opacity:.85;margin-bottom:10px}
.sidebar .month-display{font-family:'Noto Serif TC',serif;font-size:21px;letter-spacing:.06em}
.sidebar .year-display{font-size:11px;letter-spacing:.28em;opacity:.7}
.sidebar .arrow-btn{width:34px;height:34px;border-radius:10px;font-size:16px}
.sidebar .mini-cal{margin-top:6px}
.sidebar .cal-grid{gap:3px}
.sidebar .cal-grid > *{border-radius:8px;font-size:11.5px}
/* легенда: три строки слов → компактная одна строка */
.sidebar .cal-legend{display:flex;gap:12px;flex-wrap:wrap;padding:8px 2px 0;border:none}
.sidebar .legend-row{font-size:9.5px;letter-spacing:.06em;opacity:.75;display:flex;align-items:center;gap:5px}
.sidebar .month-energy{margin-top:14px}
.sidebar .deficit-block{margin-top:14px}
.sidebar .deficit-block .deficit-progress{font-size:10.5px;opacity:.8;margin-top:8px}
.sidebar .sidebar-reminders{margin-top:14px}
#permanentReminders > *{font-size:12px!important;line-height:1.5!important;padding:9px 11px!important;
  border-radius:10px!important;margin-bottom:7px!important;background:var(--panel)!important;
  border:1px solid var(--line)!important;border-left:2px solid var(--gold)!important;letter-spacing:.01em!important}
#deficitBlock > *{border-radius:10px!important;margin-bottom:7px!important}
/* воздух между блоками сайдбара */
.sidebar > div{padding-top:4px;padding-bottom:4px}

/* BUG-05 accessibility (additive) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible, [role="button"]:focus-visible { outline:2px solid #3FBFA6; outline-offset:2px; border-radius:4px; }
@media (prefers-reduced-motion: reduce){ *,*::before,*::after{ animation-duration:.001ms!important; animation-iteration-count:1!important; transition-duration:.001ms!important; scroll-behavior:auto!important; } }
