/* Family pages: phone first, a centered column on bigger screens. */
:root {
  --linen: #f5efe3;
  --linen-deep: #ede4d3;
  --card: #fffdf8;
  --ink: #3b2f25;
  --muted: #8a7a66;
  --faint: #b3a48f;
  --line: #ebe2d2;
  --green: #4f6b3a;
  --green2: #6f8f4f;
  --green-soft: #e9efdf;
  --brown: #6b4a2f;
  --brown2: #8f6542;
  --brown-soft: #f1e7dc;
  --mustard: #c9952b;
  --mustard-soft: #f5e6bf;
  --mustard-line: #e6cf8f;
  --mustard-ink: #6e5212;
  --danger: #a4452c;
  --accent: var(--green);
  --accent2: var(--green2);
  --accent-soft: var(--green-soft);
  --radius: 18px;
  --shadow: 0 2px 10px rgba(70, 50, 20, 0.07);
  --shadow-lg: 0 8px 24px rgba(70, 50, 20, 0.12);
}
.theme-brown {
  --accent: var(--brown);
  --accent2: var(--brown2);
  --accent-soft: var(--brown-soft);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.shell { max-width: 620px; margin: 0 auto; min-height: 100vh; padding-bottom: 92px; }

/* Header band */
.band {
  position: relative;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  padding: 22px 20px 58px;
  border-radius: 0 0 28px 28px;
}
.band.short { padding-bottom: 24px; }
.band__kicker { font-size: 12px; font-weight: 700; opacity: 0.88; margin-right: 96px; }
.band h1 { font-size: 25px; font-weight: 800; margin: 4px 0 0; line-height: 1.2; }
.band__tools { position: absolute; right: 14px; top: 14px; display: flex; gap: 6px; align-items: flex-start; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, 0.2); color: #fff; border: 0; border-radius: 99px;
  padding: 5px 10px; font-size: 12px; font-weight: 800; cursor: pointer; text-decoration: none;
}
.pill:hover { background: rgba(255, 255, 255, 0.3); }
.pill.on { background: #fff; color: var(--accent); }
.people-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.people-switch form { margin: 0; }

/* Settings popover */
details.settings { position: relative; }
details.settings > summary { list-style: none; }
details.settings > summary::-webkit-details-marker { display: none; }
.settings__panel {
  position: absolute; right: 0; top: 34px; z-index: 20; width: 270px;
  background: var(--card); color: var(--ink); border-radius: 16px; padding: 16px;
  box-shadow: 0 12px 40px rgba(40, 25, 10, 0.25);
}
.settings__panel h3 { margin: 0 0 10px; font-size: 15px; }
.settings__panel label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.settings__panel select { width: 100%; margin-top: 4px; }
.check { display: flex !important; gap: 8px; align-items: flex-start; font-weight: 600 !important; }
.check input { margin-top: 3px; accent-color: var(--green); }
.settings__panel .signout { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.linkish { background: none; border: 0; padding: 0; color: var(--danger); font-weight: 700; font-size: 13px; cursor: pointer; }

/* Cards */
.hero {
  margin: -42px 16px 14px; background: var(--card); border-radius: 20px; padding: 18px 18px 14px;
  box-shadow: var(--shadow-lg); position: relative;
}
.kicker { font-size: 12px; color: var(--muted); font-weight: 700; }
.hero .name { font-size: 34px; font-weight: 800; color: var(--accent); margin: 2px 0 8px; line-height: 1.15; word-break: break-word; }
.hero .name.small { font-size: 23px; }
.hero p { color: #6f6150; font-size: 14px; margin: 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--mustard-soft); color: var(--mustard-ink); }
.chip.green { background: var(--green-soft); color: var(--green); }

.card { margin: 0 16px 14px; padding: 15px 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.card h2 { font-size: 15px; font-weight: 800; margin: 0 0 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h2 small { font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.hint { font-size: 12.5px; color: var(--muted); margin: -2px 0 10px; }
.empty { font-size: 14px; color: var(--faint); margin: 4px 0; }
.badge { font-size: 10px; font-weight: 800; background: var(--mustard); color: #fff; border-radius: 99px; padding: 2px 7px; vertical-align: 1px; white-space: nowrap; }

/* Read-only lists */
ul.items { list-style: none; margin: 0; padding: 0; }
ul.items li { padding: 7px 0 7px 26px; position: relative; font-size: 15px; border-bottom: 1px solid #f3ecdf; }
ul.items li:last-child { border-bottom: 0; }
ul.items li::before { content: '🎁'; position: absolute; left: 0; top: 7px; font-size: 13px; }
ul.items.no li::before { content: '✕'; color: var(--brown2); font-weight: 800; left: 3px; }
ul.items a { font-size: 12.5px; font-weight: 700; text-decoration: none; display: inline-block; margin-top: 2px; }

/* Editable lists */
.edit-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f1eadd; }
.edit-item:last-of-type { border-bottom: 0; }
.edit-item .t { flex: 1; min-width: 0; word-break: break-word; }
.edit-item .t a { display: block; font-size: 12px; font-weight: 700; text-decoration: none; }
.edit-item form { margin: 0; }
.x {
  width: 30px; height: 30px; border-radius: 99px; border: 0; background: #f1eadd; color: var(--muted);
  font-weight: 800; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.x:hover { background: #ecd9cf; color: var(--danger); }
.add-form { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: 10px; }
.add-form .url { grid-column: 1 / 2; }
.add-form button { grid-row: 1 / span 2; grid-column: 2; align-self: stretch; }
.add-form.single button { grid-row: auto; }

input[type='text'], input[type='email'], input[type='url'], textarea, select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: #fffefb; font-size: 15px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent2); box-shadow: 0 0 0 3px var(--accent-soft); }
.add-form input { border-style: dashed; border-color: #d8c9ae; }
.add-form input.url { font-size: 13px; padding: 7px 12px; }
textarea { resize: vertical; min-height: 44px; }

.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 10px 16px;
  font-weight: 800; font-size: 15px; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.block { display: flex; width: 100%; padding: 14px; border-radius: 16px; }
.btn.soft { background: var(--mustard-soft); color: var(--mustard-ink); }
.btn.ghost { background: transparent; color: var(--accent); border: 2px solid var(--accent); }

/* Messages */
.thread { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: 360px; overflow-y: auto; }
.msg { font-size: 14px; background: #efe8db; border-radius: 14px 14px 14px 4px; padding: 7px 11px; max-width: 85%; align-self: flex-start; word-break: break-word; }
.msg .body { white-space: pre-wrap; }
.msg.me { background: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; align-self: flex-end; }
.msg .who { display: block; font-size: 10.5px; font-weight: 800; opacity: 0.72; }
.msg time { display: block; font-size: 10px; opacity: 0.6; margin-top: 2px; }
.send-form { display: flex; gap: 6px; align-items: flex-end; }
.send-form textarea { flex: 1; }

/* My gift */
.mygift { margin: 0 16px 14px; padding: 15px 16px; border-radius: var(--radius); background: var(--mustard-soft); border: 1.5px solid var(--mustard-line); }
.mygift h2 { font-size: 15px; font-weight: 800; color: var(--mustard-ink); margin: 0 0 2px; }
.mygift .hint { color: #8a6d2a; }
.mygift .saved { background: #fffdf6; border: 1.5px solid var(--mustard-line); border-radius: 12px; padding: 10px 12px; font-weight: 800; }
.mygift .saved small { display: block; font-weight: 600; color: var(--muted); font-size: 12.5px; }
.mygift .row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; font-weight: 800; }
.mygift .ok { color: var(--green); }
.mygift form { display: grid; gap: 6px; }
.mygift input { border-color: var(--mustard-line); }
.mygift details > summary { list-style: none; cursor: pointer; color: var(--mustard-ink); background: #fff; border-radius: 99px; padding: 3px 12px; font-size: 13px; font-weight: 800; }
.mygift details > summary::-webkit-details-marker { display: none; }
.mygift details[open] > summary { display: none; }

/* Past years */
.past .year { font-size: 12px; font-weight: 800; color: var(--muted); margin: 10px 0 4px; }
.past .year:first-of-type { margin-top: 4px; }
.past .got { background: var(--green-soft); color: var(--green); border-radius: 10px; padding: 7px 10px; font-size: 14px; font-weight: 800; }
.past .got.missing { background: #f1eadd; color: var(--muted); }
.past .wished { font-size: 13px; color: #6f6150; padding: 4px 4px 0; }

.note { margin: 6px 22px 18px; font-size: 12px; color: var(--muted); text-align: center; }
.error { background: #f8e1da; color: var(--danger); border-radius: 10px; padding: 7px 10px; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.center { text-align: center; }
.big-emoji { font-size: 54px; line-height: 1; }

/* Tabs: fixed bottom bar on phones */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; gap: 6px; background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 10px calc(8px + env(safe-area-inset-bottom));
}
.tabs a {
  flex: 1; text-align: center; font-size: 12px; font-weight: 800; color: var(--faint); text-decoration: none;
  padding: 6px 0; border-radius: 12px; position: relative;
}
.tabs a .ic { display: block; font-size: 22px; line-height: 1.2; }
.tabs a.on { color: var(--green); background: var(--green-soft); }
.tabs a.on.brown { color: var(--brown); background: var(--brown-soft); }
.tabs .dot { position: absolute; top: 2px; left: calc(50% + 10px); background: var(--mustard); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 6px; }

/* Public pages */
.public .shell { padding-bottom: 32px; }
.public .panel { margin: 18px 16px; background: var(--card); border-radius: 20px; padding: 26px 20px; box-shadow: var(--shadow); }
.public .panel h2 { margin: 10px 0 6px; font-size: 20px; }
.public .panel p { color: var(--muted); margin: 0 0 16px; }
.public form { display: grid; gap: 10px; }
.lang-switch { display: flex; gap: 4px; }

/* Bigger screens: the same column, floating on the linen background, tabs on top. */
@media (min-width: 760px) {
  body { background: radial-gradient(1200px 600px at 50% -200px, var(--linen-deep), var(--linen)); }
  .shell { padding: 28px 0 40px; }
  .band { border-radius: 28px; }
  .tabs {
    position: sticky; top: 12px; bottom: auto; margin: -30px 16px 26px; z-index: 15;
    border: 0; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px;
  }
  .tabs a { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; padding: 9px 0; }
  .tabs a .ic { display: inline; font-size: 18px; }
  .tabs .dot { position: static; }
  .hero { margin-top: 0; }
  .card, .mygift, .hero { margin-left: 0; margin-right: 0; }
  .tabs { margin-left: 0; margin-right: 0; }
  .note { margin-left: 0; margin-right: 0; }
  .public .panel { margin: 22px 0; padding: 32px; }
}
