:root {
  --topic-coral: #ed705a;
  --topic-sun: #f1c75b;
  --topic-deep: #102d29;
}

body.topic-page { padding-bottom: 0; background-color: var(--paper); background-image: linear-gradient(rgba(21,37,34,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(21,37,34,.025) 1px, transparent 1px); background-size: 34px 34px; }
.reading-progress { position: fixed; z-index: 1100; top: 0; left: 0; width: 0; height: 3px; background: var(--topic-coral); }
.topic-header { position: sticky; z-index: 1030; top: 0; height: 65px; border-bottom: 1px solid var(--line); background: rgba(247,247,242,.94); backdrop-filter: blur(18px); }
.topic-header .container { height: 100%; }
.topic-brand { display: inline-flex; min-width: 0; align-items: center; gap: 10px; }
.topic-brand img { width: 32px; height: 32px; object-fit: contain; }
.topic-brand strong { overflow: hidden; max-width: 180px; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.topic-header-actions { display: flex; align-items: center; gap: 4px; }
.topic-header-link, .topic-icon-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--ink); font-size: .76rem; font-weight: 700; }
.topic-header-link { gap: 7px; padding: 0 10px; }
.topic-icon-button { width: 36px; padding: 0; }
.topic-header-link:hover, .topic-icon-button:hover { border-color: var(--line); background: var(--mint); }
.topic-book { margin-left: 5px; min-height: 36px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--brand) 72%, #0a4440); border-radius: 3px; background: var(--brand); color: #09201f; font-size: .76rem; font-weight: 700; }

.topic-lead { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.56); }
.topic-lead-grid { min-height: 510px; display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(440px, .96fr); }
.topic-lead-copy { display: flex; flex-direction: column; justify-content: center; padding: 62px clamp(34px, 6vw, 82px) 58px max(20px, calc((100vw - 1180px) / 2)); }
.topic-breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 34px; color: var(--muted-ink); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.topic-breadcrumb a:hover { color: var(--ink); }
.topic-breadcrumb i { font-size: .58rem; }
.topic-label { width: fit-content; margin-bottom: 16px; padding: 6px 8px; border-left: 3px solid var(--topic-coral); background: rgba(237,112,90,.08); color: #8e3425; font-size: .68rem; font-weight: 700; text-transform: uppercase; }
.topic-lead h1 { max-width: 760px; margin: 0; font-size: clamp(3rem, 5.1vw, 5.35rem); line-height: .98; }
.topic-deck { max-width: 680px; margin: 24px 0 28px; color: var(--muted-ink) !important; font-size: 1.03rem; line-height: 1.65; }
.topic-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 18px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted-ink); font-size: .75rem; }
.topic-byline strong { color: var(--ink); }
.topic-byline span { display: inline-flex; align-items: center; gap: 6px; }
.topic-lead-media { position: relative; min-height: 510px; overflow: hidden; background: var(--topic-deep); }
.topic-lead-media img { width: 100%; height: 100%; object-fit: cover; }
.topic-lead-media::after { content: ""; position: absolute; inset: 0; border-left: 1px solid rgba(255,255,255,.22); background: linear-gradient(0deg, rgba(16,45,41,.4), transparent 42%); }
.topic-media-caption { position: absolute; z-index: 1; right: 20px; bottom: 18px; padding: 7px 9px; background: rgba(16,45,41,.84); color: white; font-size: .68rem; }

.topic-toolbar { border-bottom: 1px solid var(--line); background: var(--mint); }
.topic-toolbar .container { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topic-toolbar-nav { display: flex; align-items: center; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.topic-toolbar-nav::-webkit-scrollbar { display: none; }
.topic-toolbar-nav a { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid transparent; border-radius: 3px; white-space: nowrap; color: var(--muted-ink); font-size: .73rem; font-weight: 700; }
.topic-toolbar-nav a:hover { border-color: var(--line); background: rgba(255,255,255,.55); color: var(--ink); }
.topic-tools { display: flex; flex: 0 0 auto; gap: 4px; }
.topic-tools button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 3px; background: rgba(255,255,255,.52); color: var(--ink); }
.topic-tools button:hover, .topic-tools button.active { background: var(--ink); color: white; }

.topic-content-shell { padding-top: 54px; padding-bottom: 74px; }
.topic-content-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .72fr); gap: clamp(34px, 5vw, 72px); align-items: start; }
.section-index { margin-bottom: 9px; color: var(--topic-coral); font-size: .69rem; font-weight: 700; text-transform: uppercase; }
.topic-section-title { margin: 0 0 22px; font-size: clamp(2rem, 3.4vw, 3.15rem); }

.media-studio { overflow: hidden; border: 1px solid var(--line); background: var(--topic-deep); }
.media-tabs { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px; border-bottom: 1px solid rgba(255,255,255,.15); }
.media-tab-list { display: flex; gap: 4px; }
.media-tab { min-height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: rgba(255,255,255,.7); font-size: .74rem; font-weight: 700; }
.media-tab.active { border-color: rgba(255,255,255,.18); background: white; color: var(--ink); }
.media-duration { color: rgba(255,255,255,.62); font-size: .7rem; }
.media-panel[hidden] { display: none; }
.media-video { aspect-ratio: 16 / 9; background: #07110f; }
.media-video iframe, .media-video video { width: 100%; height: 100%; border: 0; }
.media-empty { height: 100%; display: grid; place-items: center; color: white; }
.transcript-panel { min-height: 360px; padding: 24px; background: #f0f5f1; }
.transcript-tools { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 18px; }
.transcript-search { min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 3px; background: white; color: var(--ink); }
.transcript-count { display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid var(--line); color: var(--muted-ink); font-size: .7rem; }
.transcript-list { max-height: 420px; overflow-y: auto; padding-right: 9px; }
.transcript-entry { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.transcript-time { color: #a03f2e; font-size: .7rem; font-weight: 700; }
.transcript-entry p { margin: 0; color: var(--ink) !important; font-size: .87rem; line-height: 1.65; }
.transcript-entry.is-hidden { display: none; }

.article-copy { max-width: 760px; padding-top: 54px; }
.article-block { margin-bottom: 38px; }
.article-block h2 { margin: 0 0 13px; font-size: clamp(1.7rem, 2.8vw, 2.25rem); }
.article-block p { margin: 0; color: #3f514d !important; font-size: 1.03rem; line-height: 1.85; }
.article-note { display: flex; gap: 14px; margin: 48px 0 0; padding: 20px; border-left: 3px solid var(--topic-sun); background: #fff9e9; }
.article-note i { color: #9b6b00; }
.article-note p { margin: 0; font-size: .8rem; line-height: 1.55; }

.topic-aside { position: sticky; top: 96px; }
.aside-block { padding: 0 0 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.aside-block h2 { margin: 5px 0 18px; font-size: 1.35rem; }
.takeaway-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: takeaway; }
.takeaway-list li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line); color: #40514d; font-size: .78rem; line-height: 1.5; counter-increment: takeaway; }
.takeaway-list li::before { content: counter(takeaway, decimal-leading-zero); color: var(--topic-coral); font-size: .65rem; font-weight: 700; }
.support-panel { padding: 22px; border: 1px solid var(--line); background: var(--topic-deep); color: white; }
.support-panel h2 { color: white !important; margin: 8px 0 10px; font-size: 1.55rem; }
.support-panel p { color: rgba(255,255,255,.7) !important; font-size: .78rem; line-height: 1.55; }
.support-panel .btn { width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }

.community-section { padding: 62px 0; border-top: 1px solid var(--line); background: white; }
.community-grid { display: grid; grid-template-columns: .72fr 1.28fr; gap: clamp(32px, 6vw, 84px); }
.community-intro h2 { margin: 6px 0 14px; font-size: clamp(2rem, 3.5vw, 3.2rem); }
.community-intro p { color: var(--muted-ink) !important; }
.comment-form { display: grid; grid-template-columns: 180px 1fr auto; gap: 8px; }
.comment-form .form-control, .comment-form .btn { min-height: 44px; }
.comment-list { display: grid; gap: 12px; margin-top: 24px; }
.comment-item { padding: 16px 0; border-top: 1px solid var(--line); }
.comment-item-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; font-size: .76rem; }
.comment-item p { margin: 0; color: var(--muted-ink) !important; font-size: .85rem; }
.empty-comments { padding: 18px 0; border-top: 1px solid var(--line); color: var(--muted-ink); font-size: .82rem; }

.related-section { padding: 68px 0 78px; border-top: 1px solid var(--line); background: #edf3ef; }
.related-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.related-heading h2 { margin: 5px 0 0; font-size: clamp(2.1rem, 3.6vw, 3.4rem); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related-card { display: grid; grid-template-rows: 170px 1fr; min-width: 0; border: 1px solid var(--line); background: white; transition: transform .2s ease, box-shadow .2s ease; }
.related-card:hover { transform: translateY(-3px); box-shadow: 7px 7px 0 rgba(21,37,34,.11); }
.related-card img { width: 100%; height: 170px; object-fit: cover; }
.related-card-copy { display: flex; flex-direction: column; padding: 18px; }
.related-card-meta { color: var(--topic-coral); font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.related-card h3 { margin: 9px 0 18px; font-size: 1.25rem; line-height: 1.15; }
.related-card small { margin-top: auto; color: var(--muted-ink); }

.topic-footer { padding: 34px 0; border-top: 1px solid rgba(255,255,255,.13); background: var(--topic-deep); color: white; }
.topic-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topic-footer p { margin: 3px 0 0; color: rgba(255,255,255,.58) !important; font-size: .74rem; }
.topic-footer-links { display: flex; gap: 16px; font-size: .74rem; }
.topic-footer-links a { color: rgba(255,255,255,.74); }

.topic-page .modal-content { border-radius: 4px; border: 1px solid var(--line); background: var(--paper); }
.topic-page .modal-header { border-bottom-color: var(--line); }
.topic-page .form-control, .topic-page .form-select { border-radius: 3px; border-color: var(--line); }
.topic-toast { position: fixed; z-index: 2000; right: 18px; bottom: 18px; display: none; max-width: min(360px, calc(100% - 36px)); padding: 13px 15px; border-left: 3px solid var(--brand); background: var(--topic-deep); color: white; box-shadow: 0 16px 36px rgba(0,0,0,.2); font-size: .78rem; }
.topic-toast.show { display: block; }

@media (max-width: 991.98px) {
  .topic-lead-grid { min-height: 0; grid-template-columns: 1fr; }
  .topic-lead-copy { padding: 48px max(20px, calc((100vw - 720px) / 2)) 44px; }
  .topic-lead-media { min-height: 380px; }
  .topic-content-grid { grid-template-columns: 1fr; }
  .topic-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .aside-block { margin: 0; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .community-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  body.topic-page { padding-bottom: 0; }
  .topic-header { height: 60px; }
  .topic-brand strong, .topic-header-link span, .topic-book span { display: none; }
  .topic-header-link { width: 36px; padding: 0; }
  .topic-book { width: 36px; padding: 0; }
  .topic-lead-copy { padding: 34px 14px 36px; }
  .topic-breadcrumb { margin-bottom: 25px; }
  .topic-lead h1 { font-size: clamp(2.7rem, 13vw, 4.1rem); }
  .topic-deck { margin: 18px 0 22px; font-size: .94rem; }
  .topic-lead-media { min-height: 290px; }
  .topic-toolbar .container { min-height: 58px; width: 100%; padding-left: 14px; padding-right: 14px; }
  .topic-toolbar-nav a { padding: 0 8px; }
  .topic-toolbar-nav a:nth-child(3) { display: none; }
  .topic-content-shell { padding-top: 38px; padding-bottom: 52px; }
  .media-tabs { align-items: flex-start; }
  .media-duration { display: none; }
  .transcript-panel { min-height: 320px; padding: 16px; }
  .transcript-tools { grid-template-columns: 1fr; }
  .transcript-count { min-height: 34px; width: fit-content; }
  .transcript-entry { grid-template-columns: 58px 1fr; gap: 8px; }
  .article-copy { padding-top: 42px; }
  .article-block p { font-size: .96rem; line-height: 1.78; }
  .topic-aside { grid-template-columns: 1fr; }
  .comment-form { grid-template-columns: 1fr; }
  .related-heading { align-items: flex-start; flex-direction: column; }
  .related-grid { grid-template-columns: 1fr; }
  .related-card { grid-template-columns: 116px 1fr; grid-template-rows: 1fr; }
  .related-card img { width: 116px; height: 100%; min-height: 142px; }
  .related-card h3 { font-size: 1.05rem; }
  .topic-footer-inner { align-items: flex-start; flex-direction: column; }
}