:root {
  --paper: #111111;
  --surface: #050505;
  --ink: #f7f7f7;
  --muted: #a8a8a8;
  --line: #2a2a2a;
  --accent: #f26426;
  --accent-deep: #ff8a5b;
  --shadow: 0 18px 42px rgba(0, 0, 0, .42);
  --sans: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  --serif: var(--sans);
  --ui-font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --paper: #171716; --surface: #222220; --ink: #f3efe6; --muted: #aaa69d;
    --line: #3c3934; --accent: #e25b51; --accent-deep: #ff7a70;
    --shadow: 0 18px 50px rgba(0, 0, 0, .32);
  }
}

html[data-theme="dark"] {
  --paper: #111111; --surface: #050505; --ink: #f7f7f7; --muted: #a8a8a8;
  --line: #2a2a2a; --accent: #f26426; --accent-deep: #ff8a5b;
  --shadow: 0 18px 42px rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--surface); font-family: var(--sans); font-size: var(--ui-font-size); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 99; padding: .7rem 1rem; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.top-header {
  position: sticky;
  top: 0;
  z-index: 45;
  min-height: 82px;
  border-bottom: 1px solid #292929;
  background: rgba(5, 5, 5, .96);
  backdrop-filter: blur(16px);
}
.topbar-inner {
  width: 100%;
  max-width: none;
  min-height: 82px;
  margin: auto;
  padding: 0 clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.top-brand { min-width: 0; display: inline-flex; align-items: center; gap: 12px; color: #f2f2f2; text-decoration: none; }
.top-brand-mark {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 10px;
  position: relative;
  display: grid;
  place-items: center;
  background: #ff6428;
}
.top-brand-mark::before,
.top-brand-mark::after,
.top-brand-mark span {
  content: "";
  position: absolute;
  display: block;
}
.top-brand-mark span {
  width: 29px;
  height: 19px;
  border: 2px solid #fff;
  transform: rotate(-10deg);
}
.top-brand-mark::before {
  width: 20px;
  height: 2px;
  background: #fff;
  transform: translate(-8px, -1px) rotate(28deg);
}
.top-brand-mark::after {
  width: 20px;
  height: 2px;
  background: #fff;
  transform: translate(8px, -1px) rotate(-28deg);
}
.top-brand-copy { min-width: 0; }
.top-brand-copy strong { display: block; font-size: 17px; line-height: 1.25; }
.top-brand-copy small { display: block; margin-top: 3px; color: #999; font-size: 12px; white-space: nowrap; }
.fan-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
}
.reader-font-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 2px;
}
.fan-status .reader-font-button {
  width: 34px;
  min-height: 32px;
  padding: 0;
  font-size: 12px;
  line-height: 1;
}
.fan-status .reader-font-button:disabled {
  opacity: .45;
  cursor: default;
}
.fan-status a,
.fan-status button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}
.login-label-short { display: none; }

.reader-auth-dialog {
  width: min(560px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid #343434;
  border-radius: 10px;
  color: var(--ink);
  background: #111;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65);
}
.reader-auth-dialog::backdrop { background: rgba(0, 0, 0, .76); backdrop-filter: blur(4px); }
.reader-auth-heading {
  padding: 22px 24px;
  border-bottom: 1px solid #303030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.reader-auth-heading h2 { margin: 0; font-size: 24px; }
.reader-auth-heading .eyebrow { margin-bottom: 7px; }
.reader-auth-heading > button {
  width: 38px;
  height: 38px;
  border: 1px solid #383838;
  border-radius: 8px;
  color: #eee;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}
.reader-auth-body { padding: 24px; }
.reader-auth-body > p { margin: 0 0 14px; color: #d0d0d0; line-height: 1.75; }
.reader-auth-body .reader-auth-note,
.reader-auth-body .reader-auth-footnote { color: #929292; font-size: 12px; }
.reader-auth-providers { margin: 20px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.reader-auth-providers button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #393939;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f0f0f0;
  background: #181818;
  font-weight: 700;
  text-decoration: none;
}
.reader-auth-providers button small { margin-left: 6px; color: var(--muted); }
.reader-auth-providers button:disabled { opacity: .55; cursor: default; }
.reader-auth-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reader-auth-form {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  align-content: start;
  gap: 12px;
  background: #151515;
}
.reader-auth-form h3, .reader-registration-result h3 { margin: 0; font-size: 16px; }
.reader-auth-form label, .reader-registration-result label { display: grid; gap: 6px; color: #d0d0d0; font-size: 12px; font-weight: 700; }
.reader-auth-form input, .reader-registration-result input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #393939;
  border-radius: 6px;
  color: var(--ink);
  background: #0d0d0d;
}
.reader-auth-form button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}
.reader-auth-form button:disabled { opacity: .55; cursor: wait; }
.reader-registration-result { margin-top: 14px; padding: 16px; border: 1px solid var(--accent); border-radius: 8px; display: grid; gap: 10px; }
.reader-registration-result[hidden] { display: none; }
.reader-registration-result p { margin: 0; color: #d0d0d0; font-size: 12px; line-height: 1.65; }
.reader-auth-message { margin: 14px 0 0; padding: 10px 12px; border-radius: 6px; color: #fff; background: #7a2525; }
.reader-auth-message.is-success { background: #205c39; }
.reader-account-button { gap: 6px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.library-head {
  display: grid;
  align-items: start;
  justify-content: stretch;
  gap: 16px;
  margin-bottom: 20px;
}
.library-header { padding-top: 0; }
.tag-search-panel { width: 100%; max-width: 560px; display: grid; gap: 10px; }
.search-form { width: 100%; }
.tag-search-box { width: 100%; }
.search-stack { width: min(560px, 100%); display: grid; gap: 10px; }
.novel-search,
.tag-picker {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.novel-search { display: block; }
.novel-search input,
.tag-picker input {
  width: 100%;
  min-width: 90px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}
.novel-search:focus-within,
.tag-picker:focus-within { border-color: #5a5a5a; box-shadow: 0 0 0 2px rgba(255, 90, 36, .12); }
.novel-search input::placeholder,
.tag-picker input::placeholder { color: var(--muted); opacity: 1; }
.tag-picker { position: relative; display: flex; flex-wrap: wrap; align-items: center; padding: 0; }
.tag-picker.has-tags { padding: 5px 7px; gap: 5px; }
.tag-picker.has-tags label { flex: 1 1 150px; }
.tag-picker.has-tags input { height: 30px; padding: 0 7px; }
.selected-tags { display: contents; }
.selected-tag {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid #494949;
  border-radius: 999px;
  color: #eee;
  background: #202020;
  cursor: pointer;
}
.selected-tag:hover { border-color: var(--accent); color: var(--accent-deep); }
.tag-suggestions {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  left: 0;
  width: min(720px, calc(100vw - 28px));
  max-height: min(320px, 50vh);
  padding: 9px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  background: #101010;
  box-shadow: 0 20px 45px rgba(0, 0, 0, .55);
}
.tag-suggestions[hidden] { display: none; }
.tag-suggestions button {
  padding: 7px 10px;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  color: #d5d5d5;
  background: #181818;
  cursor: pointer;
}
.tag-suggestions button:hover,
.tag-suggestions button:focus-visible { border-color: var(--accent); color: white; outline: 0; }

.segmented-control {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: var(--paper);
}
.page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-self: start;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin-top: 8px;
  padding: 0;
  background: transparent;
}
.segmented-control button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}
.segmented-control.page-tabs button {
  min-height: 40px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 0 18px;
  background: transparent;
  color: var(--muted);
}
.page-tabs button:hover,
.page-tabs button:focus-visible {
  color: var(--accent);
  outline: 0;
}
.segmented-control.page-tabs button[aria-selected="true"] {
  border-bottom-color: var(--accent);
  background: transparent;
  color: var(--accent);
}
.selector-row {
  min-height: 0;
  margin: 10px 0 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.selector-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.result-progress { margin: 0; color: #aaa; white-space: nowrap; }
.selector-row .segmented { border-radius: 8px; overflow: hidden; background: var(--paper); }
.selector-row .segmented button { min-height: 32px; border-radius: 6px; font-weight: 800; }
.selector-row .view-switch button { min-width: auto; padding: 0 12px; font-size: 14px; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid color-mix(in srgb, var(--line), transparent 30%); background: color-mix(in srgb, var(--paper), transparent 8%); backdrop-filter: blur(16px); }
.site-header {
  z-index: 45;
  min-height: 76px;
  padding: 14px clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom-color: var(--line);
  background: rgba(5, 5, 5, .92);
  backdrop-filter: blur(14px);
}
.header-inner { display: contents; }
.brand { min-width: 220px; display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 54px; height: 54px; border-radius: 9px; display: grid; place-items: center; color: white; background: var(--accent); font: 800 13px/1 var(--sans); letter-spacing: -.04em; }
.brand strong { display: block; font: 700 17px/1.25 var(--sans); letter-spacing: 0; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; letter-spacing: 0; white-space: nowrap; }
.header-actions { display: flex; gap: 9px; }
.icon-button, .reader-button { min-height: 42px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); cursor: pointer; }
.icon-button { width: 42px; border-radius: 50%; }
.reader-button { display: flex; align-items: center; gap: 7px; padding: 0 15px; border-radius: 999px; }

.hero { max-width: 1240px; margin: auto; padding: 82px 28px 70px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .7fr); align-items: end; gap: 70px; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.hero h1 { max-width: 800px; margin: 0; font: 700 clamp(48px, 7vw, 92px)/1.08 var(--sans); letter-spacing: -.045em; }
.hero h1 em { color: var(--accent); font-weight: inherit; }
.hero-copy > p:last-child { max-width: 630px; margin: 26px 0 0; color: var(--muted); font-size: 15px; line-height: 2; }
.hero-stat { min-height: 170px; padding: 28px; border-top: 3px solid var(--accent); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; }
.hero-stat span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.hero-stat strong { margin: 12px 0; font: 700 22px/1.45 var(--sans); }
.hero-stat small { color: var(--muted); line-height: 1.7; }

main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 54px; }
.discovery { width: 100%; max-width: none; margin: 0; padding: 0 0 34px; }
.search-panel { display: grid; grid-template-columns: .7fr 1.3fr; align-items: end; gap: 50px; padding: 38px 0 30px; border-top: 1px solid var(--line); }
.search-heading h2, .guide h2, .dialog-heading h2 { margin: 0; font: 700 34px/1.2 var(--sans); }
.search-box { height: 60px; padding: 0 18px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; border-bottom: 2px solid var(--ink); background: transparent; }
.search-box > span { font-size: 28px; transform: rotate(-15deg); }
.search-box input { min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
.search-box input::placeholder { color: var(--muted); }
.search-box kbd { padding: 3px 8px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); font-size: 11px; }

.category-nav { display: flex; gap: 7px; padding: 0 0 18px; overflow-x: auto; scrollbar-width: thin; }
.category { flex: 0 0 auto; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--paper); cursor: pointer; transition: border-color .2s ease, color .2s ease, background .2s ease; font-size: 13px; font-weight: 700; }
.category:hover { border-color: #4a4a4a; color: var(--ink); }
.category.active { border-color: var(--accent); color: #fff; background: var(--accent); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.toolbar > p { margin: 0; color: var(--muted); }
.toolbar > p strong { margin-right: 7px; color: var(--ink); font: 700 30px/1 var(--sans); }
.toolbar-controls { display: flex; gap: 12px; }
.segmented { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.segmented button { min-height: 32px; padding: 0 10px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 800; }
.segmented button.active { color: white; background: var(--accent); }
.view-switch button { min-width: 36px; padding: 0; font-size: 17px; }

.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.work-card { min-width: 0; height: 100%; padding: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; background: var(--paper); box-shadow: var(--shadow); transition: border-color .2s ease; }
.work-card:hover { border-color: var(--accent); }
.cover-link { display: block; flex: 0 0 auto; position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 6px; text-decoration: none; background: #000; }
.cover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; transform: scale(1.012); transition: opacity 540ms ease-out, transform 900ms ease-out; }
.cover-image.lazyloaded { opacity: 1; transform: scale(1); }
.cover-art { height: 100%; padding: 28px; position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; color: white; background: linear-gradient(145deg, #5b2524, #bd3b32 55%, #e7986f); }
.work-card:not(.has-cover-image) .cover-art { visibility: hidden; }
.works-grid:not(.panel-view) .has-cover-image .cover-art { background: transparent; }
.works-grid:not(.panel-view) .has-cover-image .cover-art > * { visibility: hidden; }
.has-cover-image .cover-art { background: linear-gradient(to bottom, rgba(10, 8, 7, .04) 15%, rgba(10, 8, 7, .84) 100%); }
.has-cover-image .cover-art::before { display: none; }
.has-cover-image .cover-title { text-shadow: 0 2px 12px rgba(0, 0, 0, .72); }
.cover-art::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .42; background: radial-gradient(circle at 72% 20%, transparent 0 14%, rgba(255,255,255,.45) 14.5% 15%, transparent 15.5%), repeating-linear-gradient(125deg, transparent 0 22px, rgba(255,255,255,.12) 23px 24px); }
.work-card[data-category="novel"] .cover-art { background: linear-gradient(145deg, #382639, #93435e 55%, #d48b85); }
.work-card[data-category="idol"] .cover-art { background: linear-gradient(145deg, #19445a, #397f8c 55%, #8ac0af); }
.work-card[data-category="anime"] .cover-art { background: linear-gradient(145deg, #30325f, #6b5ba8 55%, #d388b5); }
.work-card[data-category="lesbian"] .cover-art { background: linear-gradient(145deg, #613142, #b04b70 55%, #df9d9c); }
.work-card[data-category="solo"] .cover-art { background: linear-gradient(145deg, #40372a, #8d7146 55%, #cbb06f); }
.work-card[data-category="vr"] .cover-art { background: linear-gradient(145deg, #193e3c, #277b72 55%, #74baa4); }
.works-grid.panel-view .work-card.has-cover-image .cover-art { background: linear-gradient(to bottom, rgba(10, 8, 7, .04) 15%, rgba(10, 8, 7, .84) 100%); }
.cover-kicker { margin-bottom: auto; font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.cover-title { max-width: 90%; overflow: hidden; font: 700 25px/1.35 var(--sans); white-space: nowrap; text-overflow: ellipsis; }
.cover-art small { margin-top: 10px; opacity: .72; font-size: 9px; letter-spacing: .12em; }
.rank-badge { position: absolute; top: 0; right: 0; width: 42px; height: 42px; display: grid; place-items: center; color: white; background: var(--accent); font: 700 13px/1 var(--sans); }
.rank-badge[hidden] { display: none; }
.work-body { min-height: 0; padding: 13px 1px 2px; display: flex; flex: 1 1 auto; flex-direction: column; }
.work-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.genre { color: var(--accent); font-weight: 800; }
.work-body h3 { min-height: 1.45em; margin: 10px 0 8px; overflow: hidden; font: 700 17px/1.45 var(--sans); white-space: nowrap; }
.title-link { display: block; overflow: hidden; text-decoration: none; white-space: nowrap; text-overflow: ellipsis; }
.title-link:hover { color: var(--accent); }
.engagement-row { min-height: 25px; margin: 0 0 9px; overflow: hidden; display: flex; flex-wrap: nowrap; align-items: center; gap: 13px; color: var(--muted); font-size: 12px; line-height: 1; white-space: nowrap; }
.engagement-button, .engagement-stat { min-width: 0; padding: 3px 0; border: 0; display: inline-flex; align-items: center; gap: 4px; color: inherit; background: transparent; font-size: inherit; line-height: inherit; }
.engagement-button { cursor: pointer; }
.engagement-button:hover, .engagement-button.active { color: var(--accent); }
.engagement-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.summary { display: block; min-height: 0; margin: 6px 0 12px; overflow: visible; color: var(--muted); font-size: 13px; line-height: 1.65; }
.tags { min-height: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tag { min-height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; display: inline-flex; align-items: center; color: var(--ink); background: #181818; font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; }
.tags { margin-top: auto; }

.works-grid.panel-view { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.panel-view .work-card { height: auto; padding: 0; display: block; }
.panel-view .cover-link { aspect-ratio: 3 / 4; border-radius: 7px; }
.panel-view .cover-art { padding: 16px; }
.panel-view .cover-kicker { margin-bottom: auto; }
.panel-view .cover-title { max-width: 100%; font-size: 17px; line-height: 1.4; }
.panel-view .work-body { display: none; }

@media (prefers-reduced-motion: reduce) {
  .cover-image { opacity: 1; transform: none; transition: none; }
}

.load-more { min-width: 220px; margin: 38px auto 0; padding: 15px 24px; border: 1px solid var(--ink); display: block; color: var(--ink); background: transparent; cursor: pointer; }
.load-more:hover { color: var(--paper); background: var(--ink); }
.load-more span { margin-left: 12px; }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty-state > span { color: var(--accent); font-size: 42px; }
.empty-state h3 { margin: 10px 0; color: var(--ink); font: 600 24px/1.4 var(--serif); }

.guide { padding: 70px max(28px, calc((100vw - 1184px) / 2)); display: grid; grid-template-columns: .7fr 1.3fr; gap: 50px; color: #f6f1e9; background: #242321; }
.tag-cloud { display: flex; flex-wrap: wrap; align-content: center; gap: 10px; }
.cloud-tag { padding: 10px 15px; border: 1px solid #55514a; border-radius: 999px; color: #d8d2c8; background: transparent; cursor: pointer; }
.cloud-tag:hover { border-color: #fff; color: #fff; }

.site-footer { min-height: 180px; padding: 50px max(28px, calc((100vw - 1184px) / 2)); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; border-top: 1px solid var(--line); color: var(--muted); }
.footer-brand { color: var(--ink); }
.site-footer > p { grid-column: 1 / -1; margin: 0; font-size: 11px; }
.site-footer div { display: flex; gap: 10px; font-size: 12px; }

.library-dialog { width: min(660px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; overflow: auto; border: 1px solid var(--line); color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.library-dialog::backdrop { background: rgba(14, 13, 12, .68); backdrop-filter: blur(4px); }
.dialog-heading { position: sticky; top: 0; z-index: 2; padding: 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: var(--surface); }
.dialog-heading button { width: 40px; height: 40px; border: 1px solid var(--line); color: var(--ink); background: transparent; font-size: 24px; cursor: pointer; }
.favorite-list { padding: 16px 24px 24px; }
.favorite-row { padding: 15px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.favorite-row a { font-family: var(--sans); font-weight: 700; text-decoration: none; }
.favorite-row small { display: block; margin-top: 5px; color: var(--muted); }
.favorite-row button { border: 0; color: var(--accent); background: transparent; cursor: pointer; }
.favorite-empty { padding: 32px 24px 50px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 34px; padding-top: 58px; }
  .hero-stat { min-height: 130px; }
  .works-grid, .works-grid.panel-view { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search-panel, .guide { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 620px) {
  .top-header, .topbar-inner { min-height: 68px; }
  .topbar-inner { padding: 0 12px; gap: 10px; }
  .top-brand { gap: 9px; }
  .top-brand-mark { width: 44px; height: 44px; border-radius: 9px; }
  .top-brand-mark span { width: 24px; height: 16px; }
  .top-brand-mark::before, .top-brand-mark::after { width: 17px; }
  .top-brand-copy strong { font-size: 15px; }
  .top-brand-copy small { display: none; }
  .reader-auth-heading, .reader-auth-body { padding: 18px; }
  .library-header { padding-top: 14px; }
  .selector-row { min-height: 104px; align-items: flex-end; flex-direction: column; justify-content: center; }
  .selector-controls { width: 100%; justify-content: space-between; gap: 6px; }
  .selector-row .segmented button { padding: 0 9px; font-size: 12px; }
  .result-progress { font-size: 12px; }
  .category-nav { padding-bottom: 14px; }
  .header-inner { min-height: 66px; padding: 0 16px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand strong { font-size: 18px; }
  .desktop-label { display: none; }
  .hero { padding: 44px 18px 52px; }
  .hero h1 { font-size: clamp(43px, 14vw, 62px); }
  .hero-copy > p:last-child { line-height: 1.8; }
  .discovery { padding: 0 0 64px; }
  .search-panel { padding-top: 30px; }
  .search-box { padding: 0 8px; }
  .search-box kbd { display: none; }
  .toolbar { align-items: flex-end; }
  .toolbar-controls { flex-direction: column; align-items: flex-end; gap: 7px; }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .works-grid.panel-view { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .work-card { padding: 8px; }
  .cover-art { padding: 14px; }
  .cover-title { font-size: 17px; }
  .work-body { padding-top: 10px; }
  .work-body h3 { font-size: 15px; }
  .summary { display: -webkit-box; min-height: 5.2em; overflow: hidden; font-size: 11px; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  .work-meta { font-size: 9px; }
  .tags { min-height: 22px; }
  .work-body h3 { min-height: auto; }
  .guide { padding: 54px 18px; }
  .site-footer { padding: 42px 18px; grid-template-columns: 1fr; }
  .site-footer > p { grid-column: auto; }
}

@media (max-width: 520px) {
  .login-label-full { display: none; }
  .login-label-short { display: inline; }
  .reader-auth-providers, .reader-auth-forms { grid-template-columns: 1fr; }
}

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