/* ── Today / Coming up ───────────────────────────────────────────────────── */
.ht-today, .ht-upcoming { padding: 20px; height: 100%; }
.ht-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.ht-card-head h5 { margin: 0; font-size: 16px; }
.ht-card-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.ht-today-body { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 18px; align-items: center; }
.ht-today-meta { display: grid; gap: 6px; justify-items: start; }
.ht-today-meta strong { font-size: 15px; }
.ht-today-meta small { color: var(--muted); }
.ht-normal { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--border); }
.ht-normal > i { font-size: 26px; color: var(--primary); }
.ht-normal strong { display: block; }
.ht-normal span { color: var(--muted); font-size: 13px; }
.ht-saved { margin-top: 14px; font-size: 12px; color: var(--muted-2); }
.ht-upcoming-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ht-upcoming-list li { display: flex; gap: 12px; align-items: center; }
.ht-upcoming-list strong { display: block; font-size: 14px; font-family: 'Noto Sans Kannada', var(--font-body); }
.ht-upcoming-list small { color: var(--muted); font-size: 12px; }
.ht-date { width: 48px; height: 48px; flex: none; border-radius: 12px; background: var(--primary-50); color: var(--primary-700); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; text-transform: uppercase; line-height: 1.1; }
.ht-date b { font-size: 17px; }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.ht-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ht-filters { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.ht-filters button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; }
.ht-filters button.active { background: var(--gradient-primary); color: #fff; box-shadow: var(--shadow-primary); }
.ht-search { position: relative; min-width: 240px; }
.ht-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.ht-search input { padding-left: 34px; }

/* ── Grid ────────────────────────────────────────────────────────────────── */
.ht-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ht-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s; animation: fadeUp .5s var(--ease) both; }
.ht-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.ht-card.off .ht-card-preview { filter: grayscale(1); opacity: .55; }
.ht-card-preview { padding: 12px 12px 0; }
.ht-card-body { padding: 12px 16px 6px; flex: 1; }
.ht-card-body h6 { margin: 8px 0 6px; font-size: 15px; font-family: 'Noto Sans Kannada', var(--font-heading); }
.ht-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ht-meta { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.ht-meta i { color: var(--primary); margin-top: 1px; }
.ht-card-actions { display: flex; align-items: center; gap: 4px; padding: 10px 12px; border-top: 1px solid var(--border); }
.ht-spacer { flex: 1; }

/* ── Phone header preview (mirrors the app's ThemedHeader) ───────────────── */
/* Same layout as the apps: menu button beside the small top line, wishes below, art on the right. */
.ht-pv { position: relative; overflow: hidden; border-radius: 0 0 18px 18px; padding: 10px 14px 14px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.ht-pv-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ht-pv-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .15), rgba(0, 0, 0, .65)); }
.ht-pv-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ht-pv-menu { flex: none; width: 30px; height: 30px; border-radius: 9px; background: #fff; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .1); color: #1f2937; font-size: 17px; }
.ht-pv-body { position: relative; display: flex; gap: 10px; align-items: center; }
.ht-pv-art { flex: none; min-width: 84px; display: grid; place-items: center; }
.ht-pv-text { flex: 1; min-width: 0; font-family: 'Noto Sans Kannada', var(--font-body); }
.ht-pv-kicker { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht-pv-kn { font-size: 13px; font-weight: 800; line-height: 1.35; }
.ht-pv-title { font-size: 19px; font-weight: 900; line-height: 1.2; margin-top: 2px; }
.ht-pv-sub { font-size: 11.5px; font-weight: 600; margin-top: 4px; line-height: 1.35; }
.ht-pv.mini { padding: 8px 12px 12px; }
.ht-pv.mini .ht-pv-art { min-width: 78px; }
.ht-pv.mini .ht-pv-title { font-size: 16px; }
.ht-pv.mini .ht-pv-kn { font-size: 12px; }
.ht-pv.mini .ht-photo { width: 74px; height: 74px; }
.ht-pv.mini .ht-wflag { --fw: 66px; }
.ht-pv.mini .ht-map-behind { height: 130px; }

/* Waving flag (same idea as the apps' WavingFlag): 16 vertical strips of the flag
   face, each bobbing on a wave that grows towards the free end, shaded on the slopes. */
.ht-wflag { --fw: 84px; --fh: calc(var(--fw) * 2 / 3); position: relative; display: flex; align-items: flex-start; }
.ht-pole { position: relative; width: 3px; height: calc(var(--fh) + 34px); border-radius: 2px; background: #9ca3af; margin-right: 1px; flex: none; }
.ht-pole::before { content: ""; position: absolute; top: -4px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: #d4a017; }
.ht-wflag-face { position: relative; display: block; width: var(--fw); height: var(--fh); margin-top: 2px; }
.ht-wflag-face.still { background-size: 100% 100%; box-shadow: 0 2px 4px rgba(0, 0, 0, .12); }
.ht-wflag-face > span { position: absolute; top: 0; height: 100%; width: calc(var(--fw) / 16 + .6px); left: calc(var(--fw) / 16 * var(--i)); overflow: hidden;
  background-repeat: no-repeat; background-size: var(--fw) var(--fh); background-position: calc(var(--fw) / -16 * var(--i)) 0;
  animation: htWave 1.7s ease-in-out infinite; animation-delay: var(--d); --amp: calc(var(--fh) * .1 * var(--x)); }
.ht-wflag-face > span::after { content: ""; position: absolute; inset: 0; background: #000; opacity: 0;
  animation: htShade 1.7s ease-in-out infinite; animation-delay: calc(var(--d) - .425s); }
@keyframes htWave { 0%, 100% { transform: translateY(calc(var(--amp) * -1)); } 50% { transform: translateY(var(--amp)); } }
@keyframes htShade { 0%, 100% { opacity: 0; } 50% { opacity: calc(var(--x) * .2); } }
@media (prefers-reduced-motion: reduce) { .ht-wflag-face > span, .ht-wflag-face > span::after { animation: none; } }
/* Karnataka map silhouette behind the picture (theme.showMap) */
.ht-map-behind { position: absolute; right: 4px; bottom: -12px; height: 160px; width: auto; opacity: .22; pointer-events: none; }
.ht-photo { width: 92px; height: 92px; border-radius: 50%; border: 3px solid; padding: 3px; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15); }
.ht-photo img, .ht-photo span { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-weight: 900; font-size: 20px; font-family: 'Noto Sans Kannada', var(--font-body); }

/* ── Form panel ──────────────────────────────────────────────────────────── */
.ht-panel { width: min(760px, 100vw); }
.ht-form { display: grid; gap: 18px; align-content: start; }
.ht-preview-wrap { position: sticky; top: -20px; z-index: 2; background: var(--surface); padding: 6px 0 10px; }
.ht-preview-wrap .ht-pv { max-width: 400px; margin: 0 auto; }
.ht-preview-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-align: center; }
.ht-section { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.ht-section h6 { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 0 0 12px; }
.ht-section h6 i { color: var(--primary); }
.ht-form .kn { font-family: 'Noto Sans Kannada', var(--font-body); }
.ht-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.ht-day { display: flex; gap: 6px; align-items: center; }
.ht-art-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ht-art-grid label { cursor: pointer; }
.ht-art-grid input { position: absolute; opacity: 0; pointer-events: none; }
.ht-art-grid span { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; border: 1.5px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2); text-align: center; transition: border-color .2s, background .2s; }
.ht-art-grid span i { font-size: 20px; color: var(--muted); }
.ht-art-grid input:checked + span { border-color: var(--primary); background: var(--primary-50); color: var(--primary-700); }
.ht-art-grid input:checked + span i { color: var(--primary); }
.ht-art-grid input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-100); }
.ht-colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ht-colors label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ht-colors input[type=color] { width: 100%; height: 40px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.ht-more { border: 1px dashed var(--border); border-radius: var(--radius); padding: 10px 14px; }
.ht-more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ht-section .ht-more { border-style: solid; background: var(--surface-2); }

@media (max-width: 767.98px) {
  .ht-today-body { grid-template-columns: 1fr; }
  .ht-art-grid, .ht-colors { grid-template-columns: repeat(2, 1fr); }
  .ht-search { min-width: 0; flex: 1; }
}
