.intake-page {
  max-width: 1440px;
  min-height: calc(100vh - 58px);
}

.intake-heading {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 34px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.intake-heading h1 {
  margin-top: 4px;
  font-size: 26px;
}

.intake-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

#draft-status { color: var(--green); }

.completed-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: #425047;
  background: var(--surface);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}

.completed-link:hover { border-color: #9db8a6; color: var(--green); }
.completed-link svg { width: 14px; }

.intake-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  background: var(--surface);
}

.form-surface { min-width: 0; border-right: 1px solid var(--line-strong); }

.form-section {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 30px;
  padding: 28px 34px;
  border-bottom: 1px solid var(--line);
}

.form-section:last-child { border-bottom: 0; }

.form-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.section-icon {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e6f1ea;
  color: var(--green);
}

.section-icon.patient { background: #e9eef6; color: var(--blue); }
.section-icon.payer { background: #e4f1f0; color: var(--teal); }
.section-icon.services { background: #fff0d9; color: var(--amber); }
.section-icon svg { width: 16px; }

.form-section-heading h2 { font-size: 13px; }
.form-section-heading p { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }

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

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

.field-label {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-label > span,
.field-label legend {
  display: block;
  margin-bottom: 6px;
  color: #4f5c54;
  font-size: 10px;
  font-weight: 600;
}

.field-label input,
.field-label select {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
}

.field-label input:hover,
.field-label select:hover { border-color: #abb9af; }

.field-label input:focus,
.field-label select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(24, 121, 78, 0.1);
}

.input-with-icon { position: relative; }
.input-with-icon svg { width: 14px; position: absolute; top: 12px; left: 11px; color: #7d8981; }
.input-with-icon input { padding-left: 34px; }

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 38px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

.segmented-control label {
  min-width: 0;
  height: 100%;
  position: relative;
}
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  line-height: 1;
  text-align: center;
  cursor: pointer;
}
.segmented-control label:last-child span { border-right: 0; }
.segmented-control input:checked + span { background: var(--green-soft); color: var(--green); font-weight: 700; }
.segmented-control input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--green); }

.care-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.care-options label {
  min-width: 0;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: #405047;
  background: var(--surface);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.care-options input { position: absolute; opacity: 0; pointer-events: none; }
.care-options label > span {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: transparent;
}
.care-options label > span svg {
  width: 11px;
  height: 11px;
  display: block;
  flex: 0 0 11px;
}
.care-options label:has(input:checked) { border-color: #8ec2a4; background: #f4faf6; color: var(--green); }
.care-options input:checked + span { border-color: var(--green); background: var(--green); color: white; }
.care-options input:focus-visible + span { box-shadow: 0 0 0 3px rgba(24, 121, 78, 0.15); }

.call-setup {
  position: sticky;
  top: 0;
  min-height: calc(100vh - 58px);
  padding: 28px 26px;
  background: #f8faf7;
}

.call-setup-header { display: flex; align-items: center; justify-content: space-between; }
.ready-state { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-size: 9px; font-weight: 700; }
.ready-state svg { width: 13px; }

.call-identity { display: flex; align-items: center; gap: 11px; padding: 22px 0 18px; border-bottom: 1px solid var(--line); }
.payer-logo { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; background: #172c23; color: white; font-size: 16px; font-weight: 700; }
.call-identity strong, .call-identity span { display: block; }
.call-identity strong { font-size: 14px; }
.call-identity span { margin-top: 3px; color: var(--muted); font-size: 10px; }

.call-plan { margin: 10px 0 0; }
.call-plan div { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.call-plan dt { color: var(--muted); font-size: 10px; }
.call-plan dd { max-width: 170px; margin: 0; overflow-wrap: anywhere; text-align: right; font-size: 10px; font-weight: 700; }

.estimate { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px; border: 1px solid #d5e1d8; border-radius: 5px; background: #edf4ef; }
.estimate > svg { width: 17px; color: var(--green); }
.estimate span, .estimate strong { display: block; }
.estimate span { color: var(--muted); font-size: 9px; }
.estimate strong { margin-top: 2px; font-size: 10px; }

.dial-status { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 13px; border: 1px solid #a8cfb7; border-radius: 5px; background: var(--green-soft); }
.dial-status[hidden] { display: none; }
.dial-pulse {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 50%;
  background: var(--green);
  color: white;
  animation: call-pulse 1.3s ease-in-out infinite;
}
.dial-pulse svg {
  width: 15px;
  height: 15px;
  display: block;
  flex: 0 0 15px;
  color: white;
}
.dial-status > div > strong,
.dial-status > div > span { display: block; }
.dial-status > div > strong { font-size: 11px; }
.dial-status > div > span { margin-top: 3px; color: var(--muted); font-size: 9px; }

.start-call {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  border: 0;
  border-radius: 5px;
  background: #173e2e;
  color: white;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.start-call:hover { background: #0f5135; }
.start-call:disabled { background: #638073; cursor: wait; }
.start-call svg { width: 15px; }

.demo-note { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 10px; color: #7a857e; font-size: 9px; }
.demo-note svg { width: 12px; }

.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; }

@keyframes call-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(24, 121, 78, 0.2); }
  50% { box-shadow: 0 0 0 7px rgba(24, 121, 78, 0); }
}

@media (max-width: 1020px) {
  .intake-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .form-section { grid-template-columns: 180px minmax(0, 1fr); padding-left: 24px; padding-right: 24px; gap: 22px; }
  .care-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .intake-heading { padding: 20px 16px; }
  .intake-layout { grid-template-columns: 1fr; }
  .form-surface { border-right: 0; }
  .form-section { grid-template-columns: 1fr; padding: 24px 16px; gap: 18px; }
  .call-setup { position: static; min-height: auto; padding: 24px 16px 32px; border-top: 8px solid var(--paper); }
}

@media (max-width: 520px) {
  .intake-heading { align-items: flex-start; }
  .intake-heading h1 { font-size: 22px; }
  .completed-link { width: 34px; height: 34px; justify-content: center; padding: 0; }
  .completed-link { font-size: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .care-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented-control { height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .dial-pulse { animation: none; }
}
