:root {
  color-scheme: light;
  --paper: #f6f7f3;
  --ink: #24272a;
  --muted: #68716a;
  --line: #d6ddd4;
  --panel: #ffffff;
  --green: #286b59;
  --blue: #315f8d;
  --gold: #9d772f;
  --red: #9b4a3c;
  --shadow: 0 10px 30px rgba(52, 47, 41, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  line-height: 1.65;
}

.shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(780px, 840px);
  gap: 24px;
  align-items: center;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-top: 6px solid #144d3f;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.brand-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  min-width: 0;
}

.brand-portrait {
  position: relative;
  width: 132px;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border: 1px solid #c9d2c8;
  border-radius: 8px;
  background: #efe6d3;
  box-shadow: 0 12px 26px rgba(52, 47, 41, 0.13);
}

.brand-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-portrait figcaption {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(155, 74, 60, 0.94);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.25;
}

.brand-copy {
  min-width: 0;
}

.brand-kicker {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 800;
}

.brand-statement {
  max-width: 44rem;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.brand-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.brand-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid #d8cfbb;
  border-radius: 8px;
  background: #fff8e8;
  color: #5d4721;
  font-size: 0.9rem;
  font-weight: 750;
}

.brand-tags span:nth-child(2) {
  border-color: #bcd8ce;
  background: #e7f2ed;
  color: var(--green);
}

.brand-tags span:nth-child(3) {
  border-color: #e2c4bd;
  background: #f7eeee;
  color: var(--red);
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2vw, 2.15rem);
  font-weight: 750;
  letter-spacing: 0;
}

#summary {
  margin: 10px 0 0;
  color: var(--muted);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 96px 96px minmax(130px, 160px) 108px 104px;
  gap: 10px;
  align-items: end;
  padding: 16px 18px;
  border-radius: 8px;
  background: #144d3f;
  box-shadow: 0 12px 26px rgba(40, 107, 89, 0.16);
}

html:not(.admin-mode) [data-admin-only] {
  display: none !important;
}

html:not(.admin-mode) .search-row {
  grid-template-columns: minmax(190px, 1fr) 96px 96px minmax(130px, 160px) 104px;
}

.search,
.select,
.check {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.check {
  min-height: 42px;
  grid-template-columns: 18px 1fr;
  align-items: center;
  align-content: end;
  padding: 8px 0;
  color: var(--ink);
}

.brand-toolbar .search,
.brand-toolbar .select,
.brand-toolbar .check {
  color: #f6fbf7;
}

.check input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  padding: 8px 12px;
  box-shadow: none;
}

input:focus,
select:focus,
button:focus,
.post-card:focus,
.reading-lane:focus,
.pack-link:focus,
.bookstore-ad:focus,
.top-button:focus {
  outline: 3px solid rgba(49, 95, 141, 0.24);
  outline-offset: 1px;
}

.reading-gateway {
  display: grid;
  gap: 14px;
  margin: 20px 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 8px 22px rgba(52, 47, 41, 0.05);
}

.reading-gateway-heading {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px 12px;
  align-items: baseline;
}

.reading-gateway-heading span {
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 800;
}

.reading-gateway-heading strong {
  color: var(--green);
  font-size: 1.06rem;
  font-weight: 850;
}

.reading-gateway-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.reading-gateway-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.reading-lane {
  display: grid;
  gap: 10px;
  align-content: start;
  width: 100%;
  min-height: 154px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(52, 47, 41, 0.04);
}

.reading-lane:hover {
  border-color: #aec1b6;
}

.reading-lane[aria-pressed="true"] {
  border-color: var(--green);
  background: #e5f1ea;
  box-shadow: 0 0 0 3px rgba(40, 107, 89, 0.1), 0 8px 18px rgba(40, 107, 89, 0.1);
}

.reading-lane-top {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
}

.reading-lane-top strong {
  min-width: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.reading-lane-top span {
  flex: 0 0 auto;
  padding: 2px 10px;
  border: 1px solid #d7dfd8;
  border-radius: 999px;
  background: #edf1ee;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 850;
  white-space: nowrap;
}

.reading-lane-lead {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.reading-lane-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.reading-lane-chips span {
  min-height: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #edf1eb;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.categories {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 22px rgba(52, 47, 41, 0.05);
}

.categories-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
}

.categories-heading span {
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 800;
}

.categories-heading strong {
  color: var(--green);
  font-size: 1.06rem;
  font-weight: 850;
}

.categories-subheading {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.categories-subheading strong {
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 850;
}

.categories-subheading span {
  color: var(--muted);
  font-size: 0.86rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.categories button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(52, 47, 41, 0.04);
}

.categories button:hover {
  border-color: #aec1b6;
}

.categories button[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.category-name {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.category-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border: 1px solid #d7dfd8;
  border-radius: 999px;
  background: #edf1ee;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.categories button[aria-pressed="true"] .category-count {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.category-grid-archive button {
  min-height: 50px;
  background: #fbfcfa;
}

.layout {
  display: grid;
  grid-template-columns: 220px minmax(300px, 380px) minmax(460px, 1fr);
  gap: 18px 24px;
  align-items: start;
}

.stats {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 32px);
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.stat strong {
  color: var(--ink);
  text-align: right;
}

.series-nav {
  display: grid;
  gap: 8px;
  min-height: 0;
  margin-bottom: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.series-nav h2 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
}

.series-nav-buttons {
  display: grid;
  gap: 7px;
  max-height: min(56vh, 520px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.series-nav-buttons button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.series-nav-buttons button[aria-pressed="true"] {
  border-color: var(--green);
  background: #e5f1ea;
  color: var(--green);
  font-weight: 750;
}

.results-panel {
  min-width: 0;
  max-width: 380px;
}

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  min-height: 52px;
  margin-bottom: 10px;
}

.result-head h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

#resultMeta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.pack-link {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--green);
  background: var(--panel);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
}

.post-list {
  display: grid;
  gap: 12px;
}

.post-card {
  display: block;
  width: 100%;
  min-width: 0;
  text-align: left;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.post-card[aria-current="true"] {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(40, 107, 89, 0.14), var(--shadow);
}

.post-card:hover {
  border-color: #a9b8ad;
}

.post-card.is-published {
  background: #fbfdfb;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.category {
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  padding: 1px 8px;
}

.status-badge {
  color: var(--green);
  background: #e5f1ea;
  border: 1px solid #b7d1c0;
  border-radius: 999px;
  padding: 1px 8px;
  font-weight: 700;
}

.series-badge {
  color: var(--blue);
  background: #eef4f9;
  border: 1px solid #c2d5e7;
  border-radius: 999px;
  padding: 1px 8px;
  font-weight: 700;
}

.post-card:nth-child(3n + 2) .category {
  background: var(--gold);
}

.post-card:nth-child(3n) .category {
  background: var(--red);
}

h2 {
  margin: 8px 0 6px;
  font-size: 1.08rem;
  line-height: 1.4;
  letter-spacing: 0;
}

.excerpt {
  margin: 0;
  color: #3f3932;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  color: var(--muted);
  background: #edf1eb;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.82rem;
}

.load-more {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--green);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.load-more[hidden] {
  display: none;
}

.reader {
  align-self: start;
  justify-self: stretch;
  min-width: 0;
  padding: 22px 24px 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(52, 47, 41, 0.06);
  overflow-wrap: anywhere;
}

.inline-reader {
  display: none;
}

.recommendation-reader {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 22px;
  border-top: 1px solid #bdd3c9;
}

.recommendation-band {
  margin: 22px 0 18px;
}

.hourly-recommendation {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin: 0 0 34px;
  padding: 18px 18px 18px 22px;
  border: 1px solid #bdd3c9;
  border-left: 6px solid var(--green);
  border-radius: 8px;
  background: #f3faf6;
  box-shadow: 0 12px 26px rgba(40, 107, 89, 0.12);
  cursor: pointer;
}

.recommendation-band .hourly-recommendation {
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  margin: 0;
  padding: 22px;
  background: linear-gradient(180deg, #f2faf6 0%, #fffdf8 100%);
  box-shadow: 0 14px 34px rgba(40, 107, 89, 0.16);
}

.hourly-recommendation.is-open {
  background: #f0faf4;
}

.hourly-recommendation-media {
  aspect-ratio: 4 / 3;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(40, 107, 89, 0.18);
  border-radius: 8px;
  background: #efe6d3;
}

.hourly-recommendation-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hourly-recommendation-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.hourly-recommendation::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18px;
  height: 1px;
  background: var(--line);
}

.hourly-recommendation-after {
  margin: 34px 0 0;
}

.hourly-recommendation-after::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 1px;
  background: var(--line);
}

.hourly-recommendation-after::after {
  display: none;
}

.hourly-recommendation-band::before,
.hourly-recommendation-band::after {
  display: none;
}

.hourly-recommendation[hidden] {
  display: none;
}

.hourly-recommendation-head {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.hourly-recommendation-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff8e8;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 800;
}

.hourly-recommendation-head time {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.hourly-recommendation-meta {
  margin-bottom: 6px;
}

.hourly-recommendation h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.42;
}

.hourly-recommendation-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.hourly-recommendation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.hourly-recommendation button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: #e5f1ea;
  color: var(--green);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.recommendation-band .hourly-recommendation button {
  min-width: 112px;
}

.bookstore-search-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #c8ad77;
  border-radius: 8px;
  background: #fff8e8;
  color: #6f501c;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.bookstore-search-link:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.reader-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.reader-head h2 {
  margin: 10px 0 0;
  font-size: 1.36rem;
  line-height: 1.42;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.reader-actions button,
.reader-actions a {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.reader-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.reader-actions button:disabled {
  color: var(--muted);
  background: #edf0eb;
  cursor: not-allowed;
}

.reader-actions .back-search-button {
  display: none;
}

.reader-actions .publish-button[aria-pressed="true"] {
  border-color: var(--green);
  background: #e5f1ea;
  color: var(--green);
  font-weight: 700;
}

.reader-body {
  padding-top: 16px;
  font-size: 1.02rem;
}

.reader-body p {
  margin: 0 0 1.05em;
  white-space: pre-line;
}

.bookstore-cta {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #decda7;
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: #fffaf0;
}

.bookstore-cta h3 {
  margin: 0 0 6px;
  color: #6f501c;
  font-size: 1rem;
  line-height: 1.35;
}

.bookstore-cta p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.reader-body .image-story-label {
  margin-bottom: 8px;
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 700;
}

.image-caption-editor {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.image-caption-editor h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.caption-note,
.caption-counter,
.caption-status {
  color: var(--muted);
  font-size: 0.84rem;
}

.image-caption-editor label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.image-caption-editor input,
.image-caption-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf9;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

.image-caption-editor input {
  min-height: 38px;
  padding: 0 10px;
}

.image-caption-editor textarea {
  padding: 10px;
  resize: vertical;
}

.caption-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.caption-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.reader-tags {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.reader-media {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.reader-media h3 {
  margin: 0 0 12px;
  font-size: 0.98rem;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.media-grid figure {
  margin: 0;
  min-width: 0;
}

.media-grid img,
.media-grid video,
.media-grid iframe {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1ee;
}

.media-grid iframe {
  aspect-ratio: 16 / 9;
}

.media-grid img {
  object-fit: cover;
}

.media-grid video {
  object-fit: contain;
}

.media-grid .image-open-link {
  margin-top: 0;
  color: inherit;
}

.media-grid figcaption,
.media-grid a {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.media-grid a {
  color: var(--green);
  font-weight: 700;
}

.has-image-viewer {
  overflow: hidden;
}

.image-viewer[hidden] {
  display: none;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 20, 0.82);
}

.image-viewer-panel {
  position: relative;
  display: grid;
  gap: 10px;
  max-width: min(1120px, 96vw);
  max-height: 94vh;
}

.image-viewer-panel img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(94vh - 64px);
  object-fit: contain;
  border-radius: 8px;
  background: #101511;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.36);
}

.image-viewer-close {
  justify-self: end;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.image-viewer-caption {
  margin: 0;
  color: #f5f7f2;
  font-size: 0.86rem;
  text-align: center;
}

.reader-details {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 6px 12px;
  margin: 20px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.reader-details dt {
  font-weight: 700;
}

.reader-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  text-align: center;
}

.mobile-search-button {
  display: none;
}

.bookstore-ad {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 21;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 214px;
  min-height: 82px;
  padding: 8px 10px 8px 8px;
  border: 1px solid rgba(40, 107, 89, 0.28);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(36, 39, 42, 0.18);
}

.bookstore-ad:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.bookstore-ad:focus {
  outline: 3px solid rgba(49, 95, 141, 0.24);
  outline-offset: 1px;
}

.bookstore-ad img {
  display: block;
  width: 64px;
  height: 64px;
  border: 1px solid #e2d7c7;
  border-radius: 7px;
  background: #fff;
  object-fit: cover;
}

.bookstore-ad strong,
.bookstore-ad small {
  display: block;
  line-height: 1.3;
}

.bookstore-ad strong {
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 800;
}

.bookstore-ad small {
  margin-top: 2px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 750;
}

.top-button {
  position: fixed;
  right: 16px;
  bottom: calc(112px + env(safe-area-inset-bottom));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(36, 39, 42, 0.2);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

@media (max-width: 1320px) {
  .toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

@media (max-width: 1180px) {
  .toolbar {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .results-panel {
    max-width: none;
  }

  .reader {
    grid-column: 2;
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .toolbar,
  .layout {
    grid-template-columns: 1fr;
  }

  .shell {
    width: min(1440px, calc(100vw - 24px));
    padding: 18px 0 48px;
  }

  .toolbar {
    gap: 14px;
    padding: 14px;
  }

  .brand-card {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }

  .brand-portrait {
    width: 92px;
  }

  .brand-kicker {
    margin-bottom: 2px;
    font-size: 0.78rem;
    line-height: 1.35;
  }

  h1 {
    font-size: 1.48rem;
    line-height: 1.22;
  }

  .brand-statement {
    margin-top: 5px;
    font-size: 0.86rem;
    line-height: 1.55;
  }

  .brand-tags {
    margin-top: 8px;
    gap: 6px;
  }

  .brand-tags span {
    min-height: 26px;
    padding: 3px 8px;
    font-size: 0.74rem;
  }

  #summary {
    margin-top: 8px;
    font-size: 0.9rem;
  }

  .search-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
  }

  html:not(.admin-mode) .search-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-row .search,
  .search-row .select:nth-of-type(4) {
    grid-column: 1 / -1;
  }

  .search,
  .select,
  .check {
    gap: 3px;
    font-size: 0.78rem;
  }

  .check {
    min-height: 40px;
    padding: 4px 0;
  }

  input,
  select {
    min-height: 40px;
    padding: 7px 10px;
  }

  .reading-gateway {
    gap: 12px;
    margin: 16px 0;
    padding: 14px;
  }

  .reading-gateway-heading {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .reading-gateway-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reading-lane {
    min-height: 144px;
    padding: 12px;
  }

  .reading-lane-top {
    display: grid;
    gap: 8px;
  }

  .stats {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .series-nav-buttons {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    max-height: 260px;
  }

  .recommendation-band {
    margin: 16px 0 18px;
  }

  .recommendation-band .hourly-recommendation {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .hourly-recommendation-media {
    min-height: 108px;
  }

  .reader {
    display: none;
  }

  .inline-reader {
    display: block;
    padding: 18px;
    border: 1px solid var(--green);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 0 0 3px rgba(40, 107, 89, 0.1), var(--shadow);
  }

  .inline-reader .reader-head h2 {
    font-size: 1.18rem;
  }

  .reader-actions .back-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: var(--blue);
    background: #eef4f9;
    color: var(--blue);
    font-weight: 700;
  }

  .mobile-search-button {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid var(--green);
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    box-shadow: 0 10px 24px rgba(36, 39, 42, 0.2);
    font: inherit;
    font-weight: 750;
  }

  .mobile-search-button[hidden] {
    display: none;
  }

  .bookstore-ad {
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    grid-template-columns: 48px;
    justify-items: center;
    width: 70px;
    min-height: 78px;
    padding: 6px;
  }

  .bookstore-ad img {
    width: 48px;
    height: 48px;
  }

  .bookstore-ad strong {
    font-size: 0.68rem;
    text-align: center;
  }

  .bookstore-ad small {
    display: none;
  }

  .top-button {
    right: 16px;
    min-width: 68px;
    min-height: 42px;
    padding: 0 14px;
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 520px) {
  .reading-gateway-grid {
    grid-template-columns: 1fr;
  }

  .reading-lane {
    min-height: 0;
  }

  .recommendation-band .hourly-recommendation {
    grid-template-columns: 1fr;
  }

  .hourly-recommendation-media {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .brand-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .brand-portrait {
    width: 88px;
  }

  .brand-portrait figcaption {
    right: 6px;
    bottom: 6px;
    padding: 3px 6px;
    font-size: 0.68rem;
  }

  .brand-tags span {
    font-size: 0.7rem;
  }

  .bookstore-ad {
    grid-template-columns: 44px;
    width: 58px;
    min-height: 58px;
    padding: 6px;
  }

  .bookstore-ad img {
    width: 44px;
    height: 44px;
  }

  .bookstore-ad strong {
    display: none;
  }

  .top-button {
    right: 12px;
    min-width: 62px;
    min-height: 38px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    font-size: 0.88rem;
  }
}
