:root {
  --navy: #07396f;
  --blue: #0754a6;
  --blue-2: #0b67c9;
  --blue-50: #eef6ff;
  --blue-100: #dbeeff;
  --ink: #15243a;
  --muted: #607086;
  --line: #d9e3ef;
  --paper: #ffffff;
  --canvas: #f3f7fb;
  --warn: #9a5600;
  --warn-bg: #fff7df;
  --danger: #b42318;
  --success: #1c7c4a;
  --shadow: 0 14px 42px rgba(14, 46, 83, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.cx-app { width: min(1240px, calc(100% - 32px)); margin: 28px auto 60px; }
.cx-hero {
  overflow: hidden;
  color: white;
  border-radius: 24px 24px 0 0;
  background:
    radial-gradient(circle at 92% 10%, rgba(75, 176, 255, .38), transparent 28%),
    linear-gradient(135deg, #052c58, #0754a6 66%, #0a6ed2);
  box-shadow: var(--shadow);
}
.cx-brand { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 28px 32px 22px; }
.cx-mark {
  display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px;
  background: white; color: var(--blue); font-size: 23px; font-weight: 900;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.cx-eyebrow, .cx-kicker { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 800; }
.cx-brand h1 { margin: 0; font-size: clamp(26px, 4vw, 40px); letter-spacing: -.035em; }
.cx-brand p:last-child { margin: 4px 0 0; color: #dbeeff; font-size: 14px; }
.cx-year { justify-self: end; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 9px 14px; font-weight: 800; background: rgba(255,255,255,.12); }
.cx-prototype-note { display: flex; align-items: center; gap: 10px; padding: 11px 32px; background: rgba(0, 20, 45, .32); font-size: 13px; color: #eff7ff; }
.cx-prototype-note span { width: 8px; height: 8px; border-radius: 50%; background: #79e0a9; box-shadow: 0 0 0 5px rgba(121,224,169,.15); }

.cx-stepper {
  display: flex; gap: 8px; overflow-x: auto; padding: 14px 18px;
  border: 1px solid var(--line); border-top: 0; background: white;
  scrollbar-width: thin;
}
.cx-step {
  min-width: 140px; flex: 1; display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; color: var(--muted); text-align: left; padding: 8px 10px; border-radius: 12px;
}
.cx-step span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #edf2f7; font-weight: 800; }
.cx-step b { display: block; font-size: 13px; color: currentColor; }
.cx-step small { display: block; font-size: 11px; }
.cx-step.is-active { color: var(--blue); background: var(--blue-50); }
.cx-step.is-active span { color: white; background: var(--blue); }
.cx-step.is-complete span { color: white; background: var(--success); }

.cx-form { background: white; border-radius: 0 0 24px 24px; box-shadow: var(--shadow); }
.cx-panel { display: none; padding: 30px; }
.cx-panel.is-active { display: block; }
.cx-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.cx-panel-head h2 { margin: 0; color: var(--navy); font-size: clamp(23px, 3vw, 31px); letter-spacing: -.025em; }
.cx-kicker { color: var(--blue-2); }
.cx-tag { align-self: center; color: var(--blue); background: var(--blue-50); border: 1px solid #cbe3fb; border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 800; }
.cx-link-btn { border: 0; color: var(--blue); background: var(--blue-50); border-radius: 10px; padding: 9px 12px; font-weight: 800; }

.cx-card { margin-bottom: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.cx-card-title { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.cx-card-title > span { flex: 0 0 auto; min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(135deg, var(--blue), var(--blue-2)); font-size: 12px; font-weight: 900; }
.cx-card-title h3 { margin: 0; color: var(--navy); font-size: 18px; }
.cx-card-title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.cx-grid { display: grid; gap: 16px; }
.cx-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cx-span-2 { grid-column: span 2; }
.cx-field { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.cx-field > span, .cx-field > label > span, .cx-row-field > span { color: #31445e; font-size: 12px; font-weight: 800; }
.cx-field b { color: var(--danger); }
.cx-field small { color: var(--muted); font-size: 11px; }
input, select, textarea {
  width: 100%; min-height: 44px; border: 1px solid #cbd8e6; border-radius: 10px;
  color: var(--ink); background: white; padding: 10px 12px; outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(11,103,201,.12); }
input[readonly], textarea[readonly] { background: #f6f9fc; color: #465872; }
.cx-coordinates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cx-field.is-invalid input, .cx-field.is-invalid select, .cx-field.is-invalid textarea { border-color: var(--danger); background: #fff7f6; }

.cx-search-field { position: relative; }
.cx-results {
  position: absolute; z-index: 15; top: calc(100% - 2px); left: 0; right: 0;
  max-height: 330px; overflow: auto; border: 1px solid #b9cce0; border-radius: 12px;
  background: white; box-shadow: 0 16px 34px rgba(17, 44, 77, .17);
}
.cx-result { display: block; width: 100%; border: 0; border-bottom: 1px solid #e4ebf3; background: white; padding: 12px 14px; text-align: left; }
.cx-result:hover, .cx-result:focus { background: var(--blue-50); }
.cx-result strong { display: block; color: var(--navy); }
.cx-result small { display: block; margin-top: 3px; color: var(--muted); }
.cx-result-empty { padding: 15px; color: var(--muted); font-size: 13px; }
.cx-selected { margin-top: 18px; padding: 16px; border-radius: 14px; background: #f7fbff; border: 1px solid #cfe4f9; }
.cx-selected-head { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 14px; }
.cx-selected-head span { color: var(--blue); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; }
.cx-master-warning, .cx-verification { margin-top: 14px; border: 1px solid #efca7a; border-radius: 12px; background: var(--warn-bg); color: #714000; padding: 12px 14px; font-size: 13px; }
.cx-verification strong { display: block; color: var(--warn); }
.cx-verification p { margin: 3px 0 8px; }
.cx-verification label { font-weight: 700; }
.cx-verification input { width: auto; min-height: 0; }

.cx-part-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cx-part-picker label { cursor: pointer; }
.cx-part-picker input { position: absolute; opacity: 0; pointer-events: none; }
.cx-part-picker span { display: block; min-height: 94px; border: 1px solid #cbd8e6; border-radius: 14px; padding: 16px; background: white; transition: .2s ease; }
.cx-part-picker b { display: block; color: var(--navy); font-size: 17px; }
.cx-part-picker small { display: block; margin-top: 5px; color: var(--muted); }
.cx-part-picker input:checked + span { border-color: var(--blue); background: var(--blue-50); box-shadow: inset 0 0 0 1px var(--blue); }
.cx-part-picker input:focus-visible + span { outline: 3px solid rgba(11,103,201,.2); }
.cx-error { color: var(--danger); font-size: 13px; font-weight: 700; }

.cx-info { margin: -4px 0 18px; padding: 12px 14px; border-left: 4px solid var(--blue-2); border-radius: 8px; color: #3f526d; background: var(--blue-50); font-size: 13px; }
.cx-status-line { display: flex; justify-content: flex-end; margin: -4px 0 13px; }
.cx-status-line label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 700; }
.cx-status-line select { width: 190px; min-height: 38px; padding: 7px 9px; }
.cx-status-body.is-disabled { display: none; }
.cx-repeater { display: grid; gap: 10px; }
.cx-row {
  position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px; align-items: end; padding: 14px 42px 14px 14px; border: 1px solid #d9e3ed; border-radius: 14px; background: #fbfdff;
}
.cx-row-field { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.cx-row-field input, .cx-row-field select, .cx-row-field textarea { min-height: 40px; padding: 8px 9px; font-size: 12px; }
.cx-col-2 { grid-column: span 2; }
.cx-col-3 { grid-column: span 3; }
.cx-col-6 { grid-column: 1 / -1; }
.cx-remove { position: absolute; right: 9px; top: 9px; width: 28px; height: 28px; border: 0; border-radius: 8px; color: #8b2635; background: #ffedf0; font-size: 20px; line-height: 1; }
.cx-add { margin-top: 11px; border: 0; border-radius: 10px; color: var(--blue); background: var(--blue-50); padding: 9px 12px; font-size: 12px; font-weight: 800; }
.cx-agency-search { position: relative; }
.cx-agency-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 12; max-height: 230px; overflow: auto; background: white; border: 1px solid #b9cce0; border-radius: 10px; box-shadow: 0 12px 26px rgba(17,44,77,.17); }
.cx-agency-results button { display: block; width: 100%; border: 0; border-bottom: 1px solid #e5ecf3; background: white; padding: 9px; text-align: left; font-size: 12px; }
.cx-agency-results button:hover { background: var(--blue-50); }
.cx-agency-selected { margin-top: 5px; color: var(--success); font-size: 11px; font-weight: 700; }

.cx-review-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 17px; color: #165d3a; border: 1px solid #b9e4cb; border-radius: 15px; background: #effbf4; }
.cx-review-banner > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: white; background: var(--success); font-weight: 900; }
.cx-review-banner h3, .cx-review-banner p { margin: 0; }
.cx-review-banner p { margin-top: 2px; font-size: 13px; color: #3e6c55; }
.cx-review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cx-review-card { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.cx-review-card span, .cx-review-card small { display: block; color: var(--muted); font-size: 11px; }
.cx-review-card strong { display: block; margin: 5px 0; color: var(--navy); }
.cx-warning-list { margin-top: 15px; }
.cx-warning-item { margin-top: 8px; padding: 11px 13px; color: #7a4700; background: var(--warn-bg); border: 1px solid #efca7a; border-radius: 10px; font-size: 12px; }
.cx-declaration { display: flex; align-items: flex-start; gap: 9px; margin: 20px 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; font-weight: 700; }
.cx-declaration input { width: auto; min-height: 0; margin-top: 4px; }
.cx-submit { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; border-radius: 13px; color: white; background: linear-gradient(90deg, var(--blue), var(--blue-2)); padding: 14px 18px; font-weight: 900; }

.cx-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; bottom: 0; z-index: 8; padding: 15px 30px; border-top: 1px solid var(--line); border-radius: 0 0 24px 24px; background: rgba(255,255,255,.95); backdrop-filter: blur(10px); }
.cx-footer > div { text-align: center; }
.cx-footer small { display: block; color: var(--success); }
.cx-btn { border-radius: 11px; padding: 10px 16px; font-weight: 800; }
.cx-btn:disabled { opacity: .45; cursor: not-allowed; }
.cx-btn-secondary { border: 1px solid #c6d4e3; color: var(--navy); background: white; }
.cx-btn-primary { border: 1px solid var(--blue); color: white; background: var(--blue); }
.cx-save { border: 0; color: var(--blue); background: transparent; font-weight: 800; }
.cx-toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; max-width: 360px; padding: 12px 15px; border-radius: 11px; color: white; background: #17324f; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.cx-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .cx-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cx-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .cx-app { width: 100%; margin: 0; }
  .cx-hero, .cx-form, .cx-footer { border-radius: 0; }
  .cx-brand { grid-template-columns: auto 1fr; padding: 22px 18px 17px; }
  .cx-year { grid-column: 2; justify-self: start; }
  .cx-prototype-note { padding: 10px 18px; align-items: flex-start; }
  .cx-panel { padding: 20px 14px; }
  .cx-card { padding: 17px 14px; }
  .cx-grid-2, .cx-grid-3, .cx-part-picker, .cx-review-grid { grid-template-columns: 1fr; }
  .cx-span-2 { grid-column: span 1; }
  .cx-row { grid-template-columns: 1fr 1fr; }
  .cx-col-2, .cx-col-3, .cx-col-6 { grid-column: 1 / -1; }
  .cx-panel-head { align-items: flex-start; }
  .cx-status-line { justify-content: flex-start; }
  .cx-status-line label { width: 100%; justify-content: space-between; }
  .cx-footer { padding: 12px 14px; }
  .cx-footer-center { display: none; }
}
@media (max-width: 460px) {
  .cx-mark { width: 50px; height: 50px; border-radius: 14px; }
  .cx-row { grid-template-columns: 1fr; padding-right: 42px; }
  .cx-coordinates { grid-template-columns: 1fr; }
  .cx-year { font-size: 12px; }
  .cx-step { min-width: 112px; }
}
