/* Library › SAP › SAP Templates: the Templates and Methods rulebook tabs. */
.library-sap-intro {
    max-width: 62.5rem;
    color: var(--cai-muted);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.library-sap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.75rem;
}

.library-sap-columns {
    display: grid;
    /* The versions grid needs about 19rem for its two columns; the detail takes the rest and may shrink. */
    grid-template-columns: minmax(21rem, 23rem) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.library-sap-panel {
    min-width: 0;
}

/* As in the CSR prompt packages tab: the shell sits in a block container, so it needs its own height. */
.library-sap .library-sap-versions-grid.app-grid-page-grid-shell {
    flex: none;
    height: clamp(16rem, 50vh, 24rem);
}

.library-sap-heading {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cai-muted);
    margin: 0.25rem 0 0.5rem;
}

.library-sap-hint,
.library-sap-meta {
    color: var(--cai-muted);
    font-size: 0.8125rem;
}

.library-sap-meta--warning {
    color: var(--cai-warn);
}

.library-sap-stale {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.library-sap-item-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.25rem;
}

.library-sap-item-name {
    font-size: 1.125rem;
    font-weight: 600;
}

.library-sap-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.library-sap-section {
    margin-top: 1rem;
}

.library-sap-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* The library grid has no content-height layout, so each list shell gets its own bounded height; the shown
   version's rows are on one page and the list scrolls inside it. An empty list shows a line of text instead. */
.library-sap .library-sap-entries-grid.app-grid-page-grid-shell {
    flex: none;
    height: clamp(20rem, 60vh, 40rem);
}

.library-sap .library-sap-signatures-grid.app-grid-page-grid-shell {
    flex: none;
    height: clamp(10rem, 30vh, 18rem);
}

.library-sap-cell {
    padding: 0.375rem 0;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: break-word;
}

/* The grid sets no class per row: a level-2 section is indented inside its first cell. */
.library-sap-cell--indented {
    padding-left: 1rem;
}

/* nph-badge keeps its label on one line; a mode label longer than its column wraps inside the pill. */
.library-sap-entries-grid nph-badge {
    --nwc-badge-display: inline-block;
    --nwc-badge-white-space: normal;
}

.library-sap-owners {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: var(--cai-muted);
}

/* A link-like button that wraps: nph-button's shadow style keeps its label on one line (white-space: nowrap, no
   variable to change it), so a long section name ran into the next column. */
.library-sap-section-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--nwc-accent);
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.library-sap-section-link:hover,
.library-sap-section-link:focus-visible {
    text-decoration: underline;
}

.library-sap-judgement {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--cai-warn);
}

.library-sap-cell--wording {
    color: var(--cai-muted);
}

.library-sap-mono {
    font-family: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.library-sap-editor-form nph-input,
.library-sap-editor-form nph-textarea {
    --input-max-width: 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.library-sap-editor-form nph-textarea.library-sap-mono {
    --label-width: 0;
    --label-input-gap: 0;
}

.library-sap-field-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--nwc-text-form-labels);
    margin-top: 0.5rem;
}
