:root {
  --ink: #152522;
  --ink-soft: #50615d;
  --forest: #173f38;
  --forest-2: #21564d;
  --mint: #dceee8;
  --mint-soft: #eff7f4;
  --paper: #fbfaf6;
  --white: #ffffff;
  --line: #dbe4e0;
  --line-strong: #c5d3ce;
  --gold: #d9a83e;
  --gold-soft: #fff2cf;
  --success: #2b7359;
  --success-soft: #e2f4ec;
  --warning: #a96813;
  --warning-soft: #fff0d4;
  --danger: #a33e3e;
  --danger-soft: #fbe7e4;
  --shadow: 0 22px 60px rgba(28, 58, 51, 0.09);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shell: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(220, 238, 232, 0.72), transparent 26rem),
    linear-gradient(180deg, #f7faf7 0, var(--paper) 42rem);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--forest);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid rgba(197, 211, 206, 0.72);
  background: rgba(251, 250, 246, 0.78);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 21px;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.brand > span:last-child > span {
  color: var(--gold);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--forest);
}

.brand-mark svg {
  width: 100%;
}

.source-pill,
.unit-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  padding: 8px 12px;
}

.source-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #57a27f;
  box-shadow: 0 0 0 4px rgba(87, 162, 127, 0.12);
}

.hero {
  padding-block: 82px 64px;
  text-align: center;
}

.eyebrow,
.section-kicker {
  color: var(--forest-2);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.hero h1 {
  max-width: 860px;
  margin: 18px auto 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 7vw, 78px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero h1 em {
  color: var(--forest-2);
  font-weight: 500;
}

.hero > p {
  max-width: 650px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 17px;
}

.process {
  max-width: 780px;
  margin: 50px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.process-step {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: max-content;
  text-align: left;
  color: #82908c;
}

.process-step > span {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.process-step.is-active > span {
  border-color: var(--forest);
  color: #fff;
  background: var(--forest);
}

.process-step strong,
.process-step small {
  display: block;
}

.process-step strong {
  color: var(--ink);
  font-size: 13px;
}

.process-step small {
  margin-top: 2px;
  font-size: 11px;
}

.process-line {
  width: 70px;
  height: 1px;
  margin-inline: 20px;
  background: var(--line-strong);
}

.app-section {
  padding-bottom: 76px;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
  gap: 24px;
  align-items: start;
}

.panel,
.table-card,
.match-card {
  border: 1px solid rgba(197, 211, 206, 0.8);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.panel {
  padding: 34px;
}

.result-panel {
  min-height: 660px;
}

.panel-heading,
.measure-heading,
.result-topline,
.subsection-heading,
.section-heading-row,
.footer-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading {
  margin-bottom: 28px;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 2px 10px;
}

.panel h2,
.section-heading-row h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 560;
  letter-spacing: -0.03em;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 0;
  color: var(--forest-2);
  background: transparent;
  font-size: 12px;
  font-weight: 720;
}

.text-button:hover {
  color: var(--ink);
}

.text-button svg {
  width: 17px;
  height: 17px;
}

fieldset {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

legend,
.field-group > label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-label {
  position: relative;
  display: block;
}

.choice-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.choice-card:hover {
  border-color: #a8bdb6;
  transform: translateY(-1px);
}

.choice-label input:focus-visible + .choice-card {
  outline: 3px solid rgba(33, 86, 77, 0.2);
  outline-offset: 2px;
}

.choice-label input:checked + .choice-card {
  border-color: var(--forest-2);
  background: var(--mint-soft);
  box-shadow: inset 0 0 0 1px var(--forest-2);
}

.choice-icon {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--forest-2);
  background: var(--mint);
}

.choice-icon svg {
  width: 23px;
  height: 23px;
}

.choice-card strong,
.choice-card small {
  display: block;
}

.choice-card strong {
  font-size: 14px;
}

.choice-card small {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.3;
}

.field-group {
  margin-bottom: 28px;
}

.garment-card {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 26px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--mint-soft);
}

.garment-card small,
.garment-card strong {
  display: block;
}

.garment-card small {
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.garment-card strong {
  font-size: 14px;
}

.select-wrap {
  position: relative;
}

select,
.measure-input,
.inventory-input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

select {
  padding: 0 44px 0 14px;
  appearance: none;
  font-size: 14px;
  font-weight: 620;
}

.select-wrap > svg {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 18px;
  pointer-events: none;
  transform: translateY(-50%);
}

select:focus,
.measure-input:focus,
.inventory-input:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 4px rgba(33, 86, 77, 0.1);
}

.field-note,
.input-hint {
  margin: 7px 2px 0;
  color: var(--ink-soft);
  font-size: 10.5px;
}

.decision-controls {
  margin: 4px 0 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfb;
}

.decision-controls .measure-heading {
  margin: 0 0 16px;
  padding-top: 0;
  border-top: 0;
}

.decision-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.decision-input-grid .field-group {
  margin-bottom: 10px;
}

.inventory-field {
  margin: 10px 0 0;
}

.inventory-input {
  padding: 0 14px;
  font-size: 14px;
  font-weight: 620;
}

.optional-label {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
}

.measure-heading {
  align-items: flex-end;
  margin: 8px 0 16px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.measure-heading h3 {
  margin: 4px 0 0;
  font-size: 15px;
}

.unit-pill {
  padding: 5px 10px;
}

.measure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
}

.public-measure-grid .measure-field:last-child {
  grid-column: 1 / -1;
}

.fit-preference-field {
  margin-top: 24px;
}

.measure-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 11.5px;
  font-weight: 720;
}

.required-mark {
  margin-left: 4px;
  color: var(--forest-2);
  font-size: 8px;
  font-weight: 780;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.source-code {
  color: #7b8986;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.input-wrap {
  position: relative;
}

.measure-input {
  padding: 0 47px 0 14px;
  font-size: 16px;
  font-weight: 680;
}

.input-wrap > span {
  position: absolute;
  top: 50%;
  right: 14px;
  color: #7f8d89;
  font-size: 11px;
  transform: translateY(-50%);
}

.measure-input[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fffafa;
}

.measurement-guide {
  margin-top: 8px;
}

.measurement-guide summary {
  width: fit-content;
  color: var(--forest-2);
  font-size: 10px;
  font-weight: 760;
  cursor: pointer;
}

.measurement-guide summary::marker,
.form-disclosure summary::marker,
.result-disclosure summary::marker {
  color: var(--gold);
}

.guide-content {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfb;
}

.guide-content svg {
  width: 100%;
  max-height: 112px;
}

.guide-body {
  fill: #f7faf8;
  stroke: #a8b8b3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.guide-measure-line {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-width: 3;
}

.guide-point {
  fill: #fff;
  stroke: var(--gold);
  stroke-width: 2.5;
}

.guide-content p {
  margin: 3px 0 6px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.45;
}

.guide-content ul {
  margin: 0;
  padding-left: 16px;
  color: var(--ink-soft);
  font-size: 9.5px;
  line-height: 1.5;
}

.form-disclosure,
.result-disclosure {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}

.form-disclosure > summary,
.result-disclosure > summary {
  padding: 13px 15px;
  color: var(--forest-2);
  font-size: 11px;
  font-weight: 780;
  cursor: pointer;
}

.form-disclosure[open] > summary,
.result-disclosure[open] > summary {
  border-bottom: 1px solid var(--line);
}

.form-disclosure > .measure-grid,
.form-disclosure > .field-group,
.form-disclosure > .disclosure-intro {
  margin-inline: 15px;
}

.form-disclosure > .measure-grid {
  margin-top: 15px;
  margin-bottom: 16px;
}

.form-disclosure > .field-group {
  margin-top: 15px;
  margin-bottom: 16px;
}

.disclosure-intro {
  margin-top: 13px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.form-error {
  margin: 15px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 12px;
}

.primary-button {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--forest);
  box-shadow: 0 10px 25px rgba(23, 63, 56, 0.2);
  font-size: 14px;
  font-weight: 760;
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  background: #205148;
  box-shadow: 0 13px 30px rgba(23, 63, 56, 0.24);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button svg {
  width: 20px;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  margin: 14px 0 0;
  color: #7b8986;
  font-size: 10px;
  text-align: center;
}

.privacy-note svg {
  width: 14px;
  flex: 0 0 auto;
}

.empty-state {
  min-height: 590px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}

.empty-illustration {
  width: 152px;
  height: 152px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 50%;
  color: #5c8d80;
  background: radial-gradient(circle, #f2f9f6 0, rgba(242, 249, 246, 0) 70%);
}

.empty-illustration svg {
  width: 100%;
}

.empty-state h2 {
  margin-top: 10px;
}

.empty-state p {
  max-width: 390px;
  margin: 12px auto 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.empty-tags {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.empty-tags span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #84918e;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-topline {
  margin-bottom: 24px;
}

.status-badge,
.row-status,
.match-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 760;
}

.status-badge {
  gap: 7px;
  padding: 7px 11px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.is-standard {
  color: var(--success);
  background: var(--success-soft);
}

.is-very-good {
  color: #176846;
  background: #dff4e9;
}

.is-check {
  color: var(--warning);
  background: var(--warning-soft);
}

.is-correction {
  color: #9a5216;
  background: #ffe8d4;
}

.is-alteration {
  color: var(--warning);
  background: var(--warning-soft);
}

.is-custom {
  color: var(--danger);
  background: var(--danger-soft);
}

.result-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.result-overline {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 12px;
}

.result-hero h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
}

.result-hero h2 strong {
  color: var(--forest-2);
  font-size: 52px;
}

.result-length-warning {
  display: block;
  max-width: 290px;
  margin-top: 4px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--warning);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.35;
}

.height-variant {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.height-variant.is-length-warning {
  max-width: 330px;
  margin-top: 9px;
  padding: 8px 10px;
  border-left: 3px solid var(--warning);
  border-radius: 0 8px 8px 0;
  color: #845515;
  background: var(--warning-soft);
  font-weight: 650;
  line-height: 1.45;
}

.fit-ring {
  width: 108px;
  min-height: 92px;
  display: grid;
  flex: 0 0 auto;
  place-content: center;
  padding: 14px 10px;
  border: 1px solid currentColor;
  border-radius: 18px;
  text-align: center;
}

.fit-ring span,
.fit-ring small {
  display: block;
}

.fit-ring span {
  max-width: 86px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.fit-ring small {
  color: var(--ink-soft);
  font-size: 8px;
  text-transform: uppercase;
}

.result-summary {
  margin: 22px 0;
  padding: 15px 17px;
  border-left: 3px solid var(--forest-2);
  border-radius: 0 11px 11px 0;
  color: var(--ink-soft);
  background: var(--mint-soft);
  font-size: 12px;
  line-height: 1.6;
}

.public-result-hero {
  padding-bottom: 18px;
}

.public-fit-options {
  margin-top: 18px;
}

.public-fit-options .technical-variant:only-child {
  grid-column: 1 / -1;
}

.detail-content {
  padding: 15px;
}

.detail-content .technical-range-card {
  margin-top: 0;
}

.detail-content .comparison-section,
.detail-content .matches-section {
  padding: 20px 0 0;
}

.detail-content .section-heading-row {
  margin-bottom: 12px;
}

.detail-content .section-heading-row h2 {
  font-size: 18px;
}

.professional-terminology .detail-content p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.professional-terminology .detail-content p + p {
  margin-top: 9px;
}

.technical-decision-section,
.production-result-section {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.technical-decision-section h3,
.production-result-section h3 {
  margin: 0;
  font-size: 13px;
}

.technical-range-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 11px;
  color: var(--forest-2);
  background: var(--mint-soft);
}

.technical-range-card span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.technical-range-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  white-space: nowrap;
}

.technical-variants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.technical-variant {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
}

.technical-variant span,
.technical-variant strong,
.technical-variant small {
  display: block;
}

.technical-variant span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.technical-variant strong {
  margin-top: 3px;
  color: var(--forest-2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.technical-variant small {
  margin-top: 2px;
  color: var(--success);
  font-size: 9px;
  font-weight: 750;
}

.decision-message,
.operational-recommendation {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.operational-recommendation {
  padding: 12px 14px;
  border-left: 3px solid var(--forest-2);
  border-radius: 0 10px 10px 0;
  background: var(--mint-soft);
  font-weight: 650;
}

.operational-recommendation.is-warning {
  border-left-color: var(--warning);
  color: #845515;
  background: var(--warning-soft);
}

.why-section h3,
.auxiliary-section h3,
.length-section h3,
.reference-section h3 {
  margin: 0;
  font-size: 13px;
}

.reason-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 22px;
  padding: 0;
  list-style: none;
}

.reason-list li {
  position: relative;
  padding-left: 25px;
  color: var(--ink-soft);
  font-size: 11.5px;
}

.reason-list li::before {
  content: "✓";
  position: absolute;
  top: 0;
  left: 0;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--success);
  background: var(--success-soft);
  font-size: 10px;
  font-weight: 900;
}

.reason-list li.is-warning::before {
  content: "!";
  color: var(--warning);
  background: var(--warning-soft);
}

.compact-list {
  margin-bottom: 0;
}

.control-status {
  display: table;
  margin-bottom: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 9px;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.control-status.is-warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.secondary-result-section {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfb;
}

.secondary-result-heading h3 {
  margin: 5px 0 0;
  font-size: 14px;
}

.secondary-result-heading p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.secondary-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.auxiliary-section,
.length-section,
.reference-section {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.auxiliary-section,
.length-section {
  margin-top: 20px;
}

.secondary-result-section .auxiliary-section,
.secondary-result-section .length-section {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.auxiliary-section .reason-list,
.length-section .reason-list {
  margin-top: 12px;
}

.subsection-heading span {
  color: #84918e;
  font-size: 9px;
  text-transform: uppercase;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.reference-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
}

.reference-item span,
.reference-item strong {
  display: block;
}

.reference-item span {
  overflow: hidden;
  color: #7b8986;
  font-size: 8px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.reference-item strong {
  margin-top: 2px;
  font-size: 13px;
}

.reference-item small {
  display: block;
  margin-top: 4px;
  color: #8b9794;
  font-size: 8px;
  line-height: 1.25;
}

.comparison-section,
.matches-section {
  padding-bottom: 70px;
}

.section-heading-row {
  align-items: flex-end;
  margin-bottom: 20px;
}

.section-heading-row > p {
  max-width: 400px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  text-align: right;
}

.table-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 45px rgba(28, 58, 51, 0.07);
}

.comparison-row {
  display: grid;
  grid-template-columns: 1.35fr 0.7fr 0.85fr 1fr;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.comparison-row:first-child,
.comparison-head + #comparison-rows .comparison-row:first-child {
  border-top: 0;
}

.comparison-head {
  min-height: 44px;
  color: #6f7e7a;
  background: #f5f8f6;
  font-size: 9px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.metric-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--line-strong);
}

.metric-dot.is-ok {
  background: var(--success);
}

.metric-dot.is-near {
  background: var(--warning);
}

.metric-dot.is-far {
  background: var(--danger);
}

.comparison-value {
  font-weight: 760;
}

.range-value {
  color: var(--ink-soft);
}

.row-status {
  width: fit-content;
  padding: 5px 8px;
  font-size: 9px;
}

.matches-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.match-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 38px rgba(28, 58, 51, 0.06);
}

.match-card.is-best {
  border-color: #7da497;
  background: linear-gradient(145deg, #f4faf7, #fff 65%);
}

.match-card.is-best::before {
  content: "Najlepszy wybór";
  position: absolute;
  top: 0;
  right: 0;
  padding: 5px 10px;
  border-radius: 0 18px 0 10px;
  color: #fff;
  background: var(--forest-2);
  font-size: 8px;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.match-card.is-not-equivalent {
  border-style: dashed;
  border-color: #d9b477;
  background: #fffcf6;
  box-shadow: none;
}

.match-rank {
  color: #83918d;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.match-size span,
.match-size strong {
  display: block;
}

.match-size span {
  color: var(--ink-soft);
  font-size: 10px;
}

.match-size strong {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--forest-2);
  font-size: 39px;
  line-height: 1;
}

.match-score {
  font-size: 18px;
  font-weight: 800;
}

.match-score small {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
}

.match-status {
  width: fit-content;
  padding: 5px 8px;
  font-size: 9px;
  white-space: nowrap;
}

.match-bar {
  height: 5px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeeb;
}

.match-bar span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--forest-2);
}

.match-note {
  margin: 11px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.empty-alternative {
  grid-column: 1 / -1;
}

.source-note {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 70px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink-soft);
  background: rgba(239, 247, 244, 0.7);
}

.source-icon {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--forest-2);
  background: #fff;
}

.source-icon svg {
  width: 22px;
}

.source-note strong {
  color: var(--ink);
  font-size: 12px;
}

.source-note p {
  margin: 3px 0 0;
  font-size: 10.5px;
}

footer {
  border-top: 1px solid var(--line);
  color: #788783;
  background: rgba(255, 255, 255, 0.5);
  font-size: 10px;
}

.footer-wrap {
  min-height: 70px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .hero {
    padding-block: 64px 52px;
  }

  .process-line {
    width: 34px;
    margin-inline: 12px;
  }

  .process-step small {
    display: none;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .result-panel {
    min-height: auto;
  }

  .empty-state {
    min-height: 480px;
  }

  .matches-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(calc(100% - 24px), var(--shell));
  }

  .nav-wrap {
    min-height: 64px;
  }

  .source-pill {
    font-size: 9px;
    padding: 7px 9px;
  }

  .hero {
    padding-block: 50px 40px;
  }

  .hero h1 {
    font-size: clamp(41px, 13vw, 57px);
  }

  .hero > p {
    font-size: 14px;
  }

  .process {
    justify-content: space-between;
    margin-top: 34px;
  }

  .process-step {
    flex-direction: column;
    min-width: 64px;
    gap: 6px;
    text-align: center;
  }

  .process-step > div strong {
    max-width: 70px;
    font-size: 9px;
    line-height: 1.2;
  }

  .process-line {
    flex: 1;
    min-width: 12px;
    margin: -20px 6px 0;
  }

  .app-section,
  .comparison-section,
  .matches-section {
    padding-bottom: 48px;
  }

  .panel {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .panel-actions {
    align-items: flex-end;
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .panel h2,
  .section-heading-row h2 {
    font-size: 24px;
  }

  .text-button {
    padding-top: 3px;
    font-size: 10px;
  }

  .choice-card {
    min-height: 78px;
    padding: 12px;
  }

  .choice-icon {
    width: 36px;
    height: 36px;
  }

  .choice-card small {
    display: none;
  }

  .measure-grid {
    grid-template-columns: 1fr;
  }

  .decision-input-grid,
  .technical-variants {
    grid-template-columns: 1fr;
  }

  .empty-state {
    min-height: 430px;
    padding: 20px 5px;
  }

  .empty-illustration {
    width: 126px;
    height: 126px;
  }

  .result-hero h2 {
    font-size: 27px;
  }

  .result-hero h2 strong {
    font-size: 44px;
  }

  .fit-ring {
    width: 92px;
    min-height: 78px;
  }

  .reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .secondary-result-grid {
    grid-template-columns: 1fr;
  }

  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading-row > p {
    text-align: left;
  }

  .comparison-head {
    display: none;
  }

  .comparison-row {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 15px 16px;
  }

  .comparison-row > span:nth-child(2) {
    text-align: right;
  }

  .comparison-row > span:nth-child(3) {
    grid-column: 1;
    padding-left: 18px;
    font-size: 10px;
  }

  .comparison-row > span:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
  }

  .source-note {
    align-items: flex-start;
    margin-bottom: 48px;
  }

  .footer-wrap {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 82px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
