/* Mana: shared base, host app and marketing site. No external fonts or assets. */
:root {
  --ink: #23201c; --muted: #6b645b; --line: #e6dfd3; --paper: #fbf8f2; --card: #fff;
  --accent: #8a2b1e; --accent-ink: #fff; --ok: #2f6b45; --warn: #9a5b00; --danger: #a4262c;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Telugu", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Noto Serif", "Noto Serif Telugu", serif;
  --radius: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.55 var(--sans); color: var(--ink); background: var(--paper); overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.3rem; margin-top: 1.6em; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .9em; } a { color: var(--accent); }
img { max-width: 100%; height: auto; }
small, .small { font-size: .85rem; } .quiet { color: var(--muted); } .center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--muted); }
:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.mark { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; letter-spacing: .02em; color: var(--accent); text-decoration: none; }

/* forms */
label { display: block; font-weight: 600; font-size: .95rem; }
label small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }
input, select, textarea { font: inherit; color: inherit; width: 100%; min-height: 46px; padding: 10px 12px; margin-top: 6px;
  border: 1.5px solid #cfc6b8; border-radius: 10px; background: #fff; }
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; margin: 0; flex: none; accent-color: var(--accent); }
input[type=file] { padding: 8px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 400; min-height: 44px; }
fieldset { border: 0; padding: 0; margin: 0; } legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: 6px; }
.stack > * + * { margin-top: 16px; }
.two { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.prefixed { display: flex; align-items: center; gap: 6px; } .prefixed span { color: var(--muted); margin-top: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 20px;
  border: 1.5px solid var(--accent); border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; width: auto; margin: 0; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: .9rem; }
.btn.big { min-height: 54px; padding: 12px 28px; font-size: 1.1rem; }
.btn.danger { border-color: var(--danger); color: var(--danger); } .btn.danger:not(.ghost) { background: var(--danger); color: #fff; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; min-height: 44px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #eee7da; color: #5a5247; vertical-align: middle; }
.tag.published, .tag.ok, .tag.approved { background: #dcefe2; color: var(--ok); }
.tag.warn, .tag.pending { background: #fbe9c8; color: var(--warn); }
.flash { background: #dcefe2; color: #1d4a2e; padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.note { background: #fdf3df; border: 1px solid #f0dcae; padding: 14px 16px; border-radius: var(--radius); }
.note p:last-child { margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.card h2 { margin-top: 0; } .card.highlight { border-color: var(--accent); background: #fff8ee; }
.danger-zone { border-color: #ecc9cb; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); list-style: none; } .empty h2 { margin-top: 0; color: var(--ink); }
.copyrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
code { font: .95rem ui-monospace, Consolas, monospace; background: #f1ebe0; padding: 6px 10px; border-radius: 8px; word-break: break-all; }
.qr { display: block; width: 220px; max-width: 100%; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; }
details.card > summary { color: var(--accent); }

/* plain (login, errors) */
.narrow { max-width: 440px; margin: 0 auto; padding: 48px 20px; }

/* site */
.site-head, .app-head { display: flex; align-items: center; gap: 16px; padding: 14px 20px; }
.site-head nav { margin-left: auto; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.site-head nav a:not(.btn) { color: var(--ink); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.hero-site { max-width: 760px; margin: 0 auto; padding: 56px 20px 32px; text-align: center; }
.hero-site h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
.trio { max-width: 1000px; margin: 0 auto; padding: 16px 20px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.trio > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; } .trio h2 { margin-top: 0; }
.starts { max-width: 1000px; margin: 0 auto; padding: 16px 20px 48px; }
.chips { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.chips li { border-left: 3px solid var(--accent); padding: 4px 14px; } .chips span { display: block; color: var(--muted); font-size: .92rem; }
.prose { max-width: 680px; } article.prose { margin: 0 auto; padding: 32px 20px 56px; }
.site-foot { text-align: center; color: var(--muted); padding: 28px 20px; border-top: 1px solid var(--line); font-size: .9rem; }
.site-foot a { margin: 0 6px; display: inline-block; min-height: 44px; line-height: 44px; }

/* host app */
.app-head { background: #fff; border-bottom: 1px solid var(--line); }
.app-head .space { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); font-weight: 600; line-height: 1.2; min-width: 0; }
.app-head .space small { color: var(--accent); font-weight: 400; }
.app-head .right { margin-left: auto; }
.tabs, .subtabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs a, .subtabs a { flex: none; padding: 12px 12px; min-height: 46px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a[aria-current], .subtabs a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.subtabs { background: transparent; padding: 0; margin: 8px 0 20px; }
.app-main { max-width: 820px; margin: 0 auto; padding: 24px 16px 80px; }
.bar, .pagehead { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.bar h1, .pagehead h1 { margin: 0; } .pagehead p { margin: 4px 0 0; }
.list { list-style: none; padding: 0; margin: 16px 0; }
.list .row, form.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; color: inherit; text-decoration: none; }
.list .row small { display: block; }
.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; margin-bottom: 10px; }
.section[open] { padding-bottom: 18px; } .section.is-hidden { opacity: .65; }
.rows .rowitem { border-left: 3px solid var(--line); padding: 2px 0 8px 12px; margin: 10px 0; } .rows .rowitem > * + * { margin-top: 10px; }
.rows .rowitem.blank { border-left-style: dashed; }
.imgfield img { display: block; max-width: 220px; border-radius: 10px; margin: 6px 0; } .imgfield .lbl { font-weight: 600; font-size: .95rem; }
.addsection { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; } .addsection label { flex: 1 1 260px; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-weight: 400; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: #fff8ee; }
.choice small { display: block; color: var(--muted); }
.swatches { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.swatch { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-family: var(--p-display, var(--serif)); font-weight: 700;
  background: var(--p-bg); color: var(--p-accent); border: 1px solid var(--p-line); flex: none; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 12px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.stat .big { font: 600 1.9rem var(--serif); }
.tablewrap { overflow-x: auto; } table { border-collapse: collapse; width: 100%; background: var(--card); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.wishcard, .giftrow, .story { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.wishcard header, .giftrow header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.giftrow header { justify-content: space-between; } .giftrow .amount { font: 600 1.25rem var(--serif); }
.wishcard .body, .giftrow .body { margin: 10px 0; font-family: var(--serif); font-size: 1.05rem; }
.giftrow form.inline { margin-top: 10px; display: grid; gap: 8px; }
.story img { border-radius: 10px; margin-bottom: 10px; max-height: 420px; }
.addkinds { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } .addkinds details[open] { grid-column: 1 / -1; }
.addkinds .card { margin: 5px 0; padding: 4px 16px; } .addkinds .card[open] { padding-bottom: 18px; }
@media (prefers-reduced-motion: no-preference) { .btn { transition: filter .15s; } }

/* design presets (tokens used by guest pages and the design picker) */
.theme-marigold { --p-bg: #fdf6e7; --p-card: #fffdf7; --p-ink: #3a1f14; --p-muted: #7a5f4c; --p-accent: #9c2a1a; --p-accent-ink: #fff8e6; --p-line: #ead9b5; --p-gold: #c8962e; --p-display: var(--serif); }
.theme-jasmine { --p-bg: #f7f6ef; --p-card: #ffffff; --p-ink: #25322a; --p-muted: #63705f; --p-accent: #3d6b4f; --p-accent-ink: #fff; --p-line: #dfe5d6; --p-gold: #b9a06a; --p-display: var(--serif); }
.theme-confetti { --p-bg: #fff7f3; --p-card: #ffffff; --p-ink: #2b2140; --p-muted: #6c6280; --p-accent: #c2306b; --p-accent-ink: #fff; --p-line: #f3dbe4; --p-gold: #f2a33a; --p-display: var(--sans); }
.theme-ink { --p-bg: #ffffff; --p-card: #ffffff; --p-ink: #141414; --p-muted: #5c5c5c; --p-accent: #141414; --p-accent-ink: #fff; --p-line: #e2e2e2; --p-gold: #141414; --p-display: var(--sans); }
.theme-dusk { --p-bg: #17181f; --p-card: #20222c; --p-ink: #f1ede4; --p-muted: #aaa69c; --p-accent: #e9c46a; --p-accent-ink: #1b1a14; --p-line: #353846; --p-gold: #e9c46a; --p-display: var(--serif); }
.theme-stone { --p-bg: #f3f2f0; --p-card: #fafaf9; --p-ink: #2c2c2c; --p-muted: #6a6a6a; --p-accent: #4a4f57; --p-accent-ink: #fff; --p-line: #dcdad6; --p-gold: #8c8c8c; --p-display: var(--serif); }
.family { max-width: 1000px; margin: 0 auto; padding: 8px 0 48px; text-align: center; }
.family > h2, .family > p { padding: 0 20px; } .family .trio { text-align: left; } .family h3 { margin-top: 0; }
.site-foot a { color: inherit; }
blockquote { margin: 0; padding: 8px 14px; border-left: 3px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.scroll { overflow-x: auto; } table.traction { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.traction th, table.traction td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--line); } table.traction th[scope=row] { text-align: left; white-space: nowrap; }
table.traction th, table.traction td { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
