/* /documents/create/<slug>: schema-driven intake wizard over the (future) Composer workspace.
   The card is always light so it reads as a focused sheet in both themes. */

.intake {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-ui);
}

.intake-workspace {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    padding: 72px 24px;
    overflow: hidden;
    filter: blur(3px);
    pointer-events: none;
    user-select: none;
}

.intake-workspace__document {
    width: min(52rem, 100%);
    height: max-content;
}

.intake::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(14, 9, 30, 0.62);
    backdrop-filter: blur(2px);
}

html.light-theme .intake::before,
body.light-theme .intake::before {
    background: rgba(28, 21, 52, 0.56);
}

.intake-stage {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 40px 16px;
}

.intake-card {
    --ik-text: #251D42;
    --ik-sub: #5C5478;
    --ik-muted: #6E6688;
    --ik-border: #E6E0F3;
    --ik-field-border: #D6CDEE;
    --ik-accent: #6545E7;
    --ik-accent-soft: rgba(118, 85, 233, 0.08);
    --ik-error: #B4232F;
    --ik-success: #23704C;
    --ik-ease: cubic-bezier(0.32, 0.72, 0, 1);
    --focus-outline: #5F40D4;
    /* Every wizard control (inputs, textareas, pickers) reads only these. */
    --ik-field-bg: #FFFFFF;
    --ik-field-text: #1E1838;
    --ik-field-placeholder: #736B8C;
    --ik-field-hover: rgba(101, 69, 231, 0.45);
    --ik-field-ring: rgba(101, 69, 231, 0.3);
    --ik-field-disabled-bg: #F4F2F9;
    --ik-field-disabled-text: #8A839F;
    --ik-field-disabled-border: #E4DFEE;
    --ik-surface-shadow: 0 18px 44px rgba(30, 20, 70, 0.18), 0 2px 6px rgba(30, 20, 70, 0.08);
    color-scheme: light;
    display: flex;
    flex-direction: column;
    width: min(100%, 480px);
    padding: 18px 28px 28px;
    border-radius: 28px;
    background: #FFFFFF;
    color: var(--ik-text);
    box-shadow: 0 32px 80px rgba(16, 8, 44, 0.38), 0 2px 8px rgba(16, 8, 44, 0.12);
    overflow: clip;
}

/* ---------- top bar ---------- */

.intake-card__bar {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    min-height: 44px;
}

.intake-back {
    grid-column: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ik-text);
    cursor: pointer;
    transition: background-color 150ms ease;
}

.intake-back:hover {
    background: var(--ik-accent-soft);
}

.intake-back[hidden] {
    display: none;
}

.intake-card .brand-lockup--intake {
    grid-column: 2;
    justify-self: center;
}

.intake-card .brand-lockup--intake .brand-logo {
    width: auto;
    height: 31px;
}

.intake-card .brand-logo--dark {
    display: none;
}

.intake-card .brand-logo--light {
    display: block;
}

.intake-progress {
    grid-column: 3;
    justify-self: end;
    margin: 0;
    color: var(--ik-muted);
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.intake-progress[hidden] {
    display: none;
}

.intake-card__title {
    margin: 6px 0 0;
    color: var(--ik-muted);
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

/* ---------- steps ---------- */

.intake-form {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin: 0;
}

.intake-steps {
    display: grid;
    margin-top: 22px;
}

.intake-step {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.intake-step[hidden] {
    display: none;
}

.intake-step.is-leaving {
    pointer-events: none;
}

.intake-step__icon {
    display: grid;
    place-items: center;
    align-self: center;
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: var(--ik-accent-soft);
    color: var(--ik-accent);
}

.intake-step__icon--done {
    background: rgba(35, 112, 76, 0.1);
    color: var(--ik-success);
}

.intake-icon {
    display: block;
    width: 24px;
    height: 24px;
}

.intake-step__question {
    margin: 0;
    color: var(--ik-text);
    font-family: var(--font-brand);
    font-size: 1.875rem;
    font-weight: 400;
    line-height: 1.15;
    text-align: center;
    text-wrap: balance;
}

.intake-step__question:focus {
    outline: none;
}

.intake-step__question label {
    margin: 0;
    font: inherit;
    cursor: pointer;
}

.intake-step__help {
    margin: 10px 0 0;
    color: var(--ik-sub);
    font-size: 0.9375rem;
    line-height: 1.5;
    text-align: center;
    text-wrap: pretty;
}

.intake-step__optional {
    margin: 6px 0 0;
    color: var(--ik-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.intake-step__control {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 22px;
}

.intake-step__error,
.intake-form-error {
    margin: 10px 0 0;
    color: var(--ik-error);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.intake-form-error {
    text-align: center;
}

.intake-step__error:empty,
.intake-form-error:empty {
    display: none;
}

/* ---------- choice cards ---------- */

.intake-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.intake-options--yes-no {
    flex-direction: row;
}

.intake-options--yes-no .intake-option {
    flex: 1;
}

.intake-options--duration {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.intake-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    margin: 0;
    padding: 12px 16px;
    border: 1.5px solid var(--ik-border);
    border-radius: 16px;
    background: #FFFFFF;
    color: var(--ik-text);
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.intake-option:hover {
    border-color: rgba(101, 69, 231, 0.45);
}

.intake-option.is-selected {
    border-color: var(--ik-accent);
    background: var(--ik-accent-soft);
    box-shadow: 0 0 0 3px rgba(101, 69, 231, 0.12);
}

.intake-option:has(.intake-option__input:focus-visible) {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

.intake-option__input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.intake-option__mark {
    position: relative;
    flex: none;
    width: 20px;
    height: 20px;
    border: 1.5px solid #B4A8D8;
    border-radius: 50%;
    background: #FFFFFF;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.intake-option__mark::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--ik-accent);
    transform: scale(0);
    transition: transform 180ms var(--ik-ease);
}

.intake-option.is-selected .intake-option__mark {
    border-color: var(--ik-accent);
}

.intake-option.is-selected .intake-option__mark::after {
    transform: scale(1);
}

.intake-option--check .intake-option__mark {
    border-radius: 6px;
}

.intake-option--check .intake-option__mark::after {
    inset: 3px 6px 6px;
    border: solid #FFFFFF;
    border-width: 0 2px 2px 0;
    border-radius: 0;
    background: transparent;
    transform: rotate(45deg) scale(0);
}

.intake-option--check.is-selected .intake-option__mark {
    background: var(--ik-accent);
}

.intake-option--check.is-selected .intake-option__mark::after {
    transform: rotate(45deg) scale(1);
}

.intake-option__label {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ---------- fields ---------- */

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

.intake-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.intake-field--wide {
    grid-column: 1 / -1;
}

.intake-field[hidden],
.intake-other[hidden] {
    display: none;
}

.intake-label {
    display: block;
    margin: 0 0 6px;
    color: var(--ik-text);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
}

.intake-label__hint {
    color: var(--ik-muted);
    font-weight: 400;
}

/* One control style for every field in the card. Scoped to .intake-card so the site-wide
   input[type="text"] rules (theme-colored text on a translucent fill) can never win. */
.intake-card .intake-input {
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 12px 14px;
    border: 1.5px solid var(--ik-field-border);
    border-radius: 14px;
    outline: none;
    background: var(--ik-field-bg);
    color: var(--ik-field-text);
    -webkit-text-fill-color: var(--ik-field-text);
    caret-color: var(--ik-accent);
    font: inherit;
    font-size: 1rem;
    line-height: 1.4;
    text-align: left;
    box-shadow: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.intake-card .intake-input::placeholder {
    color: var(--ik-field-placeholder);
    -webkit-text-fill-color: var(--ik-field-placeholder);
    opacity: 1;
}

.intake-card .intake-input:hover {
    border-color: var(--ik-field-hover);
}

.intake-card .intake-input:focus,
.intake-card .intake-input:focus-visible,
.intake-card .intake-input[aria-expanded="true"] {
    background: var(--ik-field-bg);
    color: var(--ik-field-text);
}

.intake-card .intake-input[aria-invalid="true"] {
    border-color: var(--ik-error);
}

.intake-card .intake-input[aria-invalid="true"]:focus {
    outline: none;
}

.intake-card .intake-input:disabled,
.intake-card .intake-input[aria-disabled="true"] {
    border-color: var(--ik-field-disabled-border);
    border-style: dashed;
    background: var(--ik-field-disabled-bg);
    color: var(--ik-field-disabled-text);
    -webkit-text-fill-color: var(--ik-field-disabled-text);
    cursor: not-allowed;
}

/* Browser autofill paints its own fill and text color; keep ours. */
.intake-card .intake-input:-webkit-autofill,
.intake-card .intake-input:-webkit-autofill:hover {
    -webkit-text-fill-color: var(--ik-field-text);
    box-shadow: inset 0 0 0 100px var(--ik-field-bg);
    transition: background-color 9999s ease 0s;
}

.intake-card .intake-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ik-field-text);
    box-shadow: inset 0 0 0 100px var(--ik-field-bg);
}

.intake-card .intake-input:autofill {
    -webkit-text-fill-color: var(--ik-field-text);
    box-shadow: inset 0 0 0 100px var(--ik-field-bg);
}

.intake-card .intake-input[hidden] {
    display: none;
}

.intake-card .intake-input--area {
    min-height: 120px;
    resize: vertical;
}

/* While a picker list or calendar is open it may extend past the card edge. */
.intake-card.has-open-panel {
    overflow: visible;
}

/* ---------- searchable picker (country, state/province) ---------- */

.intake-picker,
.intake-date {
    position: relative;
}

.intake-picker[hidden] {
    display: none;
}

.intake-card .intake-picker__trigger,
.intake-card .intake-date__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
}

.intake-picker__value,
.intake-date__value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.intake-card .intake-picker__trigger.is-empty .intake-picker__value,
.intake-card .intake-date__trigger.is-empty .intake-date__value {
    color: var(--ik-field-placeholder);
    -webkit-text-fill-color: var(--ik-field-placeholder);
}

.intake-picker__chevron,
.intake-date__icon {
    display: inline-flex;
    flex: none;
    color: var(--ik-sub);
    transition: transform 160ms ease;
}

.intake-picker__chevron .intake-icon,
.intake-date__icon .intake-icon {
    width: 18px;
    height: 18px;
}

.intake-picker__trigger[aria-expanded="true"] .intake-picker__chevron {
    transform: rotate(180deg);
}

.intake-picker__panel,
.intake-calendar {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    border: 1px solid var(--ik-border);
    border-radius: 16px;
    background: #FFFFFF;
    color: var(--ik-text);
    box-shadow: var(--ik-surface-shadow);
}

.intake-picker__panel {
    right: 0;
    display: flex;
    flex-direction: column;
    max-height: min(340px, 60vh);
    overflow: hidden;
}

.intake-picker__panel.is-above,
.intake-calendar.is-above {
    top: auto;
    bottom: calc(100% + 6px);
}

.intake-picker__panel[hidden],
.intake-calendar[hidden] {
    display: none;
}

.intake-picker__search {
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
    margin: 8px;
    padding: 0 12px;
    border: 1.5px solid var(--ik-field-border);
    border-radius: 12px;
    background: var(--ik-field-bg);
    color: var(--ik-sub);
}

.intake-picker__search .intake-icon {
    flex: none;
    width: 18px;
    height: 18px;
}

.intake-card .intake-picker__search-input {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: none;
    background: transparent;
    color: var(--ik-field-text);
    -webkit-text-fill-color: var(--ik-field-text);
    font: inherit;
    font-size: 1rem;
    box-shadow: none;
}

/* The search box draws the focus ring (:focus-within), so the site-wide outline would double it. */
.intake-card .intake-picker__search-input:focus,
.intake-card .intake-picker__search-input:focus-visible {
    border: 0;
    outline: none !important;
    background: transparent;
    color: var(--ik-field-text);
    box-shadow: none;
}

.intake-card .intake-picker__search-input::placeholder {
    color: var(--ik-field-placeholder);
    -webkit-text-fill-color: var(--ik-field-placeholder);
    opacity: 1;
}

.intake-picker__list {
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 0 6px 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
}

.intake-picker__option {
    position: relative;
    padding: 10px 36px 10px 12px;
    border-radius: 10px;
    color: var(--ik-text);
    font-size: 0.9375rem;
    line-height: 1.35;
    cursor: pointer;
}

.intake-picker__option[hidden] {
    display: none;
}

.intake-picker__option.is-active {
    background: var(--ik-accent-soft);
    box-shadow: inset 0 0 0 1.5px rgba(101, 69, 231, 0.35);
}

.intake-picker__option[aria-selected="true"] {
    color: var(--ik-accent);
    font-weight: 600;
}

.intake-picker__option[aria-selected="true"]::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 12px;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236545E7' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5.5 12.5 4.2 4.2L18.5 8'/%3E%3C/svg%3E") center / contain no-repeat;
    transform: translateY(-50%);
}

.intake-picker__empty {
    margin: 0;
    padding: 4px 18px 16px;
    color: var(--ik-muted);
    font-size: 0.875rem;
}

.intake-picker__empty[hidden] {
    display: none;
}

/* ---------- date picker ---------- */

.intake-calendar {
    width: 312px;
    max-width: calc(100vw - 32px);
    padding: 12px;
}

.intake-calendar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.intake-calendar__title {
    margin: 0;
    color: var(--ik-text);
    font-size: 0.9375rem;
    font-weight: 700;
}

.intake-calendar__nav,
.intake-calendar__day,
.intake-calendar__action {
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.intake-calendar__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--ik-text);
}

.intake-calendar__nav .intake-icon {
    width: 18px;
    height: 18px;
}

.intake-calendar__nav:hover,
.intake-calendar__action:hover {
    background: var(--ik-accent-soft);
}

.intake-calendar__grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.intake-calendar__grid th {
    padding: 4px 0 6px;
    color: var(--ik-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.intake-calendar__grid td {
    padding: 1px;
    text-align: center;
}

.intake-calendar__day {
    width: 100%;
    max-width: 40px;
    aspect-ratio: 1;
    border-radius: 50%;
    color: var(--ik-text);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}

.intake-calendar__day:hover {
    background: var(--ik-accent-soft);
}

.intake-calendar__day.is-today {
    box-shadow: inset 0 0 0 1.5px rgba(101, 69, 231, 0.45);
    font-weight: 700;
}

.intake-calendar__day.is-selected {
    background: var(--ik-accent);
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: none;
}

.intake-calendar__day:focus-visible,
.intake-calendar__nav:focus-visible,
.intake-calendar__action:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

.intake-calendar__foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--ik-border);
}

.intake-calendar__action {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--ik-accent);
    font-size: 0.875rem;
    font-weight: 600;
}

.intake-calendar__action--quiet {
    color: var(--ik-sub);
}

.intake-money {
    position: relative;
}

.intake-money__symbol,
.intake-money__code {
    position: absolute;
    top: 50%;
    color: var(--ik-muted);
    font-weight: 600;
    transform: translateY(-50%);
    pointer-events: none;
}

.intake-money__symbol {
    left: 16px;
}

.intake-money__code {
    right: 16px;
}

.intake-card .intake-input--money {
    padding-left: 32px;
    font-variant-numeric: tabular-nums;
}

/* ---------- party ---------- */

.intake-parties {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.intake-party {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.intake-party + .intake-party {
    padding-top: 16px;
    border-top: 1px solid var(--ik-border);
}

.intake-party__row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.intake-party__remove,
.intake-add,
.intake-link,
.intake-skip {
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.intake-party__remove {
    flex: none;
    padding: 0 10px;
    color: var(--ik-muted);
    font-size: 0.875rem;
}

.intake-party__remove:hover {
    color: var(--ik-error);
}

.intake-party__remove[hidden],
.intake-add[hidden],
.intake-skip[hidden] {
    display: none;
}

.intake-add {
    align-self: flex-start;
    padding: 0 6px;
    color: var(--ik-accent);
}

.intake-add:hover,
.intake-link:hover,
.intake-skip:hover {
    background: var(--ik-accent-soft);
}

/* ---------- jurisdiction ---------- */

.intake-geo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.intake-geo[hidden] {
    display: none;
}

.intake-geo__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1.5px solid var(--ik-border);
    border-radius: 10px;
    background: #FFFFFF;
    color: var(--ik-accent);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.intake-geo__button:hover {
    border-color: rgba(101, 69, 231, 0.45);
    background: var(--ik-accent-soft);
}

.intake-geo__button:disabled {
    cursor: progress;
    opacity: 0.6;
}

.intake-geo__button[hidden] {
    display: none;
}

.intake-geo__button .intake-icon,
.intake-detected .intake-icon {
    width: 18px;
    height: 18px;
}

.intake-geo__status {
    margin: 0;
    color: var(--ik-sub);
    font-size: 0.8125rem;
    line-height: 1.4;
    text-align: center;
}

.intake-geo__status:empty {
    display: none;
}

.intake-detected {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--ik-success);
    font-size: 0.8125rem;
    font-weight: 600;
}

.intake-detected[hidden] {
    display: none;
}

/* ---------- footer ---------- */

.intake-card__footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-top: 28px;
}

.intake-card__footer[hidden] {
    display: none;
}

.intake-card .intake-continue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 0 20px;
    border-radius: 16px;
    font-size: 1rem;
    transition: opacity 150ms ease, box-shadow 150ms ease;
}

.intake-card .intake-continue[aria-disabled="true"] {
    box-shadow: none;
    opacity: 0.45;
    cursor: not-allowed;
}

.intake-card .intake-continue[aria-busy="true"] {
    cursor: progress;
}

.intake-skip {
    align-self: center;
    padding: 0 16px;
    color: var(--ik-sub);
}

/* ---------- review details ---------- */

.intake-review__list {
    display: flex;
    flex-direction: column;
    margin: 20px 0 0;
    padding: 0;
    border: 1px solid var(--ik-border);
    border-radius: 16px;
    list-style: none;
}

.intake-review__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px 12px 16px;
    border-bottom: 1px solid var(--ik-border);
}

.intake-review__row:last-child {
    border-bottom: 0;
}

.intake-review__text {
    flex: 1;
    min-width: 0;
}

.intake-review__label {
    margin: 0;
    color: var(--ik-muted);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.intake-review__value {
    margin: 2px 0 0;
    color: var(--ik-text);
    font-weight: 500;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.intake-review__value--empty {
    color: var(--ik-muted);
    font-weight: 400;
}

.intake-review__line {
    display: block;
}

.intake-review__edit {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ik-accent);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 150ms ease;
}

.intake-review__edit:hover {
    background: var(--ik-accent-soft);
}

.intake-review__edit .intake-icon {
    width: 16px;
    height: 16px;
}

.intake-review__footer {
    margin-top: 22px;
}

.intake-link {
    padding: 0 14px;
    color: var(--ik-accent);
}

.intake-card .intake-review__restart {
    align-self: center;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: var(--ik-muted);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.intake-card .intake-review__restart:hover {
    color: var(--ik-text);
    text-decoration: underline;
}

/* ---------- motion ---------- */

.intake-step.is-entering.is-forward {
    animation: intake-in-forward 260ms var(--ik-ease) both;
}

.intake-step.is-leaving.is-forward {
    animation: intake-out-forward 220ms var(--ik-ease) both;
}

.intake-step.is-entering.is-back {
    animation: intake-in-back 260ms var(--ik-ease) both;
}

.intake-step.is-leaving.is-back {
    animation: intake-out-back 220ms var(--ik-ease) both;
}

.intake-step.is-entering.is-fade {
    animation: intake-fade 140ms ease-out both;
}

@keyframes intake-in-forward {
    from { opacity: 0; transform: translateX(28px); }
    to { opacity: 1; transform: none; }
}

@keyframes intake-out-forward {
    from { opacity: 1; transform: none; }
    to { opacity: 0; transform: translateX(-20px); }
}

@keyframes intake-in-back {
    from { opacity: 0; transform: translateX(-28px); }
    to { opacity: 1; transform: none; }
}

@keyframes intake-out-back {
    from { opacity: 1; transform: none; }
    to { opacity: 0; transform: translateX(20px); }
}

@keyframes intake-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .intake-step.is-entering.is-forward,
    .intake-step.is-entering.is-back {
        animation: intake-fade 140ms ease-out both;
    }

    .intake-step.is-leaving {
        display: none;
    }

    .intake-option,
    .intake-option__mark,
    .intake-option__mark::after,
    .intake-card .intake-input,
    .intake-back {
        transition: none;
    }
}

/* ---------- small screens ---------- */

@media (max-width: 560px) {
    .intake-workspace {
        padding: 24px 12px;
    }

    /* Clears the fixed theme and account controls in the top-right corner. */
    .intake-stage {
        align-items: stretch;
        padding: 68px 12px 12px;
    }

    .intake-card {
        width: 100%;
        min-height: calc(100dvh - 80px);
        padding: 14px 20px 0;
        border-radius: 24px;
    }

    .intake-steps {
        margin-top: 18px;
    }

    .intake-step__question {
        font-size: 1.625rem;
    }

    .intake-review__row {
        padding-left: 14px;
    }

    .intake-card__footer {
        position: sticky;
        bottom: 0;
        margin-top: auto;
        padding: 20px 0 max(16px, env(safe-area-inset-bottom));
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #FFFFFF 18px);
    }

    /* Review Details: as tall as its rows and actions, then the page scrolls. */
    .intake-card.is-review {
        min-height: 0;
        padding-bottom: 12px;
    }

    .intake-card.is-review .intake-review__footer {
        position: static;
        margin-top: 22px;
        padding: 0 0 max(8px, env(safe-area-inset-bottom));
        background: none;
    }
}

@media (max-width: 360px) {
    .intake-card {
        padding-right: 16px;
        padding-left: 16px;
    }

    .intake-fields,
    .intake-options--duration {
        grid-template-columns: minmax(0, 1fr);
    }

    .intake-step__question {
        font-size: 1.5rem;
    }
}
