/* Общая основа витрины и админки: светлая тёплая палитра, шрифты, кнопки, поля, панели, уведомления. */
:root {
  color-scheme: light;
  --bg: #f7f2ea;
  --bg-2: #efe7dc;
  --paper: #fffcf7;
  --ink: #2b231d;
  --ink-2: #4b4038;
  --muted: #84766a;
  --faint: #ad9f91;
  --line: #e7ddcf;
  --line-2: #d9cbb8;
  --accent: #a4603a;
  --accent-2: #c0835a;
  --accent-ink: #fffaf4;
  --accent-soft: #f4e5d6;
  --ok: #557a52;
  --ok-soft: #e4ede0;
  --wait: #9a6d1c;
  --wait-soft: #f7ecd3;
  --moved: #4f6a8a;
  --moved-soft: #e3e9f1;
  --err: #b0462f;
  --err-soft: #f7e1da;
  --r-lg: 26px;
  --r: 18px;
  --r-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(74, 52, 30, .06), 0 4px 14px rgba(74, 52, 30, .05);
  --shadow: 0 2px 6px rgba(74, 52, 30, .06), 0 24px 60px rgba(74, 52, 30, .12);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; scroll-behavior: smooth }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden }
body.is-locked { overflow: hidden }
img { display: block; max-width: 100% }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent }
button:disabled { cursor: not-allowed }
a { color: inherit }
[hidden] { display: none !important }
h1, h2, h3 { margin: 0; font-weight: 600 }
p { margin: 0 }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }

.muted { color: var(--muted) }
.center { text-align: center }

.demo-bar { background: #efe2cf; color: #6e5233; font-size: 12.5px; font-weight: 600; padding: 7px 16px; text-align: center; letter-spacing: .01em }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; transition: transform .15s var(--ease), background .2s, border-color .2s, opacity .2s }
.btn:active:not(:disabled) { transform: scale(.97) }
.btn:disabled { opacity: .45 }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px rgba(164, 96, 58, .25) }
.btn--primary:hover:not(:disabled) { background: #93532f }
.btn--ghost { background: var(--paper); border-color: var(--line-2); color: var(--ink) }
.btn--ghost:hover:not(:disabled) { border-color: var(--accent-2) }
.btn--soft { background: var(--accent-soft); color: var(--accent) }
.btn--block { display: flex; width: 100%; height: 54px; font-size: 16px }
.btn--lg { height: 54px; padding: 0 28px; font-size: 16px }
.btn--sm { height: 38px; padding: 0 16px; font-size: 13.5px }
.btn.danger { color: var(--err); border-color: rgba(176, 70, 47, .3) }
.icon-btn { width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--bg-2); color: var(--muted); font-size: 24px; line-height: 1 }
.link { border: 0; background: none; color: var(--accent); font-weight: 700; padding: 6px 0 }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--paper); font-size: 13.5px; font-weight: 700; text-decoration: none; white-space: nowrap }

/* Статусы записи */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor }
.badge--wait { background: var(--wait-soft); color: var(--wait) }
.badge--ok { background: var(--ok-soft); color: var(--ok) }
.badge--moved { background: var(--moved-soft); color: var(--moved) }
.badge--off { background: var(--err-soft); color: var(--err) }

/* Поля */
.f { display: block; margin: 14px 0; font-size: 13px; font-weight: 700; color: var(--ink-2) }
.f__opt { font-weight: 500; color: var(--faint) }
.f input, .f select, .f textarea, .input {
  display: block; width: 100%; margin-top: 6px; padding: 13px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: 500 16px/1.3 var(--sans);
  transition: border-color .2s, box-shadow .2s
}
.f textarea { resize: vertical }
.f input:focus, .f select:focus, .f textarea:focus, .input:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft) }
.f input[aria-invalid=true] { border-color: var(--err) }
.hint { color: var(--muted); font-size: 13.5px; margin: 6px 0 }
.error { color: var(--err); font-size: 14px; font-weight: 600; margin: 4px 0 }
.error:empty { display: none }

/* Выезжающие панели: снизу на телефоне, по центру на компьютере */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(43, 35, 29, .38); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s }
.sheet.is-open { opacity: 1; visibility: visible }
.sheet__panel { position: relative; width: 100%; max-width: 640px; max-height: 94vh; overflow: auto; overscroll-behavior: contain; padding: 22px 18px calc(24px + env(safe-area-inset-bottom)); background: var(--paper); border-radius: 26px 26px 0 0; box-shadow: var(--shadow); transform: translateY(100%); transition: transform .45s var(--ease) }
.sheet.is-open .sheet__panel { transform: none }
.sheet__close { position: absolute; right: 12px; top: 12px; z-index: 2 }
.sheet h2 { font: 600 32px/1.1 var(--serif); margin: 0 52px 8px 0 }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 80; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .3s var(--ease) }
.toast.is-on { opacity: 1; transform: translate(-50%, 0) }

.fatal { padding: 14px 16px; background: var(--err-soft); color: var(--err); font-weight: 700; text-align: center }

@keyframes rise { from { transform: translateY(10px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes pop { from { transform: scale(.85); opacity: 0 } to { transform: none; opacity: 1 } }

@media (min-width: 900px) {
  .sheet { align-items: center }
  .sheet__panel { border-radius: 26px; max-height: 90vh; padding: 30px 32px; transform: translateY(24px) scale(.98) }
  .toast { bottom: 28px }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important }
}
