/* dashboard.css · the /members dashboard (light theme).
   Design system mirrors theme-light.css:
     page bg #FFFFFF · headings #14233A · body #5C5346 · gold-on-white #9A6B12
     card #EAEEF4 · border rgba(20,35,58,0.10) · primary CTA navy fill / #FFC854 text
   Grid: 12 columns, max 1180px. Panels are skeletons in static HTML and fill
   independently; tier visibility is driven by body classes
   (tier-free | tier-member, has-books | no-books) so the three dashboard
   states fall out of CSS, not per-panel JS. */

body.theme-light.dash { background: #fff; color: #1F2733; }

.dash main { max-width: 1180px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }

/* --- state panes --- */
.dash .loading-pane, .dash .signin-pane {
  background: #EAEEF4; border: 1px solid rgba(20,35,58,0.10); border-radius: 14px;
  padding: 2.5rem 2rem; text-align: center; max-width: 28rem; margin: 4rem auto;
}
.dash .loading-pane h2, .dash .signin-pane h2 {
  font-family: var(--serif); font-size: 1.6rem; color: #14233A; font-weight: 500;
  letter-spacing: -0.012em; margin-bottom: 0.5rem;
}
.dash .loading-pane p, .dash .signin-pane p { color: #5C5346; font-size: 0.95rem; margin-bottom: 1.5rem; line-height: 1.6; }
.dash #clerk-signin { display: flex; justify-content: center; }
.dash .signin-pane .signup-note { font-size: 0.88rem; margin: 1.25rem 0 0; }
.dash .signin-pane .signup-note button {
  background: none; border: 0; padding: 0; color: #9A6B12; font: inherit;
  font-weight: 600; text-decoration: underline; cursor: pointer;
}

/* --- grid --- */
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.25rem; }
.dash-grid > * { grid-column: span 12; }

/* Members lead with what the membership includes; reading stats move below.
   Free tier keeps natural DOM order (no order rules). */
body.tier-member .dash-grid > * { order: 4; }
body.tier-member #panel-start-here { order: 0; }
body.tier-member #panel-library { order: 1; }
body.tier-member .premium-card { order: 2; }
body.tier-member #panel-office-hours { order: 3; }
body.tier-member #panel-membership,
body.tier-member #panel-offers,
body.tier-member #panel-newsletter { order: 4; }
body.tier-member #profile-strip { order: 5; }
/* Members already own the guides; the site nav's buy CTA is noise here. */
body.tier-member .nav-cta-buy { display: none; }

#panel-start-here .start-here-actions { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; margin: 0.3rem 0 1rem; }
#panel-start-here .start-here-dismiss { margin-bottom: 0; }
#panel-start-here .start-here-dismiss a { color: #8B8378; font-size: 0.82rem; font-weight: 500; }
#panel-start-here .start-here-dismiss a:hover { color: #5C5346; }
@media (min-width: 760px) {
  .col-4 { grid-column: span 6; }
  .col-6 { grid-column: span 6; }
  .col-8 { grid-column: span 12; }
}
@media (min-width: 1020px) {
  .col-4 { grid-column: span 4; }
  .col-6 { grid-column: span 6; }
  .col-8 { grid-column: span 8; }
  .col-12 { grid-column: span 12; }
}

/* --- header row --- */
.dash-head { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.75rem; }
.dash-head .eyebrow {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.22em; color: #9A6B12;
  text-transform: uppercase; font-weight: 600; margin-bottom: 0.45rem;
}
.dash-head h1 {
  font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.3rem); line-height: 1.12;
  letter-spacing: -0.018em; color: #14233A; font-weight: 500; margin-bottom: 0.4rem;
}
.dash-head .sub { color: #5C5346; font-size: 1rem; }
.dash-head .right { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.tier-badge {
  display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--mono);
  font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
  color: #14233A; background: #EAEEF4; border: 1px solid rgba(20,35,58,0.14);
  border-radius: 999px; padding: 0.45rem 0.95rem;
}
.tier-badge .dot { width: 0.45rem; height: 0.45rem; background: #9A6B12; border-radius: 50%; }
.dash-head .head-cta {
  display: inline-block; background: #14233A; color: #FFC854; border-radius: 10px;
  padding: 0.65rem 1.15rem; font-size: 0.9rem; font-weight: 600; text-decoration: none;
}
.dash-head .head-cta:hover { background: #1D3152; color: #FFC854; }

/* --- panels --- */
.panel {
  background: #EAEEF4; border: 1px solid rgba(20,35,58,0.10); border-radius: 14px;
  padding: 1.5rem 1.4rem; min-width: 0;
}
.panel .eyebrow {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.2em; color: #9A6B12;
  text-transform: uppercase; font-weight: 600; margin-bottom: 0.75rem;
}
.panel h2 { font-family: var(--serif); font-size: 1.18rem; line-height: 1.25; color: #14233A; font-weight: 500; margin-bottom: 0.55rem; letter-spacing: -0.01em; }
.panel p { color: #5C5346; font-size: 0.92rem; line-height: 1.55; margin-bottom: 0.85rem; }
.panel a { color: #9A6B12; text-decoration: none; }
.panel a:hover { color: #7A540D; }
.panel .action { font-weight: 600; font-size: 0.88rem; }
.panel .fallback p { margin-bottom: 0.4rem; }

/* skeleton shimmer */
.skel { border-radius: 8px; background: linear-gradient(90deg, #DFE5EF 25%, #E8ECF3 45%, #DFE5EF 65%); background-size: 200% 100%; animation: dash-shimmer 1.4s infinite linear; }
@keyframes dash-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-line { height: 0.9rem; margin-bottom: 0.6rem; }
.skel-big { height: 2.2rem; width: 5rem; margin-bottom: 0.5rem; }

/* --- stats row --- */
.stat-value { font-family: var(--serif); font-size: 2.1rem; line-height: 1.05; color: #14233A; font-weight: 500; margin-bottom: 0.3rem; }
.stat-label { font-size: 0.88rem; color: #5C5346; }
.stat-sub { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; color: #8A8273; margin-top: 0.45rem; }

/* --- heatmap --- */
.heatmap-scroll { overflow-x: auto; padding-bottom: 0.4rem; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px; width: max-content; padding: 3px; }
.heatmap .cell { width: 11px; height: 11px; border-radius: 2.5px; background: #DFE5EF; }
.heatmap .cell.l1 { background: #B9C6DA; }
.heatmap .cell.l2 { background: #7E94B5; }
.heatmap .cell.l3 { background: #3F5578; }
.heatmap .cell.l4 { background: #14233A; }
.heatmap .cell.today { outline: 2px solid #9A6B12; outline-offset: 1px; }
.heatmap-legend { display: flex; align-items: center; gap: 4px; margin-top: 0.7rem; font-size: 0.75rem; color: #8A8273; }
.heatmap-legend .cell { display: inline-block; }

/* --- topics --- */
.topics-chart-wrap { display: flex; align-items: center; gap: 1.1rem; }
.topics-chart-wrap canvas { max-width: 130px; max-height: 130px; flex: 0 0 auto; }
.topics-list { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.topics-list li { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.86rem; color: #5C5346; padding: 0.28rem 0; }
.topics-list .t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topics-list .t-share { font-family: var(--mono); font-size: 0.72rem; color: #8A8273; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.topic-chips span { background: #fff; border: 1px solid rgba(20,35,58,0.12); border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.78rem; color: #14233A; }

/* --- reading lists (continue / recommended) --- */
.read-list { list-style: none; margin: 0; padding: 0; }
.read-list li { padding: 0.7rem 0; border-top: 1px solid rgba(20,35,58,0.08); }
.read-list li:first-child { border-top: 0; padding-top: 0.2rem; }
.read-list a { display: block; color: #14233A; font-weight: 500; font-size: 0.95rem; line-height: 1.35; }
.read-list a:hover { color: #7A540D; }
.read-list .meta { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; color: #8A8273; margin-top: 0.25rem; }
.read-progress { height: 4px; border-radius: 999px; background: #fff; overflow: hidden; margin-top: 0.45rem; }
.read-progress i { display: block; height: 100%; background: #9A6B12; border-radius: 999px; }

/* --- library --- */
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.library-item { background: #fff; border: 1px solid rgba(20,35,58,0.10); border-radius: 10px; padding: 1rem 1.05rem; display: flex; flex-direction: column; gap: 0.5rem; }
.library-item .li-kind { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: #9A6B12; font-weight: 600; }
.library-item .li-title { font-family: var(--serif); font-size: 1rem; color: #14233A; line-height: 1.3; flex: 1; }
.library-item .li-action {
  align-self: flex-start; background: #14233A; color: #FFC854; border: 0; border-radius: 8px;
  padding: 0.5rem 0.9rem; font-size: 0.82rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.library-item .li-action:hover { background: #1D3152; color: #FFC854; }
.library-item .li-action.quiet { background: #EAEEF4; color: #14233A; }
.library-item .course-bar { height: 5px; background: #EAEEF4; border-radius: 999px; overflow: hidden; }
.library-item .course-bar i { display: block; height: 100%; background: #9A6B12; }
.library-item .li-meta { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; color: #8A8273; }

/* --- premium row --- */
.premium-card { position: relative; }
.premium-card .lock { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.16em; text-transform: uppercase; color: #8A8273; font-weight: 600; }
.premium-card ul { list-style: none; margin: 0 0 0.9rem; padding: 0; }
.premium-card li { font-size: 0.88rem; color: #5C5346; padding: 0.3rem 0; border-top: 1px solid rgba(20,35,58,0.08); line-height: 1.4; }
.premium-card li:first-child { border-top: 0; }
.premium-card li .lock-mark { color: #8A8273; margin-right: 0.35rem; }

/* --- office hours --- */
.office-hours-sub { color: #5C5346; font-size: 0.92rem; margin-bottom: 1rem; }
.oh-next { background: #fff; border: 1px solid rgba(20,35,58,0.10); border-radius: 10px; padding: 1.1rem 1.2rem; margin-bottom: 1.25rem; }
.oh-next .oh-when { font-family: var(--serif); font-size: 1.05rem; color: #14233A; font-weight: 500; margin-bottom: 0.5rem; }
.oh-next .oh-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; align-items: baseline; }
.oh-next .oh-links a { font-weight: 600; font-size: 0.88rem; }
.oh-recordings-title { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: #8A8273; font-weight: 600; margin-bottom: 0.5rem; }

/* --- offers / membership / newsletter --- */
.offer-cta {
  display: inline-block; background: #14233A; color: #FFC854; border-radius: 10px;
  padding: 0.6rem 1.05rem; font-size: 0.88rem; font-weight: 600; text-decoration: none; border: 0; cursor: pointer;
}
.offer-cta:hover { background: #1D3152; color: #FFC854; }
.price-line { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; color: #8A8273; margin-top: 0.55rem; }
.member-note { font-size: 0.85rem; color: #5C5346; }

/* --- tier/book visibility --- */
.member-only, .free-only, .books-only, .no-books-only { display: none; }
body.tier-member .member-only { display: block; }
body.tier-free .free-only { display: block; }
body.has-books .books-only { display: block; }
body.no-books .no-books-only { display: block; }
span.member-only, span.free-only { display: none; }
body.tier-member span.member-only { display: inline; }
body.tier-free span.free-only { display: inline; }

/* --- profile strip (onboarding phase) --- */
#profile-strip[hidden] { display: none; }

/* --- signout --- */
.signout-row { text-align: right; margin-top: 2.25rem; padding-top: 1.75rem; border-top: 1px solid rgba(20,35,58,0.10); }
.signout-row button {
  background: transparent; border: 1px solid rgba(20,35,58,0.18); color: #5C5346;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0.55rem 1.1rem; border-radius: 999px; cursor: pointer; font-weight: 600;
}
.signout-row button:hover { color: #14233A; border-color: #14233A; }

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .dash main { padding: 2rem 1.1rem 4rem; }
  .dash-head { flex-direction: column; align-items: flex-start; }
}
  .oh-pending { color: var(--muted, #5b6b7d); font-size: .9em; }
