:root {
  --ground: #FBFAF7;
  --ink: #1F2547;
  --accent: #B8401A;
  --muted: #4A5068;
  --border: #E6E2D8;
  --cream: #F6E8D6;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 18px/1.5 Karla, "Noto Sans Devanagari", system-ui, sans-serif;
}
h1, .wordmark { font-family: Fraunces, "Noto Sans Devanagari", Georgia, serif; font-weight: 600; }
/* Devanagari needs room for its marks above and below the line. */
.lang-hi { line-height: 1.6; }
.lang-hi h1, .lang-hi .big-button { font-family: "Noto Sans Devanagari", Karla, system-ui, sans-serif; line-height: 1.4; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }

/* ---------------- Savitri's screens: huge targets, one main action */
body.mom { font-size: 22px; }
.mom-screen { max-width: 640px; margin: 0 auto; padding: 28px 20px 48px; display: flex; flex-direction: column; gap: 20px; }
.mom-screen h1 { font-size: 40px; line-height: 1.15; margin: 8px 0 8px; }
.mom-screen h1.small { font-size: 30px; margin: 0; }
.center { text-align: center; align-items: center; }
.mom-screen .center { display: flex; flex-direction: column; gap: 20px; }
.lead { font-size: 24px; margin: 0; }
.note { background: var(--cream); border-radius: 14px; padding: 14px 18px; margin: 0; }

.big-button {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  width: 100%; min-height: 96px; padding: 18px 20px;
  border-radius: 22px; border: 3px solid transparent;
  font: 700 26px/1.2 Karla, system-ui, sans-serif; text-align: center;
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.big-button:active { transform: scale(0.98); }
.big-button .icon { font-size: 34px; }
.big-button.primary { background: var(--accent); color: #fff; min-height: 128px; font-size: 30px; }
.big-button.secondary { background: #fff; color: var(--ink); border-color: var(--ink); }
.big-button.attention { background: var(--cream); color: var(--accent); border-color: var(--accent); }
.big-button.quiet { background: transparent; color: var(--muted); border-color: var(--border); min-height: 80px; font-size: 22px; }

.status { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.status p { margin: 0; display: flex; align-items: center; gap: 12px; color: var(--muted); }
.plain-link { font-size: 20px; text-align: center; padding: 12px; }

.back { font-size: 22px; text-decoration: none; padding: 8px 0; align-self: flex-start; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare figure { margin: 0; }
.compare img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.compare figcaption { text-align: center; font-size: 18px; color: var(--muted); margin-top: 6px; }
.choices { display: flex; flex-direction: column; gap: 16px; }

.tick { width: 96px; height: 96px; border-radius: 50%; background: var(--cream); color: var(--accent); font-size: 56px; line-height: 96px; text-align: center; margin: 24px auto 0; }

.spinner { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; display: inline-block; }
.spinner.big { width: 64px; height: 64px; border-width: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.sending .hint { font-size: 20px; color: var(--muted); margin: 0; }
.sending #sending-failed { display: flex; flex-direction: column; gap: 24px; width: min(90vw, 420px); }
.sending { position: fixed; inset: 0; background: rgba(251, 250, 247, 0.96); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; text-align: center; font-size: 26px; z-index: 10; }

/* Language switch: always top right, easy to find, out of the way. */
.lang-switch { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 16px; padding: 10px 16px; border: 2px solid var(--border); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font: 600 18px Karla, "Noto Sans Devanagari", system-ui, sans-serif; }
.mom-screen { position: relative; }
.heart { color: var(--accent); }

/* Her drawings with a big heart under each. */
.mine-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mine-tile { margin: 0; background: #fff; border: 2px solid var(--border); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.mine-tile img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; }
.mine-tile.loved { border-color: var(--accent); background: var(--cream); }
.heart-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; width: 100%; border-radius: 14px; border: 2px solid var(--accent); background: #fff; color: var(--accent); font: 700 20px Karla, "Noto Sans Devanagari", system-ui, sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.heart-button .heart { font-size: 32px; line-height: 1; }
.mine-tile.loved .heart-button { background: var(--accent); color: #fff; }
.mine-tile.loved .heart-button .heart { color: #fff; }
@media (min-width: 700px) { .mine-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------------- Public site */
header.site { padding: 20px 20px 8px; max-width: 1100px; margin: 0 auto; }
/* Her way home stays pinned at the top while she scrolls the site. */
.site-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--ground); padding: 8px 0; }
.my-page { display: inline-flex; align-items: center; min-height: 56px; padding: 10px 22px; border-radius: 999px; background: var(--accent); color: #fff; text-decoration: none; font: 700 20px Karla, "Noto Sans Devanagari", system-ui, sans-serif; box-shadow: 0 2px 8px rgba(31, 37, 71, 0.18); }
/* Kind switcher: pinned under the header so any kind is one tap away. */
.kind-nav { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); z-index: 4; display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; margin: 4px 0 0; background: var(--ground); }
.kind-nav a { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; }
.kind-nav a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.kind-nav .count { font-weight: 400; font-size: 14px; opacity: 0.7; }
.shelf { margin-top: 12px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.see-all { font-weight: 600; text-decoration: none; white-space: nowrap; }
.see-all-button, .show-more { display: block; width: 100%; max-width: 420px; margin: 16px auto 0; padding: 14px 20px; border-radius: 14px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font: 700 17px Karla, system-ui, sans-serif; text-align: center; text-decoration: none; cursor: pointer; }
/* On phones each shelf is one row you swipe sideways, so every kind sits
   within a couple of screens no matter how many drawings there are. */
@media (max-width: 700px) {
  .shelf .grid { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 42%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .shelf .tile { scroll-snap-align: start; }
}
.see-all-tile { font: 700 18px Karla, system-ui, sans-serif; color: var(--accent); text-decoration: none; background: var(--cream); }
.page-title { font-size: 30px; margin: 16px 0 0; }
.jump { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; }
.jump a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; }
section[id] { scroll-margin-top: 90px; }
.section-note { color: var(--muted); margin: 0 0 4px; font-size: 16px; }
.wordmark { font-size: 30px; color: var(--ink); text-decoration: none; }
.wordmark em { font-style: italic; font-weight: 500; color: var(--accent); }
.tagline { color: var(--muted); margin: 6px 0 0; max-width: 40em; }
.site-main { max-width: 1100px; margin: 0 auto; padding: 12px 20px 48px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 12px; }
.tile { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 10px; aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center; }
.tile img { max-height: 100%; object-fit: contain; }
.empty, .foot { color: var(--muted); }
h2.section { font: 600 22px Fraunces, Georgia, serif; margin: 28px 0 4px; }
.foot { margin-top: 40px; font-size: 16px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 12px 0 16px; padding-bottom: 4px; }
.tab { flex: none; font: 600 16px Karla, system-ui, sans-serif; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--ink); cursor: pointer; }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.version img { background: #fff; border: 1px solid var(--border); border-radius: 14px; margin: 0 auto; max-height: 75vh; object-fit: contain; }
.version img.mehndi { background: var(--cream); }
.download { display: inline-block; margin-top: 14px; padding: 12px 18px; border-radius: 12px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; }
.license { color: var(--muted); font-size: 15px; margin-top: 24px; }

/* ---------------- Likes and notes */
.feedback { margin-top: 28px; border-top: 1px solid var(--border); padding-top: 20px; }
.like-button { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; border: 2px solid var(--accent); background: #fff; color: var(--accent); font: 700 18px Karla, system-ui, sans-serif; cursor: pointer; }
.like-button .heart { font-size: 24px; line-height: 1; }
.like-button.liked { background: var(--accent); color: #fff; }
.like-button.liked .heart { color: #fff; }
.like-count { font-weight: 400; opacity: 0.85; }
.note-form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; max-width: 560px; }
.note-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 16px; }
.note-form .opt { font-weight: 400; color: var(--muted); }
.note-form textarea, .note-form input { font: 17px/1.4 Karla, "Noto Sans Devanagari", system-ui, sans-serif; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink); }
.note-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .note-row { grid-template-columns: 1fr; } }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.send-note { align-self: flex-start; padding: 12px 22px; border-radius: 12px; border: 0; background: var(--ink); color: #fff; font: 700 17px Karla, system-ui, sans-serif; cursor: pointer; }
.note-sent { margin-top: 20px; padding: 14px 18px; background: var(--cream); border-radius: 12px; font-weight: 600; }

/* Her notes screen: large, calm, one note per card. */
.likes-summary { font-size: 22px; margin: 0; padding: 16px 18px; background: var(--cream); border-radius: 14px; color: var(--accent); font-weight: 600; }
.likes-summary span { color: var(--muted); font-weight: 400; font-size: 19px; }
.note-card { display: grid; grid-template-columns: 96px 1fr; gap: 14px; background: #fff; border: 2px solid var(--border); border-radius: 18px; padding: 14px; }
.note-card.is-new { border-color: var(--accent); }
.note-card img { width: 96px; height: 120px; object-fit: contain; }
.note-text { margin: 0; font-size: 22px; line-height: 1.45; white-space: pre-wrap; }
.note-from { margin: 8px 0 0; color: var(--muted); font-size: 19px; }
.new-badge { display: inline-block; background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; padding: 2px 10px; border-radius: 999px; margin-bottom: 6px; }
.plain-links { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; }

/* ---------------- Keypad: big keys, six dots, nothing else */
.pin-form { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.pin-dots { display: flex; gap: 16px; }
.pin-dots .dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink); }
.pin-dots .dot.on { background: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, 96px); gap: 16px; }
.key { height: 96px; border-radius: 50%; border: 2px solid var(--border); background: #fff; color: var(--ink); font: 600 36px Karla, system-ui, sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.key:active { background: var(--cream); }
.key-clear { font-size: 18px; border-radius: 18px; font-family: "Noto Sans Devanagari", Karla, system-ui, sans-serif; }

/* ---------------- Admin: plain and functional */
.admin section { margin-top: 28px; }
.admin .stats, .admin .muted { color: var(--muted); }
.admin-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.admin input, .admin select, .admin button { font: 16px Karla, system-ui, sans-serif; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink); }
.admin button { background: var(--ink); color: #fff; border-color: var(--ink); cursor: pointer; }
.made-link input { width: 100%; font-family: ui-monospace, monospace; }
.admin-table { border-collapse: collapse; width: 100%; }
.admin-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); }
.held { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-top: 10px; background: #fff; }
.held p { margin: 0 0 6px; }

/* ---------------- Share and remove on her drawings */
.share-button { min-height: 56px; width: 100%; border-radius: 14px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font: 700 19px Karla, "Noto Sans Devanagari", system-ui, sans-serif; cursor: pointer; }
.delete-button { min-height: 44px; width: 100%; border: 0; background: none; color: var(--muted); font: 600 17px Karla, "Noto Sans Devanagari", system-ui, sans-serif; text-decoration: underline; cursor: pointer; }
.delete-confirm { display: flex; flex-direction: column; gap: 10px; }
.delete-confirm p { margin: 0; font-weight: 600; font-size: 18px; }
.delete-confirm .big-button { min-height: 64px; font-size: 20px; }
.big-button.danger { background: #8E2A12; color: #fff; }

/* ---------------- Public share row */
.share-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.pin-button, .plain-share { display: inline-flex; align-items: center; padding: 10px 18px; border-radius: 999px; font: 700 16px Karla, system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.pin-button { background: #E60023; color: #fff; }
.plain-share { border: 2px solid var(--ink); background: #fff; color: var(--ink); }

.admin-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.admin-thumb { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: #fff; }
.admin-thumb img { aspect-ratio: 3 / 4; object-fit: contain; }

/* One colour | Colourful: a two-part switch, the current one filled */
.cat-form { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; }
.cat { min-height: 52px; border: 0; background: #fff; color: var(--ink); font: 700 17px Karla, "Noto Sans Devanagari", system-ui, sans-serif; cursor: pointer; padding: 6px; }
.cat + .cat { border-left: 2px solid var(--ink); }
.cat.on { background: var(--ink); color: #fff; }
