/* ============================================================
   Scrollable Equity Research Report — page-specific styles
   (depends on wireframe.css primitives)
   ============================================================ */

html, body { height:auto; }
body { background:var(--bg); }

.layout { display:flex; align-items:flex-start; max-width:1320px; margin:0 auto; }

/* ---------- left TOC rail ---------- */
.rail {
  width:288px; flex:none; position:sticky; top:0; height:100vh;
  border-right:1px solid var(--line); background:var(--panel);
  display:flex; flex-direction:column; padding:18px 14px; gap:14px; overflow:auto;
}
.rail .brand { display:flex; align-items:center; gap:10px; }
.rail .brand .m { width:30px;height:30px;border-radius:7px;background:var(--accent);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:13px; }
.rail .co { font-weight:650; font-size:14px; line-height:1.2; }
.rail .co .s { font-family:var(--mono); font-size:10px; letter-spacing:.08em; color:var(--muted); font-weight:400; }

.ratingmini { display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--line); border:1px solid var(--line); border-radius:7px; overflow:hidden; }
.ratingmini > div { background:var(--panel); padding:8px 10px; }
.ratingmini .k { font-family:var(--mono); font-size:9.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.ratingmini .v { font-size:15px; font-weight:650; font-variant-numeric:tabular-nums; }

.toc-h { font-family:var(--mono); font-size:10px; letter-spacing:.12em; text-transform:uppercase; color:var(--faint);
  display:flex; justify-content:space-between; align-items:center; }
.toc { display:flex; flex-direction:column; gap:2px; flex:1; }

.toc-sec { border-radius:7px; }
.toc-row { display:flex; align-items:center; gap:8px; padding:5px 6px; border-radius:6px; cursor:pointer; }
.toc-row:hover { background:var(--panel-2); }
.toc-row.active { background:var(--accent-soft); }
.toc-row.active .nm { color:var(--accent-ink); font-weight:600; }

.toc-row .no { font-family:var(--mono); font-size:10px; color:var(--faint); width:15px; flex:none; }
.toc-row .nm { font-size:12.5px; color:var(--ink-2); flex:1; line-height:1.25; }
.toc-row.parent .nm { font-weight:560; color:var(--ink); }
.toc-row.off > .nm { color:var(--faint); text-decoration:line-through; }

.caret-btn { border:0; background:transparent; color:var(--faint); cursor:pointer; font-size:10px;
  width:16px; height:16px; display:flex; align-items:center; justify-content:center; padding:0;
  transition:transform .15s ease; flex:none; }
.caret-btn.closed { transform:rotate(-90deg); }

/* custom checkbox */
.cb { appearance:none; width:15px; height:15px; flex:none; border:1.5px solid var(--line);
  border-radius:4px; background:var(--panel); cursor:pointer; position:relative; margin:0; }
.cb:checked { background:var(--accent); border-color:var(--accent); }
.cb:checked::after { content:"✓"; color:#fff; font-size:10px; position:absolute; top:-2px; left:2px; }
.cb:indeterminate { background:var(--accent-soft); border-color:var(--accent); }
.cb:indeterminate::after { content:"–"; color:var(--accent-ink); font-size:12px; font-weight:700; position:absolute; top:-4px; left:3px; }
.cb.sm { width:13px; height:13px; }
.cb.sm:checked::after { font-size:9px; top:-2px; left:1.5px; }

.toc-children { display:flex; flex-direction:column; gap:1px; margin:1px 0 4px 0; overflow:hidden; }
.toc-children.collapsed { display:none; }
.toc-row.child { padding-left:30px; }
.toc-row.child .nm { font-size:11.5px; color:var(--muted); }
.toc-row.child.active .nm { color:var(--accent-ink); }

.dl { display:flex; flex-direction:column; gap:7px; padding-top:8px; border-top:1px solid var(--line); }
.dl .count { font-family:var(--mono); font-size:10.5px; color:var(--muted); text-align:center; }

/* ---------- report column ---------- */
.doc { flex:1; min-width:0; padding:30px 40px 90px; }
.doc-head { display:flex; align-items:flex-start; gap:16px; padding-bottom:18px; border-bottom:2px solid var(--ink); margin-bottom:6px; }
.doc-head .logo { width:48px;height:48px;border-radius:9px; flex:none; }
.doc-head h1 { font-size:27px; font-weight:680; letter-spacing:-0.015em; margin:0; }
.doc-head .meta { font-family:var(--mono); font-size:11px; color:var(--muted); margin-top:3px; }

.ratingband { display:flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; margin:18px 0; flex-wrap:wrap; }
.ratingband > div { padding:11px 16px; border-right:1px solid var(--line); }
.ratingband > div:last-child { border-right:0; }

.rsec { padding-top:28px; margin-top:14px; border-top:1px solid var(--line); scroll-margin-top:16px; }
.rsec:first-of-type { border-top:0; }
.sec-head { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.sec-head .sec-no { font-family:var(--mono); font-size:12px; font-weight:600; color:#fff; background:var(--ink);
  width:26px;height:26px;border-radius:6px; display:flex;align-items:center;justify-content:center; flex:none; }
.sec-head h2 { font-size:19px; font-weight:650; margin:0; letter-spacing:-0.01em; }
.sec-head .sec-tag { margin-left:auto; }

/* subsection */
.rsub { scroll-margin-top:16px; margin-top:16px; }
.rsub:first-of-type { margin-top:0; }
.sub-head { display:flex; align-items:center; gap:9px; margin-bottom:9px; }
.sub-head .h3 { font-size:13.5px; }
.sub-head .dot { width:7px;height:7px;border-radius:100px;background:var(--accent); flex:none; }

/* excluded states */
.rsec.excluded, .rsub.excluded { opacity:.4; }
.rsec.excluded .excl-ribbon, .rsub.excluded .excl-ribbon { display:inline-flex; }
.excl-ribbon { display:none; align-items:center; gap:6px; font-family:var(--mono); font-size:9.5px;
  letter-spacing:.05em; text-transform:uppercase; color:var(--neg); border:1px dashed color-mix(in oklch,var(--neg),white 50%);
  background:color-mix(in oklch,var(--neg),white 88%); padding:2px 7px; border-radius:100px; margin-left:8px; }

.grid { display:grid; gap:14px; }

/* ---------- self research widget ---------- */
.composer { border:1px dashed var(--accent-line); background:var(--accent-soft); border-radius:8px; padding:14px; }
.composer .crow { display:flex; gap:10px; align-items:center; margin-bottom:10px; flex-wrap:wrap; }
.composer textarea {
  width:100%; min-height:74px; resize:vertical; border:1px solid var(--line); border-radius:6px;
  padding:10px 12px; font-family:var(--sans); font-size:13px; color:var(--ink); background:var(--panel);
}
.composer textarea:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.composer input[type=date] { border:1px solid var(--line); border-radius:6px; padding:6px 9px; font-family:var(--mono);
  font-size:12px; color:var(--ink); background:var(--panel); }
.thumbs { display:flex; gap:8px; flex-wrap:wrap; margin:10px 0 0; }
.thumb { position:relative; width:64px; height:64px; border-radius:6px; border:1px solid var(--line); overflow:hidden; background:var(--panel-2); }
.thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.thumb .x { position:absolute; top:2px; right:2px; width:16px; height:16px; border-radius:100px; background:rgba(0,0,0,.6);
  color:#fff; font-size:11px; display:flex; align-items:center; justify-content:center; cursor:pointer; border:0; }
.attach-btn { display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.attach-btn input { display:none; }

.entries { display:flex; flex-direction:column; gap:0; margin-top:16px; }
.entry { display:flex; gap:14px; padding:14px 0; border-top:1px solid var(--line-2); }
.entry:first-child { border-top:0; }
.entry .when { flex:none; width:96px; }
.entry .when .d { font-family:var(--mono); font-size:12px; font-weight:600; color:var(--ink); }
.entry .when .r { font-family:var(--mono); font-size:10px; color:var(--faint); }
.entry .what { flex:1; min-width:0; }
.entry .what p { margin:0; font-size:13px; line-height:1.55; white-space:pre-wrap; }
.entry .imgs { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.entry .imgs img { height:120px; max-width:200px; object-fit:cover; border-radius:6px; border:1px solid var(--line); }
.entry .del { border:0; background:transparent; color:var(--faint); cursor:pointer; font-size:12px; align-self:flex-start; }
.entry .del:hover { color:var(--neg); }
.empty-note { font-size:12.5px; color:var(--muted); padding:14px; border:1px dashed var(--line); border-radius:8px; text-align:center; }

.printbar { display:none; }

/* ---------- print ---------- */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  html, body { background:#fff; }
  .rail { display:none !important; }
  .layout { display:block; max-width:none; }
  .doc { padding:0; }
  .rsec { break-before: page; opacity:1 !important; border-top:0; padding-top:0; }
  .rsec.first-print { break-before: avoid; }
  .rsec.excluded, .rsub.excluded { display:none !important; }
  .rsub { opacity:1 !important; }
  .panel, .chart, .wf-table, .entry { break-inside: avoid; }
  .doc-head { break-after: avoid; }
  .composer { display:none !important; }       /* hide input UI in the PDF */
  .excl-ribbon { display:none !important; }
}
