:root {
  --bg: #faf7f6;
  --surface: #ffffff;
  --ink: #43383d;
  --ink-soft: #6f6368;
  --muted: #9a8f94;
  --line: #ede6e6;
  --line-strong: #ddd2d3;
  --rose: #f3e7e6;
  --rose-ink: #8c5b60;
  --sage: #e7efe6;
  --sage-ink: #4b684d;
  --sky: #e6eef4;
  --sky-ink: #43637a;
  --sand: #f7eedc;
  --sand-ink: #85621f;
  --danger: #f8e6e5;
  --danger-ink: #9a3e3e;
  --button: #4b3e44;
  --button-hover: #5e4f56;
  --radius: 12px;
  --radius-sm: 6px;
  --display: "Bodoni Moda", Didot, Georgia, serif;
  --body: "Jost", "Avenir Next", "Segoe UI", sans-serif;
  --page: min(1180px, 100% - clamp(32px, 8vw, 80px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 500;
  line-height: 1.2;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--rose-ink);
  outline-offset: 2px;
}

.page-title {
  font-family: var(--display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--button);
  border-radius: var(--radius-sm);
  background: var(--button);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.button:hover {
  background: var(--button-hover);
}

.button:active {
  transform: scale(0.98);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.button-wide {
  width: 100%;
}

.button-quiet {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button-quiet:hover {
  background: var(--bg);
}

.button-danger {
  border-color: #e9cecd;
  background: var(--surface);
  color: var(--danger-ink);
}

.button-danger:hover {
  background: var(--danger);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
}

.icon-button:hover {
  background: var(--rose);
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--rose-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button .icon {
  width: 18px;
  height: 18px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.field > span {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.field em {
  color: var(--muted);
  font-style: normal;
}

.input,
.field input:not([type="checkbox"], [type="radio"], [type="file"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s ease;
}

.field textarea {
  resize: vertical;
}

.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--rose-ink);
  outline: none;
}

.field input[type="file"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.field input[type="file"]::file-selector-button {
  min-height: 44px;
  margin-right: 12px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 4px;
  cursor: pointer;
}

.check input,
.choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--rose-ink);
}

.panel {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel > h2 {
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--rose);
  color: var(--rose-ink);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge-amber {
  background: var(--sand);
  color: var(--sand-ink);
}

.badge-blue {
  background: var(--sky);
  color: var(--sky-ink);
}

.badge-green {
  background: var(--sage);
  color: var(--sage-ink);
}

.badge-red {
  background: var(--danger);
  color: var(--danger-ink);
}

.badge-muted {
  background: #efeaea;
  color: var(--ink-soft);
}

.hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.center {
  text-align: center;
}

.sub {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.empty-note {
  color: var(--muted);
}

.form-error,
.field-error {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger);
  color: var(--danger-ink);
  font-size: 0.92rem;
}

.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

.flash-success {
  background: var(--sage);
  color: var(--sage-ink);
}

.flash-error {
  background: var(--danger);
  color: var(--danger-ink);
}

.totals,
.details {
  display: grid;
  gap: 8px;
  margin: 0;
}

.totals > div,
.details > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.totals {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.totals dt,
.details dt {
  color: var(--ink-soft);
}

.totals dd,
.details dd {
  margin: 0;
  text-align: right;
}

.totals .grand {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 1.15rem;
  font-weight: 500;
}

.totals .grand dt {
  color: var(--ink);
}

.details {
  margin-top: 18px;
}

.map {
  height: 300px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  z-index: 0;
}

.map-pin {
  color: var(--rose-ink);
  filter: drop-shadow(0 2px 2px rgba(67, 56, 61, 0.25));
}

.map-pin .icon {
  width: 34px;
  height: 34px;
}

.map-pin-shop {
  color: var(--sage-ink);
}

.leaflet-container {
  font-family: var(--body);
}

.leaflet-touch .leaflet-bar a {
  width: 40px;
  height: 40px;
  line-height: 40px;
}

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

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