/* Equity Insights Elite: members area. Matches the landing page (Poppins, navy + blue, green accent). */
:root {
  --navy: #0f2557;
  --navy-2: #1a3a8f;
  --blue: #1d4ed8;
  --blue-hover: #1e40af;
  --blue-soft: #eff4ff;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --amber: #b45309;
  --amber-soft: #fff7e6;
  --red: #b42318;
  --red-soft: #fef3f2;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 4px 12px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 32px rgba(15, 37, 87, 0.14);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; padding-top: 32px; padding-bottom: 64px; }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--blue-hover); }
h1, h2, h3 { color: var(--text); letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; line-height: 1.25; margin: 0 0 8px; font-weight: 700; }
h2 { font-size: 1.15rem; line-height: 1.35; margin: 32px 0 12px; font-weight: 600; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 760px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.container.wide { max-width: 1120px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.inline { display: inline; }
.hide-sm { }
@media (max-width: 560px) { .hide-sm { display: none; } }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); box-shadow: 0 1px 0 var(--border), var(--shadow-sm); position: sticky; top: 0; z-index: 20; }
.header-inner { max-width: 1120px; margin: 0 auto; padding: 0 16px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; }
.brand img { height: 36px; width: auto; display: block; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav > a:not(.btn) { color: var(--text-2); text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.main-nav > a:not(.btn):hover { background: var(--bg); color: var(--text); }
.main-nav > a.active { color: var(--blue); background: var(--blue-soft); }

.account { position: relative; margin-left: 6px; }
.account summary { list-style: none; cursor: pointer; }
.account summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 600; font-size: 0.95rem; }
.account[open] .avatar { box-shadow: 0 0 0 3px var(--blue-soft); }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); min-width: 230px; padding: 6px; display: grid; }
.account-who { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: grid; word-break: break-all; }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--bg); color: var(--text); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #c7d2fe; font-size: 0.82rem; padding: 36px 0 28px; margin-top: auto; }
.site-footer a { color: #e0e7ff; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; }
.footer-mark { border-radius: 8px; display: block; margin-bottom: 10px; }
.footer-title { color: #fff; font-weight: 600; font-size: 1rem; margin: 0 0 4px; }
.footer-grid p { margin: 0 0 8px; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; align-content: start; word-break: break-word; }
.footer-legal { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 18px; color: #a5b4fc; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--blue); color: #fff; border: 1px solid var(--blue);
  border-radius: 10px; padding: 10px 18px; font: inherit; font-weight: 600; line-height: 1.3;
  cursor: pointer; text-decoration: none; transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.25);
}
.btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; border-radius: 8px; }
.btn-xs { padding: 4px 10px; font-size: 0.78rem; border-radius: 7px; font-weight: 500; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
.btn-danger { background: var(--surface); color: var(--red); border-color: #fecdca; box-shadow: none; }
.btn-danger:hover { background: var(--red-soft); color: var(--red); border-color: #fda29b; }
.btn-wa { background: #25d366; border-color: #25d366; color: #fff; box-shadow: none; }
.btn-wa:hover { background: #1ebe5a; border-color: #1ebe5a; }
.btn.is-busy { opacity: 0.7; cursor: progress; }
.btn-row { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

input, select, textarea {
  font: inherit; font-size: 0.95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px;
  width: 100%; max-width: 100%; transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: #9ca3af; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15); }
input[type='file'] { padding: 8px; background: var(--bg); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
label { display: block; font-weight: 500; font-size: 0.88rem; color: var(--text-2); }
label > input, label > select, label > textarea { margin-top: 6px; font-weight: 400; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
label.checkbox { display: flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; }
label.checkbox input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.stack { display: grid; gap: 16px; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.grid-form .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
@media (max-width: 640px) { .grid-form { grid-template-columns: 1fr; } }

/* ---------- Cards, notices, badges ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.card-title { font-size: 1rem; font-weight: 600; margin: 0 0 16px; }
.notice { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 20px; border: 1px solid; font-size: 0.92rem; }
.notice-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; color: #fff; margin-top: 1px; }
.notice-info { background: var(--blue-soft); border-color: #c7d7fe; color: #1e3a8a; }
.notice-info .notice-icon { background: var(--blue); }
.notice-error { background: var(--red-soft); border-color: #fecdca; color: #912018; }
.notice-error .notice-icon { background: var(--red); }
.notice-success { background: var(--green-soft); border-color: #abefc6; color: #05603a; }
.notice-success .notice-icon { background: var(--green); }
.notice a { color: inherit; font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-weight: 600; font-size: 0.72rem; letter-spacing: 0.01em; white-space: nowrap; line-height: 1.7; }
.badge-report { background: var(--blue-soft); color: var(--blue); }
.badge-concall { background: var(--amber-soft); color: var(--amber); }
.badge-infographic { background: #f4f3ff; color: #5925dc; }
.badge-update { background: #f2f4f7; color: #344054; }
.badge-free { background: var(--green-soft); color: var(--green); }
.badge-new { background: var(--navy); color: #fff; }
.badge-locked { background: #f2f4f7; color: var(--muted); }

.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-active { background: var(--green-soft); color: var(--green); }
.status-soon { background: var(--amber-soft); color: var(--amber); }
.status-expired { background: var(--red-soft); color: var(--red); }

.co-badge { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; }
.co-badge-lg { width: 56px; height: 56px; font-size: 1.05rem; border-radius: 14px; }
.tint-blue { background: #e0eaff; color: #1d4ed8; }
.tint-green { background: #dcfae6; color: #067647; }
.tint-amber { background: #fef0c7; color: #b54708; }
.tint-violet { background: #ebe9fe; color: #5925dc; }
.tint-teal { background: #ccfbef; color: #0e7090; }
.tint-rose { background: #ffe4e8; color: #c01048; }

/* ---------- Login ---------- */
.auth-wrap { min-height: calc(100vh - 64px - 260px); display: grid; place-items: center; padding: 16px 0; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 32px 28px; }
.auth-card .auth-mark { width: 48px; height: 48px; border-radius: 12px; display: block; margin-bottom: 18px; }
.auth-card h1 { font-size: 1.45rem; }
.auth-card .lead { color: var(--muted); margin: 0 0 22px; font-size: 0.93rem; }
.auth-foot { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--muted); }
.code-input { font-size: 1.6rem; letter-spacing: 0.5em; text-align: center; font-weight: 600; padding: 12px; font-variant-numeric: tabular-nums; }

/* ---------- Library ---------- */
.hero { background: linear-gradient(135deg, var(--navy-2) 0%, var(--navy) 100%); color: #fff; border-radius: 18px; padding: 28px 28px 24px; margin-bottom: 24px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%); }
.hero h1 { color: #fff; font-size: 1.6rem; margin-bottom: 4px; }
.hero p { margin: 0; color: #c7d2fe; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stat { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; padding: 8px 14px; min-width: 86px; }
.hero-stat strong { display: block; font-size: 1.25rem; line-height: 1.2; color: #fff; }
.hero-stat span { font-size: 0.75rem; color: #c7d2fe; }
.hero .status-pill { margin-top: 12px; background: rgba(255, 255, 255, 0.14); color: #fff; }
.hero .status-pill.status-active::before { background: #4ade80; }
.hero .status-pill.status-soon::before { background: #fbbf24; }

.toolbar { display: grid; gap: 14px; margin-bottom: 20px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 0.88rem; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .count { font-size: 0.75rem; opacity: 0.7; }
.filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; }
.search-input { padding-left: 38px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5.5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E") no-repeat 13px center; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr 1fr; } .filters .search-wrap { grid-column: 1 / -1; } .filters .btn { grid-column: 1 / -1; } }
.result-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; margin: 4px 0 12px; }

.post-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { height: 100%; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.post-card:hover { border-color: #c7d7fe; box-shadow: var(--shadow); transform: translateY(-2px); color: var(--text); }
.post-head { display: flex; gap: 12px; align-items: center; }
.post-co { min-width: 0; }
.post-co strong { display: block; font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-co span { font-size: 0.78rem; color: var(--muted); }
.post-card h2 { margin: 0; font-size: 1.02rem; line-height: 1.4; font-weight: 600; }
.post-summary { margin: 0; color: var(--muted); font-size: 0.88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-foot { margin-top: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); }
.post-foot .date { margin-left: auto; }
.post-card.locked { background: #fbfbfc; }
.post-card.locked h2, .post-card.locked .post-summary { color: var(--muted); }

.empty { text-align: center; padding: 48px 20px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 4px; }

/* ---------- Report page ---------- */
.crumbs { font-size: 0.85rem; margin-bottom: 16px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.report-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.report-head h1 { font-size: 1.65rem; margin: 6px 0 6px; }
.report-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.85rem; color: var(--muted); }
.report-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .report-layout { grid-template-columns: 1fr; } }
.report-main { display: grid; gap: 16px; min-width: 0; }
.lead { font-size: 1.02rem; color: var(--text-2); margin: 0; }
.prose { color: var(--text-2); }
.prose p { margin: 0 0 14px; }
.prose p:last-child { margin-bottom: 0; }
.doc-card { padding: 0; overflow: hidden; }
.doc-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.doc-name { flex: 1 1 0; display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 500; font-size: 0.9rem; }
@media (min-width: 761px) { .doc-bar { flex-wrap: nowrap; } .doc-bar .btn { flex: none; } }
.doc-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-icon { flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-size: 0.65rem; font-weight: 700; }
.pdf-frame { display: block; width: 100%; height: 82vh; min-height: 520px; border: 0; background: #525659; }
.doc-mobile { display: none; padding: 28px 18px; text-align: center; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 760px) { .pdf-frame { display: none; } .doc-mobile { display: block; } }
.infographic { display: block; width: 100%; height: auto; }
.side { display: grid; gap: 16px; position: sticky; top: 88px; }
@media (max-width: 900px) { .side { position: static; } }
.facts { margin: 0; display: grid; gap: 12px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.88rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; text-align: right; }
.related { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.related a { display: block; padding: 8px 10px; margin: 0 -10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 0.88rem; font-weight: 500; line-height: 1.4; }
.related a:hover { background: var(--bg); }
.related span { display: block; font-size: 0.76rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.note { font-size: 0.8rem; color: var(--muted); }

/* ---------- Admin ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--blue); border-bottom-color: var(--blue); }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 8px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat-label { color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.3; }
.stat.warn .stat-value { color: var(--amber); }
.stat.bad .stat-value { color: var(--red); }
.stat.good .stat-value { color: var(--green); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 32px 0 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: #fafbfc; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbff; }
td .name { font-weight: 500; color: var(--text); text-decoration: none; }
td .name:hover { color: var(--blue); }
td.actions { text-align: right; white-space: nowrap; }
.cell-sub { display: block; color: var(--muted); font-size: 0.8rem; }

/* On phones, tables become stacked cards. */
@media (max-width: 700px) {
  .table-wrap.stack-sm { background: none; border: 0; box-shadow: none; overflow: visible; }
  .stack-sm table, .stack-sm tbody, .stack-sm tr, .stack-sm td { display: block; width: 100%; }
  .stack-sm thead { display: none; }
  .stack-sm tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
  .stack-sm td { border: 0; padding: 4px 0; }
  .stack-sm td[data-label]::before { content: attr(data-label); display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
  .stack-sm td.actions { text-align: left; padding-top: 8px; white-space: normal; }
}

details.add-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 20px; }
details.add-panel > summary { cursor: pointer; padding: 16px 20px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 10px; }
details.add-panel > summary::-webkit-details-marker { display: none; }
details.add-panel > summary::before { content: '+'; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--blue-soft); color: var(--blue); font-weight: 700; }
details.add-panel[open] > summary::before { content: '–'; }
details.add-panel > .panel-body { padding: 0 20px 20px; }
.danger-zone { margin-top: 24px; padding: 16px 20px; border: 1px solid #fecdca; border-radius: var(--radius); background: var(--surface); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.danger-zone p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.search-row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search-row input { flex: 1 1 260px; width: auto; }

/* ---------- Mobile refinements ---------- */
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 700px) {
  .stack-sm tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
  .stack-sm td:first-child, .stack-sm td.actions { grid-column: 1 / -1; }
  .stack-sm td.actions:empty { display: none; }
}
@media (max-width: 560px) {
  main { padding-top: 20px; }
  h1 { font-size: 1.45rem; }
  .hero { padding: 22px 20px 20px; border-radius: 16px; }
  .hero h1 { font-size: 1.35rem; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .hero-stat { min-width: 0; padding: 8px 10px; }
  .hero-stat span { font-size: 0.7rem; }
  .card { padding: 18px; }
  .report-head h1 { font-size: 1.3rem; }
  .co-badge-lg { width: 46px; height: 46px; font-size: 0.9rem; }
  .main-nav > a:not(.btn) { padding: 8px 10px; }
  .brand img { height: 32px; }
}
.card.doc-card { padding: 0; }
@media (max-width: 760px) { .doc-bar .btn { display: none; } .doc-bar { border-bottom: 0; } }

/* ---------- Misc ---------- */
.chip-sep { flex: none; width: 1px; background: var(--border-strong); margin: 4px 2px; }
.hero-link { color: #fff; font-weight: 600; }
.hero-link:hover { color: #fff; }
a.hero-stat { text-decoration: none; transition: background 0.15s; }
a.hero-stat:hover { background: rgba(255, 255, 255, 0.18); }
.report-head-main { flex: 1; min-width: 0; }
.report-meta a { text-decoration: none; font-weight: 500; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.see-all { display: inline-block; margin-top: 10px; font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.report-head .report-dl { flex: none; margin-top: 4px; }
@media (max-width: 560px) { .report-head { flex-wrap: wrap; } .report-head .report-dl { width: 100%; } }

/* Company logos: every badge (logo or initials) is the same fixed tile so rows line up. */
.co-badge { width: 84px; height: 42px; border-radius: 10px; }
.co-badge-lg { width: 112px; height: 56px; border-radius: 13px; }
.co-logo { display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--border); padding: 6px 9px; overflow: hidden; }
.co-badge-lg.co-logo { padding: 8px 12px; }
.co-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.co-logo.on-dark { background: var(--navy); border-color: var(--navy); }
@media (max-width: 560px) { .co-badge-lg { width: 92px; height: 46px; } }

/* HTML reports */
.report-brief { padding: 14px 20px; margin-bottom: 16px; }
.report-brief .prose { display: flex; flex-wrap: wrap; gap: 6px 28px; font-size: 0.9rem; }
.report-brief .prose p { margin: 0; }
.html-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.html-report { overflow: hidden; }
.html-frame { display: block; width: 100%; height: 85vh; border: 0; background: transparent; transform-origin: 0 0; color-scheme: light; }

/* HTML report page: report + sticky sidebar on wide screens */
.container.xwide { max-width: 1300px; }
.report-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.report-side { display: none; }
@media (min-width: 1100px) {
  .report-wrap { grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; }
  .report-side { display: grid; gap: 14px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; }
  .only-narrow { display: none !important; }
  .report-head .report-dl { display: none; }
}
.side-card { padding: 16px 18px; margin: 0 !important; }
.side-card .card-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px; }
.side-card .prose { font-size: 0.86rem; color: var(--text-2); }
.side-card .prose p { margin: 0 0 8px; }
.side-actions { display: grid; gap: 8px; margin-top: 12px; }
.side-actions .btn { width: 100%; }
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 0.86rem; line-height: 1.35; }
.toc a:hover { background: var(--bg); color: var(--text); }
.toc a.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.toc .n { flex: none; min-width: 22px; font-weight: 700; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a.active .n { color: var(--blue); }
.related-wrap { margin-top: 32px; }
.related-wrap .section-head { margin-top: 0; }
.related-wrap .section-head a { font-weight: 600; text-decoration: none; font-size: 0.9rem; }

/* ---------- Companies ---------- */
.sector-group { margin-bottom: 28px; }
.sector-title { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; }
.sector-title .count, .chips .count { font-weight: 500; }
.sector-title .count { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; font-size: 0.72rem; }
.company-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.company-card { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; height: 100%; }
.company-card:hover { border-color: #c7d7fe; box-shadow: var(--shadow); transform: translateY(-2px); color: var(--text); }
.company-info { flex: 1; min-width: 0; display: grid; }
.company-info strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-counts { font-size: 0.8rem; color: var(--text-2); margin-top: 2px; }
.company-latest { flex: none; text-align: right; font-size: 0.72rem; color: var(--muted); line-height: 1.4; }
.company-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.company-head-main { flex: 1 1 260px; min-width: 0; }
.company-head h1 { margin: 0 0 6px; }
.ticker { font-weight: 600; color: var(--text-2); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 1px 8px; font-size: 0.8rem; letter-spacing: 0.02em; }
.company-stats { display: flex; gap: 8px; }
.company-stats div { background: var(--bg); border-radius: 12px; padding: 8px 14px; text-align: center; min-width: 84px; }
.company-stats strong { display: block; font-size: 1.25rem; line-height: 1.2; }
.company-stats span { font-size: 0.72rem; color: var(--muted); }
@media (max-width: 560px) { .company-stats { width: 100%; } .company-stats div { flex: 1; min-width: 0; padding: 8px; } }
.timeline-month { position: relative; padding-left: 22px; padding-bottom: 8px; }
.timeline-month::before { content: ''; position: absolute; left: 5px; top: 10px; bottom: -6px; width: 2px; background: var(--border); }
.timeline-month:last-child::before { bottom: 0; }
.timeline-label { position: relative; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 12px; }
.timeline-label::before { content: ''; position: absolute; left: -22px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--blue); }
.timeline-month .post-grid { margin-bottom: 20px; }
@media (max-width: 560px) { .main-nav > a:not(.btn) { padding: 8px 7px; font-size: 0.88rem; } .brand img { height: 28px; } }

/* Recommendations */
.rec-co { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.rec-co:hover .name { color: var(--blue); }
.rec-range { white-space: nowrap; font-variant-numeric: tabular-nums; margin-top: 4px; }
.rec-why { min-width: 220px; }
.tone-pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.tone-good { background: var(--green-soft); color: var(--green); }
.tone-mid { background: var(--amber-soft); color: var(--amber); }
.tone-bad { background: var(--red-soft); color: var(--red); }
.tone-neutral { background: #f2f4f7; color: #344054; }
.hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.hero-actions .status-pill { margin-top: 0; }
.hero .hero-reco { background: #fff; color: var(--navy); border-color: #fff; }
.hero .hero-reco:hover { background: #e8eeff; color: var(--navy); }
@media (max-width: 700px) {
  .recs-table td.rec-co-cell, .recs-table td.rec-why { grid-column: 1 / -1; }
  .recs-table td.rec-why { min-width: 0; }
  .recs-table .rec-range { white-space: normal; }
  .recs-table td { min-width: 0; overflow-wrap: break-word; }
}
.show-sm { display: none; }
@media (max-width: 560px) { .show-sm { display: inline; } }
.brand { flex-shrink: 0; }
@media (max-width: 420px) { .main-nav { gap: 2px; } .main-nav > a:not(.btn) { padding: 8px 5px; font-size: 0.82rem; } .brand img { height: 28px; width: 30px; object-fit: cover; object-position: left center; } }
