:root {
  --blue: #0a4164;
  --blue-2: #126a9d;
  --blue-3: #dceaf2;
  --orange: #f59b00;
  --orange-soft: #fff3da;
  --ice: #f2f7fa;
  --paper: #ffffff;
  --ink: #173247;
  --muted: #687b8c;
  --line: #d6e2e9;
  --shadow: 0 14px 38px rgba(10, 65, 100, 0.09);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f7fafb;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #f7fafb; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 84px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; height: 70px; }
.brand img { width: 112px; height: 68px; object-fit: contain; }
.topbar__meta { display: flex; align-items: center; gap: 14px; }
.edition { color: var(--blue); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.edition i { width: 8px; height: 8px; border-radius: 50%; background: #3ba875; box-shadow: 0 0 0 4px #e5f5ed; }

.icon-button {
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--blue);
  display: grid; place-items: center; transition: 160ms ease;
}
.icon-button:hover { border-color: var(--orange); color: var(--orange); transform: rotate(5deg); }
.icon-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

main { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.intro { padding: 54px 0 38px; display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.eyebrow { margin: 0 0 8px; color: var(--orange); font-size: 11px; line-height: 1.2; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.intro h1 { margin: 0; max-width: 700px; color: var(--blue); font-size: clamp(36px, 5vw, 58px); line-height: .98; letter-spacing: -.045em; }
.intro h1 span { color: var(--blue-2); font-weight: 400; }
.intro__copy { margin: 0 0 4px; max-width: 390px; color: var(--muted); font-size: 16px; line-height: 1.55; }

.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 26px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--paper);
}
.steps a { padding: 14px 20px; display: flex; align-items: center; gap: 10px; color: var(--muted); text-decoration: none; font-size: 13px; border-right: 1px solid var(--line); }
.steps a:last-child { border-right: 0; }
.steps b { color: var(--orange); font-size: 11px; }
.steps span { font-weight: 700; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(340px, .82fr); gap: 26px; align-items: start; }
.editor { display: grid; gap: 22px; min-width: 0; }
.panel, .summary { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel { padding: 30px; }
.section-heading { display: flex; align-items: center; gap: 14px; padding-bottom: 24px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.section-heading--compact { margin-bottom: 22px; }
.section-number { flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 12px; font-weight: 800; }
.section-heading .eyebrow { margin-bottom: 3px; }
.section-heading h2 { margin: 0; color: var(--blue); font-size: 22px; letter-spacing: -.02em; }
.subsection + .subsection { margin-top: 24px; }
.subsection h3 { margin: 0 0 14px; color: var(--blue); font-size: 13px; }
.subsection--tinted { margin: 25px -12px -12px; padding: 20px 18px 18px; border-radius: 13px; background: var(--ice); }
.signature-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.signature-section h3 { margin: 0 0 14px; color: var(--blue); font-size: 13px; }
.signature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.signature-pad { min-width: 0; }
.signature-pad__heading { min-height: 30px; display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.signature-pad__heading label { color: #3f5567; font-size: 12px; font-weight: 700; line-height: 1.35; }
.signature-pad__heading button { padding: 2px 0; border: 0; background: transparent; color: var(--blue-2); font-size: 11px; font-weight: 700; }
.signature-pad__heading button:hover { color: #c94a43; }
.signature-pad canvas { display: block; width: 100%; height: 150px; border: 1px solid #cbd9e2; border-radius: 8px; background: #fff; cursor: crosshair; touch-action: none; }
.signature-pad canvas:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(18, 106, 157, .11); outline: none; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field > span { color: #3f5567; font-size: 12px; font-weight: 700; }
.field small { color: var(--muted); font-size: 11px; line-height: 1.35; }
input, select, textarea {
  width: 100%; border: 1px solid #cbd9e2; border-radius: 10px; background: #fff; color: var(--ink); outline: none; padding: 12px 13px; transition: 150ms ease;
}
input, select { height: 45px; }
textarea { resize: vertical; min-height: 92px; }
input::placeholder, textarea::placeholder { color: #9aabb7; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(18, 106, 157, .11); }
input:invalid:not(:placeholder-shown) { border-color: #c94a43; }
.input-suffix { display: flex; position: relative; }
.input-suffix input { padding-right: 66px; }
.input-suffix i { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; font-style: normal; }

.product-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.product-tab {
  min-width: 0; padding: 15px 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); text-align: left; display: flex; align-items: center; gap: 9px; transition: 160ms ease;
}
.product-tab:hover { border-color: #a9c4d5; transform: translateY(-1px); }
.product-tab.is-active { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: var(--ice); }
.product-tab > span:last-child { min-width: 0; }
.product-tab b, .product-tab small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-tab b { color: var(--blue); font-size: 12px; }
.product-tab small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.product-icon { flex: 0 0 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-3); color: var(--blue); }
.product-tab.is-active .product-icon { background: var(--orange); color: white; }
.product-icon svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.config-area { margin-top: 26px; padding-top: 25px; border-top: 1px solid var(--line); }
.config-header { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.config-header h3 { margin: 0; color: var(--blue); font-size: 17px; }
.config-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.tag { flex: 0 0 auto; align-self: start; padding: 7px 10px; border-radius: 999px; background: var(--orange-soft); color: #a66300; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.config-grid .field--wide { grid-column: 1 / -1; }
.measure-list { grid-column: 1 / -1; display: grid; gap: 12px; }
.measure-row { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f9fbfc; }
.measure-row__heading { min-height: 30px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.measure-row__heading b { color: var(--blue); font-size: 12px; }
.measure-row__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.measure-remove { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); font-size: 21px; line-height: 1; }
.measure-remove:hover { border-color: #c94a43; color: #c94a43; }
.measure-row:only-child .measure-remove { visibility: hidden; }
.add-measure-button { grid-column: 1 / -1; justify-self: start; min-height: 40px; padding: 9px 14px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--blue); border-radius: 8px; background: #fff; color: var(--blue); font-size: 12px; font-weight: 800; }
.add-measure-button:hover { background: var(--ice); }
.add-measure-button span { font-size: 19px; line-height: 1; }
.option-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check-card { min-height: 64px; display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.check-card:hover { border-color: #a9c4d5; }
.check-card input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.check-card span { display: grid; gap: 2px; }
.check-card b { color: var(--blue); font-size: 12px; }
.check-card small { color: var(--muted); font-size: 10.5px; line-height: 1.3; }
.config-note { grid-column: 1 / -1; padding: 12px 14px; border-left: 3px solid var(--orange); background: var(--orange-soft); color: #785115; font-size: 11px; line-height: 1.45; }

.summary { position: sticky; top: 104px; }
.summary__visual { position: relative; height: 188px; background: var(--blue); overflow: hidden; }
.summary__visual::after { content: ""; position: absolute; inset: 0; background: rgba(6, 45, 70, .24); }
.summary__visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.summary__visual span { position: absolute; left: 20px; bottom: 18px; z-index: 1; padding: 7px 10px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.summary__body { padding: 25px; }
.summary__body h2 { margin: 0; color: var(--blue); font-size: 23px; line-height: 1.15; letter-spacing: -.025em; }
.summary__subtitle { min-height: 34px; margin: 8px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.summary-lines { display: grid; gap: 11px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.summary-line span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.summary-line b { color: var(--ink); font-size: 11px; white-space: nowrap; }
.summary-placeholder { margin: 4px 0; color: var(--muted); font-size: 12px; }
.notice { margin-top: 12px; padding: 11px 12px; border-radius: 9px; background: var(--orange-soft); color: #7a531a; font-size: 10.5px; line-height: 1.4; }
.totals { padding: 16px 0 12px; display: grid; gap: 8px; }
.totals > div { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; }
.totals > div b { color: var(--ink); }
.totals .totals__grand { margin-top: 5px; padding-top: 13px; border-top: 2px solid var(--orange); color: var(--blue); font-size: 16px; font-weight: 800; }
.totals .totals__grand b { color: var(--blue); font-size: 22px; }
.internal-info { margin: 2px 0 14px; padding: 10px 12px; border-radius: 9px; background: var(--ice); color: var(--blue); font-size: 10.5px; line-height: 1.5; }
.primary-button, .secondary-button { width: 100%; min-height: 48px; border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 800; font-size: 12px; transition: 160ms ease; }
.primary-button { border: 1px solid var(--orange); background: var(--orange); color: white; box-shadow: 0 8px 20px rgba(245, 155, 0, .2); }
.primary-button:hover { background: #e78f00; transform: translateY(-1px); }
.secondary-button { margin-top: 9px; border: 1px solid var(--blue); background: white; color: var(--blue); }
.secondary-button:hover { background: var(--ice); }
.primary-button:disabled, .secondary-button:disabled { opacity: .58; cursor: wait; transform: none; }
.primary-button svg, .secondary-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.summary__hint { margin: 13px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.45; text-align: center; }

.site-footer { width: min(1240px, calc(100% - 48px)); margin: 28px auto 0; padding: 22px 2px 34px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 10px; }
.site-footer span:first-child { color: var(--blue); font-weight: 800; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(390px, calc(100vw - 48px)); padding: 14px 16px; border-radius: 11px; background: var(--blue); color: white; box-shadow: 0 16px 35px rgba(10,65,100,.25); font-size: 12px; line-height: 1.45; opacity: 0; transform: translateY(12px); pointer-events: none; transition: 200ms ease; z-index: 50; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast.is-error { background: #9e3d37; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .summary { position: static; }
  .summary__visual { height: 230px; }
  .product-tabs { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 650px) {
  .topbar { height: 72px; padding: 0 18px; }
  .brand img { width: 91px; height: 58px; }
  main { width: min(100% - 28px, 1240px); }
  .intro { padding: 36px 0 28px; display: grid; gap: 19px; }
  .intro h1 { font-size: 38px; }
  .intro__copy { font-size: 14px; }
  .steps a { justify-content: center; padding: 12px 6px; }
  .steps span { display: none; }
  .panel { padding: 22px 18px; border-radius: 15px; }
  .field-grid, .config-grid { grid-template-columns: 1fr; }
  .signature-grid { grid-template-columns: 1fr; }
  .field--wide, .config-grid .field--wide { grid-column: auto; }
  .measure-list, .add-measure-button { grid-column: auto; }
  .measure-row__grid { grid-template-columns: 1fr; }
  .add-measure-button { width: 100%; justify-content: center; }
  .option-row { grid-column: auto; grid-template-columns: 1fr; }
  .product-tabs { grid-template-columns: 1fr 1fr; gap: 8px; }
  .product-tab { padding: 11px 8px; }
  .section-heading { align-items: flex-start; }
  .section-number { flex-basis: 40px; height: 40px; }
  .summary__visual { height: 195px; }
  .site-footer { width: calc(100% - 28px); flex-direction: column; gap: 6px; }
}
