/* ACORD Builder - styled to match the Lightbody site design language:
   slate-950 base, glassy slate-900/70 panels, emerald accent, amber advisories,
   pill buttons, rounded-2xl cards, soft deep shadows. */

:root {
  color-scheme: dark;
  --bg: #020617;                                  /* slate-950 */
  --panel: rgba(15, 23, 42, 0.96);                /* slate-900 */
  --panel-strong: rgba(30, 41, 59, 0.9);          /* slate-800 */
  --panel-deep: rgba(15, 23, 42, 0.78);           /* slate-900 */
  --line: rgba(100, 116, 139, 0.48);              /* slate-500/48 */
  --line-soft: rgba(100, 116, 139, 0.38);         /* slate-500/38 */
  --text: #f8fafc;                                /* slate-50 */
  --text-soft: #e2e8f0;                           /* slate-200 */
  --muted: #c6d2e2;                               /* readable slate - legibility beats brand-matching */
  --muted-strong: #e2e8f0;                        /* slate-200 */
  --emerald: #34d399;                             /* emerald-400 */
  --emerald-strong: #10b981;                      /* emerald-500 */
  --teal: #14b8a6;                                /* teal-500 */
  --amber: #fbbf24;                               /* amber-400 */
  --rose: #fb7185;                                /* rose-400 */
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.28);
  --shadow-lift: 0 18px 40px rgba(2, 6, 23, 0.45);
  --radius-panel: 1.5rem;
  --radius-card: 1rem;
  --radius-field: 0.75rem;
}

* {
  box-sizing: border-box;
}

/* Match the page color on overscroll/rubber-band instead of flashing white. */
html {
  background: var(--bg);
}

/* Readable links in both themes (buttons opt out via their own classes). */
.builder a:not(.primary):not(.secondary),
.info-chart a {
  color: var(--emerald);
}

::selection {
  background: rgba(52, 211, 153, 0.32);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% -4%, rgba(16, 185, 129, 0.14), transparent 34rem),
    radial-gradient(circle at 88% 0%, rgba(20, 184, 166, 0.1), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 2px;
}

input,
select,
textarea {
  accent-color: var(--emerald-strong);
}

.shell {
  width: min(1560px, calc(100% - 48px));
  margin: 0 auto;
  padding: 20px 0 64px;
}

/* ---------- Top bar (slim header) ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 4px 4px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.topbar-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.topbar h1 {
  font-size: 1.45rem;
  line-height: 1.1;
}

.topbar-tag {
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(120, 53, 15, 0.25);
  color: var(--amber);
  padding: 2px 10px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--emerald);
  font-size: 0.84rem;
  font-weight: 650;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow,
.step-kicker {
  margin: 0 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--emerald);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow::before,
.step-kicker::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--emerald-strong), transparent);
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h1 {
  max-width: 760px;
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  font-weight: 800;
  background: linear-gradient(135deg, #f8fafc 55%, #94e8c8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
  font-weight: 800;
  color: var(--text-soft);
}

.hero-copy,
.step-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-copy {
  max-width: 720px;
  font-size: 1rem;
  margin-top: 10px;
}

.hero-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: var(--radius-card);
  background: linear-gradient(160deg, rgba(6, 78, 59, 0.32), rgba(15, 23, 42, 0.72));
  backdrop-filter: blur(6px);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.hero-card strong,
.hero-card span {
  display: block;
}

.hero-card strong {
  color: var(--text-soft);
}

.hero-card span:not(.status-dot) {
  margin-top: 4px;
  color: var(--muted-strong);
  font-size: 0.92rem;
  line-height: 1.5;
}

.status-dot {
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--emerald);
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.14);
  flex: 0 0 auto;
  animation: pulse-dot 2.6s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16); }
  50% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0.06); }
}

.draft-banner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 0 0 18px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 8px;
  background: rgba(6, 78, 59, 0.2);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.draft-banner[hidden] {
  display: none;
}

.draft-banner strong,
.draft-banner span {
  display: block;
}

.draft-banner strong {
  color: var(--text-soft);
}

.draft-banner span {
  margin-top: 3px;
  color: var(--muted-strong);
  font-size: 0.9rem;
}

.draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Layout ---------- */

.workspace {
  display: grid;
  /* Fluid zones: rail and summary grow with the screen, the form column caps for readability. */
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) minmax(290px, 350px);
  gap: clamp(20px, 1.6vw, 30px);
  align-items: start;
}

.builder {
  max-width: 820px;
}

/* ---------- Live packet summary rail ---------- */

.packet-summary {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: var(--radius-panel);
  background: rgba(6, 78, 59, 0.14);
  padding: 16px;
  box-shadow: var(--shadow);
}

.packet-summary:empty {
  visibility: hidden;
}

.ps-insured {
  color: var(--text-soft);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ps-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ps-chip {
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.6);
  color: var(--muted-strong);
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.ps-chip.is-lob {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald);
}

.ps-section {
  border-top: 1px solid rgba(52, 211, 153, 0.22);
  padding-top: 10px;
  display: grid;
  gap: 5px;
}

.ps-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.83rem;
}

.ps-row span:first-child {
  color: var(--muted);
}

.ps-row span:last-child {
  color: var(--text-soft);
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.ps-heading {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ps-subheading {
  margin-top: 4px;
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ps-hazard span:first-child {
  color: var(--muted-strong);
  font-size: 0.8rem;
}

.ps-code {
  color: var(--emerald);
  font-weight: 800;
  font-size: 0.78rem;
}

.ps-subrow span:first-child {
  padding-left: 14px;
  color: rgba(148, 163, 184, 0.8);
  font-size: 0.78rem;
}

.ps-subrow span:last-child {
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 600;
}

.ps-row.is-total {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(52, 211, 153, 0.35);
}

.ps-row.is-total span:last-child {
  color: var(--emerald);
  font-weight: 800;
}

.ps-needed .ps-heading {
  color: var(--amber);
}

.ps-needed ul {
  margin: 4px 0 0;
  padding-left: 16px;
  color: #e7d3a6;
  font-size: 0.82rem;
  line-height: 1.55;
}

.ps-ready {
  border-radius: var(--radius-field);
  background: rgba(16, 185, 129, 0.18);
  color: var(--emerald);
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 750;
}

.ps-generated {
  border-radius: var(--radius-field);
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.14);
  color: var(--emerald);
  padding: 10px 12px;
  font-size: 0.83rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ps-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
}

.ps-foot .status-dot {
  width: 8px;
  height: 8px;
  margin-top: 0;
  animation: none;
}

.sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 16px;
}

.progress-list {
  list-style: none;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.progress-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--muted);
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
  transition: background 180ms ease, color 180ms ease;
}

.progress-list li.is-current {
  color: var(--text);
  background: rgba(16, 185, 129, 0.14);
}

.progress-list li.is-current .progress-index {
  background: var(--emerald-strong);
  color: #022c22;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.progress-list li.is-complete {
  color: var(--emerald);
}

.progress-list li.is-complete .progress-index {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald);
}

.progress-list li.is-attention {
  color: var(--amber);
}

.progress-list li.is-attention .progress-index {
  background: rgba(251, 191, 36, 0.2);
  color: var(--amber);
}

/* Visited steps render as buttons so agents can jump straight back. */
.progress-jump {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}

.progress-jump:hover {
  color: var(--text);
}

.progress-jump:hover .progress-index {
  background: rgba(16, 185, 129, 0.3);
}

.progress-index {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.55);
  color: var(--muted-strong);
  font-size: 0.76rem;
  font-weight: 800;
  flex: 0 0 auto;
  transition: background 180ms ease, color 180ms ease;
}

/* ---------- Advisory blocks (amber) ---------- */

.license-note,
.notice,
.checklist {
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: var(--radius-card);
  background: linear-gradient(160deg, rgba(120, 53, 15, 0.26), rgba(15, 23, 42, 0.6));
  padding: 16px 18px;
  color: #fde9c0;
  line-height: 1.55;
}

.license-note strong,
.license-note span {
  display: block;
}

.license-note strong {
  color: var(--amber);
  font-size: 0.92rem;
}

.license-note span {
  margin-top: 4px;
  color: #e7d3a6;
  font-size: 0.86rem;
}

/* ---------- Builder panel & steps ---------- */

.builder {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.step {
  display: none;
  padding: clamp(24px, 4vw, 44px);
  padding-bottom: clamp(96px, 8vw, 124px);
}

.step.is-active {
  display: block;
  animation: step-in 260ms ease;
}

@keyframes step-in {
  from { opacity: 0.96; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Choice cards ---------- */

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

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

.choice-card {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel-strong);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.choice-card:hover {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(30, 41, 59, 0.9);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.choice-card input {
  width: 18px;
  height: 18px;
}

.choice-card:has(input:checked) {
  border-color: rgba(16, 185, 129, 0.75);
  background: linear-gradient(160deg, rgba(6, 78, 59, 0.35), rgba(15, 23, 42, 0.85));
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35), var(--shadow-lift);
}

.choice-card:has(input:checked)::after {
  content: "\2713";
  position: absolute;
  top: 14px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--emerald-strong);
  color: #022c22;
  font-size: 0.82rem;
  font-weight: 900;
}

.choice-card span {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-soft);
}

.choice-card small {
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Sample fills ---------- */

.sample-panel {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: var(--radius-card);
  background: linear-gradient(160deg, rgba(19, 78, 74, 0.22), rgba(15, 23, 42, 0.55));
}

.sample-panel h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-soft);
}

.sample-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.sample-fill-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 96px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-field);
  background: var(--panel-deep);
  color: var(--text);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.sample-fill-card:hover {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(6, 78, 59, 0.26);
  transform: translateY(-1px);
}

.sample-fill-card span,
.sample-fill-card small {
  display: block;
}

.sample-fill-card span {
  font-weight: 800;
  font-size: 0.92rem;
}

.sample-fill-card small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

/* ---------- Form grids & fields ---------- */

.grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

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

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

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.section-stack {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.field-group,
.email-builder {
  border: 1px solid rgba(100, 116, 139, 0.42);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.42);
  padding: 18px;
}

.email-builder {
  margin-top: 24px;
}

.field-group-head,
.email-builder-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(100, 116, 139, 0.34);
}

.field-group-head h3,
.email-builder-head h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0;
}

.field-group-head p,
.email-builder-head p {
  max-width: 680px;
  margin: 5px 0 0;
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.45;
}

.required-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(52, 211, 153, 0.32);
  border-radius: 999px;
  background: rgba(6, 78, 59, 0.22);
  color: var(--emerald);
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.required-chip.optional {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(30, 41, 59, 0.42);
  color: var(--muted-strong);
}

.compact-grid {
  margin-top: 0;
  gap: 14px;
}

.mini-section-note {
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-radius: 8px;
  background: rgba(6, 78, 59, 0.12);
  color: #cbd5e1;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.field-note-card {
  min-height: 68px;
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-radius: 8px;
  background: rgba(6, 78, 59, 0.12);
  padding: 11px 12px;
}

.field-note-card strong,
.field-note-card span {
  display: block;
}

.field-note-card strong {
  color: var(--emerald);
  font-size: 0.82rem;
  font-weight: 850;
}

.field-note-card span {
  margin-top: 5px;
  color: var(--muted-strong);
  font-size: 0.78rem;
  line-height: 1.38;
}

.property-schedule-panel {
  display: grid;
  gap: 14px;
}

.schedule-summary {
  border: 1px solid rgba(52, 211, 153, 0.22);
  border-radius: 8px;
  background: rgba(6, 78, 59, 0.12);
  color: #cbd5e1;
  padding: 11px 12px;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
}

.property-building-list {
  display: grid;
  gap: 14px;
}

.property-building-card {
  border: 1px solid rgba(100, 116, 139, 0.36);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.24);
  padding: 16px;
}

details.property-building-card {
  overflow: hidden;
  padding: 0 !important;
}

.property-building-summary {
  display: grid;
  gap: 4px;
  padding: 15px 16px;
  cursor: pointer;
  list-style-position: inside;
}

.property-building-summary span {
  color: var(--text-soft);
  font-size: 0.96rem;
  font-weight: 850;
}

.property-building-summary small {
  margin-left: 20px;
  color: var(--muted-strong);
  font-size: 0.8rem;
  line-height: 1.4;
}

.property-building-card[open] > .property-building-summary {
  border-bottom: 1px solid rgba(100, 116, 139, 0.3);
  background: rgba(15, 23, 42, 0.34);
}

.property-building-card-body {
  padding: 16px;
}

.property-building-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.property-building-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(100, 116, 139, 0.3);
}

.property-building-card-head h4 {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  font-weight: 850;
}

.property-building-card-head p {
  margin: 4px 0 0;
  color: var(--muted-strong);
  font-size: 0.84rem;
  line-height: 1.4;
}

.property-building-card .mini-section {
  margin-top: 14px;
}

.property-building-card .mini-section:first-of-type {
  margin-top: 0;
}

.compact-button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.82rem;
}

.property-help {
  margin-top: 22px;
  border: 1px solid rgba(52, 211, 153, 0.24);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(6, 78, 59, 0.18), rgba(15, 23, 42, 0.56));
  overflow: hidden;
}

.property-help summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  padding: 16px 18px;
  color: var(--text-soft);
  cursor: pointer;
}

.property-help summary span {
  font-size: 1rem;
  font-weight: 850;
}

.property-help summary small {
  color: var(--emerald);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.property-help-body {
  display: grid;
  gap: 16px;
  padding: 0 18px 18px;
}

.property-help h3 {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 1rem;
}

.property-help ul {
  margin: 0;
  padding-left: 19px;
  color: var(--muted-strong);
  line-height: 1.55;
}

.property-help li + li {
  margin-top: 6px;
}

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

.property-help-grid div {
  border: 1px solid rgba(100, 116, 139, 0.34);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.32);
  padding: 12px;
}

.property-help-grid strong,
.property-help-grid span {
  display: block;
}

.property-help-grid strong {
  color: var(--emerald);
  font-size: 0.84rem;
  font-weight: 850;
}

.property-help-grid span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.42;
}

.coverage-options {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.coverage-option {
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.26);
  padding: 14px;
}

.coverage-summary {
  display: block;
  margin: 6px 0 0 30px;
  color: var(--emerald);
  font-size: 0.82rem;
  font-weight: 650;
}

.coverage-summary:empty {
  display: none;
}

.coverage-option > .inline-check {
  margin-top: 0;
}

.coverage-option .conditional.is-visible {
  margin-top: 14px;
}

.radio-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(100, 116, 139, 0.38);
  border-radius: var(--radius-field);
  background: rgba(2, 6, 23, 0.32);
  padding: 11px 12px;
}

.radio-card legend {
  padding: 0 4px;
  color: #e8eef7;
  font-size: 0.9rem;
  font-weight: 750;
}

.radio-card .inline-check {
  margin-top: 0;
}

.optional-panel {
  padding: 0;
  overflow: hidden;
}

.optional-panel summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  padding: 16px 18px;
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 850;
}

.optional-panel summary small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.optional-panel > .grid,
.optional-panel > .mini-section,
.optional-panel > .section-stack,
.optional-panel > .inline-check {
  margin: 0 18px 18px;
}

.mini-section {
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(100, 116, 139, 0.28);
  padding-top: 16px;
}

.mini-section h4 {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 850;
}

.mini-section p {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.prompt-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.prompt-strip span {
  border: 1px solid rgba(71, 85, 105, 0.42);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  color: var(--muted-strong);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.field-group .construction-picker,
.field-group .info-chart {
  margin-top: 14px;
}

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

.story-card {
  position: relative;
  gap: 7px;
  min-height: 218px;
  border: 1px solid rgba(100, 116, 139, 0.42);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.42);
  padding: 16px;
}

.story-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: var(--emerald);
  font-size: 0.78rem;
  font-weight: 850;
}

.story-title {
  color: var(--text-soft);
  font-size: 1rem;
  font-weight: 850;
}

.story-card textarea {
  min-height: 86px;
}

label {
  display: grid;
  gap: 8px;
  color: #e8eef7;
  font-size: 0.9rem;
  font-weight: 650;
}

.field-hint {
  max-width: 780px;
  color: #b9c6d8;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
}

.construction-picker {
  align-self: end;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.construction-picker button {
  min-height: 54px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  background: rgba(2, 6, 23, 0.45);
  color: var(--text-soft);
  padding: 9px 11px;
  text-align: left;
  box-shadow: none;
}

.construction-picker button:hover {
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(6, 78, 59, 0.2);
  transform: none;
}

.construction-picker button.is-selected {
  border-color: rgba(16, 185, 129, 0.75);
  background: rgba(6, 78, 59, 0.34);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.22);
}

.construction-picker strong {
  color: var(--emerald);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.construction-picker span {
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.2;
}

.info-chart {
  align-self: end;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-field);
  background: rgba(2, 6, 23, 0.34);
  color: var(--muted-strong);
  overflow: hidden;
}

.info-chart summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
}

.info-chart summary a {
  margin-left: auto;
  color: var(--emerald);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}

.info-chart summary a:hover {
  text-decoration: underline;
}

.info-chart-body {
  display: grid;
  border-top: 1px solid var(--line-soft);
}

.info-chart-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid rgba(71, 85, 105, 0.22);
  font-size: 0.82rem;
  line-height: 1.45;
}

.info-chart-row:first-child {
  border-top: 0;
}

.info-chart-row strong {
  color: var(--emerald);
}

.info-chart-row span,
.info-chart p {
  color: var(--muted);
}

.info-chart p {
  margin: 0;
  padding: 11px 14px 13px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.82rem;
  line-height: 1.45;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(100, 116, 139, 0.52);
  border-radius: var(--radius-field);
  background: rgba(2, 6, 23, 0.74);
  color: var(--text);
  padding: 11px 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.92);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(148, 163, 184, 0.62);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(16, 185, 129, 0.7);
  background: rgba(2, 6, 23, 0.75);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

input.invalid,
select.invalid,
textarea.invalid {
  border-color: rgba(251, 113, 133, 0.85);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.12);
}

input[type="checkbox"].invalid {
  outline: 2px solid rgba(251, 113, 133, 0.9);
  outline-offset: 3px;
}

.inline-check {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
  cursor: pointer;
}

.inline-check input {
  width: 18px;
  min-height: 18px;
}

.upload-panel {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(19, 78, 74, 0.2), rgba(15, 23, 42, 0.5));
}

.upload-panel h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
}

.upload-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.file-upload {
  display: inline-grid;
  justify-self: start;
  gap: 8px;
}

.file-upload span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(52, 211, 153, 0.34);
  border-radius: 999px;
  background: rgba(6, 78, 59, 0.24);
  color: var(--text-soft);
  padding: 0 18px;
  font-weight: 800;
}

.file-upload input {
  max-width: min(100%, 520px);
  min-height: 42px;
  padding: 8px;
}

.file-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.file-list strong {
  color: var(--text-soft);
}

.file-list span {
  color: var(--muted);
}

.file-list-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(100, 116, 139, 0.32);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.34);
  padding: 10px 12px;
}

.file-list-total.is-warning,
.file-list-message.is-warning {
  border-color: rgba(251, 191, 36, 0.42);
  color: #fde9c0;
}

.file-list-total.is-blocked,
.file-list-message.is-blocked {
  border-color: rgba(251, 113, 133, 0.58);
  color: #fecdd3;
}

.file-list-message {
  border: 1px solid rgba(251, 191, 36, 0.42);
  border-radius: 8px;
  background: rgba(120, 53, 15, 0.18);
  padding: 9px 12px;
  font-weight: 700;
}

/* ---------- Hazard rows / repeat cards ---------- */

.row-stack {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.repeat-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-deep);
  padding: 20px;
}

.repeat-card label {
  position: relative;
}

.code-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  max-height: 264px;
  overflow-y: auto;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-field);
  background: #0b1526;
  box-shadow: var(--shadow-lift);
}

.code-suggest button {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-soft);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.code-suggest button:hover,
.code-suggest button.is-active {
  background: rgba(16, 185, 129, 0.14);
}

.code-suggest-code {
  color: var(--emerald);
  font-size: 0.84rem;
  font-weight: 800;
}

.code-suggest-name {
  font-size: 0.84rem;
  line-height: 1.35;
}

.code-suggest-basis {
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.step > .repeat-card {
  margin-top: 24px;
}

.repeat-card .inline-check {
  margin-top: 0;
}

.repeat-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 16px;
}

.repeat-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.repeat-card-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.repeat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.repeat-actions span {
  color: var(--muted);
  font-size: 0.9rem;
}

.conditional {
  display: none;
}

.conditional.is-visible {
  display: grid;
}

/* ---------- Review ---------- */

.review-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.review-generate-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.review-generate-actions .primary {
  min-width: min(100%, 320px);
}

.summary-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: var(--panel-deep);
  padding: 16px 18px;
  transition: border-color 160ms ease;
}

.summary-card:hover {
  border-color: rgba(52, 211, 153, 0.35);
}

.summary-card-head,
.summary-card strong,
.summary-card span {
  display: block;
}

.summary-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.summary-card strong {
  color: var(--emerald);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.summary-card-head button {
  min-height: 30px;
  border: 1px solid rgba(52, 211, 153, 0.26);
  background: rgba(6, 78, 59, 0.18);
  color: var(--emerald);
  padding: 0 12px;
  font-size: 0.76rem;
  box-shadow: none;
}

.summary-card-head button:hover {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(6, 78, 59, 0.28);
  transform: none;
}

.summary-card span {
  margin-top: 8px;
  color: var(--muted-strong);
  line-height: 1.55;
}

/* ---------- Finish ---------- */

.finish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.email-draft-wrap {
  margin-top: 20px;
}

.email-draft {
  min-height: 240px;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.checklist {
  margin-top: 22px;
}

.checklist ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.checklist li + li {
  margin-top: 6px;
}

/* ---------- Controls & buttons ---------- */

.controls {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px clamp(24px, 4vw, 44px);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(8px);
}

.controls .ghost-button {
  margin-right: auto;
}

button,
.finish-actions a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 26px;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

[hidden] {
  display: none !important;
}

button:disabled,
.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.primary {
  background: linear-gradient(135deg, var(--emerald-strong), var(--teal));
  color: #022c22;
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.28);
}

.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(16, 185, 129, 0.38);
}

.secondary {
  border: 1px solid var(--line);
  background: rgba(30, 41, 59, 0.6);
  color: var(--text-soft);
}

.secondary:hover:not(:disabled):not(.disabled) {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(30, 41, 59, 0.85);
}

.ghost-button {
  border: 1px solid rgba(100, 116, 139, 0.34);
  background: transparent;
  color: var(--muted-strong);
  box-shadow: none;
}

.ghost-button:hover:not(:disabled) {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
  color: var(--text-soft);
  transform: none;
}

.form-error {
  min-height: 24px;
  padding: 0 clamp(24px, 4vw, 44px) 12px;
  color: var(--rose);
  font-weight: 650;
}

.form-error[data-tone="success"] {
  color: var(--emerald);
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .step.is-active {
    animation: none;
  }

  .status-dot {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Responsive ---------- */

/* ---------- Readability overrides (win by cascade order) ---------- */

label {
  font-size: 0.95rem;
  color: var(--text-soft);
}

.step-copy,
.hero-copy {
  font-size: 1rem;
}

.choice-card small,
.sample-fill-card small {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.field-hint {
  font-size: 0.87rem;
  line-height: 1.5;
}

.field-group-head p,
.mini-section-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.info-chart-row span,
.prompt-strip span {
  font-size: 0.85rem;
}

.progress-list li {
  font-size: 0.97rem;
}

.ps-insured {
  font-size: 1.06rem;
}

.ps-row {
  font-size: 0.9rem;
}

.ps-heading,
.ps-subheading {
  color: #a9bacd;
}

.ps-heading {
  font-size: 0.75rem;
}

.ps-subheading {
  font-size: 0.71rem;
}

.ps-hazard span:first-child {
  font-size: 0.86rem;
}

.ps-code {
  font-size: 0.83rem;
}

.ps-subrow span:first-child,
.ps-subrow span:last-child {
  font-size: 0.83rem;
}

.ps-needed ul {
  font-size: 0.86rem;
}

.ps-ready {
  font-size: 0.9rem;
}

.ps-foot {
  font-size: 0.8rem;
}

/* Two-zone below 1280px: the live summary rail hides, rail + form remain. */
@media (max-width: 1279px) {
  .workspace {
    grid-template-columns: minmax(210px, 240px) minmax(0, 1fr);
  }

  .packet-summary {
    display: none;
  }

  .builder {
    max-width: none;
  }
}

@media (max-width: 920px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  /* Slim progress: number chips in a row, only the current step keeps its label. */
  .progress-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
  }

  .progress-list li {
    min-height: 0;
    padding: 5px 6px;
  }

  .progress-list li span:not(.progress-index) {
    display: none;
  }

  .progress-list li.is-current {
    padding: 5px 14px 5px 6px;
  }

  .progress-list li.is-current span:not(.progress-index) {
    display: inline;
  }

  .choice-grid,
  .choice-grid.compact,
  .sample-fill-grid,
  .grid.two,
  .grid.three,
  .story-grid,
  .review-summary {
    grid-template-columns: 1fr;
  }

  .field-group-head,
  .email-builder-head {
    display: grid;
  }

  .draft-banner,
  .optional-panel summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .field-group,
  .email-builder {
    padding: 16px;
  }

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

  .span-2,
  .span-3 {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .controls,
  .finish-actions,
  .review-generate-actions {
    flex-direction: column;
  }

  .review-generate-actions .primary {
    width: 100%;
  }

  .controls .ghost-button {
    margin-right: 0;
  }

  .construction-picker {
    grid-template-columns: 1fr;
  }

  .story-card {
    min-height: auto;
  }
}

/* ---------- Mobile import-safe overrides ----------
   Keep these scoped to the ACORD builder root so the block can move into a
   future website route without changing unrelated site buttons or fields. */

@media (max-width: 720px) {
  .acord-builder-page.shell {
    width: min(100% - 16px, 1180px);
    padding: 14px 0 32px;
  }

  .acord-builder-page .hero {
    gap: 12px;
    margin-bottom: 12px;
  }

  .acord-builder-page .eyebrow,
  .acord-builder-page .step-kicker {
    margin-bottom: 8px;
    gap: 7px;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
  }

  .acord-builder-page .eyebrow::before,
  .acord-builder-page .step-kicker::before {
    width: 18px;
  }

  .acord-builder-page h1 {
    font-size: 2rem;
    line-height: 1.08;
  }

  .acord-builder-page h2 {
    font-size: 1.5rem;
    line-height: 1.12;
  }

  .acord-builder-page .hero-copy,
  .acord-builder-page .step-copy {
    margin-top: 10px;
    font-size: 0.94rem;
    line-height: 1.55;
  }

  .acord-builder-page .hero-card,
  .acord-builder-page .draft-banner,
  .acord-builder-page .license-note,
  .acord-builder-page .progress-list {
    border-radius: 14px;
  }

  .acord-builder-page .hero-card {
    gap: 12px;
    padding: 13px 14px;
  }

  .acord-builder-page .hero-card span:not(.status-dot),
  .acord-builder-page .draft-banner span,
  .acord-builder-page .license-note span {
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .acord-builder-page .draft-banner {
    padding: 13px 14px;
  }

  .acord-builder-page .draft-actions,
  .acord-builder-page .finish-actions {
    width: 100%;
  }

  .acord-builder-page .draft-actions button,
  .acord-builder-page .finish-actions button,
  .acord-builder-page .finish-actions a {
    flex: 1 1 auto;
    padding-inline: 16px;
  }

  .acord-builder-page .workspace {
    gap: 12px;
  }

  .acord-builder-page .progress-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px;
  }

  .acord-builder-page .progress-list li {
    flex: 0 0 auto;
    padding: 5px 6px;
  }

  .acord-builder-page .progress-list li.is-current {
    max-width: 140px;
    padding-right: 12px;
  }

  .acord-builder-page .license-note {
    padding: 12px 14px;
  }

  .acord-builder-page .builder {
    border-radius: 18px;
    overflow: hidden;
  }

  .acord-builder-page .step {
    padding: 20px 16px 24px;
  }

  .acord-builder-page .sample-panel,
  .acord-builder-page .field-group,
  .acord-builder-page .email-builder,
  .acord-builder-page .upload-panel,
  .acord-builder-page .repeat-card,
  .acord-builder-page .property-building-card {
    padding: 14px;
  }

  .acord-builder-page .sample-panel,
  .acord-builder-page .property-help,
  .acord-builder-page .grid,
  .acord-builder-page .row-stack,
  .acord-builder-page .step > .repeat-card,
  .acord-builder-page .upload-panel,
  .acord-builder-page .email-builder,
  .acord-builder-page .review-summary {
    margin-top: 18px;
  }

  .acord-builder-page .section-stack {
    gap: 14px;
    margin-top: 18px;
  }

  .acord-builder-page .grid,
  .acord-builder-page .compact-grid,
  .acord-builder-page .story-grid,
  .acord-builder-page .row-stack {
    gap: 13px;
  }

  .acord-builder-page .choice-grid {
    gap: 10px;
    margin-top: 18px;
  }

  .acord-builder-page .choice-card {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 5px 12px;
    min-height: 0;
    padding: 16px;
  }

  .acord-builder-page .choice-card input {
    grid-row: 1 / span 2;
    width: 18px;
    min-height: 18px;
    margin-top: 2px;
  }

  .acord-builder-page .choice-card span,
  .acord-builder-page .choice-card small {
    grid-column: 2;
  }

  .acord-builder-page .choice-card span {
    font-size: 1rem;
  }

  .acord-builder-page .choice-card:has(input:checked)::after {
    top: 11px;
    right: 11px;
    width: 22px;
    height: 22px;
  }

  .acord-builder-page .sample-fill-grid {
    gap: 8px;
  }

  .acord-builder-page .sample-fill-card {
    min-height: 0;
    padding: 12px;
  }

  .acord-builder-page .field-group-head,
  .acord-builder-page .email-builder-head {
    gap: 10px;
    margin-bottom: 13px;
    padding-bottom: 12px;
  }

  .acord-builder-page .field-group-head p,
  .acord-builder-page .email-builder-head p,
  .acord-builder-page .field-hint,
  .acord-builder-page .property-help ul,
  .acord-builder-page .mini-section p,
  .acord-builder-page .upload-panel p,
  .acord-builder-page .repeat-actions span {
    font-size: 0.8rem;
    line-height: 1.42;
  }

  .acord-builder-page .required-chip {
    justify-self: start;
    min-height: 24px;
    font-size: 0.68rem;
  }

  .acord-builder-page .property-help summary {
    display: grid;
    gap: 4px;
    min-height: 0;
    padding: 14px;
  }

  .acord-builder-page .property-help-body {
    padding: 0 14px 14px;
  }

  .acord-builder-page .property-help-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .acord-builder-page .field-note-card,
  .acord-builder-page .schedule-summary {
    padding: 10px 11px;
  }

  .acord-builder-page .property-building-list {
    gap: 12px;
  }

  .acord-builder-page .property-building-card-head {
    display: grid;
    gap: 10px;
  }

  .acord-builder-page .property-building-card-head .compact-button {
    width: 100%;
  }

  .acord-builder-page label {
    gap: 6px;
    font-size: 0.86rem;
  }

  .acord-builder-page input,
  .acord-builder-page select,
  .acord-builder-page textarea {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
  }

  .acord-builder-page textarea {
    min-height: 88px;
  }

  .acord-builder-page .inline-check {
    align-items: flex-start;
    margin-top: 16px;
    line-height: 1.35;
  }

  .acord-builder-page .inline-check input {
    flex: 0 0 auto;
    margin-top: 1px;
  }

  .acord-builder-page .optional-panel summary {
    min-height: 0;
    padding: 14px;
  }

  .acord-builder-page .optional-panel summary small {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .acord-builder-page .optional-panel > .grid,
  .acord-builder-page .optional-panel > .mini-section,
  .acord-builder-page .optional-panel > .section-stack,
  .acord-builder-page .optional-panel > .inline-check {
    margin: 0 14px 14px;
  }

  .acord-builder-page .mini-section {
    gap: 10px;
    padding-top: 14px;
  }

  .acord-builder-page .prompt-strip {
    gap: 6px;
    margin-bottom: 12px;
  }

  .acord-builder-page .prompt-strip span {
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .acord-builder-page .construction-picker button {
    min-height: 48px;
    padding: 8px 10px;
  }

  .acord-builder-page .construction-picker strong {
    font-size: 0.68rem;
  }

  .acord-builder-page .construction-picker span {
    font-size: 0.78rem;
  }

  .acord-builder-page .info-chart summary {
    align-items: flex-start;
    flex-wrap: wrap;
    min-height: 0;
    padding: 10px 12px;
  }

  .acord-builder-page .info-chart summary a {
    width: 100%;
    margin-left: 0;
  }

  .acord-builder-page .info-chart-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 9px 12px;
  }

  .acord-builder-page .story-card {
    padding: 14px;
  }

  .acord-builder-page .file-upload {
    justify-self: stretch;
  }

  .acord-builder-page .file-upload span {
    width: 100%;
  }

  .acord-builder-page .file-upload input {
    max-width: 100%;
  }

  .acord-builder-page .repeat-card-head {
    display: grid;
    gap: 6px;
    margin-bottom: 13px;
  }

  .acord-builder-page .code-suggest button {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .acord-builder-page .code-suggest-basis {
    grid-column: 2;
  }

  .acord-builder-page .summary-card {
    padding: 14px;
  }

  .acord-builder-page .summary-card-head {
    align-items: flex-start;
  }

  .acord-builder-page .summary-card-head button {
    min-width: 52px;
    padding: 0 10px;
  }

  .acord-builder-page .summary-card span {
    font-size: 0.9rem;
    line-height: 1.52;
  }

  .acord-builder-page .email-draft {
    min-height: 210px;
    font-size: 0.8rem;
  }

  .acord-builder-page .form-error {
    padding: 0 16px 10px;
  }

  .acord-builder-page .controls {
    position: static;
    z-index: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 16px 16px;
    border-radius: 0 0 18px 18px;
    background: rgba(2, 6, 23, 0.5);
    backdrop-filter: none;
  }

  .acord-builder-page .controls .ghost-button {
    margin-right: 0;
  }

  .acord-builder-page .controls button {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 380px) {
  .acord-builder-page.shell {
    width: min(100% - 12px, 1180px);
  }

  .acord-builder-page h1 {
    font-size: 1.8rem;
  }

  .acord-builder-page h2 {
    font-size: 1.34rem;
  }

  .acord-builder-page .step {
    padding: 18px 14px 22px;
  }

  .acord-builder-page .sample-panel,
  .acord-builder-page .field-group,
  .acord-builder-page .email-builder,
  .acord-builder-page .upload-panel,
  .acord-builder-page .repeat-card,
  .acord-builder-page .property-building-card {
    padding: 12px;
  }

  .acord-builder-page .summary-card-head {
    display: grid;
    gap: 8px;
  }

  .acord-builder-page .summary-card-head button {
    justify-self: start;
  }
}

/* ==================== Theme toggle button (both themes) ==================== */

.theme-toggle {
  min-height: 0;
  padding: 5px 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

/* ==================== Light theme ====================
   html[data-theme="light"] - toggled from the top bar, persisted in localStorage.
   Token flips carry most rules; the overrides below re-skin components with
   hardcoded dark colors. The top bar stays dark chrome in both themes. */

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-strong: #f8fafc;
  --panel-deep: #f1f4f7;
  --line: #d7dce3;
  --line-soft: #e4e8ee;
  --text: #0f172a;
  --text-soft: #1e293b;
  --muted: #5b6b7f;
  --muted-strong: #334155;
  --emerald: #059669;
  --emerald-strong: #047857;
  --teal: #0d9488;
  --amber: #b45309;
  --rose: #dc2626;
  --shadow: 0 8px 26px rgba(15, 23, 42, 0.07);
  --shadow-lift: 0 8px 20px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] body {
  background: #f4f6f8;
}

html[data-theme="light"] ::selection {
  background: rgba(5, 150, 105, 0.2);
}

/* Dark chrome top bar survives the flip. */
html[data-theme="light"] .topbar {
  background: #0b1220;
  border: 1px solid #0b1220;
  border-radius: 14px;
  padding: 12px 18px;
}

html[data-theme="light"] .topbar-title p {
  color: #9fb2c8;
}

html[data-theme="light"] .topbar-status {
  color: #34d399;
}

html[data-theme="light"] .theme-toggle {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.45);
}

html[data-theme="light"] .theme-toggle:hover {
  color: #34d399;
  border-color: #34d399;
}

/* Panels and rails */
html[data-theme="light"] .builder,
html[data-theme="light"] .progress-list,
html[data-theme="light"] .packet-summary {
  background: #ffffff;
  border-color: #e2e7ed;
  backdrop-filter: none;
}

html[data-theme="light"] .packet-summary {
  border-color: #cfe8dc;
}

html[data-theme="light"] .draft-banner {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

html[data-theme="light"] .draft-banner strong {
  color: #065f46;
}

html[data-theme="light"] .draft-banner span {
  color: #047857;
}

/* Progress rail states */
html[data-theme="light"] .progress-list li.is-current {
  background: rgba(5, 150, 105, 0.1);
}

html[data-theme="light"] .progress-index {
  background: #eef1f5;
  color: #475569;
}

html[data-theme="light"] .progress-list li.is-current .progress-index {
  background: #059669;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15);
}

html[data-theme="light"] .progress-list li.is-complete .progress-index {
  background: #d1fae5;
  color: #047857;
}

html[data-theme="light"] .progress-list li.is-attention .progress-index {
  background: #fef3c7;
  color: #b45309;
}

html[data-theme="light"] .progress-jump:hover .progress-index {
  background: #a7f3d0;
}

/* Amber advisories */
html[data-theme="light"] .license-note,
html[data-theme="light"] .notice,
html[data-theme="light"] .checklist {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

html[data-theme="light"] .license-note strong {
  color: #b45309;
}

html[data-theme="light"] .license-note span {
  color: #a16207;
}

/* Fields */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #94a3b8;
}

html[data-theme="light"] input:hover,
html[data-theme="light"] select:hover,
html[data-theme="light"] textarea:hover {
  border-color: #94a3b8;
}

html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
  background: #ffffff;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14);
}

html[data-theme="light"] input.invalid,
html[data-theme="light"] select.invalid,
html[data-theme="light"] textarea.invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Choice cards and samples */
html[data-theme="light"] .choice-card {
  background: #ffffff;
  border-color: #e2e7ed;
}

html[data-theme="light"] .choice-card:hover {
  background: #f8fafc;
  border-color: #6ee7b7;
}

html[data-theme="light"] .choice-card:has(input:checked) {
  background: #ecfdf5;
  border-color: #059669;
  box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.3), var(--shadow-lift);
}

html[data-theme="light"] .choice-card:has(input:checked)::after {
  background: #059669;
  color: #ffffff;
}

html[data-theme="light"] .sample-panel {
  background: #f0faf5;
  border-color: #bfe8d4;
}

html[data-theme="light"] .sample-fill-card {
  background: #ffffff;
  border-color: #d7dce3;
}

html[data-theme="light"] .sample-fill-card:hover {
  background: #ecfdf5;
  border-color: #059669;
}

/* Structured groups */
html[data-theme="light"] .field-group,
html[data-theme="light"] .optional-panel,
html[data-theme="light"] .repeat-card,
html[data-theme="light"] .coverage-option,
html[data-theme="light"] .email-builder,
html[data-theme="light"] .upload-panel,
html[data-theme="light"] .mini-section,
html[data-theme="light"] .property-building-card,
html[data-theme="light"] .story-card,
html[data-theme="light"] .radio-card,
html[data-theme="light"] .info-chart,
html[data-theme="light"] .summary-card {
  background: #fbfcfe;
  border-color: #e4e8ee;
}

html[data-theme="light"] .required-chip {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

html[data-theme="light"] .required-chip.optional {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #64748b;
}

html[data-theme="light"] .field-hint,
html[data-theme="light"] .field-group-head p,
html[data-theme="light"] .mini-section-note {
  color: #5b6b7f;
}

html[data-theme="light"] .prompt-strip span {
  background: #eef1f5;
  border-color: #e2e7ed;
  color: #475569;
}

html[data-theme="light"] .construction-picker button {
  background: #ffffff;
  border-color: #d7dce3;
  color: #334155;
}

html[data-theme="light"] .construction-picker button.is-selected {
  background: #ecfdf5;
  border-color: #059669;
  color: #047857;
}

html[data-theme="light"] .file-upload,
html[data-theme="light"] .file-list {
  background: #f8fafc;
  border-color: #e4e8ee;
  color: #475569;
}

/* Class-code dropdown */
html[data-theme="light"] .code-suggest {
  background: #ffffff;
  border-color: #a7f3d0;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
}

html[data-theme="light"] .code-suggest button {
  color: #1e293b;
}

html[data-theme="light"] .code-suggest button:hover,
html[data-theme="light"] .code-suggest button.is-active {
  background: #ecfdf5;
}

/* Controls and buttons */
html[data-theme="light"] .controls {
  background: rgba(248, 250, 252, 0.92);
  border-top-color: #e4e8ee;
}

html[data-theme="light"] .primary {
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.3);
}

html[data-theme="light"] .secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

html[data-theme="light"] .secondary:hover:not(:disabled):not(.disabled) {
  background: #f8fafc;
  border-color: #059669;
}

html[data-theme="light"] .ghost-button {
  color: #475569;
}

/* Live packet summary */
html[data-theme="light"] .ps-chip {
  background: #eef1f5;
  color: #475569;
}

html[data-theme="light"] .ps-chip.is-lob {
  background: #d1fae5;
  color: #047857;
}

html[data-theme="light"] .ps-section {
  border-top-color: #e4e8ee;
}

html[data-theme="light"] .ps-heading,
html[data-theme="light"] .ps-subheading {
  color: #64748b;
}

html[data-theme="light"] .ps-subrow span:first-child {
  color: #94a3b8;
}

html[data-theme="light"] .ps-needed {
  border-top-color: #fde68a;
}

html[data-theme="light"] .ps-needed .ps-heading {
  color: #b45309;
}

html[data-theme="light"] .ps-needed ul {
  color: #92400e;
}

html[data-theme="light"] .ps-ready {
  background: #ecfdf5;
  color: #047857;
}

html[data-theme="light"] .ps-generated {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

html[data-theme="light"] .ps-row.is-total {
  border-top-color: #a7f3d0;
}

html[data-theme="light"] .ps-foot {
  color: #64748b;
}
.site-back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: inherit;
  font-size: 14px;
  text-underline-offset: 4px;
}

.site-back-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}
