/* ═══════════════════════════════════════════════════════════
   CircleThrice Member Portal — stylesheet · MODERN MYSTIC skin
   Montserrat Alternates display/labels over a Spectral serif body,
   cool-blue palette. Same IA & components as the almanac build.
═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --paper:  #f6f9fc;
  --ink:    #2b3240;   /* modern-mystic ink — cool deep slate */
  --blue:   #3f6d96;   /* mystic accent */
  --l-blue: #7c9bbd;
  --muted:  #586073;
  --rule:   #cbd5e1;
  --vpale:  #dde4ec;
  --icon:   #8a98ad;
  --inaus:  #6b6e84;   /* inauspicious — cool slate, diverging from --blue */
  --white:  #ffffff;

  --sidebar-w: 232px;
  --header-h: 60px;
  --maxw: 940px;

  /* Modern Mystic type: geometric rounded sans display, Spectral serif body */
  --disp: 'Montserrat Alternates', system-ui, sans-serif;
  --body: 'Spectral', Georgia, serif;
  --sc:   'Montserrat Alternates', system-ui, sans-serif;
}

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; }

#root { min-height: 100vh; }

/* ── shared type helpers ───────────────────────────────── */
.disp { font-family: var(--disp); font-style: normal; }
.sc {
  font-family: var(--sc);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.italic { font-style: italic; font-weight: 400; }

button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── icon primitives ───────────────────────────────────── */
.p-icon   { width: 15px; height: 15px; display: inline-block; flex-shrink: 0; color: var(--blue); overflow: visible; }
.p-icon-sm{ width: 13px; height: 13px; display: inline-block; vertical-align: middle; color: var(--blue); position: relative; top: -1px; overflow: visible; }
.s-chip   { width: 11px; height: 11px; display: inline-block; vertical-align: middle; color: var(--l-blue); margin-left: 3px; position: relative; top: -1px; overflow: visible; }
.s-chip.muted { color: var(--icon); }

/* ═══════════════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════════════ */
.app { min-height: 100vh; }

/* Header ───────────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: rgba(247,249,252,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: flex; align-items: baseline; gap: 9px;
}
.brand-mark {
  font-family: var(--disp); font-size: 23px; line-height: 1; color: var(--ink);
  letter-spacing: .01em;
}
.brand-mark .thrice { color: var(--blue); }
.brand-sub {
  font-family: var(--sc); font-size: 11px; letter-spacing: .18em;
  color: var(--muted); text-transform: uppercase;
}
.header-right { display: flex; align-items: center; gap: 14px; }
.tier-pill {
  font-family: var(--sc); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--blue);
  border: 1px solid var(--vpale); padding: 5px 9px; border-radius: 2px;
  display: flex; align-items: center; gap: 6px;
}
.tier-pill .star { width: 5px; height: 5px; background: var(--blue); border-radius: 50%; }
.acct-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--rule); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-size: 15px;
  transition: border-color .15s, color .15s;
}
.acct-btn:hover { border-color: var(--blue); color: var(--blue); }

/* What's New banner ─────────────────────────────────────── */
.whatsnew {
  position: sticky; top: var(--header-h); z-index: 35;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  background: #424d61; color: var(--paper);
  border-bottom: 1px solid #424d61;
  overflow: hidden;
}
.whatsnew .wn-icon { color: var(--l-blue); flex-shrink: 0; display: flex; }
.whatsnew .wn-icon svg { width: 18px; height: 18px; overflow: visible; }
.wn-text {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wn-head {
  font-family: var(--sc); font-size: 14px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--paper); flex-shrink: 0;
}
.wn-sep { flex-shrink: 0; width: 1px; align-self: stretch; margin: 2px 0; background: rgba(247,249,252,.28); }
.wn-sub {
  font-size: 16.5px; font-style: italic; font-weight: 400;
  color: rgba(247,249,252,.92); overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
@media (max-width: 700px) {
  .wn-sep, .wn-sub { display: none; }
  .wn-head { font-size: 13px; white-space: normal; }
}
.wn-dismiss {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  color: var(--l-blue); font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.wn-dismiss:hover { background: rgba(255,255,255,.08); color: var(--paper); }

/* Layout: sidebar + content ─────────────────────────────── */
.app-body { display: flex; align-items: flex-start; }

.sidebar {
  display: none; /* mobile: hidden, replaced by tab bar */
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: calc(var(--header-h));
  align-self: flex-start;
  padding: 26px 16px 40px;
  border-right: 1px solid var(--rule);
  min-height: calc(100vh - var(--header-h));
}
.sidebar-label {
  font-family: var(--sc); font-size: 11px; letter-spacing: .26em;
  color: var(--icon); text-transform: uppercase;
  padding: 0 12px 13px; margin-bottom: 14px;
  border-bottom: 1px solid var(--vpale);
}
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 2px;
  border-left: 2px solid transparent;
  color: var(--muted); transition: background .14s, color .14s, border-color .14s;
  text-align: left; width: 100%;
}
.nav-item:hover { background: var(--white); color: var(--ink); }
.nav-item.active {
  background: var(--white); color: var(--ink);
  border-left-color: var(--blue);
}
.nav-item .ni-glyph {
  width: 17px; height: 17px; color: var(--icon); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.nav-item.active .ni-glyph, .nav-item:hover .ni-glyph { color: var(--blue); }
.nav-item .ni-glyph svg { width: 17px; height: 17px; overflow: visible; }
.nav-item .ni-label {
  font-family: var(--sc); font-size: 13px; letter-spacing: .1em;
  text-transform: uppercase;
}
.nav-item .ni-meta {
  margin-left: auto; font-family: var(--sc); font-size: 11px;
  letter-spacing: .1em; color: var(--l-blue);
}
.sidebar-foot {
  margin-top: 28px; padding: 14px 12px 0; border-top: 1px solid var(--vpale);
}
.spine-note {
  font-size: 14px; font-style: italic; font-weight: 500;
  color: var(--muted); line-height: 1.5;
}

/* Content column ────────────────────────────────────────── */
.content {
  flex: 1; min-width: 0;
  padding: 22px 18px 110px;
}
@media (min-width: 640px) {
  .content { padding: 34px 40px 60px; }
}
.content-inner { max-width: var(--maxw); margin: 0 auto; }

/* ── Page header (per section) ───────────────────────────── */
.page-head { margin-bottom: 26px; }
.page-kicker-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 7px; }
.page-kicker-row .page-kicker { margin-bottom: 0; }
.day-nav { font-family: var(--sc); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--blue); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: color .14s; }
.day-nav:hover { color: var(--ink); }
.page-kicker {
  font-family: var(--sc); font-size: 14px; letter-spacing: .16em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 7px;
  display: flex; align-items: center; gap: 8px;
}
.page-kicker .ph-glyph { color: var(--icon); }
.page-kicker .ph-glyph svg { width: 13px; height: 13px; overflow: visible; vertical-align: middle; }
.page-title {
  font-family: var(--disp); font-size: 33px; line-height: 1.04; color: var(--ink);
}
@media (min-width: 640px){ .page-title { font-size: 40px; } }
.page-desc {
  font-size: 17.5px; font-weight: 500; color: var(--ink); line-height: 1.55;
  margin-top: 9px; max-width: 56ch;
}

/* ── Section labels & rules ──────────────────────────────── */
.sec-label {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--sc); font-size: 13px; letter-spacing: .18em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 16px;
}
.sec-label::after { content:""; flex:1; height:1px; background: var(--vpale); }

.block { margin-bottom: 40px; }

/* ── Cards: left-border accent, no divergent bg ──────────── */
.card {
  background: var(--white);
  border: 1px solid var(--vpale);
  border-left: 3px solid var(--rule);
  border-radius: 2px;
  padding: 20px 22px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card.accent { border-left-color: var(--blue); }
.card.clickable { cursor: pointer; }
.card.clickable:hover {
  border-left-color: var(--blue);
  box-shadow: 0 2px 14px rgba(30,35,48,.05);
}
.card-stack { display: flex; flex-direction: column; gap: 14px; }

/* related-content cards (Today · Go Deeper) */
.related-grid { display: grid; gap: 14px; }
@media (min-width: 640px){ .related-grid { grid-template-columns: 1fr 1fr; } }
.related-card { text-align: left; display: flex; flex-direction: column; align-items: flex-start; cursor: pointer; }
.related-card .card-desc { margin-bottom: 14px; }
.related-card .btn-text { margin-top: auto; min-height: 0; }

/* ── Day sheet: the day packaged as one object ───────────── */
.day-sheet {
  background: var(--white); border: 1px solid var(--vpale);
  border-left: 3px solid var(--blue); border-radius: 3px; overflow: hidden;
}
.ds-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 26px; border-bottom: 1px solid var(--vpale); }
.ds-topbar-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ds-date { font-family: var(--sc); text-transform: uppercase; letter-spacing: .18em; font-size: 13px; color: var(--muted); }
.ds-ruler { font-family: var(--sc); text-transform: uppercase; letter-spacing: .14em; font-size: 13px; color: var(--blue); display: inline-flex; align-items: center; gap: 5px; }
.ds-ruler::before { content: ""; width: 1px; height: 12px; background: var(--rule); margin-right: 5px; }
.ds-masthead { padding: 24px 26px 24px; }
@media (min-width: 700px){ .ds-masthead { display: grid; grid-template-columns: 1fr 200px; gap: 32px; align-items: start; } }
.dm-spark { margin-top: 22px; }
@media (min-width: 700px){ .dm-spark { margin-top: 0; } }
.ds-masthead .aus-notch { margin: 0; }
.ds-title { font-family: var(--disp); font-size: 27px; line-height: 1.08; color: #535c6e; }
@media (min-width: 640px){ .ds-title { font-size: 33px; } }
.ds-desc { font-size: 17px; font-weight: 500; line-height: 1.55; color: var(--ink); margin-top: 13px; max-width: 64ch; }
.ds-label {
  font-family: var(--sc); text-transform: uppercase; letter-spacing: .2em;
  font-size: 11px; color: var(--muted); margin-bottom: 13px;
}
.ds-transits { display: flex; flex-direction: column; gap: 14px; }
.transit-card { border: 1px solid var(--vpale); border-left: 2px solid var(--l-blue); border-radius: 2px; padding: 15px 17px; background: var(--paper); }
.tc-head { display: flex; align-items: center; gap: 9px; }
.tc-icns { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
.tc-pi { width: 16px; height: 16px; color: var(--blue); overflow: visible; }
.tc-sign { width: 14px; height: 14px; color: var(--icon); overflow: visible; }
.tc-star { width: 13px; height: 13px; color: var(--l-blue); overflow: visible; }
.tc-name { font-family: var(--disp); font-size: 19px; color: var(--ink); line-height: 1.15; }
.tc-meta { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.tc-row { display: flex; gap: 12px; align-items: baseline; }
.tc-label { font-family: var(--sc); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; color: var(--muted); flex: 0 0 118px; }
.tc-val { font-size: 15.5px; font-weight: 500; color: var(--ink); }
.tc-dur { color: var(--blue); white-space: nowrap; }
.tc-desc { font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--muted); margin-top: 11px; }
.ds-head { display: grid; gap: 22px; padding: 24px 26px; }
@media (min-width: 640px){ .ds-head { grid-template-columns: 1.05fr 1fr; gap: 32px; } }
@media (max-width: 639px){ .ds-focus { border-top: 1px solid var(--vpale); padding-top: 18px; } }
@media (min-width: 640px){ .ds-focus { border-left: 1px solid var(--vpale); padding-left: 32px; } }
.ds-auspice { display: flex; flex-direction: column; }
.ds-auspice .aus-notch { margin-top: 0; }
.ds-auspice-foot { margin-top: auto; padding-top: 26px; }
.ds-region { padding: 20px 26px; border-top: 1px solid var(--vpale); }
.ds-transits .event-row { padding: 9px 0; }
.ds-transits .event-row:first-child { padding-top: 0; }
.ds-transits .event-row:last-child { padding-bottom: 0; }
.ds-links { display: flex; flex-direction: column; }
.ds-link {
  display: flex; align-items: baseline; gap: 16px; width: 100%; text-align: left;
  padding: 13px 0; border-top: .5px solid var(--vpale); cursor: pointer;
}
.ds-link:first-child { border-top: none; padding-top: 2px; }
.ds-link:last-child { padding-bottom: 0; }
.ds-link-kick { font-family: var(--sc); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--muted); flex: 0 0 124px; }
@media (max-width: 480px){ .ds-link-kick { flex-basis: 96px; } }
.ds-link-title { font-family: var(--disp); font-size: 18px; color: var(--ink); line-height: 1.2; flex: 1; transition: color .14s; }
.ds-link:hover .ds-link-title { color: var(--blue); }
.ds-link-arr { color: var(--blue); font-size: 15px; flex-shrink: 0; transition: transform .14s; }
.ds-link:hover .ds-link-arr { transform: translateX(3px); }

.card-title {
  font-family: var(--disp); font-size: 20px; line-height: 1.2; color: var(--ink);
}
.card-desc {
  font-size: 16px; font-weight: 500; line-height: 1.58; color: var(--muted);
  margin-top: 6px;
}
.card-meta {
  font-family: var(--sc); font-size: 13px; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase;
}

/* ── Tier / status badges ────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--sc); font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; padding: 5px 9px; border-radius: 2px;
  border: 1px solid var(--vpale); color: var(--muted); white-space: nowrap;
}
.badge .dotmark { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.tier-free { color: var(--muted); border-color: var(--vpale); }
.badge.tier-basic { color: var(--l-blue); border-color: var(--vpale); }
.badge.tier-planning { color: var(--blue); border-color: var(--vpale); }
.badge.tier-engagement { color: var(--ink); border-color: var(--rule); background: var(--paper); }
.badge.locked { color: var(--ink); border-color: var(--rule); }
.badge.locked svg { width: 9px; height: 9px; }
.badge.status-available { color: var(--blue); }
.badge.status-full { color: var(--muted); }
.badge.status-upcoming { color: var(--l-blue); }
.badge.type { color: var(--muted); border-style: dashed; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--sc); font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; padding: 13px 22px; border-radius: 2px;
  min-height: 52px; transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--blue); color: var(--paper); border: 1px solid var(--blue); }
.btn-primary:hover { background: #335c77; border-color: #335c77; }
.btn-ghost { border: 1px solid var(--rule); color: var(--blue); }
.btn-ghost:hover { border-color: var(--blue); background: var(--white); }
.btn-upgrade {
  border: 1px solid var(--rule); color: var(--ink); background: var(--paper);
}
.btn-upgrade:hover { border-color: var(--blue); color: var(--blue); }
.btn-text {
  font-family: var(--sc); font-size: 11.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--blue);
  display: inline-flex; align-items: center; gap: 6px; min-height: 52px;
}
.btn-text:hover { color: var(--ink); }
.btn-block { width: 100%; }

/* lock icon glyph */
.lock-glyph { display: inline-flex; }
.lock-glyph svg { width: 11px; height: 11px; }

/* ── Auspice (Today hero) ────────────────────────────────── */
.auspice-hero {
  display: grid; gap: 20px;
}
@media (min-width: 640px){ .auspice-hero { grid-template-columns: 1.2fr 1fr; } }
.auspice-word { font-family: var(--disp); font-size: 40px; line-height: 1; color: var(--blue); }
@media (min-width:640px){ .auspice-word { font-size: 52px; } }
.rating-group { display: flex; align-items: center; gap: 11px; margin-top: 14px; }

/* auspice notch — diverging 1–5 sparkline */
.aus-notch { margin-top: 16px; width: 188px; max-width: 100%; }
.aus-notch-q { font-family: var(--sc); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: #535c6e; margin-bottom: 9px; }
.aus-notch-svg { width: 188px; max-width: 100%; height: 22px; display: block; overflow: visible; }
.aus-notch-labels { display: flex; justify-content: space-between; width: 188px; max-width: 100%; margin-top: 7px; }
.aus-notch-labels span { font-family: var(--sc); text-transform: uppercase; letter-spacing: .07em; font-size: 11px; font-weight: 500; }
.an-bad { color: #565a70; }
.an-mid { color: var(--ink); }
.an-good { color: var(--blue); }
.dots { display: flex; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; border: .8px solid var(--blue); }
.dot.on { background: var(--blue); }
.rating-num { font-family: var(--sc); font-size: 12.5px; letter-spacing: .12em; color: var(--muted); }

/* ── Mood strip (week) ───────────────────────────────────── */
.mood-strip {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--vpale); border-radius: 2px; overflow: hidden;
  background: var(--white);
}
.mood-cell {
  padding: 13px 6px 14px; text-align: center;
  border-right: 1px solid var(--vpale);
}
.mood-cell:last-child { border-right: none; }
.mood-cell.is-today { background: var(--paper); }
.mood-dow {
  font-family: var(--sc); font-size: 12px; letter-spacing: .08em;
  color: var(--muted); text-transform: uppercase;
}
.mood-date { font-family: var(--disp); font-size: 17px; margin: 3px 0 8px; color: var(--ink); }
.mood-word { font-size: 13px; font-style: italic; font-weight: 500; color: var(--muted); line-height: 1.18; min-height: 30px; }
.mood-bar { display: flex; gap: 2px; justify-content: center; margin-top: 7px; }
.mood-tick { width: 4px; height: 4px; border-radius: 50%; background: var(--vpale); }
.mood-tick.on { background: var(--l-blue); }
.mood-cell.is-today .mood-tick.on { background: var(--blue); }
.mood-cell.is-today .mood-dow { color: var(--blue); }

/* ── Calendar: week list ─────────────────────────────────── */
.tab-toggle {
  display: inline-flex; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden;
  margin-bottom: 24px;
}
.tab-toggle button {
  font-family: var(--sc); font-size: 12.5px; letter-spacing: .12em;
  text-transform: uppercase; padding: 12px 20px; min-height: 52px;
  color: var(--muted); transition: background .14s, color .14s;
}
.tab-toggle button + button { border-left: 1px solid var(--rule); }
.tab-toggle button.active { background: var(--blue); color: var(--paper); }

.week-day {
  display: grid; grid-template-columns: 92px 1fr; gap: 14px;
  padding: 18px 0; border-bottom: 1px solid var(--vpale);
}
.week-day:last-child { border-bottom: none; }
.week-day.is-today .wd-num { color: var(--blue); }
.wd-dow { font-family: var(--sc); font-size: 12.5px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.wd-num { font-family: var(--disp); font-size: 30px; line-height: 1; color: var(--ink); margin-top: 3px; }
.wd-today-tag { font-family: var(--sc); font-size: 12px; letter-spacing: .16em; color: var(--blue); text-transform: uppercase; margin-top: 6px; display: inline-block; }
.event-row {
  display: flex; align-items: flex-start; gap: 11px; padding: 7px 0;
}
.event-row + .event-row { border-top: .5px solid var(--vpale); }
.event-icn { color: var(--blue); margin-top: 2px; }
.event-icn svg { width: 14px; height: 14px; overflow: visible; }
.event-body { flex: 1; }
.event-name { font-size: 16.5px; font-style: italic; font-weight: 400; color: var(--ink); }
.event-desc { font-size: 15px; font-weight: 500; color: var(--muted); line-height: 1.52; margin-top: 3px; }
.event-time { font-family: var(--sc); font-size: 12px; letter-spacing: .08em; color: var(--blue); white-space: nowrap; }
.wd-empty { font-size: 14.5px; font-style: italic; font-weight: 400; color: var(--icon); padding: 7px 0; }

/* ── Calendar: month grid ────────────────────────────────── */
.month-grids { display: grid; gap: 28px; }
.month-grids.single { grid-template-columns: minmax(0, 1fr); }
.month-grids.single .month-title { font-size: 28px; margin-bottom: 16px; }
.month-grids.single .month-dow { font-size: 11px; padding-bottom: 7px; }
.month-grids.single .mg-cell { aspect-ratio: auto; min-height: 92px; padding: 9px 11px; }
.month-grids.single .mg-num { font-size: 15px; }
.month-grids.single .mg-event-icn svg { width: 16px; height: 16px; }
@media (min-width: 880px){ .month-grids { grid-template-columns: 1fr 1fr; } }
.month-block { }
.month-title { font-family: var(--disp); font-size: 22px; color: var(--ink); margin-bottom: 12px; }
.month-dow-row { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 4px; }
.month-dow {
  text-align: center; font-family: var(--sc); font-size: 12px; letter-spacing: .04em;
  color: var(--muted); text-transform: uppercase; padding-bottom: 4px;
}
.month-grid { display: grid; grid-template-columns: repeat(7,1fr); border-top: 1px solid var(--vpale); border-left: 1px solid var(--vpale); }
.mg-cell {
  aspect-ratio: 1 / 1; border-right: 1px solid var(--vpale); border-bottom: 1px solid var(--vpale);
  padding: 4px 5px; position: relative; min-height: 38px;
  display: flex; flex-direction: column;
}
.mg-cell.empty { background: var(--paper); }
.mg-cell.has-event { cursor: pointer; }
.mg-cell.has-event:hover { background: var(--paper); }
.mg-num { font-size: 12px; font-weight: 500; color: var(--muted); }
.mg-cell.is-today .mg-num { color: var(--blue); font-weight: 400; }
.mg-cell.is-today { box-shadow: inset 0 0 0 1.5px var(--blue); }
.mg-event-icn { margin-top: auto; color: var(--blue); }
.mg-event-icn svg { width: 12px; height: 12px; overflow: visible; }
.mg-selected { box-shadow: inset 0 0 0 1.5px var(--l-blue); background: var(--paper); }

.month-event-detail {
  margin-top: 14px; padding: 14px 16px; background: var(--white);
  border: 1px solid var(--vpale); border-left: 3px solid var(--blue); border-radius: 2px;
}

/* ── Planner ─────────────────────────────────────────────── */
.select-wrap { position: relative; display: inline-block; margin-bottom: 24px; }

/* custom dropdown */
.dropdown { position: relative; display: inline-block; margin-bottom: 24px; }
.dropdown-btn {
  display: flex; align-items: center; gap: 18px; white-space: nowrap;
  font-family: var(--disp); font-size: 22px; color: var(--ink);
  border: 1px solid var(--rule); background: var(--white);
  padding: 11px 18px; border-radius: 2px; min-height: 52px; cursor: pointer;
  transition: border-color .15s;
}
.dropdown-btn:hover { border-color: var(--blue); }
.dropdown.open .dropdown-btn { border-color: var(--blue); }
.dropdown-caret {
  width: 8px; height: 8px; flex-shrink: 0;
  border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s; position: relative; top: -2px;
}
.dropdown.open .dropdown-caret { transform: rotate(-135deg); top: 2px; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%;
  background: var(--white); border: 1px solid var(--rule); border-radius: 2px;
  box-shadow: 0 10px 30px rgba(30,35,48,.14); z-index: 30; overflow: hidden; padding: 4px 0;
}
.dropdown-opt {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  font-family: var(--disp); font-size: 20px; color: var(--ink);
  padding: 11px 22px 11px 15px; min-height: 50px; white-space: nowrap;
  border-left: 3px solid transparent;
  transition: background .12s, border-color .12s, color .12s;
}
.dropdown-opt:hover { background: var(--paper); }
.dropdown-opt.sel { color: var(--blue); border-left-color: var(--blue); }
.dropdown-opt .dd-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); opacity: 0; flex-shrink: 0; }
.dropdown-opt.sel .dd-dot { opacity: 1; }
.ct-select {
  font-family: var(--disp); font-size: 21px; color: var(--ink);
  border: 1px solid var(--rule); background: var(--white);
  padding: 9px 38px 9px 14px; border-radius: 2px; min-height: 48px;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
.ct-select:hover { border-color: var(--blue); }
.select-wrap::after {
  content: ""; position: absolute; right: 15px; top: 50%; width: 7px; height: 7px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.suite-grid { display: grid; gap: 16px; }
@media (min-width: 720px){ .suite-grid { grid-template-columns: repeat(3,1fr); } }
.suite-card { display: flex; flex-direction: column; min-height: 100%; }
.suite-icn { color: var(--blue); margin-bottom: 14px; }
.suite-icn svg { width: 26px; height: 26px; overflow: visible; }
.suite-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.suite-note { font-size: 13.5px; font-weight: 500; line-height: 1.45; color: var(--muted); margin-top: 12px; padding-top: 12px; border-top: .5px solid var(--vpale); }
.suite-note-link { display: inline-block; margin-top: 9px; font-family: var(--sc); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; color: var(--blue); text-align: left; }
.suite-note-link:hover { color: var(--ink); }

/* mini planner links (Grimoire) */
.mini-suite { display: grid; gap: 14px; }
@media (min-width: 720px){ .mini-suite { grid-template-columns: repeat(3, 1fr); } }
.mini-card { text-align: left; background: var(--white); border: 1px solid var(--vpale); border-left: 3px solid var(--blue); border-radius: 2px; padding: 16px 18px; display: flex; flex-direction: column; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.mini-card:hover { box-shadow: 0 4px 16px rgba(56,65,79,.07); transform: translateY(-1px); }
.mini-type { font-family: var(--disp); font-size: 19px; color: var(--ink); line-height: 1.1; }
.mini-desc { font-size: 14px; font-weight: 500; line-height: 1.45; color: var(--muted); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-go { font-family: var(--sc); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--blue); margin-top: 12px; }

/* ── Library ─────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px;
  padding-bottom: 22px; border-bottom: 1px solid var(--vpale);
}
.filter-pill {
  font-family: var(--sc); font-size: 12.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  padding: 11px 15px; border: 1px solid var(--vpale); border-radius: 2px;
  min-height: 48px; transition: background .14s, color .14s, border-color .14s;
}
.filter-pill:hover { border-color: var(--l-blue); color: var(--ink); }
.filter-pill.active { background: var(--blue); color: var(--paper); border-color: var(--blue); }
.filter-pill .fp-count { opacity: .7; margin-left: 5px; }

.lib-grid { display: grid; gap: 14px; }
@media (min-width: 720px){ .lib-grid { grid-template-columns: 1fr 1fr; } }
.lib-card { display: flex; flex-direction: column; gap: 0; }
.lib-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lib-type-icn { color: var(--icon); flex-shrink: 0; }
.lib-type-icn svg { width: 18px; height: 18px; overflow: visible; }
.lib-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 14px; border-top: .5px solid var(--vpale); gap: 10px;
}
.lib-badges { display: flex; gap: 7px; flex-wrap: wrap; }
.lib-empty { padding: 40px 0; text-align: center; font-style: italic; font-weight: 400; color: var(--muted); }

/* Library detail */
.detail-back { margin-bottom: 22px; }
.detail-head { border-bottom: 1px solid var(--vpale); padding-bottom: 22px; margin-bottom: 22px; }
.detail-title { font-family: var(--disp); font-size: 34px; line-height: 1.06; color: var(--ink); margin: 12px 0 14px; }
@media (min-width:640px){ .detail-title { font-size: 44px; } }
.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-body { font-size: 18.5px; font-weight: 500; line-height: 1.65; color: var(--ink); max-width: 62ch; }
.detail-meta-grid {
  display: grid; gap: 1px; background: var(--vpale);
  border: 1px solid var(--vpale); border-radius: 2px; margin: 26px 0; overflow: hidden;
}
@media (min-width: 560px){ .detail-meta-grid { grid-template-columns: repeat(3,1fr); } }
.dm-cell { background: var(--white); padding: 16px 18px; }
.dm-label { font-family: var(--sc); font-size: 12px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.dm-value { font-size: 16px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 7px; }

/* ── Sessions ────────────────────────────────────────────── */
.session-card { display: grid; gap: 16px; }
@media (min-width: 640px){ .session-card { grid-template-columns: 1fr auto; align-items: center; } }
.session-when {
  display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px;
}
.sw-item { }
.sw-label { font-family: var(--sc); font-size: 12px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.sw-val { font-size: 15.5px; font-weight: 500; color: var(--ink); margin-top: 2px; font-style: italic; }
.session-cta { display: flex; flex-direction: column; gap: 9px; align-items: stretch; min-width: 168px; }
.session-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 4px; }

/* ── Grimoire ────────────────────────────────────────────── */
.rite-hero { border-left-width: 3px; }
.rite-title { font-family: var(--disp); font-size: 30px; line-height: 1.08; color: var(--ink); }
@media (min-width:640px){ .rite-title { font-size: 38px; } }
.rite-meta { display: flex; gap: 16px; flex-wrap: wrap; margin: 14px 0 6px; }
.rite-cols { display: grid; gap: 28px; margin-top: 26px; }
@media (min-width: 760px){ .rite-cols { grid-template-columns: 230px 1fr; align-items: start; } }
.supplies-list { display: flex; flex-direction: column; gap: 2px; }
.supply {
  display: flex; align-items: flex-start; gap: 11px; padding: 9px 0;
  border-bottom: .5px solid var(--vpale); text-align: left; width: 100%;
}
.supply:last-child { border-bottom: none; }
.supply-box {
  width: 16px; height: 16px; border: 1.2px solid var(--rule); border-radius: 2px;
  flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center;
  transition: border-color .14s, background .14s;
}
.supply.checked .supply-box { background: var(--blue); border-color: var(--blue); }
.supply-box svg { width: 10px; height: 10px; color: var(--paper); opacity: 0; }
.supply.checked .supply-box svg { opacity: 1; }
.supply-text { font-size: 16px; font-weight: 500; line-height: 1.45; color: var(--ink); }
.supply.checked .supply-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--rule); }
.supply-opt { font-style: italic; color: var(--muted); }

.steps-list { display: flex; flex-direction: column; }
.step {
  border-bottom: 1px solid var(--vpale);
}
.step:last-child { border-bottom: none; }
.step-head {
  display: flex; align-items: baseline; gap: 14px; padding: 16px 0;
  width: 100%; text-align: left;
}
.step-num {
  font-family: var(--disp); font-size: 22px; color: var(--blue); line-height: 1;
  width: 30px; flex-shrink: 0;
}
.step-titlewrap { flex: 1; }
.step-title { font-family: var(--disp); font-size: 19px; color: var(--ink); line-height: 1.2; }
.step-dur { font-family: var(--sc); font-size: 12px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; margin-top: 4px; }
.step-chevron {
  width: 11px; height: 11px; border-right: 1.4px solid var(--muted); border-bottom: 1.4px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s; flex-shrink: 0; align-self: center;
}
.step.open .step-chevron { transform: rotate(-135deg); }
.step-body {
  font-size: 17px; font-weight: 500; line-height: 1.65; color: var(--muted);
  padding: 0 0 18px 44px; max-width: 64ch;
}

/* ── Forums ──────────────────────────────────────────────── */
.forum-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.topic-row { display: flex; gap: 8px; flex-wrap: wrap; }
.thread {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--vpale); cursor: pointer; width: 100%; text-align: left;
}
.thread:hover .thread-title { color: var(--blue); }
.thread-title { font-family: var(--disp); font-size: 19px; color: var(--ink); line-height: 1.2; transition: color .14s; }
.thread-sub { font-size: 14.5px; font-weight: 500; font-style: italic; color: var(--muted); margin-top: 5px; display: flex; gap: 14px; flex-wrap: wrap; }
.thread-stat { text-align: right; }
.thread-replies { font-family: var(--disp); font-size: 24px; color: var(--blue); line-height: 1; }
.thread-replies-l { font-family: var(--sc); font-size: 12px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }

/* Thread detail */
.reply {
  padding: 18px 0; border-bottom: 1px solid var(--vpale);
}
.reply-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.reply-author { font-family: var(--sc); font-size: 13px; letter-spacing: .1em; color: var(--ink); text-transform: uppercase; }
.reply-time { font-family: var(--sc); font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.reply-op { color: var(--blue); }
.reply-body { font-size: 17.5px; font-weight: 500; line-height: 1.6; color: var(--ink); }

/* ── Upgrade strip ───────────────────────────────────────── */
.upgrade-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--white); border: 1px solid var(--vpale); border-left: 3px solid var(--l-blue);
  border-radius: 2px; padding: 18px 20px; flex-wrap: wrap;
}
.upgrade-strip .us-text { flex: 1; min-width: 220px; }
.us-head { font-family: var(--disp); font-size: 19px; color: var(--ink); }
.us-sub { font-size: 15px; font-weight: 500; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* ── Blog / modal ────────────────────────────────────────── */
.modal-scrim {
  position: fixed; inset: 0; z-index: 100; background: rgba(30,35,48,.42);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
@media (min-width: 640px){ .modal-scrim { align-items: center; padding: 30px; } }
.modal {
  background: var(--paper); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  border-radius: 4px 4px 0 0; border: 1px solid var(--rule);
  padding: 26px 22px 34px;
}
@media (min-width: 640px){ .modal { border-radius: 4px; padding: 36px 40px 40px; } }
.modal-close { position: absolute; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-x { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule); color: var(--muted); font-size: 17px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.modal-x:hover { border-color: var(--blue); color: var(--blue); }
.modal-title { font-family: var(--disp); font-size: 30px; line-height: 1.08; color: var(--ink); }
.modal-byline { font-family: var(--sc); font-size: 13px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; margin-top: 10px; }
.modal-body { font-size: 18px; font-weight: 500; line-height: 1.7; color: var(--ink); margin-top: 20px; }
.modal-body p { margin-bottom: 15px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--sc); font-size: 12.5px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%; font-family: var(--body); font-size: 16px; color: var(--ink);
  border: 1px solid var(--rule); background: var(--white); border-radius: 2px; padding: 11px 13px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--blue); }

/* ── Toast ───────────────────────────────────────────────── */
.toast-wrap {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  z-index: 120; width: calc(100% - 36px); max-width: 420px;
}
@media (min-width: 640px){ .toast-wrap { bottom: 32px; } }
.toast {
  background: var(--ink); color: var(--paper); border-radius: 3px;
  padding: 14px 18px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 30px rgba(30,35,48,.25);
  animation: toast-in .3s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.toast .t-icn { color: var(--l-blue); }
.toast .t-icn svg { width: 16px; height: 16px; overflow: visible; }
.toast .t-text { font-size: 15.5px; font-weight: 500; line-height: 1.4; }
.toast .t-text strong { font-weight: 400; }

/* ── Footer ──────────────────────────────────────────────── */
.app-footer {
  border-top: 1px solid var(--rule); margin-top: 20px;
  padding: 22px 20px; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-family: var(--sc); font-size: 12px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.footer-links a:hover { color: var(--blue); }
.footer-copy { font-size: 12px; font-weight: 400; font-style: italic; color: var(--icon); }

/* ═══════════════════════════════════════════════════════════
   MOBILE TAB BAR
═══════════════════════════════════════════════════════════ */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(247,249,252,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--rule);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 9px 4px 10px; min-height: 56px; color: var(--muted);
  transition: color .14s;
}
.tab .tab-glyph { width: 19px; height: 19px; color: var(--icon); display: flex; align-items: center; justify-content: center; }
.tab .tab-glyph svg { width: 19px; height: 19px; overflow: visible; }
.tab .tab-label { font-family: var(--sc); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.tab.active { color: var(--blue); }
.tab.active .tab-glyph { color: var(--blue); }

/* More drawer */
.drawer-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(30,35,48,.42); }
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  background: var(--paper); border-top: 1px solid var(--rule);
  border-radius: 10px 10px 0 0; padding: 10px 14px calc(20px + env(safe-area-inset-bottom, 0));
  animation: drawer-up .25s ease;
}
@keyframes drawer-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.drawer-grab { width: 38px; height: 4px; border-radius: 3px; background: var(--rule); margin: 6px auto 14px; }
.drawer-item {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 15px 10px; border-bottom: 1px solid var(--vpale); color: var(--ink);
}
.drawer-item:last-child { border-bottom: none; }
.drawer-item .di-glyph { color: var(--icon); width: 19px; display: flex; }
.drawer-item .di-glyph svg { width: 19px; height: 19px; overflow: visible; }
.drawer-item.active { color: var(--blue); }
.drawer-item.active .di-glyph { color: var(--blue); }
.drawer-item .di-label { font-family: var(--sc); font-size: 13.5px; letter-spacing: .1em; text-transform: uppercase; }
.drawer-item .di-meta { margin-left: auto; font-family: var(--sc); font-size: 11px; letter-spacing: .1em; color: var(--l-blue); }

/* ═══════════════════════════════════════════════════════════
   DESKTOP OVERRIDE (≥640px)
═══════════════════════════════════════════════════════════ */
@media (min-width: 640px) {
  .sidebar { display: block; }
  .tabbar { display: none; }
  .content { padding-bottom: 60px; }
}

/* keep tabbar visible only below 640 */
@media (max-width: 639px) {
  .sidebar { display: none; }
}

/* utility */
.row { display: flex; align-items: center; }
.gap8 { gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt8 { margin-top: 8px; }
.mt14 { margin-top: 14px; }
.mt20 { margin-top: 20px; }
.muted { color: var(--muted); }
.fade-in { animation: fade .28s ease both; }
@keyframes fade { from { transform: translateY(5px); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }

/* ═══════════════════════════════════════════════════════════
   MODERN MYSTIC type adjustments
   Montserrat Alternates renders light at 400 and wide at large
   sizes — give the display role weight + tighter tracking, and
   give the small-caps label role a touch more weight than the
   serif (Cormorant SC) needed.
═══════════════════════════════════════════════════════════ */
.disp,
.brand-mark, .acct-btn,
.page-title, .ds-title, .tc-name, .ds-link-title, .card-title,
.auspice-word, .mood-date, .wd-num, .month-title,
.dropdown-btn, .dropdown-opt, .ct-select, .mini-type,
.detail-title, .rite-title, .step-num, .step-title,
.thread-title, .thread-replies, .us-head, .modal-title {
  font-weight: 600;
  letter-spacing: -0.012em;
}
/* hero-scale display: hold the line on optical size & tracking */
.brand-mark { letter-spacing: -0.005em; }
.auspice-word { font-size: 44px; }
@media (min-width: 640px){ .auspice-word { font-size: 46px; } }
.page-title { letter-spacing: -0.018em; }
.detail-title { letter-spacing: -0.02em; }

/* small-caps / label role (was Cormorant SC) — Montserrat needs a bit more weight */
.sc,
.brand-sub, .tier-pill, .nav-item .ni-label, .nav-item .ni-meta,
.sidebar-label, .page-kicker, .sec-label, .ds-date, .ds-ruler,
.ds-label, .ds-link-kick, .card-meta, .badge, .btn, .btn-text,
.tab-toggle button, .filter-pill, .wd-dow, .wd-today-tag, .mood-dow,
.month-dow, .event-time, .tc-label, .dm-label, .sw-label, .step-dur,
.thread-replies-l, .reply-author, .reply-time, .footer-links a,
.tab .tab-label, .drawer-item .di-label, .modal-byline, .toast,
.aus-notch-q, .aus-notch-labels span, .suite-note-link, .mini-go,
.wn-head, .day-nav {
  font-weight: 500;
}
