:root {
  --ink: #13242e;
  --muted: #647681;
  --line: #d9e2e6;
  --paper: #fff;
  --canvas: #f1f5f6;
  --steel: #244858;
  --steel-dark: #102f3d;
  --accent: #e66c2e;
  --accent-dark: #c85018;
  --success: #277a55;
  --radius: 15px;
  --shadow: 0 18px 50px rgba(19, 42, 54, .09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.45; }
.container { width: min(1440px, calc(100% - 40px)); margin: 0 auto; }
.topbar { background: var(--steel-dark); color: #fff; border-bottom: 3px solid var(--accent); }
.topbar__inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 42px; height: 42px; background: var(--accent); font-size: 23px; font-weight: 900; clip-path: polygon(0 0, 100% 0, 84% 100%, 0 100%); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 20px; }
.brand small { margin-top: 1px; color: #b9cbd3; font-size: 12px; }
.sync-state { display: flex; align-items: center; gap: 9px; color: #dce7eb; font-size: 14px; }
.sync-state__dot { width: 9px; height: 9px; border-radius: 50%; background: #63c798; box-shadow: 0 0 0 5px rgba(99, 199, 152, .14); }

.page { padding: 28px 0 52px; }
.workspace { padding: 27px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.workspace__heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 6px; color: var(--accent-dark); font-size: 12px; font-weight: 850; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 900px; margin-bottom: 8px; font-size: clamp(27px, 3vw, 40px); line-height: 1.12; letter-spacing: -.03em; }
.lead { max-width: 800px; margin-bottom: 0; color: var(--muted); font-size: 15px; }
.updated { min-width: 190px; padding-left: 18px; border-left: 2px solid var(--line); }
.updated span, .updated strong { display: block; }
.updated span { color: var(--muted); font-size: 12px; }
.updated strong { margin-top: 4px; font-size: 15px; }

.request-form { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 17px; align-items: stretch; }
.field { display: grid; gap: 7px; }
.field > span { color: #42545e; font-size: 13px; font-weight: 750; }
textarea, input, button { font: inherit; }
textarea, input { width: 100%; color: var(--ink); background: #fbfcfc; border: 1px solid #c7d5db; border-radius: 10px; outline: none; }
textarea { min-height: 265px; padding: 16px 17px; resize: vertical; line-height: 1.55; }
input { min-height: 54px; padding: 0 14px; }
textarea:focus, input:focus { border-color: #4e8298; box-shadow: 0 0 0 3px rgba(78, 130, 152, .14); }
.request-form__actions { display: flex; flex-direction: column; padding-top: 25px; }
.search-button { width: 100%; min-height: 58px; margin-top: 15px; padding: 0 20px; color: #fff; background: var(--accent); border: 0; border-radius: 10px; font-weight: 850; cursor: pointer; box-shadow: 0 8px 20px rgba(230, 108, 46, .25); }
.search-button:hover { background: var(--accent-dark); }
.search-button span { margin-right: 5px; font-size: 24px; vertical-align: -2px; }
.form-note { margin: 14px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stats article { padding: 15px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; }
.stats span, .stats strong { display: block; }
.stats span { color: var(--muted); font-size: 11px; }
.stats strong { margin-top: 3px; font-size: 21px; }
.stats .status { font-size: 15px; line-height: 1.8; }
.status--success { color: var(--success); }
.status--partial { color: #9c6507; }
.status--running { color: #176c95; }

.results { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.results__heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 22px 25px 17px; background: #fbfcfc; border-bottom: 1px solid var(--line); }
.results__heading h2 { margin-bottom: 0; font-size: 25px; }
.results__heading > p { max-width: 460px; margin-bottom: 4px; color: var(--muted); font-size: 13px; text-align: right; }
.request-results { display: grid; }
.request-item { padding: 23px 25px 27px; border-top: 7px solid var(--canvas); }
.request-item:first-child { border-top: 0; }
.request-item__title { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 15px; }
.request-number { flex: 0 0 31px; display: grid; place-items: center; width: 31px; height: 31px; color: #fff; background: var(--steel); border-radius: 8px; font-size: 13px; font-weight: 850; }
.request-item__title h3 { margin: 1px 0 4px; font-size: 18px; line-height: 1.32; }
.quantity { color: var(--accent-dark); font-size: 12px; font-weight: 800; }
.offers { display: grid; gap: 9px; margin-left: 44px; }
.offer { display: grid; grid-template-columns: 135px minmax(260px, 1fr) minmax(170px, .58fr) 190px; gap: 16px; align-items: center; padding: 14px 16px; background: #fbfcfc; border: 1px solid #dfe7ea; border-radius: 10px; }
.offer__place, .offer__product, .offer__availability, .offer__price { min-width: 0; }
.offer__place strong, .offer__place small, .offer__product strong, .offer__product span, .offer__product small, .offer__availability span, .offer__availability strong, .offer__price span, .offer__price strong, .offer__price small { display: block; }
.offer__rank { display: inline-block; margin-bottom: 5px; padding: 3px 7px; color: #426274; background: #e8f0f3; border-radius: 5px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.offer__place strong { font-size: 14px; }
.offer__place small, .offer__product small, .offer__price small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.offer__product strong { font-size: 14px; }
.offer__product span { overflow: hidden; margin-top: 3px; color: #52636d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.offer__availability span, .offer__price span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.offer__availability strong { margin-top: 4px; color: #316d55; font-size: 12px; }
.offer__price strong { margin-top: 2px; color: #176448; font-size: 17px; white-space: nowrap; }
.offer__price a { display: inline-block; margin-top: 4px; color: #1e647f; font-size: 11px; font-weight: 750; text-decoration: none; }
.offer__price a:hover { text-decoration: underline; }
.no-offer { margin-left: 44px; padding: 17px; color: #75613b; background: #fff8e8; border: 1px solid #eddfbc; border-radius: 9px; }
.no-offer strong, .no-offer span { display: block; }
.no-offer span { margin-top: 3px; font-size: 12px; }

.notice { padding: 18px; border-radius: 10px; }
.notice--error { color: #792525; background: #fbe8e8; border: 1px solid #efc5c5; }
.how-it-works { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.how-it-works > div { position: relative; min-height: 130px; padding: 21px 22px 18px 74px; background: rgba(255,255,255,.72); border: 1px dashed #c6d5db; border-radius: 12px; }
.how-it-works span { position: absolute; top: 21px; left: 21px; display: grid; place-items: center; width: 36px; height: 36px; color: #fff; background: var(--steel); border-radius: 50%; font-weight: 850; }
.how-it-works strong { display: block; font-size: 15px; }
.how-it-works p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.footer { padding: 20px 0 32px; color: #6a7b84; font-size: 12px; }

@media (max-width: 1100px) {
  .offer { grid-template-columns: 125px minmax(230px, 1fr) 165px; }
  .offer__price { grid-column: 2 / -1; padding-top: 8px; border-top: 1px solid var(--line); }
}

@media (max-width: 850px) {
  .request-form { grid-template-columns: 1fr; }
  .request-form__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding-top: 0; align-items: end; }
  .search-button { margin-top: 0; }
  .form-note { grid-column: 1 / -1; margin-top: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .offer { grid-template-columns: 120px 1fr; }
  .offer__availability, .offer__price { grid-column: 2; }
  .offer__availability { padding-top: 7px; border-top: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .container { width: min(100% - 22px, 1440px); }
  .topbar__inner { min-height: 65px; }
  .sync-state { display: none; }
  .page { padding-top: 15px; }
  .workspace { padding: 19px 15px; }
  .workspace__heading { display: block; }
  .updated { margin-top: 14px; padding: 10px 0 0; border: 0; border-top: 1px solid var(--line); }
  textarea { min-height: 285px; }
  .request-form__actions { grid-template-columns: 1fr; }
  .form-note { grid-column: auto; }
  .stats { gap: 7px; }
  .stats article { padding: 12px 13px; }
  .stats strong { font-size: 17px; }
  .stats .status { font-size: 13px; }
  .results__heading { display: block; padding: 19px 15px 14px; }
  .results__heading > p { margin-top: 8px; text-align: left; }
  .request-item { padding: 19px 14px 21px; }
  .offers, .no-offer { margin-left: 0; }
  .offer { display: block; padding: 14px; }
  .offer__place, .offer__product, .offer__availability, .offer__price { padding: 10px 0; border-top: 1px solid var(--line); }
  .offer__place { padding-top: 0; border-top: 0; }
  .offer__price { padding-bottom: 0; }
  .offer__product span { white-space: normal; }
  .how-it-works { grid-template-columns: 1fr; }
  .how-it-works > div { min-height: 0; }
}
