/* ── Almanac mini-app ── */
.almanac-view { position: fixed; top: 56px; left: 0; right: 0; bottom: 0; display: none; flex-direction: column; z-index: 100; background: var(--bg); }
.almanac-view.open { display: flex; animation: fadeIn 0.15s ease; }
.almanac-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 24px 16px 80px; overscroll-behavior: contain; }
.almanac-inner { max-width: 600px; margin: 0 auto; }
.alm-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.alm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 8px; text-align: center; }
.alm-card-lbl { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alm-card-val { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; }
.alm-tz-wrap { margin-top: 24px; display: flex; gap: 20px; align-items: flex-start; }
.alm-tz-clock-side { flex: 0 0 auto; text-align: center; }
.alm-tz-list { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.alm-tz-city-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 4px; cursor: pointer; transition: all 0.1s; text-align: center; }
.alm-tz-city-card:hover { background: var(--surface2); border-color: var(--text3); }
.alm-tz-city-name { font-size: 11px; color: var(--text2); display: block; }
.alm-tz-city-time { font-size: 13px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; display: block; margin-top: 2px; }
.alm-tz-city-offset { font-size: 9px; color: var(--text3); display: block; margin-top: 1px; }
.alm-tz-city-night .alm-tz-city-time { color: var(--text2); }
.alm-tz-city-active { border-color: var(--amber-border); background: var(--amber-glow); }
.alm-tz-city-active .alm-tz-city-name { color: var(--amber); }
.almanac-hero { display: flex; flex-direction: column; align-items: center; margin-bottom: 32px; position: relative; }
.almanac-moon { position: relative; width: 200px; height: 200px; border-radius: 50%; overflow: hidden; background: #080c16; }
.almanac-moon .dc-moon-half { position: absolute; top: 0; width: 50%; height: 100%; }
.almanac-moon .dc-moon-half.left { left: 0; }
.almanac-moon .dc-moon-half.right { right: 0; }
.almanac-moon .dc-moon-term { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 50%; }
.almanac-moon-texture { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%; pointer-events: none; }
.almanac-moon-glow { position: absolute; width: 280px; height: 280px; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: -1; }
.almanac-moon-name { margin-top: 16px; font-size: 18px; font-weight: 500; color: var(--text); }
.almanac-moon-line { font-size: 13px; color: var(--text2); margin-top: 8px; text-align: center; }
.almanac-section { margin-top: 32px; border-top: 1px solid var(--border); padding-top: 24px; }
.almanac-section-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.06em; }
.almanac-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.almanac-info-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.almanac-info-val { font-size: 16px; font-weight: 600; color: var(--text); }
.almanac-info-lbl { font-size: 11px; color: var(--text2); margin-top: 2px; }
.almanac-progress { height: 4px; background: var(--surface2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.almanac-progress-bar { height: 100%; background: var(--amber); border-radius: 2px; }
.almanac-orrery-wrap { width: 100%; max-width: 500px; aspect-ratio: 1; margin: 0 auto; }
.almanac-orrery-wrap canvas { width: 100%; height: 100%; display: block; }
.orrery-controls { display: flex; align-items: center; gap: 6px; max-width: 500px; margin: 8px auto 0; padding: 0 4px; }
.orrery-ctrl-btn { background: none; border: 1px solid var(--border); color: var(--text-dim); border-radius: 6px; width: 32px; height: 28px; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; transition: all 0.15s; flex-shrink: 0; }
.orrery-ctrl-btn:hover { color: var(--amber); border-color: var(--amber-border); }
.orrery-slider { flex: 1; min-width: 60px; height: 4px; -webkit-appearance: none; appearance: none; background: var(--surface2); border-radius: 2px; outline: none; cursor: pointer; }
.orrery-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--amber); border: none; cursor: pointer; box-shadow: 0 0 4px rgba(255,180,60,0.3); }
.orrery-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--amber); border: none; cursor: pointer; }
.orrery-speed-end { color: var(--text3); font-size: 9px; flex-shrink: 0; user-select: none; }
.orrery-speed-label { color: var(--amber); font-size: 11px; min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; flex-shrink: 0; font-family: 'SF Mono', 'Fira Code', monospace; }
.orrery-date { color: var(--text-dim); font-size: 12px; margin-left: auto; font-variant-numeric: tabular-nums; flex-shrink: 0; min-width: 90px; text-align: right; }
.orrery-transit-wrap { display: none; align-items: center; gap: 6px; max-width: 500px; margin: 4px auto 0; padding: 0 4px; }
.orrery-transit-end { font-size: 11px; color: var(--text3); flex-shrink: 0; min-width: 40px; }
.orrery-transit-label { color: var(--amber); font-size: 11px; font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; font-family: 'SF Mono', 'Fira Code', monospace; }
.orrery-now { width: auto; padding: 0 10px; font-size: 11px; color: var(--amber); border-color: var(--amber-border); }
.almanac-sky-wrap { width: 100%; max-width: 600px; margin: 0 auto; border-radius: 12px; overflow: hidden; position: relative; }
.almanac-sky-wrap canvas { width: 100%; display: block; }
.almanac-location-link { color: var(--amber); cursor: pointer; text-decoration: none; font-size: 12px; }
.almanac-location-link:hover { text-decoration: underline; }
.almanac-eclipse-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); }
.almanac-eclipse-row:last-child { border-bottom: none; }
.almanac-eclipse-type { font-weight: 500; color: var(--text); }
.almanac-eclipse-date { color: var(--text2); font-size: 12px; }
.almanac-eclipse-until { color: var(--amber); font-size: 12px; font-weight: 500; }
/* Messages Across Time — inscription pills, metadata, text blocks */
.rosetta-pills { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.rosetta-meta { text-align: center; font-size: 12px; color: var(--amber); font-weight: 500; letter-spacing: 0.03em; margin-bottom: 6px; }
.rosetta-context { text-align: center; font-size: 13px; color: var(--text3); line-height: 1.5; margin-bottom: 14px; max-width: 560px; margin-left: auto; margin-right: auto; }
.rosetta-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.alm-rosetta-block { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; margin-bottom: 10px; }
.alm-rosetta-title { font-size: 11px; font-weight: 600; color: var(--amber); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }
.alm-rosetta-text { font-size: 14px; font-weight: 400; color: var(--text); line-height: 1.6; }
/* Golden Record gallery */
.gr-gallery { margin-top: 20px; }
.gr-gallery-title { font-size: 13px; font-weight: 600; color: var(--text); text-align: center; margin-bottom: 4px; }
.gr-gallery-sub { font-size: 12px; color: var(--text3); text-align: center; line-height: 1.4; margin-bottom: 14px; max-width: 480px; margin-left: auto; margin-right: auto; }
.gr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.gr-thumb { aspect-ratio: 4/3; overflow: hidden; border-radius: 6px; cursor: pointer; position: relative; border: 1px solid var(--border); transition: border-color 0.2s, transform 0.15s; -webkit-touch-callout: none; }
.gr-thumb:hover { border-color: var(--amber-border); transform: scale(1.03); }
.gr-thumb:active { transform: scale(0.97); }
.gr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
/* Golden Record lightbox */
.gr-lightbox { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; direction: ltr; }
.gr-lb-bg { position: absolute; inset: 0; background: rgba(0,0,0,0.92); }
.gr-lb-close { position: absolute; top: 16px; right: 20px; z-index: 2; background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; opacity: 0.7; transition: opacity 0.2s; line-height: 1; }
.gr-lb-close:hover { opacity: 1; }
.gr-lb-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 50%; width: 44px; height: 44px; color: #fff; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.gr-lb-arrow:hover { background: rgba(255,255,255,0.16); }
.gr-lb-prev { left: 16px; }
.gr-lb-next { right: 16px; }
.gr-lb-main { position: relative; z-index: 1; max-width: 90vw; max-height: 85vh; display: flex; flex-direction: column; align-items: center; }
.gr-lb-main img { max-width: 100%; max-height: 75vh; object-fit: contain; border-radius: 4px; }
.gr-lb-cap { color: #fff; font-size: 14px; font-weight: 500; margin-top: 12px; text-align: center; }
.gr-lb-num { color: rgba(255,255,255,0.45); font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }
/* Voyager "View Golden Record" button */
.voyager-record-btn { display: block; width: 100%; margin-top: 10px; padding: 8px 0; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: 6px; color: var(--amber); font-size: 12px; font-weight: 600; cursor: pointer; letter-spacing: 0.03em; transition: background 0.2s, border-color 0.2s; }
.voyager-record-btn:hover { border-color: var(--amber-border); background: var(--amber-glow); }
/* Voyager detail card */
.voyager-card-inner { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-top: 10px; }
.voyager-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.voyager-card-name { font-size: 14px; font-weight: 600; color: var(--amber); letter-spacing: 0.04em; }
.voyager-card-close { background: none; border: none; color: var(--text3); font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1; }
.voyager-card-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.voyager-stat { text-align: center; }
.voyager-stat-val { display: block; font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.voyager-stat-lbl { display: block; font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.voyager-card-quote { font-size: 12px; color: var(--text2); font-style: italic; line-height: 1.5; border-top: 1px solid var(--border); padding-top: 10px; }
/* Almanac calendar — wall calendar grid with events */
.alm-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 16px 0 10px; position: relative; }
.alm-arrow { background: none; border: none; color: var(--amber); font-size: 13px; cursor: pointer; padding: 6px 10px; border-radius: 6px; opacity: 0.7; transition: opacity 0.15s, background 0.15s; }
.alm-arrow:hover { opacity: 1; background: var(--surface2); }
.alm-title { font-size: 17px; font-weight: 600; color: var(--text); min-width: 200px; text-align: center; }
.alm-today-btn { position: absolute; right: 0; background: none; border: 1px solid var(--border); color: var(--amber); font-size: 11px; cursor: pointer; padding: 3px 10px; border-radius: 10px; opacity: 0.7; transition: opacity 0.15s; }
.alm-today-btn:hover { opacity: 1; background: var(--surface2); }
.alm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.alm-hdr { font-size: 11px; color: var(--text3); padding: 8px 0; font-weight: 500; text-align: center; background: var(--surface); }
.alm-cell { background: var(--surface); min-height: 64px; padding: 4px 5px; font-size: 12px; overflow: hidden; }
.alm-empty { background: transparent; }
.alm-day { cursor: pointer; transition: background 0.15s; }
.alm-day:hover { background: var(--surface2); }
.alm-today .alm-num { background: var(--amber); color: #000; font-weight: 700; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.alm-num { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.alm-selected { background: rgba(245,158,11,0.10); }
.alm-selected .alm-num { color: var(--amber); font-weight: 600; }
.alm-today.alm-selected { background: rgba(245,158,11,0.10); }
.alm-today.alm-selected .alm-num { background: var(--amber); color: #000; }
.alm-ev { font-size: 9px; line-height: 1.3; padding: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.alm-ev-holiday { color: #f59e0b; }
.alm-ev-seasonal { color: #68d391; }
.alm-ev-astro { color: #63b3ed; }
.alm-ev-meteor { color: #fc8181; }
.alm-ev-more { color: var(--text3); font-style: italic; }
.alm-day-detail { padding: 8px 14px; margin-top: 8px; background: var(--surface); border-radius: 8px; border: 1px solid var(--border); }
.alm-crossref { padding: 10px 14px; background: var(--surface); border-radius: 10px; border: 1px solid var(--border); margin-top: 10px; }
.alm-crossref-row { display: flex; justify-content: space-between; padding: 5px 6px; font-size: 12px; border-radius: 6px; cursor: pointer; transition: background 0.1s; }
.alm-crossref-row:hover { background: var(--surface2); }
.alm-crossref-label { color: var(--text2); font-weight: 500; }
.alm-crossref-date { color: var(--text); }
.alm-crossref-active { background: var(--surface2); }
.alm-crossref-active .alm-crossref-label { color: var(--amber); }

/* ── Almanac mobile ── */
@media (max-width: 600px) {
  body.almanac-mode .topbar-more { display: none !important; }
  body.almanac-mode .lang-selector-btn { display: flex !important; }
  body.almanac-mode .manage-btn { display: flex !important; }
  .orrery-controls { gap: 3px; padding: 0 2px; }
  .orrery-speed-label { font-size: 10px; min-width: 44px; }
  .orrery-speed-end { font-size: 8px; }
  .orrery-date { font-size: 10px; }
  .alm-tz-wrap { flex-direction: column; gap: 12px; align-items: center; width: 100%; }
  .alm-tz-clock-side { display: flex; flex-direction: column; align-items: center; width: 100%; }
  .alm-tz-clock-side canvas { width: 160px; height: 160px; }
  .alm-tz-list { grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; }
  .alm-rosetta-block { padding: 12px 14px; }
  .alm-rosetta-text { font-size: 13px; }
  .rosetta-compare { grid-template-columns: 1fr; }
  .gr-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 4px; }
  .gr-lb-arrow { width: 36px; height: 36px; font-size: 20px; }
  .gr-lb-prev { left: 8px; }
  .gr-lb-next { right: 8px; }
  .voyager-card-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .alm-cell { min-height: 52px; padding: 3px 3px; }
  .alm-num { font-size: 12px; }
  .alm-ev { font-size: 8px; }
  .alm-title { font-size: 15px; min-width: 140px; }
}
