/* Guided case review: the shared look of the Review view. One decision card per thing that needs an
   answer, and the result card with a tile per PQR check. These classes are global because the cards
   are drawn by several components (checks, consistency alerts, PQR rule choices, the case page).
   Every colour is a token, so the dark theme follows without extra rules. */

.gd-flow {
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ui-ink);
}

.gd-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gd-h {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ui-ink);
}

.gd-h--gap {
    margin-top: 14px;
}

.gd-lede {
    margin: 0;
    max-inline-size: 80ch;
    color: var(--ui-ink-2);
}

/* ── The card ── */
.gd-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 24px;
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    box-shadow: var(--ui-shadow-sm);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ui-ink);
    transition: border-color .3s ease, box-shadow .3s ease;
}

.gd-card.is-done {
    border-color: var(--ui-good-line);
}

/* A check's detail shown inside the result card. */
.gd-card.is-inset {
    padding: 16px 18px;
    background: color-mix(in srgb, var(--ui-surface-sunken) 45%, var(--ui-surface));
    border-color: var(--ui-line-soft);
    border-radius: 10px;
    box-shadow: none;
}

.gd-card--result {
    gap: 16px;
    padding: 22px 24px;
}

.gd-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.gd-spacer {
    flex: 1 1 auto;
}

.gd-kicker {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ui-ink-3);
}

.gd-question {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ui-ink);
}

.gd-facts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding-inline-start: 20px;
    color: var(--ui-ink-2);
}

.gd-note {
    margin: 0;
    font-size: 14px;
    color: var(--ui-ink-3);
}

.gd-msg {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-ink-2);
}

/* ── Status pills ── */
.gd-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    background: var(--ui-surface-sunken);
    color: var(--ui-ink-2);
}

.gd-chip.is-met { background: var(--ui-good-tint); color: var(--ui-good); }
.gd-chip.is-bad { background: var(--ui-bad-tint); color: var(--ui-bad); }
.gd-chip.is-todo { background: var(--ui-warn-tint); color: var(--ui-warn-ink); }
.gd-chip.is-wait { background: var(--ui-info-tint); color: var(--ui-info); }

.gd-pill {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--ui-warn-tint);
    color: var(--ui-warn-ink);
}

.gd-pill.is-met { background: var(--ui-good-fill); color: var(--ui-on-fill); }
.gd-pill.is-bad { background: var(--ui-bad-fill); color: var(--ui-on-fill); }
.gd-pill.is-wait { background: var(--ui-info); color: var(--ui-on-fill); }

/* ── Evidence: the part of a document a decision rests on ── */
.gd-evidence {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gd-ev {
    flex: 1 1 200px;
    min-inline-size: 0;
    max-inline-size: 360px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding: 12px 14px;
    text-align: start;
    font: inherit;
    color: var(--ui-ink);
    background: color-mix(in srgb, var(--ui-surface-sunken) 45%, var(--ui-surface));
    border: 1px solid var(--ui-line);
    border-radius: 10px;
}

.gd-ev--wide {
    max-inline-size: none;
    flex-basis: 100%;
}

button.gd-ev {
    cursor: pointer;
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
}

button.gd-ev:hover {
    transform: translateY(-1px);
    border-color: var(--ui-accent-line);
    box-shadow: 0 6px 14px -8px rgb(42 36 28 / .45);
}

.gd-ev-doc {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ui-ink-3);
}

.gd-ev-value {
    max-inline-size: 100%;
    padding: 4px 8px;
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
    background: var(--ui-accent-tint);
    border: 2px solid var(--ui-accent);
    border-radius: 4px;
}

.gd-ev-value.is-differs {
    background: var(--ui-bad-tint);
    border-color: var(--ui-bad);
}

.gd-ev-tag {
    font-size: 13px;
    color: var(--ui-ink-2);
    overflow-wrap: anywhere;
}

/* ── Answers ── */
.gd-answers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.gd-answer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-block-size: 44px;
    padding: 0 16px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-ink);
    background: var(--ui-surface);
    border: 1px solid var(--ui-faint);
    border-radius: 10px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}

.gd-answer:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -8px rgb(42 36 28 / .45);
}

.gd-answer:active:not(:disabled) {
    transform: none;
    box-shadow: none;
}

.gd-answer:focus-visible,
.gd-link:focus-visible,
button.gd-ev:focus-visible,
button.gd-tile:focus-visible {
    outline: 3px solid var(--ui-accent-ring);
    outline-offset: 2px;
}

.gd-answer.is-suggested {
    padding: 0 15px;
    color: var(--ui-accent-strong);
    background: var(--ui-accent-tint);
    border: 2px solid var(--ui-accent);
}

.gd-answer.is-primary {
    color: var(--ui-on-accent-fill);
    background: var(--ui-accent-fill);
    border-color: var(--ui-accent-fill);
}

.gd-answer.is-primary:hover:not(:disabled) {
    background: var(--ui-accent-fill-hover);
    border-color: var(--ui-accent-fill-hover);
}

.gd-answer[aria-pressed="true"],
.gd-answer.is-selected,
label.gd-answer:has(input:checked) {
    padding: 0 15px;
    color: var(--ui-on-fill);
    background: var(--ui-inverse);
    border: 2px solid var(--ui-inverse);
}

.gd-answer:disabled,
label.gd-answer:has(input:disabled) {
    color: var(--ui-ink-3);
    background: var(--ui-surface-sunken);
    border: 1px solid var(--ui-line-strong);
    cursor: not-allowed;
}

.gd-answer--lg {
    min-block-size: 48px;
    padding: 0 20px;
}

/* A radio drawn as an answer button: the input stays focusable but is not shown. */
label.gd-answer {
    position: relative;
}

label.gd-answer input[type="radio"] {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
}

label.gd-answer:has(input:focus-visible) {
    outline: 3px solid var(--ui-accent-ring);
    outline-offset: 2px;
}

.gd-answer-tag {
    font-weight: 500;
    text-transform: lowercase;
    opacity: .85;
}

/* ── Quiet actions under the answers ── */
.gd-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
}

.gd-link {
    min-block-size: 44px;
    padding: 0;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-accent);
    background: none;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

a.gd-link {
    display: inline-flex;
    align-items: center;
}

.gd-link:hover:not(:disabled) {
    color: var(--ui-accent-hover);
}

.gd-link:disabled {
    color: var(--ui-muted);
    cursor: not-allowed;
}

/* ── Result: one tile per check ── */
.gd-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gd-tile {
    flex: 1 1 200px;
    min-inline-size: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    text-align: start;
    font: inherit;
    color: var(--ui-ink);
    background: color-mix(in srgb, var(--ui-surface-sunken) 45%, var(--ui-surface));
    border: 1px solid transparent;
    border-radius: 10px;
}

/* The tile carries its check's result: met, not met, or still to decide (tokens carry the dark values). */
.gd-tile--met {
    background: color-mix(in srgb, var(--ui-good-tint) 45%, var(--ui-surface));
    border-color: var(--ui-good-line);
}

.gd-tile--bad {
    background: color-mix(in srgb, var(--ui-bad-tint) 45%, var(--ui-surface));
    border-color: var(--ui-bad-line);
}

.gd-tile--todo {
    background: color-mix(in srgb, var(--ui-warn-tint) 45%, var(--ui-surface));
    border-color: var(--ui-warn-line);
}

button.gd-tile {
    cursor: pointer;
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
}

button.gd-tile:hover {
    transform: translateY(-1px);
    border-color: var(--ui-accent-line);
    box-shadow: 0 6px 14px -8px rgb(42 36 28 / .45);
}

button.gd-tile[aria-expanded="true"] {
    background: var(--ui-accent-tint);
    border-color: var(--ui-accent);
}

.gd-tile-name {
    font-weight: 600;
}

.gd-tile-basis {
    font-size: 13px;
    color: var(--ui-ink-3);
    overflow-wrap: anywhere;
}

.gd-rule {
    padding-top: 14px;
    border-top: 1px solid var(--ui-line-soft);
}

.gd-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-ink-3);
}

.gd-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gd-grow {
    flex: 1 1 280px;
    color: var(--ui-ink-2);
}

/* ── Facts: a label above its value, in as many columns as fit ── */
.gd-dl {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 28px;
    margin: 0;
}

.gd-fact {
    flex: 1 1 200px;
    min-inline-size: 0;
}

.gd-fact dt {
    font-size: 13px;
    color: var(--ui-ink-3);
}

.gd-fact dd {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* ── Forms opened by an answer ── */
.gd-card .verif-form,
.gd-card form {
    font-size: 14px;
}

/* ── Page heading, section heading ── */
.gd-page-h {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.01em;
    color: var(--ui-ink);
}

.gd-h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ui-ink);
}

/* ── A list of records: one card, one row per record ── */
.gd-list {
    overflow: hidden;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ui-ink);
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    box-shadow: var(--ui-shadow-sm);
}

.gd-list-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    padding: 14px 20px;
    border-block-end: 1px solid var(--ui-line-soft);
    transition: background-color .15s ease;
}

.gd-list-row:last-child {
    border-block-end: 0;
}

.gd-list-row:hover {
    background: color-mix(in srgb, var(--ui-surface-sunken) 35%, var(--ui-surface));
}

.gd-list-empty {
    padding: 16px 20px;
    color: var(--ui-ink-3);
}

a.gd-answer {
    text-decoration: none;
}

/* ── Views of one page ── */
.gd-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-block-end: 1px solid var(--ui-line);
}

.gd-tab {
    min-block-size: 44px;
    margin-block-end: -1px;
    padding: 0 18px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--ui-ink-3);
    background: none;
    border: 0;
    border-block-end: 3px solid transparent;
    cursor: pointer;
}

.gd-tab:hover {
    color: var(--ui-ink);
}

a.gd-tab {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.gd-tab[aria-current="page"],
.gd-tab[aria-selected="true"] {
    color: var(--ui-ink);
    border-block-end-color: var(--ui-accent);
}

.gd-tab:focus-visible {
    outline: 3px solid var(--ui-accent-ring);
    outline-offset: 2px;
}

/* ── Dialog: a choice made over the page (assign a case) ── */
.gd-scrim {
    position: fixed;
    inset: 0;
    z-index: 60;
    padding: 0;
    background: var(--ui-scrim);
    border: 0;
    cursor: default;
}

.gd-dialog-wrap {
    position: fixed;
    inset: 0;
    z-index: 61;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    pointer-events: none;
}

.gd-dialog {
    display: flex;
    flex-direction: column;
    gap: 14px;
    inline-size: min(480px, 100%);
    max-block-size: 100%;
    overflow: auto;
    padding: 24px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ui-ink);
    background: var(--ui-surface);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgb(42 36 28 / .3);
    pointer-events: auto;
}

.gd-dialog-h {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--ui-ink);
}

.gd-dialog-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gd-pick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2px 12px;
    min-block-size: 48px;
    padding: 8px 14px;
    text-align: start;
    font: inherit;
    color: var(--ui-ink);
    background: var(--ui-surface);
    border: 1px solid var(--ui-line-strong);
    border-radius: 10px;
    cursor: pointer;
}

.gd-pick:hover:not(:disabled) {
    border-color: var(--ui-accent);
}

.gd-pick[aria-pressed="true"] {
    padding: 7px 13px;
    color: var(--ui-accent-strong);
    background: var(--ui-accent-tint);
    border: 2px solid var(--ui-accent);
}

.gd-pick:disabled {
    color: var(--ui-ink-3);
    background: var(--ui-surface-sunken);
    cursor: not-allowed;
}

.gd-pick:focus-visible {
    outline: 3px solid var(--ui-accent-ring);
    outline-offset: 2px;
}

.gd-pick-name {
    font-weight: 600;
}

.gd-pick-note {
    font-size: 13px;
}

.gd-link.is-danger {
    color: var(--ui-bad);
}

/* ── Drawer: a document beside the page (the scrim is the dialog's) ── */
.gd-drawer {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: 61;
    display: flex;
    flex-direction: column;
    gap: 14px;
    inline-size: min(600px, 100%);
    overflow: auto;
    padding: 24px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ui-ink);
    background: var(--ui-surface);
    border-inline-start: 1px solid var(--ui-line);
    box-shadow: -24px 0 60px rgb(42 36 28 / .2);
}

.gd-drawer-grow {
    flex: 1 1 auto;
    min-inline-size: 0;
}

.gd-drawer-page {
    padding: 12px;
    background: var(--ui-surface-sunken);
    border-radius: 10px;
}

.gd-drawer-page img {
    display: block;
    inline-size: 100%;
    block-size: auto;
    background: var(--ui-document-paper);
    border: 1px solid var(--ui-line);
    border-radius: 4px;
}

@keyframes gd-slide {
    from { opacity: 0; transform: translateX(28px); }
    to { opacity: 1; transform: none; }
}

.gd-slide {
    animation: gd-slide .3s cubic-bezier(.2, .7, .2, 1) both;
}

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

/* ── A labelled field ── */
.gd-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ui-ink-2);
}

.gd-input {
    inline-size: 100%;
    min-block-size: 44px;
    padding: 10px 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 400;
    color: var(--ui-ink);
    background: var(--ui-surface);
    border: 1px solid var(--ui-faint);
    border-radius: 10px;
}

textarea.gd-input {
    resize: vertical;
}

.gd-input:focus-visible {
    outline: 3px solid var(--ui-accent-ring);
    outline-offset: 2px;
}

/* ── Motion ── */
@keyframes gd-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes gd-pop {
    from { opacity: 0; transform: scale(.92); }
    to { opacity: 1; transform: none; }
}

.gd-rise {
    animation: gd-rise .34s cubic-bezier(.2, .7, .2, 1) both;
}

.gd-pop {
    animation: gd-pop .24s cubic-bezier(.2, .9, .3, 1.3) both;
}

@media (prefers-reduced-motion: reduce) {
    .gd-rise,
    .gd-pop {
        animation: none;
    }

    .gd-card,
    .gd-answer,
    button.gd-ev,
    button.gd-tile {
        transition: none;
    }

    .gd-answer:hover:not(:disabled),
    button.gd-ev:hover,
    button.gd-tile:hover {
        transform: none;
    }
}

@media (max-width: 640px) {
    .gd-card {
        padding: 16px;
    }

    .gd-answer {
        flex: 1 1 100%;
        justify-content: center;
    }
}
