:root {
  color-scheme: light;
  --ink: #172332;
  --muted: #546478;
  --blue: #1757df;
  --dark: #111922;
  --line: #dce4ee;
  --paper: #f3f6fa;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #6aaaff; outline-offset: 3px; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.top { background: var(--dark); border-bottom: 1px solid #2a3644; color: #f5f8ff; }
.top-inner, .footer-inner { min-height: 66px; display: flex; gap: 20px; align-items: center; justify-content: space-between; }
.wordmark { display: inline-flex; gap: 11px; align-items: center; font-weight: 850; font-size: 19px; letter-spacing: .1em; text-decoration: none; }
.mark { position: relative; display: grid; gap: 3px; width: 31px; height: 31px; align-content: center; justify-items: center; border-radius: 8px; background: #3478ff; }
.mark i { width: 13px; height: 2px; border-radius: 2px; background: white; transform: skew(-25deg); }
.mark i:nth-child(2) { width: 17px; }
.top-city { display: inline-flex; gap: 9px; align-items: center; color: #e3eaf5; font-size: .9rem; font-weight: 600; }
.pin { display: inline-block; width: 12px; height: 12px; border: 2px solid #8bb6ff; border-radius: 50% 50% 50% 2px; transform: rotate(-45deg); position: relative; }
.pin::before { content: ''; position: absolute; width: 3px; height: 3px; border-radius: 100%; background: #8bb6ff; inset: 2.5px; }
.hero { background: radial-gradient(ellipse at 87% 35%, #1b385c 0%, transparent 52%), var(--dark); color: white; overflow: hidden; }
.hero-inner { position: relative; isolation: isolate; padding-block: 51px 31px; }
.hero-copy { position: relative; }
h1 { margin: 0; font-size: clamp(2.35rem, 5.3vw, 4.65rem); line-height: .99; font-weight: 820; letter-spacing: -.071em; max-width: 760px; }
h1 span { display: block; color: #91bbff; }
.hero-copy p { margin: 22px 0 29px; font-size: clamp(1rem, 1.8vw, 1.125rem); color: #c9d5e5; }
.instrument { position: absolute; z-index: -1; width: 400px; aspect-ratio: 1; right: -9px; top: -30px; border-radius: 50%; display: grid; place-items: center; opacity: .8; pointer-events: none; }
.instrument::before { content: ''; position: absolute; inset: -40px; background: linear-gradient(90deg, #90bbff19 1px, transparent 1px), linear-gradient(#90bbff19 1px, transparent 1px); background-size: 24px 24px; mask-image: radial-gradient(#000 12%, transparent 68%); }
.ring { grid-area: 1/1; border-radius: 50%; aspect-ratio: 1; }
.outer { width: 96%; border: 1px dashed #7faafa63; }
.middle { width: 78%; border: 1px solid #9abfff70; box-shadow: inset 0 0 0 13px #5799fb0b, inset 0 0 0 14px #9abfff33; }
.inner { width: 59%; background: repeating-conic-gradient(from 6deg, #98beff70 0deg 1deg, #3e78d029 1deg 9deg, #142945aa 9deg 12deg); mask-image: radial-gradient(transparent 0 49%, #000 50% 99%, transparent 100%); border: 1px solid #97c4ff99; }
.hub { grid-area: 1/1; width: 29%; aspect-ratio: 1; border-radius: 50%; border: 1px solid #a6cfff70; box-shadow: inset 0 0 0 13px #8fbbff12, 0 0 36px #4c88f052; }
.search { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, 30%); gap: 17px; background: #ffffff; color: var(--ink); padding: 16px; border-radius: 15px; box-shadow: 0 10px 24px #050c1640; }
.search label { display: block; font-size: .875rem; font-weight: 700; margin: 0 0 8px 2px; }
.input-group { position: relative; display: flex; gap: 8px; }
.magnify { position: absolute; left: 16px; top: 16px; width: 14px; height: 14px; border: 2px solid #627792; border-radius: 50%; pointer-events: none; }
.magnify::after { content: ''; width: 7px; height: 2px; border-radius: 2px; background: #627792; position: absolute; rotate: 45deg; top: 10px; left: 8px; }
input, select { background-color: #f6f8fc; border: 1px solid #d5deeb; border-radius: 8px; color: var(--ink); min-width: 0; height: 48px; padding: 0 12px; }
input::placeholder { color: #5e7086; }
.input-group input { flex: 1; padding-left: 41px; width: 100%; }
select { appearance: none; width: 100%; padding-right: 32px; background-image: linear-gradient(45deg, transparent 49%, #536781 50%), linear-gradient(135deg, #536781 50%, transparent 51%); background-size: 5px 5px; background-position: right 17px center, right 12px center; background-repeat: no-repeat; }
.primary { border: 0; color: white; background: var(--blue); border-radius: 8px; padding: 0 29px; font-weight: 750; min-height: 44px; }
.primary:hover { background: #1147b9; }
.examples { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; font-size: .875rem; color: #cbd9ed; }
.examples span { margin-right: 4px; }
.examples button { border: 1px solid #4d6380; background: #26384e90; padding: 5px 9px; border-radius: 6px; color: #ecf4ff; font-family: ui-monospace, monospace; font-size: .875rem; }
.examples button:hover { background: #345984; }
.results { padding-block: 36px 52px; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 19px; }
h2 { margin: 0; font-size: clamp(1.48rem, 2.8vw, 2rem); line-height: 1.15; letter-spacing: -.045em; }
.results-bar p { margin: 7px 0 0; color: var(--muted); font-size: .9rem; }
.source { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; background: white; border: 1px solid var(--line); padding: 8px 11px; border-radius: 8px; font-size: .875rem; font-weight: 650; white-space: nowrap; }
.source:hover { color: var(--blue); }
.source span { width: 8px; height: 8px; border-radius: 100%; background: #3677ef; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 375px), 1fr)); gap: 14px; }
.card { background: white; border: 1px solid var(--line); border-top: 3px solid #3581fa; border-radius: 13px; padding: 17px 19px 16px; min-width: 0; }
.card.analog { border-top-color: #1d966c; }
.type { width: fit-content; color: #1645a1; background: #eaf1ff; border-radius: 5px; padding: 4px 8px; font-size: .875rem; line-height: 1.35; font-weight: 750; }
.analog .type { color: #126549; background: #e5f6ef; }
.part { display: flex; gap: 12px; align-items: center; margin: 13px 0 15px; min-height: 52px; }
.part img { width: 52px; height: 52px; object-fit: contain; border-radius: 6px; border: 1px solid #edf1f7; }
.part h3 { margin: 0; font-size: 1.12rem; line-height: 1.25; }
.article-line { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; margin: 4px 0 0; }
.article-line code { color: #31435b; }
.metrics { display: flex; justify-content: space-between; gap: 12px; align-items: end; padding-bottom: 13px; }
.price { font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.05em; white-space: nowrap; }
.eta { text-align: right; font-size: .875rem; font-weight: 700; }
.qty { display: block; font-weight: 500; color: var(--muted); margin-top: 3px; }
.actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .875rem; }
.actions a, .table a { text-decoration: none; color: #174eae; font-weight: 700; }
.actions a:hover, .table a:hover, .footer a:hover { text-decoration: underline; }
.secondary { background: #f1f5fb; border: 1px solid #dce5f0; border-radius: 7px; color: #173c78; font-weight: 700; min-height: 35px; padding: 6px 10px; }
.secondary:hover { background: #e4edfc; }
.message, .table-block { border: 1px solid var(--line); background: white; border-radius: 12px; padding: 18px; }
.message { color: var(--muted); line-height: 1.5; }
.message button { margin-left: 10px; }
.message.error { color: #8b292d; background: #fff7f7; }
.note { color: var(--muted); font-size: .875rem; margin: 14px 0 0; }
.table-block { margin-top: 16px; }
.table-block h3 { margin: 0 0 12px; font-size: 1.22rem; }
#used-offers .note { margin: 0 0 10px; }
#used-offers .table-wrap + .note { margin-top: 12px; }
#used-offers .table td:last-child { min-width: 11rem; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); gap: 9px; margin-bottom: 15px; }
.filters label { display: grid; gap: 5px; color: var(--muted); font-size: .875rem; }
.filters input, .filters select { height: 40px; width: 100%; font-size: .9rem; }
.table-wrap { overflow-x: auto; }
.table { border-collapse: collapse; width: 100%; text-align: left; font-size: .9rem; }
.table th { color: #42536a; background: #f2f6fc; }
.table td, .table th { padding: 10px 11px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td:last-child { white-space: normal; }
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.footer span { font-weight: 800; letter-spacing: .08em; }
.footer a { text-decoration: none; }
@media (max-width: 680px) {
  .shell { width: calc(100% - 32px); }
  .hero-inner { padding-block: 38px 23px; }
  .instrument { right: -130px; top: -40px; opacity: .43; width: 345px; }
  .search { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
  .primary { padding-inline: 16px; }
  .results { padding-block: 25px 35px; }
}
@media (max-width: 365px) {
  .source { padding: 7px; }
  .results-bar { align-items: start; }
  h1 { font-size: 2.1rem; }
  .metrics { align-items: start; flex-direction: column; }
  .eta { text-align: left; }
}

.top-actions { display: flex; align-items: center; gap: 18px; }
.top-button { color: #eef4ff; background: #243247; border: 1px solid #465975; border-radius: 8px; padding: 8px 12px; font-size: .9rem; font-weight: 700; min-height: 40px; }
.top-button:hover { background: #30455f; }
.search { grid-template-columns: minmax(0, 1fr); }

.portal-dialog { color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 16px; width: min(530px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 24px; box-shadow: 0 20px 70px #080f2780; }
.portal-dialog::backdrop { background: #0c1527a8; }
.settings-header { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.settings-close { width: 39px; height: 39px; flex: 0 0 39px; border: 1px solid var(--line); border-radius: 8px; font-size: 1.6rem; line-height: 1; background: var(--paper); color: var(--ink); }
.settings-intro, .settings-status { color: var(--muted); font-size: .9rem; }
.settings-intro { margin: 8px 0 22px; }
#settings fieldset { border: 1px solid var(--line); padding: 10px 12px 12px; border-radius: 9px; margin: 0 0 14px; min-width: 0; }
#settings legend { font-weight: 750; padding: 0 4px; }
#settings label { display: block; margin: 0 0 6px; font-size: .875rem; font-weight: 650; }
#settings select:disabled { cursor: default; opacity: .8; }
.settings-status { min-height: 1em; margin: 6px 0 12px; }
.settings-status.error { color: #8b292d; }
.settings-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.settings-actions a { color: #174eae; font-size: .9rem; }
.settings-actions button:disabled { opacity: .6; cursor: default; }
@media (max-width: 520px) {
  .top-inner { gap: 10px; }
  .top-actions { gap: 8px; }
  .top-city { display: none; }
  .portal-dialog { padding: 18px; }
}

.help-description { color: var(--muted); line-height: 1.55; margin: 14px 0 20px; }
.help-description strong { color: var(--ink); }
#help h3 { margin: 0 0 8px; font-size: 1rem; }
.help-links { display: grid; gap: 6px; list-style: none; padding: 0; margin: 0; }
.help-links a { display: block; padding: 8px 10px; border-radius: 6px; color: #174eae; background: var(--paper); text-decoration: none; }
.help-links a:hover { text-decoration: underline; }
@media (max-width: 375px) {
  .wordmark { font-size: 16px; gap: 7px; }
  .mark { width: 27px; height: 27px; }
  .top-button { padding-inline: 8px; font-size: .85rem; }
}

.stores { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.store { display: grid; align-content: start; gap: 4px; }
.store-status { font-size: .8125rem; color: var(--muted); line-height: 1.3; }
#help .help-links + h3 { margin-top: 20px; }
@media (max-width: 680px) {
  .results-bar { align-items: flex-start; flex-wrap: wrap; }
  .stores { justify-content: flex-start; }
}
