:root {
    --ink: #1a2332;
    --muted: #5d6775;
    --paper: #f3efe6;
    --card: #fffdf8;
    --line: #e4d9c8;
    --forest: #163528;
    --forest-2: #1f4a38;
    --gold: #8d6420;
    --gold-2: #e7d3a4;
    --buy: #0c7a49;
    --buy-bg: #e5f5ec;
    --sell: #a32018;
    --sell-bg: #fdeceb;
    --info: #1d4e89;
    --info-bg: #e7f0fa;
    --update: #8a5a00;
    --update-bg: #fff4dc;
    --shadow: 0 10px 30px rgba(28, 32, 24, 0.06);
    --tap: 44px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(1200px 400px at 10% -10%, rgba(231, 211, 164, 0.45), transparent 50%),
        var(--paper);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
}
h1, h2, h3 { font-family: Palatino, "Palatino Linotype", Georgia, serif; letter-spacing: -0.02em; }
a { color: var(--forest); }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }

.skip-link {
    position: absolute; left: 12px; top: -40px; background: #fff; padding: 8px 12px; z-index: 20;
}
.skip-link:focus { top: 12px; }
.main-wrap { padding-top: 1.25rem; padding-bottom: 3rem; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.site-header {
    background: var(--forest);
    color: #f6f1e6;
    border-bottom: 3px solid var(--gold-2);
}
.header-bar, .header-nav, .date-actions, .post-actions, .comment-actions, .form-row, .evidence-actions, .empty-actions, .footer-links {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.header-bar { min-height: 64px; justify-content: space-between; padding: .6rem 0; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.brand-mark {
    width: 14px; height: 14px; background: var(--gold-2);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.header-nav a, .header-link { color: #f6f1e6; text-decoration: none; }
.who { display: inline-flex; align-items: center; gap: .4rem; color: inherit; text-decoration: none; }
.choice { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.choice span { display: flex; flex-direction: column; }
.account-chip { background: #f7f4ee; border-radius: 12px; padding: .6rem .75rem; }
.nav-count { display: inline-block; min-width: 1.25rem; padding: 0 .35rem; border-radius: 999px; background: var(--gold-2); color: var(--forest); font-size: .75rem; text-align: center; }
.report-card.is-unread { box-shadow: inset 4px 0 0 var(--gold), var(--shadow); }
.btn-gold { background: var(--gold-2); color: var(--forest); border: 0; min-height: 36px; }
.btn-gold:hover { background: #f3e4c2; color: var(--forest); }
.status-banner { background: #f3d7a1; color: #3d2a05; text-align: center; padding: .55rem 1rem; }

.home-head { max-width: 760px; margin: 0 auto 1rem; text-align: center; }
.home-head h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: .25rem; }
.home-extra { margin: .35rem 0 .2rem; }
.home-extra a { color: inherit; font-weight: 700; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; color: var(--gold); font-weight: 700; margin-bottom: .2rem; }
.lede, .muted, .footer-note, .posted-by, .source-label { color: var(--muted); }
.page-narrow, .feed-list, .date-nav { max-width: 760px; margin-left: auto; margin-right: auto; }

.date-nav { position: relative; margin: 1rem auto 1.25rem; }
.date-nav-main { display: flex; align-items: center; gap: .5rem; }
.date-center { flex: 1; }
.date-label-btn, .day-arrow, .day-chip, .react-btn, .text-btn, .btn-join, .comment-count {
    min-height: var(--tap);
}
.date-label-btn {
    width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: .55rem .8rem;
}
.date-label { display: block; font-family: Palatino, Georgia, serif; font-size: 1.35rem; }
.date-hint { color: var(--muted); font-size: .8rem; }
.day-arrow {
    width: var(--tap); border: 1px solid var(--line); background: var(--card); border-radius: 14px; font-size: 1.6rem; line-height: 1;
}
.date-actions { justify-content: center; margin: .75rem 0; }
.date-picker-label { margin: 0; }
.date-picker-label input { width: 11rem; }
.day-strip { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; }
.day-chip {
    border: 1px solid var(--line); background: transparent; border-radius: 14px; min-width: 68px; padding: .35rem .4rem;
    display: flex; flex-direction: column; align-items: center; position: relative;
}
.day-chip.is-selected { background: var(--forest); color: #f6f1e6; border-color: var(--forest); }
.chip-mon { font-size: .68rem; letter-spacing: .04em; }
.chip-day { font-size: 1.05rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); display: block; }
.is-selected .chip-dot { background: var(--gold-2); }
.calendar-popover {
    position: absolute; left: 50%; transform: translateX(-50%); z-index: 5; width: min(360px, 100%);
    background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: .75rem; text-align: left;
}
.calendar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem; }
.calendar-grid span, .calendar-grid button { text-align: center; font-size: .85rem; }
.calendar-grid .dow { color: var(--muted); font-size: .72rem; }
.cal-day { border: 0; background: transparent; border-radius: 10px; min-height: 36px; position: relative; }
.cal-day.has-posts::after {
    content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
}
.cal-day.is-selected { background: var(--forest); color: white; }

.empty-day, .post-card, .report-card, .stat-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.empty-day { padding: 1.5rem 1rem 1.25rem; text-align: center; }
.empty-actions { justify-content: center; }
.feed-list { display: flex; flex-direction: column; gap: 1rem; }
.post-card { padding: 1rem; overflow: hidden; }
.post-card.dir-buy { box-shadow: inset 4px 0 0 var(--buy), var(--shadow); }
.post-card.dir-sell { box-shadow: inset 4px 0 0 var(--sell), var(--shadow); }
.post-card.dir-information { box-shadow: inset 4px 0 0 var(--info), var(--shadow); }
.post-card.dir-update { box-shadow: inset 4px 0 0 var(--update), var(--shadow); }
.post-top { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.symbol-row { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; margin: 0; }
.symbol { font-size: 1.45rem; font-weight: 750; letter-spacing: .03em; text-decoration: none; color: var(--ink); }
.signal-time { margin: .15rem 0; font-variant-numeric: tabular-nums; font-weight: 650; }
.post-title { font-size: 1.05rem; margin: .2rem 0 0; }
.dir-badge, .pin-badge, .status-pill {
    display: inline-flex; align-items: center; border-radius: 999px; padding: .15rem .55rem; font-size: .75rem; font-weight: 750; letter-spacing: .04em;
}
.dir-badge.dir-buy { background: var(--buy-bg); color: var(--buy); }
.dir-badge.dir-sell { background: var(--sell-bg); color: var(--sell); }
.dir-badge.dir-information { background: var(--info-bg); color: var(--info); }
.dir-badge.dir-update { background: var(--update-bg); color: var(--update); }
.pin-badge { background: var(--gold-2); color: #4d370c; }
.status-pill { flex-direction: column; align-items: flex-end; background: #f6f3ec; min-width: 92px; }
.status-pill span { font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.status-profit { color: var(--buy); }
.status-loss { color: var(--sell); }
.status-running, .status-open { color: var(--info); }

.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .9rem 0; }
.price-grid div { background: #f7f4ee; border-radius: 12px; padding: .55rem .6rem; }
.price-grid dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.price-grid dd { margin: 0; font-size: 1.15rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.tp-line { display: block; }
.tp-line small { display: block; color: var(--muted); font-size: .68rem; }
.summary-block, .evidence-block { margin-top: .8rem; }
.summary-block h3, .evidence-block h3 {
    font-family: "Segoe UI", sans-serif; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: .25rem;
}
.summary-text, .comment-body, .preview-comment p { white-space: pre-wrap; overflow-wrap: anywhere; }
.summary-text { margin: 0; font-size: 1.02rem; }
.staff-banner, .lock-note { background: #fff4dc; border-radius: 10px; padding: .45rem .7rem; }
.evidence-frame { margin-top: .6rem; }
.evidence-frame img { border-radius: 12px; border: 1px solid var(--line); }
.evidence-frame figcaption { color: var(--muted); font-size: .85rem; }

.post-actions { justify-content: space-between; margin-top: .8rem; }
.share-bar { display: flex; justify-content: flex-end; margin-bottom: .45rem; }
.share-menu { width: 100%; display: flex; flex-direction: column; align-items: flex-end; }
.share-menu summary { list-style: none; cursor: pointer; }
.share-menu summary::-webkit-details-marker { display: none; }
.share-toggle { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: .35rem .75rem; font-weight: 700; }
.share-menu:not([open]) .share-pop { display: none; }
.share-menu[open] .share-pop {
    display: flex; flex-wrap: wrap; gap: .4rem; width: 100%; margin-top: .45rem;
    padding: .45rem; background: #f7f4ee; border: 1px solid var(--line); border-radius: 12px;
}
.share-pop a, .share-pop button {
    border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none;
    font: inherit; font-weight: 650; padding: .4rem .7rem; border-radius: 999px;
}
.share-pop a:hover, .share-pop button:hover { background: #fffdf8; }
.react-btn, .text-btn, .comment-count, .logout-all button, .action-cell button {
    border: 0; background: transparent; color: var(--ink); padding: .35rem .55rem; border-radius: 999px;
}
.react-btn { border: 1px solid var(--line); background: #fff; min-width: 64px; }
.react-btn.is-active[data-react="like"] { background: var(--buy-bg); border-color: var(--buy); color: var(--buy); }
.react-btn.is-active[data-react="dislike"] { background: var(--sell-bg); border-color: var(--sell); color: var(--sell); }
.btn-join { width: 100%; margin-top: .8rem; background: var(--forest); color: #f6f1e6; border: 0; border-radius: 12px; font-weight: 700; }
.btn-join:hover { background: var(--forest-2); color: white; }
.preview-list { display: flex; flex-direction: column; gap: .55rem; margin-top: .8rem; }
.preview-comment, .comment { background: #f8f5ef; border-radius: 14px; padding: .7rem .75rem; }
.preview-comment header, .comment-head { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.preview-comment p, .comment-body { margin: .25rem 0; }
.discussion { margin-top: .8rem; display: flex; flex-direction: column; gap: .7rem; }
.comment { display: flex; flex-direction: column; gap: .45rem; }
.comment-main { display: flex; gap: .65rem; }
.comment.depth-1 { margin-left: .6rem; border-left: 3px solid var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-sm { width: 24px; height: 24px; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar-fallback { display: inline-grid; place-items: center; background: var(--forest); color: #f6f1e6; font-weight: 700; }
.edited, .replying-to, .removed-note { color: var(--muted); font-size: .85rem; }
.comment-form textarea, .reply-form textarea, .stack-form textarea, .stack-form input, .stack-form select, .filter-form input, .filter-form select {
    width: 100%;
}
.comment-form, .reply-form, .stack-form, .filter-form { display: flex; flex-direction: column; gap: .65rem; }
.filter-form { display: grid; gap: .65rem; margin-bottom: 1rem; }
.form-grid { display: grid; gap: .65rem; }
.btn-google {
    display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%;
    background: white; border: 1px solid var(--line); border-radius: 12px; min-height: 48px; text-decoration: none; color: var(--ink); font-weight: 700;
}
.g-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--forest); color: white; font-weight: 800; }
.login-card { border-radius: 18px; }
.site-toast {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: var(--ink); color: white;
    padding: .7rem 1rem; border-radius: 999px; z-index: 30; max-width: calc(100% - 24px);
}
.trade-scene {
    position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%;
    pointer-events: none; display: block;
}
body.has-scene .site-header,
body.has-scene main,
body.has-scene .site-footer,
body.has-scene .status-banner { position: relative; z-index: 1; }
body.has-scene { background: #070b12; }
body.has-scene.scene-dusk { background: #140f0b; }
body.has-scene .home-head h1 { color: #f5f8fc; text-shadow: 0 8px 28px rgba(0, 0, 0, 0.45); }
body.has-scene .home-head .lede,
body.has-scene .home-head .home-extra a,
body.has-scene .back-link,
body.has-scene .back-link a,
body.has-scene .permalink,
body.has-scene .permalink code { color: #d5deea; }
body.has-scene .eyebrow { color: #e7d3a4; }
body.has-scene .prose,
body.has-scene .page-narrow,
body.has-scene .filter-form {
    background: rgba(255, 253, 248, 0.94);
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 18px;
    padding: 1.1rem 1rem 1.25rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}
body.has-scene .prose { padding: 1.4rem 1.2rem; }
body.has-scene .filter-form { margin-bottom: 1rem; }
body.has-scene .site-footer {
    background: rgba(6, 10, 16, 0.78);
    border-top-color: rgba(255, 255, 255, 0.08);
    color: #d5deea;
    backdrop-filter: blur(8px);
}
body.has-scene .site-footer .disclaimer,
body.has-scene .site-footer .footer-note,
body.has-scene .footer-links a,
body.has-scene .logout-all button { color: #d5deea; }
.scene-settings { border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem 1rem; background: #fffdf8; }
.scene-settings legend { font-weight: 700; padding: 0 .3rem; }
h1.symbol-row { font-size: 1.45rem; font-family: "Segoe UI", sans-serif; margin: 0; font-weight: 750; }
.day-chip, .day-arrow { text-decoration: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 auto .8rem; max-width: 760px; color: inherit; font-size: .92rem; }
body.has-scene .breadcrumbs { color: #d5deea; }
.breadcrumbs a { color: inherit; }
.related-topics { display: flex; flex-wrap: wrap; gap: .45rem; max-width: 760px; margin: .8rem auto; }
.related-topics a { border: 1px solid var(--line); background: #fffdf8; border-radius: 999px; padding: .35rem .7rem; text-decoration: none; }
.topic-index { list-style: none; padding: 0; }
.topic-index li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.source-note { color: var(--muted); font-size: .92rem; }
.google-preview { margin-top: .6rem; padding: .9rem 1rem; border-radius: 12px; background: #fff; border: 1px solid var(--line); max-width: 600px; }
.g-title { color: #1a0dab; font-size: 1.15rem; margin: 0; }
.g-url { color: #006621; font-size: .85rem; margin: .15rem 0; }
.g-desc { color: #4d5156; margin: 0; }
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0 2rem; margin-top: 1rem; }
.disclaimer { font-size: .92rem; }
.footer-links a { color: var(--muted); }
.logout-all { margin-top: .5rem; }
.permalink { max-width: 760px; margin: .8rem auto 0; overflow-wrap: anywhere; }
.permalink code { color: var(--muted); }
.back-link { max-width: 760px; margin: 0 auto .5rem; }
.prose { max-width: 740px; margin: 0 auto; }
.prose h1 { margin-bottom: .6rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.quick-filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.quick-filters a { padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: white; }
.quick-filters a.is-on { background: var(--forest); color: white; }
.pager { display: flex; gap: 1rem; align-items: center; margin: 1rem 0; }
.result-count, .empty-copy { color: var(--muted); }

.admin-body { background: #efeae1; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
    width: 230px; background: var(--forest); color: #f6f1e6; padding: 1rem .8rem; flex: none;
}
.admin-side a { color: #f6f1e6; text-decoration: none; }
.brand-small { color: #f6f1e6; }
.side-kicker { color: var(--gold-2); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; margin: 1rem 0 .4rem; }
.side-nav { display: flex; flex-direction: column; gap: .15rem; }
.side-nav a { padding: .55rem .7rem; border-radius: 10px; }
.side-nav a.active, .side-nav a:hover { background: rgba(255,255,255,.08); }
.admin-main { flex: 1; min-width: 0; }
.admin-top {
    display: flex; gap: .75rem; align-items: center; padding: .8rem 1rem; background: rgba(255,253,248,.8);
    border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
.admin-content { padding: 1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.stat-card { padding: .9rem 1rem; }
.stat-card p { margin: 0; color: var(--muted); font-size: .85rem; }
.stat-card strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.admin-split { display: grid; gap: .8rem; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: .55rem 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.table-wrap { overflow-x: auto; background: var(--card); border-radius: 14px; border: 1px solid var(--line); }
.inline-form, .action-cell { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.action-cell form { margin: 0; }
.action-cell button, .inline-form button { border: 1px solid var(--line); background: white; border-radius: 999px; padding: .2rem .55rem; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.report-card { padding: 1rem; }
.editor-grid { display: grid; gap: 1rem; }
.preview-panel { position: sticky; top: 72px; align-self: start; }
.check-label { display: flex; gap: .5rem; align-items: center; }
.setup-pre { white-space: pre-wrap; background: white; padding: 1rem; border-radius: 12px; }
.narrow { max-width: 720px; }

@media (min-width: 720px) {
    .filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
    .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .admin-split { grid-template-columns: 1fr 1fr; }
    .editor-grid { grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); }
}
@media (max-width: 991px) {
    .admin-side { position: fixed; inset: 0 auto 0 0; z-index: 20; transform: translateX(-105%); transition: transform .2s ease; }
    .admin-side.is-open { transform: none; }
}
@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
}
