@font-face {
  font-family: 'Furore';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(furore.woff) format('woff');
}

:root {
  --blue: #0231BD;
  --navy: #011142;
  --ink: #0C0C0D;
  --grey: #9DA1AE;
  --light: #E5E6E9;
  --bg: #F4F5F7;
  --muted: #6B6F7A;
  --text-2: #4A4D57;
  --line: rgba(12, 12, 13, 0.09);
  --line-2: rgba(12, 12, 13, 0.18);
  --red: #C0392B;
  --red-dark: #8E2A1F;
  --red-bg: #FDF0EE;
  --display: Furore, Unbounded, Inter, sans-serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(16px, 7vw, 100px);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.page { min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; }

/* Header */
.header { height: 78px; display: flex; align-items: center; gap: 24px; padding: 0 var(--gutter); background: rgba(244, 245, 247, 0.92); border-bottom: 1px solid rgba(12, 12, 13, 0.1); }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; text-decoration: none; }
.brand svg { flex-shrink: 0; }
.lang { display: flex; gap: 2px; padding: 2px; border: 1px solid rgba(12, 12, 13, 0.16); border-radius: 4px; }
.lang button { border: 0; border-radius: 3px; padding: 8px 11px; min-height: 32px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; }
.lang button[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* Hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #FFFFFF 0%, #E9EBEF 100%); border-bottom: 1px solid rgba(12, 12, 13, 0.1); }
.hero-mark { position: absolute; right: -80px; top: -60px; pointer-events: none; }
.hero-inner { position: relative; padding: 56px var(--gutter) 48px; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; max-width: 760px; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 15px; border: 1px solid rgba(2, 49, 189, 0.28); border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
h1 { margin: 0; font-family: var(--display); font-size: clamp(30px, 4vw, 56px); font-weight: 400; line-height: 1.06; color: var(--navy); }
.lead { margin: 0; max-width: 56ch; font-size: 17px; line-height: 1.65; color: var(--text-2); }
.hero-tabs { display: flex; flex-direction: column; gap: 8px; width: 320px; flex-shrink: 0; }

/* Segmented controls */
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 3px; background: #fff; border-radius: 4px; }
.seg-lg { border: 1px solid rgba(12, 12, 13, 0.16); }
.seg-field { height: 52px; border: 1px solid var(--line-2); }
.seg button { height: 44px; border: 0; border-radius: 3px; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 600; }
.seg-field button { height: auto; }
.seg button[aria-selected="true"], .seg button[aria-checked="true"] { background: var(--blue); color: #fff; }

/* Layout */
.main { flex-grow: 1; padding: 40px var(--gutter) 64px; display: flex; align-items: flex-start; gap: 24px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.form { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.result { width: 472px; flex-shrink: 0; position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.result > div:not([hidden]) { display: flex; flex-direction: column; gap: 16px; }

.block { display: flex; flex-direction: column; gap: 20px; padding: 32px 36px; border-top: 1px solid var(--line); }
.block:first-child { border-top: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.block-head > div { display: flex; flex-direction: column; gap: 10px; }
.kicker { font-size: 12px; font-weight: 500; line-height: 1; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
h2 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 400; line-height: 1.2; color: var(--navy); }
.text-btn { border: 0; background: transparent; padding: 10px 0; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--blue); }

.grid { display: grid; gap: 20px 16px; }
.lot-grid { grid-template-columns: minmax(0, 1fr) 220px; }
.params-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.deliv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.label { font-size: 12px; font-weight: 500; line-height: 1; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; min-height: 18px; }
.req { color: var(--red); margin-left: -6px; }
.src:empty { display: none; }
.src { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: none; padding: 3px 6px; border-radius: 3px; background: rgba(2, 49, 189, 0.08); color: var(--blue); }
.src[data-kind="default"] { background: #E9EBEF; color: #5B5F6B; }
.src[data-kind="changed"] { background: #FFF4DB; color: #7A5200; }
.control { position: relative; }
.input { width: 100%; height: 52px; background: #fff; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 14px; font-size: 15px; color: var(--ink); outline-color: var(--blue); }
.input::placeholder { color: var(--grey); }
.input.strong { font-weight: 600; }
.input.has-left { padding-left: 42px; }
.input.has-right { padding-right: 56px; }
.input[aria-invalid="true"] { border-color: var(--red); }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6F7A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; text-overflow: ellipsis; }
.icon-left { position: absolute; left: 14px; top: 17px; color: var(--grey); pointer-events: none; }
.suffix { position: absolute; right: 14px; top: 17px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--grey); pointer-events: none; }
.field-error { font-size: 13px; line-height: 1.45; color: var(--red); }
.static-value { height: 52px; display: flex; align-items: center; padding: 0 14px; border: 1px dashed var(--line-2); border-radius: 4px; font-size: 15px; color: var(--text-2); }

/* Location combobox */
.combo-list { position: absolute; z-index: 10; left: 0; right: 0; top: 56px; max-height: 300px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line-2); border-radius: 4px; box-shadow: 0 12px 32px rgba(1, 17, 66, 0.12); }
.combo-list li { padding: 10px 12px; border-radius: 3px; font-size: 14px; cursor: pointer; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: rgba(2, 49, 189, 0.08); color: var(--navy); }
.combo-list .combo-empty { color: var(--muted); cursor: default; background: none; }

/* Lot card */
.lot { display: flex; gap: 18px; padding: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.lot-photo { width: 172px; height: 116px; flex-shrink: 0; border-radius: 4px; background: var(--light); display: flex; align-items: center; justify-content: center; color: var(--grey); overflow: hidden; }
.lot-photo img { width: 100%; height: 100%; object-fit: cover; }
.lot-photo img ~ svg, .lot-photo:has(img) svg { display: none; }
.lot-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex-grow: 1; }
.lot-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.link { font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.lot-title { font-size: 20px; font-weight: 600; line-height: 1.25; color: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 10px; background: #fff; border: 1px solid rgba(12, 12, 13, 0.1); border-radius: 999px; font-size: 13px; color: var(--text-2); }
.lot-warn { font-size: 13px; line-height: 1.45; color: #7A5200; background: #FFF4DB; border-radius: 4px; padding: 8px 10px; }
.sk { height: 14px; border-radius: 4px; background: #E9EBEF; }
.sk-lg { height: 22px; }
.lot-skeleton .lot-photo { animation: pulse 1.2s ease-in-out infinite; }

.summary { display: flex; flex-wrap: wrap; gap: 8px; }
.summary span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(12, 12, 13, 0.1); border-radius: 4px; font-size: 14px; }
.summary em { font-style: normal; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Buttons */
.actions { flex-direction: row; gap: 12px; background: #FAFAFB; border-radius: 0 0 8px 8px; }
.btn { height: 56px; padding: 0 26px; border-radius: 4px; font-size: 15px; font-weight: 600; }
.btn-primary { flex-grow: 1; border: 1px solid transparent; background: var(--blue); color: #fff; }
.btn-primary:disabled { opacity: 0.7; cursor: progress; }
.btn-ghost { border: 1px solid rgba(1, 17, 66, 0.24); background: #fff; color: var(--navy); }
.btn-block { width: 100%; }

/* Result */
.empty { padding: 40px 32px; background: #fff; border: 1px dashed var(--line-2); border-radius: 8px; align-items: flex-start; }
.empty-icon { width: 48px; height: 48px; border-radius: 50%; background: rgba(2, 49, 189, 0.08); display: flex; align-items: center; justify-content: center; color: var(--blue); }
.empty-title { font-family: var(--display); font-size: 18px; line-height: 1.2; color: var(--navy); }
.empty p { margin: 0; font-size: 15px; line-height: 1.6; color: #5B5F6B; }

.total-card { background: var(--navy); border-radius: 8px; padding: 32px; display: flex; flex-direction: column; gap: 14px; color: #fff; }
.total-kick { font-size: 12px; font-weight: 500; line-height: 1.3; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey); }
.total-card.partial .total-kick { color: #F2A99F; }
.total { font-family: var(--display); font-size: 48px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.total-card.partial .total { color: var(--grey); }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 13px; line-height: 1.4; color: var(--grey); }
.route b { font-weight: 400; color: var(--light); }
.sk-dark { border-radius: 4px; background: rgba(255, 255, 255, 0.1); animation: pulse 1.2s ease-in-out infinite; }

.alert { display: flex; flex-direction: row !important; gap: 14px !important; padding: 18px 20px; background: var(--red-bg); border: 1px solid rgba(192, 57, 43, 0.35); border-radius: 8px; }
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert > div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.alert-title { font-size: 15px; font-weight: 600; color: var(--red-dark); }
.alert-text { font-size: 14px; line-height: 1.55; color: #5B2A24; }
.alert-btn { border: 0; background: transparent; padding: 6px 0; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--red-dark); text-decoration: underline; }
.alert-btn:empty { display: none; }

.breakdown { display: flex; flex-direction: column; }
.group + .group { border-top: 1px solid var(--line); }
.group-head { width: 100%; min-height: 56px; padding: 0 20px; border: 0; background: transparent; display: flex; align-items: center; gap: 12px; text-align: left; }
.group-title { flex-grow: 1; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy); }
.group-sum { font-size: 15px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.group-head svg { flex-shrink: 0; transition: transform 160ms; }
.group-head[aria-expanded="true"] svg { transform: rotate(180deg); }
.group-rows { padding: 0 20px 14px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-top: 1px solid rgba(12, 12, 13, 0.06); font-size: 14px; line-height: 1.45; }
.row span:first-child { color: var(--text-2); }
.row span:last-child { flex-shrink: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.row.zero span { color: var(--grey) !important; font-weight: 400; }
.row.info span { color: var(--muted); font-weight: 400; }
.row.missing span { color: var(--red) !important; font-weight: 600; }
.note { margin: 0; font-size: 12px; line-height: 1.6; color: #6F7789; }

.sk-list { padding: 24px; gap: 18px; }
.sk-row { height: 14px; border-radius: 4px; background: #E9EBEF; animation: pulse 1.2s ease-in-out infinite; }

.footer { padding: 24px var(--gutter); display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid rgba(12, 12, 13, 0.1); font-size: 13px; color: var(--muted); }

@keyframes pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Tablet / mobile */
@media (max-width: 1100px) {
  .main { flex-direction: column; align-items: stretch; }
  .result { width: 100%; position: static; }
}
@media (max-width: 760px) {
  .header { height: 64px; }
  .hero-inner { flex-direction: column; align-items: stretch; padding: 28px 16px; }
  .hero-tabs { width: 100%; }
  .lead { font-size: 15px; }
  .main { padding: 16px 16px 32px; }
  .block { padding: 24px 18px; }
  .lot-grid, .deliv-grid { grid-template-columns: minmax(0, 1fr); }
  .params-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span2 { grid-column: 1 / -1; }
  .lot { flex-direction: column; }
  .lot-photo { width: 100%; height: 180px; }
  .actions { flex-direction: column; }
  .total-card { padding: 26px 22px; }
  .total { font-size: 36px; }
  .footer { flex-direction: column; padding: 20px 16px 28px; }
}
