@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,700;0,8..60,900;1,8..60,400;1,8..60,700&family=Inter:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;700;900&family=Noto+Sans+TC:wght@400;500;700;900&family=UnifrakturMaguntia&family=Noto+Serif+JP:wght@400;700;900&family=Noto+Sans+JP:wght@400;500;700&family=Noto+Serif+KR:wght@400;700;900&family=Noto+Sans+KR:wght@400;500;700&family=Amiri:ital,wght@0,400;0,700;1,400&family=Noto+Naskh+Arabic:wght@400;500;700&display=swap');

:root {
  --ink: #1a1a1a;
  --paper: #f5f0e8;
  --rule: #2a2a2a;
  --accent: #8b0000;
  --faded: #555;
  --light-rule: #bbb;

  --font-masthead: 'UnifrakturMaguntia', Georgia, serif;
  --font-headline: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-cn-headline: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Source Han Sans SC', 'WenQuanYi Micro Hei', sans-serif;
  --font-cn-body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Source Han Sans SC', 'WenQuanYi Micro Hei', sans-serif;
  --font-cn-ui: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Source Han Sans SC', 'WenQuanYi Micro Hei', sans-serif;

  --font-hant-headline: 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', 'Source Han Sans TC', 'Hiragino Sans CNS', sans-serif;
  --font-hant-body: 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', 'Source Han Sans TC', 'Hiragino Sans CNS', sans-serif;
  --font-hant-ui: 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', 'Source Han Sans TC', 'Hiragino Sans CNS', sans-serif;

  --font-ja-headline: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', 'YuMincho', 'MS PMincho', serif;
  --font-ja-body: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic Medium', 'Yu Gothic', 'Meiryo', sans-serif;
  --font-ja-ui: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;

  --font-ko-headline: 'Noto Serif KR', 'Nanum Myeongjo', 'Batang', serif;
  --font-ko-body: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-ko-ui: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;

  --font-ar-headline: 'Amiri', 'Noto Naskh Arabic', 'Traditional Arabic', 'Tahoma', serif;
  --font-ar-body: 'Noto Naskh Arabic', 'Amiri', 'Traditional Arabic', 'Tahoma', serif;
  --font-ar-ui: 'Noto Naskh Arabic', 'Tahoma', 'Arial', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #d4cfc5;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

body.lang-zh,
body.lang-cn {
  --font-headline: var(--font-cn-headline);
  --font-body: var(--font-cn-body);
  --font-ui: var(--font-cn-ui);
}

body.lang-zh-Hant {
  --font-headline: var(--font-hant-headline);
  --font-body: var(--font-hant-body);
  --font-ui: var(--font-hant-ui);
}

body.lang-ja {
  --font-headline: var(--font-ja-headline);
  --font-body: var(--font-ja-body);
  --font-ui: var(--font-ja-ui);
}

body.lang-ko {
  --font-headline: var(--font-ko-headline);
  --font-body: var(--font-ko-body);
  --font-ui: var(--font-ko-ui);
}

body.lang-ar {
  --font-headline: var(--font-ar-headline);
  --font-body: var(--font-ar-body);
  --font-ui: var(--font-ar-ui);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.newspaper {
  max-width: 1200px;
  margin: 30px auto;
  background: var(--paper);
  padding: 0;
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
  position: relative;
}

.newspaper::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0,0,0,0.008) 1px, rgba(0,0,0,0.008) 2px);
  pointer-events: none;
  z-index: 1;
}

/* ─── Language toggle ─── */
.lang-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.lang-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--ink);
  color: #ccc;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  user-select: none;
  transition: background 0.15s;
}

.lang-pill:hover { background: #2a2a2a; }

.lang-pill-name { color: #fff; font-weight: 600; }

.lang-pill-arrow {
  font-size: 8px;
  opacity: 0.5;
  transition: transform 0.2s;
}

.lang-toggle.open .lang-pill-arrow { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: var(--ink);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.lang-toggle.open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 16px;
  color: #999;
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

[dir="rtl"] .lang-menu-item { text-align: right; }

.lang-menu-item:hover { background: rgba(255,255,255,0.06); color: #ddd; }

.lang-menu-item.active {
  color: #fff;
  background: var(--accent);
}

.lang-menu-item .lang-code {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.5;
}

.lang-menu-item.active .lang-code { opacity: 0.8; }

/* hide old buttons */
.lang-btn { display: none; }

/* ─── Masthead ─── */
.masthead {
  text-align: center;
  padding: 25px 40px 0;
  border-bottom: 4px double var(--rule);
}

.masthead-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--faded);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--light-rule);
  margin-bottom: 10px;
}
.masthead-top > :first-child { flex: 1; text-align: left; }
.masthead-top > :nth-child(2) { flex: 0 0 auto; }
.masthead-top > :last-child { flex: 1; text-align: right; }

.masthead-top a,
.masthead-title a,
.masthead-title-cn a {
  color: inherit;
  text-decoration: none;
}

.masthead-title {
  font-family: var(--font-masthead);
  font-size: 64px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 2px;
  margin: 5px 0;
}

.masthead-title-cn {
  font-family: var(--font-headline);
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 8px;
  margin: 5px 0;
}

.masthead-subtitle {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--faded);
}

.masthead-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 0;
  border-top: 1px solid var(--light-rule);
  color: var(--faded);
  letter-spacing: 0.5px;
}

.topic-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topic-icon-svg {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.topic-icon-muted {
  color: var(--faded);
}

.masthead-meta .topic-icon-svg {
  width: 13px;
  height: 13px;
}

/* ─── Content ─── */
.content { padding: 0 30px 30px; }

.headline-section {
  border-bottom: 2px solid var(--rule);
  padding: 20px 0;
}

.main-headline {
  font-family: var(--font-headline);
  font-size: 42px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  margin-bottom: 8px;
}

.main-headline-cn {
  font-family: var(--font-headline);
  font-size: 38px;
  font-weight: 900;
  line-height: 1.3;
  text-align: center;
  margin-bottom: 8px;
}

.sub-headline {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 400;
  font-style: italic;
  text-align: center;
  color: var(--faded);
  max-width: 800px;
  margin: 0 auto 12px;
  line-height: 1.4;
}

.byline {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-top: 5px;
}

/* ─── Hero image ─── */
.hero-image {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  object-fit: cover;
  display: block;
  filter: grayscale(30%) contrast(1.1);
  border-top: 1px solid var(--light-rule);
  border-bottom: 1px solid var(--light-rule);
}

.hero-caption {
  font-size: 10px;
  color: var(--faded);
  text-align: right;
  padding: 4px 0;
  letter-spacing: 0.5px;
  font-style: italic;
}

/* ─── Grid layouts ─── */
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--light-rule);
  align-items: start;
}

.grid-21 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0;
  border-top: 2px solid var(--rule);
  align-items: start;
}

.grid-12 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0;
  border-top: 1px solid var(--light-rule);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--light-rule);
  align-items: start;
}

.cards-grid {
  border-top: 1px solid var(--light-rule);
  align-items: start;
}

.cards-grid .col {
  min-height: auto;
}

.cards-masonry {
  display: grid;
  border-top: 1px solid var(--light-rule);
  align-items: start;
}

.cards-masonry-2 {
  grid-template-columns: 1fr 1fr;
}

.cards-masonry-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.cards-column {
  border-right: 1px solid var(--light-rule);
  align-self: start;
  overflow: hidden;
}

.cards-column:last-child {
  border-right: none;
}

.cards-column .col {
  border-right: none;
  border-bottom: 1px solid var(--light-rule);
}

.cards-column .col:last-child {
  border-bottom: none;
}

.cards-grid-divider {
  margin-bottom: 0;
}

.cards-grid-col.short .col-headline,
.cards-grid-col.short .col-headline-lg {
  font-size: 20px;
  line-height: 1.22;
}

.cards-grid-thumb.compact {
  height: 130px;
}

/* ─── Treemap packed grid ─── */
.packed-grid {
  width: 100%;
  border-top: 1px solid var(--light-rule);
}
.packed-grid > .cards-masonry {
  border-top: none;
}

.packed-grid > .cards-masonry + * {
  border-top: 1px solid var(--light-rule);
}

.packed-row {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid var(--light-rule);
}

.packed-block {
  box-sizing: border-box;
  padding: 14px 16px;
  border-right: 1px solid var(--light-rule);
  min-width: 0;
}
.packed-row > .packed-block:last-child {
  border-right: none;
}

.packed-block .article-thumb {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 10px;
  filter: grayscale(20%) contrast(1.05);
}

.col-full {
  border-right: none;
  border-top: 1px solid var(--light-rule);
}

.cards-grid-col.span-full {
  grid-column: 1 / -1;
}

.cards-grid-col.span-2 {
  grid-column: span 2;
}

.brief-stack {
  display: grid;
  gap: 0;
}

.brief-stack-item {
  padding-bottom: 8px;
}

.brief-stack .article-brief .col-headline,
.brief-stack .article-brief .col-headline-lg {
  font-size: 19px;
  line-height: 1.25;
}

.article-bullets {
  margin: 0 0 10px 18px;
  padding: 0;
}

.article-bullets li {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.6;
}

.quick-briefs {
  margin: 8px 0 0 16px;
  padding: 0;
  font-size: 12px;
  line-height: 1.55;
}

.quick-briefs li {
  margin-bottom: 8px;
}

.micro-briefs-block {
  padding: 12px 16px;
  border-top: 1px dashed var(--light-rule);
  background: rgba(0,0,0,0.015);
}

.micro-briefs-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}

.micro-briefs-list {
  margin: 0 0 0 14px;
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
}

.micro-briefs-list li {
  margin-bottom: 6px;
}

.micro-brief-body {
  font-size: 11px;
  color: var(--faded);
}

.grid-hero {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 0;
  border-top: 2px solid var(--rule);
}

.col {
  padding: 18px 20px;
  border-right: 1px solid var(--light-rule);
  overflow: hidden;
}

.col:last-child { border-right: none; }

.col img { max-width: 100%; }

/* ─── Section labels ─── */
.section-label {
  font-family: var(--font-ui);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 2px;
  margin-bottom: 12px;
  font-weight: 700;
}

.section-banner {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 700;
  margin: 18px -30px 14px;
}

/* ─── Headlines ─── */
.col-headline {
  font-family: var(--font-headline);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 10px;
}

.col-headline-sm {
  font-family: var(--font-headline);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
}

.col-headline-lg {
  font-family: var(--font-headline);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 12px;
}

.col-headline-source {
  margin: -6px 0 8px;
  line-height: 1;
}

/* ─── Body text ─── */
.col p, .col li {
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 10px;
  text-align: left;
}

body.lang-cjk .col p,
body.lang-cjk .col li {
  line-height: 1.9;
}

body.lang-cjk .sub-headline {
  line-height: 1.55;
}

.col ul { padding-left: 18px; margin-bottom: 10px; }
.col li { margin-bottom: 6px; }

.dropcap::first-letter {
  font-family: var(--font-headline);
  float: left;
  font-size: 62px;
  line-height: 50px;
  padding-right: 8px;
  padding-top: 4px;
  font-weight: 900;
  color: var(--accent);
}

/* ─── Article thumbnail ─── */
.article-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  margin-bottom: 12px;
  filter: grayscale(20%) contrast(1.05);
  border: 1px solid var(--light-rule);
}

.article-thumb-sm {
  float: right;
  width: 120px;
  height: 90px;
  object-fit: cover;
  margin: 0 0 10px 14px;
  filter: grayscale(20%) contrast(1.05);
  border: 1px solid var(--light-rule);
}

/* ─── Edition card images ─── */
.edition-card-img-link {
  display: block;
}

.edition-card-hero {
  width: 100%;
  aspect-ratio: 2.4 / 1;
  max-height: 200px;
  object-fit: cover;
  display: block;
  margin-bottom: 12px;
  filter: grayscale(20%) contrast(1.05);
  border: 1px solid var(--light-rule);
}

/* ─── Dividers ─── */
.divider { border: none; border-top: 1px solid var(--light-rule); margin: 15px 0; }

.star-divider {
  text-align: center;
  color: var(--light-rule);
  font-size: 14px;
  margin: 12px 0;
  letter-spacing: 8px;
}

/* ─── Quotes ─── */
.quote-block {
  border-left: 3px solid var(--accent);
  padding: 10px 15px;
  margin: 12px 0;
  font-style: italic;
  background: rgba(0,0,0,0.02);
  font-size: 14px;
  line-height: 1.6;
}

.quote-block small { font-style: normal; color: var(--faded); }

/* ─── Editor Comment ─── */
.editor-comment {
  margin: 10px 0 6px;
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink);
  background: rgba(139, 0, 0, 0.04);
  border-left: 2px solid var(--accent);
  border-radius: 0 3px 3px 0;
}

body.lang-cjk .editor-comment {
  line-height: 1.72;
}

.editor-comment-label {
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-right: 6px;
}

/* ─── Figures ─── */
.figure-box {
  background: #eae5da;
  padding: 14px 12px;
  margin: 14px 0;
  text-align: center;
  font-size: 30px;
  font-weight: 900;
  font-family: var(--font-headline);
  color: var(--accent);
  border: 1px solid var(--light-rule);
}

.figure-box.figure-up { color: #1a8c3a; }
.figure-box.figure-down { color: #c0392b; }

.figure-box .arrow-up {
  font-size: 0.6em;
  vertical-align: middle;
  color: #1a8c3a;
}
.figure-box .arrow-down {
  font-size: 0.6em;
  vertical-align: middle;
  color: #c0392b;
}

.figure-box small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--faded);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
}

.figure-row {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}

.figure-row .figure-box { flex: 1; margin: 0; }

/* Figure strip — horizontal highlight bar */
.figure-strip {
  display: flex;
  gap: 0;
  border-top: 2px solid var(--rule);
  border-bottom: 2px solid var(--rule);
  margin: 0;
  background: #eae5da;
}

.figure-strip .figure-strip-item {
  flex: 1;
  text-align: center;
  padding: 14px 10px;
  border-right: 1px solid var(--light-rule);
  font-family: var(--font-headline);
}

.figure-strip .figure-strip-item:last-child { border-right: none; }

.figure-strip .figure-strip-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.figure-strip .figure-strip-label {
  font-size: 10px;
  color: var(--faded);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

.ticker-up { color: #1a7f37; }
.ticker-down { color: #cf222e; }
.figure-strip .figure-strip-label .ticker-up,
.figure-strip .figure-strip-label .ticker-down { font-weight: 700; }

/* ─── Source badges ─── */
.source-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 6px;
}

.source-badge.news,
.source-badge.x-twitter,
.source-badge.hackernews,
.source-badge.arxiv,
.source-badge.github,
.source-badge.rss,
.source-badge.external { background: #e0e0e0; color: #555; }

.source-link {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--faded);
  margin-top: 6px;
  margin-bottom: 4px;
  display: block;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.source-link:hover { opacity: 1; }
.source-link a { color: var(--accent); }

.source-link.source-link-with-share {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.source-link.source-link-with-share > .share-trigger {
  margin-left: auto;
  flex-shrink: 0;
}
[dir="rtl"] .source-link.source-link-with-share > .share-trigger {
  margin-left: 0;
  margin-right: auto;
}

/* Fallback when there's no .source-link preceding it */
.article-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
  margin-bottom: 4px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.article-actions:hover { opacity: 1; }
[dir="rtl"] .article-actions { justify-content: flex-start; }

/* ─── Share trigger icon button ─── */
.share-trigger {
  appearance: none;
  background: transparent;
  border: none;
  padding: 3px 5px;
  margin: 0;
  color: var(--ink);
  cursor: pointer;
  border-radius: 2px;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.share-trigger:hover {
  opacity: 1;
  box-shadow: 0 0 0 1px var(--ink);
}
.share-trigger:focus-visible {
  outline: none;
  opacity: 1;
  box-shadow: 0 0 0 1px var(--accent);
}
.share-trigger:active {
  transform: translateY(1px);
}
.share-trigger i[data-lucide] { display: inline-flex; }
.share-trigger svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
  display: block;
}

/* ─── Share popover (anchored, paper-styled) ─── */
.share-popover {
  position: absolute;
  z-index: 1200;
  min-width: 188px;
  max-width: 260px;
  padding: 6px 0;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-family: var(--font-ui);
  color: var(--ink);
  box-shadow: 2px 2px 0 0 rgba(26, 26, 26, 0.85), 0 10px 28px rgba(0, 0, 0, 0.22);
  animation: sharePopIn 0.14s ease-out;
}

@keyframes sharePopIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

.share-popover-header {
  padding: 6px 14px 8px;
  font-size: 10.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--faded);
  border-bottom: 1px solid var(--light-rule);
  margin-bottom: 4px;
  font-weight: 600;
}

.share-popover-list {
  display: flex;
  flex-direction: column;
}

.share-option {
  appearance: none;
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}
[dir="rtl"] .share-option { text-align: right; }

.share-option svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
  flex-shrink: 0;
}

.share-option:hover,
.share-option:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

.share-option.share-option-primary {
  font-weight: 600;
}

/* ─── Toast for copy feedback ─── */
.share-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 12px);
  z-index: 1300;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.3px;
  border-radius: 2px;
  box-shadow: 2px 2px 0 0 rgba(26, 26, 26, 0.6), 0 10px 24px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.22s ease;
  pointer-events: none;
  max-width: 88vw;
  text-align: center;
}
.share-toast.share-toast-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ─── WeChat QR modal (desktop zh flow) ─── */
.share-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 18, 14, 0.58);
  backdrop-filter: blur(2px);
  animation: shareModalFadeIn 0.18s ease-out;
}
.share-modal-card {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 0 rgba(26, 26, 26, 0.45), 0 26px 60px rgba(0, 0, 0, 0.4);
  padding: 26px 28px 22px;
  max-width: 340px;
  width: min(88vw, 340px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: shareModalPop 0.22s cubic-bezier(0.18, 0.9, 0.32, 1.18);
}
.share-modal-title {
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.15;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
  width: 100%;
}
.wechat-qr-panel {
  background: #fff;
  padding: 10px;
  border: 1px solid rgba(26, 26, 26, 0.2);
  box-shadow: 2px 2px 0 0 rgba(26, 26, 26, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
}
.wechat-qr-panel svg {
  width: 200px;
  height: 200px;
  display: block;
}
.wechat-qr-instruction {
  font-family: var(--font-body, Georgia, serif);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted, #4a4a4a);
  text-align: center;
  padding: 0 4px;
}
.share-modal-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
  justify-content: center;
}
.share-modal-btn {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 9px 18px;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.share-modal-btn:hover {
  background: var(--ink);
  color: var(--paper);
}
.share-modal-btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.share-modal-btn-primary:hover {
  background: #333;
}
@keyframes shareModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes shareModalPop {
  0% { opacity: 0; transform: scale(0.92) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@media (max-width: 400px) {
  .share-modal-card { padding: 22px 20px 18px; }
  .wechat-qr-panel { width: 200px; height: 200px; }
  .wechat-qr-panel svg { width: 180px; height: 180px; }
}

/* ─── WeChat mobile share modal (zh locale, outside in-app browser) ─── */
.wechat-mobile-card { max-width: 360px; width: min(92vw, 360px); }
.wechat-mobile-instruction {
  font-family: var(--font-body, Georgia, serif);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted, #4a4a4a);
  text-align: center;
  padding: 0 2px;
}
.wechat-mobile-url {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--ink);
  background: rgba(26, 26, 26, 0.04);
  border: 1px solid rgba(26, 26, 26, 0.25);
  border-radius: 2px;
  box-shadow: inset 2px 2px 0 0 rgba(26, 26, 26, 0.06);
  text-align: center;
  line-height: 1.3;
  user-select: all;
  -webkit-user-select: all;
  word-break: break-all;
  outline: none;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.wechat-mobile-url:focus {
  border-color: var(--ink);
  background: #fffdf6;
}
.share-modal-btn-ok {
  background: #1a6b2f;
  color: #fff;
  border-color: #1a6b2f;
}
.share-modal-btn-ok:hover { background: #1f7d36; color: #fff; }
.share-modal-btn-warn {
  background: #8a2b1f;
  color: #fff;
  border-color: #8a2b1f;
}
.share-modal-btn-warn:hover { background: #a03323; color: #fff; }

/* ─── WeChat in-app share hint (shown when UA contains MicroMessenger) ─── */
.wechat-inapp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  background: rgba(10, 10, 10, 0.86);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 14px 18px 0;
  animation: shareModalFadeIn 0.18s ease-out;
  cursor: pointer;
}
.wechat-inapp-arrow {
  color: #ffffff;
  width: 110px;
  height: 110px;
  margin-right: 6px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.7));
}
.wechat-inapp-tip {
  color: #ffffff;
  font-family: var(--font-body, Georgia, serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
  max-width: 280px;
  margin-top: 14px;
  margin-right: 8px;
  text-align: right;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.wechat-inapp-close {
  margin-top: 32px;
  align-self: center;
  padding: 11px 30px;
  background: transparent;
  color: #ffffff;
  border: 1.5px solid #ffffff;
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
}
.wechat-inapp-close:hover,
.wechat-inapp-close:focus {
  background: #ffffff;
  color: #1a1a1a;
}
/* Arabic reads right-to-left, mirror the hint column */
html[lang="ar"] .wechat-inapp-overlay {
  align-items: flex-start;
  direction: rtl;
}
html[lang="ar"] .wechat-inapp-arrow { transform: scaleX(-1); margin-left: 10px; margin-right: 0; }
html[lang="ar"] .wechat-inapp-tip { text-align: left; margin-left: 8px; margin-right: 0; }

/* ─── Deep-link landing highlight ─── */
.article-highlight {
  animation: articleHighlight 2.4s ease-out;
}
@keyframes articleHighlight {
  0%   { background: rgba(139, 0, 0, 0.00); box-shadow: 0 0 0 0 rgba(139, 0, 0, 0); }
  8%   { background: rgba(139, 0, 0, 0.08); box-shadow: 0 0 0 6px rgba(139, 0, 0, 0.06); }
  60%  { background: rgba(139, 0, 0, 0.05); box-shadow: 0 0 0 6px rgba(139, 0, 0, 0.03); }
  100% { background: rgba(139, 0, 0, 0.00); box-shadow: 0 0 0 0 rgba(139, 0, 0, 0); }
}

@media (max-width: 600px) {
  .share-popover {
    min-width: 84vw;
    max-width: 92vw;
  }
}

/* ─── Home / Headline links ─── */
a.home-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
a.home-link:hover {
  color: inherit;
  text-decoration: none;
}
a.headline-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
a.headline-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ─── Bottom bar ─── */
.bottom-bar {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 14px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ─── Loading / Error ─── */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--faded);
  font-size: 16px;
}

.loading::after {
  content: '';
  display: block;
  width: 30px;
  height: 30px;
  margin: 20px auto;
  border: 3px solid var(--light-rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
  text-align: center;
  padding: 40px 20px;
  color: var(--accent);
  font-size: 16px;
}

/* ─── Homepage cards ─── */
.paper-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 20px 30px;
}

.paper-card {
  background: var(--paper);
  border: 1px solid var(--light-rule);
  padding: 20px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}

.paper-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.paper-card .topic-icon { font-size: 24px; margin-bottom: 8px; }
.paper-card .card-date { font-size: 11px; color: var(--faded); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.paper-card .card-topic { font-size: 10px; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); margin-bottom: 8px; font-weight: 700; }
.paper-card .card-title { font-family: var(--font-headline); font-size: 18px; font-weight: 700; line-height: 1.25; margin-bottom: 6px; }
.paper-card .card-subtitle { font-size: 13px; color: var(--faded); line-height: 1.4; }

.date-group-header {
  font-family: var(--font-ui);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--faded);
  padding: 0 30px;
  margin-top: 20px;
  border-bottom: 1px solid var(--light-rule);
  padding-bottom: 6px;
}

.empty-state { text-align: center; padding: 80px 20px; color: var(--faded); }
.empty-state h2 { font-family: var(--font-headline); font-size: 28px; margin-bottom: 12px; color: var(--ink); }

.generate-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-family: var(--font-ui);
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.2s;
}

.generate-btn:hover { background: #6b0000; }
.generate-btn:disabled { background: #999; cursor: wait; }

/* ─── Horizontal article card ─── */
.article-card {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--light-rule);
}

.article-card:last-child { border-bottom: none; }

.article-card-img {
  flex: 0 0 220px;
  min-height: 180px;
  background-size: cover;
  background-position: center;
  filter: grayscale(20%) contrast(1.05);
}

.article-card-body {
  flex: 1;
  padding: 18px 20px;
}

.article-card:nth-child(even) { flex-direction: row-reverse; }

/* Pull quote — large extracted quote */
.pull-quote {
  font-family: var(--font-headline);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--accent);
  text-align: center;
  padding: 20px 30px;
  margin: 16px 0;
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  font-style: italic;
}

.pull-quote-src {
  font-size: 11px;
  font-weight: 400;
  font-style: normal;
  color: var(--faded);
  display: block;
  margin-top: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ─── Omnibus mode ─── */
.omnibus-root {
  max-width: 1200px;
  margin: 20px auto 60px;
}

.edition-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 240, 232, 0.96);
  border: 1px solid var(--light-rule);
  border-bottom: 2px solid var(--rule);
  padding: 10px 14px;
  margin-bottom: 18px;
  backdrop-filter: blur(4px);
}

.edition-nav-meta {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--faded);
  margin-bottom: 8px;
}

.edition-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.edition-nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(139, 0, 0, 0.25);
  padding: 5px 8px;
  background: #fff;
}

.edition-nav-links a:hover {
  background: #f7eee2;
  text-decoration: none;
}

.edition-nav-home {
  border-color: var(--light-rule) !important;
  color: var(--faded) !important;
}

.edition-nav-links a.edition-nav-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.edition-nav-links a.edition-nav-active:hover {
  background: #a00000;
}

.omnibus-paper-wrap {
  margin-bottom: 8px;
}

.omnibus-topic-title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px 4px;
}

.omnibus-divider {
  text-align: center;
  color: var(--faded);
  letter-spacing: 5px;
  margin: 10px 0 24px;
  font-size: 12px;
}

/* ─── Omnibus Section Masthead (non-first papers) ─── */
.omnibus-section-masthead {
  border-bottom: 2px solid var(--rule);
  border-top: none;
  padding: 0 40px;
  position: relative;
}

.omnibus-section-masthead::before {
  content: "\2726";
  display: block;
  text-align: center;
  color: var(--faded);
  font-size: 10px;
  letter-spacing: 12px;
  padding: 18px 0 14px;
  border-top: 1px solid var(--light-rule);
}

.omnibus-section-kicker {
  text-align: center;
  padding-bottom: 6px;
}

.omnibus-section-kicker .topic-with-icon {
  font-family: var(--font-headline);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lang-cjk .omnibus-section-kicker .topic-with-icon {
  font-family: var(--font-cn-headline);
  font-size: 26px;
  letter-spacing: 3px;
}

.omnibus-section-icon {
  width: 24px;
  height: 24px;
}

.omnibus-section-desk {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--faded);
  padding-bottom: 8px;
}

.lang-cjk .omnibus-section-desk {
  letter-spacing: 1px;
  text-transform: none;
}

.omnibus-section-masthead .masthead-meta {
  justify-content: center;
  gap: 16px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .omnibus-root { margin: 0; padding-bottom: 24px; }
  .edition-nav { margin: 0 10px 12px; top: 6px; }
  .edition-nav-links { gap: 6px; }
  .edition-nav-links a { font-size: 11px; padding: 4px 6px; }
  .newspaper { margin: 0; }
  .masthead { padding: 15px 15px 0; }
  .masthead-title { font-size: 42px; }
  .masthead-title-cn { font-size: 36px; letter-spacing: 4px; }
  .content { padding: 0 12px 20px; }
  .section-banner { margin: 14px -12px 10px; }
  .main-headline { font-size: 26px; }
  .main-headline-cn { font-size: 24px; }
  .sub-headline { font-size: 16px; }
  .col-headline-lg { font-size: 24px; }
  .grid-3, .grid-21, .grid-12, .grid-2, .grid-hero { grid-template-columns: 1fr !important; }
  .cards-masonry, .cards-masonry-2, .cards-masonry-3 { grid-template-columns: 1fr !important; }
  .packed-row { flex-direction: column; }
  .packed-block {
    flex: none !important;
    max-width: 100% !important;
    border-right: none;
  }
  .cards-column { border-right: none; }
  .cards-column .col { border-bottom: 1px solid var(--light-rule); }
  .col { border-right: none; border-bottom: 1px solid var(--light-rule); }
  .col:last-child { border-bottom: none; }
  .lang-toggle { top: 10px; right: 10px; }
  .lang-pill { padding: 6px 10px; font-size: 11px; }
  .figure-row { flex-direction: column; }
  .figure-strip { flex-direction: column; margin: 0; }
  .figure-strip .figure-strip-item { border-right: none; border-bottom: 1px solid var(--light-rule); }
  .masthead-top { flex-direction: column; gap: 4px; }
  .masthead-meta { flex-direction: column; gap: 2px; text-align: center; }
  .omnibus-section-masthead { padding: 0 15px; }
  .omnibus-section-kicker .topic-with-icon { font-size: 22px; }
  .lang-cjk .omnibus-section-kicker .topic-with-icon { font-size: 20px; }
  .paper-cards { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .date-group-header { padding: 0 12px; }
  .hero-image { aspect-ratio: 16 / 9; max-height: 300px; }
  .article-thumb-sm { float: none; width: 100%; height: 140px; margin: 0 0 10px 0; }
  .article-card { flex-direction: column !important; }
  .article-card-img { flex: 0 0 auto; height: 180px; min-height: 0; }
  .pull-quote { font-size: 18px; padding: 14px 16px; }
}

@media print {
  body {
    background: #fff !important;
  }

  .lang-toggle {
    display: none !important;
  }

  .newspaper {
    margin: 0 !important;
    box-shadow: none !important;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .newspaper::before {
    opacity: 0.35;
  }

  .edition-nav {
    position: static !important;
    top: auto !important;
  }

  .omnibus-paper-wrap {
    break-after: page;
    page-break-after: always;
  }

  .omnibus-divider {
    display: none;
  }
}

/* ─── Arabic typography ─── */

body.lang-ar .masthead-title {
  font-family: var(--font-ar-headline);
  letter-spacing: 0;
}

body.lang-ar .masthead-subtitle {
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
}

body.lang-ar .col p,
body.lang-ar .col li {
  line-height: 1.85;
}

body.lang-ar .sub-headline {
  font-style: normal;
  line-height: 1.5;
}

body.lang-ar .editor-comment {
  line-height: 1.72;
}

/* ─── RTL (Arabic) ─── */

[dir="rtl"] .newspaper,
[dir="rtl"] .omnibus-root {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .grid-21 { direction: rtl; }
[dir="rtl"] .card-grid { direction: rtl; }
[dir="rtl"] .lead-sidebar { direction: rtl; }
[dir="rtl"] .masthead-top { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .byline { letter-spacing: 0; }
[dir="rtl"] .section-label { letter-spacing: 0; }
[dir="rtl"] .section-banner { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .edition-nav-links { direction: rtl; }
[dir="rtl"] .quick-briefs { padding-right: 18px; padding-left: 0; }
[dir="rtl"] .source-badge { margin-left: 0; margin-right: 6px; }

/* ─── Date Calendar Picker ─── */

.date-picker-trigger {
  cursor: pointer;
  border-bottom: 1px dashed var(--faded);
  transition: color 0.15s;
  position: relative;
}

.date-picker-trigger:hover {
  color: var(--accent);
}

.date-picker-trigger::after {
  content: " ▾";
  font-size: 0.8em;
  opacity: 0.5;
}

.calendar-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  background: rgba(0, 0, 0, 0.25);
  animation: calendarFadeIn 0.15s ease-out;
}

@keyframes calendarFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.calendar-popup {
  background: var(--paper);
  border: 2px solid var(--rule);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
  padding: 20px 22px 18px;
  min-width: 300px;
  max-width: 340px;
  font-family: var(--font-ui);
  position: relative;
  animation: calendarSlideIn 0.15s ease-out;
}

@keyframes calendarSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--light-rule);
  padding-bottom: 10px;
}

.calendar-title {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.5px;
}

.calendar-nav {
  display: flex;
  gap: 4px;
}

.calendar-nav button {
  background: none;
  border: 1px solid var(--light-rule);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  font-family: var(--font-ui);
}

.calendar-nav button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--faded);
  margin-bottom: 6px;
  border-bottom: 1px solid var(--light-rule);
  padding-bottom: 6px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-day {
  text-align: center;
  font-size: 13px;
  padding: 6px 2px;
  cursor: default;
  color: #ccc;
  border: 1px solid transparent;
  transition: all 0.12s;
  line-height: 1;
}

.calendar-day.has-edition {
  color: var(--ink);
  cursor: pointer;
  font-weight: 500;
}

.calendar-day.has-edition:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.calendar-day.is-today {
  border-color: var(--accent);
  font-weight: 700;
}

.calendar-day.is-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.calendar-day.other-month {
  opacity: 0.3;
}

.calendar-day.empty {
  visibility: hidden;
}

.calendar-close {
  display: none;
}

.calendar-today-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 6px;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border: 1px solid var(--light-rule);
  cursor: pointer;
  transition: all 0.12s;
}

.calendar-today-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── Calendar topic picker (date detail view) ─── */

.calendar-back-btn {
  background: none;
  border: 1px solid var(--light-rule);
  color: var(--ink);
  cursor: pointer;
  font-size: 16px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  font-family: var(--font-ui);
  flex-shrink: 0;
  margin-right: 10px;
}

.calendar-back-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.calendar-topic-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-topic-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--light-rule);
  background: #fff;
  transition: all 0.12s;
  cursor: pointer;
}

.calendar-topic-item:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

.calendar-topic-item:hover .topic-icon-svg {
  color: #fff;
}

.calendar-topic-item:hover .calendar-topic-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.calendar-topic-all {
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--rule);
  justify-content: space-between;
}

.calendar-topic-count {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--faded);
  font-weight: 500;
}

@media (max-width: 600px) {
  .calendar-popup {
    min-width: unset;
    max-width: unset;
    width: calc(100vw - 32px);
    margin: 0 16px;
  }
  .calendar-overlay {
    padding-top: 40px;
  }
}

/* ─── Mobile nav collapse (FAB + bottom sheet) ─── */
.edition-nav-fab,
.edition-nav-sheet-overlay,
.edition-nav-sheet { display: none; }

@media (max-width: 768px) {
  .edition-nav {
    transition: transform 0.3s ease, opacity 0.25s ease;
  }
  .edition-nav.nav-collapsed {
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
  }

  .edition-nav-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 24px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    z-index: 30;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .edition-nav-fab.visible {
    opacity: 0.92;
    transform: scale(1);
    pointer-events: auto;
  }
  .edition-nav-fab:active {
    transform: scale(0.92);
  }

  .edition-nav-sheet-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .edition-nav-sheet-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .edition-nav-sheet {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(245, 240, 232, 0.98);
    backdrop-filter: blur(8px);
    border-top: 2px solid var(--rule);
    border-radius: 14px 14px 0 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .edition-nav-sheet.open {
    transform: translateY(0);
  }

  .edition-nav-sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--light-rule);
    margin: 0 auto 14px;
  }

  .edition-nav-sheet .edition-nav-meta {
    margin-bottom: 10px;
  }

  .edition-nav-sheet .edition-nav-links a {
    font-size: 13px;
    padding: 8px 12px;
  }
}

