:root {
  --bg: #0e0e0d;
  --surface: #181816;
  --surface-2: #201f1c;
  --line: #2b2925;
  --line-2: #4a463e;
  --text: #f4f0e8;
  --muted: #bcb5a6;
  --faint: #938c7e;
  --amber: #e8b04a;
  --amber-soft: rgba(232, 176, 74, 0.12);
  --amber-ink: #1a1407;
  --serif: "DM Serif Display", "Noto Sans Tamil", Georgia, serif;
  --sans: Inter, "Noto Sans Tamil", system-ui, -apple-system, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.5; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; }
button { font-family: var(--sans); cursor: pointer; }
svg.i { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- frame ---------- */
.screen { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-top: var(--safe-top); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 20px; color: var(--text); }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--amber); }
.brand .mark svg.i { width: 18px; height: 18px; }
.chip { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); background: var(--amber-soft); border: 1px solid rgba(232, 176, 74, 0.3); padding: 6px 11px; border-radius: 999px; white-space: nowrap; }
.sprockets { height: 8px; margin: 0 22px; border-radius: 2px; background: repeating-linear-gradient(90deg, #2c2a26 0 9px, transparent 9px 19px); }
main { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 18px 22px calc(28px + var(--safe-bottom)); animation: rise 0.35s ease both; }
.has-tabs main { padding-bottom: calc(112px + var(--safe-bottom)); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main { animation: none; } }

/* ---------- type ---------- */
h1 { margin: 2px 0 0; font-family: var(--serif); font-weight: 400; font-size: 31px; line-height: 1.18; letter-spacing: -0.005em; }
h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.2; }
.ta { margin-top: -6px; font-family: "Noto Sans Tamil", var(--sans); font-size: 21px; line-height: 1.5; color: var(--muted); }
p { margin: 0; font-size: 18px; line-height: 1.55; color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.amber { color: var(--amber); }

/* ---------- photo ---------- */
.photo { position: relative; border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--line); min-height: 200px; }
.photo img { display: block; width: 100%; height: auto; max-height: 52vh; object-fit: cover; }
.photo .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 16px 12px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.75)); font-size: 15px; color: #f4f0e8; }
.skeleton { min-height: 220px; background: linear-gradient(100deg, #1a1917 30%, #24221f 50%, #1a1917 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.photo .msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 15px; }

/* ---------- inputs ---------- */
label { font-size: 15px; color: var(--muted); }
textarea, input[type=text], input[type=date], input[type=datetime-local], input[type=number], select {
  width: 100%; font-family: var(--sans); font-size: 19px; line-height: 1.45; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 14px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 170px; resize: vertical; }
textarea::placeholder, input::placeholder { color: var(--faint); }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 4px rgba(232, 176, 74, 0.18); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.hint { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--faint); margin-top: -4px; }
.hint svg.i { width: 18px; height: 18px; color: var(--amber); }

/* ---------- buttons ---------- */
.primary { width: 100%; height: 58px; border: 0; border-radius: 16px; background: var(--amber); color: var(--amber-ink); font-size: 19px; font-weight: 600; box-shadow: 0 10px 28px rgba(232, 176, 74, 0.22); transition: transform 0.12s, opacity 0.15s; }
.primary:active { transform: scale(0.98); }
.primary:disabled { opacity: 0.65; }
.secondary { width: 100%; height: 54px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); color: var(--text); font-size: 17px; font-weight: 600; transition: transform 0.12s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.secondary:active { transform: scale(0.98); }
.link { align-self: center; background: none; border: 0; color: var(--muted); font-size: 17px; padding: 12px 16px; min-height: 48px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-2); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.card .q { font-family: var(--serif); font-size: 22px; line-height: 1.28; }
.card .body { font-size: 18px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.sealed { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 16px; background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.sealed svg.i { width: 18px; height: 18px; margin-top: 2px; color: var(--amber); }
.notice { border-color: rgba(232, 176, 74, 0.35); background: linear-gradient(180deg, rgba(232, 176, 74, 0.08), var(--surface)); }
.notice .row { display: flex; gap: 12px; align-items: flex-start; }
.notice .row svg.i { color: var(--amber); margin-top: 3px; }
.notice strong { display: block; font-size: 18px; margin-bottom: 2px; }
.error { background: #2e1a17; border: 1px solid #8f4334; color: #f5d6cf; border-radius: 14px; padding: 13px 15px; font-size: 16px; }
.ok { background: #172a1f; border: 1px solid #3f7c58; color: #d4efdf; border-radius: 14px; padding: 13px 15px; font-size: 16px; }

/* ---------- hero screens ---------- */
.hero { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 14px; padding: 12px 0; }
.hero .big { font-family: var(--serif); font-size: 38px; line-height: 1.15; }
.hero .badge { width: 68px; height: 68px; border-radius: 22px; display: grid; place-items: center; background: var(--amber-soft); border: 1px solid rgba(232, 176, 74, 0.3); color: var(--amber); margin-bottom: 6px; }
.hero .badge svg.i { width: 32px; height: 32px; }
.hero p { max-width: 30ch; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding-bottom: var(--safe-bottom); background: rgba(14, 14, 13, 0.82); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); border-top: 1px solid var(--line); }
.tabbar .inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tabbar button { position: relative; background: none; border: 0; color: var(--faint); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; min-height: 64px; font-size: 13px; font-weight: 600; }
.tabbar button svg.i { width: 25px; height: 25px; }
.tabbar button[aria-current=true] { color: var(--amber); }
.tabbar .count { position: absolute; top: 6px; left: calc(50% + 8px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--amber); color: var(--amber-ink); font-size: 12px; line-height: 20px; }

/* ---------- admin ---------- */
.admin main { gap: 16px; }
.admin .screen { max-width: 760px; }
.admin h2 { font-size: 24px; }
.admin label { display: block; margin-bottom: 6px; }
.admin .row { display: grid; gap: 14px; }
.admin textarea { min-height: 96px; }
.admin .tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.admin .tabs button { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 16px; font-weight: 600; }
.admin .tabs button[aria-current=true] { border-color: var(--amber); color: var(--amber); background: var(--amber-soft); }
.admin .thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.admin .thumbs figure { margin: 0; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.admin .thumbs img { width: 100%; height: 110px; object-fit: cover; border-radius: 12px; background: #000; }
.admin .small { font-size: 14px; color: var(--faint); }
.admin .status { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.admin .status.live { color: #7fd1a0; } .admin .status.scheduled { color: var(--amber); } .admin .status.off { color: var(--faint); }
.admin .check { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--text); }
.admin .check input { width: 22px; height: 22px; accent-color: var(--amber); }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
