/* Mukta and Noto Serif Devanagari, self-hosted (SIL Open Font License). */
@font-face{font-family:'Mukta';font-style:normal;font-weight:400;font-display:swap;src:url('../assets/fonts/mukta-400-devanagari.woff2') format('woff2');unicode-range:U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A}
@font-face{font-family:'Mukta';font-style:normal;font-weight:400;font-display:swap;src:url('../assets/fonts/mukta-400-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Mukta';font-style:normal;font-weight:400;font-display:swap;src:url('../assets/fonts/mukta-400-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Mukta';font-style:normal;font-weight:500;font-display:swap;src:url('../assets/fonts/mukta-500-devanagari.woff2') format('woff2');unicode-range:U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A}
@font-face{font-family:'Mukta';font-style:normal;font-weight:500;font-display:swap;src:url('../assets/fonts/mukta-500-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Mukta';font-style:normal;font-weight:500;font-display:swap;src:url('../assets/fonts/mukta-500-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Mukta';font-style:normal;font-weight:600;font-display:swap;src:url('../assets/fonts/mukta-600-devanagari.woff2') format('woff2');unicode-range:U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A}
@font-face{font-family:'Mukta';font-style:normal;font-weight:600;font-display:swap;src:url('../assets/fonts/mukta-600-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Mukta';font-style:normal;font-weight:600;font-display:swap;src:url('../assets/fonts/mukta-600-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Mukta';font-style:normal;font-weight:700;font-display:swap;src:url('../assets/fonts/mukta-700-devanagari.woff2') format('woff2');unicode-range:U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A}
@font-face{font-family:'Mukta';font-style:normal;font-weight:700;font-display:swap;src:url('../assets/fonts/mukta-700-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Mukta';font-style:normal;font-weight:700;font-display:swap;src:url('../assets/fonts/mukta-700-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Noto Serif Devanagari';font-style:normal;font-weight:500 700;font-display:swap;src:url('../assets/fonts/noto-serif-devanagari-devanagari.woff2') format('woff2');unicode-range:U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A}
@font-face{font-family:'Noto Serif Devanagari';font-style:normal;font-weight:500 700;font-display:swap;src:url('../assets/fonts/noto-serif-devanagari-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Noto Serif Devanagari';font-style:normal;font-weight:500 700;font-display:swap;src:url('../assets/fonts/noto-serif-devanagari-latin.woff2') format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}

:root {
  --bg: #F8F4EE;
  --ink: #221B17;
  --muted: #7A6E66;
  --soft: #5E534C;
  --faint: #9A8E85;
  --red: #A3262A;
  --red-dark: #8A1F23;
  --red-tint: #FBECE9;
  --gold: #8F6210;
  --gold-tint: #F7EEDB;
  --line: #ECE3D7;
  --line-strong: #E4D9CB;
  --line-soft: #F0E8DC;
  --sand: #F3EDE4;
  --sand-strong: #EFE7DC;
  --paper: #FBF8F3;
  --rose: #F6CFC9;
  --serif: 'Noto Serif Devanagari', serif;
  --sans: 'Mukta', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); }
a:hover { color: #7E1B1F; }
button, select { font-family: inherit; }
h1, h2 { font-family: var(--serif); font-weight: 700; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.is-sel:focus-visible, .hero :focus-visible { outline-color: #FFFFFF; }
[hidden] { display: none !important; }

.wrap { max-width: 1280px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(248, 244, 238, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { padding-top: 10px; padding-bottom: 10px; display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { display: block; height: 36px; width: auto; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 16px; }
.nav a:hover { background: var(--sand-strong); color: var(--ink); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.header-actions { flex-wrap: wrap; justify-content: flex-end; }
.pill-toggle { display: flex; gap: 2px; background: var(--sand-strong); padding: 3px; border-radius: 999px; }
.pill-toggle button { border: none; border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 700; cursor: pointer; background: transparent; color: var(--soft); white-space: nowrap; }
.pill-toggle button.is-active { background: #FFFFFF; color: var(--red); }

/* Calculation system: a compact header button that opens an explanation of both options */
.system-menu { position: relative; }
.system-menu-btn { display: flex; align-items: baseline; gap: 6px; border: 1px solid var(--line-strong); background: #FFFFFF; border-radius: 999px; padding: 4px 30px 4px 14px; font-size: 14px; color: var(--muted); cursor: pointer; position: relative; white-space: nowrap; }
.system-menu-btn:hover { background: var(--bg); }
.system-menu-btn strong { color: var(--red); font-weight: 700; }
.system-menu-btn::after { content: ''; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; margin-top: -5px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); }
.system-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(360px, calc(100vw - 28px)); background: #FFFFFF; border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 20px 44px -14px rgba(34, 27, 23, 0.38), 0 2px 6px rgba(34, 27, 23, 0.08); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.system-menu-panel p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--soft); text-wrap: pretty; }
.system-option { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1.5px solid var(--line-soft); background: #FFFFFF; border-radius: 12px; padding: 9px 12px; cursor: pointer; color: var(--ink); }
.system-option:hover { background: var(--bg); }
.system-option.is-active { border-color: var(--red); background: var(--red-tint); }
.system-option-name { font-size: 15px; }
.system-option-name strong { font-weight: 700; }
.system-option.is-active .system-option-name strong { color: var(--red); }
.system-option-name span { font-size: 13px; color: var(--muted); }
.system-option-desc { font-size: 13px; line-height: 1.4; color: var(--soft); text-wrap: pretty; }
.btn-app { background: var(--red); color: #FFFFFF; text-decoration: none; padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.btn-app:hover { background: var(--red-dark); color: #FFFFFF; }

/* Page frame */
.main { padding-top: 20px; display: flex; flex-direction: column; gap: 20px; }
.columns { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.card { background: #FFFFFF; border: 1px solid var(--line); border-radius: 20px; padding: 20px; scroll-margin-top: 80px; }
.calendar { flex: 999 1 620px; min-width: 0; }
.side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.03em; }
.state-msg { padding: 28px 8px; font-size: 15px; color: var(--muted); text-align: center; text-wrap: pretty; }
.state-msg button { margin-left: 8px; }
.btn-ghost { border: 1px solid var(--line-strong); background: #FFFFFF; color: var(--ink); font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.btn-ghost:hover { background: var(--bg); }
.page { padding-top: 32px; padding-bottom: 32px; min-height: 60vh; line-height: 1.6; }
.text-danger { color: var(--red); }

/* Today */
.hero { background: var(--red); color: #FFFFFF; border-radius: 20px; padding: 20px 22px; display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; }
.hero-main { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.hero-top { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.pill-today { background: #FFFFFF; color: var(--red); font-weight: 700; font-size: 14px; padding: 1px 10px; border-radius: 999px; }
.hero-weekday { font-size: 16px; font-weight: 600; color: #FBE3DF; }
.hero-fest { border: 1px solid rgba(255, 255, 255, 0.4); color: #FFFFFF; font-size: 13px; font-weight: 600; padding: 0 9px; border-radius: 999px; }
.hero-date { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hero-big { font-family: var(--serif); font-weight: 700; font-size: 46px; line-height: 1.05; }
.hero-year { font-family: var(--serif); font-weight: 500; font-size: 22px; color: var(--rose); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; color: var(--rose); }
.hero-meta span { white-space: nowrap; }
.hero-meta strong { color: #FFFFFF; font-weight: 600; }
.hero-rows { flex: 2 1 560px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.skeleton-text { display: inline-block; min-width: 6em; border-radius: 8px; background: rgba(255, 255, 255, 0.14); }

/* A date in one calendar, with its long and short forms and copy buttons */
.date-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 6px; padding: 8px 6px 8px 12px; border-radius: 10px; background: #FFFFFF; }
.date-row.is-src { background: transparent; }
.date-row-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.date-tag { font-size: 12px; font-weight: 700; color: var(--red); letter-spacing: 0.03em; }
.date-row.is-src .date-tag { color: var(--faint); }
.date-long { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.copy-short { align-self: flex-start; border: none; background: transparent; padding: 0; color: var(--muted); font-size: 13px; cursor: pointer; }
.copy-short:hover { color: var(--red); text-decoration: underline; }
.copy-short.is-copied { color: var(--red); }
.copy-long { width: 30px; height: 30px; border: none; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.copy-long:hover { background: var(--sand-strong); color: var(--red); }
.copy-long.is-copied { color: var(--red); }
.hero .date-row { padding: 10px 8px 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.09); }
.hero .date-tag { color: var(--rose); }
.hero .date-long { color: #FFFFFF; }
.hero .copy-short { color: var(--rose); }
.hero .copy-short:hover, .hero .copy-short.is-copied { color: #FFFFFF; }
.hero .copy-long { color: #FFFFFF; }
.hero .copy-long:hover { background: rgba(255, 255, 255, 0.14); color: #FFFFFF; }

/* Calendar */
#tm-calendar { display: flex; flex-direction: column; gap: 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.icon-btn { width: 38px; height: 38px; flex: none; border: 1px solid var(--line-strong); background: #FFFFFF; border-radius: 10px; cursor: pointer; font-size: 22px; line-height: 1; color: var(--ink); display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--bg); }
.cal-title { display: flex; flex-direction: column; margin-left: 8px; min-width: 0; }
.cal-title h2 { margin: 0; font-size: 28px; line-height: 1.15; }
.cal-title span { font-size: 14px; color: var(--muted); }
.cal-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.select { position: relative; }
.select select { width: 100%; height: 38px; -webkit-appearance: none; appearance: none; border: 1px solid var(--line-strong); background: #FFFFFF; border-radius: 10px; padding: 0 28px 0 12px; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; }
.select::after { content: ''; position: absolute; right: 12px; top: 13px; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.btn-today { height: 38px; border: 1px solid var(--line-strong); background: #FFFFFF; border-radius: 10px; padding: 0 14px; font-size: 15px; font-weight: 600; color: var(--red); cursor: pointer; }
.btn-today:hover { background: var(--red-tint); }
.seg { display: flex; gap: 2px; background: var(--sand); padding: 3px; border-radius: 10px; }
.seg button { border: none; border-radius: 8px; padding: 6px 11px; font-size: 14px; font-weight: 600; cursor: pointer; background: transparent; color: var(--soft); }
.seg button.is-active { background: #FFFFFF; color: var(--red); box-shadow: 0 1px 3px rgba(34, 27, 23, 0.12); }

.cal-grid-wrap { position: relative; transition: opacity 0.15s; }
.is-busy .cal-grid-wrap { opacity: 0.55; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding-top: 2px; }
.cal-wd { text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); padding: 2px 0 6px; }
.cal-wd.is-sat { color: var(--red); }
.cell { min-height: 86px; min-width: 0; background: #FFFFFF; border: 1.5px solid var(--line-soft); border-radius: 10px; padding: 7px 8px 6px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; text-align: left; cursor: pointer; font-family: inherit; color: var(--ink); }
.cell:hover { box-shadow: inset 0 0 0 1px #D9CDBE; }
.cell-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; width: 100%; min-width: 0; }
.cell-big { font-size: 22px; font-weight: 600; line-height: 1; }
.cell-small { font-size: 12px; line-height: 1.2; color: var(--faint); white-space: nowrap; overflow: hidden; min-width: 0; flex: 0 1 auto; }
.cell-small.is-first { font-weight: 700; }
.cell-sub { font-size: 12px; line-height: 1.25; color: #8A7E75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; min-height: 15px; }
.cell-sub.is-fest { color: var(--soft); font-weight: 500; }
.cell-sub.is-holiday { color: var(--red); font-weight: 600; }
.cell-sub.is-gold { color: var(--gold); font-weight: 600; }
.cell.is-hol .cell-big { color: var(--red); }
.cell.is-muted { background: transparent; border-color: transparent; opacity: 0.4; }
.cell.is-today { background: var(--red-tint); border-color: var(--red); opacity: 1; }
.cell.is-sel { background: var(--red); border-color: var(--red); opacity: 1; }
.cell.is-sel .cell-big, .cell.is-sel .cell-sub.is-fest, .cell.is-sel .cell-sub.is-holiday { color: #FFFFFF; }
.cell.is-sel .cell-small, .cell.is-sel .cell-sub { color: #F6D9D4; }
.cell.is-sel .cell-sub.is-gold { color: #FFE9C2; }
.cell.is-empty { background: transparent; border-color: transparent; cursor: default; box-shadow: none; }

.popover { position: absolute; z-index: 15; background: #FFFFFF; border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: 0 20px 44px -14px rgba(34, 27, 23, 0.38), 0 2px 6px rgba(34, 27, 23, 0.08); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.pop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pop-title { display: flex; flex-direction: column; min-width: 0; }
.pop-rel { align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--gold); background: var(--gold-tint); padding: 0 8px; border-radius: 999px; }
.pop-big { font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1.25; margin-top: 4px; }
.pop-sub { font-size: 14px; color: var(--muted); }
.pop-close { flex: none; width: 30px; height: 30px; border: none; background: var(--sand); color: var(--soft); border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.pop-close:hover { background: var(--sand-strong); color: var(--red); }
.pop-fests { display: flex; flex-wrap: wrap; gap: 6px; }
.pop-fests span { background: var(--red-tint); color: var(--red); font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.pop-rows { display: flex; flex-direction: column; border-top: 1px solid var(--line-soft); }
.pop-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid #F4EEE5; font-size: 14px; }
.pop-row span:first-child { color: var(--muted); flex: none; }
.pop-row span:last-child { font-weight: 600; text-align: right; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.legend > span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend .lg-today { border: 1.5px solid var(--red); background: var(--red-tint); }
.legend .lg-hol { background: var(--red); }
.legend .lg-ns { background: #C9962E; }
.legend .legend-hint { margin-left: auto; }
.legend .legend-hint.is-alert { color: var(--red); font-weight: 600; }

/* Converter */
.converter { box-shadow: 0 1px 0 var(--line), 0 12px 32px -18px rgba(34, 27, 23, 0.25); }
#tm-converter { display: flex; flex-direction: column; gap: 14px; }
.conv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.conv-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.conv-head h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.conv-head span { font-size: 14px; color: var(--muted); text-wrap: pretty; }
.conv-head .btn-ghost { flex: none; }
.conv-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; background: var(--sand); padding: 3px; border-radius: 11px; }
.conv-tabs button { border: none; border-radius: 8px; padding: 8px 4px; font-size: 14px; font-weight: 600; cursor: pointer; background: transparent; color: var(--soft); }
.conv-tabs button.is-active { background: #FFFFFF; color: var(--red); box-shadow: 0 1px 3px rgba(34, 27, 23, 0.12); }
.conv-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 0.85fr); gap: 10px; }
.conv-fields.is-ns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.field .select select { height: 44px; background: var(--paper); font-size: 16px; }
.field .select::after { right: 13px; top: 16px; width: 7px; height: 7px; border-width: 1.6px; }
.conv-result { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; transition: opacity 0.15s; }
.conv-result.is-loading { opacity: 0.6; }
.conv-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px 4px; }
.conv-rel { font-size: 13px; color: var(--gold); font-weight: 600; }
.conv-rows { display: flex; flex-direction: column; gap: 4px; }
.conv-msg { padding: 14px 6px; font-size: 15px; color: var(--muted); text-wrap: pretty; }
.btn-dark { border: none; background: var(--ink); color: #FFFFFF; font-size: 15px; font-weight: 600; padding: 11px 18px; border-radius: 12px; cursor: pointer; }
.btn-dark:hover { background: var(--red); }
.btn-dark:disabled { opacity: 0.45; cursor: default; background: var(--ink); }

/* Upcoming festivals */
.festivals { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.fest-list { display: flex; flex-direction: column; }
.fest-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 7px 8px; margin: 0 -8px; border: none; background: transparent; border-radius: 12px; cursor: pointer; text-align: left; font-family: inherit; color: var(--ink); }
.fest-item:hover { background: var(--bg); }
.fest-box { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 44px; border-radius: 10px; background: var(--sand); color: var(--soft); }
.fest-item.is-hol .fest-box { background: var(--red-tint); color: var(--red); }
.fest-item.is-sel .fest-box { background: var(--red); color: #FFFFFF; }
.fest-day { font-size: 18px; font-weight: 700; line-height: 1; }
.fest-mon { font-size: 11px; font-weight: 600; line-height: 1.3; }
.fest-text { display: flex; flex-direction: column; min-width: 0; }
.fest-name { font-size: 15px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fest-sub, .fest-rel { font-size: 13px; color: var(--muted); }
.fest-rel { white-space: nowrap; }
.fest-list .state-msg { padding: 14px 0; text-align: left; }

/* Apps */
.apps { background: var(--ink); color: var(--bg); border-color: var(--ink); display: flex; flex-direction: column; gap: 14px; }
.apps-head { display: flex; flex-direction: column; gap: 2px; }
.apps-head h2 { margin: 0; font-size: 20px; line-height: 1.25; color: #FFFFFF; }
.apps-head span { font-size: 14px; line-height: 1.45; color: #D8CEC4; text-wrap: pretty; }
.apps-body { display: flex; gap: 12px; align-items: stretch; }
.qr { width: 104px; flex: none; border-radius: 12px; background: #FFFFFF; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qr img { display: block; width: 100%; height: auto; }
.store-links { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.store-links a { display: flex; flex-direction: column; justify-content: center; height: 48px; padding: 0 14px; border-radius: 10px; background: var(--bg); color: var(--ink); text-decoration: none; }
.store-links a:hover { background: #FFFFFF; color: var(--ink); }
.store-sub { font-size: 11px; line-height: 1.1; color: var(--muted); }
.store-name { font-size: 16px; font-weight: 700; line-height: 1.2; }
.widget-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #3A312B; padding-top: 12px; color: var(--bg); text-decoration: none; font-size: 14px; font-weight: 600; }
.widget-link:hover { color: #FFFFFF; }
.widget-arrow { color: #B8ACA1; }

/* Footer */
.site-footer { padding-top: 24px; padding-bottom: 24px; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; font-size: 14px; color: var(--muted); }
.site-footer a { color: var(--muted); }
.site-footer .powered { margin-left: auto; text-decoration: none; }
.site-footer .powered img { display: block; height: 35px; width: auto; }

@media (max-width: 560px) {
  .wrap { padding-left: 14px; padding-right: 14px; }
  .card { padding: 14px; border-radius: 16px; }
  .hero { padding: 16px; border-radius: 16px; }
  .hero-big { font-size: 36px; }
  .cal-title h2 { font-size: 24px; }
  .cal-grid { gap: 3px; }
  .cell { min-height: 66px; padding: 5px 4px 4px; border-radius: 8px; }
  .cell-big { font-size: 17px; }
  .cell-small, .cell-sub { font-size: 10px; }
  .cal-wd { font-size: 12px; }
  .legend .legend-hint { margin-left: 0; }
  .nav a { padding: 6px 8px; font-size: 15px; }
  /* The header wraps to several rows on a phone, so it scrolls away instead of covering the page. */
  .site-header { position: relative; }
  .header-actions { margin-left: 0; justify-content: flex-start; }
  .system-menu { position: static; }
  .system-menu-panel { left: 14px; right: 14px; width: auto; top: calc(100% - 4px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cal-grid-wrap, .conv-result { transition: none; }
}
