/* Terminal Brief — Ghost theme for TheFinanceBrief */
:root {
    --bg: #0a0e13;
    --bg-2: #0e131a;
    --panel: #111821;
    --panel-2: #16202b;
    --line: #1e2833;
    --line-2: #2a3644;
    --text: #e6edf3;
    --text-2: #b3bfcc;
    --muted: #7d8a99;
    --accent: #f5b300;
    --accent-ink: #0a0e13;
    --up: #22c55e;
    --down: #f05252;
    --link: #5cc8ff;
    --sans: var(--gh-font-body, "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    --head: var(--gh-font-heading, "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --wrap: 1240px;
    --radius: 6px;
    color-scheme: dark;
}
[data-accent="Green"] { --accent: #22c55e; }
[data-accent="Cyan"] { --accent: #38bdf8; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 17px/1.65 var(--sans);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }

.tb-site { min-height: 100vh; display: flex; flex-direction: column; }
.tb-main { flex: 1; }
.tb-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* Status bar */
.tb-statusbar { background: #06090d; border-bottom: 1px solid var(--line); font: 500 12px/1 var(--mono); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.tb-statusbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; height: 32px; }
.tb-live { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: tb-pulse 2s infinite; flex: none; }
@keyframes tb-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.tb-clocks { display: flex; gap: 18px; white-space: nowrap; }
.tb-clocks b { color: var(--text-2); font-weight: 500; margin-left: 6px; }

/* Header */
.tb-header { position: sticky; top: 0; z-index: 50; background: rgba(10,14,19,.88); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--line); }
.tb-header-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.tb-logo { display: inline-flex; align-items: center; gap: 10px; font: 600 18px/1 var(--mono); letter-spacing: -.01em; white-space: nowrap; }
.tb-logo img { max-height: 34px; width: auto; }
.tb-logo-mark { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 13px solid var(--accent); }
.tb-cursor { color: var(--accent); animation: tb-blink 1.1s steps(1) infinite; margin-left: -6px; }
@keyframes tb-blink { 50% { opacity: 0; } }
.tb-nav { flex: 1; }
.tb-nav ul, .tb-footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.tb-nav a { display: block; padding: 8px 12px; border-radius: var(--radius); font: 500 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.tb-nav a:hover, .tb-nav .nav-current a { color: var(--text); background: var(--panel); }
.tb-nav .nav-current a { box-shadow: inset 0 -2px 0 var(--accent); }
.tb-actions { display: flex; align-items: center; gap: 8px; }

.tb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); font: 600 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; cursor: pointer; transition: filter .15s, transform .15s; white-space: nowrap; }
.tb-btn:hover { filter: brightness(1.1); }
.tb-btn:active { transform: translateY(1px); }
.tb-btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.tb-btn-ghost:hover { border-color: var(--muted); filter: none; }
.tb-btn-lg { height: 46px; padding: 0 22px; font-size: 14px; }

.tb-burger { display: none; width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: var(--radius); background: transparent; cursor: pointer; padding: 0; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.tb-burger span { display: block; width: 16px; height: 2px; background: var(--text); transition: transform .2s; }
.is-open .tb-burger span:first-child { transform: translateY(3.5px) rotate(45deg); }
.is-open .tb-burger span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* Hero */
.tb-hero { border-bottom: 1px solid var(--line); background:
    linear-gradient(180deg, rgba(10,14,19,0) 0%, var(--bg) 100%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 48px 100%;
    background-color: var(--bg-2); }
.tb-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; padding-top: 72px; padding-bottom: 72px; align-items: start; }
.tb-kicker { display: flex; align-items: center; gap: 12px; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 22px; }
.tb-pill { display: inline-block; padding: 5px 8px; border: 1px solid var(--accent); border-radius: 3px; color: var(--accent); }
.tb-hero-title { margin: 0 0 20px; font: 700 clamp(32px, 4.6vw, 56px)/1.08 var(--head); letter-spacing: -.025em; text-wrap: balance; }
.tb-hero-title a:hover { color: var(--accent); }
.tb-hero-excerpt { margin: 0 0 24px; max-width: 64ch; font-size: 19px; line-height: 1.6; color: var(--text-2); }
.tb-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 400 13px/1.4 var(--mono); color: var(--muted); margin-bottom: 28px; }
.tb-meta > * + *::before { content: "·"; margin-right: 18px; color: var(--line-2); }

.tb-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.tb-panel-title { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.tb-about { margin: 0 0 22px; color: var(--text-2); font-size: 15px; }

/* Subscribe */
.tb-subscribe { border-top: 1px solid var(--line); padding-top: 20px; }
.tb-hero-side .tb-subscribe:first-child { border-top: 0; padding-top: 0; }
.tb-sub-label { font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 10px; }
.tb-sub-text { margin: 0 0 14px; font-size: 15px; color: var(--text-2); }
.tb-sub-row { display: flex; gap: 8px; }
.tb-sub-row input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--text); font: 400 14px/1 var(--mono); }
.tb-sub-row input:focus { outline: none; border-color: var(--accent); }
.tb-sub-loading, .tb-sub-success, .tb-sub-error { display: none; }
.tb-subscribe.loading .tb-sub-default { display: none; }
.tb-subscribe.loading .tb-sub-loading { display: inline; }
.tb-subscribe.success .tb-sub-row { display: none; }
.tb-subscribe.success .tb-sub-success { display: block; color: var(--up); font: 500 14px/1.5 var(--mono); margin: 0; }
.tb-subscribe.error .tb-sub-error { display: block; color: var(--down); font-size: 14px; margin: 10px 0 0; }

/* Archive table */
.tb-archive { padding-top: 56px; padding-bottom: 72px; }
.tb-section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.tb-section-head h2 { margin: 0; font: 600 14px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.tb-count { font: 400 13px/1 var(--mono); color: var(--muted); }
.tb-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.tb-table:not(:has(a.tb-row)) { display: none; }
.tb-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 160px 72px; gap: 20px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line); transition: background .12s; }
.tb-row:first-child { border-top: 0; }
a.tb-row:hover { background: var(--panel); }
a.tb-row:hover .tb-c-title { color: var(--accent); }
.tb-row-head { padding: 10px 20px; background: var(--panel); font: 500 11px/1 var(--mono) !important; text-transform: uppercase; letter-spacing: .08em; color: var(--muted) !important; }
.tb-row-head > span { font: inherit !important; color: inherit !important; }
.tb-c-date, .tb-c-read, .tb-c-tag { font: 400 13px/1.3 var(--mono); color: var(--muted); }
.tb-c-read { text-align: right; }
.tb-c-tag { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-c-title { font-weight: 500; font-size: 16px; line-height: 1.4; transition: color .12s; }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; font: 500 13px/1 var(--mono); color: var(--muted); }
.pagination a { color: var(--text); padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--radius); }
.pagination a:hover { border-color: var(--accent); color: var(--accent); }

/* Post */
.tb-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--accent); z-index: 60; }
.tb-post-head, .tb-list-head { max-width: 1000px; padding-top: 64px; padding-bottom: 36px; }
.tb-list-head { padding-bottom: 0; }
.tb-breadcrumb { font: 400 13px/1 var(--mono); color: var(--muted); margin-bottom: 22px; display: flex; gap: 8px; }
.tb-breadcrumb a { color: var(--accent); }
.tb-breadcrumb a:hover { text-decoration: underline; }
.tb-post-title { margin: 0 0 18px; font: 700 clamp(30px, 4vw, 48px)/1.12 var(--head); letter-spacing: -.02em; text-wrap: balance; }
.tb-post-excerpt { margin: 0 0 22px; font-size: 20px; line-height: 1.55; color: var(--text-2); max-width: 70ch; }
.tb-post-head .tb-meta { margin: 0; padding-top: 18px; border-top: 1px solid var(--line); }
.tb-feature { margin: 0 auto 40px; max-width: 1240px; }
.tb-feature img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.tb-feature figcaption { margin-top: 10px; font: 400 13px/1.4 var(--mono); color: var(--muted); text-align: center; }

.tb-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; padding-bottom: 40px; }
.tb-layout-single { grid-template-columns: minmax(0, 1fr); max-width: 860px; padding-top: 24px; }
.tb-toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; padding-right: 8px; }
.tb-toc[hidden] { display: none; }
.tb-toc[hidden] + .tb-content { grid-column: 1 / -1; max-width: 820px; margin: 0 auto; }
.tb-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.tb-toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: 13.5px; line-height: 1.35; color: var(--muted); }
.tb-toc a:hover { color: var(--text); }
.tb-toc a.is-active { color: var(--text); border-left-color: var(--accent); }

.tb-post-foot { max-width: 1000px; padding-bottom: 32px; }
.tb-disclaimer { font: 400 13px/1.5 var(--mono); color: var(--muted); padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 0 32px; }
.tb-post-foot .tb-subscribe { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; max-width: 560px; }
.tb-more { padding-top: 16px; }

/* Content */
.tb-content { min-width: 0; max-width: 820px; font-size: 17.5px; line-height: 1.72; color: var(--text); }
.gh-content > * + * { margin-top: 1.15em; }
.gh-content > :first-child { margin-top: 0; }
.gh-content p, .gh-content ul, .gh-content ol, .gh-content blockquote, .gh-content figure, .gh-content pre, .gh-content table { margin-bottom: 0; }
.gh-content h2 { margin: 2.2em 0 .7em; padding-top: 20px; border-top: 1px solid var(--line); font: 700 26px/1.25 var(--head); letter-spacing: -.015em; scroll-margin-top: 90px; }
.gh-content h2::before { content: "§"; color: var(--accent); font-family: var(--mono); font-weight: 500; margin-right: 12px; }
.gh-content h3 { margin: 1.8em 0 .5em; font: 600 20px/1.3 var(--head); color: var(--text); scroll-margin-top: 90px; }
.gh-content h4 { margin: 1.6em 0 .4em; font: 600 13px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.gh-content a { color: var(--link); text-decoration: underline; text-decoration-color: rgba(92,200,255,.35); text-underline-offset: 3px; }
.gh-content a:hover { text-decoration-color: var(--link); }
.gh-content strong { color: #fff; font-weight: 600; }
.gh-content ul, .gh-content ol { padding-left: 1.3em; }
.gh-content li + li { margin-top: .4em; }
.gh-content li::marker { color: var(--accent); }
.gh-content blockquote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); color: var(--text-2); font-style: italic; }
.gh-content hr { border: 0; height: 1px; background: var(--line); margin: 2.5em 0; }
.gh-content code { font: 400 .88em/1.4 var(--mono); background: var(--panel-2); padding: 2px 6px; border-radius: 4px; }
.gh-content pre { background: #06090d; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; font: 400 14px/1.6 var(--mono); }
.gh-content pre code { background: none; padding: 0; }
.gh-content figcaption { font: 400 13px/1.4 var(--mono); color: var(--muted); text-align: center; margin-top: 10px; }
.gh-content img { border-radius: var(--radius); }

/* Neutralise inline styles pasted from Google Docs / Word */
.gh-content [style] { color: inherit !important; background-color: transparent !important; font-family: inherit !important; font-size: inherit !important; line-height: inherit !important; }
.gh-content span[style*="font-weight:700"], .gh-content span[style*="font-weight: 700"] { color: #fff !important; }

/* Tables (market data) */
.tb-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); -webkit-overflow-scrolling: touch; }
.gh-content table { width: 100% !important; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.gh-content table col { width: auto !important; }
.gh-content th, .gh-content td { padding: 10px 14px !important; border: 0 !important; border-top: 1px solid var(--line) !important; text-align: left; vertical-align: top; }
.gh-content td p, .gh-content th p { margin: 0 !important; }
.gh-content tr:first-child > th, .gh-content tr:first-child > td, .gh-content thead th { border-top: 0 !important; background: var(--panel) !important; font: 500 11.5px/1.3 var(--mono) !important; text-transform: uppercase; letter-spacing: .06em; color: var(--muted) !important; white-space: nowrap; }
.gh-content tr:first-child > td *, .gh-content thead th * { color: var(--muted) !important; font: inherit !important; }
.gh-content tbody tr:not(:first-child):hover td { background: var(--panel) !important; }
.gh-content td.tb-num { font-family: var(--mono) !important; font-size: 13.5px; text-align: right; white-space: nowrap; }
.gh-content td.tb-num * { font-family: var(--mono) !important; }
.gh-content tr:first-child > td.tb-num-head { text-align: right; }

.tb-up, .tb-up * { color: var(--up) !important; font-family: var(--mono); font-size: .94em; }
.tb-down, .tb-down * { color: var(--down) !important; font-family: var(--mono); font-size: .94em; }

/* Koenig cards */
.kg-width-wide { position: relative; width: calc(100% + 120px); margin-left: -60px; max-width: none; }
.kg-width-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); max-width: none; }
.kg-width-full img { border-radius: 0; }
.kg-callout-card { border-radius: var(--radius) !important; border: 1px solid var(--line); }
.kg-bookmark-card a.kg-bookmark-container { color: var(--text); background: var(--panel); border-color: var(--line) !important; text-decoration: none; }
.kg-bookmark-description, .kg-bookmark-metadata { color: var(--text-2) !important; }

/* Error */
.tb-error { padding-top: 96px; padding-bottom: 96px; max-width: 640px; }
.tb-error-code { font: 600 56px/1 var(--mono); color: var(--down); margin: 6px 0 16px; }
.tb-error p { color: var(--text-2); margin: 0 0 24px; }

/* Footer */
.tb-footer { border-top: 1px solid var(--line); background: #06090d; margin-top: 40px; }
.tb-footer-inner { display: flex; justify-content: space-between; gap: 32px; padding-top: 40px; padding-bottom: 28px; flex-wrap: wrap; }
.tb-footer-brand .tb-logo-text { font: 600 16px/1 var(--mono); }
.tb-footer-brand p { margin: 10px 0 0; color: var(--muted); font-size: 14px; max-width: 46ch; }
.tb-footer-nav a { display: block; padding: 6px 10px; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.tb-footer-nav a:hover { color: var(--accent); }
.tb-footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; padding-bottom: 28px; border-top: 1px solid var(--line); font: 400 12px/1.5 var(--mono); color: var(--muted); }
.tb-footer-legal a { color: var(--text-2); }

/* Responsive */
@media (max-width: 1080px) {
    .tb-layout { grid-template-columns: minmax(0, 1fr); }
    .tb-toc { display: none !important; }
    .tb-content { margin: 0 auto; }
    .kg-width-wide { width: 100%; margin-left: 0; }
}
@media (max-width: 920px) {
    .tb-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 48px; padding-bottom: 48px; }
    .tb-clocks span:nth-child(n+3) { display: none; }
}
@media (max-width: 760px) {
    .tb-wrap { padding-left: 16px; padding-right: 16px; }
    .tb-header-inner { gap: 12px; }
    .tb-burger { display: inline-flex; }
    .tb-hide-sm { display: none; }
    .tb-nav { position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; display: none; }
    .is-open .tb-nav { display: block; }
    .tb-nav ul { flex-direction: column; }
    .tb-header-inner { justify-content: space-between; }
    .tb-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; }
    .tb-row .tb-c-title { grid-column: 1 / -1; grid-row: 1; }
    .tb-row .tb-c-tag { display: none; }
    .tb-row-head { display: none; }
    .tb-live { max-width: 52vw; }
    .tb-clocks span:nth-child(n+2) { display: none; }
    .tb-content { font-size: 17px; }
    .gh-content h2 { font-size: 22px; }
    .tb-post-head { padding-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Newsletter sections */
.tb-sections { padding-top: 56px; }
.tb-section-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tb-section-card { display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.tb-section-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tb-section-card h3 { margin: 0 0 8px; font: 700 21px/1.25 var(--head); letter-spacing: -.01em; }
.tb-section-card p { margin: 0 0 18px; color: var(--text-2); font-size: 15px; line-height: 1.55; flex: 1; }
.tb-section-link { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.tb-section-hero .tb-hero-grid { padding-top: 56px; padding-bottom: 56px; }
.tb-section-hero .tb-breadcrumb { margin-bottom: 18px; }
.tb-empty { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); font: 400 14px/1.5 var(--mono); }
.tb-sub-more { margin: 12px 0 0; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.tb-sub-more a, .tb-link { color: var(--accent); }
@media (max-width: 920px) { .tb-section-grid { grid-template-columns: minmax(0, 1fr); } }
