/* Dinam — one stylesheet for every page. Calm and large: pale warm paper, navy ink, saffron sun. No emoji;
 * one family of line icons drawn in render.js. */
:root {
  --bg: #F7F2EA; --card: #FFFFFF; --ink: #1B2440; --muted: #5F6473; --line: #ECE4D7;
  --navy: #1F2E55; --saffron: #E8792B; --tint: #FBEFE2;
  --accent: #B4501C; --avoid: #A3261B; --avoid-bg: #FBECE8; --good: #0F6B3E; --good-bg: #E7F4EC; --next-bg: #EFE8DC;
  --radius: 18px;
  --font: "Noto Sans", "Noto Sans Malayalam", "Noto Sans Tamil", "Noto Sans Devanagari", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121418; --card: #1C1F25; --ink: #F2EFE9; --muted: #A9ABB4; --line: #2C3038;
          --navy: #DDE3F2; --saffron: #F08A4B; --tint: #2B241E;
          --accent: #F08A4B; --avoid: #FF8A7A; --avoid-bg: #3A1D19; --good: #6FD39E; --good-bg: #14301F; --next-bg: #232327; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 18px; line-height: 1.45; overflow-wrap: break-word; }
body.big { font-size: 21px; }
main { max-width: 560px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px 40px; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topr { display: flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--navy); text-decoration: none; min-height: 48px; }
.brand span { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.55em; letter-spacing: 0.03em; line-height: 1; }
.mark { width: 34px; height: 34px; flex: none; }
.m-sun { fill: var(--saffron); } .m-line { fill: var(--navy); } .m-glow { fill: var(--saffron); opacity: 0.45; }
.pill, .chip { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 999px;
               border: 1.5px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; }
.chip { min-height: 40px; padding: 0 12px; font-size: 0.8em; }
.chip[hidden] { display: none; }
.pill svg, .chip svg { width: 18px; height: 18px; flex: none; }
.pill { max-width: 70%; }
.pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* back, for pages reached from a day page */
.back { margin-top: 12px; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 18px 0 12px; border-radius: 999px;
        border: 1.5px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; }
.back svg { width: 20px; height: 20px; }

/* breadcrumbs */
.crumbs { margin-top: 12px; font-size: 0.82em; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* date + place */
.when { margin-top: 16px; }
.eyebrow { margin: 0; font-size: 0.92em; font-weight: 600; color: var(--muted); }
.date { margin: 2px 0 0; font-size: 1.55em; font-weight: 700; line-height: 1.2; }
.placebtn { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none;
            color: var(--muted); font-weight: 500; cursor: pointer; text-align: left; }
.placebtn b { color: var(--ink); font-weight: 600; }
.placebtn svg { width: 18px; height: 18px; flex: none; }

/* the answer */
.status { margin-top: 14px; padding: 18px; border-radius: var(--radius); font-weight: 700; font-size: 1.12em; line-height: 1.3;
          background: var(--next-bg); display: flex; gap: 12px; align-items: center; }
.status.avoid { background: var(--avoid-bg); color: var(--avoid); }
.status.good { background: var(--good-bg); color: var(--good); }
.sic { width: 46px; height: 46px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
       background: var(--card); color: var(--muted); }
.sic svg { width: 26px; height: 26px; }
.sic > span { display: none; }
.status .s-next, .status.avoid .s-avoid, .status.good .s-good { display: flex; }
.status.avoid .s-next, .status.good .s-next { display: none; }
.status.avoid .sic { color: var(--avoid); }
.status.good .sic { color: var(--good); }

/* cards */
.card { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px;
        box-shadow: 0 1px 2px rgba(27, 36, 64, 0.04), 0 4px 14px rgba(27, 36, 64, 0.04); }
/* rows: on phones the time sits under its name (never collides, same shape in every language); side by side when wide */
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "ic k" "ic v"; align-items: center; gap: 1px 12px;
       padding: 12px 0; border-top: 1px solid var(--line); }
.row > .ic { grid-area: ic; } .row > .k { grid-area: k; overflow-wrap: anywhere; } .row > .v { grid-area: v; }
@media (min-width: 480px) {
  .row:not(.el) { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "ic k v"; }
  .row:not(.el) > .v { text-align: right; font-size: 1em; }
}
.row:first-child { border-top: 0; }
.row[hidden] { display: none; }
.row .k { font-weight: 600; min-width: 0; }
.row .k small { display: block; font-weight: 500; color: var(--muted); font-size: 0.8em; margin-top: 1px; }
.row .v { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; font-size: 1.12em; }
.ic { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--tint); color: var(--accent); flex: none; }
.ic svg { width: 22px; height: 22px; }
.row.avoid .ic { background: var(--avoid-bg); color: var(--avoid); }
.row.good .ic { background: var(--good-bg); color: var(--good); }
.row.live .v { color: var(--avoid); }
.row.good.live .v { color: var(--good); }
.row.el { grid-template-columns: 40px auto minmax(0, 1fr); grid-template-areas: "ic k v"; align-items: start; }
.row.el > .k { overflow-wrap: normal; }                         /* short names: never split a word */
.row.el > .v { text-align: right; font-size: 1em; }
.row.el .ic { margin-top: 2px; }
.el .v { white-space: normal; }
.el .v small { display: block; color: var(--muted); font-weight: 500; font-size: 0.8em; }
.sun { display: grid; grid-template-columns: 1fr 1fr; }
.sun > div { padding: 13px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.sun .ic { width: 36px; height: 36px; }
.sun > div + div { border-left: 1px solid var(--line); padding-left: 14px; }
.sun .k { color: var(--muted); font-weight: 500; font-size: 0.9em; }
.sun .v { font-weight: 700; font-size: 1.2em; font-variant-numeric: tabular-nums; }

/* tappable terms: look like text, with a quiet dotted underline */
.term { border: 0; padding: 10px 0; margin: -10px 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left;
        text-decoration: underline dotted; text-decoration-color: var(--muted); text-underline-offset: 4px; }
.term:hover { text-decoration-color: var(--accent); }

.hint { margin: 10px 2px 0; color: var(--muted); font-size: 0.82em; text-align: center; }
.more { width: 100%; min-height: 48px; margin-top: 8px; border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; }

/* day navigation */
.nav { margin-top: 12px; display: grid; grid-template-columns: 56px 1fr 56px; gap: 10px; }
.navbtn { min-height: 56px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; color: var(--ink);
          display: flex; align-items: center; justify-content: center; text-decoration: none; }
.navbtn svg { width: 22px; height: 22px; }
.navbtn[aria-current] { color: var(--muted); }
.navbtn.off { opacity: 0.3; }
.installbtn { margin-top: 10px; width: 100%; min-height: 54px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card);
              font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; }
.installbtn[hidden] { display: none; }
.installbtn svg { width: 20px; height: 20px; }
.golink { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.monthlink { display: block; margin-top: 12px; text-align: center; font-weight: 600; text-decoration: none; min-height: 44px; line-height: 44px; }
.actions { margin-top: 6px; }
.share { margin-top: 10px; width: 100%; min-height: 58px; border: 0; border-radius: 16px; background: var(--navy); color: var(--card);
         font-weight: 700; font-size: 1.02em; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; }
.share svg { width: 22px; height: 22px; }

/* text for search engines and readers */
.summary { margin-top: 18px; color: var(--muted); font-size: 0.88em; }
.nearby h2, .list h2 { font-size: 1em; margin: 18px 0 6px; }
.nearby p { margin: 0; line-height: 2; }
.list { padding: 4px 18px 14px; }
.list h2 { margin-top: 12px; }
.list p { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.list a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--bg);
          border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }

/* month table */
.tablewrap { margin-top: 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.month { border-collapse: collapse; width: 100%; font-size: 0.9em; font-variant-numeric: tabular-nums; }
table.month th, table.month td { padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
table.month thead th { position: sticky; top: 0; background: var(--card); font-weight: 700; }
table.month tbody th { position: sticky; left: 0; background: var(--card); font-weight: 600; }
table.month tbody th a { color: var(--ink); }
table.month tr.today th, table.month tr.today td { background: var(--next-bg); font-weight: 700; }
table.plain { border-collapse: collapse; margin: 10px 0; }
table.plain th, table.plain td { border: 1px solid var(--line); padding: 6px 12px; text-align: left; }

/* articles */
.prose { margin-top: 18px; }
.prose h1 { font-size: 1.5em; line-height: 1.2; margin: 0 0 12px; }
.prose h2 { font-size: 1.12em; margin: 22px 0 6px; }
.prose p, .prose li { color: var(--ink); }
.prose .big { font-size: 1.2em; }
.morelink { font-weight: 600; text-decoration: none; }

.foot { margin-top: 26px; color: var(--muted); font-size: 0.82em; text-align: center; }
.foot p { margin: 4px 0; }
.footlinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-bottom: 10px; }
.footlinks a { color: var(--muted); min-height: 32px; line-height: 32px; }
/* ad spaces: clearly labelled, set apart from buttons, height reserved so the page never jumps */
.ad { margin: 32px 0 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.adlabel { display: block; margin-bottom: 6px; font-size: 0.72em; letter-spacing: 0.04em; color: var(--muted); text-align: center; }
.ad ins.adsbygoogle { min-height: 250px; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }       /* no ad to show: give the space back */
.adph { height: 250px; border: 2px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center;
        color: var(--muted); font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.08em; }

/* sheets */
dialog { width: min(560px, 100vw); max-width: 100vw; margin: auto auto 0; padding: 0; border: 0; border-radius: 22px 22px 0 0;
         background: var(--card); color: var(--ink); max-height: 88vh; }
@media (min-width: 600px) { dialog { margin: auto; border-radius: 22px; } }
dialog::backdrop { background: rgba(10, 10, 12, 0.45); }
.sheet { position: relative; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); }
.sheet h2 { padding-right: 52px; }
.x { position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--bg); cursor: pointer;
     display: flex; align-items: center; justify-content: center; }
.x svg { width: 22px; height: 22px; }
.sheet h2 { margin: 0 0 14px; font-size: 1.3em; }
#termText { margin: 0 0 12px; line-height: 1.6; }
.langs { display: grid; gap: 10px; }
.langs a { min-height: 64px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg); font-size: 1.35em; font-weight: 700;
           color: var(--ink); text-decoration: none; padding: 0 18px; display: flex; justify-content: space-between; align-items: center; }
.langs a[aria-current] { border-color: var(--accent); }
.langs a[aria-current]::after { content: "✓"; color: var(--accent); }
.textsize { margin-top: 14px; display: flex; gap: 10px; }
.textsize button { flex: 1; min-height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); font-weight: 700; cursor: pointer; }
.textsize button[aria-pressed="true"] { border-color: var(--accent); }
.textsize .bigA { font-size: 1.3em; }
.primary { margin-top: 16px; width: 100%; min-height: 58px; border: 0; border-radius: 16px; background: var(--accent); color: #fff; font-weight: 700; font-size: 1.05em; cursor: pointer; }
.search { width: 100%; min-height: 54px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); padding: 0 16px; font: inherit; }
.gps { margin-top: 10px; width: 100%; min-height: 52px; border-radius: 14px; border: 2px dashed var(--line); background: none; font-weight: 600; cursor: pointer; }
.plist { list-style: none; margin: 10px 0 0; padding: 0; max-height: 46vh; overflow-y: auto; }
.plist a { display: flex; align-items: center; min-height: 50px; border-bottom: 1px solid var(--line); padding: 0 6px; color: var(--ink); text-decoration: none; }

/* ---------------------------------------------------------------- day page, template layout */
.pill > svg:last-child { width: 16px; height: 16px; opacity: 0.7; }
.placepill { margin-top: 10px; max-width: 100%; gap: 8px; }
.placepill b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-change { color: var(--muted); font-weight: 500; font-size: 0.85em; white-space: nowrap; }
.when .date { font-size: 1.75em; }

.status { border: 1px solid var(--line); padding: 16px; gap: 14px; }
.status.avoid { border-color: #F1C7BF; } .status.good { border-color: #BFE0CC; }
.sic { width: 56px; height: 56px; background: var(--navy); color: #fff; }
.sic svg { width: 30px; height: 30px; }
.status.avoid .sic { background: var(--avoid); color: #fff; }
.status.good .sic { background: var(--good); color: #fff; }
.st { display: flex; flex-direction: column; min-width: 0; }
.st b { font-size: 1.3em; line-height: 1.2; }
.st span { font-weight: 500; color: var(--ink); opacity: 0.85; margin-top: 2px; }

.panel { margin-top: 14px; border-radius: var(--radius); padding: 2px 16px 4px; border: 1px solid var(--line); background: var(--card); }
.panel h2 { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; padding-bottom: 12px; font-size: 1.12em; }
.hic { width: 30px; height: 30px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.hic svg { width: 18px; height: 18px; }
.avoidp { background: #FDF1DF; border-color: #F3DBB4; }
.avoidp .hic { background: #E8851F; }
.goodp { background: var(--good-bg); border-color: #C9E6D3; }
.goodp .hic { background: var(--good); }
.goodp.off { background: var(--card); border-color: var(--line); }
.goodp.off .hic { background: var(--muted); }
.arow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 14px; padding: 12px 0; border-top: 1px solid rgba(160, 110, 40, 0.18); }
.goodp .arow { border-top-color: rgba(15, 107, 62, 0.15); }
.an { font-weight: 700; font-size: 1.05em; overflow-wrap: break-word; }
.an small { display: block; font-weight: 500; font-size: 0.75em; color: var(--muted); }
.at { font-weight: 700; font-size: 1.05em; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.arow.live .an, .arow.live .at { color: var(--avoid); }
.goodp .arow.live .an, .goodp .arow.live .at { color: var(--good); }
.arow.live .at::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: currentColor; margin-right: 7px; vertical-align: 0.1em; }
.term { text-decoration-color: rgba(95, 100, 115, 0.45); }

.glance { margin: 24px 2px 10px; font-size: 1.25em; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { position: relative; display: flex; align-items: center; gap: 9px; padding: 14px 8px 14px 10px; min-height: 86px;
        background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.tilehit { position: absolute; inset: 0; width: 100%; border: 0; background: none; border-radius: inherit; cursor: pointer; padding: 0; }
.tilehit:active { background: rgba(27, 36, 64, 0.04); }
.tile .ic { width: 40px; height: 40px; position: relative; pointer-events: none; }
.tt { flex: 1; }
.tile .ic svg { width: 24px; height: 24px; }
.tt { display: flex; flex-direction: column; min-width: 0; position: relative; pointer-events: none; }
.tk { font-size: 0.8em; color: var(--muted); font-weight: 500; }
.tv { font-size: 1.06em; font-weight: 700; line-height: 1.25; overflow-wrap: break-word; }
.ts { font-size: 0.72em; color: var(--muted); line-height: 1.35; }
.tile .ts.term { pointer-events: auto; padding: 4px 0; margin: -2px 0; text-align: left; font-size: 0.72em; color: var(--muted); }
.t-rise .ic { background: #FDF3D7; color: #B97F00; }
.t-set .ic { background: #FCE5DC; color: #CC5129; }
.t-moon .ic { background: #E5EBF8; color: #3F5FB0; }
.t-star .ic { background: #EDE7FA; color: #6B4FBB; }
.t-yoga .ic { background: #FBE4EA; color: #B8456A; }
.t-karana .ic { background: #E2F3E8; color: #2E8B57; }
.t-moon .ic svg, .t-star .ic svg { fill: currentColor; }
@media (prefers-color-scheme: dark) {
  .avoidp { background: #2C2216; border-color: #4A381F; }
  .goodp { border-color: #24533A; }
  .status.avoid { border-color: #5A2A22; } .status.good { border-color: #24533A; }
  .t-rise .ic { background: rgba(232, 170, 30, 0.16); color: #F2C14E; }
  .t-set .ic { background: rgba(230, 100, 60, 0.16); color: #F08A66; }
  .t-moon .ic { background: rgba(90, 130, 220, 0.18); color: #93AEEB; }
  .t-star .ic { background: rgba(140, 110, 220, 0.18); color: #B7A3F0; }
  .t-yoga .ic { background: rgba(210, 90, 130, 0.18); color: #EE9AB5; }
  .t-karana .ic { background: rgba(60, 170, 110, 0.18); color: #7FD3A3; }
}

.wa { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; border-radius: 16px;
      border: 2px solid #1FA855; background: var(--card); color: #128C4B; font-weight: 700; font-size: 1.05em; text-decoration: none; }
.wa svg { width: 28px; height: 28px; color: #1FA855; }
@media (prefers-color-scheme: dark) { .wa { color: #5BD58A; } }
.picbtn { margin-top: 10px; width: 100%; min-height: 50px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card);
          font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; }
.picbtn svg { width: 20px; height: 20px; }
.actions .nav { margin-top: 16px; }
.crumbs { margin-top: 22px; }

/* install panel */
.installsheet { text-align: center; }
.installsheet img { display: block; margin: 6px auto 10px; border-radius: 18px; box-shadow: 0 2px 10px rgba(27, 36, 64, 0.12); }
.installsheet h2 { padding: 0 44px; }
.installsheet p { margin: 0 0 6px; color: var(--muted); line-height: 1.55; }
.installsheet .primary[hidden] { display: none; }
.secondary { margin-top: 10px; width: 100%; min-height: 52px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card);
             font-weight: 600; cursor: pointer; }

/* place picker: popular towns, then country › state › district › town */
.gps { display: flex; align-items: center; justify-content: center; gap: 8px; }
.gps svg { width: 20px; height: 20px; color: var(--accent); }
.trail { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 0.85em; color: var(--muted); }
.trail:empty { display: none; }
.trail span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trailback { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card);
             font-weight: 700; cursor: pointer; }
.plist .pl { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 6px; border: 0; border-bottom: 1px solid var(--line);
             background: none; color: var(--ink); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.plist .pl span { flex: 1; min-width: 0; }
.plist .pl b { color: var(--accent); }
.plist .pl i { font-style: normal; font-size: 1.4em; color: var(--muted); }
.plist .pl.more span { font-weight: 600; }
.plist li:last-child .pl.more { color: var(--accent); }
.plist li.gap { border-bottom: 6px solid var(--bg); }
.loading { margin-top: 40vh; text-align: center; color: var(--muted); }

/* fits found by the phone-width sweep (Tamil/Malayalam words are long; large text makes them longer) */
.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tk { font-size: 0.76em; overflow-wrap: break-word; }
@media (max-width: 420px) { body.big .tiles { grid-template-columns: 1fr; } }      /* large text on a phone: one tile per row */
.top { gap: 8px; }
.brand { flex-shrink: 0; }
.top .pill { min-width: 0; padding: 0 12px; }
body.big .brand span { font-size: 1.25em; }
body.big .mark { width: 28px; height: 28px; }
table.plain { width: 100%; table-layout: fixed; font-size: 0.92em; }
table.plain th, table.plain td { padding: 6px 8px; overflow-wrap: break-word; }
/* phones: tiles give their words more room; with large text, a period's time goes under its name */
@media (max-width: 420px) {
  .tile { padding: 12px 8px; gap: 8px; }
  .tile .ic { width: 34px; height: 34px; }
  .tile .ic svg { width: 20px; height: 20px; }
  .tv { overflow-wrap: normal; }
  body.big .arow { grid-template-columns: 1fr; }
  body.big .at { text-align: left; }
}

/* calendar: button beside the date, month grid in a sheet */
.whenrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.whenrow .date { flex: 1; min-width: 0; }
.calbtn { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 64px; min-height: 60px;
          padding: 6px 8px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-size: 0.72em; font-weight: 700; cursor: pointer; }
.calbtn svg { width: 24px; height: 24px; color: var(--accent); }
.calhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 52px 10px 0; }
.calhead b { font-size: 1.15em; text-align: center; flex: 1; }
.calnav { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--bg); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.calnav svg { width: 22px; height: 22px; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calgrid .wd { text-align: center; font-size: 0.68em; color: var(--muted); font-weight: 600; padding-bottom: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cd { position: relative; aspect-ratio: 1 / 1; min-height: 42px; border: 0; border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; font-weight: 600;
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 0; }
.cd.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cd.sel { background: var(--navy); color: var(--card); }
.mk { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.mk.full { background: #E8A317; }
.mk.new { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.mk.eka { background: var(--good); width: 7px; height: 7px; }
.cd.sel .mk.new { box-shadow: inset 0 0 0 2px var(--card); }
.calday { margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: var(--bg); }
.calday dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0 0; }
.calday dt { color: var(--muted); }
.calday dd { margin: 0; font-weight: 700; text-align: right; }
.calday .primary { margin-top: 12px; min-height: 52px; }
.callegend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 12px 0 0; font-size: 0.8em; color: var(--muted); }
.callegend .mk { margin-left: 6px; }
.calnote { margin: 6px 0 0; font-size: 0.75em; color: var(--muted); }
.calsheet { max-height: 88vh; overflow-y: auto; }
.calhead.year { margin-top: -4px; }
.calhead.year b { font-size: 1em; color: var(--muted); }
.calhead.year .calnav { width: 40px; height: 40px; }
.calhead.year .calnav svg { width: 18px; height: 18px; }
/* phones: icon above the words, so long names (Purva Bhadrapada, திருவோணம்) get the tile's full width */
@media (max-width: 420px) {
  .tile { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; }
  .tv { font-size: 1.02em; overflow-wrap: break-word; }
  html[lang="ta"] .tv { font-size: 0.95em; }                   /* Tamil names run longest (சௌபாக்கியம்) */
}
/* calendar pickers: month names, years; and a way back to today */
.calpick { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 10px; border: 0; border-radius: 12px;
           background: none; color: var(--ink); font: inherit; cursor: pointer; }
.calpick:hover, .calpick[aria-expanded="true"] { background: var(--bg); }
.calpick svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.calpick b { font-size: 1.15em; }
.calhead.year .calpick b { font-size: 1em; color: var(--muted); }
.caltoday { display: block; margin: 0 0 10px auto; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card);
            color: var(--accent); font-weight: 700; cursor: pointer; }
.calpicker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.calpicker.years { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.calpicker[hidden], .calgrid[hidden], .callegend[hidden], .calnote[hidden] { display: none; }
.calpicker button { min-height: 52px; border: 0; border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer;
                    overflow-wrap: break-word; padding: 4px; }
.calpicker button.cur { background: var(--navy); color: var(--card); }
