:root {
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #1d4ed8;
  --brand-dark: #1e40af;
  --holiday: #d32f2f;
  --holiday-bg: #fef2f2;
  --today: #1d4ed8;
  --paper: #ffffff;
  --bg: #f4f6fb;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-width: 320px;
}
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header ---- */
.site-header { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.logo { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: #fff; letter-spacing: .2px; white-space: nowrap; }
.logo:hover { text-decoration: none; color: #fff; }
.main-nav { flex: 1; min-width: 0; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.3rem; cursor: pointer; }
.nav-links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-link { color: #dbeafe; padding: 6px 10px; border-radius: 6px; font-size: .86rem; white-space: nowrap; }
.nav-link:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.lang-switch { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-left: 4px; }
.lang-switch a { color: #fff; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35); padding: 4px 12px; border-radius: 999px; font-size: .84rem; white-space: nowrap; }
.lang-switch a:hover { background: rgba(255,255,255,.28); text-decoration: none; }
.lang-link { color: #bfdbfe; font-size: .78rem; padding: 4px 7px; border-radius: 5px; white-space: nowrap; }
.lang-link.active { background: rgba(255,255,255,.22); color: #fff; font-weight: 700; }
.lang-link:hover { color: #fff; text-decoration: none; }

/* ---- Main ---- */
main { padding: 20px 0 40px; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin: 6px 0 10px; }
.breadcrumb a { color: var(--muted); }
h1 { font-family: var(--serif); font-size: 1.9rem; line-height: 1.25; margin: 8px 0 6px; color: var(--ink); }
.lead { color: var(--muted); font-size: .98rem; margin: 0 0 18px; max-width: 820px; }

/* ---- Toolbar ---- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.toolbar .btn, .year-nav .btn { background: var(--paper); border: 1px solid var(--line); color: var(--ink); padding: 7px 12px; border-radius: 8px; font-size: .86rem; cursor: pointer; }
.toolbar .btn:hover, .year-nav .btn:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.toolbar .btn.active, .year-nav .btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.toolbar-spacer { flex: 1; }
.month-picker { font-size: 1.15rem; font-weight: 700; padding: 0 6px; font-family: var(--serif); display: inline-flex; gap: 6px; align-items: center; }
.month-picker select { background: var(--paper); border: 1px solid var(--line); color: var(--ink); padding: 6px 8px; border-radius: 8px; font-size: .92rem; font-family: var(--sans); font-weight: 500; cursor: pointer; max-width: 130px; }
.month-picker select:focus { outline: none; border-color: var(--brand); }

/* ---- Calendar ---- */
.cal { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); table-layout: fixed; }
.cal th { background: #eef2ff; color: #3730a3; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; padding: 8px 4px; border: 1px solid var(--line); text-align: center; }
.cal td { border: 1px solid var(--line); height: 74px; vertical-align: top; padding: 4px 6px; position: relative; background: var(--paper); }
.cal td.muted { background: #fafafa; }
.cal td.muted .dnum { color: #c3c9d4; }
.cal .dnum { font-size: .98rem; font-weight: 600; line-height: 1.2; }
.cal td.weekend { background: #eef0fb; }
.cal td.muted.weekend { background: #fafafa; }
.cal td.muted.weekend .dnum { color: #c3c9d4; }
.cal-mini td.weekend { background: #eef0fb; }
.cal-mini td.weekend:not(.muted) { color: #6d5bd0; font-weight: 600; }
.cal .hname { font-size: .68rem; color: var(--holiday); line-height: 1.2; margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal td.holiday { background: var(--holiday-bg); }
.cal td.h-t1 { background: #fecaca; }
.cal td.h-t1 .dnum, .cal td.h-t1 .hname { color: #b91c1c; }
.cal td.h-t2 { background: #fed7aa; }
.cal td.h-t2 .dnum, .cal td.h-t2 .hname { color: #c2410c; }
.cal td.h-t3 { background: #bfdbfe; }
.cal td.h-t3 .dnum, .cal td.h-t3 .hname { color: #1d4ed8; }
.cal td.h-t0 { background: #e2e8f0; }
.cal td.h-t0 .dnum, .cal td.h-t0 .hname { color: #475569; }
.cal td.sport { background: #bbf7d0; }
.cal td.sport .dnum, .cal td.sport .sname { color: #15803d; }
.cal .sname { font-size: .68rem; line-height: 1.2; margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal td[data-w="0"] .dnum { color: #dc2626; }
.cal td[data-w="6"] .dnum { color: #2563eb; }
.cal td.h-t1[data-w="0"] .dnum, .cal td.h-t1[data-w="6"] .dnum { color: #b91c1c; }
.cal td.h-t2[data-w="0"] .dnum, .cal td.h-t2[data-w="6"] .dnum { color: #c2410c; }
.cal td.h-t3[data-w="0"] .dnum, .cal td.h-t3[data-w="6"] .dnum { color: #1d4ed8; }
.cal td.h-t0[data-w="0"] .dnum, .cal td.h-t0[data-w="6"] .dnum { color: #475569; }
.cal td.sport[data-w="0"] .dnum, .cal td.sport[data-w="6"] .dnum { color: #15803d; }
.cal td.today { box-shadow: inset 0 0 0 2px var(--today); }
.cal td.today .dnum { color: var(--today); }

/* ---- Legend ---- */
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 10px; font-size: .8rem; color: var(--muted); }
.cal-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { display: inline-block; width: 13px; height: 13px; border-radius: 3px; border: 1px solid rgba(2,6,23,.12); }
.lg-t1 { background: #fecaca; } .lg-t2 { background: #fed7aa; }
.lg-t3 { background: #bfdbfe; } .lg-sp { background: #bbf7d0; }

/* ---- Countdown ---- */
.countdown { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.cd-item { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; padding: 8px 14px; font-size: .9rem; }
.cd-item strong { font-weight: 700; }
.cd-holiday { border-left-color: var(--holiday); }
.cd-sport { border-left-color: #d97706; }

/* ---- Moon phases on grid ---- */
.cal td { position: relative; }
.moon { position: absolute; top: 4px; right: 5px; opacity: .95; line-height: 0; }
.moon .moon-svg { width: 15px; height: 15px; vertical-align: middle; }
.moon-key .moon-svg { width: 18px; height: 18px; }
.moon-phases { margin-top: 34px; }
.moon-phases h2 { font-family: var(--serif); font-size: 1.4rem; border-bottom: 2px solid #64748b; padding-bottom: 6px; display: inline-block; }
.moon-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; }
.moon-list li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: .9rem; }
.moon-emoji { font-size: 1rem; margin-right: 4px; }

/* ---- Moon today quick bar (country pages → /cc/moon-today/) ---- */
.moon-today-bar { display: flex; align-items: center; gap: 12px; background: linear-gradient(90deg, #eef2f9, #f4f7fb); border: 1px solid #cbd5e1; border-radius: 12px; padding: 8px 14px; margin: 16px 0 4px; text-decoration: none; color: var(--ink); }
.moon-today-bar:hover { border-color: #64748b; background: #e6edf7; }
.mtb-ic { flex: 0 0 auto; line-height: 0; }
.mtb-ic .moon-svg { width: 34px; height: 34px; }
.mtb-txt { flex: 1 1 auto; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.mtb-txt strong { font-family: var(--serif); font-size: 1.02rem; }
.mtb-sub { color: var(--muted); font-size: .86rem; }
.mtb-go { color: var(--brand); font-size: 1.3rem; font-weight: 700; line-height: 1; }
@media (max-width: 640px) { .mtb-txt { flex-direction: column; gap: 2px; } }

/* Moon-today page: highlight current phase row */
.moon-current td { background: rgba(100, 116, 139, .12); font-weight: 600; }
.moon-back { margin-top: 26px; }

/* ---- Moon today panel + yearly moon table ---- */
.moon-svg { width: 22px; height: 22px; vertical-align: -5px; display: inline-block; }
.moon-today { display: flex; gap: 18px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-top: 14px; }
.moon-today-ic { flex: 0 0 auto; }
.moon-today-ic .moon-svg { width: 96px; height: 96px; vertical-align: middle; }
.moon-today-info { flex: 1 1 auto; min-width: 0; }
.moon-today-name { margin: 0 0 8px; font-size: 1.15rem; }
.moon-today-name strong { font-family: var(--serif); }
.moon-today-badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: #334155; border-radius: 999px; padding: 2px 10px; margin-right: 8px; vertical-align: 2px; }
.moon-today-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 18px; font-size: .92rem; }
.moon-today-stats li { color: var(--muted); }
.moon-today-stats strong { color: var(--ink); font-weight: 700; }
.moon-today-stats time { white-space: nowrap; }

/* ---- Moonrise / Moonset today（moon-today 页）---- */
.parg h2 { font-family: var(--serif); font-size: 1.3rem; margin: 28px 0 8px; border-bottom: 2px solid #64748b; padding-bottom: 6px; display: inline-block; }
.parg p { font-size: .95rem; color: var(--muted); }
.parg p strong { color: var(--ink); }
.moonriseset { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.moonriseset > div { flex: 1 1 200px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 12px; text-align: center; }
.moonriseset h3 { margin: 0 0 8px; font-size: .98rem; color: var(--ink); }
.moonriseset .moon-clock { width: 92px; height: 92px; margin: 0 auto 8px; display: block; }
.moonriseset > div > strong { display: block; font-size: 1.35rem; color: var(--ink); font-family: var(--serif); }
.moonriseset .illum { margin: 4px 0 0; font-size: .82rem; }
.parg .moon-note { margin: 8px 0 0; font-size: .78rem; color: var(--muted); }
.parg .moon-note strong { color: var(--muted); font-weight: 600; }
@media (max-width: 640px) {
  .moonriseset { flex-direction: column; }
  .moonriseset > div { flex: 1 1 auto; }
}

.moon-year-wrap { margin-top: 18px; }
.moon-year-title { font-family: var(--serif); font-size: 1.1rem; margin: 0 0 8px; }
.moon-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.moon-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.moon-table th, .moon-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.moon-table thead th { font-weight: 700; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.moon-table tbody tr:nth-child(even) { background: rgba(148, 163, 184, .07); }
.moon-cell { display: inline-flex; align-items: center; gap: 7px; }
@media (max-width: 640px) {
  .moon-today { flex-direction: column; text-align: center; }
  .moon-today-stats { grid-template-columns: 1fr; }
  .moon-table { font-size: .84rem; }
}

/* ---- Tools modal (print / download / share) ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex; align-items: flex-start; justify-content: center; padding: 9vh 16px 16px; z-index: 1000; }
.modal-overlay[hidden] { display: none; }
.modal { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 460px; padding: 20px 22px; box-shadow: 0 18px 50px rgba(2, 6, 23, .28); position: relative; }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); }
.tools-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tools-tab { flex: 1; padding: 9px 8px; border: 1px solid var(--line); border-radius: 9px; background: #f1f5f9; cursor: pointer; font: inherit; font-size: .92rem; }
.tools-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.tool-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.tool-row label { width: 84px; font-weight: 600; font-size: .92rem; flex-shrink: 0; }
.tool-row select, .tool-row input[type="date"] { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.tool-actions { display: flex; gap: 8px; margin-top: 16px; }
.tool-actions .btn { flex: 1; text-align: center; }
.share-intro { margin: 0 0 10px; font-size: .95rem; }
.share-row { display: flex; gap: 8px; }
.share-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--muted); background: #f8fafc; }
.share-social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; padding: 9px 16px; border-radius: 9px; text-decoration: none; font-size: .92rem; font-weight: 600; color: #fff; border: 0; cursor: pointer; }
.sh-x { background: #0f1419; } .sh-fb { background: #1877f2; } .sh-wa { background: #25d366; }
.sh-tg { background: #229ed9; } .sh-em { background: #64748b; } .sh-more { background: #7c3aed; }
.cal-mini td { height: 30px; padding: 1px 2px; font-size: .76rem; text-align: center; vertical-align: middle; }
.cal-mini th { padding: 3px 2px; font-size: .66rem; }
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.year-month { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.year-month h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 1.02rem; }

.page-intro { display: flex; align-items: center; gap: 18px; margin: 32px 0 16px; }
.page-intro-img { width: 132px; height: auto; border-radius: 10px; flex-shrink: 0; box-shadow: 0 4px 14px rgba(15, 23, 42, .1); }
.page-intro-text { flex: 1; min-width: 0; }
.page-intro .page-title { margin: 0 0 8px; }
.page-intro .page-lead { margin-bottom: 0; }
@media (max-width: 640px) {
  .page-intro { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-intro-img { width: 96px; }
}
.page-title { margin: 32px 0 8px; }
.page-lead { margin-bottom: 12px; }
.holidays { margin-top: 14px; }
.holidays h2 { font-family: var(--serif); font-size: 1.4rem; border-bottom: 2px solid var(--brand); padding-bottom: 6px; display: inline-block; }
.holiday-list { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.holiday-list th { background: #eef2ff; color: #3730a3; text-align: left; padding: 9px 12px; font-size: .82rem; }
.holiday-list td { padding: 8px 12px; border-top: 1px solid var(--line); font-size: .9rem; }
.holiday-list tr:hover td { background: #f8faff; }
.hdate { font-weight: 600; white-space: nowrap; }
.hname-cell { font-weight: 600; color: var(--holiday); }
.badge { display: inline-block; font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: #eef2ff; color: #3730a3; }
.badge-1 { background: #fee2e2; color: #b91c1c; }
.badge-2 { background: #e0f2fe; color: #0369a1; }
.badge-3 { background: #f3e8ff; color: #7e22ce; }
.badge-sport { background: #ffedd5; color: #b45309; }
.sports { margin-top: 34px; }
.sports h2 { font-family: var(--serif); font-size: 1.4rem; border-bottom: 2px solid #d97706; padding-bottom: 6px; display: inline-block; }
.sname-cell { font-weight: 600; color: #b45309; }
.btn-pdf { border-color: #d97706 !important; color: #b45309 !important; }
.btn-pdf:hover { background: #fff7ed !important; }
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 8px 0 26px; }
.country-card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 4px; transition: box-shadow .15s, transform .15s; }
.country-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.09); transform: translateY(-2px); text-decoration: none; }
.cc-flag { font-size: 1.7rem; }
.cc-name { font-weight: 700; font-size: .98rem; color: var(--ink); }
.cc-holidays { font-size: .8rem; color: var(--muted); }
.home-cal { margin-top: 8px; }
.home-cal h2 { font-family: var(--serif); }
.note { color: var(--muted); }

.year-nav { margin-top: 30px; }
.year-nav h2 { font-family: var(--serif); font-size: 1.3rem; }
.year-nav .btn { margin: 0 6px 6px 0; display: inline-block; }
.year-nav .year-select { background: var(--paper); border: 1px solid var(--line); color: var(--ink); padding: 7px 12px; border-radius: 8px; font-size: .92rem; cursor: pointer; max-width: 160px; }
.year-nav .year-select:focus { outline: none; border-color: var(--brand); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.site-footer { background: #17233b; color: #c7d2e0; padding: 22px 0 30px; font-size: .84rem; margin-top: 30px; }
.site-footer a { color: #93c5fd; }
.footer-links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.site-footer .copyright { margin-top: 12px; font-size: .78rem; opacity: .85; }
.footer-links a { text-decoration: none; border-bottom: 1px solid transparent; }
.footer-links a:hover { border-bottom-color: #93c5fd; }
.page-article { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; margin-top: 22px; }
.page-article h2 { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 10px; color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.page-article p, .page-article ul { line-height: 1.7; color: #334155; }
.page-article li { margin-bottom: 6px; }
.page-article a { color: var(--brand); }
.holiday-guide { margin-top: 22px; }
.holiday-guide .holiday-stats { font-size: .95rem; color: #0f2f5c; background: #eef4fb; border: 1px solid #d6e4f5; border-radius: 8px; padding: 10px 14px; margin-top: 12px; }

@media print {
  body { background: #fff; }
  .site-header, .toolbar, .toolbar .btn, .toolbar-spacer, .year-nav, .site-footer, .lang-switch, .nav-toggle, .breadcrumb, .countdown, .modal-overlay, .moon-today-bar, h1, .lead, .page-intro { display: none !important; }
  .container { max-width: 100%; }
  .cal, .cal td, .cal th { border-color: #999; }
  .cal td { height: auto; min-height: 52px; }
  .cal td.holiday, .cal td.weekend, .cal td.sport, .lg-t1, .lg-t2, .lg-t3, .lg-sp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .moon, .moon-emoji, .moon-svg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .holiday-list, .holiday-list td, .holiday-list th { border-color: #999; }
  a { color: #000; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .main-nav { display: flex; flex: 1; justify-content: flex-end; }
  .nav-links { display: none; flex-direction: column; position: absolute; left: 0; right: 0; top: 56px; background: var(--brand-dark); padding: 8px 12px; max-height: 60vh; overflow-y: auto; }
  .nav-links.open { display: flex; }
  h1 { font-size: 1.45rem; }
  .cal .hname { font-size: .6rem; }
  .header-inner { min-height: 52px; flex-wrap: nowrap; gap: 10px; }
  .lang-switch { flex-shrink: 0; }
  .logo { font-size: 1.12rem; }
  /* 移动端：日期与月相图标水平居中、上下排列（td 保持 table-cell，不可用 flex，否则破坏 7 列网格） */
  .cal td { height: 60px; padding: 4px 2px 2px; text-align: center; }
  .cal .moon { position: static; display: block; margin: 1px auto 0; }
  .cal .hname, .cal .sname { text-align: center; margin-top: 1px; }
  /* 假日/体育列表：固定表格布局 + 列宽分配，长名称换行，避免撑开页面宽度 */
  .holiday-list { table-layout: fixed; }
  .holiday-list th, .holiday-list td { overflow-wrap: anywhere; word-break: break-word; }
  .holiday-list th:nth-child(1), .holiday-list td:nth-child(1) { width: 31%; }
  .holiday-list th:nth-child(2), .holiday-list td:nth-child(2) { display: none; }  /* Week 列窄屏放不下且价值低，隐藏 */
  .holiday-list th:nth-child(4), .holiday-list td:nth-child(4) { width: 26%; }
  .holiday-list .hdate { white-space: normal; }
  /* 移动端工具栏：四行布局 —— 行1 上月|下月，行2 年月下拉，行3 视图切换，行4 打印/PDF/工具/分享 */
  .toolbar { gap: 6px; }
  .toolbar .btn { padding: 8px 6px; font-size: .8rem; }
  .toolbar > .btn:first-child { order: 1; flex: 1 1 42%; padding: 8px 10px; }
  .toolbar > .btn:nth-child(3) { order: 2; flex: 1 1 42%; padding: 8px 10px; }
  .month-picker { order: 3; flex: 1 1 100%; justify-content: center; padding: 0 2px; font-size: 1rem; }
  .month-picker select { max-width: 120px; font-size: .85rem; padding: 6px 6px; }
  .toolbar-spacer { display: none; }
  .toolbar > .btn:nth-child(5), .toolbar > .btn:nth-child(6) { order: 4; flex: 1 1 44%; }
  .toolbar > .btn:nth-child(n+7) { order: 5; flex: 1 1 22%; min-width: 0; }
}

.cc-search-box { margin: 4px 0 14px; max-width: 460px; }
.cc-search-box input { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: .95rem; background: var(--paper); color: var(--ink); }
.cc-group { margin: 0 0 30px; scroll-margin-top: 70px; }
.cc-group-title { font-size: 1.15rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.cc-count { font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--line); border-radius: 999px; padding: 1px 10px; }
.country-card { transition: box-shadow .15s, transform .15s, opacity .15s; }
.country-card.hidden-by-search { display: none; }

html[dir="rtl"] body { direction: rtl; text-align: right; }
html[dir="rtl"] .cal th, html[dir="rtl"] .cal td { text-align: center; }
html[dir="rtl"] .cal-nav, html[dir="rtl"] .toolbar { flex-direction: row-reverse; }
html[dir="rtl"] .country-card, html[dir="rtl"] .cal-cell { text-align: right; }
html[dir="rtl"] .holiday-list th, html[dir="rtl"] .holiday-list td { text-align: right; }
html[dir="rtl"] .cc-search-box input { direction: rtl; }
.lang-select {
  appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 34px 8px 14px;
  font-size: 14px;
  color: #1e293b;
  cursor: pointer;
  max-width: 190px;
  background-color: #fff;
}
.lang-select:hover, .lang-select:focus { border-color: #2563eb; outline: none; }

.home-hero {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
  border-radius: 20px;
  color: #fff;
  padding: 40px 36px;
  margin-top: 24px;
  box-shadow: 0 18px 40px rgba(37, 99, 235, .22);
}
.home-hero h1 { color: #fff; font-size: 34px; margin: 0 0 12px; line-height: 1.25; }
.home-hero .lead { color: #dbeafe; font-size: 16px; max-width: 760px; margin: 0 0 22px; line-height: 1.7; }
.home-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary {
  display: inline-block;
  background: #fff; color: #1d4ed8;
  font-weight: 600;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 15px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.18); color: #1d4ed8; }

.home-cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  margin-top: 28px;
  align-items: start;
}
.home-cal-main { min-width: 0; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-title { flex: 1; font-size: 18px; font-weight: 600; color: #1e293b; text-align: center; }

.home-holidays {
  background: #fff;
  border: 1px solid #eef0f6;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}
.home-holidays h2 { font-size: 17px; margin: 0 0 14px; color: #1e293b; }
.home-hol-list { list-style: none; margin: 0 0 16px; padding: 0; }
.home-hol-list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.home-hol-list li:last-child { border-bottom: none; }
.home-hol-list .hdate { min-width: 64px; color: #2563eb; font-weight: 600; }
.home-hol-list .hname-cell { color: #334155; text-decoration: none; }
.home-hol-list .hname-cell:hover { color: #2563eb; }

.home-year-strip, .hot-countries, .lang-panel, .all-countries { margin-top: 40px; }
.home-year-strip h2, .hot-countries h2, .lang-panel h2, .all-countries h2 { font-size: 22px; color: #1e293b; margin-bottom: 16px; }
.month-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.month-chip {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 10px 0; width: 74px; text-decoration: none;
  transition: all .15s;
}
.month-chip:hover { border-color: #2563eb; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(37,99,235,.12); }
.month-chip.active { background: #2563eb; border-color: #2563eb; }
.month-chip.active .mc-name, .month-chip.active .mc-count { color: #fff; }
.mc-name { font-size: 13px; font-weight: 600; color: #334155; text-transform: capitalize; }
.mc-count { font-size: 20px; font-weight: 700; color: #2563eb; }

.lang-panel { background: #fff; border: 1px solid #eef0f6; border-radius: 16px; padding: 24px; box-shadow: 0 8px 24px rgba(15,23,42,.04); }
.lang-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.lang-chip {
  display: inline-block;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 999px;
  padding: 8px 16px; font-size: 14px; color: #334155; text-decoration: none;
  transition: all .15s;
}
.lang-chip:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.lang-chip.active { background: #2563eb; border-color: #2563eb; color: #fff; }

@media (max-width: 900px) {
  .home-cal-layout { grid-template-columns: 1fr; }
  .home-holidays { order: -1; }
  .home-hero { padding: 30px 22px; }
  .home-hero h1 { font-size: 26px; }
  .toolbar-title { order: 3; flex-basis: 100%; }
}

.h1-free { font-size: 20px; font-weight: 400; color: #bfdbfe; margin-left: 4px; white-space: nowrap; }
@media (max-width: 900px) { .h1-free { display: block; font-size: 16px; margin: 6px 0 0; } }
