/* Current Psycho — a quiet place for words. No external CSS dependencies. */
:root {
  color-scheme: light;
  --paper: #f7f8f3;
  --surface: #fff;
  --ink: #253c33;
  --muted: #748078;
  --green: #176353;
  --green-deep: #124b40;
  --green-soft: #eaf3ec;
  --line: #e3e8df;
  --cream: #eff1d9;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sidebar: 224px;
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { color: var(--green-deep); background: #d8e9bd; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: wait; opacity: .55; }
button, input, textarea, select { transition: border-color .18s, background-color .18s, box-shadow .18s, color .18s; }
button, input, textarea, select { border-radius: 9px; }
button { border: 0; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
p { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #86b887; outline-offset: 4px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px #17635316; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; clip: rect(0,0,0,0); overflow: hidden; white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 12px; z-index: 100; padding: 12px 20px; background: var(--green); color: white; border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.eyebrow, .nav-caption { display: block; color: var(--green); font-size: 10px; font-weight: 750; letter-spacing: 1.6px; line-height: 1.5; }
.muted { color: var(--muted); }

/* Navigation */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar); display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fdfefb; }
.brand { flex-shrink: 0; display: flex; align-items: center; gap: 10px; min-height: 102px; padding: 23px 22px; }
.brand-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 39px; height: 43px; border-radius: 12px 12px 12px 4px; color: #f0f3da; background: var(--green); transform: rotate(-5deg); }
.brand-icon svg { transform: rotate(5deg); }
.brand > span:last-child { color: #253f33; font-size: 21px; font-weight: 750; line-height: 1.05; letter-spacing: -1px; }
.brand > span:last-child > span { color: var(--green); font-weight: 400; }
.brand small { display: block; margin-top: 9px; color: var(--muted); font-size: 7px; font-weight: 650; letter-spacing: 1.9px; }
.sidebar-content { flex: 1; min-height: 0; overflow-y: auto; padding: 17px 15px 22px; scrollbar-width: thin; scrollbar-color: #d2ddcf transparent; }
.nav-caption { margin: 0 12px 15px; color: #899187; font-size: 9px; letter-spacing: 1.65px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 46px; margin-bottom: 6px; padding: 11px 13px; border-radius: 9px; color: #6b776f; font-size: 12px; font-weight: 550; }
.nav-link.active { background: #eaf1e9; color: var(--green); font-weight: 750; }
.nav-link.active svg { stroke-width: 1.9; }
.nav-link:hover, .topic-link:hover { background: #f0f4eb; color: var(--green); }
.topic-caption { margin-top: 33px; margin-bottom: 12px; }
.topic-link { display: flex; align-items: center; gap: 12px; padding: 7px 13px; border-radius: 8px; color: #758075; font-size: 11px; }
.topic-link span { color: #a1afa0; font-size: 16px; font-weight: 400; }
.sidebar-note { margin: 27px 5px 12px; padding: 17px 15px 18px; background: #f0f2e7; border: 1px solid #e7ebd9; border-radius: 11px; }
.small-star { display: block; color: #688464; font-size: 23px; line-height: 1; margin-bottom: 12px; }
.sidebar-note h3 { margin-bottom: 7px; font: 17px/1.2 var(--serif); }
.sidebar-note p { margin-bottom: 13px; color: #7b8677; font-size: 10px; line-height: 1.8; }
.sidebar-note a { display: flex; align-items: center; justify-content: space-between; color: var(--green); font-size: 11px; font-weight: 700; }
.account-links { display: grid; margin: 22px 10px 0; padding-top: 17px; border-top: 1px solid var(--line); }
.account-links a, .account-links button { text-align: left; color: #6c786e; background: transparent; padding: 7px 0; font-size: 11px; }
.account-links a:hover, .account-links button:hover { color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.sidebar-profile { flex-shrink: 0; display: flex; align-items: center; gap: 9px; min-height: 79px; padding: 18px 20px; border-top: 1px solid var(--line); background: #fdfefb; }
.sidebar-profile > span:nth-child(2) { flex: 1; min-width: 0; }
.sidebar-profile strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; font-weight: 700; }
.sidebar-profile small { display: block; color: #929a8f; font-size: 9px; margin-top: 3px; }
.sidebar-profile > svg { width: 13px; color: #8d9889; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: #e9eddf; color: #6a7b55; font-family: var(--serif); font-size: 17px; font-weight: 500; text-transform: uppercase; }
.main-wrapper { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 28px; min-height: 82px; padding: 17px 37px; border-bottom: 1px solid var(--line); background: #fafbf7f2; backdrop-filter: blur(14px); }
.topbar-title { color: #5d6c61; font-size: 12px; font-weight: 650; white-space: nowrap; }
.search-box { display: flex; align-items: center; gap: 11px; width: min(410px, 45%); margin-left: auto; padding: 0 12px; border: 1px solid #e7ebdf; border-radius: 8px; background: #f3f5ee; color: #98a08f; }
.search-box:focus-within { border-color: #96b49a; box-shadow: 0 0 0 3px #17635309; }
.search-box input { min-width: 0; width: 100%; height: 40px; padding: 0; border: 0; background: transparent; font-size: 10px; box-shadow: none; outline: 0; }
.search-box input:focus-visible { box-shadow: none; }
.search-box button { flex-shrink: 0; padding: 5px; background: transparent; color: #87917f; }
.write-button, .outline-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 11px 18px; border: 1px solid transparent; border-radius: 7px; color: white; background: var(--green); font-size: 11px; font-weight: 650; line-height: 1.5; white-space: nowrap; }
.write-button:hover { color: white; background: var(--green-deep); box-shadow: 0 3px 8px #17635312; }
.outline-button { background: transparent; color: var(--green); border-color: #bacdbb; }
.outline-button:hover { background: var(--green-soft); border-color: var(--green); }
.inline-button { width: fit-content; }
.menu-button { display: none; align-items: center; justify-content: center; flex: 0 0 38px; width: 38px; height: 40px; background: transparent; }

/* Feed */
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 272px; align-items: start; gap: 32px; max-width: 1196px; margin: 0 auto; padding: 37px 37px 70px; }
.feed { min-width: 0; }
.feed-heading { padding: 4px 0 23px; }
.feed-heading .eyebrow { margin-bottom: 11px; font-size: 9px; letter-spacing: 2px; }
.feed-heading h1 { margin: 0 0 10px; font: 400 clamp(30px, 2.7vw, 43px)/1.2 var(--serif); letter-spacing: -1.3px; }
.feed-heading h1 > span { color: #79986a; }
.feed-heading > p:last-child { margin-bottom: 0; color: #859080; font-size: 11px; }
.compose-box { display: grid; grid-template-columns: 37px minmax(0,1fr) 30px; align-items: center; gap: 11px; margin: 0 0 20px; padding: 17px 20px 12px; background: white; border: 1px solid var(--line); border-radius: 11px; transition: border-color .18s, box-shadow .18s; }
.compose-box:hover { border-color: #b5c9b1; box-shadow: 0 3px 16px #29492b04; }
.compose-avatar { width: 34px; height: 34px; font: 10px var(--sans); text-transform: none; background: #f0efe6; color: #a09a7e; }
.compose-box > span:nth-child(2) { color: #a0a797; font-size: 12px; }
.compose-plus { display: grid; place-items: center; width: 27px; height: 27px; background: #f2f5ec; border-radius: 6px; color: #94a18a; }
.compose-plus svg { width: 17px; }
.compose-types { grid-column: 1 / -1; display: flex; align-items: center; gap: 23px; margin-top: 3px; padding-top: 12px; border-top: 1px solid #eff1eb; color: #829077; font-size: 9px; }
.compose-types > span { display: inline-flex; align-items: center; gap: 6px; }
.compose-types > span:first-child svg { color: #ae9469; }
.compose-types > span:last-child svg { color: #8b90a9; }
.feed-filters { display: flex; align-items: center; gap: 21px; margin: 0 0 20px; padding: 0 2px; border-bottom: 1px solid var(--line); }
.feed-filters a { position: relative; display: inline-flex; align-items: center; min-height: 41px; padding: 0 1px 6px; color: #8a9282; font-size: 10px; font-weight: 550; white-space: nowrap; }
.feed-filters a.selected { color: var(--green); font-weight: 750; }
.feed-filters a.selected::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--green); content: ""; }
.feed-filters a:hover { color: var(--green); }
.post-card { margin-bottom: 20px; padding: 23px 23px 0; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 3px 8px #253c3302; }
.post-byline { display: flex; align-items: center; gap: 9px; margin-bottom: 19px; }
.post-byline > div { min-width: 0; flex: 1; }
.author-name { display: block; width: fit-content; color: #415143; font-size: 11px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.author-name:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.post-byline small { display: flex; gap: 6px; align-items: center; margin-top: 3px; color: #949c8e; font-size: 9px; }
.kind-badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 4px 8px; border: 1px solid #e1ead9; border-radius: 5px; color: #738363; background: #f2f6ec; font-size: 8px; font-weight: 550; line-height: 1.5; white-space: nowrap; }
.kind-badge.short { color: #9c854c; border-color: #eee6cf; background: #faf7eb; }
.kind-badge.long { color: #66866f; border-color: #dfebdf; background: #f0f6ed; }
.kind-badge.study { color: #827596; border-color: #e8e2ef; background: #f5f2f8; }
.post-preview { display: flex; align-items: flex-start; gap: 23px; }
.post-preview > div { flex: 1; min-width: 0; }
.post-topic { display: block; margin-bottom: 7px; color: #919a80; font-size: 8px; font-weight: 650; letter-spacing: 1.2px; text-transform: uppercase; }
.post-preview h2 { margin-bottom: 9px; color: #263d30; font: 400 25px/1.26 var(--serif); letter-spacing: -.45px; overflow-wrap: anywhere; }
.post-preview:hover h2 { color: var(--green); }
.post-preview p { margin-bottom: 14px; color: #87917e; font-size: 11px; line-height: 1.8; }
.post-preview > img { flex: 0 0 142px; width: 142px; height: 165px; border-radius: 7px; object-fit: cover; background: #e6ebdf; }
.read-time { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: #a0a692; font-size: 8px; }
.read-time > svg { width: 12px; margin-left: -2px; }
.read-time > span { color: #c0c6b7; }
.attachment { display: flex; align-items: center; gap: 11px; margin-top: 18px; padding: 12px 13px; border: 1px solid #e8e4ee; border-radius: 7px; background: #f8f7fa; color: #8b7f9e; }
.attachment > span { min-width: 0; flex: 1; }
.attachment strong { display: block; font-size: 10px; font-weight: 600; overflow-wrap: anywhere; }
.attachment small { display: block; margin-top: 2px; font-size: 8px; color: #a49ab1; }
.attachment:hover { border-color: #b2a4c4; }
.post-actions { display: flex; align-items: center; gap: 18px; min-height: 49px; margin-top: 19px; border-top: 1px solid #edf0e7; color: #97a18a; }
.post-actions > button, .post-actions > a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 2px; background: none; font-size: 9px; }
.post-actions .save-action { margin-left: auto; padding-right: 0; }
.post-actions > a:hover, .post-actions > button:hover { color: var(--green); }
[data-action="like"][aria-pressed="true"] { color: #ac6563; }
[data-action="like"][aria-pressed="true"] svg { fill: #f5e6e0; }
[data-action="bookmark"][aria-pressed="true"] { color: var(--green); }
[data-action="bookmark"][aria-pressed="true"] svg { fill: #e1ebd9; }
.pagination { display: flex; justify-content: space-between; gap: 15px; padding-top: 10px; }
.pagination a { padding: 10px 0; color: var(--green); font-size: 11px; font-weight: 650; }
.pagination a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* The margin notes */
.right-rail { min-width: 0; padding-top: 5px; }
.welcome-card { position: relative; overflow: hidden; padding: 26px 22px 27px; border: 1px solid #e0e6c5; border-radius: 12px; background: radial-gradient(ellipse at 110% 110%, #c3d49455, transparent 65%), #eff1d9; }
.welcome-card .eyebrow { position: relative; z-index: 1; margin-bottom: 14px; color: #82916c; font-size: 8px; letter-spacing: 1.5px; }
.welcome-card h2 { position: relative; z-index: 1; margin-bottom: 13px; font: 400 26px/1.24 var(--serif); letter-spacing: -.4px; }
.welcome-card p { position: relative; z-index: 1; max-width: 185px; margin-bottom: 19px; font-size: 10px; line-height: 1.85; color: #81916f; }
.welcome-card a { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #687d48; font-size: 9px; font-weight: 650; }
.welcome-card a:hover { color: var(--green); }
.welcome-stamp { position: absolute; right: -9px; bottom: 18px; color: #dbe3b6; font: 400 94px/1 var(--serif); letter-spacing: -12px; transform: rotate(-12deg); pointer-events: none; }
.rail-section { margin-top: 29px; }
.rail-section h2 { margin-bottom: 13px; font-size: 12px; font-weight: 700; }
.explore-row { display: flex; align-items: center; gap: 10px; min-height: 69px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.explore-number { align-self: flex-start; width: 20px; padding-top: 3px; color: #b2bba5; font: 18px/1 var(--serif); }
.explore-row > span:nth-child(2) { flex: 1; min-width: 0; }
.explore-row strong { display: block; color: #67785b; font-size: 10px; font-weight: 650; }
.explore-row small { display: block; margin-top: 4px; color: #9ba38f; font-size: 8px; }
.explore-row > svg { color: #a6b098; }
.explore-row:hover strong, .explore-row:hover > svg { color: var(--green); }
.writing-prompt { position: relative; margin-top: 28px; padding: 22px 20px 21px; border: 1px solid #e3e7d9; border-radius: 11px; background: #f0f3e9; }
.prompt-icon { display: block; width: fit-content; margin-bottom: 15px; color: #93a375; }
.writing-prompt .eyebrow { color: #99a284; font-size: 7px; letter-spacing: 1.4px; margin-bottom: 10px; }
.writing-prompt h3 { margin-bottom: 10px; font: italic 22px/1.32 var(--serif); color: #6d7d59; letter-spacing: -.3px; }
.writing-prompt p { margin-bottom: 17px; color: #929d82; font-size: 9px; }
.writing-prompt a { display: flex; align-items: center; justify-content: space-between; font-size: 9px; color: #76895a; font-weight: 650; }
.writing-prompt a:hover { color: var(--green); }
.rail-footer { display: flex; flex-wrap: wrap; gap: 4px 13px; margin-top: 28px; color: #a0a68f; font-size: 8px; }
.rail-footer a { padding: 3px 0; }
.rail-footer a:hover { color: var(--green); }
.rail-footer p { flex: 0 0 100%; margin: 13px 0 0; }
.rail-footer > span { display: block; color: #b4baa6; }

/* Reading and supporting pages */
.reading-layout, .editor-layout, .profile-layout { width: calc(100% - 80px); max-width: 760px; margin: 0 auto; padding: 40px 0 90px; }
.reading-layout > h1, .editor-layout > h1, .profile-layout > h1 { margin: 14px 0 18px; color: #263f31; font: 400 clamp(32px, 3.5vw, 49px)/1.16 var(--serif); letter-spacing: -1.3px; overflow-wrap: anywhere; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 30px; font-size: 10px; color: #8d9885; }
.breadcrumbs > span { color: #b6bfac; }
.breadcrumbs a:hover { color: var(--green); }
.reading-layout > .kind-badge { padding: 5px 9px; font-size: 9px; }
.reading-excerpt { margin-bottom: 24px; color: #89947f; font-size: 16px; line-height: 1.8; }
.reading-byline { display: flex; align-items: center; gap: 11px; margin: 27px 0; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.reading-byline > .avatar { width: 40px; height: 40px; flex-basis: 40px; }
.reading-byline > span:nth-child(2) { min-width: 0; }
.reading-byline > span > a { color: #526447; font-size: 11px; font-weight: 700; }
.reading-byline small { display: block; margin-top: 3px; color: #959f8a; font-size: 10px; }
.edit-link { margin-left: auto; color: var(--green); font-size: 11px; font-weight: 600; white-space: nowrap; }
.edit-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.reading-cover { width: 100%; max-height: 460px; margin-bottom: 29px; border-radius: 12px; object-fit: cover; }
.reading-body { color: #46503f; font-family: var(--serif); font-size: 19px; line-height: 1.95; overflow-wrap: anywhere; }
.reading-body[lang="hi"] { font-family: var(--sans); font-size: 18px; line-height: 2; }
.reading-body p { margin: 0 0 1.4em; }
.reading-body h1, .reading-body h2, .reading-body h3, .reading-body h4 { margin: 1.7em 0 .7em; color: #2b4434; font-family: var(--serif); font-weight: 500; line-height: 1.35; letter-spacing: -.3px; }
.reading-body h1 { font-size: 1.65em; }
.reading-body h2 { font-size: 1.45em; }
.reading-body h3 { font-size: 1.25em; }
.reading-body h4 { font-size: 1.1em; }
.reading-body img { width: auto; height: auto; max-height: 750px; margin: 24px auto; border-radius: 9px; object-fit: contain; }
.reading-body a, .prose-page p a { color: var(--green); text-decoration: underline; text-decoration-color: #a6b995; text-underline-offset: 4px; }
.reading-body a:hover, .prose-page p a:hover { text-decoration-color: var(--green); }
.reading-body ul, .reading-body ol { padding-left: 1.5em; margin-bottom: 1.5em; }
.reading-body li { padding-left: .2em; margin-bottom: .35em; }
.reading-body blockquote { margin: 28px 0; padding: 12px 24px; border-left: 3px solid #a1b78d; background: #edf2e7; color: #5b6c4b; font-style: italic; }
.reading-body blockquote p:last-child { margin-bottom: 0; }
.reading-body pre { max-width: 100%; padding: 20px; border: 1px solid var(--line); border-radius: 9px; overflow-x: auto; background: #eef1e9; font: 12px/1.8 ui-monospace, monospace; }
.reading-body code { padding: 2px 4px; border-radius: 3px; background: #eef1e9; font: .8em ui-monospace, monospace; }
.reading-body pre code { padding: 0; font-size: inherit; }
.reading-body table { display: block; max-width: 100%; margin: 25px 0; overflow-x: auto; border-collapse: collapse; font: 12px/1.7 var(--sans); }
.reading-body td, .reading-body th { padding: 12px 15px; border: 1px solid var(--line); text-align: left; min-width: 110px; }
.reading-body th { background: #edf2e7; font-weight: 700; }
.reading-body hr { margin: 35px auto; border: 0; border-top: 1px solid var(--line); width: 65%; }
.download-card { display: flex; align-items: center; gap: 15px; padding: 20px; margin: 28px 0; border: 1px solid #ddd9e9; border-radius: 11px; background: #f2f0f6; color: #817390; }
.download-card > span:nth-child(2) { flex: 1; min-width: 0; font-size: 10px; }
.download-card strong { display: block; margin-top: 4px; color: #5f5271; font-size: 12px; overflow-wrap: anywhere; }
.download-card > span:last-child { font-size: 24px; }
.download-card:hover { border-color: #afa2c0; }
.reading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 22px 0; margin-top: 29px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.reading-actions > button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 14px; border: 1px solid #dee6d5; color: #6b7d59; background: #fafbf7; font-size: 11px; }
.reading-actions > button:hover { background: #edf2e6; border-color: #bbccae; }
.reading-actions > button:last-child { margin-left: auto; border-color: transparent; background: transparent; }
.comments-section { margin-top: 35px; }
.comments-section h2 { display: flex; align-items: center; gap: 11px; font: 27px/1.4 var(--serif); }
.comments-section h2 span { font: 11px var(--sans); color: #97a189; }
.comments-section form { margin: 22px 0 28px; }
.comments-section form .write-button { margin-top: 11px; }
.comments-section > p { color: #89967c; font-size: 12px; }
.comments-section > p a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.comment { display: flex; align-items: flex-start; gap: 12px; padding: 21px 0; border-top: 1px solid var(--line); }
.comment > div { flex: 1; min-width: 0; }
.comment strong { color: #4d6141; font-size: 11px; }
.comment small { margin-left: 10px; color: #9ca78e; font-size: 9px; }
.comment p { margin: 7px 0 0; color: #768569; font-size: 12px; line-height: 1.85; }
.prose-page > h2 { margin: 35px 0 10px; font: 28px/1.4 var(--serif); }
.prose-page > p { color: #77856b; font-size: 15px; line-height: 1.95; }
.prose-page > .write-button { margin-top: 15px; }
.empty-state { padding: 45px 25px; text-align: center; border: 1px dashed #d6deca; border-radius: 12px; background: #f5f7ef; }
.empty-state > svg { margin-bottom: 18px; color: #9baa87; }
.empty-state h2 { margin-bottom: 12px; font: 29px/1.3 var(--serif); color: #536a42; }
.empty-state p { max-width: 370px; margin: 0 auto 23px; color: #8b977b; font-size: 12px; line-height: 1.9; }
main.empty-state { margin-top: 60px; margin-bottom: 70px; }
main.empty-state > h1 { margin-top: 0; }
.empty-state .inline-button { margin: 0 auto; }

/* Writing, account forms, and feedback */
label { display: block; color: #586d48; font-size: 11px; font-weight: 650; }
input:not([type="hidden"]), select, textarea { display: block; width: 100%; padding: 12px 13px; border: 1px solid #dde5d3; background: #fdfefb; color: #344d29; font-size: 12px; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #a4af98; opacity: 1; }
input:not([type="hidden"]), select { min-height: 45px; }
textarea { min-height: 105px; resize: vertical; }
label > input, label > textarea, label > select { margin-top: 7px; }
select { cursor: pointer; }
input[type="file"] { padding: 8px; font-size: 10px; background: white; }
input::file-selector-button { margin-right: 12px; padding: 7px 10px; border: 0; border-radius: 5px; background: #eaf1e1; color: #607b4b; font: inherit; cursor: pointer; }
.search-box input { min-height: 0; padding: 0; border: 0; background: transparent; color: #5e7053; font-size: 10px; }
.editor-layout { max-width: 800px; }
.editor-layout > .eyebrow, .profile-layout > .eyebrow { margin-bottom: 12px; }
.editor-layout > h1 { margin-top: 0; }
.editor-layout > .muted, .profile-layout > .muted { font-size: 12px; }
.editor-form { margin-top: 30px; padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.editor-form > label { margin-top: 21px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.title-input { font: 23px/1.5 var(--serif) !important; padding-top: 11px !important; padding-bottom: 11px !important; }
.story-textarea { min-height: 350px; font: 17px/1.9 var(--serif); }
.editor-count { text-align: right; margin: 8px 0 18px; color: #a0ac94; font-size: 9px; }
.upload-field { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 19px; padding: 20px; border: 1px dashed #ced9c3; border-radius: 9px; background: #f6f8f1; }
.upload-field > svg { color: #93a780; }
.upload-field > span { flex: 1; min-width: 160px; }
.upload-field small { display: block; margin-top: 5px; color: #96a58a; font-size: 9px; font-weight: 400; line-height: 1.7; }
.upload-field input { flex-basis: 100%; margin-top: 7px; }
.upload-field > small { width: 100%; overflow-wrap: anywhere; }
.form-note { margin: 22px 0 0; color: #97a38a; font-size: 10px; line-height: 1.9; }
.form-note a { color: #6b8653; text-decoration: underline; text-underline-offset: 3px; }
.editor-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 11px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.notice { padding: 13px 16px; margin: 18px 0; border: 1px solid #e7dcbf; border-radius: 8px; background: #fbf7eb; color: #8a7544; font-size: 11px; line-height: 1.8; }
.auth-layout { width: calc(100% - 50px); max-width: 440px; margin: 65px auto 90px; padding: 35px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 15px 55px #26431d06; text-align: center; }
.auth-layout > .brand-icon { width: 45px; height: 49px; margin-bottom: 21px; }
.auth-layout > .eyebrow { color: #8ca176; font-size: 8px; letter-spacing: 2px; margin-bottom: 12px; }
.auth-layout > h1 { margin-bottom: 12px; color: #315127; font: 35px/1.18 var(--serif); letter-spacing: -.8px; }
.auth-layout > p { color: #99a58e; font-size: 11px; }
.auth-layout form { display: grid; gap: 17px; margin-top: 26px; text-align: left; }
.auth-layout form .write-button { margin-top: 5px; }
.auth-layout .notice { margin: 0; }
.auth-layout .auth-switch { margin: 22px 0 0; font-size: 10px; }
.auth-switch a { color: var(--green); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.profile-layout > .inline-button { margin: 12px 0 29px; }
.writing-list { display: grid; gap: 17px; }
.writing-row { padding: 24px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.writing-row h2 { margin: 13px 0 10px; font: 26px/1.3 var(--serif); }
.writing-row h2 a:hover { color: var(--green); }
.writing-row > p { margin-bottom: 17px; color: #8a997d; font-size: 11px; }
.writing-row > a { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: 10px; font-weight: 600; }
#moderation-list { display: grid; gap: 18px; margin-top: 28px; color: #869a77; font-size: 12px; }
#moderation-list > article, #moderation-list > section, #moderation-list > div:not(.empty-state) { padding: 23px; border: 1px solid var(--line); border-radius: 11px; background: white; }
#moderation-list h2, #moderation-list h3 { font: 24px/1.3 var(--serif); color: #456338; }
#moderation-list a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
#moderation-list button { min-height: 40px; margin: 7px 8px 0 0; padding: 9px 12px; background: #edf3e7; color: var(--green); font-size: 10px; }
#moderation-list button:hover { background: #dee9d5; }
#moderation-list .danger, #moderation-list [data-action="remove"] { color: #a6614b; background: #faefe8; }

/* Modal and mobile navigation */
dialog { position: fixed; width: min(440px, calc(100% - 36px)); max-height: calc(100svh - 48px); padding: 31px; border: 1px solid #dce5d3; border-radius: 16px; background: #fdfefb; color: var(--ink); overflow-y: auto; box-shadow: 0 24px 90px #102c2440; }
dialog::backdrop { background: #152b24a3; backdrop-filter: blur(3px); }
dialog h2 { padding-right: 30px; margin-bottom: 11px; font: 29px/1.2 var(--serif); }
dialog > p { margin-bottom: 22px; color: #8b9980; font-size: 11px; line-height: 1.85; }
dialog form > .write-button { margin-top: 18px; }
.dialog-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 37px; height: 37px; background: transparent; color: #8c9c7d; font-size: 25px; line-height: 1; }
.dialog-close:hover { background: #edf2e7; color: var(--green); }
#toast { position: fixed; z-index: 100; bottom: 28px; left: calc(50% + var(--sidebar) / 2); max-width: min(420px, calc(100% - 35px)); transform: translate(-50%, 8px); padding: 13px 21px; border: 1px solid #427b58; border-radius: 9px; background: #1a523d; color: #f1f6e7; box-shadow: 0 9px 35px #193a2625; font-size: 12px; text-align: center; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; }
#toast.show, #toast.visible, #toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
#toast:empty { display: none; }
.mobile-shade { display: none; }

@media (min-width: 1600px) {
  .content-grid { max-width: 1320px; grid-template-columns: minmax(0,1fr) 294px; gap: 42px; padding: 48px 48px 80px; }
  .post-card { padding: 27px 28px 0; }
  .post-preview > img { flex-basis: 178px; width: 178px; height: 183px; }
  .post-preview h2 { font-size: 29px; }
  .post-preview p { font-size: 12px; }
  .topbar { padding-right: 48px; padding-left: 48px; }
}

@media (max-width: 1200px) {
  :root { --sidebar: 210px; }
  .brand { padding-left: 17px; padding-right: 15px; gap: 8px; }
  .brand > span:last-child { font-size: 20px; }
  .topbar { gap: 20px; padding-right: 25px; padding-left: 25px; }
  .content-grid { padding-right: 25px; padding-left: 25px; gap: 24px; grid-template-columns: minmax(0,1fr) 240px; }
  .post-card { padding: 20px 19px 0; }
  .post-preview { gap: 16px; }
  .post-preview > img { flex-basis: 120px; width: 120px; height: 150px; }
  .post-preview h2 { font-size: 23px; }
  .welcome-card { padding: 23px 18px; }
  .welcome-card h2 { font-size: 24px; }
  .writing-prompt { padding: 21px 17px; }
}

@media (max-width: 1070px) {
  .content-grid { grid-template-columns: minmax(0,1fr); max-width: 780px; }
  .right-rail { display: none; }
  .feed-heading h1 { font-size: 40px; }
  .post-preview > img { flex-basis: 155px; width: 155px; height: 170px; }
  .post-preview h2 { font-size: 27px; }
  .topbar-title { display: none; }
  .search-box { margin-left: 0; margin-right: auto; width: min(430px, 65%); }
  .reading-layout, .editor-layout, .profile-layout { width: calc(100% - 54px); }
}

@media (max-width: 780px) {
  :root { --sidebar: 250px; }
  html { scroll-padding-top: 90px; }
  .sidebar { transform: translateX(-101%); transition: transform .22s ease; box-shadow: 16px 0 45px #183a251c; }
  .sidebar.open, .sidebar.is-open, body.nav-open .sidebar { transform: translateX(0); }
  .sidebar .brand { min-height: 95px; padding-left: 23px; }
  .sidebar .brand > span:last-child { font-size: 23px; }
  .sidebar .brand-icon { width: 43px; height: 46px; }
  .sidebar-content { padding-top: 13px; }
  .nav-link { min-height: 47px; font-size: 13px; }
  .topic-link { font-size: 12px; min-height: 37px; }
  .account-links a, .account-links button { min-height: 39px; font-size: 12px; }
  .sidebar-profile strong { font-size: 11px; }
  .sidebar-profile small { font-size: 10px; }
  .mobile-shade:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 35; background: #152c2694; backdrop-filter: blur(2px); }
  body.nav-open { overflow: hidden; }
  .main-wrapper { margin-left: 0; }
  .topbar { min-height: 71px; gap: 13px; padding: 14px 20px; }
  .menu-button { display: flex; }
  .search-box { flex: 1; width: auto; margin-right: auto; max-width: none; }
  .search-box input { font-size: 11px; }
  .topbar > .write-button { font-size: 10px; padding: 10px 13px; }
  .content-grid { padding: 30px 24px 55px; max-width: 730px; }
  .feed-heading { padding-bottom: 24px; }
  .feed-heading h1 { font-size: clamp(32px, 6vw, 42px); }
  .feed-heading > p:last-child { font-size: 12px; }
  .compose-box { padding-top: 18px; padding-bottom: 14px; }
  .compose-types { font-size: 10px; }
  .feed-filters { gap: 25px; }
  .feed-filters a { font-size: 11px; min-height: 45px; }
  .post-card { padding: 22px 22px 0; }
  .post-byline { margin-bottom: 18px; }
  .author-name { font-size: 12px; }
  .post-byline small { font-size: 10px; }
  .kind-badge { font-size: 9px; }
  .post-preview p { font-size: 12px; }
  .read-time { font-size: 9px; }
  .post-actions { gap: 23px; }
  .post-actions > button, .post-actions > a { min-height: 48px; font-size: 10px; }
  .reading-layout, .editor-layout, .profile-layout { width: calc(100% - 48px); max-width: 690px; padding-top: 32px; }
  .reading-layout > h1, .editor-layout > h1, .profile-layout > h1 { font-size: clamp(33px, 6vw, 45px); }
  .reading-byline > span > a { font-size: 12px; }
  .reading-byline small { font-size: 11px; }
  .reading-body { font-size: 19px; }
  .editor-form { padding: 23px; }
  input:not([type="hidden"]), select, textarea { font-size: 16px; }
  .search-box input { font-size: 12px; }
  label { font-size: 12px; }
  .field-grid { gap: 11px; }
  .field-grid select { font-size: 13px; padding-left: 10px; }
  .auth-layout { margin-top: 40px; }
  #toast { left: 50%; bottom: 20px; }
}

@media (max-width: 480px) {
  .topbar { gap: 7px; padding: 12px 13px; min-height: 68px; }
  .menu-button { flex-basis: 33px; width: 33px; }
  .search-box { gap: 7px; padding: 0 9px; }
  .search-box > svg { width: 15px; }
  .search-box input { height: 38px; font-size: 10px; }
  .search-box button { display: none; }
  .topbar > .write-button { gap: 5px; padding: 10px 9px; font-size: 9px; }
  .topbar > .write-button svg { width: 14px; }
  .content-grid { padding: 27px 16px 45px; }
  .feed-heading .eyebrow { font-size: 8px; }
  .feed-heading h1 { max-width: 330px; margin-bottom: 11px; font-size: 35px; line-height: 1.18; letter-spacing: -.9px; }
  .feed-heading > p:last-child { font-size: 11px; }
  .compose-box { padding: 14px 14px 12px; grid-template-columns: 32px minmax(0,1fr) 25px; gap: 9px; }
  .compose-avatar { width: 31px; height: 31px; }
  .compose-box > span:nth-child(2) { font-size: 11px; }
  .compose-types { justify-content: space-between; gap: 9px; font-size: 8px; }
  .compose-types > span { gap: 4px; }
  .compose-types svg { width: 13px; }
  .feed-filters { gap: 0; justify-content: space-between; padding: 0; margin-bottom: 17px; }
  .feed-filters a { font-size: 10px; }
  .post-card { padding: 17px 16px 0; margin-bottom: 16px; }
  .post-byline { gap: 8px; margin-bottom: 17px; flex-wrap: wrap; }
  .post-byline .avatar { flex-basis: 31px; width: 31px; height: 31px; font-size: 16px; }
  .author-name { font-size: 11px; }
  .post-byline small { gap: 5px; font-size: 8px; }
  .kind-badge { padding: 4px 6px; gap: 3px; font-size: 7px; }
  .kind-badge svg { width: 11px; }
  .post-preview { gap: 13px; }
  .post-preview h2 { font-size: 23px; line-height: 1.24; }
  .post-preview p { font-size: 11px; line-height: 1.75; }
  .post-preview > img { flex-basis: 87px; width: 87px; height: 124px; margin-top: 1px; border-radius: 6px; }
  .post-topic { font-size: 7px; letter-spacing: 1px; }
  .read-time { font-size: 8px; gap: 5px; }
  .post-actions { margin-top: 17px; gap: 21px; }
  .post-actions > button, .post-actions > a { min-height: 45px; }
  .post-actions svg { width: 17px; }
  .attachment { padding: 11px; }
  .attachment strong { font-size: 9px; }
  .reading-layout, .editor-layout, .profile-layout { width: calc(100% - 36px); padding-top: 25px; padding-bottom: 55px; }
  .reading-layout > h1, .editor-layout > h1, .profile-layout > h1 { font-size: 35px; letter-spacing: -.9px; }
  .reading-excerpt { font-size: 14px; line-height: 1.8; }
  .breadcrumbs { margin-bottom: 25px; }
  .reading-byline { gap: 9px; flex-wrap: wrap; }
  .reading-byline small { font-size: 9px; }
  .reading-byline .edit-link { font-size: 10px; }
  .reading-body { font-size: 18px; line-height: 1.9; }
  .reading-body[lang="hi"] { font-size: 17px; }
  .reading-body blockquote { padding: 10px 16px; }
  .reading-actions { gap: 7px; }
  .reading-actions > button { min-height: 41px; padding: 9px 10px; font-size: 10px; gap: 6px; }
  .reading-actions > button svg { width: 16px; }
  .comment small { display: block; margin: 2px 0 0; }
  .comments-section h2 { font-size: 26px; }
  .download-card { padding: 16px 13px; gap: 11px; }
  .download-card strong { font-size: 11px; }
  .editor-form { padding: 18px 16px; margin-top: 24px; }
  .field-grid { grid-template-columns: 1fr 1fr; gap: 14px 10px; }
  .field-grid > label:first-child { grid-column: 1 / -1; }
  .field-grid select { font-size: 14px; }
  .story-textarea { min-height: 300px; font-size: 16px; }
  .title-input { font-size: 21px !important; }
  .editor-buttons { justify-content: stretch; }
  .editor-buttons > button { flex: 1; padding-right: 9px; padding-left: 9px; }
  .upload-field { padding: 16px 13px; }
  .auth-layout { width: calc(100% - 36px); margin: 30px auto 55px; padding: 30px 23px; }
  .auth-layout > h1 { font-size: 33px; }
  .auth-layout form { gap: 17px; }
  .writing-row { padding: 20px; }
  .writing-row h2 { font-size: 25px; }
  .empty-state { padding: 34px 19px; }
  .empty-state h2 { font-size: 27px; }
  .empty-state p { font-size: 11px; }
  main.empty-state { margin-top: 30px; }
  dialog { padding: 28px 23px; }
  #toast { font-size: 11px; padding: 12px 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

@media print {
  .sidebar, .topbar, .right-rail, .reading-actions, .comments-section form, .edit-link, #toast, dialog, .mobile-shade { display: none !important; }
  body { background: white; color: black; }
  .main-wrapper { margin: 0; }
  .reading-layout { max-width: none; width: 100%; padding: 0; }
  .reading-body { color: black; font-size: 12pt; }
  .reading-body img { max-height: 600px; break-inside: avoid; }
  .post-card { break-inside: avoid; }
}

/* Preserve the site's original brain-and-headphones logo without pixel changes. */
.sidebar .brand { min-height: 150px; justify-content: center; padding: 15px 18px; }
.original-brand-logo { display: block; width: 180px; max-width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; background: transparent; border-radius: 9px; }
.auth-brand { display: inline-block; margin: 0 auto 22px; }
.auth-brand .original-brand-logo { width: 210px; }
@media (max-width: 780px) { .sidebar .brand { min-height: 150px; padding: 15px 18px; } }

/* A small, always-visible switch; the label and state are supplied by the app. */
.topbar { gap: 18px; }
.topbar .search-box { flex: 1; width: auto; min-width: 130px; max-width: 410px; }
.topbar > .write-button { flex-shrink: 0; }
.theme-toggle { position: relative; display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 10px; border: 1px solid #dce5d5; border-radius: 9px; background: #f2f5ed; color: #536b48; font-size: 11px; font-weight: 650; line-height: 1; }
.theme-toggle:hover { color: var(--green); background: #e8efdf; border-color: #a6bd99; }
.theme-toggle:focus-visible { outline: 3px solid #7fa777; outline-offset: 3px; }
.theme-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; font-size: 20px; line-height: 1; }
.theme-icon > span, .theme-icon > svg { grid-area: 1 / 1; }
.theme-icon svg { width: 19px; height: 19px; }
.theme-toggle[data-tooltip]::after { position: absolute; top: calc(100% + 10px); right: 0; z-index: 50; width: max-content; max-width: 210px; padding: 8px 11px; border: 1px solid #d9e3d0; border-radius: 7px; background: #fff; color: #425739; box-shadow: 0 5px 18px #223d211a; content: attr(data-tooltip); font-size: 10px; font-weight: 500; line-height: 1.5; white-space: normal; opacity: 0; visibility: hidden; transform: translateY(-3px); pointer-events: none; transition: opacity .15s, transform .15s, visibility .15s; }
.theme-toggle[data-tooltip]:hover::after, .theme-toggle[data-tooltip]:focus-visible::after { opacity: 1; visibility: visible; transform: translateY(0); }

/* Guest writing belongs in the same editor as every other voice. */
.guest-notice { margin: 22px 0; padding: 16px 18px; border: 1px solid #dce6ce; border-left: 3px solid #9caf81; border-radius: 9px; background: #eff4e8; color: #61774f; font-size: 12px; line-height: 1.8; }
.guest-notice > :first-child { margin-top: 0; }
.guest-notice > :last-child { margin-bottom: 0; }
.guest-notice strong { color: #3b592c; font-weight: 700; }
.guest-notice p { margin-bottom: 8px; }
.guest-notice a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.guest-badge { display: inline-flex; align-items: center; gap: 4px; width: fit-content; margin-left: 6px; padding: 2px 6px; border: 1px solid #e1e7d7; border-radius: 4px; background: #f2f5ec; color: #748463; font: 500 9px/1.4 var(--sans); vertical-align: middle; white-space: nowrap; }
.post-byline small .guest-badge { margin-left: 0; }
.guest-author { margin: 21px 0; }
.guest-author label { margin-top: 0; }
.guest-author small, .guest-author .field-help { display: block; margin-top: 7px; color: #7e9070; font-size: 10px; font-weight: 400; line-height: 1.7; }

@media screen {
  html[data-theme="dark"] {
    color-scheme: dark;
    --paper: #101713;
    --surface: #19221c;
    --ink: #e1eadd;
    --muted: #a3af9e;
    --green: #92cdb1;
    --green-deep: #b2dec5;
    --green-soft: #263c30;
    --line: #2c392e;
    --cream: #293423;
  }
  html[data-theme="dark"] ::selection { color: #eff8e8; background: #3b634b; }
  html[data-theme="dark"] :focus-visible { outline-color: #b0d396; }
  html[data-theme="dark"] .sidebar,
  html[data-theme="dark"] .sidebar-profile { background: #141d17; border-color: var(--line); }
  html[data-theme="dark"] .sidebar { box-shadow: 12px 0 45px #0000000d; }
  html[data-theme="dark"] .sidebar-content { scrollbar-color: #3b4c3b transparent; }
  html[data-theme="dark"] .topbar { background: #141e18f2; border-color: var(--line); }
  html[data-theme="dark"] :is(.brand, .brand > span:last-child, .sidebar-profile strong, .feed-heading h1, .rail-section h2, .comments-section h2, .writing-row h2, dialog h2) { color: #e1eadd; }
  html[data-theme="dark"] :is(.brand small, .nav-caption, .sidebar-profile small, .sidebar-profile > svg, .topbar-title, .breadcrumbs, .reading-byline small, .post-byline small, .comment small, .comments-section h2 span, .editor-count, .form-note, .auth-layout > p, .auth-layout .auth-switch, .rail-footer, .rail-footer > span) { color: #9dab94; }
  html[data-theme="dark"] :is(.nav-link, .topic-link, .account-links a, .account-links button) { color: #b4c0ac; }
  html[data-theme="dark"] :is(.nav-link.active, .nav-link:hover, .topic-link:hover) { color: #c0dfb3; background: #273828; }
  html[data-theme="dark"] :is(.topic-link span, .small-star, .prompt-icon, .sidebar-note a, .account-links a:hover, .account-links button:hover) { color: #afc99a; }
  html[data-theme="dark"] .sidebar-note { background: #202c1e; border-color: #34432d; }
  html[data-theme="dark"] .sidebar-note h3 { color: #deead2; }
  html[data-theme="dark"] .sidebar-note p { color: #a6b69a; }
  html[data-theme="dark"] .avatar { color: #c1d5ab; background: #32402b; }
  html[data-theme="dark"] .compose-avatar { color: #c9c3a9; background: #3a3d2b; }
  html[data-theme="dark"] :is(.search-box, .compose-plus) { background: #202c22; border-color: #344332; color: #aabda1; }
  html[data-theme="dark"] .search-box:focus-within { border-color: #86ac78; box-shadow: 0 0 0 3px #b2d89215; }
  html[data-theme="dark"] .search-box button { color: #b3c9a8; }
  html[data-theme="dark"] :is(.compose-box, .post-card, .editor-form, .auth-layout, .writing-row) { background: var(--surface); border-color: var(--line); box-shadow: 0 3px 15px #0000000b; }
  html[data-theme="dark"] .compose-box:hover { border-color: #62845b; box-shadow: 0 4px 20px #00000015; }
  html[data-theme="dark"] :is(.compose-box > span:nth-child(2), .feed-heading > p:last-child, .post-preview p, .reading-excerpt, .prose-page > p, .writing-row > p, .comments-section > p, .comment p) { color: #aebba4; }
  html[data-theme="dark"] :is(.compose-types, .feed-filters a, .post-actions, .post-topic, .read-time, .read-time > span, .feed-heading h1 > span) { color: #a0b391; }
  html[data-theme="dark"] :is(.compose-types, .post-actions) { border-color: var(--line); }
  html[data-theme="dark"] .compose-types > span:first-child svg { color: #d2b578; }
  html[data-theme="dark"] .compose-types > span:last-child svg { color: #b5a8d3; }
  html[data-theme="dark"] :is(.feed-filters a.selected, .feed-filters a:hover, .post-actions > a:hover, .post-actions > button:hover, .author-name:hover, .post-preview:hover h2) { color: #b9dda3; }
  html[data-theme="dark"] .feed-filters a.selected::after { background: #a6cd8d; }
  html[data-theme="dark"] .author-name { color: #d0dfc4; }
  html[data-theme="dark"] :is(.post-preview h2, .reading-layout > h1, .editor-layout > h1, .profile-layout > h1, .auth-layout > h1, .prose-page > h2) { color: #e4ecd9; }
  html[data-theme="dark"] .post-preview > img { background: #273421; }
  html[data-theme="dark"] .kind-badge { color: #bad0a3; border-color: #405139; background: #2a3824; }
  html[data-theme="dark"] .kind-badge.short { color: #dbc78e; border-color: #524a2f; background: #383422; }
  html[data-theme="dark"] .kind-badge.long { color: #b3d0a5; border-color: #3c5136; background: #293a27; }
  html[data-theme="dark"] .kind-badge.study { color: #c8b9df; border-color: #4e435c; background: #342d3d; }
  html[data-theme="dark"] :is(.attachment, .download-card) { background: #2a2632; border-color: #443c50; color: #c5b5dc; }
  html[data-theme="dark"] :is(.attachment:hover, .download-card:hover) { border-color: #9a82b6; }
  html[data-theme="dark"] .attachment small { color: #b0a2c4; }
  html[data-theme="dark"] .download-card strong { color: #ddceee; }
  html[data-theme="dark"] [data-action="like"][aria-pressed="true"] { color: #e9a298; }
  html[data-theme="dark"] [data-action="like"][aria-pressed="true"] svg { fill: #653e36; }
  html[data-theme="dark"] [data-action="bookmark"][aria-pressed="true"] { color: #bedc9d; }
  html[data-theme="dark"] [data-action="bookmark"][aria-pressed="true"] svg { fill: #3d5831; }
  html[data-theme="dark"] .welcome-card { background: radial-gradient(ellipse at 110% 110%, #718d3b22, transparent 65%), #283421; border-color: #405035; }
  html[data-theme="dark"] .welcome-card h2 { color: #e1ebca; }
  html[data-theme="dark"] :is(.welcome-card .eyebrow, .welcome-card p) { color: #afbf97; }
  html[data-theme="dark"] .welcome-card a { color: #c0d6a3; }
  html[data-theme="dark"] .welcome-stamp { color: #3d4d2e; }
  html[data-theme="dark"] .explore-number { color: #8ba175; }
  html[data-theme="dark"] .explore-row strong { color: #c3d1b6; }
  html[data-theme="dark"] :is(.explore-row small, .explore-row > svg) { color: #a0b28e; }
  html[data-theme="dark"] .writing-prompt { background: #1e2a1c; border-color: #35482b; }
  html[data-theme="dark"] :is(.writing-prompt .eyebrow, .writing-prompt p) { color: #a4b78f; }
  html[data-theme="dark"] .writing-prompt h3 { color: #cadcb7; }
  html[data-theme="dark"] .writing-prompt a { color: #bbd399; }
  html[data-theme="dark"] :is(.welcome-card a:hover, .explore-row:hover strong, .explore-row:hover > svg, .writing-prompt a:hover, .rail-footer a:hover) { color: #d6ebc2; }
  html[data-theme="dark"] .breadcrumbs > span { color: #819873; }
  html[data-theme="dark"] .reading-byline > span > a { color: #cadbbd; }
  html[data-theme="dark"] .reading-body { color: #c7d2bd; }
  html[data-theme="dark"] :is(.reading-body h1, .reading-body h2, .reading-body h3, .reading-body h4) { color: #e2ecd6; }
  html[data-theme="dark"] .reading-body blockquote { background: #273823; border-color: #95b179; color: #c2d6ad; }
  html[data-theme="dark"] :is(.reading-body pre, .reading-body code) { background: #253121; border-color: #3c4c32; color: #d2e0c0; }
  html[data-theme="dark"] .reading-body th { background: #2a3a25; color: #d6e4c6; }
  html[data-theme="dark"] .reading-body td { background: #172119; color: #c4d3b7; }
  html[data-theme="dark"] :is(.reading-body a, .prose-page p a, .form-note a) { color: #add48c; text-decoration-color: #688953; }
  html[data-theme="dark"] .reading-actions > button { background: #1c291b; border-color: #3b4e30; color: #bed4ab; }
  html[data-theme="dark"] .reading-actions > button:hover { background: #2d4025; border-color: #779661; }
  html[data-theme="dark"] .reading-actions > button:last-child { background: transparent; border-color: transparent; }
  html[data-theme="dark"] .comment strong { color: #d3e1c5; }
  html[data-theme="dark"] label { color: #c6d6b7; }
  html[data-theme="dark"] :is(input:not([type="hidden"]), select, textarea) { color: #e0ead6; background: #111b14; border-color: #43513b; }
  html[data-theme="dark"] :is(input, textarea)::placeholder { color: #95a38b; }
  html[data-theme="dark"] :is(input, textarea, select):focus-visible { border-color: #a1c87f; box-shadow: 0 0 0 3px #9bc47c20; }
  html[data-theme="dark"] :is(input, textarea, select):disabled { color: #8b9a80; background: #1d281b; opacity: .8; }
  html[data-theme="dark"] input:-webkit-autofill { -webkit-text-fill-color: #e0ead6; caret-color: #d5e7c4; box-shadow: 0 0 0 1000px #1c2c1c inset; }
  html[data-theme="dark"] .search-box input { background: transparent; border: 0; color: #dde7d3; box-shadow: none; }
  html[data-theme="dark"] .search-box input:focus-visible { box-shadow: none; }
  html[data-theme="dark"] .upload-field { background: #1e2c1d; border-color: #526b42; }
  html[data-theme="dark"] :is(.upload-field > svg, .upload-field small) { color: #a3b98d; }
  html[data-theme="dark"] input::file-selector-button { color: #cdddba; background: #354d2b; }
  html[data-theme="dark"] input::file-selector-button:hover { background: #456237; }
  html[data-theme="dark"] :is(.write-button, .skip-link) { color: #102319; background: #99cda8; border-color: #99cda8; }
  html[data-theme="dark"] .write-button:hover { color: #102319; background: #b3dfba; border-color: #b3dfba; box-shadow: 0 3px 12px #00000018; }
  html[data-theme="dark"] .outline-button { color: #b5d29d; border-color: #68815a; background: transparent; }
  html[data-theme="dark"] .outline-button:hover { color: #d2e5bf; background: #2d4026; border-color: #9eb788; }
  html[data-theme="dark"] .notice { background: #342e1e; border-color: #605233; color: #dbc796; }
  html[data-theme="dark"] .empty-state { background: #17221a; border-color: #405538; }
  html[data-theme="dark"] .empty-state h2 { color: #d0e0bb; }
  html[data-theme="dark"] :is(.empty-state p, .empty-state > svg) { color: #a7bd93; }
  html[data-theme="dark"] #moderation-list { color: #adbf9c; }
  html[data-theme="dark"] :is(#moderation-list > article, #moderation-list > section, #moderation-list > div:not(.empty-state)) { background: var(--surface); border-color: var(--line); }
  html[data-theme="dark"] :is(#moderation-list h2, #moderation-list h3) { color: #d2e2bf; }
  html[data-theme="dark"] #moderation-list blockquote { margin: 15px 0; padding: 12px 16px; border-left: 2px solid #75945a; background: #233320; color: #bdcfae; }
  html[data-theme="dark"] #moderation-list button { color: #c2dbad; background: #2b3f25; border-color: #587a45; }
  html[data-theme="dark"] #moderation-list button:hover { background: #38532d; }
  html[data-theme="dark"] :is(#moderation-list .danger, #moderation-list [data-action="remove"]) { color: #edb1a0; background: #483027; border-color: #7a4d3c; }
  html[data-theme="dark"] dialog { background: #1a251b; border-color: #405736; color: #e1eadd; box-shadow: 0 24px 90px #00000080; }
  html[data-theme="dark"] dialog::backdrop { background: #030806c9; }
  html[data-theme="dark"] :is(dialog > p, .dialog-close) { color: #adc29b; }
  html[data-theme="dark"] .dialog-close:hover { color: #d4e7bc; background: #2a3e23; }
  html[data-theme="dark"] #toast { color: #e6f0da; background: #29432b; border-color: #648258; box-shadow: 0 8px 30px #00000055; }
  html[data-theme="dark"] .mobile-shade:not([hidden]) { background: #020806b8; }
  html[data-theme="dark"] .theme-toggle { color: #d2ddb0; background: #293722; border-color: #475938; }
  html[data-theme="dark"] .theme-toggle:hover { color: #e3edc4; background: #35472b; border-color: #83a465; }
  html[data-theme="dark"] .theme-toggle[data-tooltip]::after { color: #d9e7c7; background: #253522; border-color: #516744; box-shadow: 0 5px 20px #00000044; }
  html[data-theme="dark"] .guest-notice { color: #b6cba3; background: #243420; border-color: #415a34; border-left-color: #a4bd7c; }
  html[data-theme="dark"] .guest-notice strong { color: #d2e5bd; }
  html[data-theme="dark"] .guest-notice a { color: #c2df9f; }
  html[data-theme="dark"] .guest-badge { color: #b8cba1; background: #2a3a24; border-color: #4c623d; }
  html[data-theme="dark"] :is(.guest-author small, .guest-author .field-help) { color: #a4b891; }
  /* The original image is never recolored, dimmed, cropped, or given a tile. */
  html[data-theme="dark"] .original-brand-logo { background: transparent; }
}

@media (max-width: 780px) {
  html { scroll-padding-top: 145px; }
  .topbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 44px; grid-template-rows: 44px 44px; gap: 10px 11px; min-height: 0; padding: 12px 20px; }
  .topbar .menu-button { grid-area: 1 / 1; width: 44px; height: 44px; }
  .topbar-title { display: block; grid-area: 1 / 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  .topbar > .write-button { grid-area: 1 / 3; min-height: 44px; padding: 10px 13px; font-size: 11px; }
  .topbar > .theme-toggle { grid-area: 1 / 4; width: 44px; height: 44px; padding: 10px; }
  .topbar > .theme-toggle > .theme-label { display: none; }
  .topbar .search-box { grid-area: 2 / 1 / 3 / -1; width: 100%; min-width: 0; max-width: none; margin: 0; padding: 0 12px; gap: 10px; }
  .topbar .search-box input { height: 42px; font-size: 16px; }
  .topbar .search-box button { display: inline-flex; align-items: center; justify-content: center; width: 34px; min-height: 40px; }
  .guest-notice { padding: 15px; font-size: 12px; }
  .guest-badge { font-size: 9px; }
}

@media (max-width: 380px) {
  .topbar { grid-template-columns: 44px minmax(0,1fr) 44px; padding: 11px 14px; }
  .topbar-title { display: none; }
  .topbar > .write-button { grid-area: 1 / 2; justify-self: end; }
  .topbar > .theme-toggle { grid-area: 1 / 3; }
  .topbar .search-box input { font-size: 16px; }
  .post-byline .guest-badge { margin-left: 3px; font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle::after { transition: none; }
}
