/* The caption picker (caption-pick.js). Adds to paper.css and redefines no token.
   One row per line that can print, the line set in type the way it prints. */
.cap-pick {
    container-type: inline-size;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

/* Its own name: pro-flow.css styles the address on the sheet as .cap-title, and sharing that
   class made this legend as large as the address and shrank the address on a phone. */
.cap-pick-title {
    padding: 0;
    font: 600 17px/1.3 var(--text);
    color: var(--ink);
}

.cap-hint {
    margin-top: 6px;
    font-size: 15px;
    color: var(--muted);
}

.cap-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.cap-opt {
    position: relative;
    min-width: 0;
}

/* The real radio stays in the page for keyboards and screen readers; the row shows its state. */
.cap-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.cap-card {
    display: block;
    min-height: 44px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}

.cap-card:hover {
    border-color: var(--field-line);
}

.cap-text {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
}

/* The radio dot, at the start of the row. */
.cap-text::before {
    content: "";
    grid-row: 1 / span 2;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--field-line);
    border-radius: 50%;
    background: var(--surface);
}

/* The line as it prints: capitals, spaced, in the heading face. */
.cap-line {
    grid-column: 2;
    font: 500 15px/1.35 var(--display);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.cap-line.is-none {
    font-style: italic;
    letter-spacing: 0;
    text-transform: none;
}

.cap-name {
    grid-column: 2;
    font-size: 13px;
    line-height: 1.3;
    color: var(--muted);
}

.cap-input:checked + .cap-card {
    border-color: var(--accent);
    background: var(--panel);
    box-shadow: 0 0 0 1px var(--accent);
}

.cap-input:checked + .cap-card .cap-text::before {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 4px var(--surface);
}

.cap-input:focus-visible + .cap-card {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.cap-status {
    min-height: 1.55em;
    margin-top: 10px;
    font-size: 15px;
    color: var(--muted);
}

.cap-status.is-error {
    color: var(--ink);
    font-weight: 600;
}
