/* App shell + reusable components.
   Design rules: cards 14px radius, 14–16px padding; left-edge accent for status;
   1px lines in --line-soft. 100px bottom padding to clear bottom nav + FAB. */

/* === Shell ============================================================ */
.app-shell {
  display: block;
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 32px);
  /* Hard clip + width lock so internal scroll containers (.chips, .subtabs)
     can scroll horizontally inside themselves without the body picking it up. */
  overflow-x: clip;
  overscroll-behavior-x: none;
}

.boot-splash {
  display: grid;
  place-items: center;
  height: 100dvh;
  gap: 14px;
  text-align: center;
}
.boot-splash__emblem { width: 96px; height: 96px; opacity: 0.92; }
.boot-splash__title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  margin: 0;
  color: var(--cream);
}
.boot-splash__title em { color: var(--gold-bright); }
.boot-splash__sub {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--cream-dim);
}

/* === Header =========================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 12px) var(--pad-xl) 12px;
  background:
    linear-gradient(180deg, rgba(10, 6, 8, 0.92) 0%, rgba(10, 6, 8, 0.6) 80%, transparent 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-header__brand {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 97, 0.35);
  padding: 2px;
  background: radial-gradient(circle at 30% 30%, rgba(201, 169, 97, 0.1), transparent 70%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.app-header__brand img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.app-header__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.app-header__name {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--cream);
}
.app-header__sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--cream-dim);
}

.presence {
  display: flex;
  align-items: center;
  gap: 6px;
}
.presence__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--cream);
  background: var(--surface-2);
  border: 1px solid var(--line);
  position: relative;
}
.presence__avatar[data-color="gold"] {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold-bright));
  color: var(--ink);
  border-color: var(--gold);
}
.presence__avatar[data-color="wine"] {
  background: linear-gradient(135deg, var(--wine), var(--wine-light));
  color: var(--cream);
  border-color: var(--wine-light);
}
.presence__avatar[data-online="true"]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--black);
}

/* === Greeting block =================================================== */
.greeting-block {
  padding: 8px var(--pad-xl) 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.greeting-block .label { color: var(--cream-dim); }

/* === View / page ====================================================== */
.view {
  padding: 0 var(--pad-xl) 24px;
  display: flex;
  flex-direction: column;
  gap: var(--pad-xl);
}
.view__title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.view__title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  color: var(--cream);
}

/* === Card ============================================================= */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: var(--pad-md) var(--pad-md);
  position: relative;
  overflow: hidden;
}
.card--accent { padding-left: calc(var(--pad-md) + 4px); }
.card--accent::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}
.card--accent[data-status="rose"]::before { background: var(--rose); }
.card--accent[data-status="amber"]::before { background: var(--amber); }
.card--accent[data-status="green"]::before { background: var(--green); }
.card--accent[data-status="gold"]::before { background: var(--gold); }

.card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.card__head > * { min-width: 0; }
.card__title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--cream);
}
.card__body { color: var(--cream-dim); font-size: 14px; }

/* === Tile (stat) ====================================================== */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.tile {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}
.tile__label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--cream-dim); }
.tile__value {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 32px;
  line-height: 1;
  color: var(--cream);
  letter-spacing: -0.02em;
}
.tile__value--rose { color: var(--rose); }
.tile__value--amber { color: var(--amber); }
.tile__value--gold { color: var(--gold-bright); }

/* === Pill / tag ======================================================= */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: 4px;
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold-soft);
  white-space: nowrap;
}
.tag[data-kind="room"] { border-color: var(--gold-dim); color: var(--gold-soft); }
.tag[data-kind="person"] { border-color: var(--wine-light); color: var(--wine-light); }
.tag[data-kind="function"] { border-color: var(--cream-dim); color: var(--cream-dim); }
.tag[data-kind="lifecycle"] { border-color: var(--rose); color: var(--rose); }

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* === Filter chips ===================================================== */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 calc(-1 * var(--pad-xl));
  padding-left: var(--pad-xl);
  padding-right: var(--pad-xl);
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: 0.06em;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  color: var(--cream-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
.chip[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--wine-deep), var(--wine));
  border-color: var(--gold-dim);
  color: var(--gold-bright);
}

/* === Sub-tabs ========================================================= */
.subtabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line-soft);
  margin: 0 calc(-1 * var(--pad-xl));
  padding: 0 var(--pad-xl);
  /* Allow the strip itself to scroll if labels don't fit on the narrowest
     viewports — the .app-shell clip prevents this from leaking into a
     body-level scroll. */
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.subtabs::-webkit-scrollbar { display: none; }
.subtab {
  padding: 10px 14px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--cream-dim);
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}
.subtab[aria-selected="true"] { color: var(--gold-bright); }
.subtab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 14px; right: 14px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px 2px 0 0;
}

/* === Buttons ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--cream);
  min-height: 44px;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold-bright));
  border-color: var(--gold);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 8px 24px -10px rgba(201, 169, 97, 0.4);
}

.btn--wine {
  background: linear-gradient(135deg, var(--wine-deep), var(--wine));
  border-color: var(--wine-light);
  color: var(--cream);
}

.btn--ghost { background: transparent; }
.btn--full { width: 100%; }
.btn--small { padding: 8px 12px; font-size: 12px; min-height: 36px; }

/* === Inputs =========================================================== */
.input,
.textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--cream);
  font-size: 15px;
  min-height: 44px;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .textarea:focus { border-color: var(--gold-dim); }

.input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

/* === List rows (for restock/todos) ==================================== */
.list { display: flex; flex-direction: column; gap: 10px; }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  position: relative;
}
.list-row::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}
.list-row[data-status="out"]::before { background: var(--rose); }
.list-row[data-status="low"]::before { background: var(--amber); }
.list-row[data-status="stocked"]::before { background: var(--green); }

.list-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list-row__title { color: var(--cream); font-size: 15px; font-weight: 500; }
.list-row__meta { color: var(--cream-dim); font-size: 11px; letter-spacing: 0.06em; }

.list-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 6px 0 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.list-section-head > * { min-width: 0; }
.list-section-head h3 {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--cream);
  font-weight: 500;
}

/* === Row × button (delete) =========================================== */
.row-x {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
  color: var(--muted);
  border: 1px solid transparent;
  flex-shrink: 0;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.row-x:hover, .row-x:active {
  color: var(--rose);
  border-color: var(--line-soft);
  background: var(--ink);
}

/* === Checkbox ========================================================= */
.check {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--gold-dim);
  background: var(--ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.check:checked { background: var(--gold); border-color: var(--gold-bright); }
.check:checked::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(-45deg) translate(1px, -2px);
}

/* === Bottom nav ======================================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-max);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 8px 0 calc(8px + var(--safe-bottom));
  background:
    linear-gradient(180deg, rgba(10, 6, 8, 0) 0%, rgba(10, 6, 8, 0.95) 35%, rgba(10, 6, 8, 1) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
  z-index: 20;
}
.bottom-nav__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  color: var(--cream-dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  min-height: 50px;
  position: relative;
}
.bottom-nav__btn[aria-current="page"] { color: var(--gold-bright); }
.bottom-nav__icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}
.bottom-nav__btn[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2px;
  background: var(--gold);
  border-radius: 0 0 2px 2px;
}

/* === FAB stack ======================================================== */
.fab-stack {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 25;
}
.fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold-bright));
  color: var(--ink);
  box-shadow: var(--shadow-lift);
  font-size: 24px;
  font-weight: 600;
  border: 1px solid var(--gold);
}
.fab--favor {
  background: linear-gradient(135deg, var(--wine-deep), var(--wine));
  color: var(--gold-bright);
  border: 1px solid var(--gold-dim);
  width: 48px;
  height: 48px;
  font-size: 18px;
  position: relative;
}
.fab--favor[data-pending="true"]::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 2px var(--black);
  animation: pulse-dot 1.6s var(--ease) infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

/* === Drawer (slides up from bottom) =================================== */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.scrim[data-open="true"] { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: var(--shell-max);
  max-height: 88dvh;
  background: linear-gradient(180deg, var(--surface), var(--ink));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur) var(--ease);
  box-shadow: var(--shadow);
}
.drawer[data-open="true"] { transform: translate(-50%, 0); }

.drawer__handle {
  width: 44px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  margin: 10px auto 4px;
}
.drawer__head {
  padding: 8px var(--pad-xl) 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drawer__title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--cream);
}
.drawer__title em { color: var(--gold-bright); }

.drawer__body {
  padding: var(--pad-md) var(--pad-xl) 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.drawer__foot {
  padding: 12px var(--pad-xl) calc(16px + var(--safe-bottom));
  border-top: 1px solid var(--line-soft);
  background: var(--ink);
}

/* === Quick Favor specific ============================================= */
.qf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.qf-tile {
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--cream-dim);
  min-height: 70px;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.qf-tile__icon { font-size: 22px; line-height: 1; }
.qf-tile[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--wine-deep), var(--wine));
  border-color: var(--gold);
  color: var(--gold-bright);
}
.qf-tile--other { border-style: dashed; }

.qf-urgency {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.qf-urgency .chip { justify-content: center; }
.qf-urgency .chip[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--wine-deep), var(--wine));
  border-color: var(--gold);
  color: var(--gold-bright);
}

/* === Activity feed ==================================================== */
.activity {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.activity__row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.activity__row:last-child { border-bottom: 0; }
.activity__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 12px;
  flex-shrink: 0;
}
.activity__avatar[data-color="gold"] { background: var(--gold); color: var(--ink); }
.activity__avatar[data-color="wine"] { background: var(--wine); color: var(--cream); }
.activity__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.activity__text { font-size: 13px; color: var(--cream); }
.activity__text em { color: var(--gold-bright); font-style: italic; }
.activity__when { font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); }

/* === Toast =========================================================== */
.toast-rail {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 80px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
  pointer-events: none;
  width: calc(100% - 36px);
  max-width: 420px;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--cream);
  box-shadow: var(--shadow-lift);
  pointer-events: auto;
  animation: toast-in 240ms var(--ease);
}
.toast em { color: var(--gold-bright); font-family: 'Playfair Display', serif; font-style: italic; }
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === Meals — week grid + recipe cards ================================= */
.week {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.week-day {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}
.week-day__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.week-day__title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--cream);
  font-weight: 500;
  margin: 0;
}
.week-day__slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meal-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  text-align: left;
  width: 100%;
  min-width: 0;
}
.meal-slot[data-filled="true"] {
  background: linear-gradient(135deg, rgba(92,26,38,0.45), rgba(36,19,25,0.6));
  border-color: var(--line);
}
.meal-slot__type {
  flex: 0 0 70px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--cream-dim);
  text-transform: uppercase;
}
.meal-slot__name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.recipe-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.recipe-card:hover { border-color: var(--gold-dim); }
.recipe-card:active { transform: scale(0.98); }
.recipe-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.recipe-card__image--placeholder {
  background:
    linear-gradient(135deg, rgba(201,169,97,0.12), rgba(92,26,38,0.4)),
    radial-gradient(circle at 30% 30%, rgba(201,169,97,0.15), transparent 60%);
}
.recipe-card__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.recipe-card__name {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--cream);
  margin: 0;
  font-weight: 500;
}
.recipe-card__meta {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--cream-dim);
  margin: 0;
  text-transform: uppercase;
}

/* === Empty states ===================================================== */
.empty {
  text-align: center;
  padding: 28px 14px;
  color: var(--cream-dim);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}
.empty__title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--cream);
  margin-bottom: 4px;
}

/* === Login splash + persona picker ==================================== */
.login {
  min-height: 100dvh;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: max(40px, calc(var(--safe-top) + 32px)) var(--pad-xl) calc(var(--safe-bottom) + 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  text-align: center;
}
.login__emblem {
  width: 88px;
  height: 88px;
  margin: 0 auto 4px;
  opacity: 0.95;
  filter: drop-shadow(0 8px 24px rgba(201, 169, 97, 0.18));
}
.login__title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 32px;
  color: var(--cream);
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
}
.login__title em {
  color: var(--gold-bright);
  font-style: italic;
}
.login__sub {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--cream-dim);
}
.login__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.login__error {
  margin: 4px 0 0;
  color: var(--rose);
  font-size: 13px;
  text-align: center;
}
.login__foot {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* Persona picker cards */
.persona-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.persona-card:hover, .persona-card:active {
  border-color: var(--gold-dim);
}
.persona-card[disabled] { opacity: 0.5; cursor: default; }
.persona-card__avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 22px;
  flex-shrink: 0;
}
.persona-card__avatar[data-color="gold"] {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold-bright));
  color: var(--ink);
}
.persona-card__avatar[data-color="wine"] {
  background: linear-gradient(135deg, var(--wine), var(--wine-light));
  color: var(--cream);
}
.persona-card__text {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.persona-card__name {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 19px;
  color: var(--cream);
}
.persona-card__short {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--cream-dim);
}

/* === User menu (popover from header avatar) ========================== */
.user-menu {
  position: fixed;
  top: calc(var(--safe-top) + 56px);
  right: max(var(--pad-xl), env(safe-area-inset-right, 0px));
  width: 240px;
  max-width: calc(100vw - 28px);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 14px 10px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: user-menu-in 180ms var(--ease);
}
@keyframes user-menu-in {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.user-menu__head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.user-menu__name {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--cream);
}
.user-menu__email {
  font-size: 11px;
  color: var(--cream-dim);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* === Setup screen (first-run) ========================================= */
.setup {
  padding: calc(var(--safe-top) + 40px) var(--pad-xl) calc(var(--safe-bottom) + 40px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100dvh;
  max-width: var(--shell-max);
  margin: 0 auto;
}
.setup__emblem { width: 72px; height: 72px; align-self: center; opacity: 0.95; }
.setup__title {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 28px;
  color: var(--cream);
  text-align: center;
}
.setup__title em { color: var(--gold-bright); }
.setup__sub {
  text-align: center;
  color: var(--cream-dim);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.setup__field { display: flex; flex-direction: column; gap: 6px; }
.setup__field .label { color: var(--cream-dim); }
.setup__hint { font-size: 11px; color: var(--muted); }
