:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card: #f9fafb;
  --link: #111827;
  --shadow: 0 1px 2px rgba(0,0,0,0.04);
  --te-font: "Anek Telugu", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --en-font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--en-font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

html[lang="te"] body {
  font-family: var(--te-font);
}

a { color: var(--link); }

.container { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.container--wide { max-width: 1400px; }

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 6px; }
.brand__title { font-size: 18px; font-weight: 700; text-decoration: none; }
.brand__sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg);
}
.lang-toggle__btn {
  border: none;
  background: transparent;
  min-height: 36px;
  padding: 0 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.lang-toggle__btn.is-active {
  background: var(--text);
  color: #fff;
}

.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 2px;
  text-decoration: none;
  font-weight: 600;
  color: var(--muted);
}

.tab--active {
  color: var(--text);
}

.tab--active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -13px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.h1 { font-size: 22px; margin: 18px 0 8px; }
.h2 { font-size: 16px; margin: 18px 0 8px; }
.muted { color: var(--muted); }

.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--bg);
  box-shadow: none;
}

.stack { display: grid; gap: 12px; }
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: none; }
.kv__k { color: var(--muted); font-weight: 600; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 6px 10px; font-weight: 600; }

/* Plain pills for tithi / nakshatra on day view (no border, no bold). */
.pill--plain {
  border: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-weight: 400;
}

.btnrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  text-decoration: none;
  font-weight: 700;

  padding: 10px 14px;
}

.btn[aria-disabled="true"],
.btn[aria-disabled="true"]:hover {
  opacity: 0.45;
  pointer-events: none;
}

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

.cell{
  border:1px solid var(--border);
  border-radius:14px;
  min-height:190px;
  padding:18px 16px 14px;
  background:var(--bg);
  position:relative;
  text-decoration:none;
  color:inherit;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  box-shadow: var(--shadow);
}

.cell:hover{
  background:#f9fafb;
  border-color:#d1d5db;
}

.cell--blank{
  border:none;
  background:transparent;
  padding:0;
  min-height:0;
  box-shadow:none;
}

.cell__date{
  font-weight:800;
  font-size:20px;
  line-height:1;
  text-align:center;
  margin:2px 0 10px;
  color: var(--text);
}

.cell__meta{
  width:100%;
  font-size:14px;
  line-height:1.35;
  color:var(--text);
  text-align:center;
}

.cell__meta .mutedline{
  color:var(--muted);
  font-size:13px;
  font-weight:500;
  margin-bottom:10px;
}

.cell__meta .accent{
  color:var(--text);
  font-weight:800;
  display:inline-block;
}

.cell__meta .tiny{
  color:var(--muted);
  font-size:13px;
  margin-top:10px;
}

.dot{
  position:absolute;
  top:10px;
  right:10px;
  width:8px;
  height:8px;
  border-radius:999px;
  background:#ef4444;
}

.weekdays{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:16px;
  margin:18px 0 12px;
  color:var(--muted);
  font-weight:600;
  font-size:14px;
}
.weekdays>div{
  text-align:left;
  padding:0 6px;
}


.footerop:10px;
  right:10px;
  width:8px;
  height:8px;
  border-radius:999px;
  background:#ef4444;
}

.weekdays{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:12px;
  margin:16px 0 12px;
  color:var(--muted);
  font-weight:600;
  font-size:13px;
}
.weekdays>div{
  text-align:center;
  padding:0;
}


.footer {
  border-top: 1px solid var(--border);
  margin-top: 26px;
  padding: 18px 0;
  color: var(--muted);
}

select {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px;
  font-weight: 600;
}

ul { padding-left: 18px; }


/* Month page header: align with full-bleed calendar scroller while keeping 16px inner padding */
.month-head{
  padding: 0 24px;
  margin: 0;
}


/* --- Month view horizontal scroll: keep weekday headers aligned with cells on small viewports --- */
.calendar-scroll{
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
  /* Match the header padding and avoid the calendar touching the viewport edge on small screens */
  margin: 0 -16px;
  padding: 0 16px;
}

@media (max-width: 980px){
  /* Force a consistent grid width so the whole calendar (headers + cells) scrolls together */
  .calendar-scroll .weekdays,
  .calendar-scroll .calendar{
    grid-template-columns: repeat(7, 180px);
    width: max-content;
  }
}



/* Moon markers (Purnima / Amavasya) next to day number */
/* Base moon marker */
.moon {
  display: inline-block;
  width: 20px;              /* Larger */
  height: 20px;
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
  border: 2px solid #111827;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 🌕 Purnima */
.moon--purnima {
  background: #ffffff;
  box-shadow:
    0 0 10px rgba(255, 255, 255, 1),
    0 0 20px rgba(255, 255, 255, 0.7),
    0 0 30px rgba(255, 255, 255, 0.4);
}

/* 🌑 Amavasya */
.moon--amavasya {
  background: #111827;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.5);
}

