/* Checklist library and compact thermal-label output. */

.checklist-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.checklist-sheet-context {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 12px;
}

.checklist-device-assignment {
    display: grid;
    min-width: min(360px, 44vw);
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #bac6d8;
    border-left: 4px solid var(--sg-cyan, #00cfe8);
    background: #f7fafc;
}

.checklist-device-assignment.is-linked {
    border-color: #93d9d1;
    border-left-color: #10b981;
    background: #f0fdf9;
}

.checklist-device-assignment label {
    display: grid;
    grid-template-columns: auto minmax(150px, 1fr);
    align-items: center;
    gap: 8px;
}

.checklist-device-assignment label > span {
    color: var(--sg-ink-950, #071226);
    font-size: 0.62rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.checklist-device-assignment select {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 6px 28px 6px 8px;
    border: 1px solid #9dacbf;
    background: #fff;
    color: var(--sg-ink-950, #071226);
    font-size: 0.72rem;
    font-weight: 800;
}

.checklist-device-assignment small {
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.58rem;
    line-height: 1.25;
}

.checklist-device-assignment > button {
    justify-self: start;
    padding: 0;
    border: 0;
    background: none;
    color: #047857;
    font-size: 0.62rem;
    font-weight: 900;
    cursor: pointer;
}

.checklist-record-device button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

.checklist-record-device button span {
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.7rem;
}

.sheet-check input {
    display: grid;
    width: 22px;
    height: 22px;
    min-height: 22px;
    flex: 0 0 22px;
    margin: 0;
    place-content: center;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid var(--sg-ink-950, #071226);
    border-radius: 0;
    background: #ffffff;
    cursor: pointer;
}

.sheet-check input::before {
    content: '✓';
    color: #ffffff;
    font-size: 15px;
    font-weight: 950;
    line-height: 1;
    opacity: 0;
    transform: scale(0.7);
}

.sheet-check input:checked {
    border-color: #000000;
    background: #000000;
}

.sheet-check input:checked::before {
    opacity: 1;
    transform: scale(1);
}

.sheet-check input:focus-visible {
    outline: 3px solid var(--sg-cyan, #00cfe8);
    outline-offset: 2px;
}

.sheet-check:has(input:checked) span {
    color: var(--sg-ink-950, #071226);
    font-weight: 950;
}

.sheet-confirmed,
.sheet-missing {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.sheet-confirmed {
    color: var(--sg-ink-950, #071226) !important;
    font-weight: 950;
}

.sheet-confirm-box,
.checklist-view-confirm {
    display: inline-grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    border: 2px solid #000000;
    background: #000000;
    color: #ffffff;
    font-size: 15px;
    font-style: normal;
    font-weight: 950;
    line-height: 1;
}

.sheet-confirm-box.is-empty,
.checklist-view-confirm.is-empty {
    border-color: var(--sg-ink-950, #071226);
    background: #ffffff;
    color: transparent;
}

.checklist-view-confirm-spacer {
    width: 24px;
    flex: 0 0 24px;
}

.checklist-checkbox {
    border-color: var(--sg-ink-950, #071226);
    background: #ffffff;
}

.checklist-checkbox.checked {
    border-color: #000000;
    background: #000000;
    color: #ffffff;
    box-shadow: none;
}

.checklist-sheet-sections {
    width: 100%;
}

.checklist-sheet-sections.is-two-column {
    column-count: 2;
    column-gap: 18px;
}

.checklist-sheet-sections .checklist-sheet-table {
    display: table;
    width: 100%;
    break-inside: avoid;
    page-break-inside: avoid;
}

.checklist-sheet-table:not(.ccr-sensor-matrix) {
    table-layout: fixed;
}

.checklist-sheet-table:not(.ccr-sensor-matrix) td:first-child {
    width: 62%;
}

.checklist-sheet-table:not(.ccr-sensor-matrix) .sheet-answer-cell {
    width: 38%;
    min-width: 0;
    overflow: hidden;
}

.checklist-sheet-table .sheet-reading-control,
.checklist-sheet-table .sheet-reading-control > div,
.checklist-sheet-table .sheet-choice-control select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.checklist-sheet-table .sheet-reading-control > small {
    overflow-wrap: anywhere;
}

.checklist-sheet-section-group {
    break-inside: avoid;
    page-break-inside: avoid;
}

.checklist-sheet-section-group + .checklist-sheet-section-group {
    margin-top: 14px;
}

.sheet-field-row > td {
    transition: background-color 160ms ease, color 160ms ease;
}

.sheet-field-row.is-ok > td,
.checklist-sheet-initials-row.is-ok > td {
    background: rgba(16, 185, 129, 0.09);
}

.sheet-field-row.is-warning > td {
    background: rgba(245, 158, 11, 0.1);
}

.sheet-field-row.is-danger > td {
    background: rgba(239, 68, 68, 0.1);
}

.checklist-sheet-section-group.is-complete .checklist-sheet-table {
    outline: 2px solid rgba(16, 185, 129, 0.5);
    outline-offset: -1px;
}

.checklist-sheet-section-group.is-complete .checklist-sheet-table thead th {
    border-color: #047857;
    background: #047857;
    color: #ffffff;
}

.checklist-sheet-section-group.is-complete > .checklist-sheet-table:first-of-type thead th:first-child::after {
    content: '✓ CLEAR';
    float: right;
    margin-left: 8px;
    color: #d1fae5;
    font-size: 0.56rem;
    font-weight: 950;
    letter-spacing: 0.1em;
}

.checklist-sheet-initials {
    display: inline-grid;
    min-width: 48px;
    min-height: 30px;
    place-items: center;
    padding: 4px 9px;
    border: 2px solid var(--sg-ink-950, #071226);
    background: var(--sg-electric-yellow, #ffe000);
    color: var(--sg-ink-950, #071226);
    font-size: 0.82rem;
    font-weight: 950;
    letter-spacing: 0.12em;
}

.ccr-sensor-matrix {
    table-layout: fixed;
}

.ccr-sensor-matrix thead th:first-child {
    width: 43%;
    text-align: left;
}

.ccr-sensor-matrix thead th:not(:first-child) {
    width: 19%;
    text-align: center;
}

.ccr-sensor-matrix tbody th {
    padding: 7px 8px;
    background: #dff4fb;
    color: var(--sg-ink-950, #071226);
    text-align: left;
    vertical-align: middle;
}

.ccr-sensor-matrix tbody th strong,
.ccr-sensor-matrix tbody th small {
    display: block;
}

.ccr-sensor-matrix tbody th strong {
    font-size: 0.72rem;
    font-weight: 900;
}

.ccr-sensor-matrix tbody th small {
    margin-top: 2px;
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.58rem;
    line-height: 1.2;
}

.ccr-sensor-reading {
    padding: 5px !important;
    text-align: center;
    transition: background 150ms ease;
}

.ccr-sensor-reading > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.ccr-sensor-reading input {
    width: min(100%, 62px) !important;
    min-height: 30px !important;
    padding: 4px !important;
    border: 1px solid #b7c1d2 !important;
    background: #ffffff !important;
    font-weight: 850 !important;
    text-align: center !important;
}

.ccr-sensor-reading output {
    font-size: 0.78rem;
    font-weight: 950;
}

.ccr-sensor-reading > div > span {
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.58rem;
    font-weight: 800;
}

.ccr-sensor-reading > small {
    display: block;
    min-height: 1.1em;
    margin-top: 2px;
    font-size: 0.52rem;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
}

.ccr-sensor-reading.is-ok,
.sheet-reading-control.is-ok {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.ccr-sensor-reading.is-warning,
.sheet-reading-control.is-warning {
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
}

.ccr-sensor-reading.is-danger,
.sheet-reading-control.is-danger {
    background: rgba(239, 68, 68, 0.13);
    color: #b91c1c;
}

.sheet-reading-control {
    display: grid;
    min-width: 0;
}

.sheet-reading-control > div {
    display: flex;
    align-items: center;
    min-width: 0;
}

.sheet-reading-control > small {
    padding: 3px 6px 5px;
    font-size: 0.55rem;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    text-transform: uppercase;
}

.sheet-choice-control select {
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid #aeb9c9;
    background: transparent;
    color: var(--sg-ink-950, #071226);
    font-weight: 900;
    text-align: center;
}

.sheet-choice-control.is-ok select {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
}

.sheet-choice-control.is-danger select {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.09);
    color: #b91c1c;
}

.sheet-choice-result {
    display: inline-grid;
    min-width: 64px;
    place-items: center;
    padding: 5px 9px;
    border: 2px solid currentColor;
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sheet-choice-result.is-ok {
    color: #047857;
}

.sheet-choice-result.is-danger {
    background: #b91c1c;
    color: #ffffff;
}

.checklist-sheet-notes {
    display: grid;
    gap: 7px;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--sg-line, #d9dee9);
    border-left: 4px solid var(--sg-cyan, #00cfe8);
    background: #f8fbfd;
}

.checklist-sheet-notes > span {
    color: var(--sg-ink-950, #071226);
    font-size: 0.7rem;
    font-weight: 950;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.checklist-sheet-notes textarea {
    width: 100%;
    min-height: 94px;
    padding: 11px 12px;
    border: 1px solid #bcc7d7;
    background: #ffffff;
    color: var(--sg-ink-950, #071226);
    font: inherit;
    line-height: 1.45;
    resize: vertical;
}

.checklist-sheet-validation {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
    padding: 14px 16px;
    border-left: 4px solid currentColor;
}

.checklist-sheet-validation.is-clear {
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
}

.checklist-sheet-validation.has-warnings {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.checklist-sheet-validation strong,
.checklist-sheet-validation span {
    display: block;
}

.checklist-sheet-validation strong {
    font-size: 0.78rem;
    font-weight: 950;
    text-transform: uppercase;
}

.checklist-sheet-validation span,
.checklist-sheet-validation li {
    font-size: 0.68rem;
    line-height: 1.4;
}

.checklist-sheet-validation ul {
    margin: 8px 0 0;
    padding-left: 17px;
}

.checklist-sheet-validation li.is-danger {
    color: #b91c1c;
}

.checklist-sheet-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
    padding: 18px;
    border-top: 3px solid var(--sg-ink-950, #071226);
    background: var(--sg-ink-950, #071226);
    color: #ffffff;
}

.checklist-sheet-signer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 2px 11px;
}

.checklist-sheet-signer > span,
.checklist-sheet-signer > small {
    grid-column: 2;
}

.checklist-sheet-signer > span {
    color: var(--sg-cyan, #00cfe8);
    font-size: 0.58rem;
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.checklist-sheet-signer > strong {
    grid-row: 1 / span 2;
    padding: 9px 10px;
    border: 2px solid #ffffff;
    font-size: 1.15rem;
    font-weight: 950;
    letter-spacing: 0.08em;
}

.checklist-sheet-signer > small {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.62rem;
}

.checklist-sheet-action-buttons {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.checklist-sheet-actions .btn-secondary {
    border-color: #ffffff;
    color: #ffffff;
}

.checklist-sheet-actions .btn-secondary:hover {
    background: #ffffff;
    color: var(--sg-ink-950, #071226);
}

.checklist-library {
    width: min(100%, 1920px);
    margin: 18px auto 28px;
    border: 1px solid var(--sg-line, #d9dee9);
    border-top: 4px solid var(--sg-cyan, #00cfe8);
    background: var(--sg-paper, #ffffff);
    box-shadow: var(--sg-shadow-object, 0 12px 28px rgba(8, 18, 42, 0.08));
}

.checklist-library-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding: 24px;
    background:
        linear-gradient(112deg, rgba(0, 207, 232, 0.11), transparent 44%),
        linear-gradient(160deg, #071226 0 24%, #101a31 24% 100%);
}

.checklist-library-header > div:first-child {
    max-width: 720px;
}

.checklist-library-header .section-label {
    color: var(--sg-cyan, #00cfe8);
}

.checklist-library-header h2 {
    margin: 6px 0 4px;
    color: #ffffff;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    font-weight: 950;
    letter-spacing: -0.045em;
    line-height: 0.9;
    text-transform: uppercase;
}

.checklist-library-header p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.72rem;
    line-height: 1.5;
}

.checklist-library-count {
    display: grid;
    min-width: 126px;
    padding: 13px 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 4px solid var(--sg-cyan, #00cfe8);
    background: rgba(255, 255, 255, 0.06);
}

.checklist-library-count strong {
    color: #ffffff;
    font-size: 1.65rem;
    font-weight: 950;
    line-height: 1;
}

.checklist-library-count span {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.5rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.checklist-library-filters {
    display: flex;
    gap: 5px;
    padding: 10px 12px;
    overflow-x: auto;
    border-bottom: 1px solid var(--sg-line, #d9dee9);
    background: var(--sg-paper-muted, #f5f7fb);
}

.checklist-library-filters button {
    min-height: 34px;
    flex: 0 0 auto;
    padding: 0 12px;
    border: 1px solid var(--sg-line, #d9dee9);
    border-left: 3px solid var(--sg-cyan, #00cfe8);
    background: #ffffff;
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.55rem;
    font-weight: 950;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.checklist-library-filters button.is-active {
    border-color: var(--sg-ink-950, #071226);
    background: var(--sg-ink-950, #071226);
    color: #ffffff;
}

.checklist-library-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
}

.checklist-library-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 300px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--sg-line, #d9dee9);
    border-top: 3px solid var(--sg-violet, #7457ff);
    background:
        linear-gradient(145deg, rgba(116, 87, 255, 0.055), transparent 45%),
        #ffffff;
}

.checklist-library-card.is-featured {
    grid-column: span 2;
    border-top-color: var(--sg-cyan, #00cfe8);
    background:
        linear-gradient(90deg, rgba(0, 207, 232, 0.08), transparent 42%),
        #ffffff;
}

.checklist-library-card::after {
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 58px;
    height: 58px;
    border: 3px solid var(--sg-cyan, #00cfe8);
    content: "";
    transform: rotate(45deg);
}

.checklist-library-card[hidden] {
    display: none;
}

.checklist-library-card-topline {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 13px;
    border-bottom: 1px solid var(--sg-line, #d9dee9);
    background: var(--sg-paper-muted, #f5f7fb);
}

.checklist-library-card-topline span {
    overflow: hidden;
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.5rem;
    font-weight: 950;
    letter-spacing: 0.055em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.checklist-library-card-topline span:first-child i {
    margin-right: 4px;
    color: var(--sg-cyan-dark, #009db7);
}

.checklist-library-card-topline .is-installed {
    color: var(--sg-green, #00b875);
}

.checklist-library-card-copy {
    flex: 1;
    padding: 19px 18px 15px;
}

.checklist-library-card-copy small {
    color: var(--sg-violet, #7457ff);
    font-size: 0.53rem;
    font-weight: 950;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.checklist-library-card-copy h3 {
    max-width: 680px;
    margin: 7px 0 8px;
    color: var(--sg-ink-950, #071226);
    font-size: clamp(1.15rem, 2vw, 1.85rem);
    font-weight: 950;
    letter-spacing: -0.035em;
    line-height: 0.98;
    text-transform: uppercase;
}

.checklist-library-card-copy p {
    max-width: 680px;
    margin: 0;
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.68rem;
    line-height: 1.5;
}

.checklist-library-card-meta {
    display: flex;
    gap: 1px;
    border-top: 1px solid var(--sg-line, #d9dee9);
    border-bottom: 1px solid var(--sg-line, #d9dee9);
    background: var(--sg-line, #d9dee9);
}

.checklist-library-card-meta span {
    min-width: 0;
    flex: 1;
    padding: 8px 10px;
    background: var(--sg-paper-muted, #f5f7fb);
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.49rem;
    font-weight: 900;
    text-transform: uppercase;
}

.checklist-library-card-meta strong {
    display: block;
    color: var(--sg-ink-950, #071226);
    font-size: 0.68rem;
}

.checklist-library-card-meta .has-label strong {
    color: var(--sg-cyan-dark, #009db7);
}

.checklist-library-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0;
    padding: 9px 13px;
    border-bottom: 1px solid var(--sg-line, #d9dee9);
    background: rgba(255, 196, 0, 0.08);
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.54rem;
    line-height: 1.35;
}

.checklist-library-disclaimer i {
    margin-top: 1px;
    color: #bf8800;
}

.checklist-library-card > footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    padding: 10px 12px;
}

.checklist-template-builder-option.is-library {
    border-left-color: var(--sg-violet, #7457ff);
}

.checklist-template-builder-option.is-library > i {
    color: var(--sg-violet, #7457ff);
}

.checklist-label-dialog {
    display: flex;
    flex-direction: column;
    width: min(96vw, 1040px);
    max-width: 1040px;
}

/* The base .modal is overflow:hidden — without a scrolling body the print
   buttons in the footer are unreachable once the previews outgrow the modal. */
.checklist-label-dialog > .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.checklist-label-comparison {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.checklist-label-variant {
    min-width: 0;
    overflow: hidden;
    border: 2px solid #c9d2df;
    background: #f8fafc;
}

.checklist-label-variant.is-selected {
    border-color: var(--sg-cyan, #00cfe8);
    box-shadow: 0 0 0 3px rgba(0, 207, 232, 0.14);
}

.checklist-label-variant-selector {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #c9d2df;
    background: #ffffff;
    color: var(--sg-ink-950, #071226);
    cursor: pointer;
}

.checklist-label-variant.is-selected .checklist-label-variant-selector {
    background: var(--sg-ink-950, #071226);
    color: #ffffff;
}

.checklist-label-variant-selector span {
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.checklist-label-variant-selector strong {
    font-size: 0.72rem;
}

.checklist-label-preview-stage {
    display: grid;
    min-height: 330px;
    place-items: center;
    padding: 14px;
    overflow: auto;
    background:
        linear-gradient(45deg, #e9edf3 25%, transparent 25%),
        linear-gradient(-45deg, #e9edf3 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e9edf3 75%),
        linear-gradient(-45deg, transparent 75%, #e9edf3 75%),
        #f8fafc;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}

.checklist-label-preview-stage .checklist-label-80x50 {
    box-shadow: none;
}

.checklist-label-printer-note {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 14px;
    padding: 12px 14px;
    border-left: 3px solid var(--sg-cyan, #00cfe8);
    background: rgba(0, 207, 232, 0.07);
}

.checklist-label-printer-note > i {
    color: var(--sg-cyan-dark, #009db7);
}

.checklist-label-printer-note strong {
    color: var(--sg-ink-950, #071226);
    font-size: 0.63rem;
    font-weight: 950;
    text-transform: uppercase;
}

.checklist-label-printer-note p {
    margin: 3px 0 0;
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.62rem;
    line-height: 1.45;
}

.checklist-niimbot-panel {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 11px 13px;
    border: 1px solid #c8d1df;
    border-left: 4px solid var(--sg-violet, #7457ff);
    background:
        linear-gradient(100deg, rgba(116, 87, 255, 0.08), transparent 42%),
        #ffffff;
}

.checklist-niimbot-panel.is-connected {
    border-color: #8ad7ca;
    border-left-color: #10b981;
    background:
        linear-gradient(100deg, rgba(16, 185, 129, 0.09), transparent 42%),
        #ffffff;
}

.checklist-niimbot-panel.is-error {
    border-color: #f4a6ae;
    border-left-color: #ef476f;
    background:
        linear-gradient(100deg, rgba(239, 71, 111, 0.08), transparent 42%),
        #ffffff;
}

.checklist-niimbot-panel.is-complete {
    border-left-color: #10b981;
}

.checklist-niimbot-panel.is-unsupported {
    border-left-color: #94a3b8;
    background: #f8fafc;
}

.checklist-niimbot-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #c8d1df;
    background: var(--sg-ink-950, #071226);
    color: #ffffff;
    font-size: 1rem;
    transform: skewX(-5deg);
}

.checklist-niimbot-panel.is-connected .checklist-niimbot-mark {
    border-color: #10b981;
    background: #047857;
}

.checklist-niimbot-panel.is-unsupported .checklist-niimbot-mark {
    background: #64748b;
}

.checklist-niimbot-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.checklist-niimbot-copy > span {
    color: var(--sg-violet, #7457ff);
    font-size: 0.48rem;
    font-weight: 950;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.checklist-niimbot-panel.is-connected .checklist-niimbot-copy > span {
    color: #047857;
}

.checklist-niimbot-copy > strong {
    color: var(--sg-ink-950, #071226);
    font-size: 0.76rem;
    font-weight: 950;
}

.checklist-niimbot-copy > p {
    margin: 0;
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.59rem;
    line-height: 1.35;
}

.checklist-niimbot-progress {
    width: 100%;
    height: 4px;
    margin-top: 5px;
    overflow: hidden;
    background: #e2e8f0;
}

.checklist-niimbot-progress[hidden] {
    display: none;
}

.checklist-niimbot-progress i {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--sg-cyan, #00cfe8), var(--sg-violet, #7457ff));
    transition: width 180ms ease;
}

.checklist-niimbot-panel.is-complete .checklist-niimbot-progress i {
    background: #10b981;
}

.checklist-label-dialog > .modal-footer {
    flex-wrap: wrap;
}

/* Physical label. All measurements below are intentional print dimensions. */

.checklist-label-80x50 {
    display: grid;
    width: 80mm;
    height: 50mm;
    grid-template-rows: 6.2mm minmax(0, 1fr) 3.4mm;
    overflow: hidden;
    border: 0;
    background: #ffffff;
    color: #000000;
    font-family: "Arial Narrow", "Roboto Condensed", Arial, Helvetica, sans-serif;
    line-height: 1;
    box-sizing: border-box;
}

.checklist-label-80x50.is-portrait {
    width: 50mm;
    height: 80mm;
    grid-template-rows: 7.4mm minmax(0, 1fr) 3.4mm;
}

.compact-label-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1mm;
    padding: 0.65mm 1.2mm 0.4mm;
    border-bottom: 0;
}

.compact-label-identity {
    display: grid;
    min-width: 0;
    grid-template-columns: 13mm minmax(0, 1fr);
    align-items: center;
    gap: 0.8mm;
}

.compact-label-brand {
    font-size: 2.35mm;
    font-weight: 950;
    letter-spacing: -0.12mm;
}

.compact-label-brand span {
    color: #000000;
}

.compact-label-brand i {
    margin: 0 0.35mm;
    font-style: normal;
}

.compact-label-title {
    display: grid;
    min-width: 0;
    gap: 0.45mm;
}

.compact-label-title strong {
    overflow: hidden;
    font-size: 3.05mm;
    font-weight: 950;
    letter-spacing: -0.13mm;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.compact-label-title span {
    font-size: 1.2mm;
    font-weight: 800;
    letter-spacing: 0.08mm;
}

.compact-label-print-date {
    display: flex;
    min-width: 0;
    min-height: 0;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    border: 0;
    background: transparent;
    color: #000000;
    text-align: left;
}

.compact-label-print-date strong {
    margin: 0;
    font-size: 3.2mm;
    font-weight: 950;
    letter-spacing: 0.03mm;
    line-height: 1;
}

.compact-label-signer {
    display: grid;
    min-width: 10mm;
    min-height: 4.5mm;
    place-content: center;
    padding: 0.45mm 0.5mm;
    background: #000000;
    color: #ffffff;
    text-align: center;
}

.compact-label-signer strong {
    font-size: 3.15mm;
    font-weight: 950;
    letter-spacing: 0.15mm;
    line-height: 0.95;
}

.checklist-label-80x50.is-portrait .compact-label-header {
    grid-template-columns: minmax(0, 1fr) 11mm;
    grid-template-rows: 1fr;
    align-content: center;
    gap: 0.8mm;
    padding: 0.65mm 1mm 0.35mm;
}

.checklist-label-80x50.is-portrait .compact-label-identity {
    grid-column: 1 / -1;
    grid-template-columns: 13.4mm minmax(0, 1fr);
}

.checklist-label-80x50.is-portrait .compact-label-title {
    gap: 0.25mm;
}

.checklist-label-80x50.is-portrait .compact-label-title strong {
    font-size: 2.7mm;
}

.checklist-label-80x50.is-portrait .compact-label-title span {
    font-size: 1.1mm;
}

.checklist-label-80x50.is-portrait .compact-label-print-date,
.checklist-label-80x50.is-portrait .compact-label-signer {
    min-height: 4.3mm;
}

.checklist-label-80x50.is-portrait .compact-label-print-date {
    grid-column: 1;
    padding: 0;
    border: 0;
}

.checklist-label-80x50.is-portrait .compact-label-signer {
    grid-column: 2;
}

.compact-label-columns {
    display: grid;
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7mm;
    padding: 0.65mm 0.8mm 0.5mm;
}

.checklist-label-80x50.is-portrait .compact-label-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65mm;
    padding: 0.85mm 0.8mm 0.65mm;
}

.checklist-label-80x50.is-portrait .compact-label-column {
    overflow: hidden;
}

.checklist-label-80x50.is-portrait .compact-label-column section + section {
    margin-top: 0.9mm;
}

.checklist-label-80x50.is-portrait .compact-label-columns.is-ccr-portrait-grid {
    grid-template-areas:
        "assembly preparation"
        "supply preparation"
        "sensors sensors"
        "calibration calibration";
    grid-template-rows: auto auto auto auto;
    align-content: start;
    gap: 0.65mm;
}

.checklist-label-80x50.is-portrait .is-ccr-portrait-grid .compact-label-section-assembly {
    grid-area: assembly;
}

.checklist-label-80x50.is-portrait .is-ccr-portrait-grid .compact-label-section-preparation {
    grid-area: preparation;
}

.checklist-label-80x50.is-portrait .is-ccr-portrait-grid .compact-label-section-supply {
    grid-area: supply;
}

.checklist-label-80x50.is-portrait .is-ccr-portrait-grid .compact-label-section-calibration {
    grid-area: calibration;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.35mm;
}

.checklist-label-80x50.is-portrait .is-ccr-portrait-grid .compact-label-section-calibration > h4 {
    grid-column: 1 / -1;
}

.checklist-label-80x50.is-portrait .is-ccr-portrait-grid
    .compact-label-section-calibration [data-compact-label-field="calibration_result"] {
    grid-column: 1 / -1;
}

.checklist-label-80x50.is-portrait .is-ccr-portrait-grid
    .compact-label-section-calibration [data-compact-label-field="calibration_result"] .compact-label-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checklist-label-80x50.is-portrait .is-ccr-portrait-grid .compact-label-section-sensors {
    grid-area: sensors;
}

.checklist-label-80x50.is-portrait .compact-label-column h4 {
    margin-bottom: 0.35mm;
    padding: 0.58mm 0.48mm 0.5mm;
    font-size: 2.05mm;
    letter-spacing: 0.06mm;
}

.checklist-label-80x50.is-portrait .is-ccr-portrait-grid .compact-label-section h4 {
    margin-bottom: 0.35mm;
    padding: 0.58mm 0.48mm 0.5mm;
    font-size: 2.05mm;
    letter-spacing: 0.06mm;
}

.checklist-label-80x50.is-portrait .compact-label-row {
    min-height: 2.5mm;
    grid-template-columns: 2.45mm minmax(0, 1fr) auto;
    gap: 0.3mm;
    padding: 0.12mm 0.28mm;
    font-size: 2.05mm;
}

.checklist-label-80x50.is-portrait .compact-label-check {
    width: 2.2mm;
    height: 2.2mm;
    font-size: 2.05mm;
}

.checklist-label-80x50.is-portrait .compact-label-name {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.03;
    text-overflow: clip;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.checklist-label-80x50.is-portrait .compact-label-row > strong {
    max-width: 9mm;
    font-size: 1.88mm;
}

.checklist-label-80x50.is-portrait .compact-label-row > strong.is-choice-pass,
.checklist-label-80x50.is-portrait .compact-label-row > strong.is-choice-fail {
    padding: 0.18mm 0.3mm;
    font-size: 1.68mm;
}

.checklist-label-80x50.is-portrait .compact-label-sensor-matrix {
    margin-bottom: 0.45mm;
}

.checklist-label-80x50.is-portrait .compact-label-sensor-head,
.checklist-label-80x50.is-portrait .compact-label-sensor-row {
    min-height: 2.65mm;
    grid-template-columns: 13mm repeat(3, minmax(0, 1fr));
}

.checklist-label-80x50.is-portrait .compact-label-sensor-head {
    font-size: 1.8mm;
}

.checklist-label-80x50.is-portrait .compact-label-sensor-row {
    font-size: 2mm;
}

.compact-label-column {
    min-width: 0;
    overflow: hidden;
}

.compact-label-column section + section {
    margin-top: 0.55mm;
}

.compact-label-section-sensors {
    min-width: 0;
    grid-column: 1 / -1;
}

.checklist-label-80x50.is-landscape .compact-label-columns.is-ccr-label-grid {
    gap: 0.35mm 0.7mm;
    padding-top: 0.4mm;
    padding-bottom: 0.35mm;
}

.checklist-label-80x50.is-landscape .is-ccr-label-grid .compact-label-column section + section {
    margin-top: 0.3mm;
}

.checklist-label-80x50.is-landscape .is-ccr-label-grid .compact-label-section > h4 {
    margin-bottom: 0.14mm;
    padding-top: 0.34mm;
    padding-bottom: 0.3mm;
}

.checklist-label-80x50.is-landscape .is-ccr-label-grid .compact-label-row {
    min-height: 1.82mm;
    padding-top: 0.05mm;
    padding-bottom: 0.05mm;
}

.checklist-label-80x50.is-landscape .is-ccr-label-grid .compact-label-sensor-matrix {
    margin-bottom: 0;
}

.checklist-label-80x50.is-landscape .is-ccr-label-grid .compact-label-sensor-head,
.checklist-label-80x50.is-landscape .is-ccr-label-grid .compact-label-sensor-row {
    min-height: 1.95mm;
}

.compact-label-section > h4 {
    margin: 0 0 0.25mm;
    padding: 0.45mm 0.6mm 0.38mm;
    overflow: hidden;
    background: #000000;
    color: #ffffff;
    font-size: 1.7mm;
    font-weight: 950;
    letter-spacing: 0.08mm;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.compact-label-row {
    display: grid;
    min-height: 2.05mm;
    grid-template-columns: 2.25mm minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.42mm;
    padding: 0.16mm 0.42mm;
    font-size: 1.62mm;
}

.compact-label-check {
    display: grid;
    width: 1.85mm;
    height: 1.85mm;
    place-items: center;
    border: 0.22mm solid #000000;
    font-size: 1.78mm;
    font-weight: 950;
}

.compact-label-row.is-checked .compact-label-check {
    border-color: #000000;
    background: #000000;
    color: #ffffff;
}

.compact-label-row:not(.is-checked) .compact-label-check:empty {
    background: #ffffff;
}

.compact-label-check.is-value-marker {
    border: 0;
    background: transparent !important;
}

.compact-label-name {
    min-width: 0;
    overflow: hidden;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-label-row > strong {
    max-width: 13mm;
    overflow: hidden;
    font-size: 1.55mm;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-label-row > strong.is-choice-pass,
.compact-label-row > strong.is-choice-fail {
    padding: 0.12mm 0.35mm;
    border: 0.2mm solid #000000;
    font-size: 1.34mm;
    letter-spacing: 0.05mm;
    text-transform: uppercase;
}

.compact-label-row > strong.is-choice-fail {
    background: #000000;
    color: #ffffff;
}

.compact-label-sensor-matrix {
    margin-bottom: 0.32mm;
    border: 0.18mm solid #000000;
}

.compact-label-sensor-head,
.compact-label-sensor-row {
    display: grid;
    grid-template-columns: 13mm repeat(3, minmax(0, 1fr));
    align-items: center;
    min-height: 2.15mm;
    text-align: center;
}

.compact-label-sensor-head {
    background: #dedede;
    font-size: 1.5mm;
}

.compact-label-sensor-row {
    border-top: 0.14mm solid #777777;
    font-size: 1.65mm;
}

.compact-label-sensor-row > b {
    padding-left: 0.35mm;
    text-align: left;
}

.compact-label-sensor-row > span {
    overflow: hidden;
    border-left: 0.14mm solid #777777;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-label-sensor-row > span.is-warning,
.compact-label-sensor-row > span.is-danger {
    color: #000000;
    font-weight: 950;
    text-decoration: underline;
    text-decoration-thickness: 0.25mm;
}

.compact-label-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1mm;
    padding: 0 1mm;
    border-top: 0.35mm solid #000000;
    font-size: 1.3mm;
    font-weight: 950;
    letter-spacing: 0.04mm;
}

.compact-label-print-page {
    width: 80mm;
    height: 50mm;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
}

.compact-label-print-page.is-portrait {
    width: 50mm;
    height: 80mm;
}

@media print {
    html.compact-label-print-root,
    body.compact-label-print-page {
        width: 80mm !important;
        height: 50mm !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    html.compact-label-print-root.is-portrait,
    body.compact-label-print-page.is-portrait {
        width: 50mm !important;
        height: 80mm !important;
    }

    body.compact-label-print-page > :not(.checklist-label-80x50) {
        display: none !important;
    }

    .compact-label-print-page .checklist-label-80x50 {
        width: 80mm !important;
        height: 50mm !important;
        border: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .compact-label-print-page.is-portrait .checklist-label-80x50 {
        width: 50mm !important;
        height: 80mm !important;
    }
}

@media (max-width: 900px) {
    .checklist-library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .main:has(.ready-check-hero) {
        width: 100%;
        min-width: 0;
        overflow-x: clip;
    }

    .main:has(.ready-check-hero) > * {
        min-width: 0;
        max-width: 100%;
    }

    .checklist-label-overlay {
        width: 100%;
        max-width: 100vw;
        padding: 0 !important;
        overflow-x: hidden;
    }

    .checklist-label-comparison {
        grid-template-columns: 1fr;
    }

    .checklist-label-preview-stage {
        min-height: 320px;
    }

    .checklist-sheet-header {
        display: grid;
        gap: 12px;
    }

    .checklist-sheet-context {
        display: grid;
        justify-content: stretch;
    }

    .checklist-device-assignment {
        min-width: 0;
        width: 100%;
    }

    .checklist-device-assignment label {
        grid-template-columns: 1fr;
    }

    .checklist-sheet-sections.is-two-column {
        column-count: 1;
    }

    .checklist-sheet-sections .checklist-sheet-table {
        table-layout: fixed;
    }

    .checklist-sheet-table td:first-child {
        width: 54%;
        overflow-wrap: anywhere;
    }

    .checklist-sheet-table .sheet-answer-cell {
        width: 46%;
        min-width: 0;
    }

    .checklist-sheet-table .sheet-answer-cell input {
        min-width: 0;
    }

    .ccr-sensor-matrix thead th:first-child {
        width: 40%;
    }

    .ccr-sensor-matrix thead th:not(:first-child) {
        width: 20%;
    }

    .ccr-sensor-matrix tbody th {
        padding: 6px 5px;
    }

    .ccr-sensor-reading {
        padding: 4px 2px !important;
    }

    .ccr-sensor-reading input {
        width: 100% !important;
    }

    .ccr-sensor-reading > div > span {
        display: none;
    }

    .checklist-sheet-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .checklist-sheet-action-buttons {
        display: grid;
        grid-template-columns: 1fr;
    }

    .checklist-sheet-action-buttons .btn {
        width: 100%;
    }

    .checklist-library-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px 17px;
    }

    .checklist-library-count {
        width: 100%;
    }

    .checklist-library-grid {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .checklist-library-card.is-featured {
        grid-column: auto;
    }

    .checklist-library-card > footer {
        align-items: stretch;
        flex-direction: column;
    }

    .checklist-label-dialog {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: none;
    }

    .checklist-niimbot-panel {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .checklist-niimbot-mark {
        width: 38px;
        height: 38px;
    }

    .checklist-niimbot-panel > button {
        width: 100%;
        grid-column: 1 / -1;
    }

    .checklist-label-dialog > .modal-footer {
        display: grid;
        grid-template-columns: 1fr;
    }

    .checklist-label-dialog > .modal-footer .btn {
        width: 100%;
    }

    .checklist-label-preview-stage {
        --label-preview-scale: 1.08;
        min-height: calc(50mm * var(--label-preview-scale) + 20px);
        justify-content: start;
        padding: 16px 10px;
    }
}

/* Calm ready-check workspace: grouped routines instead of a catalogue wall. */
.ready-check-focus-grid {
    display: grid;
    width: min(100%, 1500px);
    margin-inline: auto;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 16px;
}

.ready-check-personal,
.ready-check-history {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--sg-line, #d9dee9);
    border-radius: var(--sg-radius-object, 8px);
    background: var(--sg-paper, #ffffff);
    box-shadow: 0 10px 24px rgba(8, 18, 42, 0.055);
}

.ready-check-personal {
    border-top: 3px solid var(--sg-cyan, #00cfe8);
}

.ready-check-history {
    border-top: 3px solid var(--sg-green, #00b875);
}

.ready-check-cluster-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px 17px;
    border-bottom: 1px solid var(--sg-line, #d9dee9);
    background:
        linear-gradient(135deg, rgba(0, 207, 232, 0.055), transparent 48%),
        #ffffff;
}

.ready-check-history .ready-check-cluster-header {
    background:
        linear-gradient(135deg, rgba(0, 184, 117, 0.05), transparent 48%),
        #ffffff;
}

.ready-check-cluster-header h2 {
    margin: 5px 0 4px;
    color: var(--sg-ink-950, #071226);
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.025em;
}

.ready-check-cluster-header p {
    max-width: 52ch;
    margin: 0;
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.72rem;
    line-height: 1.5;
}

.ready-check-history-count {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid rgba(0, 184, 117, 0.2);
    border-radius: 999px;
    background: rgba(0, 184, 117, 0.075);
    color: #08754f;
    font-size: 0.62rem;
    font-weight: 850;
}

.ready-check-focus-grid .ready-check-template-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
}

.ready-check-focus-grid .ready-check-template-chip {
    display: grid;
    min-height: 72px;
    padding: 13px 18px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 0;
    border-bottom: 1px solid var(--sg-line, #d9dee9);
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
    clip-path: none;
    text-align: left;
}

.ready-check-focus-grid .ready-check-template-chip:last-child {
    border-bottom: 0;
}

.ready-check-focus-grid .ready-check-template-chip > i:first-child {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 207, 232, 0.1);
    color: var(--sg-cyan-dark, #009db7);
}

.ready-check-focus-grid .ready-check-template-chip > i:last-child {
    color: var(--sg-ink-400, #93a0b5);
    font-size: 0.7rem;
}

.ready-check-focus-grid .ready-check-template-chip strong {
    display: block;
    color: var(--sg-ink-950, #071226);
    font-size: 0.82rem;
    font-weight: 850;
}

.ready-check-focus-grid .ready-check-template-chip small {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.66rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ready-check-focus-grid .ready-check-list {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.ready-check-focus-grid .ready-check-row,
.ready-check-focus-grid .checklist-history-item {
    min-height: 76px;
}

.ready-check-cluster-empty {
    display: flex;
    min-height: 116px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.75rem;
    text-align: center;
}

.ready-check-cluster-empty i {
    color: var(--sg-cyan-dark, #009db7);
}

.checklist-library {
    width: min(100%, 1500px);
    margin: 0 auto 28px;
    overflow: hidden;
    border: 1px solid var(--sg-line, #d9dee9);
    border-top: 3px solid var(--sg-cyan, #00cfe8);
    border-radius: var(--sg-radius-object, 8px);
    background: var(--sg-paper, #ffffff);
    box-shadow: 0 12px 28px rgba(8, 18, 42, 0.055);
}

.checklist-library-header {
    align-items: center;
    padding: 25px 26px 22px;
    border-bottom: 1px solid var(--sg-line, #d9dee9);
    background:
        linear-gradient(125deg, rgba(0, 207, 232, 0.085), transparent 44%),
        #f9fbfe;
}

.checklist-library-header .section-label {
    color: var(--sg-cyan-dark, #009db7);
}

.checklist-library-header h2 {
    margin: 6px 0 5px;
    color: var(--sg-ink-950, #071226);
    font-size: clamp(1.6rem, 3vw, 2.45rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    text-transform: none;
}

.checklist-library-header p {
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.74rem;
}

.checklist-library-count {
    min-width: 118px;
    border: 1px solid rgba(0, 157, 183, 0.18);
    border-left: 3px solid var(--sg-cyan, #00cfe8);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.8);
}

.checklist-library-count strong {
    color: var(--sg-ink-950, #071226);
    font-size: 1.35rem;
}

.checklist-library-count span {
    color: var(--sg-ink-600, #5b6881);
}

.checklist-library-filters {
    gap: 7px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sg-line, #d9dee9);
    background: #ffffff;
}

.checklist-library-filters button {
    min-height: 32px;
    padding: 0 13px;
    border: 1px solid var(--sg-line, #d9dee9);
    border-radius: 999px;
    background: #ffffff;
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.55rem;
    font-weight: 850;
    letter-spacing: 0.025em;
}

.checklist-library-filters button.is-active {
    border-color: rgba(0, 157, 183, 0.28);
    background: rgba(0, 207, 232, 0.1);
    color: #087c91;
}

.checklist-library-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
    background: #f5f7fb;
}

.checklist-library-cluster {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--sg-line, #d9dee9);
    border-radius: 7px;
    background: #ffffff;
}

.checklist-library-cluster[hidden] {
    display: none;
}

.checklist-library-cluster-header {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--sg-line, #d9dee9);
    background:
        linear-gradient(90deg, rgba(0, 207, 232, 0.055), transparent 55%),
        #fbfcfe;
}

.checklist-library-cluster-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: rgba(0, 207, 232, 0.1);
    color: var(--sg-cyan-dark, #009db7);
}

.checklist-library-cluster-header h3 {
    margin: 3px 0 2px;
    color: var(--sg-ink-950, #071226);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.checklist-library-cluster-header p {
    margin: 0;
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.63rem;
}

.checklist-library-cluster-header > strong {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: #eef2f7;
    color: var(--sg-ink-600, #5b6881);
    font-size: 0.7rem;
}

.checklist-library-cluster-list {
    display: grid;
}

.checklist-library-card,
.checklist-library-card.is-featured {
    display: grid;
    min-height: 0;
    overflow: visible;
    grid-column: auto;
    grid-template-areas:
        "top actions"
        "copy actions"
        "meta actions"
        "notice notice";
    grid-template-columns: minmax(0, 1fr) auto;
    border: 0;
    border-bottom: 1px solid var(--sg-line, #d9dee9);
    background: #ffffff;
}

.checklist-library-card:last-child {
    border-bottom: 0;
}

.checklist-library-card::after {
    display: none;
}

.checklist-library-card-topline {
    grid-area: top;
    min-height: 0;
    justify-content: flex-start;
    gap: 10px;
    padding: 15px 18px 0;
    border: 0;
    background: transparent;
}

.checklist-library-card-topline span {
    color: var(--sg-ink-500, #6f7d95);
    font-size: 0.5rem;
    letter-spacing: 0.045em;
}

.checklist-library-card-topline span:last-child {
    padding-left: 9px;
    border-left: 1px solid var(--sg-line, #d9dee9);
}

.checklist-library-card-copy {
    grid-area: copy;
    padding: 7px 18px 8px;
}

.checklist-library-card-copy h3 {
    margin: 0 0 5px;
    color: var(--sg-ink-950, #071226);
    font-size: clamp(0.95rem, 1.4vw, 1.2rem);
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1.15;
    text-transform: none;
}

.checklist-library-card-copy p {
    max-width: 78ch;
    font-size: 0.67rem;
    line-height: 1.45;
}

.checklist-library-card-meta {
    grid-area: meta;
    justify-content: flex-start;
    gap: 7px;
    padding: 0 18px 15px;
    border: 0;
    background: transparent;
}

.checklist-library-card-meta span {
    min-width: auto;
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: #f1f4f8;
    font-size: 0.5rem;
    text-transform: none;
}

.checklist-library-card-meta strong {
    display: inline;
    margin-right: 2px;
    font-size: 0.62rem;
}

.checklist-library-disclaimer {
    grid-area: notice;
    padding: 9px 18px;
    border-top: 1px solid rgba(191, 136, 0, 0.12);
    border-bottom: 0;
    background: rgba(255, 196, 0, 0.055);
}

.checklist-library-card > footer {
    grid-area: actions;
    align-items: flex-end;
    justify-content: center;
    flex-direction: column;
    min-width: 176px;
    padding: 14px 16px;
    border-left: 1px solid var(--sg-line, #d9dee9);
    background: #fbfcfe;
}

@media (max-width: 900px) {
    .ready-check-focus-grid {
        grid-template-columns: 1fr;
    }

    .checklist-library-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ready-check-cluster-header {
        align-items: stretch;
        flex-direction: column;
    }

    .ready-check-cluster-header .btn {
        width: 100%;
    }

    .ready-check-focus-grid .ready-check-template-chip small {
        white-space: normal;
    }

    .checklist-library-header {
        padding: 20px 18px;
    }

    .checklist-library-grid {
        padding: 10px;
    }

    .checklist-library-cluster-header {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        padding: 13px;
    }

    .checklist-library-cluster-icon {
        width: 34px;
        height: 34px;
    }

    .checklist-library-card,
    .checklist-library-card.is-featured {
        grid-template-areas:
            "top"
            "copy"
            "meta"
            "notice"
            "actions";
        grid-template-columns: minmax(0, 1fr);
    }

    .checklist-library-card-meta {
        flex-wrap: wrap;
    }

    .checklist-library-card > footer {
        min-width: 0;
        align-items: stretch;
        padding: 12px 14px;
        border-top: 1px solid var(--sg-line, #d9dee9);
        border-left: 0;
    }
}

/* Ready-check chooser: one calm decision surface for demo and signed-in accounts. */
.ritual-picker-dialog {
    display: flex;
    width: min(880px, calc(100vw - 32px));
    max-width: 880px;
    max-height: min(900px, calc(100vh - 40px));
    flex-direction: column;
}

.ritual-picker-header {
    align-items: flex-start;
    min-height: 0;
    padding: 24px 26px 20px;
}

.ritual-picker-heading {
    display: grid;
    min-width: 0;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 15px;
}

.ritual-picker-mark,
.ritual-picker-gear-icon,
.ritual-picker-card-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #0284c7;
    background: linear-gradient(145deg, #e0f7ff, #edf2ff);
}

.ritual-picker-mark {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(14, 165, 233, 0.16);
    border-radius: 8px;
    font-size: 1.05rem;
}

.ritual-picker-heading .section-label {
    margin-bottom: 5px;
}

.ritual-picker-heading .modal-title {
    margin: 0;
    font-size: 1.38rem;
    letter-spacing: -0.025em;
    line-height: 1.1;
    text-transform: none;
}

.ritual-picker-heading p {
    max-width: 64ch;
    margin: 8px 0 0;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.55;
}

.ritual-picker-body {
    display: grid;
    gap: 18px;
    overflow-y: auto;
    padding: 20px 26px 26px;
    background: #f6f8fb;
}

.ritual-picker-gear {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    padding: 14px;
    border: 1px solid #dce3ed;
    border-radius: 8px;
    background: #ffffff;
}

.ritual-picker-gear-icon {
    width: 42px;
    height: 42px;
    border-radius: 6px;
}

.ritual-picker-gear .checklist-template-gear-picker {
    grid-template-columns: minmax(180px, 0.7fr) minmax(240px, 1.3fr);
    grid-template-areas:
        "label select"
        "hint select";
    gap: 2px 18px;
    align-items: center;
    margin: 0;
}

.ritual-picker-gear .checklist-template-gear-picker > span {
    grid-area: label;
    color: #0f172a;
    font-size: 0.72rem;
}

.ritual-picker-gear .checklist-template-gear-picker > small {
    grid-area: hint;
    color: #7c8799;
    font-size: 0.68rem;
}

.ritual-picker-gear .checklist-template-gear-picker > select {
    grid-area: select;
    min-height: 44px;
    padding: 9px 38px 9px 12px;
    border: 1px solid #cfd8e5;
    border-radius: 6px;
    background-color: #fbfcfe;
    font-size: 0.82rem;
}

.ritual-picker-section {
    overflow: hidden;
    border: 1px solid #dce3ed;
    border-radius: 8px;
    background: #ffffff;
}

.ritual-picker-section.is-library {
    border-color: rgba(82, 114, 255, 0.2);
}

.ritual-picker-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 17px;
    border-bottom: 1px solid #e5eaf1;
    background: #fbfcfe;
}

.ritual-picker-section-header h4 {
    margin: 2px 0 0;
    color: #111827;
    font-size: 0.94rem;
    font-weight: 900;
    letter-spacing: -0.015em;
}

.ritual-picker-section-header > strong {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 999px;
    background: #e8edf5;
    color: #334155;
    font-size: 0.72rem;
}

.ritual-picker-list {
    display: grid;
}

.ritual-picker-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #edf0f5;
    background: #ffffff;
}

.ritual-picker-card:last-child {
    border-bottom: 0;
}

.ritual-picker-card.is-ready {
    background:
        linear-gradient(90deg, rgba(0, 212, 255, 0.045), transparent 32%),
        #ffffff;
}

.ritual-picker-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 7px;
}

.ritual-picker-card-copy {
    min-width: 0;
}

.ritual-picker-card-copy > span {
    color: #64748b;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ritual-picker-card-copy h5 {
    margin: 3px 0 4px;
    color: #111827;
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1.25;
}

.ritual-picker-card-copy p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #778196;
    font-size: 0.68rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ritual-picker-card-actions {
    display: flex;
    gap: 7px;
    align-items: center;
}

.ritual-picker-card-actions .btn {
    min-height: 38px;
    white-space: nowrap;
}

.ritual-picker-empty {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 20px 18px;
    color: #64748b;
}

.ritual-picker-empty > i {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 999px;
    background: #eefaf4;
    color: #16a36a;
}

.ritual-picker-empty strong,
.ritual-picker-empty span {
    display: block;
}

.ritual-picker-empty strong {
    margin-bottom: 3px;
    color: #1f2937;
    font-size: 0.8rem;
}

.ritual-picker-empty span {
    font-size: 0.7rem;
}

.ritual-picker-footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ritual-picker-footer-action {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 13px;
    border: 1px solid #dce3ed;
    border-radius: 7px;
    background: #ffffff;
    color: #334155;
    text-align: left;
    cursor: pointer;
}

.ritual-picker-footer-action:hover {
    border-color: rgba(14, 165, 233, 0.38);
    background: #fbfdff;
}

.ritual-picker-footer-action > i:first-child {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 6px;
    background: #eef3f9;
    color: #0ea5e9;
}

.ritual-picker-footer-action strong,
.ritual-picker-footer-action small {
    display: block;
}

.ritual-picker-footer-action strong {
    color: #111827;
    font-size: 0.73rem;
    font-weight: 900;
}

.ritual-picker-footer-action small {
    margin-top: 2px;
    color: #7c8799;
    font-size: 0.62rem;
    line-height: 1.35;
}

.ritual-picker-footer-action > i:last-child {
    color: #94a3b8;
    font-size: 0.7rem;
}

/* Template workshop: deliberate fields instead of a spreadsheet of browser controls. */
.checklist-builder-page {
    width: min(100%, 1460px);
    margin-inline: auto;
}

.checklist-builder-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 18px;
    padding: 28px 30px;
    border: 1px solid #dbe3ed;
    border-top: 4px solid #00c9ee;
    border-radius: 8px;
    background:
        radial-gradient(circle at 88% 15%, rgba(82, 114, 255, 0.12), transparent 34%),
        linear-gradient(135deg, #ffffff, #f4f8fc);
}

.checklist-builder-hero-copy {
    max-width: 760px;
}

.checklist-builder-back {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    margin: 0 0 20px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 850;
    cursor: pointer;
}

.checklist-builder-back:hover {
    color: #0284c7;
}

.checklist-builder-hero h1 {
    margin: 6px 0 9px;
    color: #111827;
    font-size: clamp(1.65rem, 2.5vw, 2.55rem);
    font-weight: 950;
    letter-spacing: -0.045em;
    line-height: 1;
}

.checklist-builder-hero p {
    max-width: 68ch;
    margin: 0;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.6;
}

.checklist-builder-hero > .btn {
    min-height: 46px;
    flex: 0 0 auto;
}

.checklist-builder-workspace {
    display: grid;
    grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.checklist-builder-guide {
    position: sticky;
    top: calc(var(--header-height, 70px) + 20px);
    padding: 22px;
    border: 1px solid #dbe3ed;
    border-radius: 8px;
    background: #f7f9fc;
}

.checklist-builder-guide-mark {
    display: grid;
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    place-items: center;
    border-radius: 7px;
    background: #e4f7fd;
    color: #0284c7;
}

.checklist-builder-guide h2 {
    margin: 6px 0 18px;
    color: #111827;
    font-size: 1.08rem;
    font-weight: 900;
    letter-spacing: -0.025em;
}

.checklist-builder-guide ol {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: ritual-guide;
}

.checklist-builder-guide li {
    position: relative;
    padding: 0 0 17px 35px;
    counter-increment: ritual-guide;
}

.checklist-builder-guide li:not(:last-child)::after {
    position: absolute;
    top: 25px;
    bottom: 0;
    left: 12px;
    width: 1px;
    background: #d8e1eb;
    content: "";
}

.checklist-builder-guide li::before {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border: 1px solid #cbd7e4;
    border-radius: 999px;
    background: #ffffff;
    color: #0284c7;
    content: counter(ritual-guide);
    font-size: 0.62rem;
    font-weight: 900;
}

.checklist-builder-guide li strong,
.checklist-builder-guide li span {
    display: block;
}

.checklist-builder-guide li strong {
    color: #1f2937;
    font-size: 0.72rem;
}

.checklist-builder-guide li span {
    margin-top: 3px;
    color: #7c8799;
    font-size: 0.65rem;
    line-height: 1.45;
}

.checklist-builder-shell {
    overflow: hidden;
    padding: 0;
    border: 1px solid #dbe3ed;
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.055);
}

.checklist-builder-meta {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.2fr);
    gap: 14px;
    margin: 0;
    padding: 20px;
    border-bottom: 1px solid #e4e9f0;
    background: #fbfcfe;
}

.checklist-builder-field,
.checklist-builder-row-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.checklist-builder-field > span,
.checklist-builder-row-field > span {
    color: #334155;
    font-size: 0.61rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.checklist-builder-field > small {
    min-height: 1.35em;
    color: #8a94a5;
    font-size: 0.63rem;
}

.checklist-builder-field input,
.checklist-builder-row-field input,
.checklist-builder-row-field select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid #cfd8e5;
    border-radius: 6px;
    outline: none;
    background: #ffffff;
    color: #172033;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
}

.checklist-builder-field input:focus,
.checklist-builder-row-field input:focus,
.checklist-builder-row-field select:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.11);
}

.checklist-builder-structure > header {
    padding: 20px 20px 15px;
}

.checklist-builder-structure > header h2 {
    margin: 4px 0;
    color: #111827;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: -0.025em;
}

.checklist-builder-structure > header p {
    margin: 0;
    color: #7c8799;
    font-size: 0.68rem;
}

.checklist-builder-row-list {
    display: grid;
    gap: 9px;
    padding: 0 20px 20px;
}

.checklist-builder-row {
    display: grid;
    grid-template-columns:
        18px
        minmax(125px, 0.72fr)
        minmax(210px, 1.35fr)
        minmax(115px, 0.62fr)
        minmax(105px, 0.55fr)
        minmax(130px, 0.68fr)
        38px;
    gap: 10px;
    align-items: end;
    min-width: 0;
    padding: 13px;
    border: 1px solid #dde4ed;
    border-left: 3px solid #c7d2e2;
    border-radius: 7px;
    background: #f8fafc;
}

.checklist-builder-row:focus-within {
    border-left-color: #00c9ee;
    background: #fbfdff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.055);
}

.checklist-builder-row-grip {
    display: grid;
    min-height: 44px;
    place-items: center;
    color: #a5afbd;
    font-size: 0.72rem;
}

.checklist-builder-required {
    position: relative;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid #d7dfe9;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}

.checklist-builder-required .builder-required {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
    opacity: 0;
}

.checklist-builder-required-box {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #c9d3df;
    border-radius: 5px;
    background: #f7f9fb;
    color: transparent;
}

.checklist-builder-required .builder-required:checked + .checklist-builder-required-box {
    border-color: #0ea5e9;
    background: #e0f7ff;
    color: #0284c7;
}

.checklist-builder-required strong,
.checklist-builder-required small {
    display: block;
}

.checklist-builder-required strong {
    color: #334155;
    font-size: 0.62rem;
}

.checklist-builder-required small {
    margin-top: 2px;
    color: #8a94a5;
    font-size: 0.52rem;
    line-height: 1.2;
}

.checklist-builder-row .builder-row-remove {
    display: grid;
    width: 38px;
    height: 44px;
    place-items: center;
    border: 1px solid #d7dfe9;
    border-radius: 6px;
    background: #ffffff;
}

.checklist-builder-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0;
    padding: 16px 20px 20px;
    border-top: 1px solid #e4e9f0;
    background: #fbfcfe;
}

.checklist-builder-actions > div {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 1180px) {
    .checklist-builder-row {
        grid-template-columns: 18px minmax(150px, 0.8fr) minmax(230px, 1.2fr) minmax(120px, 0.65fr) 38px;
    }

    .checklist-builder-row-field.is-unit {
        grid-column: 2 / 3;
    }

    .checklist-builder-required {
        grid-column: 3 / 5;
    }
}

@media (max-width: 900px) {
    .ritual-picker-gear .checklist-template-gear-picker {
        grid-template-columns: 1fr;
        grid-template-areas:
            "label"
            "hint"
            "select";
        gap: 3px;
    }

    .checklist-builder-workspace {
        grid-template-columns: 1fr;
    }

    .checklist-builder-guide {
        position: static;
    }

    .checklist-builder-guide ol {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .checklist-builder-guide li {
        padding: 34px 0 0;
    }

    .checklist-builder-guide li:not(:last-child)::after {
        display: none;
    }

    .checklist-builder-meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .ritual-picker-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }

    .ritual-picker-header,
    .ritual-picker-body {
        padding-right: 16px;
        padding-left: 16px;
    }

    .ritual-picker-heading {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .ritual-picker-mark {
        width: 40px;
        height: 40px;
    }

    .ritual-picker-card {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .ritual-picker-card-icon {
        width: 38px;
        height: 38px;
    }

    .ritual-picker-card-actions {
        grid-column: 2;
        justify-content: flex-start;
    }

    .ritual-picker-footer {
        grid-template-columns: 1fr;
    }

    .checklist-builder-hero {
        align-items: stretch;
        flex-direction: column;
        padding: 22px 18px;
    }

    .checklist-builder-hero > .btn {
        width: 100%;
    }

    .checklist-builder-guide ol {
        grid-template-columns: 1fr;
    }

    .checklist-builder-row {
        grid-template-columns: minmax(0, 1fr) 38px;
        padding: 12px;
    }

    .checklist-builder-row-grip {
        display: none;
    }

    .checklist-builder-row-field,
    .checklist-builder-row-field.is-unit,
    .checklist-builder-required {
        grid-column: 1 / -1;
    }

    .checklist-builder-row .builder-row-remove {
        grid-column: 2;
        justify-self: end;
    }

    .checklist-builder-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .checklist-builder-actions > div {
        display: grid;
        grid-template-columns: 1fr;
    }

    .checklist-builder-actions .btn {
        width: 100%;
    }
}

/* Dark mode for the interactive Ready Checks workspace.
   Printable label canvases intentionally remain paper-white. */
[data-theme="dark"] .main:has(.ready-check-active-run) > .ready-check-hero {
    background:
        linear-gradient(120deg, rgba(0, 207, 232, 0.11), transparent 38%),
        linear-gradient(var(--sg-paper), var(--sg-paper-muted));
}

[data-theme="dark"] .ready-check-active-run {
    background:
        linear-gradient(135deg, rgba(0, 207, 232, 0.12), transparent 42%),
        #10182e;
}

[data-theme="dark"] .ready-check-cluster-header,
[data-theme="dark"] .ready-check-history .ready-check-cluster-header,
[data-theme="dark"] .ready-check-stat,
[data-theme="dark"] .ready-check-latest,
[data-theme="dark"] .ready-check-row,
[data-theme="dark"] .checklist-history-item,
[data-theme="dark"] .ready-check-focus-grid .ready-check-template-rail,
[data-theme="dark"] .ready-check-focus-grid .ready-check-template-chip,
[data-theme="dark"] .checklist-library-filters,
[data-theme="dark"] .checklist-library-filters button,
[data-theme="dark"] .checklist-library-cluster,
[data-theme="dark"] .checklist-library-card,
[data-theme="dark"] .checklist-library-card.is-featured {
    background: var(--sg-paper);
    border-color: var(--sg-line);
}

[data-theme="dark"] .checklist-library-header,
[data-theme="dark"] .checklist-library-cluster-header,
[data-theme="dark"] .checklist-library-card > footer {
    background:
        linear-gradient(125deg, rgba(0, 207, 232, 0.07), transparent 44%),
        var(--sg-paper-muted);
    border-color: var(--sg-line);
}

[data-theme="dark"] .checklist-library-grid {
    background: var(--sg-canvas);
}

[data-theme="dark"] .checklist-library-count {
    background: rgba(21, 29, 49, 0.88);
}

[data-theme="dark"] .checklist-library-card-meta span,
[data-theme="dark"] .checklist-library-cluster-header > strong {
    background: var(--sg-paper-muted);
    color: var(--sg-ink-600);
}

[data-theme="dark"] .ready-check-history-count {
    color: #59dca7;
}

[data-theme="dark"] .checklist-library-filters button.is-active {
    color: #67e8f9;
}

[data-theme="dark"] .ritual-picker-body,
[data-theme="dark"] .checklist-builder-guide,
[data-theme="dark"] .checklist-builder-row {
    background: var(--sg-canvas);
}

[data-theme="dark"] .ritual-picker-gear,
[data-theme="dark"] .ritual-picker-section,
[data-theme="dark"] .ritual-picker-card,
[data-theme="dark"] .ritual-picker-footer-action,
[data-theme="dark"] .checklist-builder-hero,
[data-theme="dark"] .checklist-builder-shell,
[data-theme="dark"] .checklist-builder-required,
[data-theme="dark"] .checklist-builder-row .builder-row-remove {
    background: var(--sg-paper);
    border-color: var(--sg-line);
    color: var(--sg-ink-950);
}

[data-theme="dark"] .ritual-picker-section-header,
[data-theme="dark"] .checklist-builder-meta,
[data-theme="dark"] .checklist-builder-actions,
[data-theme="dark"] .ritual-picker-card.is-ready,
[data-theme="dark"] .ritual-picker-footer-action:hover,
[data-theme="dark"] .checklist-builder-row:focus-within {
    background: var(--sg-paper-muted);
    border-color: var(--sg-line);
}

[data-theme="dark"] .ritual-picker-gear .checklist-template-gear-picker > select,
[data-theme="dark"] .checklist-builder-field input,
[data-theme="dark"] .checklist-builder-row-field input,
[data-theme="dark"] .checklist-builder-row-field select {
    background: #10182e;
    border-color: var(--sg-line-strong);
    color: var(--sg-ink-950);
}

[data-theme="dark"] .ritual-picker-section-header h4,
[data-theme="dark"] .ritual-picker-card-copy h5,
[data-theme="dark"] .ritual-picker-empty strong,
[data-theme="dark"] .ritual-picker-footer-action strong,
[data-theme="dark"] .checklist-builder-hero h1,
[data-theme="dark"] .checklist-builder-guide h2,
[data-theme="dark"] .checklist-builder-guide li strong,
[data-theme="dark"] .checklist-builder-structure > header h2,
[data-theme="dark"] .checklist-builder-required strong {
    color: var(--sg-ink-950);
}

[data-theme="dark"] .ritual-picker-heading p,
[data-theme="dark"] .ritual-picker-card-copy > span,
[data-theme="dark"] .ritual-picker-card-copy p,
[data-theme="dark"] .ritual-picker-empty,
[data-theme="dark"] .ritual-picker-footer-action small,
[data-theme="dark"] .checklist-builder-back,
[data-theme="dark"] .checklist-builder-hero p,
[data-theme="dark"] .checklist-builder-guide li span,
[data-theme="dark"] .checklist-builder-field > small,
[data-theme="dark"] .checklist-builder-structure > header p,
[data-theme="dark"] .checklist-builder-required small {
    color: var(--sg-ink-600);
}

[data-theme="dark"] .checklist-builder-field > span,
[data-theme="dark"] .checklist-builder-row-field > span {
    color: var(--sg-ink-800);
}

[data-theme="dark"] .checklist-builder-guide li::before,
[data-theme="dark"] .checklist-builder-required-box {
    background: var(--sg-paper-muted);
    border-color: var(--sg-line-strong);
}

/* Ready Checks workspace: saved routines on the left, selected history on the right. */
.main:has(.ready-check-page),
.main:has(.ready-check-runner) {
    background: var(--sg-canvas);
}

.ready-check-page {
    display: grid;
    gap: 16px;
}

.main:has(.ready-check-page) .ready-check-overview {
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 22px;
    overflow: visible;
    border: 1px solid var(--sg-line);
    border-left: 5px solid var(--sg-cyan);
    border-radius: 9px;
    background: var(--sg-paper);
    box-shadow: none;
    color: var(--sg-ink-950);
}

/* The active-run hero in product-language.css uses a named grid area. The
   overview reuses the copy class, but is a separate flex/grid component and
   must not inherit that placement or it creates an implicit, clipped column. */
.main:has(.ready-check-page) .ready-check-hero-copy {
    grid-area: auto;
    align-self: auto;
    min-width: 0;
}

.main:has(.ready-check-page) .ready-check-overview::after {
    display: none;
}

.main:has(.ready-check-page) .ready-check-overview .page-title {
    margin: 3px 0 5px;
    color: var(--sg-ink-950);
    font-size: clamp(1.8rem, 3vw, 2.65rem);
    line-height: 1;
}

.main:has(.ready-check-page) .ready-check-overview p {
    max-width: 62ch;
    margin: 0;
    color: var(--sg-ink-600);
}

.main:has(.ready-check-page) .ready-check-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.main:has(.ready-check-page) .ready-check-overview .btn-secondary,
.main:has(.ready-check-page) .ready-check-overview .btn-ghost {
    border-color: var(--sg-line-strong);
    background: var(--sg-paper);
    color: var(--sg-ink-950);
}

.ready-check-workspace {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.ready-check-routines,
.ready-check-detail {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--sg-line);
    border-radius: 9px;
    background: var(--sg-paper);
}

.ready-check-panel-heading,
.ready-check-detail-header,
.ready-check-selected-history > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.ready-check-panel-heading {
    padding: 16px;
    border-bottom: 1px solid var(--sg-line);
    background: var(--sg-paper-muted);
}

.ready-check-panel-heading h2,
.ready-check-detail-header h2,
.ready-check-selected-history h3 {
    margin: 3px 0 0;
    color: var(--sg-ink-950);
    line-height: 1.15;
}

.ready-check-panel-heading h2 {
    font-size: 1.25rem;
}

.ready-check-panel-heading > strong,
.ready-check-selected-history > header > span {
    display: grid;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(0, 207, 232, 0.14);
    color: #007a91;
    font-size: 0.72rem;
    font-weight: 900;
    place-items: center;
}

.ready-check-routine-list {
    display: grid;
    padding: 6px;
}

.ready-check-routine {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
}

.ready-check-routine + .ready-check-routine {
    border-top-color: var(--sg-line);
    border-radius: 0;
}

.ready-check-routine.is-selected {
    border-color: var(--sg-cyan);
    border-radius: 7px;
    background: rgba(0, 207, 232, 0.08);
    box-shadow: inset 4px 0 0 var(--sg-cyan);
}

.ready-check-routine-select {
    display: grid;
    min-width: 0;
    min-height: 68px;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 6px 10px 10px;
    border: 0;
    background: transparent;
    color: var(--sg-ink-950);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ready-check-routine-select:focus-visible,
.ready-check-routine-remove:focus-visible {
    outline: 3px solid rgba(0, 207, 232, 0.32);
    outline-offset: -2px;
}

.ready-check-routine:not(.is-selected):hover {
    background: var(--sg-paper-muted);
}

.ready-check-routine-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: 7px;
    background: rgba(0, 207, 232, 0.11);
    color: var(--sg-cyan-deep);
    place-items: center;
}

.ready-check-routine-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.ready-check-routine-copy strong,
.ready-check-routine-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ready-check-routine-copy strong {
    font-size: 0.77rem;
    line-height: 1.3;
}

.ready-check-routine-copy small {
    color: var(--sg-ink-600);
    font-size: 0.59rem;
}

.ready-check-routine-state {
    padding: 4px 6px;
    border-radius: 999px;
    font-size: 0.52rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ready-check-routine-state.is-running {
    background: rgba(245, 158, 11, 0.13);
    color: #a75b00;
}

.ready-check-routine-arrow {
    color: var(--sg-ink-400);
    font-size: 0.68rem;
}

.ready-check-routine-remove {
    display: grid;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--sg-ink-400);
    cursor: pointer;
    place-items: center;
}

.ready-check-routine-remove:hover {
    background: rgba(255, 51, 95, 0.1);
    color: var(--sg-coral);
}

.ready-check-routines-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--sg-line);
    background: var(--sg-paper-muted);
}

.ready-check-routines-footer .btn {
    width: 100%;
    justify-content: center;
}

.ready-check-panel-empty,
.ready-check-detail-empty {
    display: grid;
    justify-items: start;
    gap: 8px;
    padding: 28px 20px;
}

.ready-check-panel-empty > i,
.ready-check-detail-empty > i {
    color: var(--sg-cyan-deep);
    font-size: 1.4rem;
}

.ready-check-panel-empty p,
.ready-check-detail-empty p,
.ready-check-history-empty p {
    margin: 0;
    color: var(--sg-ink-600);
    line-height: 1.5;
}

.ready-check-detail {
    min-height: 440px;
}

.ready-check-detail-header {
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid var(--sg-line);
}

.ready-check-detail-title {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 12px;
}

.ready-check-detail-title .ready-check-routine-icon {
    width: 38px;
    height: 38px;
}

.ready-check-detail-header h2 {
    font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.ready-check-detail-header p {
    max-width: 62ch;
    margin: 6px 0 0;
    color: var(--sg-ink-600);
    font-size: 0.78rem;
    line-height: 1.5;
}

.ready-check-detail-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.ready-check-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--sg-line);
    background: var(--sg-paper-muted);
}

.ready-check-detail-meta span {
    padding: 5px 8px;
    border: 1px solid var(--sg-line);
    border-radius: 5px;
    background: var(--sg-paper);
    color: var(--sg-ink-600);
    font-size: 0.62rem;
}

.ready-check-detail-meta strong {
    color: var(--sg-ink-950);
}

.ready-check-selected-history {
    display: grid;
    gap: 10px;
    padding: 18px 20px 20px;
}

.ready-check-selected-history h3 {
    font-size: 1.05rem;
}

.ready-check-selected-history .ready-check-list {
    border: 1px solid var(--sg-line);
    border-radius: 7px;
}

.ready-check-selected-history .ready-check-row {
    box-shadow: none;
}

.ready-check-history-empty {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    border: 1px dashed var(--sg-line-strong);
    border-radius: 7px;
    background: var(--sg-paper-muted);
}

.ready-check-history-empty > i {
    margin-top: 2px;
    color: var(--sg-cyan-deep);
}

/* Template catalogue is intentionally a popup, never part of the main page. */
body.checklist-template-library-open {
    overflow: hidden;
}

.checklist-template-modal-overlay {
    padding: 18px;
}

.checklist-template-modal {
    display: grid;
    width: min(1120px, 100%);
    max-width: 1120px;
    max-height: min(92vh, 980px);
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.checklist-template-modal-header {
    align-items: flex-start;
}

.checklist-template-modal-header p {
    max-width: 68ch;
    margin: 5px 0 0;
    color: var(--sg-ink-600);
    font-size: 0.75rem;
    line-height: 1.45;
}

.checklist-template-modal-body {
    padding: 0;
    overflow-y: auto;
    background: var(--sg-canvas);
}

.checklist-template-modal .checklist-library {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.checklist-template-modal .checklist-library-header {
    padding: 15px 18px;
}

.checklist-template-modal .checklist-library-header h2 {
    font-size: 1.3rem;
}

.checklist-template-modal .checklist-library-grid {
    padding: 12px;
}

.checklist-template-modal-footer {
    justify-content: flex-end;
}

/* All non-sheet templates use the same accessible, full-width runner. */
.ready-check-runner {
    display: grid;
    width: min(880px, 100%);
    margin: 0 auto;
    gap: 14px;
}

.ready-check-runner-header,
.ready-check-runner-card,
.ready-check-runner-actions {
    border: 1px solid var(--sg-line);
    border-radius: 9px;
    background: var(--sg-paper);
}

.ready-check-runner-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 20px;
    padding: 18px 20px;
    border-left: 5px solid var(--sg-cyan);
}

.ready-check-runner-back {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--sg-ink-600);
    font: inherit;
    font-size: 0.68rem;
    font-weight: 850;
    cursor: pointer;
}

.ready-check-runner-back:hover {
    color: var(--sg-cyan-deep);
}

.ready-check-runner-heading h1 {
    margin: 4px 0 5px;
    color: var(--sg-ink-950);
    font-size: clamp(1.55rem, 3vw, 2.25rem);
    line-height: 1.05;
}

.ready-check-runner-heading p {
    max-width: 62ch;
    margin: 0;
    color: var(--sg-ink-600);
    line-height: 1.5;
}

.ready-check-runner-voice {
    align-self: start;
}

.ready-check-runner-progress {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(120px, 1fr);
    align-items: center;
    gap: 10px;
    color: var(--sg-ink-600);
    font-size: 0.65rem;
}

.ready-check-runner-progress > div {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--sg-line);
}

.ready-check-runner-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--sg-cyan), var(--sg-cyan-deep));
}

.ready-check-runner-card {
    display: grid;
    min-height: 320px;
    align-content: center;
    gap: 18px;
    padding: clamp(18px, 4vw, 38px);
}

.ready-check-runner-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sg-line);
    color: var(--sg-cyan-deep);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.ready-check-runner-context strong,
.ready-check-runner-context small {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(255, 51, 95, 0.09);
    color: var(--sg-coral);
    font-size: 0.54rem;
}

.ready-check-runner-context small {
    background: var(--sg-paper-muted);
    color: var(--sg-ink-500);
}

.ready-check-confirm {
    display: grid;
    width: 100%;
    min-height: 156px;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 2px solid var(--sg-line-strong);
    border-radius: 9px;
    background: var(--sg-paper-muted);
    color: var(--sg-ink-950);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ready-check-confirm:hover,
.ready-check-confirm:focus-visible {
    border-color: var(--sg-cyan);
}

.ready-check-confirm:focus-visible,
.ready-check-field input:focus,
.ready-check-field textarea:focus,
.ready-check-field select:focus {
    outline: 3px solid rgba(0, 207, 232, 0.28);
    outline-offset: 2px;
}

.ready-check-confirm.is-checked {
    border-color: #00a878;
    background: rgba(0, 168, 120, 0.08);
}

.ready-check-confirm-box {
    display: grid;
    width: 52px;
    height: 52px;
    border: 2px solid var(--sg-line-strong);
    border-radius: 8px;
    background: var(--sg-paper);
    color: transparent;
    font-size: 1.15rem;
    place-items: center;
}

.ready-check-confirm.is-checked .ready-check-confirm-box {
    border-color: #00a878;
    background: #00a878;
    color: #ffffff;
}

.ready-check-field-copy {
    display: grid;
    gap: 5px;
}

.ready-check-field-copy > small {
    color: var(--sg-cyan-deep);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ready-check-field-copy h2 {
    margin: 0;
    color: var(--sg-ink-950);
    font-size: clamp(1.25rem, 3vw, 1.85rem);
    line-height: 1.15;
}

.ready-check-field-copy p {
    margin: 0;
    color: var(--sg-ink-600);
    line-height: 1.5;
}

.ready-check-confirm-state {
    padding: 6px 8px;
    border-radius: 999px;
    background: var(--sg-paper);
    color: var(--sg-ink-500);
    font-size: 0.58rem;
    font-weight: 900;
    white-space: nowrap;
}

.ready-check-confirm.is-checked .ready-check-confirm-state {
    background: #00a878;
    color: #ffffff;
}

.ready-check-field {
    display: grid;
    gap: 16px;
}

.ready-check-field input,
.ready-check-field textarea,
.ready-check-field select {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 2px solid var(--sg-line-strong);
    border-radius: 8px;
    background: var(--sg-paper);
    color: var(--sg-ink-950);
    font: inherit;
    font-size: 1rem;
}

.ready-check-field textarea {
    min-height: 128px;
    resize: vertical;
}

.ready-check-number-control {
    display: grid;
    grid-template-columns: minmax(0, 220px) auto;
    align-items: center;
    gap: 10px;
}

.ready-check-number-control > span {
    color: var(--sg-ink-600);
    font-weight: 850;
}

.ready-check-field-hint {
    color: var(--sg-ink-500);
}

.ready-check-runner-validation {
    min-height: 20px;
    margin: 0;
    color: var(--sg-coral);
    font-size: 0.72rem;
    font-weight: 800;
}

.ready-check-runner-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
}

.ready-check-runner-empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    text-align: center;
}

.ready-check-runner-empty > i {
    color: var(--sg-cyan-deep);
    font-size: 1.7rem;
}

.ready-check-runner-empty h2,
.ready-check-runner-empty p {
    margin: 0;
}

.ready-check-runner-empty p {
    color: var(--sg-ink-600);
}

@media (max-width: 900px) {
    .ready-check-workspace {
        grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    }

    .ready-check-detail-header {
        align-items: stretch;
        flex-direction: column;
    }

    .ready-check-detail-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .main:has(.ready-check-page) .ready-check-overview {
        display: grid;
        gap: 14px;
        padding: 16px;
    }

    .main:has(.ready-check-page) .ready-check-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main:has(.ready-check-page) .ready-check-actions .btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .ready-check-workspace {
        grid-template-columns: 1fr;
    }

    .ready-check-routine-list {
        display: flex;
        gap: 7px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
    }

    .ready-check-routine {
        flex: 0 0 min(82vw, 310px);
        scroll-snap-align: start;
        border: 1px solid var(--sg-line);
        border-radius: 7px;
    }

    .ready-check-detail {
        min-height: 0;
    }

    .ready-check-detail-actions {
        grid-template-columns: 1fr;
    }

    .ready-check-detail-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .ready-check-detail-header,
    .ready-check-selected-history {
        padding: 15px;
    }

    .checklist-template-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .checklist-template-modal {
        width: 100%;
        max-height: 94vh;
        border-radius: 12px 12px 0 0;
    }

    .checklist-template-modal-footer {
        display: grid;
        grid-template-columns: 1fr;
    }

    .checklist-template-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .ready-check-runner-header {
        grid-template-columns: minmax(0, 1fr);
        padding: 15px;
    }

    .ready-check-runner-voice {
        grid-row: 1;
        grid-column: 1;
        justify-self: end;
    }

    .ready-check-confirm {
        min-height: 0;
        grid-template-columns: 44px minmax(0, 1fr);
        padding: 16px;
    }

    .ready-check-confirm-box {
        width: 44px;
        height: 44px;
    }

    .ready-check-confirm-state {
        grid-column: 2;
        justify-self: start;
    }

    .ready-check-runner-actions .btn {
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .main:has(.ready-check-page) .ready-check-actions {
        grid-template-columns: 1fr;
    }

    .ready-check-detail-title {
        display: grid;
    }

    .ready-check-detail-meta {
        padding-inline: 15px;
    }

    .ready-check-runner-card {
        min-height: 300px;
        padding: 15px;
    }

    .ready-check-runner-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .ready-check-runner-actions .btn {
        width: 100%;
        padding-inline: 8px;
        justify-content: center;
    }
}

[data-theme="dark"] .main:has(.ready-check-page) .ready-check-overview,
[data-theme="dark"] .ready-check-routines,
[data-theme="dark"] .ready-check-detail,
[data-theme="dark"] .ready-check-runner-header,
[data-theme="dark"] .ready-check-runner-card,
[data-theme="dark"] .ready-check-runner-actions,
[data-theme="dark"] .ready-check-confirm,
[data-theme="dark"] .ready-check-field input,
[data-theme="dark"] .ready-check-field textarea,
[data-theme="dark"] .ready-check-field select {
    border-color: var(--sg-line);
    background: var(--sg-paper);
    color: var(--sg-ink-950);
}

[data-theme="dark"] .ready-check-panel-heading,
[data-theme="dark"] .ready-check-routines-footer,
[data-theme="dark"] .ready-check-detail-meta,
[data-theme="dark"] .ready-check-history-empty,
[data-theme="dark"] .ready-check-confirm:not(.is-checked),
[data-theme="dark"] .checklist-template-modal-body {
    background: var(--sg-paper-muted);
}

/* Archived checklist records remain an on-screen dark sheet in dark mode.
   Explicit ink colours prevent the light-mode table/date values from becoming
   black-on-navy while leaving print output untouched. */
[data-theme="dark"] .main:has(.procedure-sheet) .procedure-sheet .checklist-sheet-header h2,
[data-theme="dark"] .main:has(.procedure-sheet) .procedure-sheet .checklist-sheet-table td:first-child,
[data-theme="dark"] .main:has(.procedure-sheet) .procedure-sheet .sheet-confirmed {
    color: #f8fafc !important;
}

[data-theme="dark"] .main:has(.procedure-sheet) .procedure-sheet .checklist-sheet-table td {
    background: #17283a;
}

[data-theme="dark"] .main:has(.procedure-sheet) .procedure-sheet .checklist-sheet-table td:first-child {
    background: #183445;
}

[data-theme="dark"] .main:has(.procedure-sheet) .procedure-sheet .sheet-answer-cell {
    color: #60a5fa;
}

[data-theme="dark"] .ready-check-routine.is-selected {
    background: rgba(0, 207, 232, 0.13);
}
