/* Handwriting fonts for wishes (SIL Open Font License, see assets/fonts/OFL-*.txt) */
@font-face { font-family: 'caveat'; src: url('../fonts/caveat.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'dancing'; src: url('../fonts/dancing.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'indieflower'; src: url('../fonts/indieflower.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'kalam'; src: url('../fonts/kalam.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'patrickhand'; src: url('../fonts/patrickhand.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'shadows'; src: url('../fonts/shadows.woff2') format('woff2'); font-display: swap; }
/* Wishstoria brand fonts */
@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('../fonts/lora-italic.woff2') format('woff2'); font-style: italic; font-weight: 400 700; font-display: swap; }

/* Wishstoria palette. Gold is for accents only: it fails contrast as a text color. */
:root {
  --plum: #7551A8;        /* Royal Plum */
  --plum-deep: #4B2D7F;   /* wordmark purple */
  --gold: #F4C77D;        /* Warm Gold, accents only */
  --ivory: #FAF6EF;       /* Soft Ivory */
  --charcoal: #292435;    /* Deep Charcoal */
  --ink: var(--charcoal);
  --muted: #625c6e;
  --line: #e7e0d4;
  --bg: var(--ivory);
  --panel: #ffffff;
  --accent: var(--plum);
  --ok: #2f7a4a;
  --warn: #8a5a00;
  --bad: #b3261e;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .4rem; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: .4rem 0 .9rem; }
small, .muted { color: var(--muted); }
code { background: #f0ece5; padding: 1px 5px; border-radius: 4px; font-size: .9em; }

.topbar { background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 1080px; margin: 0 auto; padding: 10px 20px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.topbar .brand { font-weight: 700; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.topbar .brand img { height: 28px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topbar nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.topbar nav a.on, .topbar nav a:hover { color: var(--ink); background: #f1ede6; }
.topbar form { margin: 0; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
.narrow { max-width: 560px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 1.6rem; }

.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; background: #e8f3ec; color: #1d5232; border: 1px solid #c8e2d1; }
.flash.error, .error-box { background: #fbeceb; color: #7d1a14; border: 1px solid #f1cdca; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.note { background: #fff8e6; border: 1px solid #f0e0b0; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }

label { display: block; font-weight: 600; font-size: .92rem; margin: 12px 0 4px; }
label.inline { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
label.inline input { margin-top: 4px; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cfc8bc; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row, .row3 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn.ghost { background: #fff; color: var(--accent); }
.btn.quiet { background: #fff; color: var(--ink); border-color: #cfc8bc; font-weight: 500; }
.btn.danger { background: #fff; color: var(--bad); border-color: #e3b5b1; }
.btn.small { padding: 6px 10px; font-size: .88rem; }
.btn.big { padding: 14px 20px; font-size: 1.05rem; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.actions form { margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tr.dim td { color: #a59f95; }
.table-scroll { overflow-x: auto; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .8rem; background: #efebe4; color: var(--muted); white-space: nowrap; }
.pill.collecting { background: #e7eefb; color: #24467f; }
.pill.review { background: #fff1d6; color: #7a5200; }
.pill.approved, .pill.to_print { background: #efe6f6; color: #5a2d78; }
.pill.delivered, .pill.posted { background: #e3f2e8; color: #22603a; }
.pill.cancelled { background: #f3e9e8; color: #8a3a33; }
.pill.mail { background: #fdf0e3; color: #8a4b12; }
.pill.flag { background: #fbeceb; color: #9a231b; }

.progress { height: 8px; background: #eee8de; border-radius: 99px; overflow: hidden; min-width: 80px; }
.progress span { display: block; height: 100%; background: var(--accent); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a, .tabs button { padding: 9px 14px; text-decoration: none; color: var(--muted); border: 0; background: none; font: inherit; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

.linkbox { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.linkbox input { flex: 1; min-width: 160px; font-size: .85rem; padding: 7px 9px; color: var(--muted); }

.wish-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.wish-admin .w { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: #fffdf9; }
.wish-admin .w.is-hidden { opacity: .45; }
.wish-admin .w img { max-width: 100%; max-height: 120px; display: block; }

/* Public, phone-first pages */
.public { max-width: 560px; margin: 0 auto; padding: 22px 18px 60px; }
.public .head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--muted); font-size: .92rem; }
.public .head img { height: 32px; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.choice button { padding: 12px 6px; border: 1px solid #cfc8bc; border-radius: 10px; background: #fff; font: inherit; font-size: .92rem; cursor: pointer; color: var(--ink); }
.choice button.on { border-color: var(--accent); outline: 2px solid var(--accent); font-weight: 600; }
.pad-wrap { position: relative; border: 1px dashed #b9b0a2; border-radius: 10px; background: #fffdf8; touch-action: none; }
.pad-wrap canvas { display: block; width: 100%; height: 260px; touch-action: none; border-radius: 10px; }
.pad-wrap .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #b9b0a2; pointer-events: none; }
.fonts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 8px 0; }
.fonts label { margin: 0; border: 1px solid #cfc8bc; border-radius: 10px; padding: 8px 10px; font-weight: 400; cursor: pointer; background: #fff; font-size: 1.3rem; line-height: 1.2; }
.fonts input { position: absolute; opacity: 0; }
.fonts label.on { border-color: var(--accent); outline: 2px solid var(--accent); }
.preview-wish { border: 1px solid var(--line); background: #fffdf8; border-radius: 10px; padding: 14px; font-size: 1.5rem; line-height: 1.25; min-height: 70px; white-space: pre-wrap; word-wrap: break-word; color: #1d2a5c; }
.mine { border: 1px solid var(--line); background: #fffdf8; border-radius: 10px; padding: 14px; }
.mine img { max-width: 100%; max-height: 180px; }
.hidden { display: none !important; }

/* Wishstoria wordmark (flat, one color, works at any size) */
.wordmark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--plum-deep); font-weight: 700; letter-spacing: -.01em; }
.wordmark svg { flex: none; }
.wordmark.big { font-size: 2rem; }
.tagline { font-family: Lora, Georgia, serif; font-style: italic; color: var(--charcoal); }
.tagline::before, .tagline::after { content: ""; display: inline-block; width: 22px; height: 2px; background: var(--gold); vertical-align: middle; margin: 0 10px; }
.brandbar { text-align: center; margin: 8px 0 22px; }
.brandbar .tagline { display: block; margin-top: 4px; font-size: 1.05rem; }
.poweredby { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 26px; }
.poweredby a { color: inherit; }
