/* ============================================================
   LIMONE · свадебный планировщик
   Палитра «Амальфийское лето»: кремовая бумага, пастельный
   лимон, шалфей, терракота, чернильная олива.
   ============================================================ */

:root {
  --cream:      #FBF6E8;
  --paper:      #FFFDF4;
  --lemon:      #F9DE6B;
  --lemon-soft: #FCEFB8;
  --lemon-deep: #E3B92E;
  --sage:       #A9BFA0;
  --sage-soft:  #DDE8D6;
  --olive:      #57663F;
  --terracotta: #C97B5D;
  --terra-soft: #F2DCD0;
  --ink:        #3B3A2F;
  --ink-soft:   #8A8672;
  --sea:        #BFD9D3;
  --danger:     #B4543A;

  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 10px 30px -12px rgba(87, 102, 63, .25);
  --shadow-s: 0 4px 14px -6px rgba(87, 102, 63, .22);

  --font-display: "Cormorant", "Georgia", serif;
  --font-body: "Jost", "Verdana", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* атрибут hidden должен побеждать любые display-классы (.btn и т.п.) */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: #EFE8D5;
  min-height: 100dvh;
}

/* Фактура бумаги + лимонные ветви по краям на больших экранах */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 15% 8%,  rgba(249, 222, 107, .18), transparent 50%),
    radial-gradient(ellipse at 85% 92%, rgba(169, 191, 160, .20), transparent 50%);
  pointer-events: none;
}

#app {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--cream);
  box-shadow: 0 0 60px rgba(59, 58, 47, .18);
  display: flex;
  flex-direction: column;
  /* зернистость бумаги */
  background-image:
    radial-gradient(rgba(87, 102, 63, .035) 1px, transparent 1px);
  background-size: 7px 7px;
}

/* ---------- Шапка с навесом ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--paper);
}

.topbar-inner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 10px;
}

.brand-link {
  flex: none;
  display: inline-flex;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease;
}
.brand-link:active { transform: scale(.92) rotate(-6deg); }
@media (hover: hover) { .brand-link:hover { transform: rotate(-6deg); } }

.brand-lemon { width: 44px; height: 44px; flex: none; display: block; }
.brand-lemon .fruit { fill: var(--lemon); stroke: var(--ink); stroke-width: 2.5; }
.brand-lemon .leaf  { fill: var(--sage);  stroke: var(--ink); stroke-width: 2.5; }
.brand-lemon .shine { fill: none; stroke: var(--paper); stroke-width: 3; stroke-linecap: round; }

.brand-text { flex: 1; min-width: 0; }

.brand-text h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
  letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.brand-text p {
  font-size: 12px;
  font-style: italic;
  color: var(--ink-soft);
  letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Полосатый навес итальянского кафе с фестонами */
.awning {
  height: 22px;
  background:
    repeating-linear-gradient(90deg,
      var(--lemon) 0 28px,
      var(--sage-soft) 28px 56px);
  -webkit-mask:
    radial-gradient(14px at 14px 8px, #000 98%, transparent) 0 0 / 28px 100%,
    linear-gradient(#000 0 0) 0 0 / 100% 8px no-repeat;
  mask:
    radial-gradient(14px at 14px 8px, #000 98%, transparent) 0 0 / 28px 100%,
    linear-gradient(#000 0 0) 0 0 / 100% 8px no-repeat;
  filter: drop-shadow(0 3px 3px rgba(59, 58, 47, .12));
}

/* ---------- Основная область ---------- */

#main {
  flex: 1;
  padding: 18px 16px calc(86px + env(safe-area-inset-bottom));
}

.view { animation: view-in .35s ease both; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.view > * { animation: rise .4s ease backwards; }
.view > *:nth-child(1) { animation-delay: .02s; }
.view > *:nth-child(2) { animation-delay: .07s; }
.view > *:nth-child(3) { animation-delay: .12s; }
.view > *:nth-child(4) { animation-delay: .17s; }
.view > *:nth-child(5) { animation-delay: .22s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Типографика разделов ---------- */

.view-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.05;
  margin-bottom: 2px;
}

.view-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.section-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  margin: 22px 0 10px;
}

.section-title::after {
  content: "";
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--sage), transparent);
}

/* Рисованная лимонная веточка-разделитель */
.divider-branch {
  display: block;
  width: 130px; height: 26px;
  margin: 18px auto 6px;
  opacity: .9;
}
.divider-branch .stem { fill: none; stroke: var(--olive); stroke-width: 1.6; stroke-linecap: round; }
.divider-branch .leaf { fill: var(--sage-soft); stroke: var(--olive); stroke-width: 1.4; }
.divider-branch .lem  { fill: var(--lemon); stroke: var(--olive); stroke-width: 1.4; }

/* ---------- Карточки ---------- */

.card {
  background: var(--paper);
  border: 1px solid rgba(87, 102, 63, .14);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  padding: 16px;
  margin-bottom: 12px;
}

.card.flat { box-shadow: none; }

.card-tap { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.card-tap:active { transform: scale(.985); }

/* ---------- Hero на главной ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, var(--paper) 55%, var(--lemon-soft));
  border: 1px solid rgba(87, 102, 63, .16);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 26px 20px 22px;
  text-align: center;
  margin-bottom: 14px;
}

.hero::before, .hero::after {
  content: "";
  position: absolute;
  width: 110px; height: 110px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: .9;
  pointer-events: none;
}

/* лимонная ветвь — углы hero */
.hero::before {
  top: -26px; left: -26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M10 10 C40 20 60 40 70 80' fill='none' stroke='%2357663F' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath d='M34 26 C46 14 64 18 66 30 C54 40 38 38 34 26Z' fill='%23DDE8D6' stroke='%2357663F' stroke-width='2'/%3E%3Cpath d='M50 52 C64 42 80 50 78 62 C66 70 52 64 50 52Z' fill='%23DDE8D6' stroke='%2357663F' stroke-width='2'/%3E%3Cellipse cx='78' cy='92' rx='17' ry='14' fill='%23F9DE6B' stroke='%2357663F' stroke-width='2.2' transform='rotate(-24 78 92)'/%3E%3C/svg%3E");
}

.hero::after {
  bottom: -26px; right: -26px;
  transform: rotate(180deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M10 10 C40 20 60 40 70 80' fill='none' stroke='%2357663F' stroke-width='2.4' stroke-linecap='round'/%3E%3Cpath d='M34 26 C46 14 64 18 66 30 C54 40 38 38 34 26Z' fill='%23DDE8D6' stroke='%2357663F' stroke-width='2'/%3E%3Cpath d='M50 52 C64 42 80 50 78 62 C66 70 52 64 50 52Z' fill='%23DDE8D6' stroke='%2357663F' stroke-width='2'/%3E%3Cellipse cx='78' cy='92' rx='17' ry='14' fill='%23F9DE6B' stroke='%2357663F' stroke-width='2.2' transform='rotate(-24 78 92)'/%3E%3C/svg%3E");
}

.hero .eyebrow {
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 500;
}

.hero h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 34px;
  line-height: 1.05;
  margin: 8px 0 4px;
}

.hero h2 .amp {
  font-style: italic;
  color: var(--terracotta);
}

.hero .hero-date {
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
}

.hero .countdown {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 22px;
  background: var(--paper);
  border: 1.5px dashed var(--lemon-deep);
  border-radius: 999px;
}

.hero .countdown b {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--olive);
}

.hero .countdown span { font-size: 13px; color: var(--ink-soft); }

/* ---------- Статистика-плитки ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  background: var(--paper);
  border: 1px solid rgba(87, 102, 63, .14);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  box-shadow: var(--shadow-s);
}

.stat .num {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--olive);
}

.stat .lbl { font-size: 12px; color: var(--ink-soft); }

.stat.accent { background: linear-gradient(150deg, var(--lemon-soft), var(--paper)); }
.stat.sage   { background: linear-gradient(150deg, var(--sage-soft), var(--paper)); }
.stat.terra  { background: linear-gradient(150deg, var(--terra-soft), var(--paper)); }

/* ---------- Прогресс ---------- */

.progress {
  height: 10px;
  background: var(--sage-soft);
  border-radius: 999px;
  overflow: hidden;
}

.progress > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--olive));
  border-radius: 999px;
  transition: width .5s ease;
}

.progress.lemon > i { background: linear-gradient(90deg, var(--lemon), var(--lemon-deep)); }
.progress.over  > i { background: linear-gradient(90deg, var(--terracotta), var(--danger)); }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
  -webkit-tap-highlight-color: transparent;
}

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

.btn-primary {
  background: var(--olive);
  color: var(--paper);
  box-shadow: 0 6px 16px -6px rgba(87, 102, 63, .55);
}

.btn-lemon {
  background: var(--lemon);
  color: var(--ink);
  box-shadow: 0 6px 16px -6px rgba(227, 185, 46, .6);
}

.btn-ghost {
  background: transparent;
  color: var(--olive);
  border: 1.5px solid var(--sage);
}

.btn-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--terracotta); }

.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.icon-btn {
  width: 38px; height: 38px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1.5px solid rgba(87, 102, 63, .25);
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:active { background: var(--sage-soft); }

.icon-btn svg, .tab svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  color: var(--olive);
}

/* плавающая кнопка добавления */
.fab-row {
  position: sticky;
  bottom: calc(94px + env(safe-area-inset-bottom));
  display: flex; justify-content: flex-end;
  z-index: 5;
  pointer-events: none;
  margin-top: 10px;
}

.fab-row .btn { pointer-events: auto; box-shadow: var(--shadow); }

/* ---------- Нижняя навигация ---------- */

.tabbar {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  z-index: 40;
  display: flex;
  background: var(--paper);
  border-top: 1px solid rgba(87, 102, 63, .15);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px -14px rgba(59, 58, 47, .35);
}

.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none;
  font-family: var(--font-body);
  font-size: 10.5px;
  letter-spacing: .02em;
  color: var(--ink-soft);
  padding: 7px 2px 5px;
  border-radius: 14px;
  cursor: pointer;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}

.tab svg { color: currentColor; }

.tab.active {
  color: var(--olive);
  font-weight: 600;
}

.tab.active svg { color: var(--lemon-deep); stroke-width: 2.1; }

.tab.active span { position: relative; }
.tab.active span::after {
  content: "";
  position: absolute; left: 50%; bottom: -4px;
  transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--terracotta);
}

/* ---------- Списки ---------- */

.list-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper);
  border: 1px solid rgba(87, 102, 63, .13);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-s);
  cursor: pointer;
  transition: transform .12s ease;
}

.list-item:active { transform: scale(.985); }

.list-item .li-main { flex: 1; min-width: 0; }

.list-item .li-title {
  font-size: 15px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.list-item .li-sub {
  font-size: 12px; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.list-item .li-end { text-align: right; flex: none; }

.avatar {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 17px;
  color: var(--olive);
  background: var(--lemon-soft);
  border: 1.5px solid var(--lemon-deep);
}

.avatar.sage  { background: var(--sage-soft);  border-color: var(--sage); }
.avatar.terra { background: var(--terra-soft); border-color: var(--terracotta); color: var(--terracotta); }

/* ---------- Чипы и бейджи ---------- */

.chip-row {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(87, 102, 63, .25);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}

.chip.active {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--paper);
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--olive);
}

.badge.lemon { background: var(--lemon-soft); color: #8a6d10; }
.badge.terra { background: var(--terra-soft); color: var(--terracotta); }
.badge.gray  { background: #EEEADB; color: var(--ink-soft); }

/* ---------- Формы ---------- */

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid rgba(87, 102, 63, .25);
  border-radius: var(--radius-s);
  padding: 11px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}

.field textarea { resize: vertical; min-height: 70px; }

.field input[type="range"] {
  border: none;
  background: transparent;
  padding: 0;
  height: 34px;
  accent-color: var(--lemon-deep);
}

.field input[type="range"]:focus { box-shadow: none; }

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--lemon-deep);
  box-shadow: 0 0 0 3px rgba(249, 222, 107, .4);
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2357663F' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

/* сегментированный выбор */
.seg {
  display: flex; gap: 6px;
  background: var(--cream);
  border: 1.5px solid rgba(87, 102, 63, .2);
  border-radius: 999px;
  padding: 4px;
}

.seg button {
  flex: 1;
  font-family: var(--font-body);
  font-size: 13.5px;
  border: none; background: none;
  padding: 8px 6px;
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}

.seg button.active {
  background: var(--lemon);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 2px 8px -2px rgba(227, 185, 46, .55);
}

/* ---------- Поиск ---------- */

.search-wrap { position: relative; margin-bottom: 12px; }

.search-wrap svg {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linecap: round;
}

.search-wrap input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--paper);
  border: 1.5px solid rgba(87, 102, 63, .2);
  border-radius: 999px;
  padding: 11px 16px 11px 40px;
  outline: none;
}

.search-wrap input:focus { border-color: var(--lemon-deep); }

/* ---------- Бюджет ---------- */

.budget-ring-card {
  display: flex; align-items: center; gap: 18px;
}

.ring { position: relative; width: 110px; height: 110px; flex: none; }

.ring svg { transform: rotate(-90deg); }

.ring .track { fill: none; stroke: var(--sage-soft); stroke-width: 10; }
.ring .val   {
  fill: none; stroke: var(--lemon-deep); stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset .6s ease;
}
.ring.over .val { stroke: var(--terracotta); }

.ring .ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

.ring .ring-label b { font-family: var(--font-display); font-size: 24px; color: var(--olive); }
.ring .ring-label span { font-size: 10px; color: var(--ink-soft); }

.budget-cat { margin-bottom: 10px; }

.budget-cat .cat-head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 6px;
}

.budget-cat .cat-head h3 {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600;
  flex: 1;
}

.budget-cat .cat-head .sum { font-size: 13px; color: var(--ink-soft); }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Рассадка ---------- */

.hall-wrap {
  background: var(--paper);
  border: 1px solid rgba(87, 102, 63, .16);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  padding: 10px;
  margin-bottom: 12px;
}

.hall-svg {
  display: block;
  width: 100%;
  touch-action: none;
  border-radius: 10px;
  background:
    linear-gradient(rgba(191, 217, 211, .16), rgba(191, 217, 211, .16)),
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(87,102,63,.06) 24px 25px),
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(87,102,63,.06) 24px 25px),
    var(--cream);
}

.hall-svg .hall-border { fill: none; stroke: var(--sage); stroke-width: 2; stroke-dasharray: 7 5; }

.hall-svg .table-shape {
  fill: var(--lemon-soft);
  stroke: var(--lemon-deep);
  stroke-width: 2;
  cursor: grab;
}

.hall-svg g.dragging .table-shape { stroke: var(--terracotta); fill: var(--terra-soft); }

.hall-svg .table-label {
  font-family: var(--font-display);
  font-weight: 700;
  fill: var(--ink);
  text-anchor: middle;
  pointer-events: none;
}

.hall-svg .table-name {
  font-family: var(--font-body);
  font-weight: 600;
  fill: var(--olive);
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 0.09px;
  stroke-linejoin: round;
}

.hall-svg .seat { fill: var(--paper); stroke: var(--sage); stroke-width: 1.5; pointer-events: none; }
.hall-svg .seat.taken { fill: var(--sage); }
.hall-svg .seat.conflict { fill: var(--terracotta); stroke: var(--danger); }

.seat-assign-row.blocked { opacity: .55; }
.seat-assign-row.blocked .seat-num { background: #EEEADB; border-color: rgba(87,102,63,.3); }
.seat-assign-row .badge { flex: none; }
.hall-svg .seat-initial {
  font-family: var(--font-body);
  font-weight: 600;
  fill: var(--paper);
  text-anchor: middle;
  pointer-events: none;
}

.hall-svg .rotate-handle { cursor: grab; }
.hall-svg .rotate-handle .knob {
  fill: var(--paper);
  stroke: var(--terracotta);
  stroke-width: 1.6;
}
.hall-svg .rotate-handle text {
  fill: var(--terracotta);
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
}
.hall-svg g.dragging .rotate-handle .knob { fill: var(--terra-soft); }

.hall-hint {
  font-size: 11.5px; color: var(--ink-soft);
  text-align: center; font-style: italic;
  margin-top: 6px;
}

.seat-assign-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(87, 102, 63, .2);
}

.seat-assign-row:last-child { border-bottom: none; }

.seat-assign-row .seat-num {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--lemon-soft);
  border: 1.5px solid var(--lemon-deep);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 14px;
}

.seat-assign-row select {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
  border: 1.5px solid rgba(87,102,63,.22);
  border-radius: 10px;
  background: var(--cream);
  padding: 8px 10px;
  appearance: none;
}

/* соседи по столу в карточке гостя */
.neighbors {
  display: flex; align-items: stretch; gap: 8px;
  background: var(--cream);
  border: 1.5px dashed rgba(87, 102, 63, .3);
  border-radius: var(--radius-s);
  padding: 12px 10px 10px;
}

.nb { flex: 1; min-width: 0; text-align: center; }

.nb-avatar {
  width: 40px; height: 40px;
  margin: 0 auto 5px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 16px;
  color: var(--olive);
  background: var(--sage-soft);
  border: 1.5px solid var(--sage);
}

.nb-avatar.empty {
  background: var(--paper);
  border-style: dashed;
  color: var(--ink-soft);
}

.nb.me .nb-avatar {
  background: var(--lemon);
  border-color: var(--lemon-deep);
  color: var(--ink);
}

.nb-name {
  font-size: 12.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nb.me .nb-name { color: var(--olive); font-weight: 600; }

.nb-side {
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 1px;
}

.nb-hint {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-style: italic;
  text-align: center;
  margin-top: 6px;
}

/* ---------- Меню ---------- */

.menu-course { margin-bottom: 4px; }

.menu-course-head {
  text-align: center;
  margin: 20px 0 4px;
}

.menu-course-head h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 24px;
  color: var(--olive);
}

.menu-course-head p {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.dish {
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 4px;
  border-bottom: 1px dotted rgba(87, 102, 63, .3);
  cursor: pointer;
}

.dish:last-child { border-bottom: none; }

.dish .dish-name { font-size: 15.5px; font-weight: 500; }
.dish .dish-desc { font-size: 12.5px; color: var(--ink-soft); font-style: italic; }
.dish .dish-tags { margin-left: auto; flex: none; display: flex; gap: 4px; }

/* ---------- Чек-лист ---------- */

.check-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px dashed rgba(87, 102, 63, .2);
  cursor: pointer;
}

.check-item:last-child { border-bottom: none; }

.check-box {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.8px solid var(--sage);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}

.check-box svg {
  width: 14px; height: 14px;
  fill: none; stroke: var(--paper); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: scale(.4);
  transition: all .2s;
}

.check-item.done .check-box {
  background: var(--olive);
  border-color: var(--olive);
}

.check-item.done .check-box svg { opacity: 1; transform: none; }

.check-item .check-text { flex: 1; font-size: 15px; transition: color .2s; }
.check-item.done .check-text { color: var(--ink-soft); text-decoration: line-through; }

/* ---------- Пустые состояния ---------- */

.empty {
  text-align: center;
  padding: 34px 20px;
}

.empty .empty-lemon {
  width: 90px; height: 90px;
  margin: 0 auto 12px;
  animation: sway 4s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(4deg); }
}

.empty h3 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600;
  margin-bottom: 4px;
}

.empty p { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 16px; }

/* ---------- Bottom sheet ---------- */

.sheet-backdrop[hidden] { display: none; }

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(59, 58, 47, .45);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .2s ease;
}

@keyframes fade-in { from { opacity: 0; } }

.sheet {
  width: 100%; max-width: 480px;
  max-height: 88dvh;
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  display: flex; flex-direction: column;
  animation: sheet-up .3s cubic-bezier(.2, .9, .3, 1);
  border-top: 4px solid var(--lemon);
}

@keyframes sheet-up { from { transform: translateY(60%); opacity: .4; } }

.sheet-handle {
  width: 44px; height: 4px;
  border-radius: 99px;
  background: rgba(87, 102, 63, .25);
  margin: 10px auto 2px;
}

.sheet-head {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 18px 10px;
}

.sheet-head h2 {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
}

.sheet-body {
  overflow-y: auto;
  padding: 4px 18px calc(24px + env(safe-area-inset-bottom));
}

.sheet-actions {
  display: flex; gap: 10px;
  margin-top: 18px;
}

.sheet-actions .btn { flex: 1; }

/* ---------- Экран входа ---------- */

/* пока не решили «кабинет или вход» — каркас приложения скрыт,
   чтобы интерфейс не мелькал перед экраном входа */
body.booting .topbar,
body.booting #main,
body.booting .tabbar { visibility: hidden; }

/* плавное появление кабинета (срабатывает при снятии .booting) */
body:not(.booting) .topbar,
body:not(.booting) #main,
body:not(.booting) .tabbar {
  animation: app-blur-in .55s ease both;
}

@keyframes app-blur-in {
  from { opacity: 0; filter: blur(9px); }
  to   { opacity: 1; filter: blur(0); }
}

#auth-screen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
  background-image: radial-gradient(rgba(87, 102, 63, .035) 1px, transparent 1px);
  background-size: 7px 7px;
  padding: 24px 18px;
  animation: app-blur-in .45s ease both;
  transition: opacity .45s ease, filter .45s ease, transform .45s ease;
}

/* уход экрана входа в кабинет — blur-out */
#auth-screen.leaving {
  opacity: 0;
  filter: blur(10px);
  transform: scale(1.04);
  pointer-events: none;
}

.auth-card {
  width: 100%; max-width: 360px;
  background: var(--paper);
  border: 1px solid rgba(87, 102, 63, .16);
  border-radius: 24px;
  border-top: 5px solid var(--lemon);
  box-shadow: var(--shadow);
  padding: 30px 24px 24px;
  text-align: center;
  animation: card-blur-in .4s ease backwards;
  transition: opacity .23s ease, filter .23s ease, transform .23s ease;
}

@keyframes card-blur-in {
  from { opacity: 0; filter: blur(8px); transform: translateY(14px); }
  to   { opacity: 1; filter: blur(0);  transform: none; }
}

/* смена карточки (вход ⇄ регистрация) */
.auth-card.card-out {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(-10px) scale(.98);
  pointer-events: none;
}

/* кнопки на карточке входа не должны слипаться */
.auth-card > .btn-block { margin-top: 12px; }
.auth-card form .btn-block { margin-top: 8px; }
.auth-card .auth-hint { margin-bottom: 12px; }

.auth-privacy {
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-top: 14px;
}

.auth-privacy a { color: var(--olive); text-underline-offset: 2px; }

.auth-card .auth-lemon {
  width: 74px; height: 74px;
  margin: 0 auto 8px;
  animation: sway 4s ease-in-out infinite;
  transform-origin: top center;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  letter-spacing: .02em;
}

.auth-card .auth-sub {
  font-size: 13.5px;
  font-style: italic;
  color: var(--ink-soft);
  margin: 4px 0 20px;
}

.auth-card form { text-align: left; }

.auth-error {
  color: var(--danger);
  font-size: 13.5px;
  margin: -4px 0 12px;
  text-align: center;
}

.auth-hint {
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
  margin: -2px 0 12px;
  line-height: 1.45;
}

.auth-link {
  display: block;
  width: 100%;
  background: none; border: none;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--olive);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 12px 0 2px;
}

.code-input {
  text-align: center;
  font-family: var(--font-display);
  font-size: 30px !important;
  font-weight: 700;
  letter-spacing: .5em;
  padding-left: .5em !important;
}

/* поле пароля с глазком «показать/скрыть» */
.pw-wrap { position: relative; }

.pw-wrap input { padding-right: 46px; }

.pw-toggle {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; padding: 0;
  color: var(--ink-soft);
  cursor: pointer;
}

.pw-toggle svg {
  width: 21px; height: 21px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.pw-toggle .eye-off { display: none; }
.pw-toggle.on .eye { display: none; }
.pw-toggle.on .eye-off { display: block; }
.pw-toggle.on { color: var(--olive); }

/* ---------- Сплеш при загрузке ---------- */

#splash {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
  background-image: radial-gradient(rgba(87, 102, 63, .035) 1px, transparent 1px);
  background-size: 7px 7px;
  transition: opacity .55s ease, filter .55s ease, transform .55s ease;
}

#splash.leaving {
  opacity: 0;
  filter: blur(10px);
  transform: scale(1.05);
  pointer-events: none;
}

.splash-inner { text-align: center; }

.splash-lemon {
  width: 96px; height: 96px;
  margin: 0 auto 4px;
  transform-origin: top center;
  filter: drop-shadow(0 8px 10px rgba(87, 102, 63, .18));
  animation: card-blur-in .6s ease backwards, sway 4s ease-in-out .6s infinite;
}

.splash-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 44px;
  letter-spacing: .02em;
  animation: card-blur-in .6s ease .18s backwards;
}

.splash-greet {
  font-size: 15.5px;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 8px;
  opacity: 0;
  filter: blur(6px);
  transform: translateY(8px);
  transition: opacity .5s ease, filter .5s ease, transform .5s ease;
}

#splash.greet .splash-greet {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

/* ---------- Аккаунт ---------- */

.account-card { display: flex; align-items: center; gap: 14px; }

.account-avatar {
  width: 52px; height: 52px;
  font-size: 24px;
}

/* ---------- Инструкция «на экран Домой» ---------- */

.install-steps { display: flex; flex-direction: column; gap: 10px; }

.install-step {
  display: flex; align-items: center; gap: 12px;
  background: var(--cream);
  border: 1px solid rgba(87, 102, 63, .16);
  border-radius: var(--radius-s);
  padding: 12px 14px;
}

.install-ico {
  flex: none;
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--paper);
  border: 1.5px solid var(--sage);
  display: flex; align-items: center; justify-content: center;
  color: var(--olive);
}

.install-ico svg { width: 24px; height: 24px; }
.install-ico.install-lemon { border-color: var(--lemon-deep); background: var(--lemon-soft); }
.install-ico.install-lemon svg { width: 36px; height: 36px; }

.install-text b { display: block; font-size: 14.5px; font-weight: 600; }
.install-text span { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Toast ---------- */

#toast {
  position: fixed;
  left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 80;
  background: var(--ink);
  color: var(--cream);
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: toast-in .25s ease;
  max-width: 90%;
  text-align: center;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
}

/* ---------- Мелочи ---------- */

.muted { color: var(--ink-soft); font-size: 13px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }

.link-rows .list-item { box-shadow: none; }

.confirm-text { font-size: 15px; margin: 6px 0 4px; line-height: 1.45; }

@media (min-width: 520px) {
  #main { padding-left: 22px; padding-right: 22px; }
}

/* ---------- Компьютерная адаптация ----------
   широкий экран: рамка приложения растёт, нижние вкладки
   превращаются в боковую панель слева */

@media (min-width: 960px) {
  #app {
    max-width: 1040px;
    display: grid;
    grid-template-columns: 232px 1fr;
    grid-template-rows: auto 1fr;
  }

  .topbar { grid-column: 1 / -1; grid-row: 1; }

  .tabbar {
    position: static;
    transform: none;
    width: auto; max-width: none;
    grid-column: 1; grid-row: 2;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 4px;
    padding: 22px 14px;
    border-top: none;
    border-right: 1px solid rgba(87, 102, 63, .14);
    box-shadow: none;
    background: var(--paper);
  }

  .tab {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    font-size: 14.5px;
    padding: 11px 16px;
    border-radius: 12px;
    transition: background .15s, color .15s;
  }

  .tab svg { width: 21px; height: 21px; }
  .tab:hover { background: var(--cream); }
  .tab.active { background: var(--lemon-soft); }
  .tab.active span::after { display: none; }

  #main {
    grid-column: 2; grid-row: 2;
    padding: 28px 36px 60px;
  }

  #main .view { max-width: 760px; margin: 0 auto; }

  .stat-grid { grid-template-columns: repeat(4, 1fr); }

  .fab-row { bottom: 24px; }

  /* модальные листы по центру, а не снизу */
  .sheet-backdrop { align-items: center; padding: 32px; }
  .sheet {
    border-radius: 24px;
    max-height: 84dvh;
    animation: sheet-pop .3s cubic-bezier(.2, .9, .3, 1);
  }
  .sheet-handle { display: none; }

  #toast { bottom: 40px; }
}

@keyframes sheet-pop {
  from { transform: translateY(26px) scale(.97); opacity: 0; }
}
