:root {
  --bg: #f4f0ea;
  --surface: #ffffff;
  --ink: #1d1a17;
  --muted: #7a726a;
  --line: #e6dfd5;
  --accent: #b5462a;
  --accent-ink: #ffffff;
  --accent-soft: #f6e3dc;
  --ok: #2f7d4f;
  --danger: #b42318;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(30, 20, 10, .06), 0 8px 24px rgba(30, 20, 10, .08);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }

.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 28px; height: 22px; position: relative; display: inline-block;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 50%;
  background: var(--accent); border-radius: 3px 1px 1px 3px;
}
.brand-mark::before { left: 0; transform: skewY(6deg); transform-origin: right; }
.brand-mark::after { right: 0; background: #d98a6f; border-radius: 1px 3px 3px 1px; transform: skewY(-6deg); transform-origin: left; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; text-decoration: none;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: #cfc5b8; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #9e3b22; border-color: #9e3b22; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0, 0, 0, .05); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-icon { width: 44px; padding: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* поля */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 600; color: var(--muted); }
.input {
  min-height: 48px; padding: 0 14px; width: 100%;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* переключатель глянец/матовый */
.seg {
  display: inline-flex; padding: 3px; border-radius: 12px;
  background: rgba(0, 0, 0, .06); gap: 2px;
}
.seg button {
  border: 0; background: transparent; border-radius: 9px;
  padding: 6px 12px; font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--muted); min-height: 32px;
}
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* уведомления */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1d1a17; color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 15px; transition: opacity .2s, transform .2s; z-index: 100;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* модальное окно */
.modal-back {
  position: fixed; inset: 0; background: rgba(20, 15, 10, .45);
  display: none; align-items: center; justify-content: center; padding: 16px; z-index: 90;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 20px; padding: 24px;
  width: 100%; max-width: 420px; box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 16px; font-family: var(--serif); font-size: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
