:root {
  color: #1b2b28;
  background: #f4f1e9;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #17332c;
  --muted: #6c7974;
  --line: #dfe3dc;
  --paper: #fffefa;
  --green: #1d644f;
  --lime: #d9ef7f;
  --orange: #f27c4a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  min-height: 72px;
  padding: 0 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 51, 44, .12);
  background: rgba(244, 241, 233, .92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--green); border-radius: 50% 50% 50% 10%; font-size: 12px; }
nav { display: flex; gap: 28px; }
nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
nav a:hover { color: var(--green); }

main { width: min(1180px, 88vw); margin: 0 auto; }
.hero { display: grid; grid-template-columns: 1.55fr .75fr; gap: 7vw; align-items: end; padding: 88px 0 74px; }
.eyebrow, .step { color: var(--green); font-weight: 700; text-transform: uppercase; letter-spacing: .15em; font-size: 11px; margin: 0 0 14px; }
h1, h2 { color: var(--ink); }
h1 { font-size: clamp(42px, 6vw, 76px); letter-spacing: -.055em; line-height: .98; margin: 0; }
h1 em { font-family: Georgia, serif; font-weight: 400; color: var(--green); }
.hero-copy { max-width: 640px; margin: 30px 0 0; color: #576661; font-size: 18px; line-height: 1.65; }
.connection-card { padding: 26px; border: 1px solid rgba(23, 51, 44, .15); background: rgba(255,255,255,.46); border-radius: 18px; box-shadow: 0 20px 60px rgba(43, 60, 52, .07); }
.connection-card p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.status-row { display: flex; align-items: center; gap: 10px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #9ba5a1; box-shadow: 0 0 0 5px rgba(155,165,161,.16); }
.status-dot.connected { background: #58a477; box-shadow: 0 0 0 5px rgba(88,164,119,.16); }

.workspace { display: grid; grid-template-columns: minmax(330px, .85fr) minmax(420px, 1.15fr); gap: 22px; align-items: start; }
.panel { border-radius: 20px; background: var(--paper); border: 1px solid rgba(23,51,44,.1); box-shadow: 0 16px 50px rgba(38,51,45,.06); }
.builder, .preview-panel { padding: 32px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.pill { padding: 7px 11px; border-radius: 999px; background: #edf2e8; color: var(--green); font-size: 12px; font-weight: 700; white-space: nowrap; }
label { display: grid; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
input, select { width: 100%; border: 1px solid #d7ddd5; background: white; color: var(--ink); border-radius: 9px; padding: 11px 12px; outline: none; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,100,79,.1); }
.field-heading { display: flex; margin: 28px 0 12px; }
.field-heading p { color: var(--muted); font-size: 12px; margin: 3px 0 0; }
.interval-list { display: grid; gap: 8px; }
.interval-row { display: grid; grid-template-columns: 34px 20px 70px 34px 20px 34px 1fr; gap: 7px; align-items: center; }
.interval-row input { padding: 8px; text-align: center; }
.round-chip { display: grid; place-items: center; height: 34px; border-radius: 8px; background: #edf2e8; color: var(--green); font-size: 12px; font-weight: 700; }
.arrow, .days-label { color: #929d98; font-size: 12px; text-align: center; }
.remove-button { border: 0; background: transparent; color: #a4aca8; cursor: pointer; font-size: 20px; justify-self: end; }
.remove-button:hover { color: #b7422f; }
.text-button { border: 0; background: transparent; color: var(--green); padding: 14px 0; font-weight: 700; cursor: pointer; }
.button { border: 0; border-radius: 10px; padding: 12px 17px; font-weight: 700; cursor: pointer; }
.button span { margin-left: 10px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.button:disabled { cursor: not-allowed; }
.primary { color: white; background: var(--green); }
.primary:hover { background: #124e3c; }
.secondary { color: var(--muted); background: #e5e5df; width: 100%; margin-top: 8px; }
.accent { background: var(--lime); color: #263b31; }
.accent:hover { background: #cde468; }
.full { width: 100%; margin-top: 6px; }
.inline-message { min-height: 20px; margin: 12px 0 0; font-size: 12px; }
.success { color: var(--green); }
.error { color: #b7422f; font-size: 13px; }

.date-field { min-width: 165px; }
.schedule-list { display: grid; }
.schedule-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 15px; min-height: 76px; align-items: start; }
.schedule-row strong, .schedule-row time { display: block; }
.schedule-row strong { margin-top: 3px; font-size: 14px; }
.schedule-row time { margin-top: 6px; color: var(--muted); font-size: 13px; }
.timeline { height: 100%; display: flex; flex-direction: column; align-items: center; }
.timeline span { flex: 0 0 34px; display: grid; place-items: center; width: 34px; border-radius: 50%; background: var(--green); color: white; font-size: 11px; font-weight: 700; }
.timeline i { width: 1px; flex: 1; background: #d9ded8; }
.interval-badge { border: 1px solid #e2e5df; color: var(--muted); border-radius: 999px; padding: 6px 9px; font-size: 11px; }
.interval-badge.start { background: #f5f3ed; }

.reschedule { margin: 22px 0 80px; padding: 42px; display: grid; grid-template-columns: .75fr 1.25fr; gap: 70px; background: var(--ink); color: white; }
.reschedule h2 { color: white; font-size: 34px; line-height: 1.1; }
.reschedule-copy > p:not(.step) { color: #bcc8c4; line-height: 1.6; }
.reschedule .step { color: var(--lime); }
.safety-note { margin-top: 28px; padding: 14px; display: flex; gap: 12px; background: rgba(255,255,255,.07); border-radius: 12px; }
.safety-note span { color: var(--lime); }
.safety-note p { margin: 0; color: #dce3df; font-size: 12px; line-height: 1.5; }
.reschedule-form { background: white; color: var(--ink); border-radius: 15px; padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.shift-results { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 15px; }
.result-header, .result-row { display: grid; grid-template-columns: 1fr 1.6fr 1.5fr; gap: 10px; align-items: center; }
.result-header { padding: 5px 8px 12px; font-size: 12px; }
.result-header span { color: var(--muted); grid-column: 2 / 4; }
.result-row { padding: 9px 8px; border-radius: 7px; font-size: 12px; }
.result-row:nth-child(even) { background: #f7f7f3; }
.result-row.changed { color: var(--green); font-weight: 600; }
.result-row span:last-child { color: var(--muted); text-align: right; font-size: 10px; }
.preview-disclaimer { margin: 15px 0 0; color: var(--muted); font-size: 11px; }
.jobber-data { margin: 22px 0; padding: 34px; }
.jobber-data + .reschedule { margin-bottom: 22px; }
.read-only-badge { padding: 7px 11px; border-radius: 999px; color: #315c4e; background: var(--lime); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.jobber-summary { color: var(--muted); font-size: 13px; }
.jobber-visits { border-top: 1px solid var(--line); }
.jobber-visit { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.jobber-visit strong, .jobber-visit time { display: block; }
.jobber-visit strong { font-size: 14px; }
.jobber-visit time { margin-top: 5px; color: var(--muted); font-size: 12px; }
.jobber-visit small { display: block; margin-top: 5px; color: #88938f; font-size: 10px; }
.completion { padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.completion.scheduled { color: #315c4e; background: #edf2e8; }
.completion.complete { color: #5f6864; background: #e9eae7; }
.jobber-empty { padding: 18px 4px; color: var(--muted); font-size: 13px; }

.replacement-planner { margin: 22px 0 80px; padding: 38px; }
.planner-banner { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.planner-warning { margin: 22px 0 30px; padding: 14px 16px; color: #6b421f; background: #fff3df; border: 1px solid #f1d7ab; border-radius: 10px; font-size: 13px; }
.schema-status { margin: -18px 0 30px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.replacement-form { display: grid; gap: 20px; }
.planner-section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; border-top: 1px solid var(--line); padding-top: 25px; }
.planner-section-heading > div { display: flex; gap: 13px; align-items: start; }
.planner-section-heading > div > span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; color: white; background: var(--green); font-size: 12px; font-weight: 800; }
.planner-section-heading h3 { margin: 1px 0 4px; font-size: 16px; }
.planner-section-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mapping-status { max-width: 390px; color: var(--green); font-size: 11px; text-align: right; }
.round-mappings { display: grid; gap: 8px; }
.mapping-row { display: grid; grid-template-columns: 44px 62px minmax(260px, 1fr) 145px; gap: 10px; align-items: center; padding: 9px; border-radius: 10px; background: #f7f7f3; }
.mapping-round { display: grid; place-items: center; width: 38px; height: 38px; color: var(--green); background: #e8efdf; border-radius: 9px; font-size: 12px; font-weight: 800; }
.mapping-arrow, .mapping-prefill { color: var(--muted); font-size: 10px; font-weight: 500; }
.mapping-prefill { text-align: right; }
.planner-controls { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 12px; }
.reference-note { margin: -10px 0 0; color: var(--muted); font-size: 11px; }
.planner-results { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 28px; }
.plan-verdict { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 18px; border-radius: 12px; }
.plan-verdict p { margin: 0 0 5px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.plan-verdict > div > strong { font-size: 14px; }
.plan-verdict > span { padding: 8px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.plan-verdict.safe { color: #315c4e; background: #edf5e8; border: 1px solid #d6e5cf; }
.plan-verdict.safe > span { background: var(--lime); }
.plan-verdict.blocked { color: #7b3327; background: #fff0eb; border: 1px solid #f0cec4; }
.plan-verdict.blocked > span { color: white; background: #b7422f; }
.plan-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.plan-summary > div { padding: 15px; border: 1px solid var(--line); border-radius: 10px; }
.plan-summary strong, .plan-summary span { display: block; }
.plan-summary strong { font-size: 23px; color: var(--ink); }
.plan-summary span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.blocker-list { margin: 14px 0; padding: 16px 18px; background: #fff8f5; border-left: 3px solid #b7422f; font-size: 12px; }
.blocker-list ul { margin: 9px 0 0; padding-left: 20px; color: #7b3327; line-height: 1.55; }
.schema-unavailable { margin: 14px 0; padding: 12px; color: #7b3327; background: #fff8f5; border: 1px solid #f0cec4; border-radius: 9px; font-size: 11px; }
.schema-details { margin: 14px 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; font-size: 11px; }
.schema-details summary { color: var(--green); cursor: pointer; font-weight: 800; }
.schema-details p { color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.schema-details ul { padding-left: 19px; line-height: 1.5; }
.schema-details li, .schema-details li small { overflow-wrap: anywhere; }
.schema-details li small { display: block; color: var(--muted); }
.schema-input-types { display: grid; gap: 6px; color: var(--muted); overflow-wrap: anywhere; }
.plan-table-wrap { overflow-x: auto; margin-top: 18px; }
.plan-table { width: 100%; min-width: 1180px; border-collapse: collapse; font-size: 11px; }
.plan-table th { padding: 10px 8px; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.plan-table td { max-width: 250px; padding: 13px 8px; vertical-align: top; border-bottom: 1px solid #eceee9; }
.plan-table td strong, .plan-table td small { display: block; }
.plan-table td small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.action-badge { display: inline-block; padding: 5px 7px; border-radius: 6px; font-size: 9px; font-weight: 900; white-space: nowrap; }
.action-badge.keep { color: #53605b; background: #ebedea; }
.action-badge.would_replace { color: #315c4e; background: #e6f0dc; }
.action-badge.blocked { color: white; background: #b7422f; }
.metadata-details { width: clamp(220px, calc(100vw - 96px), 820px); }
.metadata-details summary { color: var(--green); cursor: pointer; font-weight: 700; white-space: normal; overflow-wrap: anywhere; }
.audit-matrix { display: grid; grid-auto-rows: auto; gap: 7px; width: 100%; min-width: 0; margin-top: 10px; }
.audit-matrix-head, .audit-entry { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.25fr) minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .8fr); gap: 8px; align-items: start; }
.audit-matrix-head { padding: 0 9px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.audit-entry { padding: 9px; border-radius: 7px; background: #f4f5f1; }
.audit-entry > * { min-width: 0; overflow-wrap: anywhere; }
.audit-entry span { font-size: 8px; font-weight: 800; letter-spacing: .03em; }
.audit-entry small { grid-column: 1 / -1; display: block; color: var(--muted); line-height: 1.45; }
.audit-entry.blocked { border-left: 3px solid #b7422f; }
.audit-entry.preservable { border-left: 3px solid var(--green); }
.audit-entry.not_applicable { border-left: 3px solid #9ba5a1; }
.audit-empty { color: var(--muted); font-size: 10px; }
.planner-final-disclaimer { margin: 20px 0 0; color: #6b421f; font-size: 12px; font-weight: 700; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

footer { padding: 25px 6vw; display: flex; justify-content: space-between; border-top: 1px solid rgba(23,51,44,.12); color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .hero, .workspace, .reschedule { grid-template-columns: 1fr; }
  .hero { gap: 38px; padding-top: 60px; }
  .reschedule { gap: 32px; }
  .planner-controls { grid-template-columns: repeat(2, 1fr); }
  .mapping-row { grid-template-columns: 44px 1fr; }
  .mapping-row select { grid-column: 2; }
  .mapping-prefill { grid-column: 2; text-align: left; }
}
@media (max-width: 620px) {
  .topbar { padding: 0 20px; }
  .brand > span:last-child, nav { display: none; }
  main { width: min(92vw, 520px); }
  .hero { padding: 42px 0; }
  .builder, .preview-panel, .reschedule, .replacement-planner { padding: 22px; }
  .section-heading { display: grid; }
  .form-grid { grid-template-columns: 1fr; }
  .result-header, .result-row { grid-template-columns: .8fr 1.2fr; }
  .result-row span:last-child { grid-column: 1 / 3; text-align: left; }
  .interval-row { grid-template-columns: 32px 14px 62px 28px 14px 32px 1fr; gap: 4px; }
  .planner-banner, .planner-section-heading { display: grid; }
  .mapping-status { text-align: left; }
  .planner-controls, .plan-summary { grid-template-columns: 1fr; }
  .audit-matrix-head { display: none; }
  .audit-entry { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .audit-entry > strong, .audit-entry > span, .audit-entry > small { grid-column: 1; }
  .audit-entry > strong::before, .audit-entry > span::before { display: block; margin-bottom: 2px; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .audit-entry > strong::before { content: "Field"; }
  .audit-entry > span:nth-of-type(1)::before { content: "Source"; }
  .audit-entry > span:nth-of-type(2)::before { content: "Create schema"; }
  .audit-entry > span:nth-of-type(3)::before { content: "Behavior"; }
  .audit-entry > span:nth-of-type(4)::before { content: "Verdict"; }
}
