@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #fbf9f4;
  --ink: #1e1b2e;
  --muted: #6d6880;
  --line: #e8e2d5;
  --brand: #241d47;
  --brand-2: #3a2f6e;
  --gold: #b8892f;
  --gold-2: #d6ac55;
  --gold-soft: #f5ecd7;
  --danger: #b03a3a;
  --ok: #2d7a53;
  --warn: #b7791f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 27, 46, .04), 0 8px 24px rgba(30, 27, 46, .06);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* theme parts (overridden by [data-theme]) */
  --side-1: var(--brand); --side-2: #1a1535; --side-text: #d9d4ec; --side-strong: #fff; --side-muted: #8c85ad; --side-sub: #a49dc4;
  --side-hover: rgba(255, 255, 255, .06); --side-line: rgba(255, 255, 255, .12); --side-active-bg: rgba(214, 172, 85, .16); --side-active: var(--gold-2);
  --logo-text: #fff; --logo-mark-text: var(--brand); --topbar: rgba(246, 243, 236, .85);
  --btn-text: #fff; --btn-gold-text: var(--brand); --badge-dark-text: var(--gold-2); --avatar-text: var(--gold-2);
  --kv-alt: #f3efe5; --badge-text: #7a5a1c; --alert-info-text: #6f521a;
  --ok-soft: var(--ok-soft); --bad-soft: var(--bad-soft); --mid-soft: var(--mid-soft); --loshu-line: #d9d2c2;
  --cover-1: #4a3d8a; --cover-2: var(--brand); --cover-3: #120e26; --cover-text: #fff; --cover-muted: #cfc8ea;
  --chart-ink: #241d47; --chart-line: #241d47; --chart-bg: #fffdf8; --chart-accent: #b8892f; --chart-hl: #f5ecd7; --chart-asc: #b03a3a; --chart-center: #fff;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums; }
svg text { font-variant-numeric: lining-nums; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--gold); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .2px; margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--side-1) 0%, var(--side-2) 100%); color: var(--side-text); border-right: 1px solid var(--line);
  padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: var(--logo-text); }
.logo-mark {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--logo-mark-text);
  font: 700 1.3rem var(--serif);
}
.logo-text { font: 600 1.3rem var(--serif); line-height: 1.1; }
.logo-text small { display: block; font: 400 .7rem var(--sans); color: var(--side-sub); letter-spacing: .4px; }
.nav-group { margin: 16px 10px 6px; font-size: .7rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--side-muted); }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--side-text); font-weight: 500; margin-bottom: 2px;
}
.nav a svg { width: 18px; height: 18px; opacity: .8; flex: none; }
.nav a:hover { background: var(--side-hover); color: var(--side-strong); }
.nav a.active { background: var(--side-active-bg); color: var(--side-active); }
.nav-head {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; border-radius: 10px; margin-bottom: 2px;
  background: none; border: 0; color: var(--side-text); font: 500 .95rem var(--sans); cursor: pointer; text-align: left;
}
.nav-head svg { width: 18px; height: 18px; opacity: .8; flex: none; }
.nav-head:hover { background: var(--side-hover); color: var(--side-strong); }
.nav-head .chev { margin-left: auto; width: 14px; height: 14px; transition: transform .2s; }
.nav-sec.open > .nav-head .chev { transform: rotate(90deg); }
.nav-sec.open > .nav-head { color: var(--side-strong); }
.nav-sub { display: none; margin: 0 0 6px 21px; padding-left: 8px; border-left: 1px solid var(--side-line); }
.nav-sec.open > .nav-sub { display: block; }
.nav a.sub { padding: 7px 10px; font-size: .9rem; }
.nav a.sub svg { width: 15px; height: 15px; }
.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 32px; background: var(--topbar); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar .user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: var(--avatar-text); font-weight: 600;
}
.menu-btn { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink); }
/* name + picture in the top bar open a small menu: profile, plan, orders, log out */
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 6px; border-radius: 12px; cursor: pointer; color: var(--ink); font: inherit; }
.user-btn:hover, .user-btn[aria-expanded="true"] { background: var(--surface-2); }
.user-btn .user-txt { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.user-drop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 190px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.user-drop a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink); font-weight: 500; font-size: .92rem; }
.user-drop a:hover { background: var(--surface-2); }
.user-drop a svg { width: 17px; height: 17px; opacity: .8; }
.user-drop a.logout { color: var(--danger); border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; }
.content { padding: 28px 32px 60px; max-width: 1280px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 0; color: var(--muted); }

/* ---------- cards & grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 20px; }
.grid > .card + .card { margin-top: 0; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h2, .card-title h3 { margin: 0; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.g-chart { grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr); }
.stack > * + * { margin-top: 20px; }

.stat { padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .8px; }
.stat .value { font: 600 2.2rem var(--serif); color: var(--brand); line-height: 1.1; margin-top: 4px; }
.stat .sub { color: var(--muted); font-size: .85rem; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
  font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 137, 47, .15); background: var(--surface); }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox] { width: auto; accent-color: var(--brand-2); transform: scale(1.15); }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--ink); font-size: .92rem; margin: 0; cursor: pointer; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid transparent; font: 600 .92rem var(--sans); cursor: pointer; transition: all .15s; white-space: nowrap;
  background: var(--brand); color: var(--btn-text);
}
.btn:hover { background: var(--brand-2); color: var(--btn-text); }
.btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--btn-gold-text); }
.btn-gold:hover { filter: brightness(1.05); color: var(--btn-gold-text); background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); border-color: var(--gold); color: var(--ink); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--bad-soft); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.kv th { width: 38%; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); background: var(--surface-2); }
.kv td { font-weight: 500; }
.kv tr:nth-child(odd) th { background: var(--kv-alt); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--gold-soft); color: var(--badge-text); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--danger); }
.badge.mid { background: var(--mid-soft); color: var(--warn); }
.badge.dark { background: var(--brand); color: var(--badge-dark-text); }
.pills { display: inline-flex; gap: 6px; flex-wrap: wrap; vertical-align: middle; }
.num-pill { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; background: var(--gold-soft); color: var(--brand); }
.num-pill.bad { background: var(--bad-soft); color: var(--danger); }
.num-pill.mid { background: var(--mid-soft); color: var(--warn); }

/* ---------- Lo Shu grid ---------- */
.loshu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; width: 100%; max-width: 330px; aspect-ratio: 1; margin: 0 auto; border: 2px solid var(--brand); border-radius: 12px; overflow: hidden; }
.loshu div {
  display: grid; place-items: center; border: 1px solid var(--loshu-line); position: relative;
  font: 700 1.8rem var(--serif); color: var(--brand); background: linear-gradient(135deg, var(--surface), var(--gold-soft));
}
.loshu div.empty { background: var(--surface-2); }
.loshu div .ghost { position: absolute; top: 5px; left: 8px; font: 500 .72rem var(--sans); color: var(--muted); }
.loshu div .count { font-size: clamp(1.1rem, 4vw, 1.8rem); letter-spacing: 1px; word-break: break-all; text-align: center; line-height: 1; }

/* ---------- charts ---------- */
.chart-box { max-width: 440px; margin: 0 auto; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-title { text-align: center; font: 600 1.1rem var(--serif); margin-top: 8px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: none; border: 0; padding: 10px 16px; font: 600 .92rem var(--sans); color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button.active { color: var(--brand); border-color: var(--gold); }

/* ---------- auth & public pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
  background: radial-gradient(circle at 30% 20%, var(--cover-1) 0%, var(--cover-2) 45%, var(--cover-3) 100%); color: var(--cover-text);
  padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-art h1 { font-size: 3rem; color: var(--cover-text); max-width: 480px; }
.auth-art p { color: var(--cover-muted); max-width: 440px; font-size: 1.05rem; }
.auth-art .orbit { position: absolute; right: -120px; bottom: -120px; width: 520px; opacity: .55; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form .card { width: 100%; max-width: 410px; padding: 34px; }
.alert { padding: 10px 14px; border-radius: 10px; font-size: .9rem; margin-bottom: 12px; }
.alert.error { background: var(--bad-soft); color: var(--danger); }
.alert.success { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--gold-soft); color: var(--alert-info-text); }

.site-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 40px; gap: 20px; flex-wrap: wrap; }
.site-header .logo { padding: 0; color: var(--brand); }
.site-header .logo-text small { color: var(--muted); }
.site-nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--ink); font-weight: 500; }
.site-nav a.btn { color: var(--btn-text); }
.site-nav a.btn-gold { color: var(--btn-gold-text); }
.hero {
  margin: 10px 40px 0; border-radius: 26px; padding: 80px 64px; color: var(--cover-text); position: relative; overflow: hidden;
  background: radial-gradient(circle at 80% 30%, var(--cover-1) 0%, var(--cover-2) 50%, var(--cover-3) 100%);
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); color: var(--cover-text); max-width: 640px; }
.hero p { color: var(--cover-muted); max-width: 560px; font-size: 1.1rem; }
.hero .orbit { position: absolute; right: -60px; top: 50%; transform: translateY(-50%); width: 480px; opacity: .7; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; padding: 40px; }
.feature .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; margin-bottom: 12px; font: 700 1.3rem var(--serif); }
.page-body { max-width: 820px; margin: 30px auto; padding: 0 24px; }
.site-footer { text-align: center; padding: 30px; color: var(--muted); font-size: .85rem; }

/* ---------- misc ---------- */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 100; background: var(--brand); color: var(--btn-text); padding: 12px 18px;
  border-radius: 12px; box-shadow: var(--shadow); transform: translateY(20px); opacity: 0; transition: all .25s; max-width: 360px;
}
.toast.show { transform: none; opacity: 1; }
.toast.error { background: var(--danger); }
.modal-bg { position: fixed; inset: 0; background: rgba(20, 16, 40, .45); display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal { background: var(--surface); border-radius: 18px; padding: 26px; width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.close-x { background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--muted); line-height: 1; }
.place-results { border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; max-height: 220px; overflow-y: auto; background: var(--surface); }
.place-results div { padding: 8px 12px; cursor: pointer; font-size: .9rem; }
.place-results div:hover { background: var(--gold-soft); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- category -> chart picker ---------- */
.client-pick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.client-pick select { width: auto; min-width: 150px; max-width: 280px; }
.client-pick .cp-cat { background: var(--gold-soft); border-color: var(--line); font-weight: 600; }

/* ---------- dasha explorer ---------- */
.dasha-tree { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dasha summary, .dasha-leaf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 14px; cursor: pointer; border-bottom: 1px solid var(--line); list-style: none; }
.dasha summary::-webkit-details-marker { display: none; }
.dasha summary::before { content: '▸'; color: var(--gold); width: 10px; transition: transform .15s; }
.dasha[open] > summary::before { transform: rotate(90deg); }
.dasha-leaf { cursor: default; padding-left: 36px; }
.dasha .dl { font-weight: 600; min-width: 220px; }
.dasha .dd, .dasha-leaf .dd { color: var(--muted); font-size: .88rem; }
.dasha .kids { padding-left: 22px; background: var(--surface-2); }
.dasha.cur > summary, .dasha-leaf.cur { background: var(--gold-soft); }
.lvl0 > summary { background: var(--surface); }
.lvl0.cur > summary { background: var(--gold-soft); }
.gochar td { text-align: center; }
.gochar td.good { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.gochar td.bad { background: var(--bad-soft); color: var(--danger); }

/* ---------- report ---------- */
.report { max-width: 900px; margin: 0 auto; }
.report-cover {
  background: radial-gradient(circle at 85% 20%, var(--cover-1) 0%, var(--cover-2) 55%, var(--cover-3) 100%); color: var(--cover-text);
  border-radius: 18px; padding: 34px 38px; display: flex; justify-content: space-between; gap: 20px; align-items: center;
}
.report-cover h1 { color: var(--cover-text); margin: 0; font-size: 2.4rem; }
.report-cover p { margin: 4px 0 0; color: var(--cover-muted); }
.report-section { margin-top: 24px; page-break-inside: avoid; }
.report-section h2 { border-bottom: 2px solid var(--gold); padding-bottom: 6px; display: inline-block; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
  .menu-btn { display: block; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .g2, .g3, .g4, .g-chart { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .hero { margin: 10px 16px; padding: 48px 26px; }
  .hero .orbit { display: none; }
  .site-header, .features { padding-left: 16px; padding-right: 16px; }
  .report-cover { flex-direction: column; align-items: flex-start; }
}

/* ---------- print ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .no-print, .toast { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ddd; padding: 14px; }
  .report-cover, .badge, .num-pill, .loshu div, th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page-break { page-break-before: always; }
  a { color: inherit; }
}

/* ============================== THEMES ============================== */
/* Charts are drawn with fixed colours in SVG; these rules map them onto the theme. */
.chart-box svg [fill="#241d47"] { fill: var(--chart-ink); }
.chart-box svg [stroke="#241d47"] { stroke: var(--chart-line); }
.chart-box svg [fill="#fffdf8"] { fill: var(--chart-bg); }
.chart-box svg [fill="#fff"] { fill: var(--chart-center); }
.chart-box svg [fill="#b8892f"] { fill: var(--chart-accent); }
.chart-box svg [fill="#f5ecd7"] { fill: var(--chart-hl); }
.chart-box svg [fill="#b03a3a"] { fill: var(--chart-asc); }
.chart-box svg [stroke="#b03a3a"] { stroke: var(--chart-asc); }
.chart-box svg [fill="#8a8399"] { fill: var(--muted); }
.chart-title { color: var(--ink); }

/* Dark theme */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0d1a; --surface: #1a1729; --surface-2: #221e35; --ink: #ece8f7; --muted: #a39dbb; --line: #2f2a47;
  --brand: #c9a24e; --brand-2: #e0bd6c; --gold: #d6ac55; --gold-2: #e8c372; --gold-soft: #2c2640;
  --danger: #ec8080; --ok: #62c795; --warn: #e6b05a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --side-1: #0b0914; --side-2: #0b0914; --side-text: #c9c3de; --side-strong: #fff;
  --logo-mark-text: #1a1426; --topbar: rgba(15, 13, 26, .88);
  --btn-text: #1a1426; --btn-gold-text: #1a1426; --badge-dark-text: #1a1426; --avatar-text: #1a1426;
  --kv-alt: #1f1b31; --badge-text: #e8c372; --alert-info-text: #e8c372;
  --ok-soft: rgba(98, 199, 149, .14); --bad-soft: rgba(236, 128, 128, .14); --mid-soft: rgba(230, 176, 90, .14); --loshu-line: #3a3456;
  --cover-1: #3a2f6e; --cover-2: #1c1640; --cover-3: #07050f;
  --chart-ink: #ece8f7; --chart-line: #8a7fb8; --chart-bg: #1a1729; --chart-accent: #e0bd6c; --chart-hl: #2c2640; --chart-asc: #ff8f8f; --chart-center: #221e35;
}
/* Theme picker (top bar) */
.theme-pick { position: relative; }
.theme-btn { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 6px 10px; cursor: pointer; color: var(--ink); display: flex; align-items: center; gap: 6px; font: 600 .82rem var(--sans); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; width: 250px; z-index: 60; }
.theme-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--ink); font: 500 .9rem var(--sans); text-align: left; }
.theme-menu button:hover { background: var(--surface-2); }
.theme-menu button.on { background: var(--gold-soft); font-weight: 700; }
.theme-sw { width: 34px; height: 22px; border-radius: 7px; flex: none; border: 1px solid rgba(0, 0, 0, .1); }
.theme-menu .tm-note { font-size: .75rem; color: var(--muted); padding: 6px 10px 2px; }

/* ---------- site emblem ---------- */
.logo-emblem { flex: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25)); }
.logo-emblem svg { display: block; width: 100%; height: 100%; }
.hero-emblem { position: absolute; right: 48px; top: 50%; transform: translateY(-50%); filter: drop-shadow(0 10px 40px rgba(0, 0, 0, .35)); }
.auth-emblem { align-self: flex-start; filter: drop-shadow(0 10px 40px rgba(0, 0, 0, .4)); }
.auth-emblem svg { width: clamp(150px, 26vh, 240px); height: auto; display: block; }
@media (max-width: 1100px) { .hero-emblem { opacity: .25; right: -40px; } }
@media (max-width: 860px) { .hero-emblem { display: none; } }

/* uploaded logo image */
.custom-logo { display: block; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--gold-2); background: var(--surface); }

/* logo picker (Settings) */
.logo-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.logo-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; width: 112px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; color: var(--ink); font: 600 .78rem var(--sans); text-align: center; }
.logo-choice:hover { border-color: var(--gold-2); }
.logo-choice.on { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

/* ============================== PHONES & SMALL TABLETS ============================== */
.cal-wd { display: none; }
@media (max-width: 860px) {
  /* top bar: icons only */
  .topbar { padding-top: 10px; padding-bottom: 10px; }
  .topbar strong { font-size: 1.1rem !important; }
  .theme-btn .theme-name { display: none; }
  .topbar .user > div:not(.avatar):not(.theme-pick):not(.user-menu) { display: none; }
  .user-btn .user-txt { display: none; }
  .theme-menu { right: -50px; }
  /* two shortcut tiles / stats per row */
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .value { font-size: 1.7rem; }
  /* headers and action buttons */
  h1 { font-size: 1.7rem; }
  .page-head { gap: 10px; }
  .page-head .actions { width: 100%; }
  .page-head .actions > * { flex: 1 1 calc(50% - 10px); }
  .page-head .actions input, .page-head .actions select { flex-basis: 100%; width: 100% !important; min-width: 0 !important; }
  .card { padding: 16px; }
  .report-cover { padding: 22px; }
  .report-cover h1 { font-size: 1.7rem; }
  /* category chips scroll sideways in one row */
  .cat-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-left: -4px; }
  .cat-chips::-webkit-scrollbar { display: none; }
  .cat-chips button { white-space: nowrap; flex: none; }
  /* pickers and forms */
  .client-pick { width: 100%; }
  .client-pick select { flex: 1 1 140px; max-width: none; }
  .form-row > div[style*="span 2"] { grid-column: auto !important; }
  .div-bar select { min-width: 0; flex: 1; }
  /* Gujarati calendar: weekday inside each day */
  .cal-wd { display: inline; font: 600 .7rem var(--sans); color: var(--muted); margin-left: 4px; }
  .cal .day { min-height: 0; }
  /* tables marked stack-m turn into cards */
  table.stack-m tr:first-child { display: none; }
  table.stack-m tr { display: block; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  table.stack-m td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border: 0; padding: 3px 12px; text-align: right; white-space: normal !important; }
  table.stack-m td::before { content: attr(data-label); font-size: .75rem; font-weight: 600; color: var(--muted); text-align: left; flex: none; }
  table.stack-m td.m-title { font-size: 1.05rem; }
  table.stack-m td.m-title::before, table.stack-m td.m-actions::before { display: none; }
  table.stack-m td.m-actions { justify-content: flex-start; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
  /* modals use the full width */
  .modal { padding: 18px; border-radius: 14px; }
  /* logo picker */
  .logo-choice { width: calc(33% - 8px); }
}
@media (max-width: 860px) {
  .content .cat-chips { flex-wrap: nowrap; }
  .page-head .actions .btn { padding: 8px 10px; font-size: .8rem; }
}
/* grid columns may shrink below their content (wide tables scroll inside .table-wrap instead) */
.grid > * { min-width: 0; }
@media (max-width: 860px) { .card-title { flex-wrap: wrap; } }
@media (max-width: 860px) {
  .div-bar { flex-wrap: nowrap; gap: 6px; top: 52px; }
  .div-bar .btn { flex: none; padding: 7px 9px; font-size: .78rem; }
  .div-bar select { flex: 1; min-width: 0; font-size: .85rem; }
}

/* transit planets drawn on a birth chart */
:root { --chart-transit: #1f6fb2; }
:root[data-theme="dark"] { --chart-transit: #7fb8ff; }
.chart-box svg [fill="#1f6fb2"] { fill: var(--chart-transit); }
.tr-legend { display: flex; gap: 14px; justify-content: center; font-size: .8rem; margin-top: 6px; color: var(--muted); }
.tr-legend b.n { color: var(--chart-ink); } .tr-legend b.t { color: var(--chart-transit); font-style: italic; }

/* ============================== READABLE CHARTS ============================== */
.chart-box { max-width: 480px; }
:root {
  --pl-su: #d9661f; --pl-mo: #2f78b7; --pl-ma: #c0392b; --pl-me: #23915a; --pl-ju: #b8860b;
  --pl-ve: #c2306f; --pl-sa: #3d4a63; --pl-ra: #7a4a2a; --pl-ke: #7c3fa0;
}
:root[data-theme="dark"] {
  --pl-su: #ffa25e; --pl-mo: #8cc4ff; --pl-ma: #ff8a7a; --pl-me: #6fe0a2; --pl-ju: #ffd36b;
  --pl-ve: #ff8fc1; --pl-sa: #c3cbe0; --pl-ra: #e0b48c; --pl-ke: #d0a4ff;
}
.chart-box svg .pl-Su, .chart-key .pk-Su { fill: var(--pl-su); color: var(--pl-su); }
.chart-box svg .pl-Mo, .chart-key .pk-Mo { fill: var(--pl-mo); color: var(--pl-mo); }
.chart-box svg .pl-Ma, .chart-key .pk-Ma { fill: var(--pl-ma); color: var(--pl-ma); }
.chart-box svg .pl-Me, .chart-key .pk-Me { fill: var(--pl-me); color: var(--pl-me); }
.chart-box svg .pl-Ju, .chart-key .pk-Ju { fill: var(--pl-ju); color: var(--pl-ju); }
.chart-box svg .pl-Ve, .chart-key .pk-Ve { fill: var(--pl-ve); color: var(--pl-ve); }
.chart-box svg .pl-Sa, .chart-key .pk-Sa { fill: var(--pl-sa); color: var(--pl-sa); }
.chart-box svg .pl-Ra, .chart-key .pk-Ra { fill: var(--pl-ra); color: var(--pl-ra); }
.chart-box svg .pl-Ke, .chart-key .pk-Ke { fill: var(--pl-ke); color: var(--pl-ke); }
.chart-box svg .pl-tr { fill: var(--chart-transit); }
.chart-box svg .pl-deg { fill: var(--muted); }
.chart-title { font-size: 1.15rem; margin-top: 10px; }
.chart-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin-top: 8px; font-size: .74rem; color: var(--muted); }
.chart-key b { font-weight: 800; }
@media print { .chart-key { font-size: 9px; } }

/* ============================== READABLE TABLES ============================== */
.table-wrap { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.card > .table-wrap:first-child:last-child, .card[style*="padding:0"] .table-wrap { border: 0; border-radius: 0; }
table { font-size: .92rem; }
th {
  text-transform: none; letter-spacing: 0; font-size: .8rem; font-weight: 700; color: var(--muted);
  white-space: nowrap; padding: 10px 14px; background: var(--surface-2); border-bottom: 2px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
td { padding: 9px 14px; vertical-align: middle; line-height: 1.45; }
table:not(.kv) tr:nth-child(even) > td { background: var(--surface-2); }
table:not(.kv) tr:hover > td { background: var(--gold-soft); }
td b:first-child { color: var(--ink); }
td .small, td.small { line-height: 1.4; }
.kv th { position: static; border-bottom: 1px solid var(--line); white-space: normal; font-size: .9rem; }
.kv td, .kv th { padding: 10px 14px; }
@media (max-width: 860px) { th { padding: 8px 10px; } td { padding: 7px 10px; } table { font-size: .88rem; } }
@media print { th { position: static; } table:not(.kv) tr:nth-child(even) > td { background: #f7f7f7; } }
/* short values stay on one line (wide tables scroll); descriptions wrap */
td { white-space: nowrap; }
td.small, td.wrap, .kv td { white-space: normal; min-width: 160px; }
.kv td { min-width: 0; }

/* ---------- compact chart picker (Category -> Chart, form folded away) ---------- */
.bp-pick.client-pick { margin: 4px 0 2px; }
.bp-pick.client-pick select { flex: 1 1 220px; max-width: none; padding: 12px 14px; font-size: 1rem; }
.bp-pick.client-pick .cp-cat { flex: 0 1 240px; }
.bp-summary { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.bp-summary .btn { margin-left: auto; flex: none; }
.bp-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--brand); color: var(--badge-dark-text); font: 700 1.1rem var(--serif); }
.bp-manual { margin-top: 12px; }
.bp-manual > summary { cursor: pointer; list-style: none; color: var(--brand-2); font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; gap: 6px; }
.bp-manual > summary::-webkit-details-marker { display: none; }
.bp-manual > summary::before { content: '✎'; }
.bp-manual[open] > summary { color: var(--muted); }
#pickCard .card-title, .card .card-title:has(+ .bp-pick) { margin-bottom: 10px; }

/* Use lining (full-height) figures everywhere; the serif's old-style 1 and 0 read like I and o. */
body, body * { font-variant-numeric: lining-nums !important; }

/* ---------- Kundali tools (Kundali page + Complete Kundali Report): toolbar dropdowns, hover tips, bar charts ---------- */
/* chart series colours (validated default palette: slot 1 blue, slot 2 orange), with their own dark-mode steps */
:root { --s1: #2a78d6; --s2: #eb6834; --grid: #e1e0d9; --axis: #c3c2b7; --ref: #0b0b0b; }
:root[data-theme="dark"] { --s1: #3987e5; --s2: #d95926; --grid: #2c2c2a; --axis: #383835; --ref: #f0efec; }
.fr-bar { position: sticky; top: 64px; z-index: 30; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin: 18px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.fr-dd { position: relative; }
.fr-dd > summary { list-style: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.fr-dd > summary::-webkit-details-marker { display: none; }
.fr-dd > summary::after { content: ' ▾'; color: var(--muted); }
.fr-dd[open] > summary { border-color: var(--gold); }
.fr-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 250px; max-height: 60vh; overflow: auto; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.fr-panel label { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: .9rem; margin: 0; }
.fr-panel label:hover { background: var(--surface-2); }
.fr-panel .fr-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.fr-panel small { color: var(--muted); font-weight: 400; }
.fr-sec { margin-top: 26px; }
.fr-sec > h2 { display: flex; align-items: center; gap: 10px; }
.fr-sec > h2 .info { font: 600 .75rem var(--sans); color: var(--muted); border: 1px solid var(--line); border-radius: 50%; width: 20px; height: 20px; display: inline-grid; place-items: center; cursor: help; }
.fr-hidden { display: none !important; }
[data-tip] { cursor: help; }
.chart-box svg text[data-tip]:hover { text-decoration: underline; }
#tip { position: fixed; z-index: 100; max-width: 320px; padding: 10px 12px; border-radius: 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: .84rem; line-height: 1.45; pointer-events: none; }
#tip b.t { display: block; font: 700 .95rem var(--sans); margin-bottom: 4px; }
#tip .r { display: flex; justify-content: space-between; gap: 12px; }
#tip .r span:first-child { color: var(--muted); }
.chart-box svg .pl-Ur { fill: #2a8a8a; } .chart-box svg .pl-Ne { fill: #4a6ab8; } .chart-box svg .pl-Pl { fill: #8a4a6a; }
.chart-box svg .pl-Gk, .chart-box svg .pl-Md { fill: #6b6b6b; }
:root[data-theme="dark"] .chart-box svg .pl-Ur { fill: #6fd0d0; } :root[data-theme="dark"] .chart-box svg .pl-Ne { fill: #9fb6ff; }
:root[data-theme="dark"] .chart-box svg .pl-Pl { fill: #e09ac0; } :root[data-theme="dark"] .chart-box svg .pl-Gk, :root[data-theme="dark"] .chart-box svg .pl-Md { fill: #b8b8b8; }
.viz { width: 100%; }
.viz svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz text { font: 11px var(--sans); fill: var(--muted); }
.viz .lbl { fill: var(--ink); font-weight: 600; }
.viz .bar { transition: opacity .15s; }
.viz .hit:hover + .bar, .viz .col:hover .bar { opacity: .75; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: 0 0 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.legend i.line { height: 2px; border-radius: 0; vertical-align: 3px; }
.av-cell { text-align: center; }
.av-hi { background: var(--ok-soft); font-weight: 700; } .av-lo { background: var(--bad-soft); }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.mini-grid .card { padding: 12px; }
.mini-grid .chart-box { max-width: none; }
@media (max-width: 760px) {
  .fr-bar { position: static; gap: 6px; padding: 8px; }
  .fr-dd > summary { padding: 6px 9px; font-size: .8rem; }
  .fr-bar .hint { display: none; }
  .fr-bar > select { flex: 1 1 100%; font-size: .85rem; padding: 7px 9px; }
  .fr-panel { min-width: min(260px, 82vw); }
  .fr-dd:nth-of-type(2n) .fr-panel { left: auto; right: 0; }
}
@media print { .fr-bar, #tip { display: none !important; } .fr-sec { break-inside: auto; } }

/* ---------- Chart hover areas (houses), transit key and Nakshatra & pada chart ---------- */
.chart-box svg .house-hit { cursor: help; transition: fill .12s; }
.chart-box svg polygon.house-hit:hover { fill: rgba(214, 172, 85, .16); }
.chart-box svg rect.house-hit:hover { filter: brightness(.96); }
.chart-box svg circle, .chart-box svg text:not([data-tip]), .chart-box svg tspan { pointer-events: none; }
.chart-box svg text[data-tip] { pointer-events: auto; }
.chart-key .pk-tr { color: var(--chart-transit); font-style: italic; }
.nak-wheel svg { width: 100%; height: auto; display: block; }
.nak-wheel svg path[data-tip]:hover { filter: brightness(.93); }
.nak-grid table { font-size: .82rem; }
.nak-grid td, .nak-grid th { padding: 4px 8px; }
.nak-grid tr.has td { background: var(--gold-soft); }
.nak-grid b { font-weight: 700; cursor: help; }
.nak-grid .pk-asc { color: #b03a3a; }
.nak-grid .pk-Su { color: var(--pl-su); } .nak-grid .pk-Mo { color: var(--pl-mo); } .nak-grid .pk-Ma { color: var(--pl-ma); }
.nak-grid .pk-Me { color: var(--pl-me); } .nak-grid .pk-Ju { color: var(--pl-ju); } .nak-grid .pk-Ve { color: var(--pl-ve); }
.nak-grid .pk-Sa { color: var(--pl-sa); } .nak-grid .pk-Ra { color: var(--pl-ra); } .nak-grid .pk-Ke { color: var(--pl-ke); }
.grid.nak-chart { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.nak-wheel { max-width: 640px; margin: 0 auto; }
@media (max-width: 1250px) { .grid.nak-chart { grid-template-columns: minmax(0, 1fr); } }

/* Saved Charts: long columns wrap and the buttons stack in two rows, so the whole table fits the screen */
@media (min-width: 861px) {
  table.fit-cols th, table.fit-cols td { white-space: normal; vertical-align: top; }
  table.fit-cols td[data-label="Name"] { min-width: 120px; }
  table.fit-cols td[data-label="Birth time & place"] { min-width: 130px; max-width: 220px; }
  table.fit-cols td[data-label="Contact"] { max-width: 190px; overflow-wrap: anywhere; }
  table.fit-cols td[data-label="Date of birth"] { white-space: nowrap; }
  table.fit-cols td.small { min-width: 0; }
  table.fit-cols td[data-label="Category"] .badge { white-space: normal; }
  table.fit-cols td[data-label="Contact"] { min-width: 100px; }
  table.fit-cols .row-btns { display: grid; grid-template-columns: auto auto; gap: 5px; justify-content: end; }
}
@media (max-width: 860px) { table.fit-cols .row-btns { display: flex; flex-wrap: wrap; gap: 6px; } }
/* contact line at the bottom of every report */
.report-contact { margin: 26px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; font-size: .92rem; color: var(--muted); }
.report-contact b { color: var(--ink); }
.report-contact a { color: inherit; text-decoration: none; }

/* Consultation booking and astrologer calendar */
.cs-step { display: flex; align-items: center; gap: 10px; }
.cs-step span { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--gold-soft); color: var(--badge-text); font: 700 .9rem var(--sans, inherit); }
.cs-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cs-type { position: relative; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; margin: 0; }
.cs-type input { position: absolute; opacity: 0; pointer-events: none; }
.cs-type.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.cs-price { font: 600 1.35rem var(--serif); color: var(--gold); }
.cs-pick { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 24px; align-items: start; }
.cs-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cs-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cs-dow { text-align: center; font-size: .72rem; color: var(--muted); padding: 2px 0; }
.cs-day { aspect-ratio: 1; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; opacity: .55; cursor: default; padding: 0; }
.cs-day.free { background: var(--gold-soft); color: var(--ink); opacity: 1; cursor: pointer; font-weight: 600; border-color: var(--line); }
.cs-day.free:hover { border-color: var(--gold); }
.cs-day.on { background: var(--gold); color: #fff; border-color: var(--gold); }
.cs-day.today { text-decoration: underline; }
.cs-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cs-slot { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 9px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, transparent); color: var(--ink); font: inherit; cursor: pointer; }
.cs-slot:hover { border-color: var(--gold); }
.cs-slot.on { border-color: var(--gold); background: var(--gold-soft); }
.cs-pay { display: flex; gap: 10px; flex-wrap: wrap; }
.cs-pay label { flex: 1 1 200px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; margin: 0; }
.cs-pay label:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.cs-manual { white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 12px; font-size: .9rem; }
.cs-booking { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.cs-booking.big { border: 0; padding: 0; }
.cs-wk-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.cs-wk-day { width: 96px; flex: none; font-weight: 600; padding-top: 6px; }
.cs-wk-ranges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cs-range { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 10px; padding: 4px 8px; }
.cs-range input { width: auto; padding: 5px 6px; }
.cs-x { border: 0; background: transparent; color: var(--danger); font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 0 4px; }
.cs-week { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: .78rem; }
.cs-week > div { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 32px; position: relative; }
.cs-week .cs-wh { background: var(--surface-2); padding: 6px 4px; text-align: center; font-weight: 600; min-height: 0; }
.cs-week .cs-hr { text-align: right; padding: 2px 6px; color: var(--muted); }
.cs-week .cs-today { background: var(--gold-soft); }
.cs-ev { position: absolute; left: 2px; right: 2px; border-radius: 6px; background: var(--gold); color: #fff; padding: 2px 5px; overflow: hidden; cursor: pointer; border: 0; text-align: left; font: inherit; font-size: .74rem; line-height: 1.2; z-index: 1; }
.cs-ev.pending { background: var(--warn); }
.cs-ev.cancelled { background: var(--muted); text-decoration: line-through; opacity: .6; }
.cs-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cs-mcell { min-height: 84px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; font-size: .75rem; overflow: hidden; }
.cs-mcell.dim { opacity: .45; }
.cs-mcell.today { border-color: var(--gold); }
.cs-mev { display: block; width: 100%; text-align: left; border: 0; border-radius: 5px; background: var(--gold-soft); color: var(--ink); margin-top: 2px; padding: 1px 4px; cursor: pointer; font: inherit; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-mev.pending { background: var(--mid-soft); }
.cs-mev.cancelled { text-decoration: line-through; opacity: .6; }
.cs-feed { display: flex; gap: 8px; flex-wrap: wrap; }
.cs-feed input { flex: 1 1 260px; font-family: monospace; font-size: .8rem; }
@media (max-width: 760px) {
  .cs-pick { grid-template-columns: minmax(0, 1fr); }
  .cs-wk-row { flex-direction: column; gap: 4px; }
  .cs-week { grid-template-columns: 40px repeat(7, minmax(0, 1fr)); font-size: .65rem; }
  .cs-ev { font-size: .62rem; padding: 1px 2px; }
  .cs-mcell { min-height: 58px; font-size: .65rem; padding: 2px; }
}
.cs-wk { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: .78rem; }
.cs-wk-h { background: var(--surface-2); padding: 6px 4px; text-align: center; font-weight: 600; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.cs-wk-h:first-child { border-left: 0; }
.cs-hours div { text-align: right; padding: 0 6px; color: var(--muted); font-size: .7rem; box-sizing: border-box; border-top: 1px solid var(--line); }
.cs-col { position: relative; border-left: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--px) - 1px), var(--line) calc(var(--px) - 1px), var(--line) var(--px)); }
.cs-col.cs-today, .cs-wk-h.cs-today { background-color: var(--gold-soft); }
@media (max-width: 760px) { .cs-wk { grid-template-columns: 42px repeat(7, minmax(0, 1fr)); font-size: .62rem; } .cs-wk-h { padding: 4px 1px; } }

/* public (logged-out) layout for the shop and consultation pages: App.boot({ public: true }) */
.pub-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.pub-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 22px; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pub-logo { display: flex; align-items: center; gap: 10px; color: var(--brand); font: 600 1.3rem var(--serif); }
.pub-nav { display: flex; gap: 20px; flex-wrap: wrap; flex: 1; }
.pub-nav a { color: var(--ink); font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
.pub-nav a.on, .pub-nav a:hover { border-color: var(--gold); }
.pub-actions { display: flex; align-items: center; gap: 8px; }
.pub-content { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 26px 28px 40px; }
.pub-foot { text-align: center; padding: 18px 16px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .pub-top { padding: 10px 14px; gap: 10px; } .pub-nav { order: 3; flex-basis: 100%; gap: 14px; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; } .pub-content { padding: 18px 14px 30px; } .pub-actions .theme-name { display: none; } }
@media print { .pub-top, .pub-foot { display: none; } }

/* theme picker (ThemeMenu in app.js) */
.tp-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); flex: none; }
.theme-btn, .h-theme { gap: 6px; }
.tp { position: fixed; z-index: 120; width: min(340px, calc(100vw - 16px)); max-height: calc(100vh - 80px); overflow: auto; padding: 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); }
.tp-h { font: 700 .74rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 2px 2px 8px; }
.tp-h:not(:first-child) { margin-top: 14px; }
.tp-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.tp-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; border: 0; background: none; border-radius: 9px; cursor: pointer; color: var(--ink); font: 600 .86rem var(--sans); }
.tp-seg button svg { width: 15px; height: 15px; }
.tp-seg button.on { background: var(--brand); color: var(--btn-text); }
.tp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tp-sw, .pal-choice { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 1.5px solid var(--line); background: var(--surface-2); border-radius: 12px; cursor: pointer; color: var(--ink); font: 600 .84rem var(--sans); text-align: left; }
.tp-sw:hover, .pal-choice:hover { border-color: var(--gold); }
.tp-sw.on, .pal-choice.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.tp-chip { position: relative; display: inline-block; width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(0, 0, 0, .12); flex: none; overflow: hidden; }
.tp-chip i { position: absolute; left: 0; right: 0; height: 10px; }
.tp-chip i:first-child { bottom: 10px; } .tp-chip i:last-child { bottom: 0; }
.tp-reset { margin-top: 12px; width: 100%; padding: 9px; border: 1px dashed var(--line); background: none; border-radius: 10px; cursor: pointer; color: var(--muted); font: 600 .84rem var(--sans); }
.tp-reset:hover { color: var(--ink); border-color: var(--gold); }
.pal-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
@media print { .tp { display: none; } }

/* ===== PALETTES (generated by scratchpad/palettes.js; edit the generator, not this block) ===== */
/* hero / footer colours: always dark, tinted by the palette (home.css uses them) */
:root[data-palette="saffron"] {
  --deep-1: #2a0d06; --deep-2: #5a2010; --deep-3: #8a3a16; --deep-glow: #b4561f; --deep-4: #3d1409; --deep-text: #f4dcc8; --deep-text-2: #e2c5b2; --deep-text-3: #b99582; --h-gold: #f2a24a; --h-gold-2: #f8c07a; --h-gold-3: #fde0b0;
}
:root[data-palette="saffron"]:not([data-theme="dark"]) {
  --bg: #fbf3e8; --surface: #ffffff; --surface-2: #fff8ee; --ink: #2b1a12; --muted: #7b6558; --line: #efdcc4; --brand: #7b2d12; --brand-2: #a2431b; --gold: #d0691a; --gold-2: #ee943a; --gold-soft: #fde8cf; --shadow: 0 1px 2px rgba(43, 26, 18, 0.04), 0 8px 24px rgba(43, 26, 18, 0.07); --side-1: #5a2010; --side-2: #2a0d06; --side-text: #f4dcc8; --side-strong: #ffffff; --side-muted: #af8775; --side-sub: #cead9a; --side-active-bg: rgba(238, 148, 58, 0.18); --side-active: #ee943a; --logo-mark-text: #7b2d12; --topbar: rgba(251, 243, 232, 0.85); --btn-text: #ffffff; --btn-gold-text: #150703; --badge-dark-text: #f5bf89; --avatar-text: #f5bf89; --kv-alt: #f4e6d4; --badge-text: #814110; --alert-info-text: #814110; --loshu-line: #dbc9b2; --cover-1: #a2431b; --cover-2: #7b2d12; --cover-3: #2a0d06; --cover-muted: #f4dcc8; --chart-ink: #7b2d12; --chart-line: #7b2d12; --chart-bg: #fffaf4; --chart-accent: #d0691a; --chart-hl: #fde8cf; --chart-center: #ffffff;
}
:root[data-palette="saffron"][data-theme="dark"] {
  --bg: #160d09; --surface: #221510; --surface-2: #2b1b14; --ink: #f7eadf; --muted: #c0a291; --line: #44291c; --brand: #f0993c; --brand-2: #f8b869; --gold: #f0993c; --gold-2: #f8b869; --gold-soft: #432a17; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35); --side-1: #0c0705; --side-2: #0c0705; --side-text: #bfb3aa; --logo-mark-text: #0c0705; --topbar: rgba(22, 13, 9, 0.88); --btn-text: #0c0705; --btn-gold-text: #0c0705; --badge-dark-text: #0c0705; --avatar-text: #0c0705; --kv-alt: #1d120d; --badge-text: #f8b869; --alert-info-text: #f8b869; --loshu-line: #563c30; --cover-1: #8a3a16; --cover-2: #5a2010; --cover-3: #2a0d06; --chart-ink: #f7eadf; --chart-line: #d19f73; --chart-bg: #221510; --chart-accent: #f8b869; --chart-hl: #432a17; --chart-center: #2b1b14;
}
:root[data-palette="saffron"] :is(.a4-sheet, .a4-stage) {
  --a4-paper: #fefbf7; --bg: #fbf3e8; --surface: #ffffff; --surface-2: #fff8ee; --ink: #2b1a12; --muted: #7b6558; --line: #efdcc4; --brand: #7b2d12; --brand-2: #a2431b; --gold: #d0691a; --gold-2: #ee943a; --gold-soft: #fde8cf; --kv-alt: #f4e6d4; --badge-text: #814110; --alert-info-text: #814110; --loshu-line: #dbc9b2; --cover-1: #a2431b; --cover-2: #7b2d12; --cover-3: #2a0d06; --cover-muted: #f4dcc8; --chart-ink: #7b2d12; --chart-line: #7b2d12; --chart-bg: #fffaf4; --chart-accent: #d0691a; --chart-hl: #fde8cf; --chart-center: #ffffff; --shadow: none;
}
:root .a4-sheet[data-pal][data-pal="saffron"], :root .a4-stage[data-pal][data-pal="saffron"] {
  --a4-paper: #fefbf7; --bg: #fbf3e8; --surface: #ffffff; --surface-2: #fff8ee; --ink: #2b1a12; --muted: #7b6558; --line: #efdcc4; --brand: #7b2d12; --brand-2: #a2431b; --gold: #d0691a; --gold-2: #ee943a; --gold-soft: #fde8cf; --kv-alt: #f4e6d4; --badge-text: #814110; --alert-info-text: #814110; --loshu-line: #dbc9b2; --cover-1: #a2431b; --cover-2: #7b2d12; --cover-3: #2a0d06; --cover-muted: #f4dcc8; --chart-ink: #7b2d12; --chart-line: #7b2d12; --chart-bg: #fffaf4; --chart-accent: #d0691a; --chart-hl: #fde8cf; --chart-center: #ffffff; --shadow: none;
}
:root[data-palette="emerald"] {
  --deep-1: #04180f; --deep-2: #0b3a2a; --deep-3: #136045; --deep-glow: #1f8a63; --deep-4: #082a1e; --deep-text: #d3ebdf; --deep-text-2: #bbd6c9; --deep-text-3: #87a89a; --h-gold: #e8c46a; --h-gold-2: #f1d489; --h-gold-3: #f6dd9c;
}
:root[data-palette="emerald"]:not([data-theme="dark"]) {
  --bg: #f1f6f2; --surface: #ffffff; --surface-2: #f7faf7; --ink: #14241c; --muted: #5e7266; --line: #d9e6dc; --brand: #0f4a36; --brand-2: #176a4c; --gold: #b88a2e; --gold-2: #d6ac55; --gold-soft: #f2ead3; --shadow: 0 1px 2px rgba(20, 36, 28, 0.04), 0 8px 24px rgba(20, 36, 28, 0.07); --side-1: #0b3a2a; --side-2: #04180f; --side-text: #d3ebdf; --side-strong: #ffffff; --side-muted: #799b8e; --side-sub: #a1bfb2; --side-active-bg: rgba(214, 172, 85, 0.18); --side-active: #d6ac55; --logo-mark-text: #0f4a36; --topbar: rgba(241, 246, 242, 0.85); --btn-text: #ffffff; --btn-gold-text: #020c08; --badge-dark-text: #e6cd99; --avatar-text: #e6cd99; --kv-alt: #e4ede6; --badge-text: #72561d; --alert-info-text: #72561d; --loshu-line: #c5d3c9; --cover-1: #176a4c; --cover-2: #0f4a36; --cover-3: #04180f; --cover-muted: #d3ebdf; --chart-ink: #0f4a36; --chart-line: #0f4a36; --chart-bg: #fcfaf5; --chart-accent: #b88a2e; --chart-hl: #f2ead3; --chart-center: #ffffff;
}
:root[data-palette="emerald"][data-theme="dark"] {
  --bg: #0a1511; --surface: #12201a; --surface-2: #182a22; --ink: #e6f3ec; --muted: #9bb5a8; --line: #243b31; --brand: #5fd0a2; --brand-2: #8ae3bd; --gold: #d6ac55; --gold-2: #e8c372; --gold-soft: #313623; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35); --side-1: #060c09; --side-2: #060c09; --side-text: #afbcb5; --logo-mark-text: #060c09; --topbar: rgba(10, 21, 17, 0.88); --btn-text: #060c09; --btn-gold-text: #060c09; --badge-dark-text: #060c09; --avatar-text: #060c09; --kv-alt: #0f1c16; --badge-text: #e8c372; --alert-info-text: #e8c372; --loshu-line: #374d44; --cover-1: #136045; --cover-2: #0b3a2a; --cover-3: #04180f; --chart-ink: #e6f3ec; --chart-line: #86bea6; --chart-bg: #12201a; --chart-accent: #e8c372; --chart-hl: #313623; --chart-center: #182a22;
}
:root[data-palette="emerald"] :is(.a4-sheet, .a4-stage) {
  --a4-paper: #fafcfa; --bg: #f1f6f2; --surface: #ffffff; --surface-2: #f7faf7; --ink: #14241c; --muted: #5e7266; --line: #d9e6dc; --brand: #0f4a36; --brand-2: #176a4c; --gold: #b88a2e; --gold-2: #d6ac55; --gold-soft: #f2ead3; --kv-alt: #e4ede6; --badge-text: #72561d; --alert-info-text: #72561d; --loshu-line: #c5d3c9; --cover-1: #176a4c; --cover-2: #0f4a36; --cover-3: #04180f; --cover-muted: #d3ebdf; --chart-ink: #0f4a36; --chart-line: #0f4a36; --chart-bg: #fcfaf5; --chart-accent: #b88a2e; --chart-hl: #f2ead3; --chart-center: #ffffff; --shadow: none;
}
:root .a4-sheet[data-pal][data-pal="emerald"], :root .a4-stage[data-pal][data-pal="emerald"] {
  --a4-paper: #fafcfa; --bg: #f1f6f2; --surface: #ffffff; --surface-2: #f7faf7; --ink: #14241c; --muted: #5e7266; --line: #d9e6dc; --brand: #0f4a36; --brand-2: #176a4c; --gold: #b88a2e; --gold-2: #d6ac55; --gold-soft: #f2ead3; --kv-alt: #e4ede6; --badge-text: #72561d; --alert-info-text: #72561d; --loshu-line: #c5d3c9; --cover-1: #176a4c; --cover-2: #0f4a36; --cover-3: #04180f; --cover-muted: #d3ebdf; --chart-ink: #0f4a36; --chart-line: #0f4a36; --chart-bg: #fcfaf5; --chart-accent: #b88a2e; --chart-hl: #f2ead3; --chart-center: #ffffff; --shadow: none;
}
:root[data-palette="rose"] {
  --deep-1: #240a18; --deep-2: #4a1632; --deep-3: #75254f; --deep-glow: #a23c70; --deep-4: #36102a; --deep-text: #f3d9e4; --deep-text-2: #dfc2cf; --deep-text-3: #b38fa0; --h-gold: #f2a0bd; --h-gold-2: #f7bdd1; --h-gold-3: #fbd8e4;
}
:root[data-palette="rose"]:not([data-theme="dark"]) {
  --bg: #fbf2f4; --surface: #ffffff; --surface-2: #fff7f9; --ink: #2d1822; --muted: #7d6571; --line: #f0dce1; --brand: #6b1f45; --brand-2: #8f2e5f; --gold: #c2527a; --gold-2: #e07a9f; --gold-soft: #fbe3ea; --shadow: 0 1px 2px rgba(45, 24, 34, 0.04), 0 8px 24px rgba(45, 24, 34, 0.07); --side-1: #4a1632; --side-2: #240a18; --side-text: #f3d9e4; --side-strong: #ffffff; --side-muted: #a78194; --side-sub: #c9a8b8; --side-active-bg: rgba(224, 122, 159, 0.18); --side-active: #e07a9f; --logo-mark-text: #6b1f45; --topbar: rgba(251, 242, 244, 0.85); --btn-text: #ffffff; --btn-gold-text: #12050c; --badge-dark-text: #ecafc5; --avatar-text: #ecafc5; --kv-alt: #f5e6ea; --badge-text: #78334c; --alert-info-text: #78334c; --loshu-line: #ddc8ce; --cover-1: #8f2e5f; --cover-2: #6b1f45; --cover-3: #240a18; --cover-muted: #f3d9e4; --chart-ink: #6b1f45; --chart-line: #6b1f45; --chart-bg: #fef9fa; --chart-accent: #c2527a; --chart-hl: #fbe3ea; --chart-center: #ffffff;
}
:root[data-palette="rose"][data-theme="dark"] {
  --bg: #170c12; --surface: #231520; --surface-2: #2c1b28; --ink: #f8e9ef; --muted: #c4a3b3; --line: #442a3b; --brand: #f08fb2; --brand-2: #f7b0ca; --gold: #f08fb2; --gold-2: #f7b0ca; --gold-soft: #442937; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35); --side-1: #0d070a; --side-2: #0d070a; --side-text: #c0b2b8; --logo-mark-text: #0d070a; --topbar: rgba(23, 12, 18, 0.88); --btn-text: #0d070a; --btn-gold-text: #0d070a; --badge-dark-text: #0d070a; --avatar-text: #0d070a; --kv-alt: #1e111a; --badge-text: #f7b0ca; --alert-info-text: #f7b0ca; --loshu-line: #563d4d; --cover-1: #75254f; --cover-2: #4a1632; --cover-3: #240a18; --chart-ink: #f8e9ef; --chart-line: #d39cb3; --chart-bg: #231520; --chart-accent: #f7b0ca; --chart-hl: #442937; --chart-center: #2c1b28;
}
:root[data-palette="rose"] :is(.a4-sheet, .a4-stage) {
  --a4-paper: #fefafb; --bg: #fbf2f4; --surface: #ffffff; --surface-2: #fff7f9; --ink: #2d1822; --muted: #7d6571; --line: #f0dce1; --brand: #6b1f45; --brand-2: #8f2e5f; --gold: #c2527a; --gold-2: #e07a9f; --gold-soft: #fbe3ea; --kv-alt: #f5e6ea; --badge-text: #78334c; --alert-info-text: #78334c; --loshu-line: #ddc8ce; --cover-1: #8f2e5f; --cover-2: #6b1f45; --cover-3: #240a18; --cover-muted: #f3d9e4; --chart-ink: #6b1f45; --chart-line: #6b1f45; --chart-bg: #fef9fa; --chart-accent: #c2527a; --chart-hl: #fbe3ea; --chart-center: #ffffff; --shadow: none;
}
:root .a4-sheet[data-pal][data-pal="rose"], :root .a4-stage[data-pal][data-pal="rose"] {
  --a4-paper: #fefafb; --bg: #fbf2f4; --surface: #ffffff; --surface-2: #fff7f9; --ink: #2d1822; --muted: #7d6571; --line: #f0dce1; --brand: #6b1f45; --brand-2: #8f2e5f; --gold: #c2527a; --gold-2: #e07a9f; --gold-soft: #fbe3ea; --kv-alt: #f5e6ea; --badge-text: #78334c; --alert-info-text: #78334c; --loshu-line: #ddc8ce; --cover-1: #8f2e5f; --cover-2: #6b1f45; --cover-3: #240a18; --cover-muted: #f3d9e4; --chart-ink: #6b1f45; --chart-line: #6b1f45; --chart-bg: #fef9fa; --chart-accent: #c2527a; --chart-hl: #fbe3ea; --chart-center: #ffffff; --shadow: none;
}
:root[data-palette="ocean"] {
  --deep-1: #04131f; --deep-2: #0a3150; --deep-3: #0f5780; --deep-glow: #1a85b8; --deep-4: #07263d; --deep-text: #d3e8f2; --deep-text-2: #bbd2df; --deep-text-3: #87a2b4; --h-gold: #6fd0ee; --h-gold-2: #9ae0f4; --h-gold-3: #c4effa;
}
:root[data-palette="ocean"]:not([data-theme="dark"]) {
  --bg: #eef5f8; --surface: #ffffff; --surface-2: #f6fafc; --ink: #0f2230; --muted: #5a7080; --line: #d6e5ec; --brand: #0b3b57; --brand-2: #135a82; --gold: #1486a8; --gold-2: #35b1d1; --gold-soft: #d9eef5; --shadow: 0 1px 2px rgba(15, 34, 48, 0.04), 0 8px 24px rgba(15, 34, 48, 0.07); --side-1: #0a3150; --side-2: #04131f; --side-text: #d3e8f2; --side-strong: #ffffff; --side-muted: #7996a9; --side-sub: #a1baca; --side-active-bg: rgba(53, 177, 209, 0.18); --side-active: #35b1d1; --logo-mark-text: #0b3b57; --topbar: rgba(238, 245, 248, 0.85); --btn-text: #ffffff; --btn-gold-text: #020a10; --badge-dark-text: #86d0e3; --avatar-text: #86d0e3; --kv-alt: #e1ecf1; --badge-text: #0c5368; --alert-info-text: #0c5368; --loshu-line: #c2d2d9; --cover-1: #135a82; --cover-2: #0b3b57; --cover-3: #04131f; --cover-muted: #d3e8f2; --chart-ink: #0b3b57; --chart-line: #0b3b57; --chart-bg: #f7fbfd; --chart-accent: #1486a8; --chart-hl: #d9eef5; --chart-center: #ffffff;
}
:root[data-palette="ocean"][data-theme="dark"] {
  --bg: #08141c; --surface: #0f212c; --surface-2: #152a37; --ink: #e6f1f7; --muted: #9ab3c2; --line: #213a49; --brand: #4fc3e8; --brand-2: #8bdcf5; --gold: #4fc3e8; --gold-2: #8bdcf5; --gold-soft: #193b4a; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35); --side-1: #040b0f; --side-2: #040b0f; --side-text: #afbac0; --logo-mark-text: #040b0f; --topbar: rgba(8, 20, 28, 0.88); --btn-text: #040b0f; --btn-gold-text: #040b0f; --badge-dark-text: #040b0f; --avatar-text: #040b0f; --kv-alt: #0c1c26; --badge-text: #8bdcf5; --alert-info-text: #8bdcf5; --loshu-line: #354c5a; --cover-1: #0f5780; --cover-2: #0a3150; --cover-3: #04131f; --chart-ink: #e6f1f7; --chart-line: #80b9cf; --chart-bg: #0f212c; --chart-accent: #8bdcf5; --chart-hl: #193b4a; --chart-center: #152a37;
}
:root[data-palette="ocean"] :is(.a4-sheet, .a4-stage) {
  --a4-paper: #f9fcfd; --bg: #eef5f8; --surface: #ffffff; --surface-2: #f6fafc; --ink: #0f2230; --muted: #5a7080; --line: #d6e5ec; --brand: #0b3b57; --brand-2: #135a82; --gold: #1486a8; --gold-2: #35b1d1; --gold-soft: #d9eef5; --kv-alt: #e1ecf1; --badge-text: #0c5368; --alert-info-text: #0c5368; --loshu-line: #c2d2d9; --cover-1: #135a82; --cover-2: #0b3b57; --cover-3: #04131f; --cover-muted: #d3e8f2; --chart-ink: #0b3b57; --chart-line: #0b3b57; --chart-bg: #f7fbfd; --chart-accent: #1486a8; --chart-hl: #d9eef5; --chart-center: #ffffff; --shadow: none;
}
:root .a4-sheet[data-pal][data-pal="ocean"], :root .a4-stage[data-pal][data-pal="ocean"] {
  --a4-paper: #f9fcfd; --bg: #eef5f8; --surface: #ffffff; --surface-2: #f6fafc; --ink: #0f2230; --muted: #5a7080; --line: #d6e5ec; --brand: #0b3b57; --brand-2: #135a82; --gold: #1486a8; --gold-2: #35b1d1; --gold-soft: #d9eef5; --kv-alt: #e1ecf1; --badge-text: #0c5368; --alert-info-text: #0c5368; --loshu-line: #c2d2d9; --cover-1: #135a82; --cover-2: #0b3b57; --cover-3: #04131f; --cover-muted: #d3e8f2; --chart-ink: #0b3b57; --chart-line: #0b3b57; --chart-bg: #f7fbfd; --chart-accent: #1486a8; --chart-hl: #d9eef5; --chart-center: #ffffff; --shadow: none;
}
:root[data-palette="amethyst"] {
  --deep-1: #120a2e; --deep-2: #2c1a66; --deep-3: #4a2c96; --deep-glow: #6a43c4; --deep-4: #1d1048; --deep-text: #ddd3f5; --deep-text-2: #c8bde4; --deep-text-3: #9a8dbf; --h-gold: #c9a2f5; --h-gold-2: #dbbffa; --h-gold-3: #ebd9fc;
}
:root[data-palette="amethyst"]:not([data-theme="dark"]) {
  --bg: #f4f1f9; --surface: #ffffff; --surface-2: #faf8fd; --ink: #20163a; --muted: #6e6585; --line: #e3dcf0; --brand: #3b1f78; --brand-2: #5a35a8; --gold: #9a5fe6; --gold-2: #b690f2; --gold-soft: #ece0fb; --shadow: 0 1px 2px rgba(32, 22, 58, 0.04), 0 8px 24px rgba(32, 22, 58, 0.07); --side-1: #2c1a66; --side-2: #120a2e; --side-text: #ddd3f5; --side-strong: #ffffff; --side-muted: #8d80b5; --side-sub: #b1a5d1; --side-active-bg: rgba(182, 144, 242, 0.18); --side-active: #b690f2; --logo-mark-text: #3b1f78; --topbar: rgba(244, 241, 249, 0.85); --btn-text: #ffffff; --btn-gold-text: #090517; --badge-dark-text: #d3bcf7; --avatar-text: #d3bcf7; --kv-alt: #ebe5f4; --badge-text: #5f3b8f; --alert-info-text: #5f3b8f; --loshu-line: #d0c8de; --cover-1: #5a35a8; --cover-2: #3b1f78; --cover-3: #120a2e; --cover-muted: #ddd3f5; --chart-ink: #3b1f78; --chart-line: #3b1f78; --chart-bg: #fbf8fe; --chart-accent: #9a5fe6; --chart-hl: #ece0fb; --chart-center: #ffffff;
}
:root[data-palette="amethyst"][data-theme="dark"] {
  --bg: #100b1e; --surface: #1a1330; --surface-2: #231a3f; --ink: #efe9fb; --muted: #aa9fcb; --line: #38285c; --brand: #b88af0; --brand-2: #d0b2f8; --gold: #b88af0; --gold-2: #d0b2f8; --gold-soft: #33264f; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35); --side-1: #090611; --side-2: #090611; --side-text: #b7b2c4; --logo-mark-text: #090611; --topbar: rgba(16, 11, 30, 0.88); --btn-text: #090611; --btn-gold-text: #090611; --badge-dark-text: #090611; --avatar-text: #090611; --kv-alt: #161029; --badge-text: #d0b2f8; --alert-info-text: #d0b2f8; --loshu-line: #4a3b6c; --cover-1: #4a2c96; --cover-2: #2c1a66; --cover-3: #120a2e; --chart-ink: #efe9fb; --chart-line: #af98d8; --chart-bg: #1a1330; --chart-accent: #d0b2f8; --chart-hl: #33264f; --chart-center: #231a3f;
}
:root[data-palette="amethyst"] :is(.a4-sheet, .a4-stage) {
  --a4-paper: #fbfafd; --bg: #f4f1f9; --surface: #ffffff; --surface-2: #faf8fd; --ink: #20163a; --muted: #6e6585; --line: #e3dcf0; --brand: #3b1f78; --brand-2: #5a35a8; --gold: #9a5fe6; --gold-2: #b690f2; --gold-soft: #ece0fb; --kv-alt: #ebe5f4; --badge-text: #5f3b8f; --alert-info-text: #5f3b8f; --loshu-line: #d0c8de; --cover-1: #5a35a8; --cover-2: #3b1f78; --cover-3: #120a2e; --cover-muted: #ddd3f5; --chart-ink: #3b1f78; --chart-line: #3b1f78; --chart-bg: #fbf8fe; --chart-accent: #9a5fe6; --chart-hl: #ece0fb; --chart-center: #ffffff; --shadow: none;
}
:root .a4-sheet[data-pal][data-pal="amethyst"], :root .a4-stage[data-pal][data-pal="amethyst"] {
  --a4-paper: #fbfafd; --bg: #f4f1f9; --surface: #ffffff; --surface-2: #faf8fd; --ink: #20163a; --muted: #6e6585; --line: #e3dcf0; --brand: #3b1f78; --brand-2: #5a35a8; --gold: #9a5fe6; --gold-2: #b690f2; --gold-soft: #ece0fb; --kv-alt: #ebe5f4; --badge-text: #5f3b8f; --alert-info-text: #5f3b8f; --loshu-line: #d0c8de; --cover-1: #5a35a8; --cover-2: #3b1f78; --cover-3: #120a2e; --cover-muted: #ddd3f5; --chart-ink: #3b1f78; --chart-line: #3b1f78; --chart-bg: #fbf8fe; --chart-accent: #9a5fe6; --chart-hl: #ece0fb; --chart-center: #ffffff; --shadow: none;
}
:root[data-palette="sandalwood"] {
  --deep-1: #1c120a; --deep-2: #3d2814; --deep-3: #61401f; --deep-glow: #8a5a2b; --deep-4: #2b1a0d; --deep-text: #ecdcc8; --deep-text-2: #d7c6b2; --deep-text-3: #aa9884; --h-gold: #e0ab6c; --h-gold-2: #ecc28f; --h-gold-3: #f4d8b3;
}
:root[data-palette="sandalwood"]:not([data-theme="dark"]) {
  --bg: #f6f1ea; --surface: #ffffff; --surface-2: #fbf8f3; --ink: #2a2118; --muted: #716556; --line: #e6dccf; --brand: #4a3322; --brand-2: #6b4a31; --gold: #a9702d; --gold-2: #cf9650; --gold-soft: #f2e4d0; --shadow: 0 1px 2px rgba(42, 33, 24, 0.04), 0 8px 24px rgba(42, 33, 24, 0.07); --side-1: #3d2814; --side-2: #1c120a; --side-text: #ecdcc8; --side-strong: #ffffff; --side-muted: #9d8b77; --side-sub: #c0af9b; --side-active-bg: rgba(207, 150, 80, 0.18); --side-active: #cf9650; --logo-mark-text: #4a3322; --topbar: rgba(246, 241, 234, 0.85); --btn-text: #ffffff; --btn-gold-text: #0e0905; --badge-dark-text: #e2c096; --avatar-text: #e2c096; --kv-alt: #ede5db; --badge-text: #69451c; --alert-info-text: #69451c; --loshu-line: #d3c9bd; --cover-1: #6b4a31; --cover-2: #4a3322; --cover-3: #1c120a; --cover-muted: #ecdcc8; --chart-ink: #4a3322; --chart-line: #4a3322; --chart-bg: #fcf9f5; --chart-accent: #a9702d; --chart-hl: #f2e4d0; --chart-center: #ffffff;
}
:root[data-palette="sandalwood"][data-theme="dark"] {
  --bg: #14100b; --surface: #1f1912; --surface-2: #29211a; --ink: #f3ebdf; --muted: #bba98f; --line: #3f3427; --brand: #d9a566; --brand-2: #ebc08a; --gold: #d9a566; --gold-2: #ebc08a; --gold-soft: #3d2f1f; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35); --side-1: #0b0906; --side-2: #0b0906; --side-text: #bbb4aa; --logo-mark-text: #0b0906; --topbar: rgba(20, 16, 11, 0.88); --btn-text: #0b0906; --btn-gold-text: #0b0906; --badge-dark-text: #0b0906; --avatar-text: #0b0906; --kv-alt: #1b150f; --badge-text: #ebc08a; --alert-info-text: #ebc08a; --loshu-line: #514639; --cover-1: #61401f; --cover-2: #3d2814; --cover-3: #1c120a; --chart-ink: #f3ebdf; --chart-line: #c6a881; --chart-bg: #1f1912; --chart-accent: #ebc08a; --chart-hl: #3d2f1f; --chart-center: #29211a;
}
:root[data-palette="sandalwood"] :is(.a4-sheet, .a4-stage) {
  --a4-paper: #fcfaf8; --bg: #f6f1ea; --surface: #ffffff; --surface-2: #fbf8f3; --ink: #2a2118; --muted: #716556; --line: #e6dccf; --brand: #4a3322; --brand-2: #6b4a31; --gold: #a9702d; --gold-2: #cf9650; --gold-soft: #f2e4d0; --kv-alt: #ede5db; --badge-text: #69451c; --alert-info-text: #69451c; --loshu-line: #d3c9bd; --cover-1: #6b4a31; --cover-2: #4a3322; --cover-3: #1c120a; --cover-muted: #ecdcc8; --chart-ink: #4a3322; --chart-line: #4a3322; --chart-bg: #fcf9f5; --chart-accent: #a9702d; --chart-hl: #f2e4d0; --chart-center: #ffffff; --shadow: none;
}
:root .a4-sheet[data-pal][data-pal="sandalwood"], :root .a4-stage[data-pal][data-pal="sandalwood"] {
  --a4-paper: #fcfaf8; --bg: #f6f1ea; --surface: #ffffff; --surface-2: #fbf8f3; --ink: #2a2118; --muted: #716556; --line: #e6dccf; --brand: #4a3322; --brand-2: #6b4a31; --gold: #a9702d; --gold-2: #cf9650; --gold-soft: #f2e4d0; --kv-alt: #ede5db; --badge-text: #69451c; --alert-info-text: #69451c; --loshu-line: #d3c9bd; --cover-1: #6b4a31; --cover-2: #4a3322; --cover-3: #1c120a; --cover-muted: #ecdcc8; --chart-ink: #4a3322; --chart-line: #4a3322; --chart-bg: #fcf9f5; --chart-accent: #a9702d; --chart-hl: #f2e4d0; --chart-center: #ffffff; --shadow: none;
}
:root[data-palette="graphite"] {
  --deep-1: #0a0e17; --deep-2: #1b2433; --deep-3: #2c3b52; --deep-glow: #4a6490; --deep-4: #121a28; --deep-text: #d5dcea; --deep-text-2: #bfc6d4; --deep-text-3: #8e96a4; --h-gold: #8fb2f5; --h-gold-2: #b0cbfa; --h-gold-3: #d2e1fc;
}
:root[data-palette="graphite"]:not([data-theme="dark"]) {
  --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f9fafb; --ink: #161a22; --muted: #646b78; --line: #e2e5ea; --brand: #1f2937; --brand-2: #374151; --gold: #5a86e0; --gold-2: #7ea4ee; --gold-soft: #e1eafb; --shadow: 0 1px 2px rgba(22, 26, 34, 0.04), 0 8px 24px rgba(22, 26, 34, 0.07); --side-1: #1b2433; --side-2: #0a0e17; --side-text: #d5dcea; --side-strong: #ffffff; --side-muted: #818998; --side-sub: #a7aebc; --side-active-bg: rgba(126, 164, 238, 0.18); --side-active: #7ea4ee; --logo-mark-text: #1f2937; --topbar: rgba(243, 244, 246, 0.85); --btn-text: #ffffff; --btn-gold-text: #05070c; --badge-dark-text: #b2c8f5; --avatar-text: #b2c8f5; --kv-alt: #eaecef; --badge-text: #38538b; --alert-info-text: #38538b; --loshu-line: #ced1d6; --cover-1: #374151; --cover-2: #1f2937; --cover-3: #0a0e17; --cover-muted: #d5dcea; --chart-ink: #1f2937; --chart-line: #1f2937; --chart-bg: #f8fafe; --chart-accent: #5a86e0; --chart-hl: #e1eafb; --chart-center: #ffffff;
}
:root[data-palette="graphite"][data-theme="dark"] {
  --bg: #0c0f15; --surface: #151a23; --surface-2: #1c222d; --ink: #e8ecf3; --muted: #98a2b3; --line: #2b3340; --brand: #8fb2f5; --brand-2: #b5cdfa; --gold: #8fb2f5; --gold-2: #b5cdfa; --gold-soft: #293245; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35); --side-1: #07080c; --side-2: #07080c; --side-text: #b1b5bc; --logo-mark-text: #07080c; --topbar: rgba(12, 15, 21, 0.88); --btn-text: #07080c; --btn-gold-text: #07080c; --badge-dark-text: #07080c; --avatar-text: #07080c; --kv-alt: #11161d; --badge-text: #b5cdfa; --alert-info-text: #b5cdfa; --loshu-line: #3e4652; --cover-1: #2c3b52; --cover-2: #1b2433; --cover-3: #0a0e17; --chart-ink: #e8ecf3; --chart-line: #95a8ca; --chart-bg: #151a23; --chart-accent: #b5cdfa; --chart-hl: #293245; --chart-center: #1c222d;
}
:root[data-palette="graphite"] :is(.a4-sheet, .a4-stage) {
  --a4-paper: #fbfbfc; --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f9fafb; --ink: #161a22; --muted: #646b78; --line: #e2e5ea; --brand: #1f2937; --brand-2: #374151; --gold: #5a86e0; --gold-2: #7ea4ee; --gold-soft: #e1eafb; --kv-alt: #eaecef; --badge-text: #38538b; --alert-info-text: #38538b; --loshu-line: #ced1d6; --cover-1: #374151; --cover-2: #1f2937; --cover-3: #0a0e17; --cover-muted: #d5dcea; --chart-ink: #1f2937; --chart-line: #1f2937; --chart-bg: #f8fafe; --chart-accent: #5a86e0; --chart-hl: #e1eafb; --chart-center: #ffffff; --shadow: none;
}
:root .a4-sheet[data-pal][data-pal="graphite"], :root .a4-stage[data-pal][data-pal="graphite"] {
  --a4-paper: #fbfbfc; --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f9fafb; --ink: #161a22; --muted: #646b78; --line: #e2e5ea; --brand: #1f2937; --brand-2: #374151; --gold: #5a86e0; --gold-2: #7ea4ee; --gold-soft: #e1eafb; --kv-alt: #eaecef; --badge-text: #38538b; --alert-info-text: #38538b; --loshu-line: #ced1d6; --cover-1: #374151; --cover-2: #1f2937; --cover-3: #0a0e17; --cover-muted: #d5dcea; --chart-ink: #1f2937; --chart-line: #1f2937; --chart-bg: #f8fafe; --chart-accent: #5a86e0; --chart-hl: #e1eafb; --chart-center: #ffffff; --shadow: none;
}
:root .a4-sheet[data-pal][data-pal="classic"], :root .a4-stage[data-pal][data-pal="classic"] {
  --a4-paper: #fcfbf8; --bg: #f6f3ec; --surface: #ffffff; --surface-2: #fbf9f4; --ink: #1e1b2e; --muted: #6d6880; --line: #e8e2d5; --brand: #241d47; --brand-2: #3a2f6e; --gold: #b8892f; --gold-2: #d6ac55; --gold-soft: #f5ecd7; --kv-alt: #eeeadf; --badge-text: #72551d; --alert-info-text: #72551d; --loshu-line: #d4cec4; --cover-1: #3a2f6e; --cover-2: #241d47; --cover-3: #120e26; --cover-muted: #cfc8ea; --chart-ink: #241d47; --chart-line: #241d47; --chart-bg: #fdfbf6; --chart-accent: #b8892f; --chart-hl: #f5ecd7; --chart-center: #ffffff; --shadow: none;
}
/* ===== /PALETTES ===== */

.foot-prev { padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); text-align: center; font-size: .92rem; }
.report-contact .rf-disc { font-size: .8rem; margin-bottom: 6px; }

/* Admin → PDF & Report Footer: mock of the bottom of a printed page */
.pdf-mock { max-width: 640px; margin-top: 6px; background: #fff; color: #1f1b2e; border: 1px solid #ddd; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.08); padding: 18px 26px 12px; font-size: 12px; }
.pdf-mock-body span { display: block; height: 7px; margin: 0 0 8px; border-radius: 4px; background: #ece8df; }
.pdf-mock-disc { font-size: 10px; color: #6d6880; text-align: center; margin: 6px 0 4px; min-height: 2px; }
.pdf-mock-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid #ddd; padding-top: 8px; font-size: 11px; color: #4a4558; }
.pdf-mock-foot a { color: inherit; } .pdf-mock-foot b { color: #1f1b2e; }
.pm-site, .pm-page { color: #8a8399; white-space: nowrap; }
