/* ═══════════════════════════════════════
   WOBAZI — Registered User Portal
   Layout only. Reuses .nav-bar, .results-toc-*, .scroll-body,
   .section-head, .context-strip and .hero-compact from style.css,
   and only existing tokens/values.
═══════════════════════════════════════ */

/* The screen itself only fades (the backdrop); the sheet does the moving. */
#portal.screen-shelf { background: transparent; overflow: hidden; transform: none; transition: opacity 0.3s ease; }

/* Shelf chrome: My Wobazi (home/history/reading/settings) always opens as a dismissible
   sheet over a dimmed backdrop, never a full page — closing it (✕, or tapping the backdrop)
   returns to whatever tab was open, same as the Oracle drawer's _oracleReturnTab pattern. */
#portal .shelf-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(7, 7, 15, 0.86);
}
#portal .shelf-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: max(52px, calc(env(safe-area-inset-top, 0px) + 30px));
  z-index: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  /* Slides up from the bottom edge; app/portal.js drags it down to dismiss. */
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.22, 0.9, 0.3, 1);
  will-change: transform;
}
#portal.active .shelf-sheet { transform: translateY(0); }
#portal .shelf-handle,
#portal .nav-bar { touch-action: none; }   /* a drag on the grab area moves the sheet, not the page */
#portal .shelf-handle { cursor: grab; }

/* Moving between the hub and a sub-page (Readings, Settings, a day) inside the sheet:
   deeper pages come in from the right, going back comes in from the left. */
@keyframes shelf-in-fwd  { from { opacity: 0; transform: translateX(28px); }  to { opacity: 1; transform: none; } }
@keyframes shelf-in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
#portal .shelf-in-fwd  { animation: shelf-in-fwd 0.26s cubic-bezier(0.22, 0.9, 0.3, 1); }
#portal .shelf-in-back { animation: shelf-in-back 0.26s cubic-bezier(0.22, 0.9, 0.3, 1); }

@media (prefers-reduced-motion: reduce) {
  #portal .shelf-sheet { transition: none; }
  #portal .shelf-in-fwd,
  #portal .shelf-in-back { animation: none; }
}
#portal .shelf-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--w2);
  margin: 10px auto 0;
  flex-shrink: 0;
}
#portal .nav-bar { flex-shrink: 0; }
#portal .nav-bar .nav-title { flex: 1; }
#portal .nav-bar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
#portal .btn-shelf-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--w07);
  color: var(--text);
  transition: background 0.2s;
  flex-shrink: 0;
}
#portal .btn-shelf-close:active { background: var(--w14); }

#portal .results-toc-chip { cursor: pointer; }
#portal .results-toc-chip.is-on {
  background: var(--w12);
  color: var(--text);
  border-color: var(--w2);
}
#portal .portal-day.is-read {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}
#portal .portal-day:disabled,
#portal .portal-day:disabled:hover {
  background: var(--w06);
  border-color: var(--border);
  color: var(--m4);
  cursor: default;
}

.portal-month-head { margin-top: 16px; }

.portal-more {
  display: flex;
  justify-content: center;
  margin: 8px 0 32px;
}

.portal-empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  padding: 48px 24px;
}

/* ── Portal home, journal, account (existing tokens/values only) ── */
/* First section sits right under the header */
#portal .scroll-body > div > .section:first-child { margin-top: 0; }
.portal-card { border-color: var(--border); }
.portal-keep { margin-top: 16px; }
.portal-id-row { display: flex; align-items: center; gap: 10px; }
.portal-id-name { font-size: 16px; font-weight: 700; }
.portal-copy { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0 0 14px; }
.portal-card .portal-copy { margin: 0; }
.portal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.portal-actions a.btn-secondary { text-decoration: none; }

.portal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.portal-stat {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--w04); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 10px; text-align: center;
}
.portal-stat-num { font-size: 24px; font-weight: 700; color: var(--gold); line-height: 1; }
.portal-stat-lbl { font-size: 11px; color: var(--muted); line-height: 1.4; }

.portal-row-wrap .context-strip { margin-bottom: 8px; }
.portal-row-wrap { margin-bottom: 14px; }
.portal-note-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 4px; }
.portal-reaction-tag { font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 100px; background: var(--w07); border: 1px solid var(--border); color: var(--text); }
.portal-reaction-tag.is-accurate { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }
.portal-note-snippet { font-style: italic; }

.portal-reactions { display: flex; gap: 8px; margin-bottom: 16px; }
#portal .portal-reaction-btn { flex: 1; justify-content: center; padding: 10px 12px; }
#portal .portal-reaction-btn.is-on { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }
.portal-note-label { display: block; margin-bottom: 8px; }
#portal .portal-note-input,
#portal .portal-input { display: block; width: 100%; max-height: none; border-radius: var(--radius-md); }
#portal .portal-note-input { min-height: 110px; }
#portal .portal-input { margin-bottom: 14px; }
.portal-save-state { min-height: 1.5em; font-size: 12px; color: var(--muted); margin: 8px 4px; }
.portal-private { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 12px 0 0; }

#portal .portal-link { width: 100%; justify-content: space-between; }
#portal .portal-lang { margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); }
#portal .portal-danger { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.25); color: #f87171; }
#portal .portal-danger:disabled { opacity: 0.4; cursor: default; }

/* ── Signed-in menu: member items first, site links next, language last ── */
.drawer-member.drawer-authed {
  display: flex; flex-direction: column; gap: 10px;
  text-decoration: none; text-align: left; font-size: inherit; color: inherit; padding: 0;
}
.drawer-member-head { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.drawer-member-avatar { width: 36px; height: 36px; flex-shrink: 0; }
.drawer-member-id { min-width: 0; }
.drawer-member-name { font-size: 14px; font-weight: 600; color: var(--text); }
.drawer-member-handle {
  display: block; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-decoration: none;
}
.drawer-member-choose { color: var(--gold); }
.portal-hero-title { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.25; margin: 0 0 8px; }
.portal-handle { margin: 8px 0 0; }
.portal-hist-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
#compat-type { margin: 12px 0 4px; }
#compat-type .rel-type-seg { margin-top: 8px; }
.portal-copy, .portal-hero-title, .splash-tagline { text-wrap: pretty; }

/* Member avatar button: opens the header menu on every page */
.nav-member-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--w07);
  border: 1px solid var(--border);
  color: var(--text);
  overflow: hidden;
}
.nav-member-btn .nav-authed-avatar { position: absolute; inset: 0; width: 100%; height: 100%; }
.nav-member-btn .nav-authed-avatar:not([src]),
.nav-member-btn .nav-authed-avatar[src=""] { display: none; }
.nav-member-btn:hover { border-color: var(--gold); }

/* ── Settings: profile photo ── */
.portal-avatar-big { position: relative; flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--w07); box-shadow: 0 0 0 1px var(--border); }
.portal-avatar-big img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portal-avatar-initial { font-weight: 700; font-size: 20px; color: var(--text); }
.portal-avatar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.portal-avatar-actions .btn-secondary[hidden] { display: none; }

/* ═══════════ My Wobazi dashboard (portal home) ═══════════
   Compact cards on the theme tokens, so light mode follows. Tier colours match the
   Power Days calendar; element colours are the app's --el-* tokens. */
.dash { display: flex; flex-direction: column; gap: 12px; }
.dash > .section { margin: 0; }
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.dash-card[role="button"] { cursor: pointer; }
.dash-card[role="button"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.dash-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.dash-head-out { padding: 0 2px; }
.dash-kicker { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.dash-sub { margin: 0; font-size: 13px; line-height: 1.45; color: var(--m6); }
.dash-link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--m6); cursor: pointer; white-space: nowrap; }
.dash-link:hover, .dash-link:focus-visible { color: var(--gold); outline: none; }
.dash-cn { color: var(--m5); font-weight: 500; }

/* Today */
.dash-today { display: flex; gap: 12px; align-items: center; }
.dash-gauge { width: 72px; height: 72px; flex: 0 0 72px; }
.dash-today .dash-card-head { margin-bottom: 0; flex-wrap: wrap; row-gap: 2px; }
.dash-gauge-track { stroke: var(--w08, rgba(240,240,255,0.08)); }
body.light-mode .dash-gauge-track { stroke: rgba(0,0,0,0.08); }
.dash-gauge-val { stroke: var(--gold); }
/* Gauge colour = the day's verdict: gold auspicious, green balanced, red challenging. */
.dash-gauge-val.is-auspicious { stroke: var(--gold); }
.dash-gauge-val.is-balanced { stroke: #22c55e; }
.dash-gauge-val.is-challenging { stroke: #ef4444; }
body.light-mode .dash-gauge-val.is-balanced { stroke: #15803d; }
body.light-mode .dash-gauge-val.is-challenging { stroke: #c0262d; }
.dash-gauge-num { fill: var(--text); font-size: 24px; font-weight: 800; font-family: inherit; }
.dash-gauge-of { fill: var(--m5); font-size: 10px; font-family: inherit; }
.dash-today-main { min-width: 0; flex: 1; }
.dash-today-pillar { margin: 4px 0 2px; font-size: 16px; font-weight: 700; color: var(--text); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dash-verdict { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--m7); }
.dash-verdict.is-auspicious { color: var(--gold); border-color: var(--gold-dim); background: var(--gold-dim); }
.dash-verdict.is-challenging { color: #f8a5a5; border-color: rgba(239,68,68,0.35); }
.dash-verdict.is-balanced { color: #86e6ad; border-color: rgba(34,197,94,0.35); }
body.light-mode .dash-verdict.is-balanced { color: #15803d; }
body.light-mode .dash-verdict.is-challenging { color: #b42318; }
.dash-today-msg { margin: 0; font-size: 13px; line-height: 1.45; color: var(--m7); }

/* Power Days */
.dash-power-head { margin: 2px 0 2px; font-size: 17px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.dash-tier { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--w08, rgba(240,240,255,0.08)); color: var(--m8); }
.dash-tier.is-power { background: linear-gradient(135deg, #f0d080, #e8a040); color: #1a0a00; }
.dash-tier.is-good { background: rgba(34,197,94,0.14); color: #86e6ad; }
.dash-tier.is-avoid { background: rgba(239,68,68,0.16); color: #f8a5a5; }
body.light-mode .dash-tier.is-good { color: #15803d; }
body.light-mode .dash-tier.is-avoid { color: #b42318; }
.dash-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.dash-wk { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dash-wk-dow { font-size: 10px; font-weight: 600; color: var(--m5); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.dash-wk.is-today .dash-wk-dow { color: var(--gold); }
.dash-wk-day {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--m7);
}
.dash-wk-day.is-power {
  color: #ffe3a0; font-weight: 800;
  background: radial-gradient(circle at 50% 40%, rgba(240,200,96,0.34), rgba(232,160,64,0.14) 70%);
  box-shadow: inset 0 0 0 1px rgba(240,192,64,0.45);
}
.dash-wk-day.is-good { color: #86e6ad; font-weight: 700; box-shadow: inset 0 0 0 1.5px rgba(34,197,94,0.6); }
.dash-wk-day.is-avoid { color: #ff9f9f; text-decoration: line-through; text-decoration-color: rgba(239,68,68,0.8); }
body.light-mode .dash-wk-day.is-power { color: #7a4a00; }
body.light-mode .dash-wk-day.is-good { color: #15803d; }
body.light-mode .dash-wk-day.is-avoid { color: #b42318; }
.dash-wk.is-today .dash-wk-day { outline: 1.5px solid var(--m5); outline-offset: 2px; }
.dash-wk-score { font-size: 10px; color: var(--m5); font-variant-numeric: tabular-nums; }
.dash-week-key { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--m5); }
.dash-week-key span { display: inline-flex; align-items: center; gap: 5px; }
.dash-week-key i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dash-week-key i.is-power { background: #e8a040; }
.dash-week-key i.is-good { box-shadow: inset 0 0 0 1.5px rgba(34,197,94,0.8); }
.dash-week-key i.is-avoid { background: rgba(239,68,68,0.8); }

/* People: one scrollable row of compact cards */
.dash-people { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.dash-people::-webkit-scrollbar { display: none; }
.dash-person {
  flex: 0 0 116px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 12px 8px 10px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font: inherit; cursor: pointer;
}
.dash-person:hover, .dash-person:focus-visible { border-color: var(--gold-dim); outline: none; }
.dash-person-av { width: 40px; height: 40px; }
.dash-person-name { font-size: 13px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-person-type { font-size: 11px; color: var(--m5); white-space: nowrap; }
.dash-person-arch { font-size: 11px; color: var(--m6); line-height: 1.3; }
.dash-person-score {
  --p: 0; width: 34px; height: 34px; border-radius: 50%; margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--w08, rgba(240,240,255,0.1)) 0);
}
.dash-person-score b {
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg-card);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--text);
}
.dash-person-add { justify-content: center; border-style: dashed; color: var(--m6); }
.dash-person-plus { font-size: 22px; line-height: 1; color: var(--gold); }

/* Stats */
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 6px; }
.dash-stat { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.dash-stat-n { font-size: 22px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; }
.dash-stat-n small { font-size: 12px; font-weight: 600; color: var(--m5); }
.dash-stat-l { font-size: 11px; color: var(--m5); }

/* 30-day trend */
.dash-chart { position: relative; margin-top: 8px; padding-left: 20px; }
.dash-chart svg { display: block; width: 100%; height: 96px; overflow: visible; }
.dash-bar { fill: var(--gold); opacity: 0.85; }
.dash-bar-g.is-on .dash-bar { opacity: 1; }
.dash-bar-miss { fill: var(--m2); }
.dash-hit { fill: transparent; cursor: pointer; }
.dash-grid { stroke: var(--m2); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.dash-axis { stroke: var(--m3); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dash-y { position: absolute; left: 0; transform: translateY(-50%); font-size: 10px; color: var(--m5); pointer-events: none; }
.dash-x { display: flex; justify-content: space-between; font-size: 10px; color: var(--m5); margin-top: 2px; padding-left: 20px; }
.dash-tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%);
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; white-space: nowrap;
  pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

/* Recent readings */
.dash-recents { display: flex; flex-direction: column; }
.dash-recent {
  display: grid; grid-template-columns: 96px 44px 1fr auto auto; align-items: center; gap: 8px;
  padding: 9px 0; border: 0; border-top: 1px solid var(--border); background: none;
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.dash-recent:first-child { border-top: 0; }
.dash-recent:hover .dash-recent-date, .dash-recent:focus-visible .dash-recent-date { color: var(--gold); }
.dash-recent:focus-visible { outline: none; }
.dash-recent-date { font-size: 13px; font-weight: 600; white-space: nowrap; }
.dash-recent-pillar { font-size: 14px; color: var(--m7); }
.dash-recent-verdict { font-size: 11px; color: var(--m5); text-transform: uppercase; letter-spacing: 0.06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-recent-score { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--gold-dim); color: var(--gold); font-variant-numeric: tabular-nums; }
.dash-recent-note { font-size: 12px; color: var(--m5); }

/* Compatibility invite: now a compact card near the bottom */
.dash-invite .portal-actions { margin-top: 10px; }
.dash-invite .portal-handle { margin-top: 8px; }

@media (min-width: 768px) {
  .dash { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .dash > .dash-today, .dash > .dash-power, .dash > .section:not(.dash-card):not(.dash-stats), .dash > .dash-stats, .dash > .dash-trend { grid-column: 1 / -1; }
}
.dash .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Settings: grouped rows, small icon buttons ── */
#portal-account { padding-top: 4px; }
.set-id { display: flex; align-items: center; gap: 12px; padding: 4px 2px 6px; }
.set-avatar { width: 52px; height: 52px; flex-shrink: 0; }
.set-id-text { flex: 1; min-width: 0; }
.set-id-name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-id-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-group-label {
  margin: 18px 4px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.set-group { background: var(--w05); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.set-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 46px; padding: 6px 12px; margin: 0;
  font: inherit; font-size: 14px; color: var(--text); text-align: left; text-decoration: none;
  background: none; border: 0; border-top: 1px solid var(--border);
}
.set-group > .set-row:first-child, .set-group > form.set-row:first-child { border-top: 0; }
.set-row-link { cursor: pointer; }
.set-row-link:active { background: var(--w07); }
.set-ico { display: flex; color: var(--gold); flex-shrink: 0; }
.set-label { flex-shrink: 0; font-weight: 500; }
.set-value { flex: 1; min-width: 0; text-align: right; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-chev { display: flex; color: var(--m4, var(--muted)); margin-left: auto; flex-shrink: 0; }
.set-value + .set-chev { margin-left: 0; }
.set-input {
  flex: 1; min-width: 0; height: 32px; padding: 0 10px;
  font: inherit; font-size: 16px; /* 16px: no iOS zoom on focus */ color: var(--text);
  background: var(--w05); border: 1px solid var(--border); border-radius: 8px; outline: none;
}
.set-input:focus { border-color: var(--gold); }
.set-icon-btn {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; padding: 0; border-radius: 8px;
  color: var(--text); background: var(--w07); border: 1px solid var(--border); cursor: pointer;
}
.set-icon-btn:active { background: var(--w14); }
.set-icon-btn:disabled { opacity: 0.5; }
.set-icon-btn[hidden] { display: none; }
.set-pill {
  flex-shrink: 0; padding: 4px 9px; border-radius: 6px; font-size: 11px; font-weight: 600;
  color: var(--text); text-decoration: none; background: var(--w07); border: 1px solid var(--border);
}
.set-lang { margin-left: auto; }
.set-hint { margin: 0; padding: 0 12px 8px 40px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.set-state:empty { display: none; }
.set-state { margin: 4px 12px 8px; font-size: 12px; color: var(--muted); }
.set-danger { border-top: 1px solid var(--border); }
.set-danger > summary { list-style: none; border-top: 0; }
.set-danger > summary::-webkit-details-marker { display: none; }
.set-danger > summary .set-ico, .set-danger > summary .set-label { color: #ff7a7a; }
.set-danger[open] > summary .set-chev { transform: rotate(90deg); }
.set-danger-body { padding: 2px 0 10px; }
.set-danger-body .set-hint { padding-left: 12px; }
.set-danger-form { display: flex; gap: 8px; padding: 0 12px; }
.set-danger-btn {
  flex-shrink: 0; height: 32px; padding: 0 14px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600;
  color: #fff; background: #c0392b; border: 0; cursor: pointer;
}
.set-danger-btn:disabled { opacity: 0.4; cursor: default; }
#portal-account .portal-private { margin: 14px 4px 0; font-size: 11px; }

/* People shelf rows */
.set-person-av { width: 32px; height: 32px; font-size: 13px; flex-shrink: 0; }
.set-person-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-row-2 { min-height: 56px; }
.set-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.set-sub { font-size: 12px; line-height: 1.35; color: var(--muted); }
.set-hint-flat { padding: 0 4px; }

/* Signed-in-with badges: each provider's official mark */
.set-provs { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
.set-prov { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; }
.set-prov-google { background: #fff; border: 1px solid #dadce0; }
.set-prov-google .google-logo { width: 16px; height: 16px; }
.set-prov-line { background: #06C755; }
.set-prov-email { background: var(--w07); border: 1px solid var(--border); color: var(--text); }
.set-prov-email svg { width: 16px; height: 16px; }
.set-group-solo { margin-top: 18px; }

/* Last-30-days bars take the day's verdict colour (same as today's gauge) */
.dash-bar.is-auspicious { fill: var(--gold); }
.dash-bar.is-balanced { fill: #22c55e; }
.dash-bar.is-challenging { fill: #ef4444; }
body.light-mode .dash-bar.is-balanced { fill: #15803d; }
body.light-mode .dash-bar.is-challenging { fill: #c0262d; }

/* Reading history: each day tinted by its result (the stored strip keeps the gold it was
   captured with, so the tint is laid over it), and reactions in fixed colours:
   Accurate gold, Not accurate red, Unsure grey. */
.portal-row-wrap.is-balanced .portal-row .cs-bg { background: linear-gradient(120deg, rgba(34,197,94,0.28), rgba(20,60,40,0.55) 55%, rgba(15,15,28,0.9)) !important; }
.portal-row-wrap.is-challenging .portal-row .cs-bg { background: linear-gradient(120deg, rgba(239,68,68,0.3), rgba(70,20,24,0.55) 55%, rgba(15,15,28,0.9)) !important; }
.portal-row-wrap.is-auspicious .portal-row .cs-bg { background: linear-gradient(120deg, rgba(240,192,64,0.32), rgba(80,64,20,0.55) 55%, rgba(15,15,28,0.9)) !important; }
.portal-row-wrap.is-balanced .portal-row .cs-score { color: #4ade80 !important; }
.portal-row-wrap.is-challenging .portal-row .cs-score { color: #f87171 !important; }

.portal-reaction-tag.is-off { background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.55); color: #f87171; }
.portal-reaction-tag.is-unsure { background: var(--w07); border-color: var(--w2); color: var(--muted); }
#portal .portal-reaction-btn.is-on[data-reaction="off"] { background: rgba(239,68,68,0.14); border-color: rgba(239,68,68,0.55); color: #f87171; }
#portal .portal-reaction-btn.is-on[data-reaction="unsure"] { background: var(--w12); border-color: var(--w2); color: var(--text); }

.portal-note-edit {
  display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 3px 8px;
  border-radius: 100px; font: inherit; font-size: 12px; color: var(--muted);
  background: none; border: 1px solid var(--border); cursor: pointer;
}
.portal-note-edit:active { background: var(--w07); }
.portal-note-line { align-items: center; }

/* Day chips take the day's result colour (no gold ring). Noted days get a small dot. */
#portal .portal-day.is-read { box-shadow: none; }
#portal .portal-day.is-read.is-auspicious { background: rgba(240,192,64,0.2); border-color: rgba(240,192,64,0.45); color: var(--gold); }
#portal .portal-day.is-read.is-balanced { background: rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.45); color: #4ade80; }
#portal .portal-day.is-read.is-challenging { background: rgba(239,68,68,0.18); border-color: rgba(239,68,68,0.45); color: #f87171; }
#portal .portal-day.is-noted { box-shadow: none; position: relative; }
#portal .portal-day.is-noted::after { content: ''; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* My Wobazi reading history: each day in its result colour */
.dash-recent { border-left: 0; }
.dash-recent.is-auspicious .dash-recent-verdict { color: var(--gold); }
.dash-recent.is-balanced .dash-recent-verdict { color: #4ade80; }
.dash-recent.is-challenging .dash-recent-verdict { color: #f87171; }
.dash-recent.is-balanced .dash-recent-score { background: rgba(34,197,94,0.16); color: #4ade80; }
.dash-recent.is-challenging .dash-recent-score { background: rgba(239,68,68,0.16); color: #f87171; }

/* Reading history: accuracy meter */
.acc-card { margin: 16px 0 6px; padding: 16px; border-radius: 16px; background: var(--w05); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.acc-top { display: flex; align-items: center; gap: 14px; }
.acc-num { flex-shrink: 0; font-size: 44px; font-weight: 800; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; }
.acc-num small { font-size: 20px; font-weight: 700; margin-left: 1px; }
.acc-num.is-empty { color: var(--muted); }
.acc-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.acc-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.acc-bar { display: flex; gap: 2px; height: 10px; border-radius: 6px; overflow: hidden; background: var(--w08); }
.acc-bar span { height: 100%; }
.acc-bar .is-acc, .acc-legend .is-acc { background: var(--gold); }
.acc-bar .is-off, .acc-legend .is-off { background: #ef4444; }
.acc-bar .is-uns, .acc-legend .is-uns { background: #64748b; }
.acc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.acc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.acc-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.acc-cta { font-size: 13px; line-height: 1.45; color: var(--m85, var(--text)); padding-top: 8px; border-top: 1px solid var(--border); }
.acc-cta b { color: var(--text); }

/* The unrated day's button is the call to action */
.portal-note-edit.is-cta { color: #1a1405; background: var(--gold); border-color: var(--gold); font-weight: 700; }
.portal-note-edit.is-cta:active { filter: brightness(0.92); }
