:root {
  --ink: #102044;
  --muted: #5f6d89;
  --line: #d9e1ef;
  --surface: #ffffff;
  --canvas: #f7f9fc;
  --accent: #1357e6;
  --accent-dark: #0b3fae;
  --soft: #edf3ff;
  --notice: #fff8e7;
  --focus: #714bd4;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  scroll-behavior: smooth;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, input, select { min-height: 44px; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: 1rem; top: -5rem; z-index: 10; padding: .75rem 1rem; background: var(--surface); }
.skip-link:focus { top: 1rem; }
.site-header, main { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.site-header { display: flex; justify-content: space-between; gap: 2rem; align-items: center; padding: 1.15rem 0; }
.site-title { display: flex; gap: .7rem; align-items: center; color: var(--ink); font-size: 1.02rem; font-weight: 780; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid var(--accent); border-radius: 12px; color: var(--accent); font-size: .72rem; font-weight: 850; }
.site-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a { color: var(--muted); font-size: .92rem; text-decoration: none; }
.site-nav a:hover { color: var(--accent-dark); }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 1rem; font-size: clamp(2.45rem, 5vw, 4.45rem); line-height: 1.02; letter-spacing: -.052em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.45rem); line-height: 1.08; letter-spacing: -.028em; }
h3 { font-size: 1.14rem; }
.lead, .hint, .query-caption, .page-disclaimer { color: var(--muted); }
.lead { max-width: 720px; font-size: 1.08rem; line-height: 1.55; }
.step { margin-bottom: .6rem; color: var(--accent-dark); font-size: .74rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.panel { margin-bottom: 1rem; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 34px rgba(16, 32, 68, .055); }
.hero-section { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .72fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; min-height: 610px; padding: clamp(3rem, 8vw, 6rem) 0; }
.hero-copy .lead { margin-bottom: 2rem; }
.hero-search { max-width: 820px; }
label, legend { display: block; font-weight: 680; }
input:not([type="radio"]):not([type="checkbox"]), select, textarea { width: 100%; margin-top: .5rem; padding: .8rem .9rem; border: 1px solid #9eabc2; border-radius: 10px; background: var(--surface); color: var(--ink); }
textarea { min-height: 138px; resize: vertical; line-height: 1.5; }
.mark-search-row { display: grid; grid-template-columns: minmax(0, 1fr) 205px; gap: .75rem; align-items: end; }
.mark-search-row .primary { min-height: 48px; }
#mark-help { margin: .65rem 0 0; }
.hero-map { padding: 1.5rem; border: 1px solid #cdd9f0; border-radius: 24px; background: linear-gradient(180deg, #f4f7ff 0%, #fff 100%); }
.hero-map-label { display: block; margin-bottom: .8rem; color: var(--accent-dark); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.hero-map ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.hero-map li { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: .8rem; align-items: center; padding: .7rem 0; }
.hero-map li:not(:last-child)::after { content: ""; position: absolute; left: 18px; top: 48px; bottom: -2px; width: 1px; background: #b8c9ec; }
.hero-map li > span { z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; }
.hero-map strong, .hero-map small { display: block; }
.hero-map small { margin-top: .1rem; color: var(--muted); }
.outcome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: clamp(3rem, 8vw, 6rem); }
.outcome-grid article { padding: 1.5rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.outcome-grid h2 { margin: .9rem 0 .45rem; font-size: 1.15rem; letter-spacing: -.01em; }
.outcome-grid p { margin: 0; color: var(--muted); line-height: 1.45; }
.outcome-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--soft); color: var(--accent); font-size: 1.45rem; font-weight: 800; }
.journey-section { margin: 0 calc(50% - 50vw) 4rem; padding: clamp(3rem, 7vw, 5.5rem) max(1rem, calc(50vw - 590px)); background: #f0f5ff; scroll-margin-top: 1rem; }
.journey-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: start; margin-bottom: 2rem; }
.journey-heading .lead { margin-bottom: 0; }
.journey-number { display: grid; flex: 0 0 auto; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1.35rem; font-weight: 850; }
.scope-workspace { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 1rem; align-items: start; }
.scope-resolver, .mktu-explainer { padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 32px rgba(16, 32, 68, .045); }
.scope-resolver h3 { margin-bottom: 1.1rem; }
.scope-action { width: 100%; margin-top: 1rem; }
.known-class-link { width: auto; margin-top: .8rem; }
.scope-suggestion-status { min-height: 0; margin-top: .8rem; color: var(--muted); }
.scope-suggestion-status:not(:empty) { min-height: 1.5rem; }
.scope-confirmation { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.scope-confirmation h3 { margin-bottom: .35rem; }
#scope-suggestions { display: grid; gap: .65rem; margin: 1rem 0; }
.scope-candidate { display: grid; grid-template-columns: 22px 1fr; gap: .75rem; padding: .9rem; border: 1px solid var(--line); border-radius: 11px; background: #fbfcff; font-weight: 500; }
.scope-candidate input { width: 20px; height: 20px; margin-top: .1rem; }
.scope-candidate span, .scope-candidate small { display: block; }
.scope-candidate-heading { margin-top: .15rem; }
.scope-candidate-terms { margin-top: .35rem; color: var(--muted); line-height: 1.4; }
.mktu-explainer { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 1rem; background: #fbfcff; }
.mktu-explainer h3 { margin-bottom: .75rem; font-size: 1.35rem; line-height: 1.2; }
.mktu-explainer p { color: #334260; line-height: 1.55; }
.mktu-explainer p:last-child { margin-bottom: 0; }
.info-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--accent); border-radius: 50%; color: var(--accent-dark); font-weight: 850; }
.example-note { padding-top: 1rem; border-top: 1px solid var(--line); }
.manual-scope-fields { margin-top: 1rem; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.field-heading, .section-heading, .dialog-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.class-picker, .class-map { display: grid; grid-template-columns: repeat(9, minmax(54px, 1fr)); gap: .45rem; }
.class-toggle, .class-card { min-height: 50px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-weight: 750; }
.class-toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); box-shadow: inset 0 0 0 1px var(--accent); }
.class-card { display: grid; place-items: center; gap: .1rem; padding: .4rem; }
.class-card small { color: var(--muted); font-weight: 500; }
.class-card.has-results { border-width: 2px; border-color: var(--accent); }
.goods-details { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.goods-details summary { cursor: pointer; color: var(--accent-dark); font-weight: 750; }
.goods-heading { margin-top: 1rem; }
.goods-heading .hint { margin: 0; }
.goods-row { display: grid; grid-template-columns: 1fr 110px 44px; gap: .6rem; align-items: end; margin-top: .75rem; }
.scoped-search-action { width: 100%; margin-top: 1rem; }
.primary, .secondary, .link-button, .icon-button { border-radius: 10px; font-weight: 750; }
.primary { padding: .78rem 1.15rem; border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-dark); }
.secondary { padding: .68rem .92rem; border: 1px solid var(--accent); background: var(--surface); color: var(--accent-dark); }
.link-button { padding: .35rem; border: 0; background: transparent; color: var(--accent-dark); text-decoration: none; }
.link-button:hover { text-decoration: underline; }
.icon-button { width: 44px; border: 1px solid var(--line); background: var(--surface); font-size: 1.4rem; }
.status-panel { scroll-margin-top: 1rem; text-align: center; }
.status-panel p { margin: .4rem 0 0; }
.spinner { display: inline-block; width: 1rem; height: 1rem; margin-right: .6rem; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-section { scroll-margin-top: 1rem; }
.result-hero { display: flex; justify-content: space-between; gap: 2rem; align-items: center; padding-block: 2.2rem; }
.result-hero h2 { margin-bottom: .35rem; }
.result-heading-copy .secondary { margin-top: .75rem; }
.coverage-badge { min-width: 230px; padding: .9rem 1rem; border: 2px solid var(--ink); border-radius: 12px; }
.coverage-badge span, .coverage-badge small { display: block; }
.coverage-badge span { font-weight: 800; }
.coverage-badge small { margin-top: .2rem; color: var(--muted); }
.notice { margin-bottom: 1rem; padding: 1rem 1.25rem; border: 1px solid #caa959; border-radius: 12px; background: var(--notice); }
.notice p { margin: .25rem 0 0; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.coverage-list, .facts { display: grid; grid-template-columns: minmax(150px, 1fr) auto; gap: .65rem 1rem; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 680; text-align: right; }
.plain-list { padding-left: 1.2rem; }
.matches-list { display: grid; gap: .75rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.match-card { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
.rank { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--soft); font-weight: 800; }
.match-card h3 { margin: 0 0 .25rem; font-size: 1.15rem; overflow-wrap: anywhere; }
.match-meta { margin: 0; color: var(--muted); }
.match-card .secondary { white-space: nowrap; }
.empty-state { padding: 2rem; border: 1px dashed #9da8bc; border-radius: 12px; text-align: center; }
.empty-state p { margin: .4rem 0 0; color: var(--muted); }
.class-map-details > summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.class-map-details > summary::-webkit-details-marker { display: none; }
.class-map-details > summary span span, .class-map-details > summary strong { display: block; }
.class-map-details > summary strong { margin-top: .2rem; font-size: 1.15rem; }
.class-map-heading { margin: 1rem 0 .75rem; }
.class-map-heading p { margin: 0; }
dialog { width: min(760px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 1.5rem; border: 0; border-radius: 18px; color: var(--ink); }
dialog::backdrop { background: rgba(22, 33, 60, .52); }
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.metric { padding: .9rem; border: 1px solid var(--line); border-radius: 10px; }
.metric strong, .metric span { display: block; }
.metric span { margin-top: .25rem; color: var(--muted); font-size: .85rem; }
.page-disclaimer { margin: 1.5rem auto 2.5rem; text-align: center; font-size: .86rem; }
@media (max-width: 860px) {
  .hero-section, .scope-workspace { grid-template-columns: 1fr; }
  .hero-section { min-height: 0; padding: 3rem 0; }
  .hero-map { max-width: 620px; }
  .outcome-grid { grid-template-columns: 1fr; }
  .mktu-explainer { order: -1; }
}
@media (max-width: 760px) {
  .site-nav a { display: none; }
  .result-grid { grid-template-columns: 1fr; }
  .mark-search-row { grid-template-columns: 1fr; }
  .class-picker, .class-map { grid-template-columns: repeat(5, 1fr); }
  .result-hero, .section-heading, .journey-heading { align-items: stretch; flex-direction: column; }
  .journey-number { display: none; }
  .coverage-badge { min-width: 0; }
  .match-card { grid-template-columns: 44px minmax(0, 1fr); }
  .match-card .secondary { grid-column: 1 / -1; }
}
@media (max-width: 460px) {
  .site-header { gap: 1rem; }
  .site-title span:last-child { max-width: 150px; line-height: 1.15; }
  h1 { font-size: 2.35rem; }
  .hero-map { padding: 1rem; }
  .goods-row { grid-template-columns: 1fr 86px 44px; }
  .class-picker, .class-map { grid-template-columns: repeat(3, 1fr); }
  .metrics { grid-template-columns: 1fr; }
  .mktu-explainer { grid-template-columns: 1fr; }
}
@media print {
  :root, body { background: #fff; }
  body { font-size: 10.5pt; }
  .site-header, main { width: 100%; }
  .site-header { padding-top: 0; }
  .hero-section, .outcome-grid, .journey-section, .print-only-control, dialog, .page-disclaimer { display: none !important; }
  .panel { box-shadow: none; break-inside: avoid; }
  .matches-list { break-inside: auto; }
  .match-card { break-inside: avoid; }
  .result-grid { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  .spinner { animation: none; }
}
