/* The field the author is editing (forms deck .fb-selected). */
#akashic-health-records-patient-portal-root .selected-item {
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 12px;
    background-color: var(--surface);
}

/* Column layout. A field with no span is span 12 (full width), which reproduces the
   pre-feature stacked rendering exactly. See
   docs/_CLAUDE/2026-07-16-questionnaire-grid-columns-design.md */
#akashic-health-records-patient-portal-root .ahr-q-row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 16px;
    align-items: start;
}

#akashic-health-records-patient-portal-root .ahr-q-col {
    grid-column: span 12;
    position: relative;
    /* Grid items default to min-width:auto, which lets long content blow out the column. */
    min-width: 0;
}

/* Builder-only: the whole column is the drag handle, so the move cursor IS the affordance (there is no
   visible grip). Scoped to the `--draggable` modifier, NOT `.ahr-q-col` -- the patient's form reuses
   `.ahr-q-col` and must never show a drag cursor on a field it cannot move. */
#akashic-health-records-patient-portal-root .ahr-q-col--draggable {
    cursor: move;
}

/* `cursor` is inherited, so without this the move cursor would bleed onto the field's own controls.
   Reset text-entry controls to their natural cursor; keep the pointer on clickable ones. */
#akashic-health-records-patient-portal-root .ahr-q-col--draggable input,
#akashic-health-records-patient-portal-root .ahr-q-col--draggable textarea,
#akashic-health-records-patient-portal-root .ahr-q-col--draggable select {
    cursor: auto;
}

#akashic-health-records-patient-portal-root .ahr-q-col--draggable button,
#akashic-health-records-patient-portal-root .ahr-q-col--draggable [role="button"],
#akashic-health-records-patient-portal-root .ahr-q-col--draggable a {
    cursor: pointer;
}

#akashic-health-records-patient-portal-root .ahr-q-group-children {
    margin-left: 32px;
}

/* The column being dragged. dnd-kit applies the transform inline; this is just the visual. */
#akashic-health-records-patient-portal-root .ahr-q-col.is-dragging {
    opacity: 0.5;
    z-index: 3;
}

/* A structurally empty group has no rendered children for dnd-kit to collide with, so this stands in as
   the group's droppable landing zone (see GroupDropZone in QuestionnairePreview.tsx). */
#akashic-health-records-patient-portal-root .ahr-q-group-dropzone {
    border: 1px dashed var(--line);
    border-radius: 4px;
    padding: 16px;
    text-align: center;
    color: var(--ink-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

#akashic-health-records-patient-portal-root .ahr-q-group-dropzone.is-over {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--blue-soft);
}

/* A column's width is a class, not an inline custom property: span 1 to 12, 12 being full width. */
#akashic-health-records-patient-portal-root .ahr-q-col--span-1 {
    grid-column: span 1;
}

#akashic-health-records-patient-portal-root .ahr-q-col--span-2 {
    grid-column: span 2;
}

#akashic-health-records-patient-portal-root .ahr-q-col--span-3 {
    grid-column: span 3;
}

#akashic-health-records-patient-portal-root .ahr-q-col--span-4 {
    grid-column: span 4;
}

#akashic-health-records-patient-portal-root .ahr-q-col--span-5 {
    grid-column: span 5;
}

#akashic-health-records-patient-portal-root .ahr-q-col--span-6 {
    grid-column: span 6;
}

#akashic-health-records-patient-portal-root .ahr-q-col--span-7 {
    grid-column: span 7;
}

#akashic-health-records-patient-portal-root .ahr-q-col--span-8 {
    grid-column: span 8;
}

#akashic-health-records-patient-portal-root .ahr-q-col--span-9 {
    grid-column: span 9;
}

#akashic-health-records-patient-portal-root .ahr-q-col--span-10 {
    grid-column: span 10;
}

#akashic-health-records-patient-portal-root .ahr-q-col--span-11 {
    grid-column: span 11;
}

#akashic-health-records-patient-portal-root .ahr-q-col--span-12 {
    grid-column: span 12;
}

/* Columns are unusable on a phone: collapse everything to full width. 640px is the existing
   breakpoint convention and matches PublicFormPage's card width. */
@media (max-width: 640px) {
    #akashic-health-records-patient-portal-root .ahr-q-col[class*="ahr-q-col--span-"] {
        grid-column: span 12;
    }
}

/* One question and the next, 16px apart on every surface that draws them. */
#akashic-health-records-patient-portal-root .ahr-q-item {
    margin-bottom: 16px;
}

#akashic-health-records-patient-portal-root .ahr-q-item--group {
    position: relative;
}

/* The faint rail down the left of a group's children. */
#akashic-health-records-patient-portal-root .ahr-q-group-rail {
    position: absolute;
    top: 60px;
    bottom: 0;
    left: -4px;
    width: 2px;
    background-color: var(--line);
}

#akashic-health-records-patient-portal-root .ahr-q-required {
    color: var(--danger);
}

#akashic-health-records-patient-portal-root [data-slot="wp-card"].ahr-q-card--flat {
    box-shadow: none;
}

#akashic-health-records-patient-portal-root .ahr-q-card-header {
    justify-content: center;
}

/* A yes/no question: two choices, nothing picked until somebody picks (tasks deck .q .opts). */
#akashic-health-records-patient-portal-root .ahr-q-yesno {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#akashic-health-records-patient-portal-root .ahr-q-yesno__opt {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
    color: var(--ink-strong);
    font-size: 13px;
    line-height: 1.5;
}

#akashic-health-records-patient-portal-root .ahr-q-yesno__opt.is-on {
    border-color: var(--primary);
    background: var(--blue-soft);
    color: var(--primary);
    font-weight: 500;
}
