/* Form Submissions, from the receptionist deck's submissions frames. */

#akashic-health-records-patient-portal-root .ahr-form-submissions {
    min-width: 0;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__header {
    margin-bottom: 12px;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__title {
    margin: 0;
}

/* Square chips; the chosen one is filled. */
#akashic-health-records-patient-portal-root .ahr-form-submissions__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

/* The status filters are shared buttons; the chosen one is the pressed primary. */

#akashic-health-records-patient-portal-root .ahr-form-submissions__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 48px 16px;
    color: var(--ink-muted);
    font-size: 14px;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__spinner {
    width: 16px;
    height: 16px;
}

/* The rows are the shared card in the shared card list (.ak-card-list, .ak-card). */

#akashic-health-records-patient-portal-root button.ahr-form-submissions__row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    text-align: left;
    line-height: 1.55;
    cursor: pointer;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__row-main {
    display: block;
    flex: 1;
    min-width: 0;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__row-form {
    display: block;
    font-size: 14px;
    font-weight: var(--ak-heading-weight, 400);
    color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__row-sub {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
    margin-top: 3px;
    font-size: 12px;
    color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__row-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__row-date {
    flex: none;
    white-space: nowrap;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__row-snippet {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    font-size: 13.5px;
    color: var(--ink-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__row-meta {
    flex: none;
    align-self: flex-start;
    padding-top: 2px;
}

/* Status: the shared pill on a row, a square tag in the overlay, an icon on a phone row. */

#akashic-health-records-patient-portal-root .ahr-form-submissions__status-icon {
    display: none;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__status--new .ahr-form-submissions__status-icon,
#akashic-health-records-patient-portal-root .ahr-form-submissions__status--in_progress .ahr-form-submissions__status-icon {
    color: var(--warning);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__status--converted .ahr-form-submissions__status-icon {
    color: var(--sage-deep);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__status--resolved .ahr-form-submissions__status-icon {
    color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__load-more {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* A failed read or write: the shared error notice with its triangle. */
#akashic-health-records-patient-portal-root .ahr-form-submissions__alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 2px 0 8px;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__alert-icon {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

#akashic-health-records-patient-portal-root p.ahr-form-submissions__alert-title {
    margin: 0;
    color: var(--danger);
}

#akashic-health-records-patient-portal-root p.ahr-form-submissions__alert-text {
    margin: 3px 0 0;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__alert .ahr-form-submissions__alert-action {
    margin-top: 10px;
}

/* The overlay: a compact panel over the list; a sheet from under the header on a phone. */
#akashic-health-records-patient-portal-root [data-slot="dialog-content"].ahr-form-submissions__sheet {
    display: flex;
    flex-direction: column;
    width: min(620px, calc(100vw - 36px));
    max-width: min(620px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    padding: 0;
    gap: 0;
    overflow: hidden;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__sheet > [data-slot="dialog-close"] {
    display: grid;
    place-items: center;
    top: 15px;
    right: 22px;
    width: 32px;
    height: 32px;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__sheet > [data-slot="dialog-close"] svg {
    width: 18px;
    height: 18px;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__head {
    flex: none;
    padding: 18px 60px 18px 22px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__head [data-slot="dialog-title"] {
    margin: 0;
    padding: 0;
    line-height: 1.55;
    text-align: left;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 22px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__footer {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-top: 1px solid var(--line);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__spacer {
    flex: 1;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__footer .btn svg,
#akashic-health-records-patient-portal-root .ahr-form-submissions__actions .btn svg {
    width: 14px;
    height: 14px;
    flex: none;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 0 16px;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__facts > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__facts dt {
    display: block;
    font-size: 12px;
    color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__facts dd {
    display: block;
    margin: 0;
    font-size: 14px;
    color: var(--ink);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__status--tag .ahr-form-submissions__status-text {
    padding: 2px 7px;
    border: 0;
    border-radius: 2px;
    font-size: 12px;
    line-height: 1.5;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__heading {
    display: block;
    margin: 16px 0 8px;
    font-size: 14px;
    font-weight: var(--ak-body-weight, 300);
    line-height: 1.5;
    color: var(--ink-strong);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__answer {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__answer-label {
    display: block;
    font-size: 12px;
    color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root p.ahr-form-submissions__answer-value {
    margin: 4px 0;
    font-size: 14px;
    color: var(--ink);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#akashic-health-records-patient-portal-root p.ahr-form-submissions__note {
    margin: 13px 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-muted);
}

#akashic-health-records-patient-portal-root p.ahr-form-submissions__plain {
    margin: 14px 0;
    font-size: 14px;
    color: var(--ink);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__body > p.ahr-form-submissions__plain:first-child {
    margin-top: 0;
}

#akashic-health-records-patient-portal-root p.ahr-form-submissions__success {
    margin: 14px 0;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__field {
    display: block;
    margin: 0 0 14px;
}

/* The label, fields and radios are the shared ones (.ak-label and the foundation field rules). */
#akashic-health-records-patient-portal-root .ahr-form-submissions__label {
    display: block;
    margin-bottom: 5px;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__input {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

#akashic-health-records-patient-portal-root textarea.ahr-form-submissions__input {
    resize: vertical;
}

#akashic-health-records-patient-portal-root label.ahr-form-submissions__candidate {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__candidate-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--ink);
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__candidate-name input[type="radio"] {
    flex: none;
    margin: 0 0 0 5px;
}

#akashic-health-records-patient-portal-root .ahr-form-submissions__candidate-detail {
    display: block;
    margin: 4px 0;
    font-size: 14px;
    color: var(--ink);
}

@media (max-width: 640px) {
    #akashic-health-records-patient-portal-root .ahr-form-submissions__row-meta {
        padding-top: 2px;
    }

    #akashic-health-records-patient-portal-root button.ahr-form-submissions__row {
        gap: 10px;
    }

    #akashic-health-records-patient-portal-root .ahr-form-submissions__row-meta .ahr-form-submissions__status-text {
        display: none;
    }

    #akashic-health-records-patient-portal-root .ahr-form-submissions__row-meta .ahr-form-submissions__status-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
    }

    #akashic-health-records-patient-portal-root .ahr-form-submissions__status-icon svg {
        width: 18px;
        height: 18px;
        stroke-width: 1.8;
    }

    /* The 44px touch floor for every control a thumb meets on this screen. */
    #akashic-health-records-patient-portal-root button.ahr-form-submissions__filter,
    #akashic-health-records-patient-portal-root .ahr-form-submissions__sheet .btn {
        min-height: 44px;
    }

    #akashic-health-records-patient-portal-root [data-slot="dialog-content"].ahr-form-submissions__sheet {
        top: 52px;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        max-height: none;
        border-radius: 14px 14px 0 0;
        transform: none;
        translate: none;
    }

    #akashic-health-records-patient-portal-root .ahr-form-submissions__head,
    #akashic-health-records-patient-portal-root .ahr-form-submissions__footer {
        padding: 14px 16px;
    }

    #akashic-health-records-patient-portal-root .ahr-form-submissions__head {
        padding-right: 56px;
    }

    #akashic-health-records-patient-portal-root .ahr-form-submissions__sheet > [data-slot="dialog-close"] {
        top: 12px;
        right: 10px;
    }

    #akashic-health-records-patient-portal-root .ahr-form-submissions__body {
        padding: 16px;
    }

    #akashic-health-records-patient-portal-root .ahr-form-submissions__facts {
        grid-template-columns: 1fr;
    }
}
