:root {
  color-scheme: dark;
  --bg: #0d0d11;
  --surface: #15151b;
  --raised: #1a1921;
  --line: #292832;
  --text: #f6f4fb;
  --muted: #a5a2b1;
  --violet: #a889ff;
  --primary: #8b5cf6;
  --green: #6bdcaf;
  --amber: #f0c377;
  --red: #ff929e;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: #484253 var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #c8b1ff; outline-offset: 4px; }
::selection { background: #7d48e7; color: white; }
.shell { width: min(1280px, calc(100% - 96px)); margin-inline: auto; }
.skip { position: fixed; z-index: 10; top: 8px; left: 8px; padding: 10px; background: var(--surface); transform: translateY(-150%); }
.skip:focus { transform: none; }
.site-header { background: #111116; border-bottom: 1px solid #24232c; }
.header-inner { min-height: 71px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.brand { width: fit-content; display: inline-flex; align-items: center; gap: 10px; font: 900 25px/1 Geist, Inter, sans-serif; letter-spacing: -.055em; }
.brand-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(145deg, #a67aff, #7946ef); color: white; box-shadow: 0 4px 20px #9a61fd33; }
.brand-icon svg { fill: currentColor; stroke-width: 1; width: 20px; height: 20px; }
.brand-dot { color: #ac87ff; }
.header-nav { align-self: stretch; display: flex; align-items: stretch; gap: 32px; }
.header-nav > * { position: relative; display: flex; align-items: center; white-space: nowrap; color: var(--muted); background: none; border: 0; padding: 0 2px; font-weight: 600; transition: color .2s; }
.header-nav > *:hover, .header-nav > .nav-current { color: #c0a9ff; }
.nav-current::after { content: ""; position: absolute; bottom: -1px; inset-inline: 0; height: 2px; border-radius: 2px 2px 0 0; background: #a179ff; box-shadow: 0 -2px 12px #a179ff80; }
.header-saved { justify-self: end; }
#saved-count { color: #d5c5ff; background: #302348; padding: 0 5px; border-radius: 4px; font-size: 11px; }
svg { width: 18px; height: 18px; display: block; flex-shrink: 0; }
[data-icon] { display: inline-flex; flex: none; align-items: center; justify-content: center; }
.button { min-height: 42px; padding: 0 15px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; color: var(--text); border: 1px solid transparent; border-radius: 9px; background: transparent; font-weight: 650; line-height: 1.2; white-space: nowrap; transition: background .22s, color .22s, border-color .22s, box-shadow .22s, transform .22s; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: default; opacity: .42; }
.button-primary { background: linear-gradient(105deg, #8c59f5, #7e4ae9); color: white; box-shadow: inset 0 1px 0 #ffffff24, 0 4px 13px #6934c82e; }
.button-primary:hover:not(:disabled) { background: linear-gradient(105deg, #a16dfb, #905bf0); box-shadow: 0 6px 22px #8c59f54b; }
.button-outline { border-color: #34323e; background: #1a1921; }
.button-outline:hover:not(:disabled) { border-color: #6c528f; background: #242031; }
.button-ghost { border-color: #ffffff2e; background: #171322a3; }
.button-ghost:hover { border-color: #b69afa; background: #2c2141; }
.button-quiet { color: #b4b0bf; border-color: #2c2a35; background: #15151a; }
.button-quiet:hover { color: white; border-color: #5e487c; background: #211b2c; }
.button-full { width: 100%; min-height: 43px; }
.button-tail { margin-left: 5px; }
.hero { position: relative; isolation: isolate; overflow: hidden; margin-top: 27px; min-height: 350px; border: 1px solid #332847; border-radius: 19px; background: radial-gradient(ellipse at 78% 49%, #2e1947, #161123 50%, #100e17 85%); display: flex; align-items: center; }
.hero-art { position: absolute; z-index: -2; inset: 0; background: url("./assets/hero.webp") center 49% / cover no-repeat; animation: hero-image 1.25s cubic-bezier(.22,.76,.26,1) both; }
.hero::after { content: ""; pointer-events: none; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #100e17 0%, #100e17ed 25%, #100e1773 49%, transparent 64%), linear-gradient(0deg, #100e1740, transparent 28%); }
.hero-content { width: min(57%, 650px); padding: 34px 0 36px 48px; animation: arrive .65s cubic-bezier(.22,.76,.26,1) both; }
.eyebrow { color: #cbb5ff; background: #9b6dfa19; border: 1px solid #a578ff48; border-radius: 20px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.eyebrow svg { width: 13px; height: 13px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(43px, 5.3vw, 75px); letter-spacing: -.07em; font-weight: 850; line-height: .99; margin-top: 16px; }
h1 span { color: #ae83ff; background: linear-gradient(95deg, #b68dff 0%, #9b6bff 80%); background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: #b7b2c5; margin-top: 19px; max-width: 390px; font-size: 15px; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }
.hero-actions .button { min-height: 45px; padding-inline: 15px; }
.section { scroll-margin-top: 24px; margin-top: 33px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-heading h2 { font-size: clamp(27px, 3vw, 34px); font-weight: 800; line-height: 1.13; letter-spacing: -.044em; }
.section-heading p { margin-top: 6px; color: var(--muted); }
.section-heading .button { min-height: 39px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 350px); align-items: start; gap: 19px; }
.component-list { display: grid; gap: 9px; min-width: 0; }
.component { display: grid; grid-template-columns: 62px minmax(0,1fr) auto; align-items: center; gap: 14px; min-height: 82px; padding: 9px 13px 9px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; transition: border-color .25s, background .25s; }
.component:hover { background: #191821; border-color: #41344e; }
.component[data-conflict="true"] { border-color: #64343e; }
.component-visual { height: 60px; width: 62px; border: 1px solid #2b2734; background: #1a1822; border-radius: 8px; display: grid; place-items: center; color: #a88de0; overflow: hidden; }
.component-visual img { width: 100%; height: 100%; object-fit: contain; display: block; }
.component-visual > span svg { width: 24px; height: 24px; }
.component-label { display: flex; align-items: center; gap: 6px; color: #aaa4b7; font-size: 11px; font-weight: 650; letter-spacing: .005em; }
.component-name { font-size: 15px; font-weight: 750; line-height: 1.3; margin-top: 2px; overflow-wrap: anywhere; }
.component-empty .component-name { color: #9893a7; font-weight: 550; }
.component-spec { color: #a5a0b1; font-size: 11px; line-height: 1.45; margin-top: 3px; }
.component-actions { display: flex; align-items: center; gap: 9px; }
.component-price { font: 750 16px/1.2 Geist, Inter, sans-serif; white-space: nowrap; font-variant-numeric: tabular-nums; margin-right: 2px; }
.icon-button { width: 35px; height: 35px; border: 1px solid #312f3b; border-radius: 8px; color: #b5afc3; background: #1c1b24; display: inline-grid; place-items: center; padding: 0; flex: none; transition: background .2s, color .2s, border-color .2s; }
.icon-button:hover { color: white; border-color: #654990; background: #2c2240; }
.remove:hover { color: var(--red); border-color: #6c3944; background: #32202a; }
.icon-button svg { width: 16px; height: 16px; }
.add-part { background: #241b35; border-color: #403054; color: #c7aaff; min-height: 35px; padding-inline: 11px; font-size: 12px; }
.add-part:hover { background: #32234b; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.summary { position: sticky; top: 16px; padding: 17px; }
.summary-heading { display: flex; align-items: center; gap: 10px; }
.summary-heading h3 { font-size: 18px; letter-spacing: -.025em; font-weight: 800; }
.summary-icon { width: 36px; height: 36px; border-radius: 8px; color: #c4a5ff; background: #2b2040; }
.summary-price-label { margin-top: 15px; color: var(--muted); font-size: 12px; }
.total { font: 800 37px/1.1 Geist, Inter, sans-serif; letter-spacing: -.055em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.summary-divider { height: 1px; background: var(--line); margin: 14px 0; }
.progress-label { display: flex; justify-content: space-between; gap: 10px; color: #b9b5c4; font-size: 12px; }
.progress-label strong { color: #c9adff; }
progress { display: block; width: 100%; height: 6px; overflow: hidden; margin-top: 7px; border: 0; border-radius: 10px; background: #2b2735; appearance: none; }
progress::-webkit-progress-bar { background: #2b2735; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #8151ed, #ad85ff); border-radius: 10px; transition: width .45s cubic-bezier(.22,.76,.26,1); }
progress::-moz-progress-bar { background: linear-gradient(90deg, #8151ed, #ad85ff); border-radius: 10px; }
.compatibility { display: flex; align-items: flex-start; gap: 9px; padding: 10px; margin-top: 15px; border: 1px solid #2a4d43; background: #172923; color: var(--green); border-radius: 8px; font-size: 12px; }
.compatibility.warning { color: var(--amber); background: #2b2418; border-color: #4e4027; }
.compatibility.error { color: var(--red); background: #2c1b22; border-color: #57303d; }
.compatibility.neutral { color: #bbb0d0; background: #211c2b; border-color: #3b3149; }
.compatibility strong { display: block; font-weight: 750; }
.compatibility small { display: block; color: inherit; opacity: .92; font-size: 11px; margin-top: 2px; }
.compatibility button { background: none; border: 0; padding: 0; margin-top: 3px; color: inherit; text-decoration: underline; text-underline-offset: 2px; font-size: 11px; }
.power { display: flex; align-items: center; gap: 7px; min-height: 41px; color: #b9b4c5; font-size: 12px; }
.power strong { margin-left: auto; color: #e8e2f1; white-space: nowrap; }
.power svg { color: #a58acd; width: 15px; height: 15px; }
.summary .button + .button { margin-top: 8px; }
.summary-note { text-align: center; font-size: 10px; color: #a29aad; margin-top: 9px; }
.presets { margin-top: 41px; margin-bottom: 49px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.preset-card { padding: 17px; transition: border-color .25s, transform .25s; }
.preset-card:hover { transform: translateY(-3px); border-color: #72549b; }
.preset-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: #2c2141; color: #c4a5ff; margin-bottom: 11px; }
.preset-card h3 { font-size: 18px; letter-spacing: -.025em; }
.preset-card p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.preset-parts { color: #c4b8d4; font-size: 12px; margin-top: 11px; min-height: 37px; }
.preset-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.preset-bottom strong { font: 750 20px/1 Geist, Inter, sans-serif; }
.preset-bottom .button { min-height: 35px; font-size: 12px; }
footer { background: #111116; border-top: 1px solid #24232c; }
.footer-inner { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 74px; }
.footer-inner .brand { font-size: 21px; }
.footer-inner .brand-icon { width: 29px; height: 29px; border-radius: 7px; }
.footer-link { display: inline-flex; align-items: center; gap: 6px; color: #b4a8c6; background: none; border: 0; padding: 8px 0; font-size: 12px; text-align: left; }
.footer-link:hover { color: #d3b9ff; }
.footer-link svg { width: 15px; height: 15px; }
dialog { width: min(760px, calc(100% - 28px)); max-height: min(86dvh, 760px); overflow: hidden; padding: 0; color: var(--text); background: #17161e; border: 1px solid #413450; border-radius: 16px; box-shadow: 0 24px 100px #000b; }
dialog[open] { animation: dialog-in .28s cubic-bezier(.22,.76,.26,1) both; }
dialog::backdrop { background: #08060ccc; backdrop-filter: blur(5px); animation: fade-in .2s ease both; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-layout { display: flex; flex-direction: column; max-height: min(86dvh, 760px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 19px 21px 15px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 24px; letter-spacing: -.035em; line-height: 1.2; }
.dialog-head p { color: var(--muted); margin-top: 4px; font-size: 12px; }
#dialog-body { overflow: auto; padding: 16px 21px 21px; }
.catalog-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }
.chip { border: 1px solid #37313f; border-radius: 7px; padding: 5px 8px; background: #1e1b28; color: #c6bece; font-size: 11px; transition: background .2s, color .2s; }
.chip:hover, .chip[aria-pressed="true"] { color: #e9d9ff; background: #372750; border-color: #69508e; }
.catalog-controls { display: grid; grid-template-columns: 1fr 145px; gap: 8px; margin-bottom: 9px; }
.field { min-height: 39px; width: 100%; background: #100f16; color: var(--text); border: 1px solid #383241; border-radius: 8px; padding: 7px 10px; }
.field::placeholder { color: #9991a5; }
.check-label { display: inline-flex; align-items: center; gap: 6px; color: #c1b8cd; font-size: 12px; margin-bottom: 11px; cursor: pointer; }
.check-label input { accent-color: #976aff; width: 15px; height: 15px; }
.catalog-results, .saved-results { display: grid; gap: 7px; }
.catalog-item { display: grid; align-items: center; grid-template-columns: 55px minmax(0,1fr) auto; gap: 10px; padding: 8px; border: 1px solid #2f2939; border-radius: 9px; background: #1b1922; }
.catalog-item .component-visual { width: 55px; height: 49px; }
.catalog-item h3 { font-size: 13px; line-height: 1.3; }
.catalog-item .button { min-height: 33px; font-size: 11px; padding-inline: 8px; }
.catalog-item-actions { display: flex; align-items: center; gap: 8px; }
.catalog-item-actions strong { white-space: nowrap; font-size: 13px; }
.part-note { color: var(--red); font-size: 11px; margin-top: 3px; }
.part-note.warning { color: var(--amber); }
.part-note.selected { color: var(--green); }
.empty-state { text-align: center; padding: 24px 9px; color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.save-form label { display: block; margin-bottom: 7px; }
.guide-text { color: #c5bed0; }
.guide-text ul { padding-left: 20px; margin-block: 8px 12px; }
.guide-text li + li { margin-top: 6px; }
.guide-text a { color: #caadff; text-decoration: underline; text-underline-offset: 3px; }
.guide-text p + p { margin-top: 9px; }
.saved-item { grid-template-columns: minmax(0,1fr) auto; padding: 11px; }
.saved-item h3 { overflow-wrap: anywhere; }
.toast { position: fixed; bottom: max(15px, env(safe-area-inset-bottom)); right: 17px; z-index: 5; display: flex; align-items: center; gap: 8px; max-width: calc(100% - 34px); padding: 10px 13px; border: 1px solid #514467; background: #211a30; color: #efe7ff; border-radius: 9px; box-shadow: 0 8px 36px #0007; animation: arrive .28s ease both; }
.toast [data-icon] { color: #b793ff; }
@keyframes arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes hero-image { from { opacity: .3; transform: scale(1.035); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 1050px) {
  .shell { width: calc(100% - 64px); }
  .workspace { grid-template-columns: minmax(0,1fr) minmax(280px, 315px); gap: 13px; }
  .hero-content { padding-left: 34px; }
}
@media (max-width: 800px) {
  .shell { width: calc(100% - 40px); }
  .header-inner { gap: 12px; }
  .header-nav { gap: 16px; }
  .header-nav > * { font-size: 12px; }
  .hero-content { width: 70%; padding-left: 26px; }
  .workspace { grid-template-columns: minmax(0,1fr) 263px; }
  .component { gap: 8px; grid-template-columns: 47px minmax(0,1fr) auto; padding-inline: 7px; }
  .component-visual { width: 47px; height: 49px; }
  .component-actions { gap: 5px; }
  .component-price { font-size: 13px; }
  .summary { padding: 13px; }
}
@media (max-width: 700px) {
  .workspace { grid-template-columns: minmax(0,1fr); }
  .summary { position: static; padding: 17px; }
  .component { grid-template-columns: 54px minmax(0,1fr) auto; min-height: 76px; }
  .component-visual { width: 54px; height: 54px; }
  .preset-grid { grid-template-columns: 1fr; }
  .preset-parts { min-height: 0; }
}
@media (max-width: 540px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { display: flex; justify-content: space-between; flex-wrap: wrap; padding: 11px 0 0; gap: 5px 10px; }
  .header-nav { order: 3; width: 100%; justify-content: space-between; gap: 7px; min-height: 40px; }
  .header-saved { min-height: 35px; font-size: 12px; padding-inline: 8px; }
  .hero { margin-top: 15px; min-height: 440px; align-items: flex-end; }
  .hero-art { background-size: auto 69%; background-position: 72% 0%; }
  .hero::after { background: linear-gradient(0deg, #100e17 1%, #100e17 37%, #100e1780 63%, transparent 83%); }
  .hero-content { width: 100%; padding: 0 14px 18px; }
  .hero h1 { font-size: clamp(38px, 10.9vw, 56px); }
  .hero p { margin-top: 13px; font-size: 13px; }
  .hero-actions { gap: 6px; margin-top: 14px; }
  .hero-actions .button { min-height: 39px; padding-inline: 8px; font-size: 11px; }
  .hero-actions .button svg { width: 13px; height: 13px; }
  .button-tail { margin-left: 0; }
  .section { margin-top: 27px; }
  .section-heading { align-items: center; gap: 7px; }
  .section-heading p { font-size: 12px; }
  .section-heading .button { padding-inline: 6px; font-size: 10px; min-height: 33px; gap: 4px; }
  .section-heading .button svg { width: 12px; height: 12px; }
  .component { grid-template-columns: 43px minmax(0,1fr) auto; }
  .component-visual { width: 43px; height: 45px; }
  .component-name { font-size: 13px; }
  .component-label, .component-spec { font-size: 10px; }
  .component-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 73px; gap: 4px; }
  .component-price { flex-basis: 100%; text-align: right; font-size: 13px; }
  .component-actions .icon-button { width: 30px; height: 28px; }
  .component-actions .icon-button svg { width: 13px; height: 13px; }
  .add-part { padding-inline: 5px; font-size: 10px; gap: 3px; }
  .add-part svg { width: 13px; height: 13px; }
  .catalog-controls { grid-template-columns: minmax(0,1fr) 116px; }
  .catalog-controls select { font-size: 11px; }
  .catalog-item { grid-template-columns: 39px minmax(0,1fr) auto; gap: 6px; padding: 6px; }
  .catalog-item .component-visual { width: 39px; height: 41px; }
  .catalog-item-actions { flex-wrap: wrap; justify-content: flex-end; width: 64px; gap: 3px; }
  .catalog-item-actions strong { font-size: 11px; }
  .catalog-item h3 { font-size: 12px; }
  .catalog-item .button { min-height: 29px; padding-inline: 5px; font-size: 10px; }
  .dialog-head { padding: 13px 12px 10px; }
  .dialog-head h2 { font-size: 20px; }
  #dialog-body { padding: 11px 12px 14px; }
  .saved-item { grid-template-columns: minmax(0,1fr) auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 540px) {
  .hero-art { background-image: url("./assets/hero-mobile.webp"); background-position: center top; background-size: 100% auto; }
}
.part-source { color: #bfa1f9; font-size: 10px; margin-top: 4px; }
.part-source a:hover, .part-source a:focus-visible { text-decoration: underline; text-underline-offset: 2px; }
.header-actions { justify-self: end; display: flex; justify-content: flex-end; gap: 7px; min-width: 0; }
.account-button { color: #d4bfff; background: #251c36; border-color: #453258; }
.account-button #account-label { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.connection-note { margin-top: 14px; padding: 9px 12px; border-radius: 8px; border: 1px solid #4e4027; color: var(--amber); background: #2b2418; }
.text-button { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.price-tag { display: inline-block; color: #e5bf84; margin: 3px 8px 0 0; font-size: 10px; }
.part-source { display: inline-block; }
.form-stack { display: grid; gap: 12px; }
.form-stack label:not(.check-label) { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.form-stack .field { margin: 0; font-weight: 400; }
.form-stack .dialog-actions { margin-top: 3px; }
.form-stack .check-label { margin: 0; min-height: 28px; }
.form-hint { color: var(--muted); font-size: 12px; }
.form-error { margin: 5px 0; }
.modal-link { margin-bottom: 10px; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; }
.admin-top > .button { min-height: 34px; padding-inline: 8px; }
.product-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.product-fields select[multiple] { min-height: 72px; }
@media (max-width: 880px) {
  .header-nav { gap: 14px; }
  .header-actions .button { font-size: 12px; padding-inline: 7px; }
  .account-button #account-label { max-width: 74px; }
}
@media (max-width: 580px) {
  .header-inner { display: flex; flex-wrap: wrap; justify-content: space-between; padding: 10px 0 0; gap: 4px 8px; }
  .header-nav { order: 3; width: 100%; justify-content: space-between; min-height: 39px; }
  .header-actions .button { min-height: 33px; padding-inline: 6px; gap: 4px; }
  .header-actions svg { width: 14px; height: 14px; }
  .product-fields { grid-template-columns: 1fr; }
}
