/* ---------- Lina · нежная палитра ---------- */
:root {
  --bg: #fbf6f2;
  --bg-2: #f6ece6;
  --surface: #ffffff;
  --blush: #f3e2dc;
  --blush-2: #ecd3cb;
  --rose: #d6a39c;
  --accent: #a6625c;
  --accent-ink: #ffffff;
  --ink: #3d2f2b;
  --ink-2: #6e5c57;
  --muted: #9a8782;
  --line: #ecdcd5;
  --sage: #8fa186;
  --sage-bg: #e8eee4;
  --gold: #c9a27a;
  --danger: #b5544c;
  --shadow-sm: 0 1px 2px rgba(89, 58, 50, .06), 0 2px 8px rgba(89, 58, 50, .05);
  --shadow: 0 2px 6px rgba(89, 58, 50, .05), 0 12px 32px rgba(89, 58, 50, .08);
  --shadow-lg: 0 24px 60px rgba(89, 58, 50, .18);
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 28px;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; margin: 0; line-height: 1.1; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.eyebrow {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); font-weight: 700;
}
.muted { color: var(--muted); }
.serif { font-family: var(--serif); }

/* ---------- buttons ---------- */
.btn {
  --h: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s, color .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent; user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px rgba(166, 98, 92, .32); }
.btn-primary:hover { background: #95544e; box-shadow: 0 12px 28px rgba(166, 98, 92, .38); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--blush-2); color: var(--muted); box-shadow: none; cursor: not-allowed; transform: none; }
.btn-soft { background: var(--blush); color: var(--ink); }
.btn-soft:hover { background: var(--blush-2); }
.btn-ghost { background: rgba(255, 255, 255, .7); color: var(--ink); border-color: var(--line); backdrop-filter: blur(10px); }
.btn-ghost:hover { background: #fff; border-color: var(--rose); }
.btn-light { background: rgba(255, 255, 255, .92); color: var(--ink); }
.btn-light:hover { background: #fff; }
.btn-danger { background: transparent; color: var(--danger); border-color: #efc9c4; }
.btn-danger:hover { background: #fbeceb; }
.btn-sm { --h: 38px; padding: 0 16px; font-size: 13.5px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; transition: background .2s, transform .2s var(--ease); color: var(--ink); flex: none;
}
.icon-btn:hover { background: var(--blush); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .2s var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--rose); color: var(--ink); }
.chip[aria-pressed="true"], .chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--blush); color: var(--accent); white-space: nowrap;
}
.pill svg { width: 13px; height: 13px; flex: none; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.s-new { background: #fbeee2; color: #a8692c; }
.pill.s-confirmed { background: var(--sage-bg); color: #56694d; }
.pill.s-done { background: #eae6f3; color: #6c5c95; }
.pill.s-editing { background: #f6e6ef; color: #9c4a75; }
.pill.s-delivered { background: #e3eef0; color: #3a6d78; }
.pill.s-cancelled { background: #f1ecea; color: #8d7a75; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.input, .textarea, .select {
  width: 100%; min-height: 50px; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); transition: border-color .2s, box-shadow .2s; font-size: 16px; outline: none;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(214, 163, 156, .22); }
.input::placeholder, .textarea::placeholder { color: #bcaaa4; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239a8782' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .form-grid.two { grid-template-columns: 1fr; } }

.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-sm); border: 1px solid rgba(236, 220, 213, .7); }

/* ---------- calendar ---------- */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-family: var(--serif); font-size: 24px; text-transform: capitalize; }
.cal-nav { display: flex; gap: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; padding: 4px 0 8px; }
.cal-day {
  position: relative; aspect-ratio: 1; border-radius: 14px; border: 0; background: transparent; cursor: pointer;
  font-weight: 600; font-size: 15px; color: var(--ink); display: grid; place-items: center; transition: background .2s, transform .15s, color .2s;
}
.cal-day.empty { visibility: hidden; }
.cal-day:disabled { color: #cdbdb8; cursor: default; }
.cal-day.free { background: var(--blush); }
.cal-day.free::after { content: ''; position: absolute; bottom: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.cal-day.free:hover { background: var(--blush-2); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--rose); }
.cal-day.selected { background: var(--ink) !important; color: #fff; transform: scale(1.04); }
.cal-day.selected::after { background: #fff; }
.cal-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot {
  height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer;
  transition: all .2s var(--ease);
}
.slot:hover { border-color: var(--rose); }
.slot[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- sheet / modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(48, 32, 28, .38); backdrop-filter: blur(6px); z-index: 80;
  opacity: 0; transition: opacity .3s var(--ease); display: flex; align-items: flex-end; justify-content: center;
}
.overlay.open { opacity: 1; }
.sheet {
  width: min(640px, 100%); max-height: min(92vh, 900px); max-height: min(92dvh, 900px); background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateY(40px); transition: transform .4s var(--ease);
  overflow: hidden;
}
.overlay.open .sheet { transform: none; }
@media (min-width: 720px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { border-radius: var(--r-lg); max-height: 88vh; }
}
.sheet-head { padding: 14px 20px 10px; display: flex; align-items: center; gap: 12px; }
.sheet-head h2 { font-size: 26px; flex: 1; }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--blush-2); margin: 8px auto 0; }
.sheet-body { padding: 4px 20px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.sheet-foot { padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); background: rgba(251, 246, 242, .96); display: flex; gap: 10px; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 16px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px;
  animation: toast-in .4s var(--ease); pointer-events: auto;
}
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(28, 20, 18, .94); display: flex; flex-direction: column; animation: fade .3s var(--ease); }
.lightbox-img { flex: 1; display: grid; place-items: center; padding: 56px 12px 12px; min-height: 0; touch-action: pan-y; }
.lightbox-img img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 6px; animation: zoom-in .35s var(--ease); }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px calc(14px + var(--safe-b)); color: #fff; }
.lightbox .icon-btn { background: rgba(255, 255, 255, .12); border-color: transparent; color: #fff; }
.lightbox .close { position: absolute; top: 14px; right: 14px; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox .nav.prev { left: 14px; }
.lightbox .nav.next { right: 14px; }
@media (max-width: 640px) { .lightbox .nav { display: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.97); } }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--blush-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--blush) 0%, #f8ede8 50%, var(--blush) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.map { height: 240px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); z-index: 0; }
