:root {
  font-family: Inter, system-ui, sans-serif;
  color: #202632;
  background: #fff;
  --muted: #5b6475;
  --red: #b61425;
  --edge: #dbe0e7;
  --wash: #f0f2f4;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { background: var(--wash); border-bottom: 4px solid var(--red); }
.mast, main { width: min(100% - 28px, 800px); margin-inline: auto; }
.mast { padding: 16px 0; display: grid; gap: 8px; align-items: center; }
.mast img { width: 174px; height: auto; display: block; }
h1 { margin: 0; font-size: clamp(1.42rem, 4.4vw, 2rem); line-height: 1.15; letter-spacing: -.032em; }
main { padding: 18px 0 36px; }
section { border: 1px solid var(--edge); background: #fff; border-radius: 14px; padding: 15px; margin-bottom: 13px; }
h2 { font-size: 1.12rem; margin: 0 0 12px; }
.grid { display: grid; gap: 12px; }
label { display: grid; gap: 5px; font-size: .89rem; font-weight: 630; min-width: 0; }
label small, .hint { color: var(--muted); font-size: .82rem; line-height: 1.45; font-weight: 400; }
label small { overflow-wrap: anywhere; }
.hint { margin: 7px 0 0; }
#customs-title + .hint { margin: -5px 0 14px; }
input:not([type=checkbox]):not([type=radio]), select {
  width: 100%; min-width: 0; height: 46px; border: 1px solid #bfc8d4; border-radius: 8px; background: #fff;
  padding: 9px 10px; color: inherit; font: inherit; font-size: 16px;
}
input[type=date] { display: block; appearance: none; }
fieldset { border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
legend { font-size: .89rem; font-weight: 630; margin-bottom: 6px; padding: 0; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choices label { position: relative; cursor: pointer; }
.choices label span { display: grid; place-items: center; text-align: center; min-height: 45px; padding: 6px; border: 1px solid #bfc8d4; border-radius: 8px; }
.choices input, .visually-hidden { position: absolute; width: 1px !important; height: 1px !important; opacity: 0; padding: 0 !important; overflow: hidden; clip-path: inset(50%); }
.choices input:checked + span { background: #fff3f4; border-color: var(--red); color: #9f1020; box-shadow: inset 0 0 0 1px var(--red); }
input:focus-visible, select:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible,
.choices input:focus-visible + span, .upload-label:has(+ input:focus-visible) { outline: 2px solid #2058bd; outline-offset: 3px; }
#city-field, .age-grid { margin-top: 12px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.check input { flex: none; width: 18px; height: 18px; accent-color: var(--red); }
details { margin-top: 10px; font-size: .87rem; }
summary { cursor: pointer; width: fit-content; min-height: 32px; padding-top: 5px; font-weight: 650; }
details label { padding-top: 7px; }
.rows { margin: 0; }.rows div { display: flex; justify-content: space-between; gap: 10px; min-height: 26px; padding-block: 3px; }
.rows dd { margin: 0; white-space: nowrap; }
button, .primary, .secondary, .upload-label { font: inherit; border: 1px solid #bbc4d0; border-radius: 8px; padding: 10px 13px; min-height: 45px; cursor: pointer; font-weight: 680; color: inherit; background: #fff; text-decoration: none; display: inline-grid; place-items: center; }
.upload-label { width: fit-content; font-size: .89rem; }
.photo-item { display: flex; margin-top: 8px; gap: 10px; align-items: center; }
.photo-item img { width: min(105px, 42%); height: 72px; object-fit: contain; background: var(--wash); border-radius: 6px; }
.quiet { padding-inline: 9px; }
.gift-default { font-size: .87rem; margin: 13px 0 0; }
#gift-fields { display: grid; gap: 9px; }
#actions { margin-bottom: 14px; }
.primary { background: var(--red); color: #fff; border-color: var(--red); } .primary:hover { background: #9f1221; }
#submit { width: 100%; }
button:disabled { opacity: .7; cursor: wait; }
#message { margin: 10px 0 0; padding: 10px; background: var(--wash); border-radius: 8px; font-size: .9rem; }
#message.error { color: #8e1223; background: #fff1f2; }
#result { background: #f8fafb; scroll-margin-top: 12px; }
#total { font-weight: 720; font-size: 1.19rem; margin: 0 0 12px; }
.result-actions { display: grid; gap: 8px; }
@media (min-width: 600px) {
  .mast { display: flex; gap: 24px; min-height: 98px; }
  .mast img { width: 190px; }
  main { padding-top: 23px; }
  section { padding: 19px; margin-bottom: 14px; }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
  #city-field { width: calc((100% - 15px) / 2); }
  .result-actions { display: flex; flex-wrap: wrap; }
}
.login-wrap { max-width: 430px; }
.login-form { display: grid; gap: 12px; }
.login-form .hint { margin: 0; }
.logout { margin: 0; }
.logout button { min-height: 36px; font-size: .83rem; padding: 4px 11px; }
@media (min-width: 600px) { .logout { margin-left: auto; flex-shrink: 0; } }
