:root {
  --bg: #fdf6ec;
  --surface: #ffffff;
  --ink: #1c1917;
  --muted: #6b635d;
  --line: #eadfce;
  --brand: #ea580c;
  --brand-deep: #9a3412;
  --maroon: #7c2d12;
  --gold: #f59e0b;
  --sel-bg: #fff1e6;
  --sel-line: #ea580c;
  --mine-bg: #ecfdf5;
  --mine-line: #059669;
  --taken-ink: #a8a29e;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(28 25 23 / .06), 0 4px 16px rgb(28 25 23 / .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 150px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 Mukta, system-ui, sans-serif;
  padding-bottom: 96px;
}
button, input { font: inherit; color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(circle at 85% 20%, rgb(251 191 36 / .35), transparent 40%),
    radial-gradient(circle at 10% 90%, rgb(234 88 12 / .35), transparent 45%),
    linear-gradient(135deg, #431407, var(--maroon) 55%, #9a3412);
  color: #fff7ed;
}
.hero-inner { max-width: 1120px; margin: 0 auto; padding: 40px 16px 28px; display: flex; flex-direction: row-reverse; align-items: center; gap: 32px; }
.hero-text { flex: 1; min-width: 0; }
/* Annakut darshan photo in a mandir-style arch */
.darshan {
  flex: none; margin: 0; width: 260px; aspect-ratio: 2 / 3; padding: 6px;
  border-radius: 140px 140px 18px 18px;
  background: linear-gradient(160deg, #fde68a, #d97706 45%, #fbbf24 70%, #92400e);
  box-shadow: 0 0 0 1px rgb(253 230 138 / .35), 0 12px 40px rgb(0 0 0 / .35), 0 0 60px rgb(251 191 36 / .25);
}
.darshan img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; border-radius: 134px 134px 13px 13px; }
.eyebrow { margin: 0; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; color: #fdba74; font-weight: 600; }
.hero h1 { font-family: 'Yatra One', Mukta, serif; font-weight: 400; font-size: clamp(34px, 7vw, 56px); line-height: 1.05; margin: 6px 0 10px; }
.hero h1 span { color: var(--gold); }
.tagline { margin: 0 0 18px; color: #fde68a; font-size: 20px; font-weight: 500; letter-spacing: .01em; }
.rules { background: rgb(0 0 0 / .22); border: 1px solid rgb(253 186 116 / .3); border-radius: var(--radius); padding: 12px 14px; max-width: 760px; }
.rules-intro { margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid rgb(253 186 116 / .25); color: #fff7ed; font-size: 15px; }
.rules-title { display: block; font-size: 13px; font-weight: 600; color: #fdba74; margin-bottom: 8px; }
.rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rules li { background: rgb(255 255 255 / .1); border-radius: 999px; padding: 2px 10px; font-size: 14px; white-space: nowrap; }

/* ---------- edit banner ---------- */
.edit-banner { background: var(--mine-bg); border-bottom: 1px solid #a7f3d0; color: #065f46; font-size: 15px; }
.edit-banner .wrap { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding-top: 10px; padding-bottom: 10px; }

/* ---------- toolbar ---------- */
.toolbar { position: sticky; top: 0; z-index: 20; background: rgb(253 246 236 / .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.toolbar .wrap { padding-top: 12px; padding-bottom: 10px; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input {
  width: 100%; height: 48px; padding: 0 44px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); font-size: 17px; outline: none; box-shadow: var(--shadow);
}
.search input:focus { border-color: var(--brand); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 26px; line-height: 1; width: 36px; height: 36px; cursor: pointer; color: var(--muted); }
.filters { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 4px 12px; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip:hover, .chip.active { border-color: var(--brand); color: var(--brand-deep); background: var(--sel-bg); }
.toggle { flex: none; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.toggle input { accent-color: var(--brand); width: 16px; height: 16px; }
.mine-toggle { color: #065f46; font-weight: 600; }
.live-status { margin: 8px 0 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.live-status::before { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; flex: none; }
.live-status.warn { color: #92400e; }
.live-status.warn::before { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.mine-toggle input { accent-color: var(--mine-line); }

/* ---------- sections ---------- */
main { padding-top: 8px; }
.state { text-align: center; color: var(--muted); padding: 48px 0; }
.state.error { color: #b91c1c; }
.section { padding-top: 20px; }
.section > h2 { font-family: 'Yatra One', Mukta, serif; font-weight: 400; color: var(--maroon); font-size: 26px; margin: 8px 0 4px; }
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; box-shadow: var(--shadow); }
.cat > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 14px 16px; font-weight: 700; font-size: 18px;
}
.cat > summary::-webkit-details-marker { display: none; }
.cat > summary::after { content: '▾'; color: var(--muted); font-size: 14px; transition: transform .15s; }
.cat:not([open]) > summary::after { transform: rotate(-90deg); }
.cat .count { margin-left: auto; font-weight: 500; font-size: 14px; color: var(--muted); white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; padding: 0 12px 14px; }

.item {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; text-align: left;
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 12px;
  cursor: pointer; font-size: 15px; line-height: 1.25; transition: border-color .12s, background .12s;
}
.item:hover { border-color: #fdba74; }
.item:focus-visible { outline: 3px solid rgb(234 88 12 / .35); outline-offset: 1px; }
.item .box { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid #d6cbbd; display: grid; place-items: center; }
.item .box svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; fill: none; opacity: 0; }
.item .tag { margin-left: auto; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }

.item.selected { border-color: var(--sel-line); background: var(--sel-bg); }
.item.selected .box { background: var(--brand); border-color: var(--brand); }
.item.selected .box svg { opacity: 1; }
/* saved items: locked, can't be removed by the visitor */
.item.mine { border-color: var(--mine-line); background: var(--mine-bg); cursor: default; color: #064e3b; }
.item.mine:hover { border-color: var(--mine-line); }
.item.mine .box { background: var(--mine-line); border-color: var(--mine-line); }
.item.mine .box svg { opacity: 1; }
.item.mine .tag { background: #d1fae5; color: #065f46; }

.item.taken { cursor: not-allowed; background: #faf8f5; border-color: #efe8de; color: var(--taken-ink); }
.item.taken .name { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.item.taken .box { border-color: #e7e0d6; background: #f1ece5; }
.item.taken .tag { background: #f1ece5; color: #a8a29e; }
.item.taken:hover { border-color: #efe8de; }

mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }

.footer-note { text-align: center; color: var(--muted); margin: 40px 0 24px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand-deep); text-decoration: underline; cursor: pointer; font-weight: 600; }

/* ---------- cart ---------- */
.cart {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--maroon); color: #fff7ed; box-shadow: 0 -6px 24px rgb(0 0 0 / .18);
  padding-bottom: env(safe-area-inset-bottom);
}
.cart-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.cart-count { font-size: 17px; }
.cart-count strong { font-size: 22px; color: var(--gold); }

.btn { border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 700; font-size: 16px; cursor: pointer; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: #c2410c; }
.btn.primary:disabled { background: #d6cbbd; cursor: default; }
.cart .btn.primary { background: var(--gold); color: #431407; }
.btn.block { width: 100%; margin-top: 12px; }

/* ---------- dialogs ---------- */
dialog.sheet {
  width: min(560px, 100vw); max-height: min(92vh, 900px); margin: auto; padding: 24px 20px 20px;
  border: 0; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / .3);
}
dialog.sheet.small { width: min(440px, 100vw); }
dialog::backdrop { background: rgb(28 25 23 / .55); }
@media (max-width: 600px) {
  dialog.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 16px 16px 0 0; max-height: 94vh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
.sheet h2 { margin: 0 0 12px; font-size: 22px; padding-right: 36px; }
.sheet-close { position: absolute; top: 10px; right: 10px; margin: 0; }
.sheet-close button { border: 0; background: #f5efe7; width: 36px; height: 36px; border-radius: 50%; font-size: 22px; cursor: pointer; line-height: 1; }

.review-list { margin: 0 0 16px; }
.review-list h3 { font-size: 14px; color: var(--brand-deep); margin: 12px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.review-list ul { list-style: none; margin: 0; padding: 0; }
.review-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f3ece2; }
.review-list li .rm { border: 0; background: none; color: #b91c1c; cursor: pointer; font-size: 14px; font-weight: 600; }
.review-list .removed { color: #991b1b; }
.review-list .removed span { text-decoration: line-through; }
.review-list .empty { color: var(--muted); }
.review-list .already { margin-top: 14px; color: #065f46; }
.review-list .already summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.review-list .already li { color: var(--ink); }
.new-tag { margin-left: 8px; font-size: 12px; font-weight: 700; color: #065f46; background: #d1fae5; border-radius: 999px; padding: 0 8px; }
.note { font-size: 14px; color: var(--muted); margin: 10px 0; }
.review-who { background: var(--mine-bg); color: #065f46; border-radius: 10px; padding: 10px 12px; font-size: 15px; margin: 12px 0; }

.fields { display: grid; gap: 12px; margin: 16px 0 12px; }
.fields label { display: grid; gap: 4px; font-weight: 600; font-size: 15px; }
.fields input { height: 46px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; font-weight: 400; }
.fields input:focus { outline: none; border-color: var(--brand); }
.fields input[aria-invalid="true"] { border-color: #dc2626; }
.field-error { font-weight: 500; font-size: 14px; color: #b91c1c; min-height: 0; }
.field-error:empty { display: none; }
.field-error .suggest { color: var(--brand-deep); font-weight: 700; text-decoration: underline; cursor: pointer; border: 0; background: none; padding: 0; font-size: inherit; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; margin: 8px 0; cursor: pointer; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.turnstile { margin: 12px 0 0; min-height: 0; }
.form-error { color: #b91c1c; font-weight: 600; margin: 12px 0 0; }

.done-icon { font-size: 44px; text-align: center; }
#review-done-view h2 { text-align: center; padding: 0; }
#review-done-view > p { text-align: center; color: var(--muted); }
.done-link { background: var(--sel-bg); border: 1px dashed var(--brand); border-radius: 10px; padding: 10px 12px; word-break: break-all; text-align: center; }
.done-link a { color: var(--brand-deep); font-weight: 600; }
.conflicts { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.conflicts ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 50;
  background: #1c1917; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 15px;
  max-width: calc(100vw - 32px); box-shadow: var(--shadow);
}

@media (max-width: 600px) {
  .hero-inner { padding: 20px 16px 22px; flex-direction: column; align-items: stretch; gap: 8px; }
  .darshan { width: 170px; align-self: center; margin-bottom: 8px; border-radius: 92px 92px 14px 14px; }
  .darshan img { border-radius: 86px 86px 10px 10px; }
  .tagline { font-size: 18px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 10px 12px; }
  .item { font-size: 14px; padding: 8px 10px; gap: 8px; min-height: 52px; }
  .item .tag { position: absolute; top: -8px; right: 6px; font-size: 11px; }
  .cat > summary { font-size: 17px; padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
