/* DLSU-D Thesis Repository. Green and white, light and dark. */
:root {
  --bg: #f3f8f4; --surface: #ffffff; --surface-2: #eaf3ec; --line: #d6e4d9;
  --ink: #10241a; --ink-2: #4a6054;
  --brand: #0a6b3f; --brand-hover: #085832; --brand-ink: #ffffff; --brand-soft: #ddeee3;
  --sidebar: #063f27; --sidebar-ink: #e3f1e8; --sidebar-dim: #9cc2ad;
  --red: #c8332b;
  --ok-bg: #dcf1e3; --ok-ink: #0b5a34;
  --wait-bg: #fdf0c9; --wait-ink: #6b4a00;
  --rev-bg: #e1eaf6; --rev-ink: #264a7a;
  --no-bg: #f9dcd9; --no-ink: #8a1f19;
  --shadow: 0 1px 2px rgba(7, 40, 24, .06), 0 8px 24px rgba(7, 40, 24, .06);
  --font-ui: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-read: "Literata", Georgia, "Times New Roman", serif;
}
[data-theme="dark"] {
  --bg: #0b130f; --surface: #121e17; --surface-2: #182a20; --line: #25392e;
  --ink: #e8f2ec; --ink-2: #9db5a5;
  --brand: #46c487; --brand-hover: #5fd69b; --brand-ink: #05180e; --brand-soft: #163325;
  --sidebar: #08150f; --sidebar-ink: #e3f1e8; --sidebar-dim: #86ab97;
  --red: #ef6a61;
  --ok-bg: #153a28; --ok-ink: #8fe3b6;
  --wait-bg: #3d3210; --wait-ink: #f1d27a;
  --rev-bg: #1b2d47; --rev-ink: #a9c8f2;
  --no-bg: #432120; --no-ink: #f3a6a1;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.55 var(--font-ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-read); line-height: 1.25; margin: 0; letter-spacing: -.005em; }
h1 { font-size: clamp(1.6rem, 2.6vw, 2.15rem); font-weight: 650; }
h2 { font-size: 1.3rem; font-weight: 620; }
h3 { font-size: 1.12rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--brand); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sidebar :focus-visible { outline-color: #9fe8c1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: .86rem; }
kbd { font: inherit; font-size: .8rem; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); }
.ic { flex: none; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stack { display: grid; gap: 14px; }
.stack-lg { display: grid; gap: 36px; }
.grow { flex: 1 1 auto; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.crumb { font-size: .9rem; color: var(--ink-2); margin-bottom: 10px; }
.crumb a { color: var(--ink-2); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 18px 14px; background: var(--sidebar); color: var(--sidebar-ink); z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 10px; text-decoration: none; color: inherit; }
.brand span { display: grid; line-height: 1.15; }
.brand strong { font-family: var(--font-read); font-size: 1.2rem; }
.brand small { color: var(--sidebar-dim); font-size: .82rem; }
.nav { display: grid; gap: 2px; }
.nav hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .12); margin: 8px 6px; width: calc(100% - 12px); }
.nav a, .nav-btn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--sidebar-ink); text-decoration: none; font: 500 .95rem var(--font-ui); background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.nav a:hover, .nav-btn:hover { background: rgba(255, 255, 255, .09); }
.nav a.active { background: rgba(255, 255, 255, .15); box-shadow: inset 3px 0 0 #7be0ac; }
.badge { margin-left: auto; font-style: normal; font-size: .75rem; font-weight: 700; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .2); }
.badge-red { background: #d7433a; color: #fff; }
.sb-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); }
.nav-btn > span, .nav-btn .when-light, .nav-btn .when-dark { display: inline-flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.user-chip:hover { background: rgba(255, 255, 255, .09); }
.user-chip .who { display: grid; line-height: 1.2; min-width: 0; }
.user-chip strong { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { color: var(--sidebar-dim); }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .85rem; flex: none; }
.sidebar .avatar { background: #bfe8d0; color: #063f27; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.content { min-width: 0; }
.main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 40px) 72px; display: grid; gap: 28px; align-content: start; }
.topbar { display: none; position: sticky; top: 0; z-index: 30; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-title { font-family: var(--font-read); font-weight: 650; flex: 1; }
.scrim { display: none; }
.theme-toggle .when-dark, .nav-btn.theme-toggle .when-dark { display: none; }
[data-theme="dark"] .theme-toggle .when-light { display: none; }
[data-theme="dark"] .theme-toggle .when-dark { display: inline-flex; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.theme-toggle .when-light, .theme-toggle .when-dark { align-items: center; }

@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(5, 25, 15, .5); z-index: 35; }
}

/* ---------- Page structure ---------- */
.page-head { display: grid; gap: 10px; justify-items: start; }
.page-head .sub { color: var(--ink-2); max-width: 68ch; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--brand-hover); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; min-width: 0; }
.panel > h2, fieldset.panel > legend { font-family: var(--font-read); font-size: 1.15rem; font-weight: 620; }
fieldset.panel { margin: 0; }
fieldset.panel > legend { padding: 0 6px; }
.empty { padding: 28px; border: 1px dashed var(--line); border-radius: 14px; color: var(--ink-2); display: grid; gap: 6px; justify-items: start; }
.alert { padding: 12px 16px; border-radius: 12px; font-weight: 500; }
.alert-ok { background: var(--ok-bg); color: var(--ok-ink); }
.alert-err { background: var(--no-bg); color: var(--no-ink); }
.validation-summary-valid { display: none; }
.banner { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 14px 18px; border-radius: 12px; }
.banner .quote { width: 100%; }
.st-ok { background: var(--ok-bg); color: var(--ok-ink); }
.st-wait { background: var(--wait-bg); color: var(--wait-ink); }
.st-rev { background: var(--rev-bg); color: var(--rev-ink); }
.st-no { background: var(--no-bg); color: var(--no-ink); }
.status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 650; }
.quote { border-left: 3px solid var(--brand); padding: 2px 0 2px 12px; color: var(--ink-2); margin-top: 6px; }

/* ---------- Buttons and forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: 600 .95rem var(--font-ui); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .88rem; border-radius: 9px; }
.btn-block { width: 100%; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, label.inline { font-weight: 600; font-size: .9rem; }
label.inline { display: inline-flex; align-items: center; gap: 8px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="date"], input:not([type]), select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit;
}
input[type="file"] { width: 100%; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
textarea { resize: vertical; line-height: 1.5; }
label.inline select { width: auto; padding: 6px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.err, .field-validation-error { color: var(--red); font-size: .86rem; font-weight: 500; }
.input-validation-error { border-color: var(--red) !important; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; text-align: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; cursor: pointer; background: var(--surface); }
.seg input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.seg input:disabled + span { opacity: .5; cursor: not-allowed; }
.seg-sm span { padding: 6px 10px; font-size: .88rem; }
.form-wide { display: grid; gap: 18px; max-width: 820px; }
.filter-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
.filter-row select { width: auto; }
.inline-form { display: inline-flex; gap: 12px; }
.new-col { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- Dialogs and menus ---------- */
dialog.dialog { border: 1px solid var(--line); border-radius: 16px; padding: 24px; width: calc(100% - 32px); max-width: 440px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog.dialog::backdrop { background: rgba(5, 25, 15, .55); }
dialog.dialog-lg { max-width: 660px; }
.dialog h2 { margin-bottom: 8px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 18px; }
.dialog-actions .hint { margin-right: auto; }
.terms-scroll { max-height: 48vh; overflow-y: auto; margin-top: 12px; padding: 6px 14px 6px 0; border-block: 1px solid var(--line); line-height: 1.6; }
.terms-scroll h3 { font-size: 1rem; margin: 14px 0 4px; }
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; z-index: 25; top: calc(100% + 8px); left: 0; min-width: 270px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); display: grid; gap: 8px; }
.req-menu { display: block; }
.req-menu .menu-pop { position: static; margin-top: 10px; box-shadow: none; background: var(--surface-2); }
.pick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.pick:hover { background: var(--surface-2); }
.pick .box { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--line); border-radius: 6px; color: transparent; }
.pick.on .box { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* ---------- Home ---------- */
.hero { gap: 12px; }
.greet { color: var(--brand); font-weight: 650; }
.hero h1 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); max-width: 18ch; }
.hero-search, .searchbar { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 760px; padding: 6px 6px 6px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.hero-search:focus-within, .searchbar:focus-within { border-color: var(--brand); }
.hero-search input, .searchbar input { border: 0 !important; outline: 0 !important; box-shadow: none; background: transparent; padding: 10px 4px; }
.hs-icon { color: var(--ink-2); display: inline-flex; }
.searchbar { position: sticky; top: 8px; z-index: 10; max-width: none; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 32px; align-items: start; }
.glance { position: sticky; top: 24px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.glance h2 { font-size: 1.05rem; margin-bottom: 8px; }
.glance-list { list-style: none; margin: 0; padding: 0; }
.glance-list a { display: grid; gap: 0; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.glance-list li:first-child a { border-top: 0; }
.glance-list b { font-family: var(--font-read); font-size: 1.15rem; }
.glance-list span { color: var(--ink-2); font-size: .88rem; }
.glance-list a:hover b { color: var(--brand); }
@media (max-width: 1100px) { .home-grid { grid-template-columns: 1fr; } .glance { position: static; order: -1; } .glance-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 16px; } .glance-list li:first-child a { border-top: 1px solid var(--line); } }

/* College "spines": the one memorable thing. */
.spine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.spine { display: flex; min-height: 136px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px 16px 16px 6px; overflow: hidden; text-decoration: none; color: inherit; animation: shelve .5s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 55ms); transition: transform .18s ease, box-shadow .18s ease; }
.spine:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.spine-code { writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; min-width: 60px; padding: 14px 10px; background: var(--spine); color: #fff; font-family: var(--font-read); font-weight: 700; font-size: 1.45rem; letter-spacing: .08em; border-left: 5px solid rgba(255, 255, 255, .22); }
.spine-body { display: grid; gap: 4px; align-content: center; padding: 14px 16px; min-width: 0; }
.spine-body strong { font-family: var(--font-read); font-size: 1.02rem; line-height: 1.3; }
.spine-body .muted { font-size: .9rem; }
.spine-stats { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; color: var(--ink-2); font-size: .9rem; }
.spine-stats b { color: var(--brand); font-family: var(--font-read); font-size: 1.1rem; }
.spine-stats .gap { width: 12px; }
@keyframes shelve { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Thesis lists ---------- */
.thesis-list { display: grid; gap: 12px; }
.thesis { display: flex; gap: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.thesis:hover { border-color: var(--brand); }
.thesis-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.thesis-main h3 a { color: var(--ink); text-decoration: none; }
.thesis-main h3 a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.thesis-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: .86rem; color: var(--ink-2); }
.tag-college { display: inline-block; padding: 1px 9px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-weight: 700; text-decoration: none; }
.by { color: var(--ink-2); font-size: .94rem; }
.abs { font-family: var(--font-read); font-size: .96rem; line-height: 1.6; color: var(--ink); max-width: 75ch; }
.kw { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { padding: 2px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; color: var(--ink-2); text-decoration: none; background: var(--surface); }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.thesis-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.has-pdf { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.bm { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.bm:hover { border-color: var(--brand); color: var(--brand); }
[data-bookmark-for].is-saved { color: var(--brand); border-color: var(--brand); }
[data-bookmark-for].is-saved svg { fill: currentColor; }
.with-remove { display: grid; gap: 6px; justify-items: start; }
.with-remove .thesis { width: 100%; }
.with-remove form { padding-left: 6px; }
.with-remove .link { font-size: .86rem; font-weight: 500; color: var(--ink-2); }

.browse { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 18px; }
.filters { position: sticky; top: 76px; display: grid; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.results { display: grid; gap: 14px; min-width: 0; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.pager a, .pager span { min-width: 40px; text-align: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--surface); }
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
@media (max-width: 860px) { .browse { grid-template-columns: 1fr; } .filters { position: static; grid-template-columns: 1fr 1fr; } .filters .link { grid-column: 1 / -1; } }

.college-head h1 { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.big-code { font-size: 1.1em; padding: 0 12px; border-radius: 6px; background: var(--brand); color: var(--brand-ink); letter-spacing: .06em; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.course { display: grid; gap: 2px; padding: 16px; border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 6px 14px 14px 6px; background: var(--surface); text-decoration: none; color: inherit; }
.course:hover { border-color: var(--brand); }
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.people li { display: flex; gap: 12px; align-items: center; }

/* ---------- Study details ---------- */
.study-head { display: grid; gap: 10px; }
.study-head h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); max-width: 28ch; }
.actions { margin-top: 6px; }
.reader { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.reader iframe { display: block; width: 100%; height: 82vh; border: 0; background: #fff; }
.study-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.study-body { display: grid; gap: 16px; }
.study-body > h2 { margin-top: 6px; }
.abstract, .prose { font-family: var(--font-read); font-size: 1.08rem; line-height: 1.78; max-width: 68ch; }
.abstract p + p, .prose p + p { margin-top: 1em; }
.study-side { display: grid; gap: 16px; position: sticky; top: 24px; }
.facts { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 12px 0 0; }
.facts dt { color: var(--ink-2); font-size: .82rem; margin-top: 10px; }
.facts dd { margin: 0; font-weight: 500; }
.plain { list-style: none; padding: 0; margin: 0; }
.related { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.related li { display: grid; }
.related a { color: var(--ink); text-decoration: none; font-weight: 500; }
.related a:hover { color: var(--brand); text-decoration: underline; }
@media (max-width: 960px) { .study-grid { grid-template-columns: 1fr; } .study-side { position: static; } }

/* ---------- Rows (submissions, requests, reports) ---------- */
.rows { display: grid; gap: 12px; }
.row-card { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; flex-wrap: wrap; }
.row-card > .grow { display: grid; gap: 4px; }
.row-card.compact { align-items: center; padding: 10px 16px; }
.respond { display: grid; gap: 8px; min-width: 240px; }
section + section { margin-top: 8px; }

/* ---------- Library ---------- */
.lib { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.lib-side { position: sticky; top: 24px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.collections { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.collections a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: var(--ink); }
.collections a:hover { background: var(--surface-2); }
.collections a.on { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.collections em { margin-left: auto; font-style: normal; color: var(--ink-2); font-size: .85rem; }
.lib-main { display: grid; gap: 16px; min-width: 0; }
.lib-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
@media (max-width: 860px) { .lib { grid-template-columns: 1fr; } .lib-side { position: static; } }

/* ---------- Advisers ---------- */
.adviser-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.adviser { display: grid; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.adviser-top { display: flex; gap: 12px; align-items: center; }
.bio { color: var(--ink-2); font-size: .94rem; }
.slots { font-size: .86rem; color: var(--ink-2); display: grid; gap: 6px; }
.slots.full { color: var(--no-ink); }
.meter { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.slots.full .meter i { background: var(--red); }

/* ---------- Forum ---------- */
.communities { display: flex; flex-wrap: wrap; gap: 8px; }
.communities a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink-2); background: var(--surface); font-weight: 600; font-size: .9rem; }
.communities a.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.posts { display: grid; gap: 10px; }
.post-row, .post-full { display: flex; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.post-full { padding: 22px; }
.post-main { flex: 1; min-width: 0; display: grid; gap: 6px; align-content: start; }
.post-row h3 a { color: var(--ink); text-decoration: none; }
.post-row h3 a:hover { color: var(--brand); }
.removed { opacity: .65; }
.votes { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 40px; flex: none; }
.votes b { font-family: var(--font-read); font-size: 1rem; }
.vote { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; }
.vote:hover { background: var(--surface-2); color: var(--brand); }
.vote.on { color: var(--brand); background: var(--brand-soft); }
.vote.down.on { color: var(--red); background: var(--no-bg); }
.votes-sm { width: 32px; }
.votes-sm .vote { width: 26px; height: 26px; }
.thread { display: grid; gap: 16px; }
.comments { display: grid; }
.comment { display: flex; gap: 10px; padding: 14px 0 6px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.comment:target { background: var(--brand-soft); border-radius: 10px; }
.comment-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: flex-start; font-size: .88rem; }
.comment-actions .link, .post-actions .link { font-weight: 500; font-size: .88rem; text-decoration: none; color: var(--ink-2); display: inline-flex; gap: 4px; align-items: center; }
.comment-actions .link:hover, .post-actions .link:hover { color: var(--brand); }
.inline-reply { min-width: 0; }
.inline-reply[open] { flex-basis: 100%; }
.inline-reply > summary { list-style: none; cursor: pointer; }
.inline-reply > summary::-webkit-details-marker { display: none; }
.inline-reply form { margin-top: 8px; }
.replies { margin-top: 6px; padding-left: 14px; border-left: 2px solid var(--line); }
.replies .comment:first-child { border-top: 0; }
.post-actions { margin-top: 8px; gap: 18px; }
.prose { font-size: 1rem; line-height: 1.7; }

/* ---------- Notifications ---------- */
.notes { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.notes li + li { border-top: 1px solid var(--line); }
.notes a { display: flex; align-items: center; gap: 14px; padding: 14px 18px; color: var(--ink); text-decoration: none; }
.notes a:hover { background: var(--surface-2); }
.notes .dot { width: 9px; height: 9px; border-radius: 50%; background: transparent; flex: none; }
.notes .unread .dot { background: var(--red); }
.notes .unread { background: var(--brand-soft); }
.notes .unread a { font-weight: 600; }
.notes time { font-size: .84rem; white-space: nowrap; }

/* ---------- Auth ---------- */
.auth-body { background: var(--surface); }
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: clamp(28px, 5vw, 64px); color: #eaf6ee; overflow: hidden;
  background: radial-gradient(900px 500px at 10% -10%, #137a4a 0%, transparent 60%), linear-gradient(160deg, #053a24 0%, #0a6b3f 100%); }
.auth-art-inner { display: grid; gap: 16px; max-width: 460px; }
.auth-art h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); }
.auth-art p { color: #c9e6d4; font-size: 1.05rem; }
.shelf { display: flex; align-items: flex-end; gap: 6px; height: 260px; }
.shelf span { flex: 1; max-width: 64px; height: var(--h); background: var(--c); writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; padding: 14px 0; border-radius: 4px 4px 0 0; border: 1px solid rgba(255, 255, 255, .16); border-bottom: 0; font-family: var(--font-read); font-weight: 700; letter-spacing: .1em; color: rgba(255, 255, 255, .9); box-shadow: inset 3px 0 0 rgba(255, 255, 255, .12); }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 470px; display: grid; gap: 18px; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.tabs button { flex: 1; padding: 9px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: 600 .95rem var(--font-ui); cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.auth-form { display: grid; gap: 14px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.auth-form[hidden], [hidden] { display: none !important; }
.auth-theme { position: fixed; top: 14px; right: 14px; z-index: 20; }
.center-card { max-width: 460px; margin: 18vh auto; padding: 24px; display: grid; gap: 14px; justify-items: start; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { padding: 28px 22px; gap: 20px; } .shelf { height: 90px; } .shelf span { writing-mode: horizontal-tb; transform: none; padding: 0; font-size: .7rem; } .auth-art p { display: none; } .two { grid-template-columns: 1fr; } }

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