:root {
  --paper: #f6f1e8;
  --ink: #1c1710;
  --muted: #7a7166;
  --terracotta: #b85c38;
  --terracotta-deep: #8f4226;
  --olive: #4f5d3a;
  --card: #fffbf4;
  --line: rgba(28, 23, 16, 0.08);
  --shadow: 0 18px 40px -24px rgba(28, 23, 16, 0.28);
  --radius: 1.75rem;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --sidebar: 16.5rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: Outfit, sans-serif;
  font-weight: 450;
  letter-spacing: -0.01em;
}

body {
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* --- Login: true center --- */

.auth-root {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom));
}

.auth-panel {
  width: min(26.5rem, 100%);
  display: grid;
  gap: 1.5rem;
  justify-items: stretch;
  text-align: left;
}

.auth-copy {
  display: grid;
  gap: 0.45rem;
}

.auth-copy h1 {
  margin: 0.15rem 0 0;
}

/* --- App chrome --- */

.app-root {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 1.6rem 1.15rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  background: rgba(255, 251, 244, 0.55);
  box-shadow: inset -1px 0 0 var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.35rem;
}

.brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.7rem;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  display: grid;
  place-items: center;
}

.brand-mark span {
  width: 0.7rem;
  height: 0.7rem;
  background: var(--terracotta);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.brand strong {
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 450;
}

.menu-block {
  display: grid;
  gap: 0.25rem;
}

.menu-label {
  padding: 0 0.7rem 0.35rem;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 560;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  border-radius: 0.95rem;
  padding: 0.7rem 0.75rem;
  color: var(--ink);
  transition: background 0.35s var(--ease), transform 0.25s var(--ease);
}

.menu-item:hover {
  background: rgba(28, 23, 16, 0.05);
}

.menu-item:active {
  transform: scale(0.98);
}

.menu-item.active {
  background: var(--olive);
  color: #f4efe6;
}

.menu-item svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.menu-item .count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  font-size: 0.85rem;
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 0.35rem;
  padding-top: 0.6rem;
  box-shadow: inset 0 1px 0 var(--line);
}

.who {
  padding: 0.85rem 0.75rem 0.2rem;
}

.who strong {
  display: block;
  letter-spacing: -0.02em;
}

.who span {
  color: var(--muted);
  font-size: 0.8rem;
}

.stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.mast {
  display: none;
}

.stage-body {
  width: min(44rem, 100%);
  margin: 0 auto;
  padding: 2.1rem 1.6rem 5rem;
}

.fab {
  position: fixed;
  right: 1.4rem;
  bottom: calc(1.3rem + env(safe-area-inset-bottom));
  width: 3.3rem;
  height: 3.3rem;
  border-radius: 999px;
  background: var(--terracotta);
  color: #fff8f1;
  display: grid;
  place-items: center;
  z-index: 6;
  box-shadow: 0 14px 30px -16px rgba(184, 92, 56, 0.9);
  transition: transform 0.3s var(--ease);
}

.fab:active {
  transform: scale(0.96);
}

.fab svg {
  width: 1.3rem;
  height: 1.3rem;
}

.menu-scrim,
.drawer {
  display: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(79, 93, 58, 0.1);
  color: var(--olive);
  font-size: 0.68rem;
  font-weight: 560;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  width: max-content;
}

.mark {
  width: 0.55rem;
  height: 0.55rem;
  background: var(--terracotta);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

h1 {
  margin: 0.7rem 0 0.4rem;
  font-size: clamp(2.1rem, 6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 32ch;
  line-height: 1.45;
}

.bezel {
  padding: 0.35rem;
  border-radius: calc(var(--radius) + 0.2rem);
  background: rgba(28, 23, 16, 0.04);
  box-shadow: inset 0 0 0 1px var(--line);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  padding: 1.15rem 1.15rem 1.25rem;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.field label {
  font-size: 0.78rem;
  font-weight: 560;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 0;
  background: rgba(28, 23, 16, 0.04);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  outline: none;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 0.4s var(--ease);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  box-shadow: inset 0 0 0 1.5px rgba(184, 92, 56, 0.55);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%237a7166' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.2rem;
}

.row-fields {
  display: grid;
  grid-template-columns: 1fr 5.5rem;
  gap: 0.6rem;
}

.row-fields.even {
  grid-template-columns: 1fr 1fr;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.2rem 0 1rem;
  color: var(--ink);
  font-size: 0.95rem;
}

.check-row input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--olive);
}

.lang-switch {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.18rem;
  border-radius: 999px;
  background: rgba(28, 23, 16, 0.06);
  width: max-content;
  margin-top: 0.55rem;
}

.sidebar-foot .lang-switch,
.drawer .lang-switch {
  margin: 0.35rem 0.55rem 0.2rem;
}

.lang-switch button {
  min-width: 2.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 560;
  letter-spacing: 0.04em;
}

.lang-switch button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(28, 23, 16, 0.08);
}

.repeat-hint {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  border-radius: 999px;
  padding: 0.95rem 1.1rem;
  font-weight: 560;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--ink);
  color: #f7f2ea;
}

.btn-ghost {
  background: rgba(28, 23, 16, 0.06);
}

.btn-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(28, 23, 16, 0.06);
}

.btn-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.alert {
  color: var(--terracotta-deep);
  font-size: 0.9rem;
  min-height: 1.2rem;
  margin: 0 0 0.8rem;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.3rem;
}

.hello {
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  margin: 0.15rem 0 0;
}

.subtle {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.chips {
  display: none;
}

.list {
  display: grid;
  gap: 0.55rem;
}

.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.95rem 0.9rem;
  border-radius: 1.35rem;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}

.item.done {
  opacity: 0.55;
}

.item.done .item-title {
  text-decoration: line-through;
  color: var(--muted);
}

.check {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 0.55rem;
  box-shadow: inset 0 0 0 1.5px rgba(28, 23, 16, 0.22);
  margin-top: 0.1rem;
  display: grid;
  place-items: center;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.check.on {
  background: var(--olive);
  box-shadow: none;
}

.check svg {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.check.on svg {
  opacity: 1;
  transform: scale(1);
}

.item-title {
  margin: 0;
  font-weight: 560;
  letter-spacing: -0.02em;
}

.item-meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.empty {
  padding: 2.4rem 1rem 2rem;
  text-align: left;
}

.empty h2 {
  margin: 0.4rem 0 0.35rem;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.3rem 0 0.55rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 560;
}

.household-grid {
  display: grid;
  gap: 1.4rem;
}

.people {
  display: grid;
  gap: 0.55rem;
}

.person {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1rem;
  background: var(--card);
  border-radius: 1.3rem;
  box-shadow: inset 0 0 0 1px var(--line);
}

.role {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--olive);
  font-weight: 560;
}

.cal-top {
  align-items: center;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cal-today {
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(28, 23, 16, 0.06);
  font-weight: 560;
  font-size: 0.85rem;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 560;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
}

.cal-day {
  aspect-ratio: 1;
  border-radius: 1rem;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.2rem;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.2s var(--ease);
}

.cal-day:active {
  transform: scale(0.97);
}

.cal-day.outside {
  opacity: 0.38;
}

.cal-day.today .cal-num {
  color: var(--terracotta);
  font-weight: 700;
}

.cal-day.selected {
  background: var(--olive);
  color: #f4efe6;
  box-shadow: none;
}

.cal-day.selected .cal-num {
  color: inherit;
}

.cal-day.selected .cal-dots i {
  background: #f4efe6;
}

.cal-num {
  font-variant-numeric: tabular-nums;
  font-weight: 560;
  font-size: 0.95rem;
}

.cal-dots {
  display: flex;
  gap: 0.15rem;
  min-height: 0.35rem;
}

.cal-dots i {
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 99px;
  background: var(--terracotta);
  display: block;
}

.event-time {
  min-width: 3.6rem;
  margin-top: 0.1rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.7rem;
  background: rgba(79, 93, 58, 0.12);
  color: var(--olive);
  font-size: 0.75rem;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 23, 16, 0.28);
  z-index: 9;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(32rem, 100%);
  max-height: min(92dvh, 44rem);
  overflow: auto;
  background: var(--paper);
  border-radius: 1.8rem 1.8rem 0 0;
  padding: 1.1rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom));
  z-index: 10;
  box-shadow: 0 -20px 50px -30px rgba(28, 23, 16, 0.5);
}

.recipe-item {
  grid-template-columns: 1fr auto;
}

.recipe-body {
  text-align: left;
  min-width: 0;
}

.recipe-notes {
  margin: 0.35rem 0 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.recipe-link {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: rgba(79, 93, 58, 0.12);
  color: var(--olive);
  font-size: 0.75rem;
  font-weight: 560;
  text-decoration: none;
  max-width: 8.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.handle {
  width: 2.6rem;
  height: 0.28rem;
  border-radius: 99px;
  background: rgba(28, 23, 16, 0.14);
  margin: 0 auto 1rem;
}

.skeleton {
  height: 4.2rem;
  border-radius: 1.35rem;
  background: linear-gradient(90deg, rgba(28, 23, 16, 0.05), rgba(28, 23, 16, 0.1), rgba(28, 23, 16, 0.05));
  background-size: 200% 100%;
  animation: shimmer 1.2s var(--ease) infinite;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@media (min-width: 900px) {
  .household-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .household-grid .people {
    grid-column: 1 / -1;
  }
}

/* --- Phone: hamburger menu --- */

@media (max-width: 767px) {
  .app-root {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mast {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    position: sticky;
    top: 0;
    z-index: 5;
    padding: calc(0.7rem + env(safe-area-inset-top)) 0.9rem 0.7rem;
    background: rgba(246, 241, 232, 0.88);
    backdrop-filter: blur(16px);
    box-shadow: inset 0 -1px 0 var(--line);
  }

  .mast h2 {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
  }

  .menu-toggle {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.9rem;
    background: var(--card);
    box-shadow: inset 0 0 0 1px var(--line);
    display: grid;
    place-items: center;
  }

  .menu-toggle svg {
    width: 1.2rem;
    height: 1.2rem;
  }

  .mast .grow {
    flex: 1;
  }

  .stage-body {
    padding: 1.15rem 1rem 6rem;
    width: 100%;
  }

  .chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    margin: 0 0 1rem;
    scrollbar-width: none;
  }

  .chips::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    background: rgba(28, 23, 16, 0.05);
    color: var(--muted);
    font-weight: 560;
    font-size: 0.92rem;
  }

  .chip.active {
    background: var(--olive);
    color: #f4efe6;
  }

  .chip .count {
    margin-left: 0.35rem;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
  }

  .menu-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(28, 23, 16, 0.32);
    z-index: 20;
  }

  .drawer {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(20rem, 86vw);
    background: var(--paper);
    z-index: 21;
    padding: calc(1.1rem + env(safe-area-inset-top)) 1rem 1.2rem;
    box-shadow: 16px 0 40px -24px rgba(28, 23, 16, 0.4);
    transform: translateX(0);
  }

  .drawer-close {
    position: absolute;
    top: calc(0.8rem + env(safe-area-inset-top));
    right: 0.8rem;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    background: rgba(28, 23, 16, 0.06);
    display: grid;
    place-items: center;
  }

  .hello {
    font-size: 1.55rem;
  }
}

/* --- Gift lists (admin + public page) --- */

.sheet-title,
.gift-sheet-title {
  font-size: 1.45rem;
  margin-bottom: 0.9rem;
}

.gift-sheet-title {
  margin-bottom: 0.4rem;
}

.gift-sheet-sub {
  margin: 0 0 1rem;
}

.gift-sheet-hint {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.gift-shop {
  margin-bottom: 1rem;
  text-decoration: none;
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.4rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  background: var(--ink);
  color: #f7f2ea;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-weight: 560;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
}

.gift-list-card {
  grid-template-columns: auto 1fr auto;
  align-items: center;
  text-align: left;
  width: 100%;
}

.gift-list-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.9rem;
  display: grid;
  place-items: center;
  background: rgba(184, 92, 56, 0.12);
  color: var(--terracotta-deep);
}

.gift-list-icon svg {
  width: 1.3rem;
  height: 1.3rem;
}

.gift-list-body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.gift-list-body .item-title,
.gift-list-body .item-meta {
  margin: 0;
}

.gift-progress {
  display: block;
  height: 0.28rem;
  border-radius: 99px;
  background: rgba(28, 23, 16, 0.08);
  overflow: hidden;
  margin-top: 0.35rem;
}

.gift-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--olive);
  border-radius: inherit;
}

.gift-list-count {
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.gift-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
  font-weight: 560;
  font-size: 0.92rem;
  margin: 0 0 0.6rem -0.3rem;
  padding: 0.3rem;
}

.gift-back svg {
  width: 1.1rem;
  height: 1.1rem;
}

.gift-share {
  margin-bottom: 1.4rem;
}

.gift-share-url {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border-radius: 1rem;
  background: rgba(28, 23, 16, 0.05);
  margin-bottom: 0.8rem;
}

.gift-share-url svg {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  color: var(--muted);
}

.gift-share-url input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 0.92rem;
  text-overflow: ellipsis;
}

.gift-share-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.5rem;
}

.gift-share-actions a {
  color: inherit;
  text-decoration: none;
}

.gift-share-actions svg {
  width: 1.1rem;
  height: 1.1rem;
}

.gift-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  margin-top: 0.9rem;
}

.gift-text-btn {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 560;
  padding: 0.2rem 0;
}

.gift-text-btn.danger,
.gift-delete-btn {
  color: var(--terracotta-deep);
}

.gift-delete-btn {
  margin-top: 0.5rem;
}

.gift-delete-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.gift-fetch-row {
  display: flex;
  gap: 0.5rem;
}

.gift-fetch-row input {
  flex: 1;
  min-width: 0;
}

.gift-fetch-row .btn {
  width: auto;
  flex: none;
  padding: 0.7rem 1rem;
}

.gift-fetch-row .btn:disabled {
  opacity: 0.6;
}

.gift-form-preview {
  margin: 0 0 1rem;
}

.gift-form-preview img {
  width: 6rem;
  height: 6rem;
  object-fit: contain;
  border-radius: 1rem;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

/* Product grid, shared by the admin view and the public page */

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(11rem, 44vw), 1fr));
  gap: 1.1rem 0.9rem;
}

.gift-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
  text-align: left;
  padding: 0;
}

.gift-img {
  position: relative;
  aspect-ratio: 1;
  border-radius: 1.2rem;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  display: grid;
  place-items: center;
}

.gift-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.6s var(--ease);
}

.gift-card:hover .gift-img img {
  transform: scale(1.03);
}

.gift-ph {
  width: 40%;
  color: rgba(184, 92, 56, 0.45);
}

.gift-ph svg {
  width: 100%;
  height: auto;
}

.gift-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: var(--olive);
  color: #f4efe6;
  font-size: 0.75rem;
  font-weight: 560;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}

.gift-card.claimed .gift-img img,
.gift-card.claimed .gift-ph {
  opacity: 0.45;
  filter: grayscale(0.6);
}

.gift-info {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 0.25rem;
}

.gift-name {
  margin: 0;
  font-weight: 560;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gift-name a {
  color: inherit;
  text-decoration: none;
}

.gift-meta,
.gift-notes,
.gift-claimed {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.gift-meta {
  font-variant-numeric: tabular-nums;
}

.gift-claimed {
  color: var(--olive);
  font-weight: 560;
}

.gift-buy {
  width: 100%;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-weight: 560;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}

.gift-buy:not(:disabled):hover {
  background: var(--ink);
  color: #f7f2ea;
}

.gift-buy:active {
  transform: scale(0.98);
}

.gift-buy:disabled {
  cursor: default;
  box-shadow: none;
  background: rgba(28, 23, 16, 0.06);
  color: var(--muted);
}

.gift-buy.is-mine {
  box-shadow: none;
  background: rgba(79, 93, 58, 0.14);
  color: var(--olive);
  font-size: 0.88rem;
}

/* Public page shell */

.gift-public {
  position: relative;
  z-index: 2;
}

.gift-wrap {
  width: min(78rem, 100%);
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem calc(2rem + env(safe-area-inset-bottom));
}

.gift-hero {
  position: relative;
  min-height: clamp(11rem, 28vw, 16rem);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem 1.4rem 1.5rem;
  color: #fff8f1;
  background-color: #2b2219;
  background-image:
    radial-gradient(circle at 12% 30%, rgba(214, 170, 92, 0.55) 0 0.35rem, transparent 0.4rem),
    radial-gradient(circle at 78% 22%, rgba(214, 170, 92, 0.5) 0 0.3rem, transparent 0.35rem),
    radial-gradient(circle at 55% 75%, rgba(214, 170, 92, 0.4) 0 0.25rem, transparent 0.3rem),
    radial-gradient(circle at 90% 80%, rgba(214, 170, 92, 0.45) 0 0.35rem, transparent 0.4rem),
    linear-gradient(135deg, #8f4226 0%, #3a2c1f 55%, #4f5d3a 100%);
  background-size: cover;
  background-position: center;
  margin-bottom: 1.2rem;
}

.gift-hero.skeleton {
  background: rgba(28, 23, 16, 0.08);
}

.gift-hero-top {
  display: flex;
  justify-content: flex-end;
}

.gift-hero .lang-switch {
  background: rgba(255, 248, 241, 0.16);
  backdrop-filter: blur(8px);
}

.gift-hero .lang-switch button {
  color: rgba(255, 248, 241, 0.75);
}

.gift-hero .lang-switch button.active {
  background: #fff8f1;
  color: var(--ink);
}

.gift-hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

.gift-hero-for,
.gift-hero-count {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  opacity: 0.88;
}

.gift-hero-count {
  font-variant-numeric: tabular-nums;
}

.gift-desc {
  margin: 0 0 1.2rem;
  line-height: 1.5;
  white-space: pre-wrap;
  max-width: 46rem;
}

.gift-search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  margin-bottom: 1.4rem;
}

.gift-search svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--muted);
  flex: none;
}

.gift-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
}

.gift-none {
  padding: 2rem 0;
  text-align: center;
}

.gift-missing {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

.gift-missing .card {
  max-width: 26rem;
}

.gift-foot {
  margin-top: 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* --- Admin --- */

.admin-person {
  gap: 0.8rem;
  flex-wrap: wrap;
}

.admin-person-who {
  min-width: 0;
  flex: 1 1 12rem;
}

.admin-person-who .item-meta {
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-person.is-off .admin-person-who {
  opacity: 0.55;
}

.admin-person-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.admin-person-actions select {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  background: rgba(28, 23, 16, 0.06);
  font-size: 0.88rem;
  font-weight: 560;
}

.admin-person-actions select:disabled {
  opacity: 0.6;
}

.invite-created {
  margin-top: 1.1rem;
  padding-top: 1rem;
  box-shadow: inset 0 1px 0 var(--line);
}

.invite-created .item-title {
  margin: 0 0 0.6rem;
}

.invite-note {
  margin-top: 0.7rem;
  font-size: 0.85rem;
}

.auth-panel > a.btn {
  text-decoration: none;
  color: inherit;
}
