/* PER-358: unified visual layer for home, cards, birthday calendar and story
   directory. Reuses the existing paper/ink/seal/lake palette; no filters,
   no background blur, no decorative particles and no layout-framework change. */
:root {
  --w-paper: #f6f8fc;
  --w-surface: #ffffff;
  --w-ink: #1f2d47;
  --w-muted: #56657e;
  --w-line: #dce4f0;
  --w-line-strong: #c3d0e2;
  --w-accent: #c52b70;
  --w-lake: #18768c;
  --w-lav: #eeeafb;
  --w-lav-deep: #e0d9f6;
  --w-warm: #f6efe6;
  --w-radius: 16px;
  --w-radius-sm: 11px;
  --w-shadow: 0 14px 34px -24px rgba(31, 45, 71, 0.42);
  --w-cut: 4px;
}

.v358 {
  background: var(--w-paper);
  color: var(--w-ink);
}

.v358 .shell,
.v358 .story-shell,
.v358 .reader-shell {
  width: min(1140px, calc(100% - 40px));
}

.v358 .kicker,
.v358 .eyebrow {
  margin: 0;
  color: var(--w-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.v358 h1,
.v358 h2,
.v358 h3 {
  color: var(--w-ink);
  letter-spacing: -0.02em;
}

.v358 .small,
.v358 small {
  color: var(--w-muted);
}

/* Home -------------------------------------------------------------------- */
.v358.home-page .shell {
  padding: 30px 0 0;
}

.home-lead {
  display: grid;
  gap: 10px;
  padding: 6px 0 26px;
  border-bottom: 1px solid var(--w-line);
}

.home-lead h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4.2vw, 2.8rem);
  line-height: 1.12;
  font-weight: 750;
}

.home-lead h1 em {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 500;
  color: var(--w-lake);
}

.home-lead p {
  max-width: 46rem;
  margin: 0;
  color: var(--w-muted);
  font-size: 0.98rem;
}

.home-features {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  align-items: start;
  gap: 20px;
  margin-top: 26px;
}

.home-feature {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--w-line);
  border-radius: 20px;
  background: var(--w-surface);
  box-shadow: var(--w-shadow);
  overflow: hidden;
}

.home-feature .feature-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 18px 22px 22px;
}

.home-feature .panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 0;
}

.home-feature .panel-head h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--w-muted);
  letter-spacing: 0.01em;
}

.birthday-feature {
  background:
    radial-gradient(120% 150% at 100% 0%, #ffffff 0%, #f7f1ff 46%, #efe9fc 100%);
}

.birthday-feature .feature-countdown {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.birthday-feature .feature-countdown:hover {
  border-color: transparent;
}

.birthday-feature .feature-countdown .char-chip img {
  width: 76px;
  height: 76px;
  border: 0;
}

.birthday-feature .feature-countdown-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.birthday-feature .feature-countdown-text > span:first-child {
  color: var(--w-muted);
}

.birthday-feature .feature-countdown-text > span:last-child {
  color: var(--w-muted);
  font-size: 0.95rem;
}

.birthday-feature .feature-countdown-text strong {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(1.7rem, 2.6vw, 2.25rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.feature-upcoming {
  display: grid;
  gap: 2px;
  margin: 4px 0 2px;
  padding: 10px 0 0;
  list-style: none;
  border-top: 1px solid rgba(31, 45, 71, 0.08);
}

.feature-upcoming[hidden] {
  display: none;
}

.feature-upcoming li {
  min-width: 0;
}

.feature-upcoming a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 6px;
  border-radius: 10px;
  color: var(--w-ink);
}

.feature-upcoming a:hover {
  background: rgba(255, 255, 255, 0.7);
}

.feature-upcoming .char-chip img {
  width: 30px;
  height: 30px;
}

.feature-upcoming strong {
  font-size: 0.9rem;
  color: var(--char-color, var(--w-ink));
}

.feature-upcoming a::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--char-color, var(--w-accent));
}

.feature-upcoming a > span:not(.char-chip) {
  margin-left: auto;
  color: var(--w-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.birthday-feature .feature-round {
  margin: 0;
  color: var(--w-muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.birthday-feature .feature-cta {
  margin: auto 0 0;
  padding-top: 4px;
}

.birthday-feature .feature-cta a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--w-ink);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}

.birthday-feature .feature-cta a:hover {
  background: var(--w-accent);
}

.story-feature .story-feature-visual {
  position: relative;
  display: block;
  min-height: 196px;
  margin: 4px 22px 0;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(140deg, #e9e3fb 0%, #f6eef5 52%, #f7efe3 100%);
  isolation: isolate;
}

.story-feature .story-feature-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 196px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.story-feature .story-feature-visual img[hidden] {
  display: none;
}

.story-feature .story-feature-visual:hover img {
  transform: scale(1.02);
}

.story-feature .story-feature-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(178deg, rgba(20, 27, 41, 0) 38%, rgba(20, 27, 41, 0.74) 100%);
}

.story-feature .story-feature-copy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 2;
  display: grid;
  gap: 2px;
  color: #fff;
}

.story-feature .story-feature-copy span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.82;
}

.story-feature .story-feature-copy strong {
  font-size: 1.1rem;
  line-height: 1.4;
  text-shadow: 0 1px 12px rgba(16, 22, 34, 0.4);
}

.story-feature .feature-body {
  gap: 8px;
}

.story-feature .feature-round {
  margin: 0;
  color: var(--w-muted);
  font-size: 0.84rem;
}

.story-feature .regional-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin: 0;
  color: var(--w-muted);
  font-size: 0.82rem;
}

.story-feature .regional-dates p {
  margin: 0;
}

.story-feature .feature-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: auto 0 0;
  padding-top: 6px;
}

.story-feature .feature-cta a {
  font-weight: 700;
  color: var(--w-lake);
}

.story-feature .feature-cta a:hover {
  color: var(--w-accent);
}

/* Cards promo + updates --------------------------------------------------- */
.cards-promo {
  display: flex;
  text-decoration: none;
  color: inherit;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding: 18px 22px;
  border: 1px solid var(--w-line);
  border-radius: var(--w-radius);
  background: var(--w-surface);
  color: inherit;
}

.cards-promo:hover {
  border-color: var(--w-lake);
}

.cards-promo .promo-copy {
  display: grid;
  gap: 2px;
}

.cards-promo strong {
  font-size: 1.02rem;
}

.cards-promo span {
  color: var(--w-muted);
  font-size: 0.86rem;
}

.cards-promo .promo-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--w-accent);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.updates {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.updates ol {
  list-style: none;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 0 0 20px;
  border-left: 1px solid var(--w-line);
}

.updates li {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0 12px 18px;
  border: 0;
  position: relative;
}

.updates li::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 21px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--w-paper);
  border: 2px solid var(--w-line-strong);
}

.updates li:first-child::before {
  background: var(--w-accent);
  border-color: var(--w-accent);
}

.updates time {
  color: var(--w-muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.updates li span {
  color: var(--w-ink);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* Story directory --------------------------------------------------------- */
.v358.story-page .story-shell {
  padding-top: 24px;
}

.story-v2 .story-toolbar {
  position: static;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  background: transparent;
}

.story-toolbar-top {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--w-line);
}

.story-toolbar-top .story-tabs {
  padding: 0;
  gap: 4px;
}

.story-v2 .story-tabs a {
  min-height: 42px;
  padding: 6px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--w-muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.story-v2 .story-tabs a:hover {
  background: var(--w-lav);
  color: var(--w-ink);
}

.story-v2 .story-tabs a[aria-current="page"] {
  border-color: var(--w-ink);
  background: var(--w-ink);
  color: #fff;
}

.story-v2 .story-tabs small {
  opacity: 0.66;
  font-weight: 700;
}

.story-v2 .story-continue {
  flex: none;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--w-accent);
  border-radius: 999px;
  color: var(--w-accent);
  background: #fff;
  font-size: 0.86rem;
  font-weight: 700;
}

.story-v2 .story-continue[hidden] {
  display: none;
}

.story-v2 .story-search-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0 8px;
}

.story-v2 .story-search input {
  min-height: 46px;
  padding: 8px 18px;
  border-radius: 999px;
  border-color: var(--w-line);
  background: var(--w-surface);
}

.story-v2 .story-count {
  flex: none;
  color: var(--w-muted);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.story-v2 .story-filter {
  padding: 10px 0 0;
}

.story-v2 .story-bands {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.story-v2 .story-band {
  height: 48px;
  border-radius: 12px;
  border-color: var(--w-line);
  background: var(--w-surface);
}

.story-v2 .story-band img {
  width: 54px;
  height: 34px;
}

.story-v2 .story-band[aria-pressed="true"] {
  border-color: var(--w-lake);
  background: #eef8fa;
  box-shadow: inset 0 0 0 1px var(--w-lake);
}

.story-v2 .story-char {
  border-color: var(--w-surface);
  box-shadow: 0 0 0 1px var(--w-line);
}

.story-v2 .story-char[aria-pressed="true"] {
  border-color: var(--w-accent);
  box-shadow: 0 0 0 3px rgba(197, 43, 112, 0.16);
}

.story-v2 .story-results.grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 292px), 1fr));
  gap: 18px;
}

.story-v2 .story-card {
  border: 1px solid var(--w-line);
  border-radius: var(--w-radius);
  background: var(--w-surface);
  box-shadow: 0 1px 0 rgba(31, 45, 71, 0.03);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.story-v2 .story-card:hover {
  border-color: var(--w-line-strong);
  box-shadow: var(--w-shadow);
  transform: none;
}

.story-v2 .story-card-visual {
  aspect-ratio: 2.3 / 1;
  min-height: 118px;
  background:
    linear-gradient(132deg, var(--w-lav) 0%, #f8f0f6 58%, var(--w-warm) 100%);
}

.story-v2 .story-card-visual img {
  transition: transform 0.4s ease;
}

.story-v2 .story-card:hover .story-card-visual img {
  transform: scale(1.025);
}

.story-v2 .story-card-visual .period {
  left: 12px;
  top: 12px;
  padding: 4px 10px;
  background: rgba(24, 32, 46, 0.74);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.story-v2 .story-card-body {
  gap: 6px;
  padding: 14px 16px 16px;
}

.story-v2 .story-card-body h3 {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.45;
}

.story-v2 .story-card-meta,
.story-v2 .story-card-desc {
  font-size: 0.81rem;
  color: var(--w-muted);
}

.story-v2 .story-card-meta:first-of-type {
  color: var(--w-lake);
  font-weight: 700;
}

.story-v2 .story-card-desc {
  line-height: 1.6;
  -webkit-line-clamp: 2;
}

.story-v2 .story-card-chars {
  margin-top: auto;
  padding-top: 8px;
}

.story-v2 .story-card-chars img {
  width: 26px;
  height: 26px;
}

.story-v2 .story-load-more {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--w-line-strong);
  border-radius: 999px;
  background: var(--w-surface);
  color: var(--w-ink);
}

.story-v2 .story-empty,
.story-v2 .story-footnote {
  color: var(--w-muted);
  font-size: 0.82rem;
}

/* Loading skeletons: same geometry as the real cards, no extra requests. */
.story-skeleton {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--w-line);
  border-radius: var(--w-radius);
  background: var(--w-surface);
  overflow: hidden;
}

.story-skeleton .skeleton-visual {
  aspect-ratio: 2.3 / 1;
  min-height: 118px;
  background: linear-gradient(100deg, #eef2f9 20%, #f8fafd 42%, #eef2f9 64%);
  background-size: 220% 100%;
  animation: w-shimmer 1.5s linear infinite;
}

.story-skeleton .skeleton-body {
  display: grid;
  gap: 9px;
  padding: 15px 16px 18px;
}

.story-skeleton .skeleton-line {
  height: 11px;
  border-radius: 999px;
  background: #edf1f8;
}

.story-skeleton .skeleton-line.short {
  width: 42%;
}

.story-skeleton .skeleton-line.mid {
  width: 72%;
}

@keyframes w-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .story-skeleton .skeleton-visual {
    animation: none;
  }
}

/* Cards ------------------------------------------------------------------- */
.v358.cards-page .story-shell {
  width: min(1240px, calc(100% - 40px));
  padding-top: 26px;
}

.cards-v2 .story-intro {
  align-items: flex-end;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--w-line);
}

.cards-v2 .story-intro h1 {
  margin: 2px 0 6px;
  font-size: clamp(1.9rem, 3.6vw, 2.35rem);
  font-weight: 750;
}

.cards-v2 .story-lead {
  margin: 0;
  color: var(--w-muted);
}

.cards-v2 .story-intro .button-link {
  border-radius: 999px;
  border-color: var(--w-line-strong);
  background: var(--w-surface);
}

.cards-v2 .card-filters {
  margin: 18px 0 20px;
  padding: 18px 20px 16px;
  border: 1px solid var(--w-line);
  border-radius: var(--w-radius);
  background: var(--w-surface);
}

.cards-v2 .card-filters fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.cards-v2 .card-filters legend {
  padding: 0;
  margin-bottom: 10px;
  color: var(--w-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cards-v2 .filter-label {
  display: block;
  margin: 10px 0 6px;
  color: var(--w-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.cards-v2 .filter-chips {
  gap: 6px;
}

.cards-v2 #card-bands {
  padding-bottom: 10px;
}

.cards-v2 .filter-chip {
  min-height: 40px;
  padding: 5px 12px;
  border-color: var(--w-line);
  border-radius: 999px;
  background: #fbfcfe;
  color: var(--w-ink);
  font-size: 0.86rem;
}

.cards-v2 .filter-chip:hover {
  border-color: var(--w-line-strong);
  background: var(--w-lav);
}

.cards-v2 .filter-chip[aria-pressed="true"] {
  border: 1px solid var(--w-ink);
  background: var(--w-ink);
  color: #fff;
  padding: 5px 12px;
}

.cards-v2 .filter-chip[aria-pressed="true"] .chip-label {
  color: #fff;
}

.cards-v2 #card-bands .filter-chip {
  flex-direction: column;
  gap: 1px;
  min-width: 72px;
  padding: 6px 8px;
  border-radius: 12px;
}

.cards-v2 #card-bands .filter-chip img {
  width: 50px;
  height: 28px;
}

.cards-v2 #card-bands .filter-chip[data-value=""] {
  justify-content: center;
  align-content: center;
  font-weight: 800;
}

.cards-v2 #card-bands .filter-chip[aria-pressed="true"] {
  background: #eef8fa;
  color: var(--w-ink);
  border-color: var(--w-lake);
  box-shadow: inset 0 0 0 1px var(--w-lake);
}

.cards-v2 #card-bands .filter-chip[aria-pressed="true"] .band-label {
  color: var(--w-ink);
}

.cards-v2 .character-chips {
  display: grid;
  max-height: 10.8rem;
  height: auto;
  grid-template-columns: repeat(auto-fill, 46px);
  grid-auto-rows: 46px;
  gap: 9px;
  padding: 2px 4px 4px;
  overflow-y: auto;
  overflow-x: hidden;
}

.cards-v2 .character-chips .filter-chip {
  padding: 0;
  justify-content: center;
}

.cards-v2 .character-chips .chip-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.cards-v2 .character-chips .filter-chip[data-value=""] {
  padding: 0 2px;
  background: var(--w-ink);
  color: #fff;
  font-weight: 800;
}

.cards-v2 .character-chips .filter-chip[data-value=""] .chip-label {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  color: #fff;
  font-size: 0.68rem;
}

.cards-v2 .character-chips .filter-chip img {
  width: 40px;
  height: 40px;
}

.cards-v2 .card-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--w-line);
}

.cards-v2 .card-filter-grid label {
  display: grid;
  gap: 5px;
  color: var(--w-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.cards-v2 .card-filter-grid input,
.cards-v2 .card-filter-grid select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--w-line);
  border-radius: var(--w-radius-sm);
  background: #fbfcfe;
  color: var(--w-ink);
  font: inherit;
  font-size: 0.9rem;
}

.cards-v2 .card-filter-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.cards-v2 .card-filter-foot button,
.cards-v2 .card-filter-foot .button-link {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--w-line);
  border-radius: 999px;
  background: #fbfcfe;
  color: var(--w-ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.cards-v2 .card-filter-foot button:hover {
  border-color: var(--w-line-strong);
}

.cards-v2 #card-after[aria-pressed="true"] {
  border-color: var(--w-lake);
  background: #eef8fa;
  color: var(--w-lake);
}

.cards-v2 .card-filter-foot label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--w-muted);
  font-size: 0.84rem;
}

.cards-v2 .card-results-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 2px 0 12px;
}

.cards-v2 .card-results-heading p {
  margin: 0;
  color: var(--w-muted);
  font-size: 0.82rem;
}

.cards-v2 .card-results-heading #story-count {
  color: var(--w-ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.cards-v2 .card-grid {
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 18px;
}

.cards-v2 .card-tile {
  border-radius: var(--w-radius);
  border-color: var(--w-line);
}

.cards-v2 .card-tile .card-art {
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(120% 120% at 50% 0%, #fbfcff 0%, #eef2f9 100%);
}

.cards-v2 .card-tile .card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cards-v2 .card-tile .card-art-label {
  position: absolute;
  right: 10px;
  top: 10px;
  bottom: auto;
  height: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(31, 45, 71, 0.74);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.cards-v2 .card-tile .story-card-body {
  gap: 5px;
  padding: 12px 14px 14px;
}

.cards-v2 .card-tile h3 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cards-v2 .card-tile .story-card-meta {
  font-size: 0.78rem;
  line-height: 1.55;
}

.cards-v2 .card-tile .story-card-meta:first-child {
  color: var(--w-lake);
  font-weight: 700;
}

.cards-v2 .card-tile .regional-date {
  color: var(--w-muted);
}

.cards-v2 .story-empty {
  padding: 36px 16px;
  border: 1px dashed var(--w-line-strong);
  border-radius: var(--w-radius);
  text-align: center;
}

/* Birthday calendar ------------------------------------------------------- */
.v358.birthday-page .shell {
  width: min(1200px, calc(100% - 40px));
  padding: 28px 0 0;
}

.birthday-page .page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.birthday-page .page-heading h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3.6vw, 2.4rem);
  font-weight: 750;
}

.birthday-page .page-heading p {
  margin: 0;
  color: var(--w-muted);
}

.birthday-page .calendar-sections {
  gap: 4px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--w-line);
}

.birthday-page .calendar-sections a {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--w-muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.birthday-page .calendar-sections a:hover {
  background: var(--w-lav);
  color: var(--w-ink);
}

.birthday-page .calendar-sections a[aria-current="page"] {
  border-color: var(--w-ink);
  background: var(--w-ink);
  color: #fff;
}

.birthday-page .birthday-spread {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(340px, 0.72fr);
  gap: 20px;
  align-items: start;
}

.birthday-page .calendar-paper {
  padding: 22px 24px 18px;
  border: 1px solid var(--w-line);
  border-radius: 20px;
  background: var(--w-surface);
  box-shadow: var(--w-shadow);
}

.birthday-page #month-title {
  font-size: 1.5rem;
  font-weight: 750;
}

.birthday-page .month-controls button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--w-line);
  background: #fbfcfe;
  color: var(--w-ink);
}

.birthday-page .calendar {
  border-spacing: 5px;
  margin: 10px 0 6px;
}

.birthday-page .calendar th {
  color: var(--w-muted);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
}

.birthday-page .calendar td {
  height: 76px;
  padding: 5px 6px;
  border-color: #e8eef7;
  border-radius: 12px;
  background: #fbfcfe;
  font-size: 0.78rem;
}

.birthday-page .calendar td:not(:empty):hover {
  border-color: var(--w-line-strong);
  background: #fff;
}

.birthday-page .calendar td.has-birthday {
  background: color-mix(in srgb, var(--char-color, var(--seal)) 7%, #fff);
  border-color: color-mix(in srgb, var(--char-color, var(--seal)) 30%, var(--w-line));
}

.birthday-page .calendar td.has-birthday:hover {
  background: color-mix(in srgb, var(--char-color, var(--seal)) 11%, #fff);
}

.birthday-page .calendar .day-button {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--w-ink);
  font-weight: 700;
}

.birthday-page .calendar .day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.8rem;
}

.birthday-page .calendar [aria-current="date"] .day-number {
  background: var(--w-accent);
  color: #fff;
}

.birthday-page .birthday-marks {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}

.birthday-page .birthday-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--char-color, var(--seal)) 18%, #fff);
}

.birthday-page .birthday-mark-button {
  padding: 0;
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--char-color, var(--seal)) 35%, transparent);
}

.birthday-page .birthday-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.birthday-page .birthday-mark-button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--w-accent);
}

.birthday-page .memorial-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.birthday-page .art-panel {
  padding: 18px 18px 14px;
  border: 1px solid var(--w-line);
  border-radius: 20px;
  background:
    radial-gradient(130% 100% at 100% 0%, #ffffff 0%, #faf7ff 55%, #f3eefc 100%);
  box-shadow: var(--w-shadow);
}

.birthday-page .art-panel h2 {
  margin: 0 0 12px;
  font-size: 0.98rem;
  font-weight: 700;
}

.birthday-page .art-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.birthday-page .art-stack img {
  width: 100%;
  height: auto;
  border: 1px solid var(--w-line);
  border-radius: 12px;
  background: var(--w-lav);
}

.birthday-page .art-stack img:first-of-type {
  grid-column: 1 / -1;
  max-height: 420px;
  object-fit: contain;
}

.birthday-page .art-year {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: var(--w-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.birthday-page .art-pending {
  padding: 24px 0 18px;
}

.birthday-page .art-panel-foot {
  margin-top: 12px;
}

.birthday-page .art-panel-foot button {
  width: 100%;
  border: 1px solid var(--w-line);
  border-radius: 999px;
  background: #fff;
  color: var(--w-ink);
  font-size: 0.84rem;
}

.birthday-page .predict-panel {
  border: 1px solid var(--w-line);
  border-radius: var(--w-radius);
  background: var(--w-surface);
  padding: 14px 16px 16px;
}

.birthday-page .content-section {
  margin-top: 26px;
}

.birthday-page .content-section h2 {
  font-size: 1.12rem;
}

.birthday-page .upcoming-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.birthday-page .upcoming-item {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--w-line);
  border-radius: var(--w-radius);
  background: var(--w-surface);
  gap: 10px;
}

.birthday-page .upcoming-item:hover {
  border-color: var(--w-line-strong);
  background: #fbfcfe;
}

.birthday-page .upcoming-item .char-chip img {
  width: 44px;
  height: 44px;
}

.birthday-page .upcoming-text strong {
  font-size: 0.92rem;
}

.birthday-page #month-summary {
  margin: 0 0 4px;
  color: var(--w-muted);
  font-size: 0.82rem;
}

/* Mobile ------------------------------------------------------------------ */
@media (max-width: 960px) {
  .home-features {
    grid-template-columns: minmax(0, 1fr);
  }

  .birthday-page .birthday-spread {
    grid-template-columns: minmax(0, 1fr);
  }

  .cards-v2 .card-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cards-v2 .card-filter-grid label:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .v358 .shell,
  .v358 .story-shell,
  .v358 .reader-shell,
  .v358.cards-page .story-shell,
  .v358.birthday-page .shell {
    width: calc(100% - 24px);
  }

  .v358.home-page .shell {
    padding-top: 20px;
  }

  .home-lead {
    padding-bottom: 18px;
  }

  .home-lead h1 {
    font-size: 1.72rem;
    line-height: 1.22;
  }

  .home-features {
    gap: 14px;
    margin-top: 16px;
  }

  .home-feature .panel-head {
    padding: 15px 16px 0;
  }

  .home-feature .feature-body {
    padding: 14px 16px 18px;
  }

  .birthday-feature .feature-countdown {
    gap: 12px;
  }

  .birthday-feature .feature-countdown .char-chip img {
    width: 58px;
    height: 58px;
  }

  .birthday-feature .feature-countdown-text strong {
    font-size: 1.55rem;
  }

  .story-feature .story-feature-visual {
    min-height: 158px;
    margin: 4px 16px 0;
  }

  .story-feature .story-feature-visual img {
    min-height: 158px;
  }

  .cards-promo {
    padding: 14px 16px;
    gap: 10px;
  }

  .cards-promo .promo-arrow {
    font-size: 0.82rem;
  }

  .updates li {
    grid-template-columns: 1fr;
    gap: 2px;
    padding-left: 4px;
  }

  .updates li::before {
    left: -25px;
    top: 18px;
  }

  .story-toolbar-top {
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 8px;
  }

  .story-toolbar-top .story-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .story-v2 .story-tabs a {
    padding: 6px 13px;
    font-size: 0.88rem;
    white-space: nowrap;
  }

  .story-v2 .story-search-row {
    gap: 8px;
  }

  .story-v2 .story-count {
    font-size: 0.78rem;
  }

  .story-v2 .story-bands {
    display: flex;
    overflow-x: auto;
    gap: 6px;
  }

  .story-v2 .story-band {
    flex: 0 0 58px;
  }

  .story-v2 .story-results.grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .story-v2 .story-card-visual {
    aspect-ratio: 2.6 / 1;
    min-height: 112px;
  }

  .cards-v2 .story-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 14px;
  }

  .cards-v2 .card-filters {
    padding: 14px;
    margin: 14px 0;
  }

  .cards-v2 .card-filter-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cards-v2 .card-filter-grid label:first-child {
    grid-column: auto;
  }

  .cards-v2 #card-bands {
    display: flex;
    overflow-x: auto;
    padding-bottom: 12px;
  }

  .cards-v2 #card-bands .filter-chip {
    flex: 0 0 64px;
    min-width: 64px;
  }

  .cards-v2 .character-chips {
    grid-template-columns: repeat(auto-fill, 42px);
    grid-auto-rows: 42px;
    gap: 8px;
    padding-bottom: 4px;
  }

  .cards-v2 .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .cards-v2 .card-tile .story-card-body {
    padding: 10px 10px 12px;
  }

  .cards-v2 .card-tile h3 {
    font-size: 0.86rem;
  }

  .cards-v2 .card-tile .story-card-meta {
    font-size: 0.72rem;
  }

  .cards-v2 .card-tile .card-art-label {
    right: 6px;
    top: 6px;
    padding: 1px 6px;
    font-size: 0.62rem;
  }

  .birthday-page .page-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .birthday-page .calendar-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 8px;
  }

  .birthday-page .calendar-sections a {
    justify-content: center;
    min-width: 0;
    white-space: nowrap;
    font-size: 0.84rem;
  }

  .birthday-page .upcoming-text span {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 0.76rem;
  }

  .birthday-page .calendar-paper {
    padding: 14px 12px 12px;
    border-radius: 16px;
  }

  .birthday-page .calendar {
    border-spacing: 2px;
  }

  .birthday-page .calendar td {
    height: 58px;
    padding: 3px;
    border-radius: 8px;
    font-size: 0.7rem;
  }

  .birthday-page .calendar .day-number {
    width: 22px;
    height: 22px;
    font-size: 0.72rem;
  }

  .birthday-page .birthday-mark {
    width: 20px;
    height: 20px;
  }

  .birthday-page .art-panel {
    padding: 14px;
  }

  .birthday-page .upcoming-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .birthday-page .upcoming-item {
    padding: 10px;
  }
}

/* OurNotes test page ------------------------------------------------------ */
.ournotes-page {
  min-width: 320px;
}

.ournotes-page .ournotes-topbar {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--w-line);
}

.ournotes-page .ournotes-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 750;
  font-size: 0.98rem;
  color: var(--w-ink);
}

.ournotes-page .ournotes-brand span {
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 500;
}

.ournotes-page .test-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--w-accent);
  border-radius: 999px;
  color: var(--w-accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.ournotes-page .ournotes-main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 60px;
}

.ournotes-page .ournotes-lead {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.ournotes-page .ournotes-lead h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.ournotes-page .ournotes-lead p {
  margin: 0;
  color: var(--w-muted);
  font-size: 0.86rem;
}

.ournotes-page .ournotes-layout {
  display: grid;
  grid-template-columns: minmax(230px, 292px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ournotes-page .sample-list {
  border: 1px solid var(--w-line);
  border-radius: var(--w-radius);
  background: var(--w-surface);
  overflow: hidden;
}

.ournotes-page .sample-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--w-line);
}

.ournotes-page .sample-list-head h2 {
  margin: 0;
  font-size: 0.92rem;
}

.ournotes-page .sample-list-head span {
  color: var(--w-muted);
  font-size: 0.74rem;
}

.ournotes-page .sample-list ol {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: grid;
  gap: 2px;
  max-height: 560px;
  overflow-y: auto;
}

.ournotes-page .sample-item {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--w-ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.ournotes-page .sample-item:hover {
  background: #f8fafd;
}

.ournotes-page .sample-item[aria-current="true"] {
  border-color: var(--w-line-strong);
  background: var(--w-lav);
}

.ournotes-page .sample-item strong {
  font-size: 0.85rem;
  line-height: 1.45;
  font-weight: 700;
}

.ournotes-page .sample-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--w-muted);
  font-size: 0.7rem;
}

.ournotes-page .kind-badge {
  display: inline-flex;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef8fa;
  color: var(--w-lake);
  font-size: 0.66rem;
  font-weight: 800;
}

.ournotes-page .reader-pane {
  min-width: 0;
  border: 1px solid var(--w-line);
  border-radius: var(--w-radius);
  background: var(--w-surface);
  overflow: hidden;
}

.ournotes-page .reader-head {
  display: grid;
  gap: 6px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--w-line);
}

.ournotes-page .reader-head .ournotes-kicker {
  margin: 0;
  color: var(--w-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ournotes-page .reader-head h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
}

.ournotes-page .reader-head .reader-sub {
  margin: 0;
  color: var(--w-muted);
  font-size: 0.8rem;
}

.ournotes-page .reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--w-line);
  background: #fbfcfe;
}

.ournotes-page .reader-toolbar .group {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--w-line);
  border-radius: 999px;
  background: #fff;
}

.ournotes-page .reader-toolbar button {
  min-height: 34px;
  padding: 2px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--w-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.ournotes-page .reader-toolbar button[aria-pressed="true"] {
  background: var(--w-ink);
  color: #fff;
}

.ournotes-page .reader-toolbar .read-state {
  margin-left: auto;
  border: 1px solid var(--w-line);
  background: #fff;
  color: var(--w-lake);
}

.ournotes-page .reader-toolbar .read-state[data-state="read"] {
  border-color: var(--w-lake);
  background: #eef8fa;
}

.ournotes-page .reader-lines {
  padding: 18px 26px 26px;
  display: grid;
  gap: 14px;
  max-height: 62vh;
  overflow-y: auto;
}

.ournotes-page .line {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.ournotes-page .line .speaker {
  color: var(--w-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.ournotes-page .line .text {
  display: grid;
  gap: 2px;
}

.ournotes-page .line .cn {
  color: var(--w-ink);
  font-size: 0.98rem;
  line-height: 1.9;
  white-space: pre-line;
}

.ournotes-page .line .jp {
  color: var(--w-muted);
  font-size: 0.82rem;
  line-height: 1.8;
  white-space: pre-line;
}

.ournotes-page[data-lang="cn"] .line .jp,
.ournotes-page[data-lang="jp"] .line .cn {
  display: none;
}

.ournotes-page .reader-pager {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 22px;
  border-top: 1px solid var(--w-line);
  background: #fbfcfe;
}

.ournotes-page .reader-pager button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--w-line);
  border-radius: 999px;
  background: #fff;
  color: var(--w-ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.ournotes-page .reader-pager button:disabled {
  opacity: 0.45;
}

.ournotes-page .state-box {
  margin: 22px;
  padding: 26px 18px;
  border: 1px dashed var(--w-line-strong);
  border-radius: var(--w-radius-sm);
  color: var(--w-muted);
  text-align: center;
  font-size: 0.86rem;
}

.ournotes-page .note {
  margin: 16px 0 0;
  color: var(--w-muted);
  font-size: 0.76rem;
  line-height: 1.7;
}

.ournotes-page .ournotes-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 28px;
  border-top: 1px solid var(--w-line);
  color: var(--w-muted);
  font-size: 0.75rem;
}

@media (max-width: 760px) {
  .ournotes-page .ournotes-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ournotes-page .sample-list ol {
    max-height: 220px;
  }

  .ournotes-page .reader-lines {
    padding: 14px 16px 22px;
    max-height: none;
  }

  .ournotes-page .line {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ournotes-page .line .speaker {
    font-size: 0.72rem;
    line-height: 1.6;
  }

  .ournotes-page .reader-toolbar {
    padding: 10px 16px;
  }

  .ournotes-page .reader-head,
  .ournotes-page .reader-pager {
    padding-left: 16px;
    padding-right: 16px;
  }
}
