/* ============================================================
   Салон краси — Mini App. Тепла пудрова тема з золотим акцентом.
   ============================================================ */

:root {
  --rose-900: #4a2434;
  --rose-700: #a04a63;
  --rose-600: #c25f7c;
  --rose-500: #d97b95;
  --rose-300: #f0b7c6;
  --rose-100: #fbe4ea;
  --rose-050: #fdf2f5;

  --gold: #c39b59;
  --gold-soft: #f3e5cd;

  --bg: #fdf7f5;
  --bg-soft: #f8ebe8;
  --surface: #ffffff;
  --surface-2: #fffafb;

  --text: #35202a;
  --text-muted: #8a7079;
  --text-soft: #b3a0a7;

  --border: #f3e3e7;
  --border-strong: #e7cfd6;

  --danger: #d9506e;
  --danger-bg: #ffe8ee;
  --warn: #c98130;
  --warn-bg: #fff2e2;
  --success: #3f9e7c;
  --success-bg: #e3f5ee;
  --info: #7b6bd6;
  --info-bg: #eceaff;

  --radius-lg: 24px;
  --radius: 18px;
  --radius-sm: 12px;

  --shadow-sm: 0 2px 10px rgba(146, 84, 104, 0.07);
  --shadow: 0 10px 30px rgba(146, 84, 104, 0.12);
  --shadow-lg: 0 -12px 44px rgba(74, 36, 52, 0.22);

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1318;
    --bg-soft: #281a20;
    --surface: #271a20;
    --surface-2: #2e1f26;

    --text: #f8edf0;
    --text-muted: #c3a7b0;
    --text-soft: #9a8189;

    --border: #3a2830;
    --border-strong: #4a333c;

    --rose-100: #472d38;
    --rose-050: #33222a;
    --gold-soft: #4a3a24;

    --danger-bg: #4a2130;
    --warn-bg: #46331f;
    --success-bg: #1e4034;
    --info-bg: #2f2a55;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

button,
.tabbar,
.segmented,
.chips,
.header,
.group__head { -webkit-user-select: none; user-select: none; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background:
    radial-gradient(1100px 420px at 100% -10%, rgba(217, 123, 149, 0.16), transparent 60%),
    radial-gradient(900px 380px at -10% 0%, rgba(195, 155, 89, 0.14), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

.hidden { display: none !important; }

a { color: var(--rose-700); }

/* ------------------------------------------------- splash / demo / denied */

.splash,
.demo,
.denied {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: var(--bg);
  z-index: 90;
  overflow-y: auto;
}

.splash__logo,
.demo__logo {
  font-size: 40px;
  color: var(--rose-500);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}

.splash__text { color: var(--text-muted); }

.demo { justify-content: flex-start; padding-top: 42px; }

.demo__card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 18px;
  text-align: center;
}

.demo__title { margin: 6px 0 4px; font-size: 22px; }
.demo__text { margin: 0 0 18px; color: var(--text-muted); font-size: 14px; }
.demo__list { display: flex; flex-direction: column; gap: 8px; }
.demo #demoBack { margin-top: 12px; }

.demo__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.demo__item:active { transform: scale(0.98); border-color: var(--rose-300); }

.demo__avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--rose-100);
  color: var(--rose-700);
  font-weight: 600;
  font-size: 13px;
  flex: none;
}

.demo__info { display: flex; flex-direction: column; flex: 1; }
.demo__info span { font-size: 12px; color: var(--text-muted); }
.demo__go { color: var(--text-soft); }

.denied__icon { font-size: 40px; }
.denied__title { margin: 0; font-size: 20px; text-align: center; }
.denied__text,
.denied__id { margin: 0; color: var(--text-muted); text-align: center; font-size: 14px; }

/* ------------------------------------------------------------ каркас ---- */

.app { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px); }

.screen { padding: 0 16px; }
.screen__body { display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 14px;
}

.header__hint { margin: 0; font-size: 12px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.header__title { margin: 2px 0 0; font-size: 26px; font-weight: 650; letter-spacing: -0.02em; }

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--rose-300), var(--rose-500));
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  flex: none;
}

/* --------------------------------------------------------- перемикачі --- */

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: var(--bg-soft);
  border-radius: 14px;
}

.segmented__item {
  flex: 1;
  padding: 9px 6px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}

.segmented__item.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.chip.is-active { background: var(--rose-600); border-color: var(--rose-600); color: #fff; }

/* -------------------------------------------------------------- hero ---- */

.hero {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 20px;
  border: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--rose-600), var(--rose-700) 70%);
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
}

.hero--soft { background: linear-gradient(145deg, var(--rose-500), var(--rose-600)); }

.hero--empty {
  background: var(--surface);
  color: var(--text);
  border: 1px dashed var(--border-strong);
  box-shadow: none;
  cursor: default;
}

.hero__badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 12px;
  margin-bottom: 10px;
}

.hero--empty .hero__badge { background: var(--rose-100); color: var(--rose-700); }

.hero__title { margin: 0 0 8px; font-size: 20px; font-weight: 650; }
.hero__line { margin: 2px 0; font-size: 14px; opacity: 0.94; }
.hero__hint { display: block; margin-top: 12px; font-size: 12px; opacity: 0.7; }
.hero--empty .hero__line { color: var(--text-muted); }
.hero--empty .btn { margin-top: 14px; }

/* ------------------------------------------------------------- плитки --- */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.tile__value { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.tile__label { font-size: 11px; color: var(--text-muted); line-height: 1.25; }
.tile__hint { font-size: 10px; color: var(--text-soft); }

/* -------------------------------------------------------------- групи --- */

.group { display: flex; flex-direction: column; gap: 8px; }

.group__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.group__title { margin: 0; font-size: 15px; font-weight: 600; }
.group__count { font-size: 12px; color: var(--text-soft); }
.group__list { display: flex; flex-direction: column; gap: 8px; }
.group__empty { margin: 0; padding: 14px; text-align: center; color: var(--text-soft); font-size: 13px;
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius); }
.group__footer { margin: 0; font-size: 12px; color: var(--text-muted); text-align: right; }

/* ------------------------------------------------------------- картка --- */

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.card:active { transform: scale(0.99); }

.card--soon { border-color: var(--rose-300); background: var(--rose-050); }
.card--done { opacity: 0.86; }
.card--muted { opacity: 0.6; }

.card__time {
  flex: none;
  min-width: 52px;
  max-width: 82px;
  font-size: 13px;
  font-weight: 650;
  color: var(--rose-700);
  line-height: 1.2;
}

.card__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--rose-100);
  color: var(--rose-700);
  font-size: 12px;
  font-weight: 600;
}

.card__main { flex: 1; min-width: 0; }
.card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  /* Назви послуг довгі — краще два рядки, ніж обрізане слово. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__meta { font-size: 12px; color: var(--text-muted); }
.card__side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.card__price { font-size: 12px; color: var(--text-muted); }

/* ------------------------------------------------------------- бейджі --- */

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
}

.badge--new { background: var(--warn-bg); color: var(--warn); }
.badge--confirmed { background: var(--success-bg); color: var(--success); }
.badge--done { background: var(--bg-soft); color: var(--text-muted); }
.badge--cancelled { background: var(--danger-bg); color: var(--danger); }
.badge--no_show { background: var(--danger-bg); color: var(--danger); }

/* --------------------------------------------------------- крок запису -- */

.step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.step__title { margin: 0; font-size: 15px; font-weight: 600; }

.options { display: flex; flex-direction: column; gap: 8px; }

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.option:active { border-color: var(--rose-300); }
.option__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.option__hint { font-size: 12px; color: var(--text-muted); }
.option__masters { font-size: 11px; color: var(--text-soft); }
.option__side { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--text-muted); flex: none; }
.option__side b { font-size: 14px; color: var(--text); }

.summary-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.summary-row__label { font-size: 12px; color: var(--text-soft); min-width: 62px; }
.summary-row__value { flex: 1; font-size: 14px; font-weight: 550; }
.summary-row__change {
  border: 0;
  background: transparent;
  color: var(--rose-700);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
}

/* --------------------------------------------------------- дні та час --- */

.days,
.daynav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}

.days::-webkit-scrollbar,
.daynav::-webkit-scrollbar { display: none; }

.daynav { padding: 0 0 12px; }

.day {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 62px;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.day--sm { min-width: 50px; padding: 8px 6px; }
.day__weekday { font-size: 11px; color: var(--text-soft); text-transform: lowercase; }
.day__number { font-size: 17px; font-weight: 650; }
.day__slots { font-size: 10px; color: var(--rose-700); }

.day.is-active { background: var(--rose-600); border-color: var(--rose-600); color: #fff; }
.day.is-active .day__weekday,
.day.is-active .day__slots { color: rgba(255, 255, 255, 0.85); }
.day.is-disabled { opacity: 0.4; cursor: default; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }

.slot {
  padding: 12px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.slot span { font-size: 10px; font-weight: 400; color: var(--text-soft); }
.slot:active { background: var(--rose-600); color: #fff; border-color: var(--rose-600); }

/* -------------------------------------------------------------- чек ----- */

.receipt {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--rose-050);
  border: 1px solid var(--border);
}

.receipt__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.receipt__row span { color: var(--text-muted); }
.receipt__row b { text-align: right; }
.receipt__row--total { padding-top: 8px; border-top: 1px dashed var(--border-strong); font-size: 15px; }

.quote {
  padding: 12px 14px;
  border-left: 3px solid var(--rose-300);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2);
}

.quote span { font-size: 11px; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.quote p { margin: 4px 0 0; font-size: 14px; }
.quote--danger { border-left-color: var(--danger); }

/* ------------------------------------------------------------- форми ---- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field__label { font-size: 12px; color: var(--text-muted); }
.field__label i { color: var(--danger); font-style: normal; }
.field__hint { font-size: 11px; color: var(--text-soft); }

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.input:focus { outline: none; border-color: var(--rose-500); }
.input--area { resize: vertical; min-height: 64px; }
.input--time { padding: 10px; text-align: center; }

.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 34px; }
.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  pointer-events: none;
}

.form__error { margin: 0; color: var(--danger); font-size: 13px; }

.btn {
  padding: 13px 18px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-soft);
  color: var(--text);
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn--primary { background: linear-gradient(140deg, var(--rose-600), var(--rose-700)); color: #fff; }
.btn--ghost { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.btn--danger { background: var(--danger-bg); color: var(--danger); }
.btn--block { display: block; width: 100%; }

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 14px;
  cursor: pointer;
}

.switch input { width: 20px; height: 20px; accent-color: var(--rose-600); }
.switch span i { font-style: normal; color: var(--text-soft); font-size: 12px; }

.checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 46vh;
  overflow-y: auto;
  margin-bottom: 12px;
}

.hours { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.hours__row { display: grid; grid-template-columns: 38px 1fr 1fr; align-items: center; gap: 8px; }
.hours__day { font-size: 13px; color: var(--text-muted); }

.client-pick { position: relative; }
.client-results { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }

.client-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.client-result span { font-size: 11px; color: var(--text-muted); }

/* ------------------------------------------------------------- прайс ---- */

.price-list { display: flex; flex-direction: column; gap: 6px; }

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.price-row.is-off { opacity: 0.55; }
.price-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.price-row__main span { font-size: 11px; color: var(--text-muted); }
.price-row__price { font-weight: 650; color: var(--rose-700); white-space: nowrap; }

/* ------------------------------------------------------------ майстри --- */

.master-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.master-card.is-off { opacity: 0.6; }
.master-card__head { display: flex; align-items: center; gap: 12px; }
.master-card__emoji {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold-soft);
  font-size: 20px;
  flex: none;
}

.master-card__name { margin: 0; font-size: 16px; font-weight: 620; }
.master-card__title { margin: 0; font-size: 12px; color: var(--text-muted); }
.master-card__about { margin: 0; font-size: 13px; color: var(--text-muted); }
.master-card__schedule { margin: 0; font-size: 12px; color: var(--text-soft); }
.master-card__off { margin: 0; font-size: 12px; color: var(--warn); }
.master-card__services { display: flex; flex-wrap: wrap; gap: 6px; }
.master-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.master-card__actions .btn { flex: 1; min-width: 96px; font-size: 13px; padding: 10px 12px; }

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--rose-050);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

/* -------------------------------------------------------- статистика ---- */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 130px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.bar__fill { width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--rose-500), var(--rose-300)); }
.bar__label { font-size: 9px; color: var(--text-soft); }

.rank { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); }
.rank__row { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 10px; }
.rank__name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__bar { height: 8px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; }
.rank__bar i { display: block; height: 100%; background: var(--rose-500); }
.rank__value { font-size: 13px; font-weight: 600; text-align: right; }
.rank__value small { display: block; font-size: 10px; font-weight: 400; color: var(--text-soft); }

/* ------------------------------------------------------------ профіль --- */

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.profile__avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--rose-300), var(--rose-600));
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}

.profile__name { margin: 0; font-size: 18px; }
.profile__role { margin: 0; font-size: 13px; color: var(--text-muted); }
.profile__username { margin: 0; font-size: 12px; color: var(--text-soft); }

.contacts {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
}

.contacts p { margin: 2px 0; }
.contacts__hint { margin-top: 10px !important; color: var(--text-muted); font-size: 12px; }

.demo-note {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--gold-soft);
  border: 1px solid var(--border);
  font-size: 13px;
}

.demo-note p { margin: 0 0 10px; }

/* ------------------------------------------------------------ таббар ---- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  gap: 2px;
  padding: 8px 6px calc(8px + var(--safe-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  z-index: 40;
}

.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  cursor: pointer;
}

.tabbar__icon { font-size: 17px; line-height: 1; }
.tabbar__label { font-size: 10px; }
.tabbar__item.is-active { color: var(--rose-700); }

/* --------------------------------------------------------------- шторка - */

.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(53, 32, 42, 0.45); backdrop-filter: blur(2px); }

.sheet__panel {
  position: relative;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 10px 16px calc(24px + var(--safe-bottom));
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg);
  animation: slide-up 0.24s ease;
}

@keyframes slide-up { from { transform: translateY(14%); opacity: 0.6; } to { transform: none; opacity: 1; } }

.sheet__grabber {
  width: 42px;
  height: 4px;
  margin: 4px auto 12px;
  border-radius: 2px;
  background: var(--border-strong);
  cursor: pointer;
}

.sheet__content { display: flex; flex-direction: column; gap: 12px; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet__title { margin: 0; font-size: 19px; font-weight: 650; }
.sheet__subtitle { margin: 0; font-size: 14px; font-weight: 600; }
.sheet__hint { margin: 0; font-size: 12px; color: var(--text-muted); }
.sheet__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet__actions .btn { flex: 1; min-width: 130px; }

.notes { display: flex; flex-direction: column; gap: 8px; }
.notes__list { display: flex; flex-direction: column; gap: 6px; max-height: 34vh; overflow-y: auto; }
.notes__form { display: flex; gap: 8px; align-items: flex-end; }
.notes__form .btn { flex: none; padding: 12px 14px; }

.note { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.note--own { background: var(--rose-050); }
.note__head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-soft); }
.note__author { font-weight: 600; color: var(--text-muted); }
.note__text { margin: 4px 0 0; font-size: 13px; }

/* ------------------------------------------------------ дрібні деталі --- */

.empty { padding: 28px 16px; text-align: center; }
.empty__icon { font-size: 30px; margin-bottom: 8px; }
.empty__title { margin: 0; font-weight: 600; }
.empty__text { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }

.skeleton {
  height: 62px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--surface-2) 37%, var(--bg-soft) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: 14px;
  background: var(--rose-900);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow);
  z-index: 80;
  animation: slide-up 0.2s ease;
}

.toast--error { background: var(--danger); }

@media (min-width: 640px) {
  .app,
  .sheet__panel { max-width: 560px; margin: 0 auto; }
  .sheet__panel { border-radius: 26px; margin-bottom: 20px; }
  .sheet { align-items: center; justify-content: center; }
  .tabbar { max-width: 560px; margin: 0 auto; border-radius: 20px 20px 0 0; }
}
