/* ============ Patient Funnel All-in-One Class — Premium Dark & Gold ============ */
:root {
  --bg: #0d0e12;
  --bg-soft: #14161c;
  --bg-card: #191c24;
  --bg-card-hover: #1f232d;
  --border: #262a35;
  --border-soft: #1e222c;
  --gold: #d4af6a;
  --gold-bright: #e8c986;
  --gold-dim: rgba(212, 175, 106, 0.14);
  --text: #e8e6e1;
  --text-soft: #b3b0a8;
  --text-dim: #7c7a74;
  --green: #6fcf97;
  --red: #eb7a7a;
  --blue: #7aa8eb;
  --sidebar-w: 300px;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--gold-dim); color: var(--gold-bright); }

/* ---------- Layout ---------- */
#app-layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
#sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: var(--bg-soft);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.28s ease;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 22px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.brand-mark {
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #d4af6a, #a8843e);
  color: #14161c; font-weight: 800; font-size: 16px;
  border-radius: 12px; letter-spacing: 0.5px;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 15px; font-weight: 700; color: var(--gold-bright); letter-spacing: 0.3px; }
.brand-sub { font-size: 12.5px; color: var(--text-dim); }

.sidebar-progress { padding: 18px 22px 6px; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-dim); margin-bottom: 8px;
  font-weight: 600; letter-spacing: 0.3px;
}
.progress-label #progress-percent { color: var(--gold); }
.progress-track {
  height: 6px; background: var(--border-soft); border-radius: 99px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #a8843e, #e8c986);
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

#chapter-nav {
  flex: 1; overflow-y: auto; padding: 14px 12px 20px;
}
#chapter-nav::-webkit-scrollbar { width: 4px; }
#chapter-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.nav-week-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--text-dim); text-transform: uppercase;
  padding: 10px 12px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  padding: 11px 12px; margin-bottom: 3px;
  background: none; border: none; cursor: pointer;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 14px; font-weight: 500;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}
.nav-item:hover { background: var(--bg-card); color: var(--text); }
.nav-item.active {
  background: var(--gold-dim); color: var(--gold-bright); font-weight: 700;
}
.nav-num {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 12px; font-weight: 700; color: var(--text-dim);
  transition: all 0.15s;
}
.nav-item.active .nav-num { border-color: var(--gold); color: var(--gold); }
.nav-item.done .nav-num {
  background: var(--gold); border-color: var(--gold); color: #14161c;
}
.nav-title { flex: 1; }

.sidebar-footer {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border-soft);
}
#reset-progress {
  background: none; border: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px; font-family: inherit;
  padding: 7px 12px; border-radius: 8px; cursor: pointer;
  transition: all 0.15s;
}
#reset-progress:hover { color: var(--red); border-color: var(--red); }
.sidebar-copy { font-size: 11px; color: var(--text-dim); margin-top: 12px; opacity: 0.7; }

#sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 40;
}

/* ---------- Mobile topbar ---------- */
#mobile-topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; height: 56px;
  background: rgba(13,14,18,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  z-index: 60;
  align-items: center; gap: 14px; padding: 0 16px;
}
#menu-toggle {
  background: none; border: none; color: var(--gold); font-size: 20px; cursor: pointer;
}
.topbar-title { font-weight: 700; font-size: 15px; color: var(--gold-bright); flex: 1; }
.topbar-progress { font-size: 13px; color: var(--text-dim); font-weight: 600; }

/* ---------- Main content ---------- */
#main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 56px 60px 80px;
  max-width: calc(var(--sidebar-w) + 980px);
}

#chapter-content { animation: fadeUp 0.4s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Typography in content ---------- */
.chapter-kicker {
  font-size: 13px; font-weight: 700; letter-spacing: 2.5px;
  color: var(--gold); text-transform: uppercase; margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.chapter-kicker::after { content: ''; flex: 0 0 44px; height: 1px; background: var(--gold); opacity: 0.5; }

.chapter-title {
  font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.25;
  letter-spacing: -0.5px; margin-bottom: 12px;
}
.chapter-intro { font-size: 17px; color: var(--text-soft); margin-bottom: 40px; max-width: 680px; }

.content-section { margin-bottom: 52px; }

h2.sec-title {
  font-size: 24px; font-weight: 800; margin-bottom: 20px; letter-spacing: -0.3px;
  padding-top: 8px;
  display: flex; align-items: baseline; gap: 12px;
}
h2.sec-title .sec-num {
  color: var(--gold); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
}
h3.sub-title {
  font-size: 18.5px; font-weight: 700; margin: 30px 0 14px; color: var(--gold-bright);
}
h4.minor-title { font-size: 16px; font-weight: 700; margin: 22px 0 10px; }

p.body-text { font-size: 15.5px; color: var(--text-soft); margin-bottom: 14px; max-width: 720px; }
p.body-text strong, li strong { color: var(--text); font-weight: 700; }
p.body-text em { color: var(--gold-bright); font-style: normal; }

ul.body-list, ol.body-list { margin: 0 0 16px 4px; padding-left: 20px; max-width: 720px; }
ul.body-list li, ol.body-list li { font-size: 15.5px; color: var(--text-soft); margin-bottom: 8px; }
ul.body-list li::marker { color: var(--gold); }
ol.body-list li::marker { color: var(--gold); font-weight: 700; }

a.ext-link { color: var(--blue); text-decoration: none; border-bottom: 1px dashed rgba(122,168,235,0.4); }
a.ext-link:hover { border-bottom-style: solid; }

/* ---------- Quote wall ---------- */
.quote-wall {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px; margin: 26px 0 34px;
}
.quote-card {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 22px 24px;
  position: relative;
}
.quote-card::before {
  content: '\201C'; position: absolute; top: 8px; left: 16px;
  font-size: 44px; color: var(--gold); opacity: 0.35; font-family: Georgia, serif;
}
.quote-text { font-size: 15.5px; font-weight: 600; line-height: 1.6; padding-left: 12px; margin-bottom: 10px; }
.quote-author { font-size: 13px; color: var(--gold); font-weight: 600; padding-left: 12px; }

/* ---------- Callout ---------- */
.callout {
  display: flex; gap: 14px;
  background: var(--gold-dim);
  border: 1px solid rgba(212,175,106,0.3);
  border-radius: var(--radius);
  padding: 20px 22px; margin: 24px 0;
  max-width: 760px;
}
.callout-icon { color: var(--gold); font-size: 18px; padding-top: 2px; }
.callout-body { font-size: 15.5px; font-weight: 600; color: var(--gold-bright); line-height: 1.65; }
.callout-body .co-sub { display: block; font-weight: 400; color: var(--text-soft); margin-top: 6px; font-size: 14.5px; }

.callout.warn { background: rgba(235,122,122,0.08); border-color: rgba(235,122,122,0.3); }
.callout.warn .callout-icon { color: var(--red); }
.callout.warn .callout-body { color: #f0b0b0; }

.callout.info { background: rgba(122,168,235,0.08); border-color: rgba(122,168,235,0.3); }
.callout.info .callout-icon { color: var(--blue); }
.callout.info .callout-body { color: #b6cdf2; }

/* ---------- Cards / KPI grid ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 20px 0 8px; }
.info-card {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 22px;
  transition: border-color 0.2s, transform 0.2s;
}
.info-card:hover { border-color: rgba(212,175,106,0.4); transform: translateY(-2px); }
.info-card .card-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.info-card .card-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-dim); color: var(--gold); border-radius: 10px; font-size: 15px;
}
.info-card .card-title { font-size: 16px; font-weight: 700; }
.info-card .card-badge {
  margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 9px; border-radius: 99px;
  background: var(--gold-dim); color: var(--gold);
}
.info-card ul { padding-left: 18px; }
.info-card li { font-size: 14px; color: var(--text-soft); margin-bottom: 6px; }
.info-card li::marker { color: var(--gold); }
.info-card .card-note {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
  font-size: 13.5px; color: var(--gold-bright); font-weight: 600;
}

/* indicator category headers */
.indicator-def {
  background: var(--bg-card); border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px; margin: 16px 0 20px;
  max-width: 760px;
}
.indicator-def p { font-size: 14.5px; color: var(--text-soft); margin-bottom: 4px; }
.indicator-def p b { color: var(--text); }

/* ---------- Flow diagram (chain) ---------- */
.flow-chain {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 18px 0; max-width: 780px;
}
.flow-step {
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--text-soft);
}
.flow-step.hl { border-color: var(--gold); color: var(--gold-bright); background: var(--gold-dim); }
.flow-step.bad { border-color: rgba(235,122,122,0.5); color: #f0b0b0; background: rgba(235,122,122,0.07); }
.flow-step.good { border-color: rgba(111,207,151,0.5); color: #a7e3c2; background: rgba(111,207,151,0.07); }
.flow-arrow { color: var(--gold); font-size: 13px; opacity: 0.8; }

.flow-vert { display: flex; flex-direction: column; gap: 6px; margin: 18px 0; max-width: 640px; }
.flow-vert .flow-step { width: 100%; }
.flow-vert .flow-arrow { text-align: center; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 20px 0; border-radius: var(--radius); border: 1px solid var(--border-soft); }
table.data-table { width: 100%; border-collapse: collapse; background: var(--bg-card); min-width: 560px; }
table.data-table th {
  background: #1e2129; color: var(--gold); font-size: 13px; font-weight: 700;
  padding: 13px 16px; text-align: left; letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}
table.data-table td {
  padding: 12px 16px; font-size: 14px; color: var(--text-soft);
  border-bottom: 1px solid var(--border-soft);
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table td.hl { color: var(--gold-bright); font-weight: 700; }
table.data-table tr.row-hl td { background: var(--gold-dim); color: var(--gold-bright); font-weight: 600; }

/* ---------- Compare (A vs B) ---------- */
.vs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; max-width: 820px; }
.vs-card { border-radius: var(--radius); padding: 22px; border: 1px solid; }
.vs-card.bad { background: rgba(235,122,122,0.06); border-color: rgba(235,122,122,0.28); }
.vs-card.good { background: rgba(111,207,151,0.06); border-color: rgba(111,207,151,0.28); }
.vs-card .vs-label {
  font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px;
}
.vs-card.bad .vs-label { color: var(--red); }
.vs-card.good .vs-label { color: var(--green); }
.vs-card .vs-title { font-size: 16.5px; font-weight: 700; margin-bottom: 12px; }
.vs-card ul { padding-left: 18px; }
.vs-card li { font-size: 14px; color: var(--text-soft); margin-bottom: 7px; }
.vs-card.bad li::marker { color: var(--red); }
.vs-card.good li::marker { color: var(--green); }
.vs-card .vs-formula {
  font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 12px;
  background: rgba(0,0,0,0.25); color: var(--text);
  line-height: 1.6;
}

/* ---------- Good/Bad example pairs ---------- */
.ex-pair { margin: 14px 0; max-width: 760px; }
.ex-item {
  display: flex; gap: 12px; padding: 14px 18px; border-radius: 12px; margin-bottom: 8px;
  font-size: 14.5px; line-height: 1.65;
}
.ex-item.bad { background: rgba(235,122,122,0.07); border: 1px solid rgba(235,122,122,0.22); color: var(--text-soft); }
.ex-item.good { background: rgba(111,207,151,0.07); border: 1px solid rgba(111,207,151,0.22); color: var(--text-soft); }
.ex-item .ex-mark { font-size: 15px; padding-top: 2px; flex-shrink: 0; }
.ex-item.bad .ex-mark { color: var(--red); }
.ex-item.good .ex-mark { color: var(--green); }
.ex-item b { color: var(--text); }

/* ---------- Mission examples of hospitals ---------- */
.hospital-card {
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 14px; max-width: 780px;
}
.hospital-card .h-name { font-size: 16.5px; font-weight: 800; color: var(--gold-bright); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.hospital-card .h-row { display: flex; gap: 12px; margin-bottom: 8px; font-size: 14.5px; }
.hospital-card .h-key {
  flex-shrink: 0; width: 68px; font-weight: 700; color: var(--gold); font-size: 13px; padding-top: 2px;
}
.hospital-card .h-val { color: var(--text-soft); }
.hospital-card a { font-size: 12.5px; }

/* ---------- Accordion ---------- */
.accordion { border: 1px solid var(--border-soft); border-radius: var(--radius); margin: 16px 0; max-width: 780px; overflow: hidden; }
.accordion-head {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: none; cursor: pointer;
  padding: 16px 20px; font-family: inherit; text-align: left;
  font-size: 15px; font-weight: 700; color: var(--text);
  transition: background 0.15s;
}
.accordion-head:hover { background: var(--bg-card-hover); }
.accordion-head i.chev { margin-left: auto; color: var(--gold); transition: transform 0.25s; font-size: 13px; }
.accordion.open .accordion-head i.chev { transform: rotate(180deg); }
.accordion-head i.lead { color: var(--gold); }
.accordion-body { display: none; padding: 6px 22px 20px; background: var(--bg-card); }
.accordion.open .accordion-body { display: block; }

/* ---------- Answers wall (기존 기수 답변) ---------- */
.answer-wall { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; max-width: 760px; }
.answer-chip {
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: 10px; padding: 12px 16px;
  font-size: 13.5px; color: var(--text-dim); font-style: italic;
}

/* ---------- Homework / checklist ---------- */
.hw-list { margin: 22px 0; max-width: 780px; }
.hw-item {
  display: flex; gap: 15px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 10px;
  cursor: pointer; transition: border-color 0.2s;
}
.hw-item:hover { border-color: rgba(212,175,106,0.4); }
.hw-item.checked { border-color: rgba(111,207,151,0.4); background: rgba(111,207,151,0.04); }
.hw-check {
  width: 24px; height: 24px; flex-shrink: 0; margin-top: 2px;
  border: 2px solid var(--border); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: transparent; font-size: 12px; transition: all 0.2s;
}
.hw-item.checked .hw-check { background: var(--green); border-color: var(--green); color: #0d0e12; }
.hw-body { flex: 1; }
.hw-title { font-size: 15.5px; font-weight: 700; margin-bottom: 4px; }
.hw-item.checked .hw-title { color: var(--green); }
.hw-desc { font-size: 13.5px; color: var(--text-dim); }
.hw-desc a { color: var(--blue); text-decoration: none; }
.hw-desc a:hover { text-decoration: underline; }

/* ---------- Resource links ---------- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 18px 0; max-width: 800px; }
.res-link {
  display: flex; align-items: center; gap: 13px;
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 15px 17px;
  text-decoration: none; transition: all 0.2s;
}
.res-link:hover { border-color: var(--gold); transform: translateY(-2px); }
.res-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-dim); color: var(--gold); border-radius: 10px; font-size: 15px;
}
.res-name { font-size: 14px; font-weight: 700; color: var(--text); }
.res-desc { font-size: 12px; color: var(--text-dim); }

/* ---------- Big statement ---------- */
.big-statement {
  font-size: clamp(18px, 2.4vw, 23px); font-weight: 800; line-height: 1.55;
  padding: 28px 0; margin: 20px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  max-width: 760px; letter-spacing: -0.3px;
}
.big-statement .gold { color: var(--gold-bright); }

/* ---------- Math visual ---------- */
.math-visual {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: stretch; margin: 22px 0; max-width: 760px;
}
.math-box {
  flex: 1; min-width: 240px;
  background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 22px; text-align: center;
}
.math-box .m-label { font-size: 12.5px; font-weight: 700; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 12px; }
.math-box .m-expr { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.math-box .m-note { font-size: 13px; color: var(--text-dim); margin-top: 10px; }
.math-box.hard .m-expr { color: var(--red); }
.math-box.easy .m-expr { color: var(--green); white-space: pre-line; line-height: 1.5; }

/* ---------- Chapter completion ---------- */
.chapter-complete {
  margin-top: 56px; padding: 26px;
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.complete-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #d4af6a, #b8934a);
  color: #14161c; font-weight: 800; font-size: 15px; font-family: inherit;
  border: none; padding: 13px 26px; border-radius: 12px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.complete-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212,175,106,0.25); }
.complete-btn.done { background: var(--bg-soft); color: var(--green); border: 1.5px solid var(--green); }
.complete-msg { font-size: 14px; color: var(--text-dim); }

/* ---------- Pager ---------- */
#chapter-pager {
  display: flex; justify-content: space-between; gap: 14px; margin-top: 28px;
}
.pager-btn {
  flex: 1; max-width: 340px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-card); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 16px 20px;
  cursor: pointer; font-family: inherit; text-align: left;
  transition: border-color 0.2s;
}
.pager-btn:hover { border-color: var(--gold); }
.pager-btn.next { text-align: right; margin-left: auto; }
.pager-dir { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.pager-title { font-size: 14.5px; font-weight: 700; color: var(--gold-bright); }
.pager-btn:disabled { opacity: 0; pointer-events: none; }

/* ---------- Hero (intro chapter) ---------- */
.hero-banner {
  background:
    radial-gradient(ellipse at 80% -20%, rgba(212,175,106,0.16), transparent 55%),
    radial-gradient(ellipse at 10% 110%, rgba(212,175,106,0.08), transparent 50%),
    var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 46px 44px; margin-bottom: 40px;
}
.hero-week {
  display: inline-block; font-size: 12.5px; font-weight: 800; letter-spacing: 2px;
  color: var(--gold); border: 1px solid rgba(212,175,106,0.45);
  padding: 6px 14px; border-radius: 99px; margin-bottom: 20px;
}
.hero-title { font-size: clamp(30px, 4.6vw, 46px); font-weight: 900; line-height: 1.22; letter-spacing: -1px; margin-bottom: 14px; }
.hero-sub { font-size: 16.5px; color: var(--text-soft); max-width: 620px; }

/* ---------- Video embed ---------- */
.video-embed {
  margin: 22px 0; max-width: 760px;
}
.video-frame {
  position: relative; width: 100%; padding-top: 56.25%;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #000;
}
.video-frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.video-caption {
  font-size: 13px; color: var(--text-dim); margin-top: 10px;
  display: flex; align-items: center; gap: 8px;
}
.video-caption i { color: var(--red); }

/* ---------- Image figure ---------- */
.content-figure {
  margin: 22px 0; max-width: 760px;
}
.content-figure img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  display: block;
}
.content-figure figcaption {
  font-size: 13px; color: var(--text-dim); margin-top: 10px; text-align: center;
}
.figure-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin: 22px 0; max-width: 800px;
}
.figure-grid .content-figure { margin: 0; }
.card-figure { margin: 12px 0 4px; }
.card-figure img {
  width: 100%; border-radius: 10px;
  border: 1px solid var(--border-soft); display: block;
  background: #fff;
}
.card-figure figcaption { font-size: 12px; color: var(--text-dim); margin-top: 8px; text-align: center; }
.card-figure-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 4px; }
.card-figure-row .card-figure { margin: 0; }
.content-figure img.on-light { background: #fff; }

/* ---------- Lightbox ---------- */
img.zoomable { cursor: zoom-in; transition: opacity 0.15s, transform 0.2s; }
img.zoomable:hover { opacity: 0.92; transform: scale(1.01); }
#lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(8, 9, 12, 0.92);
  backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 40px 20px;
  opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0.22s;
  cursor: zoom-out;
}
#lightbox.open { opacity: 1; visibility: visible; }
#lightbox-img {
  max-width: 94vw; max-height: 84vh;
  border-radius: 10px; border: 1px solid rgba(212,175,106,0.35);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  background: #fff;
  transform: scale(0.96); transition: transform 0.22s ease;
}
#lightbox.open #lightbox-img { transform: scale(1); }
#lightbox-caption {
  font-size: 14px; color: var(--text-soft); text-align: center; max-width: 720px;
  line-height: 1.6;
}
#lightbox-close {
  position: absolute; top: 18px; right: 22px;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.07); color: #fff;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
#lightbox-close:hover { background: rgba(212,175,106,0.25); border-color: var(--gold); }
body.lightbox-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  #sidebar { transform: translateX(-100%); }
  body.sidebar-open #sidebar { transform: translateX(0); box-shadow: 20px 0 60px rgba(0,0,0,0.5); }
  body.sidebar-open #sidebar-backdrop { display: block; }
  #mobile-topbar { display: flex; }
  #main-content { margin-left: 0; padding: 86px 22px 60px; }
  .vs-grid { grid-template-columns: 1fr; }
  .hero-banner { padding: 32px 26px; }
}

/* ---------- Login page ---------- */
.login-page { background: radial-gradient(ellipse at 50% -20%, rgba(212,175,106,0.08), transparent 60%), var(--bg); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 420px; text-align: center;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 18px; padding: 44px 36px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
}
.brand-mark.lg { width: 64px; height: 64px; font-size: 26px; border-radius: 16px; margin: 0 auto 18px; }
.login-title { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.login-sub { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin-bottom: 26px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card input {
  background: var(--bg); border: 1px solid var(--border-soft); border-radius: 10px;
  color: var(--text); padding: 14px 16px; font-size: 15px; font-family: inherit;
  text-align: center; letter-spacing: 1px;
}
.login-card input:focus { outline: none; border-color: var(--gold); }
.login-card button {
  background: linear-gradient(135deg, #d4af6a, #b8934e); color: #14161c;
  border: none; border-radius: 10px; padding: 14px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: opacity 0.15s;
}
.login-card button:hover { opacity: 0.92; }
.login-card button:disabled { opacity: 0.5; cursor: wait; }
.login-error { color: #f87171; font-size: 13px; margin-top: 14px; min-height: 18px; }
.login-foot { font-size: 12px; color: var(--text-dim); margin-top: 26px; line-height: 1.8; }
.login-foot span { opacity: 0.7; }

/* ---------- Week selector ---------- */
.week-select-wrap { padding: 0 20px 6px; }
.week-label { display: block; font-size: 11px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.week-label i { color: var(--gold); margin-right: 4px; }
#week-select {
  width: 100%; background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: 8px; color: var(--text); padding: 9px 12px; font-size: 13px;
  font-family: inherit; cursor: pointer;
}
#week-select:focus { outline: none; border-color: var(--gold); }

/* ---------- Loading ---------- */
.loading-state {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 40vh; color: var(--text-dim); font-size: 15px;
}
.loading-state i { color: var(--gold); }

/* ---------- Logout btn ---------- */
#logout-btn {
  width: 100%; background: transparent; border: 1px solid var(--border-soft);
  color: var(--text-dim); border-radius: 8px; padding: 8px; font-size: 12px;
  cursor: pointer; font-family: inherit; margin-top: 8px; transition: all 0.15s;
}
#logout-btn:hover { color: #f87171; border-color: rgba(248,113,113,0.4); }

/* ---------- Notion-converted extras ---------- */
.content-divider { border: none; border-top: 1px solid var(--border-soft); margin: 28px 0; }
.li-sub { margin-top: 6px; margin-left: 4px; font-size: 13px; color: var(--text-dim); }
.li-sub ul, .li-sub ol { padding-left: 16px; }
.code-block {
  background: var(--bg); border: 1px solid var(--border-soft); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; margin: 16px 0;
}
.code-block code { font-size: 13px; color: var(--text-soft); }
.table-wrap { overflow-x: auto; margin: 18px 0; }
mark { background: rgba(212,175,106,0.25); color: var(--text); border-radius: 3px; padding: 0 3px; }
