.account-layout {
    display: grid;
    gap: 1rem;
}

.account-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.account-meta {
    display: grid;
    gap: .25rem;
    color: var(--muted);
    margin-top: .5rem;
}

.account-form {
    display: grid;
    gap: 1.25rem;
}

.form-section {
    border: 1px solid var(--bg);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--bg);
}

.form-section h2,
.form-section h3 {
    margin-top: 0;
}


.form-field {
    display: grid;
    gap: .35rem;
}

.form-field.full {
    grid-column: 1 / -1;
}

.readonly-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 0.75rem 1rem;
    background: var(--panel-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
}

.readonly-badge {
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    background: #e2e8f0;
    border-radius: 999px;
}

.readonly-value {
    padding: .65rem .75rem;
    border: 1px solid var(--bg);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--muted);

    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}

.preference-card {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    padding: .75rem;
    border: 1px solid var(--bg);
    border-radius: var(--radius);
    background: var(--bg);
}

.preference-card input {
    margin-top: .2rem;
}

.preference-title {
    font-weight: 600;
    display: block;
}

.preference-help {
    display: block;
    margin-top: .15rem;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.35;
}

.phone-row {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}

.country-picker {
    position: relative;
    width: 180px;
    flex: 0 0 180px;
}

.country-display,
.country-search,
.country-option,
.account-form input[type="text"],
.account-form input[type="tel"],
.account-form select,
.account-form textarea {
    width: 100%;
}

.country-display {
    padding: .65rem .75rem;
    border: 1px solid var(--bg);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--bg);
}

.country-search {
    display: none;
    margin-top: .4rem;
}

.country-dropdown {
    position: absolute;
    top: calc(100% + .35rem);
    left: 0;
    width: 100%;
    max-height: 240px;
    overflow: auto;
    border: 1px solid var(--bg);
    border-radius: var(--radius);
    background: var(--bg);
    display: none;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.country-option {
    padding: .6rem .75rem;
    cursor: pointer;
}

.country-option:hover {
    background: var(--bg);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

@media (max-width: 900px) {

    .form-grid,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .phone-row {
        flex-direction: column;
    }

    .country-picker {
        width: 100%;
        flex-basis: auto;
    }
}/* Root modal only */
.modal.ai-sql-modal {
    align-items: center;
    background: var(--bg);
    backdrop-filter: blur(7px);
    display: flex;
    inset: 0;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem;
    position: fixed;
    z-index: 1000;
}


.modal.ai-sql-modal[hidden] {
    display: none;
}

/* Prevent global SVG rules from expanding icons inside this component. */
.ai-sql-modal svg {
    display: block;
    flex-shrink: 0;
}

/* Everything below must be scoped beneath this modal */
.ai-sql-modal .ai-sql-modal-content {
    background:
        radial-gradient(circle at top right,
            rgba(49, 94, 231, 0.05),
            transparent 24rem),
        var(--panel);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    box-shadow:
        0 2rem 5rem rgba(15, 23, 42, 0.28),
        0 0 0 1px rgba(15, 23, 42, 0.08);
    color: var(--text);
    max-height: calc(100vh - 4rem);
    max-width: 84rem;
    overflow-y: auto;
    padding: 0;
    width: 100%;
}

.ai-sql-modal .ai-sql-modal-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 1.65rem 1.75rem 1.4rem;
}

.ai-sql-modal .ai-sql-modal-heading {
    align-items: flex-start;
    display: flex;
    gap: 0.9rem;
}

.ai-sql-modal .ai-sql-modal-icon {
    align-items: center;
    background: var(--bg-subtle);
    border: 1px solid rgba(49, 94, 231, 0.12);
    border-radius: 0.85rem;
    color: var(--primary);
    display: flex;
    flex: 0 0 auto;
    height: 2.85rem;
    justify-content: center;
    width: 2.85rem;
}

.ai-sql-modal .ai-sql-modal-icon svg {
    height: 1.55rem;
    max-height: 1.55rem;
    max-width: 1.55rem;
    width: 1.55rem;
}

.ai-sql-modal .ai-sql-modal-header h2 {
    color: var(--text);
    font-size: 1.35rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin: 0 0 0.35rem;
}

.ai-sql-modal .ai-sql-modal-header p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    max-width: 42rem;
}

.ai-sql-modal .ai-sql-close-button {
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    height: 2.45rem;
    justify-content: center;
    padding: 0;
    transition:
        background 140ms ease,
        border-color 140ms ease,
        color 140ms ease;
    width: 2.45rem;
}

.ai-sql-modal .ai-sql-close-button:hover {
    background: var(--panel);
    border-color: var(--border);
    color: var(--text);
}

.ai-sql-modal .ai-sql-close-button svg {
    height: 1.2rem;
    max-height: 1.2rem;
    max-width: 1.2rem;
    width: 1.2rem;
}

.ai-sql-modal .ai-sql-capabilities {
    background: var(--bg);
    border: 1px solid var(--bg);
    border-radius: 0.9rem;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 1.35rem 1.75rem 0;
    padding: 1rem;
}

.ai-sql-modal .ai-sql-capability {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    min-width: 0;
}

.ai-sql-modal .ai-sql-capability-icon {
    align-items: center;
    background: var(--bg);
    border-radius: 0.7rem;
    color: var(--primary);
    display: flex;
    flex: 0 0 auto;
    height: 2.45rem;
    justify-content: center;
    width: 2.45rem;
}

.ai-sql-modal .ai-sql-capability:nth-child(2) .capability-icon {
    background: var(--success-subtle);
    color: var(--success);
}

.ai-sql-modal .ai-sql-capability:nth-child(3) .capability-icon {
    background: var(--bg-subtle);
    color: #7957d5;
}

.ai-sql-modal .ai-sql-capability-icon svg {
    height: 1.25rem;
    max-height: 1.25rem;
    max-width: 1.25rem;
    width: 1.25rem;
}

.ai-sql-modal .ai-sql-capability strong,
.ai-sql-modal .ai-sql-capability span {
    display: block;
}

.ai-sql-modal .ai-sql-capability strong {
    font-size: 0.78rem;
    margin-bottom: 0.18rem;
}

.ai-sql-modal .ai-sql-capability span {
    color: var(--muted);
    font-size: 0.71rem;
    line-height: 1.35;
}

.ai-sql-modal .ai-sql-modal-body {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1fr) 18rem;
    padding: 1.35rem 1.75rem 1.5rem;
}

.ai-sql-modal .ai-sql-workspace {
    min-width: 0;
}

.ai-sql-modal .ai-sql-section+.section {
    border-top: 1px solid var(--border);
    margin-top: 1.4rem;
    padding-top: 1.4rem;
}

.ai-sql-modal .ai-sql-section-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.ai-sql-modal .ai-sql-section-title {
    align-items: flex-start;
    display: flex;
    gap: 0.65rem;
}

.ai-sql-modal .ai-sql-step-number {
    align-items: center;
    background: var(--primary);
    border-radius: 999px;
    color: #fff;
    display: flex;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 700;
    height: 1.45rem;
    justify-content: center;
    margin-top: 0.05rem;
    width: 1.45rem;
}

.ai-sql-modal .ai-sql-section-title label {
    color: var(--text);
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.18rem;
}

.ai-sql-modal .ai-sql-section-title>div>span {
    color: var(--muted);
    display: block;
    font-size: 0.75rem;
    line-height: 1.4;
}

.ai-sql-modal .ai-sql-input-wrapper {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    overflow: hidden;
    transition:
        border-color 140ms ease,
        box-shadow 140ms ease;
}

.ai-sql-modal .ai-sql-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(49, 94, 231, 0.12);
}

/* Use the real IDs from the Askama template */
.ai-sql-modal #ai-sql-prompt {
    background: transparent;
    border: 0;
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.55;
    min-height: 8.25rem;
    outline: none;
    padding: 0.9rem 1rem 0.65rem;
    resize: vertical;
    width: 100%;
}

.ai-sql-modal #ai-sql-prompt::placeholder {
    color: #94a3b8;
}

.ai-sql-modal .ai-sql-input-footer {
    align-items: center;
    border-top: 1px solid var(--border);
    color: var(--muted);
    display: flex;
    font-size: 0.68rem;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
}

.ai-sql-modal .ai-sql-generation-actions {
    align-items: center;
    display: flex;
    gap: 0.8rem;
    margin-top: 0.75rem;
}

.ai-sql-modal .ai-sql-primary-button {
    align-items: center;
    background: linear-gradient(135deg, var(--primary), #416de9);
    border: 1px solid var(--primary);
    box-shadow: 0 0.35rem 0.85rem rgba(49, 94, 231, 0.18);
    color: #fff;
    display: inline-flex;
    font-weight: 700;
    gap: 0.45rem;
    justify-content: center;
}

.ai-sql-modal .ai-sql-primary-button:hover {
    background: var(--primary);
    color: #fff;
}

.ai-sql-modal .ai-sql-primary-button svg {
    height: 1rem;
    width: 1rem;
}

.ai-sql-modal .ai-sql-generation-note {
    color: var(--muted);
    font-size: 0.7rem;
}

.ai-sql-modal .ai-sql-validation-badge {
    align-items: center;
    background: var(--success-subtle);
    border: 1px solid var(--bg-subtle);
    border-radius: 999px;
    color: var(--success);
    display: flex;
    font-size: 0.68rem;
    font-weight: 700;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
}

.ai-sql-modal .ai-sql-validation-badge[hidden] {
    display: none;
}

.ai-sql-modal .ai-sql-validation-dot,
.ai-sql-modal .ai-sql-provider-indicator {
    background: currentColor;
    border-radius: 999px;
    display: block;
    height: 0.42rem;
    width: 0.42rem;
}

.ai-sql-modal .ai-sql-code-editor {
    background: var(--bg-subtle);
    border: 1px solid var(--border-strong);
    border-radius: 0.8rem;
    overflow: hidden;
}

.ai-sql-modal .ai-sql-code-toolbar {
    align-items: center;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 0.52rem 0.65rem;
}

.ai-sql-modal .ai-sql-code-language {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.69rem;
    font-weight: 700;
    gap: 0.42rem;
    text-transform: uppercase;
}

.ai-sql-modal .ai-sql-code-dot {
    background: #315ee7;
    border-radius: 999px;
    height: 0.45rem;
    width: 0.45rem;
}

.ai-sql-modal .ai-sql-toolbar-button {
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.69rem;
    font-weight: 600;
    gap: 0.35rem;
    padding: 0.32rem 0.5rem;
}

.ai-sql-modal .ai-sql-toolbar-button:hover {
    border-color: var(--border);
    color: var(--text);
}

.ai-sql-modal .ai-sql-toolbar-button svg {
    height: 0.85rem;
    width: 0.85rem;
}

.ai-sql-modal #ai-sql-output {
    background: var(--bg-subtle);
    border: 0;
    border-radius: 0;
    color: var(--text);
    font-family:
        "JetBrains Mono",
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    min-height: 20rem;
    outline: none;
    padding: 0.9rem 1rem;
    resize: vertical;
    tab-size: 4;
    width: 100%;
}

.ai-sql-modal .ai-sql-status {
    border-radius: 0.55rem;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.45;
    margin-top: 0.6rem;
    min-height: 1.1rem;
}

.ai-sql-modal .ai-sql-status:not(:empty) {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 0.55rem 0.7rem;
}

.ai-sql-modal .ai-sql-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-width: 0;
}

.ai-sql-modal .ai-sql-sidebar-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.9rem;
}

.ai-sql-modal .ai-sql-sidebar-card h3 {
    color: var(--text);
    font-size: 0.78rem;
    margin: 0;
}

.ai-sql-modal .ai-sql-sidebar-heading {
    align-items: center;
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.ai-sql-modal .ai-sql-sidebar-heading svg {
    color: var(--primary);
    height: 1rem;
    width: 1rem;
}

.ai-sql-modal .ai-sql-examples {
    display: flex;
    flex-direction: column;
}

.ai-sql-modal .ai-sql-examples button {
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-size: 0.72rem;
    gap: 0.5rem;
    justify-content: space-between;
    line-height: 1.4;
    padding: 0.65rem 0.2rem;
    text-align: left;
    width: 100%;
}

.ai-sql-modal .ai-sql-examples button:last-child {
    border-bottom: 0;
    padding-bottom: 0.15rem;
}

.ai-sql-modal .ai-sql-examples button:first-child {
    padding-top: 0.15rem;
}

.ai-sql-modal .ai-sql-examples button:hover {
    color: var(--primary);
}

.ai-sql-modal .ai-sql-examples button svg {
    flex: 0 0 auto;
    height: 0.85rem;
    width: 0.85rem;
}

.ai-sql-modal .ai-sql-tips {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}

.ai-sql-modal .ai-sql-tips li {
    align-items: flex-start;
    color: var(--muted);
    display: flex;
    font-size: 0.7rem;
    gap: 0.55rem;
    line-height: 1.45;
}

.ai-sql-modal .ai-sql-tip-icon {
    align-items: center;
    background: var(--bg);
    border-radius: 999px;
    color: var(--primary);
    display: flex;
    flex: 0 0 auto;
    font-size: 0.62rem;
    font-weight: 700;
    height: 1.2rem;
    justify-content: center;
    width: 1.2rem;
}

.ai-sql-modal .ai-sql-safety-card {
    background: var(--panel);
}

.ai-sql-modal .ai-sql-safety-card .sidebar-heading svg {
    color: var(--success);
}

.ai-sql-modal .ai-sql-safety-card p {
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.5;
    margin: 0;
}

.ai-sql-modal .ai-sql-modal-footer {
    align-items: center;
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: grid;
    gap: 1rem;
    grid-template-columns: auto 1fr auto;
    padding: 1rem 1.75rem;
}

.ai-sql-modal .ai-sql-provider-status {
    align-items: center;
    display: flex;
    gap: 0.55rem;
}

.ai-sql-modal .ai-sql-provider-indicator {
    box-shadow: 0 0 0 4px var(--success-subtle);
    color: var(--success);
}

.ai-sql-modal .ai-sql-provider-status span,
.ai-sql-modal .ai-sql-provider-status strong {
    display: block;
}

.ai-sql-modal .ai-sql-provider-status span {
    color: var(--muted);
    font-size: 0.62rem;
    margin-bottom: 0.08rem;
}

.ai-sql-modal .ai-sql-provider-status strong {
    color: var(--text);
    font-size: 0.72rem;
}

.ai-sql-modal .ai-sql-disclaimer {
    color: var(--muted);
    font-size: 0.66rem;
    margin: 0;
    text-align: center;
}

.ai-sql-modal .ai-sql-footer-actions {
    display: flex;
    gap: 0.6rem;
}

.ai-sql-modal .ai-sql-cancel-button {
    background: var(--panel);
    border-color: var(--border);
    color: var(--text);
}

@media (max-width: 960px) {
    .modal.ai-sql-modal {
        align-items: flex-start;
        padding: 1rem;
    }

    .ai-sql-modal .ai-sql-modal-content {
        max-height: none;
    }

    .ai-sql-modal .ai-sql-capabilities {
        grid-template-columns: 1fr;
    }

    .ai-sql-modal .ai-sql-modal-body {
        grid-template-columns: 1fr;
    }

    .ai-sql-modal .ai-sql-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ai-sql-modal .ai-sql-safety-card {
        grid-column: 1 / -1;
    }

    .ai-sql-modal .ai-sql-modal-footer {
        grid-template-columns: 1fr auto;
    }

    .ai-sql-modal .ai-sql-disclaimer {
        display: none;
    }
}

@media (max-width: 640px) {
    .modal.ai-sql-modal {
        padding: 0;
    }

    .ai-sql-modal .ai-sql-modal-content {
        border-radius: 0;
        min-height: 100vh;
    }

    .ai-sql-modal .ai-sql-modal-header,
    .ai-sql-modal .ai-sql-modal-body,
    .ai-sql-modal .ai-sql-modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .ai-sql-modal .ai-sql-capabilities {
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .ai-sql-modal .ai-sql-sidebar {
        display: flex;
    }

    .ai-sql-modal .ai-sql-modal-footer {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .ai-sql-modal .ai-sql-provider-status {
        display: none;
    }

    .ai-sql-modal .ai-sql-footer-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .ai-sql-modal .ai-sql-generation-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .ai-sql-modal .ai-sql-primary-button {
        width: 100%;
    }
}/* ==========================================================================
   FlaskTrack Digital Lab Assistant
   Scoped production styles
   ========================================================================== */

#aiModal.ai-modal {
    position: fixed;
    inset: 20px;
    width: auto;
    max-width: 1240px;
    height: auto;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: hidden;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border-muted);
    border-radius: calc(var(--radius) * 2);
    box-shadow: var(--shadow-lg);
}

#aiModal.ai-modal::backdrop {
    background: rgb(31 42 42 / 0.66);
    backdrop-filter: blur(8px);
}

#aiModal.ai-modal[open] {
    display: block;
}

#aiModal.ai-modal,
#aiModal.ai-modal * {
    box-sizing: border-box;
}

#aiModal .ai-modal-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--panel);
}

/* Header */

#aiModal .ai-modal-header {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    min-height: 108px;
    padding: 22px 26px;
    background:
        radial-gradient(circle at 0 0,
            var(--primary-subtle),
            transparent 48%),
        var(--panel);
    border-bottom: 1px solid var(--border);
}

#aiModal .ai-modal-heading {
    min-width: 0;
    max-width: 760px;
}

#aiModal .ai-modal-heading-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
}

#aiModal .eyebrow {
    color: var(--primary-hover);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

#aiModal .ai-modal-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    font-weight: 780;
    line-height: 1.12;
    letter-spacing: -0.035em;
}

#aiModal .ai-modal-heading p {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

#aiModal .ai-modal-status,
#aiModal .ai-response-context,
#aiModal .ai-file-formats {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    color: var(--primary-hover);
    background: var(--primary-subtle);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
}

#aiModal .ai-modal-close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    color: var(--muted);
    background: var(--neutral-btn);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 1.4rem;
    line-height: 1;
    box-shadow: none;
}

#aiModal .ai-modal-close:hover {
    color: var(--text-hover);
    background: var(--neutral-btn-hover);
    border-color: var(--border-muted);
}

/* Workspace */

#aiModal .ai-modal-workspace {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(360px, 0.82fr) minmax(460px, 1.18fr);
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

#aiModal .ai-modal-input-panel {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    overflow-y: auto;
    padding: 24px 26px 26px;
    background: var(--panel);
    border-right: 1px solid var(--border);
}

#aiModal .ai-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 100%;
    margin: 0;
}

#aiModal .form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
}

#aiModal [hidden] {
    display: none !important;
}

#aiModal .ai-field-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

#aiModal .ai-field-heading>div {
    min-width: 0;
}

#aiModal .ai-field-heading label {
    display: block;
    margin: 0;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 760;
    line-height: 1.35;
}

#aiModal .ai-field-heading p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

#aiModal .ai-prompt-count {
    flex: 0 0 auto;
    padding-top: 2px;
    color: var(--muted);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#aiModal .ai-prompt-count.state-warning {
    color: var(--color-contaminated);
    font-weight: 750;
}

/* Prompt composer */

#aiModal textarea#aiPrompt {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 230px;
    max-height: 430px;
    margin: 0;
    padding: 17px 18px;
    resize: vertical;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border-muted);
    border-radius: calc(var(--radius) + 4px);
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / 0.5),
        0 1px 2px rgb(0 0 0 / 0.03);
    font: inherit;
    font-size: 0.94rem;
    line-height: 1.6;
    outline: none;
    transition:
        background 140ms ease,
        border-color 140ms ease,
        box-shadow 140ms ease;
}

#aiModal textarea#aiPrompt:hover {
    border-color: var(--primary);
}

#aiModal textarea#aiPrompt:focus {
    background: var(--panel);
    border-color: var(--primary);
    box-shadow:
        0 0 0 3px var(--primary-subtle),
        var(--shadow);
}

#aiModal textarea#aiPrompt::placeholder {
    color: var(--muted);
    opacity: 0.65;
}

#aiModal .ai-prompt-guidance {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

#aiModal .ai-prompt-guidance span {
    position: relative;
    padding-left: 17px;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

#aiModal .ai-prompt-guidance span::before {
    position: absolute;
    top: 0.48em;
    left: 2px;
    width: 5px;
    height: 5px;
    content: "";
    background: var(--primary);
    border-radius: 999px;
}

/* Upload state */

#aiModal .ai-file-dropzone {
    position: relative;
    min-height: 134px;
    overflow: hidden;
    background: var(--bg);
    border: 1px dashed var(--border-muted);
    border-radius: calc(var(--radius) + 4px);
    transition:
        background 140ms ease,
        border-color 140ms ease,
        box-shadow 140ms ease;
}

#aiModal .ai-file-dropzone:hover,
#aiModal .ai-file-dropzone.is-dragging {
    background: var(--primary-subtle);
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

#aiModal .ai-file-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
}

#aiModal .file-dropzone-content {
    display: flex;
    min-height: 134px;
    align-items: center;
    gap: 14px;
    padding: 18px;
    pointer-events: none;
}

#aiModal .file-dropzone-content strong,
#aiModal .file-dropzone-content span {
    display: block;
}

#aiModal .file-dropzone-content span {
    margin-top: 4px;
}

#aiModal .ai-file-dropzone-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--primary-hover);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: var(--shadow);
}

#aiModal .ai-file-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    background: var(--success-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

#aiModal .ai-file-selection-copy {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

#aiModal .ai-file-selection-copy>div {
    min-width: 0;
}

#aiModal .ai-file-selection-copy strong,
#aiModal .ai-file-selection-copy span {
    display: block;
}

#aiModal .ai-file-selection-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#aiModal .ai-file-selection-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    color: var(--success);
    background: var(--panel);
    border-radius: 999px;
    font-weight: 800;
}

/* Notice and actions */

#aiModal .ai-mode-notice {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 12px 14px;
    color: var(--text);
    background: var(--warning-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

#aiModal .ai-mode-notice strong,
#aiModal .ai-mode-notice span {
    display: block;
}

#aiModal .ai-mode-notice span {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

#aiModal .ai-form-footer {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-top: auto;
    padding-top: 8px;
}

#aiModal .ai-disclaimer {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

#aiModal .form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 0;
}

#aiModal .form-actions .button {
    min-height: 40px;
    margin: 0;
}

#aiModal .ai-submit-button {
    display: inline-flex;
    min-width: 166px;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#aiModal .ai-submit-arrow {
    transition: transform 140ms ease;
}

#aiModal .ai-submit-button:hover .ai-submit-arrow {
    transform: translateX(3px);
}

/* Progress */

#aiModal .ai-progress {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
    padding: 14px;
    background: var(--primary-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

#aiModal .ai-progress-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

#aiModal .ai-progress-header strong,
#aiModal .ai-progress-header span {
    display: block;
}

#aiModal .ai-progress-header strong {
    font-size: 0.82rem;
}

#aiModal .ai-progress-header .muted {
    margin-top: 3px;
    font-size: 0.72rem;
}

#aiModal #aiProgressPercent {
    flex: 0 0 auto;
    color: var(--primary-hover);
    font-size: 0.78rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

#aiModal progress {
    display: block;
    width: 100%;
    height: 8px;
    overflow: hidden;
    appearance: none;
    background: var(--border);
    border: 0;
    border-radius: 999px;
}

#aiModal progress::-webkit-progress-bar {
    background: var(--border);
    border-radius: 999px;
}

#aiModal progress::-webkit-progress-value {
    background: var(--primary);
    border-radius: 999px;
}

#aiModal progress::-moz-progress-bar {
    background: var(--primary);
    border-radius: 999px;
}

/* Response surface */

#aiModal .ai-response-section {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

#aiModal .ai-response-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 70px;
    padding: 15px 20px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

#aiModal .ai-response-header h3 {
    margin: 3px 0 0;
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.25;
}

#aiModal .ai-response-context {
    color: var(--muted);
    background: var(--bg);
    font-weight: 650;
}

#aiModal .ai-response {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        linear-gradient(180deg,
            var(--bg),
            var(--bg-subtle));
}

#aiModal .ai-response-placeholder {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 38px;
    text-align: center;
}

#aiModal .ai-response-placeholder-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    margin-bottom: 17px;
    color: var(--primary-hover);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    font-size: 1rem;
    font-weight: 850;
    letter-spacing: -0.04em;
    box-shadow: var(--shadow);
}

#aiModal .ai-response-placeholder strong {
    color: var(--text);
    font-size: 1rem;
}

#aiModal .ai-response-placeholder p {
    max-width: 390px;
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

#aiModal .ai-frame {
    position: relative;
    z-index: 1;
    display: block;
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    margin: 0;
    background: transparent;
    border: 0;
}

#aiModal .ai-response.has-response {
    background: var(--panel);
}

#aiModal .ai-response.has-response .ai-response-placeholder {
    display: none;
}

#aiModal .ai-response.has-response .ai-frame {
    background: var(--panel);
}

/* Empty provider state */

#aiModal .ai-empty-state {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: min(650px, 100%);
    margin: 0 auto;
    padding: 48px 34px;
}

#aiModal .ai-empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 66px;
    margin-bottom: 20px;
    color: var(--primary-hover);
    background: var(--primary-subtle);
    border: 1px solid var(--border);
    border-radius: 18px;
    font-size: 1.05rem;
    font-weight: 850;
    box-shadow: var(--shadow);
}

#aiModal .ai-empty-state-copy {
    max-width: 560px;
}

#aiModal .ai-empty-state-copy h3 {
    margin: 7px 0 0;
    color: var(--text);
    font-size: 1.45rem;
    line-height: 1.25;
}

#aiModal .ai-empty-state-copy p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

#aiModal .ai-empty-state .form-actions {
    margin-top: 24px;
}

/* States */

#aiModal .ai-form.is-submitting textarea,
#aiModal .ai-form.is-submitting input,
#aiModal .ai-form.is-submitting .ai-file-dropzone {
    pointer-events: none;
    opacity: 0.68;
}

#aiModal .ai-form.is-submitting .ai-submit-button {
    cursor: wait;
}

/* Accessibility */

#aiModal button:focus-visible,
#aiModal a:focus-visible,
#aiModal textarea:focus-visible,
#aiModal input:focus-visible {
    outline: 3px solid var(--primary-subtle);
    outline-offset: 2px;
}

/* Responsive */

@media (max-width: 920px) {
    #aiModal.ai-modal {
        inset: 12px;
    }

    #aiModal .ai-modal-workspace {
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    #aiModal .ai-modal-input-panel {
        flex: 0 0 auto;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    #aiModal .ai-response-section {
        flex: 0 0 auto;
        min-height: 500px;
        overflow: visible;
    }

    #aiModal .ai-response {
        min-height: 430px;
    }

    #aiModal .ai-frame {
        min-height: 430px;
    }
}

@media (max-width: 640px) {
    #aiModal.ai-modal {
        inset: 0;
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    #aiModal .ai-modal-header {
        min-height: 0;
        gap: 14px;
        padding: 17px 16px;
    }

    #aiModal .ai-modal-heading-row {
        gap: 6px;
    }

    #aiModal .ai-modal-status {
        display: none;
    }

    #aiModal .ai-modal-heading h2 {
        font-size: 1.35rem;
    }

    #aiModal .ai-modal-heading p {
        font-size: 0.82rem;
    }

    #aiModal .ai-modal-input-panel {
        padding: 20px 16px 22px;
    }

    #aiModal textarea#aiPrompt {
        min-height: 190px;
    }

    #aiModal .ai-field-heading,
    #aiModal .ai-progress-header {
        align-items: flex-start;
    }

    #aiModal .ai-response-header {
        padding: 14px 16px;
    }

    #aiModal .ai-response-context {
        display: none;
    }

    #aiModal .form-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    #aiModal .form-actions .button {
        width: 100%;
    }

    #aiModal .ai-response-section {
        min-height: 470px;
    }

    #aiModal .ai-response,
    #aiModal .ai-frame {
        min-height: 400px;
    }
}

@media (prefers-reduced-motion: reduce) {

    #aiModal *,
    #aiModal *::before,
    #aiModal *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}.alert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;

}

.alert-card {
    padding: 1.25rem;
    border: 1px solid var(--bg);
    border-radius: 10px;
    transition: left 0.2s ease, opacity 0.2s ease;
}

.alert-card:hover {
    background: var(--hover-bg);
}

.alert-card.highlight {
    border-color: #f39c12;
}

.alert-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.alert-card .value {
    font-size: 1.05rem;
    font-weight: 600;
}

.actions.spaced {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.alerts-panel {
    max-width: 950px;
    margin: 0 auto;
}

.alerts-list {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--bg);
    text-decoration: none;
    color: var(--text);
    transition: left 0.2s ease, opacity 0.2s ease;
}

.alert-card-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.alert-card-row.overdue {
    border-left: 5px solid #e74c3c;
}

.alert-card-row.upcoming {
    border-left: 5px solid #f39c12;
}

.alert-left {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.alert-title {
    font-size: 1rem;
}

.alert-time {
    font-size: 0.9rem;
    color: #666;
}

.alert-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chevron {
    font-size: 1.2rem;
    opacity: 0.4;
}

.empty-state.large {
    text-align: center;
    padding: 4rem 0;
}

.empty-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.badge.large {
    font-size: 0.85rem;
    padding: 0.45rem 0.8rem;
}

/* Pulse reused from previous message */
.pulse {
    animation: pulseGlow 1.8s;
}

@keyframes pulseGlow {
    0% {
        box-shadow: var(--shadow);
    }

    70% {
        box-shadow: var(--shadow);
    }

    100% {
        box-shadow: var(--shadow);
    }
}


/* Delivery panel */
.delivery-panel {
    margin-top: 2rem;
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--bg);
}

.delivery-header {
    font-weight: 600;
    margin-bottom: 1rem;
}

.delivery-placeholder {
    font-size: 0.9rem;
    color: var(--muted);
}

.escalation-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ==========================================================================
   Alerts — shared page foundations
   ========================================================================== */

.alerts-page,
.alert-group-page,
.alert-detail-page {
    width: min(100%, 1500px);
    margin: 0 auto;
    padding: 1.5rem;
}

.alerts-breadcrumb,
.alert-group-breadcrumb,
.alert-detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.alerts-breadcrumb a,
.alert-group-breadcrumb a,
.alert-detail-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.alerts-breadcrumb a:hover,
.alert-group-breadcrumb a:hover,
.alert-detail-breadcrumb a:hover {
    color: var(--text);
}

.alerts-eyebrow,
.alert-group-eyebrow,
.alert-detail-eyebrow {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/* ==========================================================================
      Alerts index
      ========================================================================== */

.alerts-hero,
.alert-group-hero,
.alert-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--panel);
}

.alerts-hero-content {
    max-width: 780px;
}

.alerts-hero h1,
.alert-group-hero h1,
.alert-detail-hero h1 {
    margin: 0;
    line-height: 1.15;
}

.alerts-hero p,
.alert-group-hero p,
.alert-detail-hero p {
    max-width: 760px;
    margin: 0.75rem 0 0;
    color: var(--muted);
    ;
    line-height: 1.65;
}

.alerts-hero-summary {
    min-width: 180px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.025);
    text-align: right;
}

.alerts-hero-summary-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.alerts-hero-summary-label {
    display: block;
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.alerts-workspace,
.alert-group-workspace,
.alert-detail-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
}

.alerts-main,
.alert-group-main,
.alert-detail-main {
    min-width: 0;
}

.alerts-sidebar,
.alert-group-sidebar,
.alert-detail-sidebar {
    display: grid;
    gap: 1rem;
    position: sticky;
    top: 1rem;
}

.alerts-section-list {
    display: grid;
    gap: 1rem;
}

.alerts-category {
    overflow: hidden;
    padding: 0;
}

.alerts-category.is-priority {
    border-color: rgba(230, 100, 100, 0.5);
}

.alerts-category-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.alerts-category-summary::-webkit-details-marker {
    display: none;
}

.alerts-category-summary:hover {
    background: rgba(255, 255, 255, 0.025);
}

.alerts-category-heading,
.alerts-category-summary-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.alerts-category-icon {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    font-size: 1.1rem;
}

.alerts-category-copy {
    display: grid;
    gap: 0.15rem;
}

.alerts-category-copy strong {
    font-size: 1rem;
}

.alerts-category-copy small,
.alerts-category-toolbar p,
.alerts-sidebar-card p {
    color: var(--muted);
}

.alerts-priority-label {
    color: #f0a0a0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.alerts-category-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.alerts-category-close-label {
    display: none;
}

.alerts-category[open] .alerts-category-open-label {
    display: none;
}

.alerts-category[open] .alerts-category-close-label {
    display: inline;
}

.alerts-category[open] .alerts-category-toggle>span:last-child {
    transform: rotate(180deg);
}

.alerts-category-body {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
}

.alerts-category-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 0;
}

.alerts-category-toolbar h2 {
    margin: 0;
    font-size: 1rem;
}

.alerts-category-toolbar p {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
}

.alerts-group-list {
    display: grid;
    gap: 0.75rem;
}

.alerts-group-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.25rem;
    overflow: hidden;
    padding: 1rem 1rem 1rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.018);
}

.alerts-group-card:hover {
    border-color: rgba(139, 211, 221, 0.45);
    background: rgba(255, 255, 255, 0.03);
}

.alerts-group-status-rail,
.alert-group-item-status {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--muted);
    ;
}

.alerts-group-card.danger .alerts-group-status-rail,
.alert-group-item.danger .alert-group-item-status {
    background: #e57373;
}

.alerts-group-card.warning .alerts-group-status-rail,
.alert-group-item.warning .alert-group-item-status {
    background: #e4b85b;
}

.alerts-group-main {
    min-width: 0;
}

.alerts-group-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.alerts-group-type-icon {
    display: grid;
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.04);
}

.alerts-group-title {
    min-width: 0;
}

.alerts-group-title-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.alerts-group-title-line h3 {
    margin: 0;
    font-size: 1rem;
}

.alerts-group-step {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.alerts-group-step strong {
    color: var(--text);
}

.alerts-group-details {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.8rem 1.25rem;
    margin-top: 1rem;
}

.alerts-group-schedule {
    display: grid;
    gap: 0.2rem;
}

.alerts-group-detail-label {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.alerts-group-schedule time {
    font-size: 0.875rem;
    font-weight: 600;
}

.alerts-group-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.alerts-group-actions {
    display: flex;
    min-width: 130px;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.alerts-group-count {
    text-align: right;
}

.alerts-group-count strong {
    display: block;
    font-size: 1.4rem;
    line-height: 1;
}

.alerts-group-count span {
    color: var(--muted);
    font-size: 0.75rem;
}

.alerts-sidebar-card,
.alert-group-sidebar-card,
.alert-detail-sidebar-card {
    padding: 1.25rem;
}

.alerts-sidebar-card h2,
.alert-group-sidebar-card h2,
.alert-detail-sidebar-card h2 {
    margin: 0;
    font-size: 1rem;
}

.alerts-summary-list,
.alert-group-summary-list,
.alert-detail-summary-list {
    display: grid;
    gap: 0;
    margin: 1rem 0 0;
}

.alerts-summary-list>div,
.alert-group-summary-list>div,
.alert-detail-summary-list>div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}

.alerts-summary-list>div:last-child,
.alert-group-summary-list>div:last-child,
.alert-detail-summary-list>div:last-child {
    border-bottom: 0;
}

.alerts-summary-list dt,
.alert-group-summary-list dt,
.alert-detail-summary-list dt {
    color: var(--muted);
    font-size: 0.82rem;
}

.alerts-summary-list dd,
.alert-group-summary-list dd,
.alert-detail-summary-list dd {
    margin: 0;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 700;
}

.alerts-guidance-list,
.alert-detail-guidance-list {
    display: grid;
    gap: 0.7rem;
    margin: 1rem 0 0;
    padding-left: 1.2rem;
    color: var(--muted);
    ;
    font-size: 0.85rem;
    line-height: 1.5;
}

.alerts-sidebar-note,
.alert-group-sidebar-note,
.alert-detail-sidebar-note {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(139, 211, 221, 0.25);
    border-radius: 0.8rem;
    background: rgba(139, 211, 221, 0.06);
}

.alerts-sidebar-note p,
.alert-group-sidebar-note p,
.alert-detail-sidebar-note p {
    margin: 0;
    color: var(--muted);
    ;
    font-size: 0.82rem;
    line-height: 1.5;
}


/* ==========================================================================
      Grouped alert page
      ========================================================================== */

.alert-group-hero-main,
.alert-detail-hero-main {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
}

.alert-group-hero-icon,
.alert-detail-icon {
    display: grid;
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.035);
    font-size: 1.25rem;
}

.alert-group-hero-content,
.alert-detail-hero-content {
    min-width: 0;
}

.alert-group-hero-meta,
.alert-detail-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1rem;
}

.alert-group-hero-actions,
.alert-detail-hero-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.alert-group-list-card {
    padding: 1.25rem;
}

.alert-group-section-header,
.alert-detail-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.alert-group-section-header h2,
.alert-detail-section-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.alert-group-section-header p,
.alert-detail-section-header p {
    max-width: 700px;
    margin: 0.4rem 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.alert-group-count-badge {
    flex: 0 0 auto;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.alert-group-list {
    display: grid;
    gap: 0.75rem;
}

.alert-group-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    overflow: hidden;
    padding: 1rem 1rem 1rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.018);
}

.alert-group-item-main {
    min-width: 0;
}

.alert-group-item-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-group-item-icon {
    display: grid;
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.04);
}

.alert-group-item-heading h3 {
    margin: 0;
    font-size: 0.95rem;
}

.alert-group-item-heading p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.alert-group-item-details {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-top: 0.9rem;
}

.alert-group-item-details>div:first-child {
    display: grid;
    gap: 0.2rem;
}

.alert-group-item-label {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.alert-group-item-details time {
    font-size: 0.85rem;
    font-weight: 600;
}

.alert-group-item-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.alert-group-item-action {
    display: flex;
    align-items: center;
}

.alert-group-guidance-list {
    display: grid;
    gap: 1rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.alert-group-guidance-list li {
    display: flex;
    gap: 0.75rem;
}

.alert-group-guidance-list li>span {
    display: grid;
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
}

.alert-group-guidance-list strong,
.alert-group-guidance-list small {
    display: block;
}

.alert-group-guidance-list small {
    margin-top: 0.2rem;
    color: var(--muted);
    line-height: 1.45;
}


/* ==========================================================================
      Alert detail page
      ========================================================================== */

.alert-detail-main {
    display: grid;
    gap: 1rem;
}

.alert-detail-overview,
.alert-detail-records,
.alert-detail-next-action,
.alert-detail-dismiss-zone {
    padding: 1.25rem;
}

.alert-detail-state-indicator {
    flex: 0 0 auto;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.alert-detail-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.alert-detail-overview-card {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.018);
}

.alert-detail-overview-label {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.alert-detail-overview-card time,
.alert-detail-overview-card strong {
    overflow-wrap: anywhere;
    font-size: 0.9rem;
}

.alert-detail-record-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.alert-detail-record-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.018);
    color: inherit;
    text-decoration: none;
}

.alert-detail-record-card:hover {
    border-color: rgba(139, 211, 221, 0.5);
    background: rgba(139, 211, 221, 0.05);
}

.alert-detail-record-card.is-highlighted {
    border-color: rgba(139, 211, 221, 0.32);
}

.alert-detail-record-card.is-primary {
    background: rgba(139, 211, 221, 0.07);
    border-color: rgba(139, 211, 221, 0.45);
}

.alert-detail-record-icon {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    color: var(--accent-color);
    font-size: 0.7rem;
    font-weight: 800;
}

.alert-detail-record-content {
    display: grid;
    min-width: 0;
    gap: 0.15rem;
}

.alert-detail-record-content small {
    color: var(--muted);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.alert-detail-record-content strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.alert-detail-record-action {
    color: var(--accent-color);
}

.alert-detail-next-action {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
}

.alert-detail-next-action-icon {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: 0.7rem;
    background: rgba(139, 211, 221, 0.08);
    color: var(--accent-color);
}

.alert-detail-next-action h2,
.alert-detail-dismiss-zone h2 {
    margin: 0;
    font-size: 1rem;
}

.alert-detail-next-action p,
.alert-detail-dismiss-zone p {
    margin: 0.4rem 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.alert-detail-dismiss-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1rem;
}


/* ==========================================================================
      Empty states
      ========================================================================== */

.alerts-empty-state,
.alert-group-empty {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 2rem;
}

.alerts-empty-icon,
.alert-group-empty-icon {
    display: grid;
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border-radius: 50%;
    background: rgba(87, 190, 129, 0.12);
    color: #75d59a;
    font-size: 1.25rem;
}

.alerts-empty-content,
.alert-group-empty>div:nth-child(2) {
    flex: 1;
}

.alerts-empty-state h2,
.alert-group-empty h2 {
    margin: 0;
}

.alerts-empty-state p,
.alert-group-empty p {
    margin: 0.4rem 0 0;
    color: var(--muted);
}


/* ==========================================================================
      Responsive behavior
      ========================================================================== */

@media (max-width: 1100px) {

    .alerts-workspace,
    .alert-group-workspace,
    .alert-detail-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .alerts-sidebar,
    .alert-group-sidebar,
    .alert-detail-sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {

    .alerts-page,
    .alert-group-page,
    .alert-detail-page {
        padding: 1rem;
    }

    .alerts-hero,
    .alert-group-hero,
    .alert-detail-hero {
        flex-direction: column;
        padding: 1.25rem;
    }

    .alerts-hero-summary {
        width: 100%;
        text-align: left;
    }

    .alert-group-hero-actions,
    .alert-detail-hero-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .alerts-sidebar,
    .alert-group-sidebar,
    .alert-detail-sidebar {
        grid-template-columns: 1fr;
    }

    .alerts-category-toolbar,
    .alert-group-section-header,
    .alert-detail-section-header,
    .alert-detail-dismiss-zone {
        flex-direction: column;
        align-items: stretch;
    }

    .alerts-group-card,
    .alert-group-item {
        grid-template-columns: 1fr;
    }

    .alerts-group-actions {
        min-width: 0;
        flex-direction: row;
        align-items: center;
    }

    .alerts-group-count {
        text-align: left;
    }

    .alert-group-item-action {
        justify-content: flex-start;
    }

    .alert-detail-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .alert-detail-record-grid {
        grid-template-columns: 1fr;
    }

    .alert-detail-next-action {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .alert-detail-next-action>.button {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 520px) {

    .alerts-page,
    .alert-group-page,
    .alert-detail-page {
        padding: 0.75rem;
    }

    .alerts-category-summary {
        align-items: flex-start;
        padding: 1rem;
    }

    .alerts-category-summary-right {
        align-items: flex-end;
        flex-direction: column;
    }

    .alerts-category-body {
        padding: 0 1rem 1rem;
    }

    .alerts-group-details,
    .alert-group-item-details {
        align-items: flex-start;
        flex-direction: column;
    }

    .alerts-group-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .alerts-group-actions .button,
    .alert-group-item-action .button,
    .alert-group-hero-actions .button,
    .alert-detail-hero-actions .button {
        width: 100%;
    }

    .alert-group-hero-actions,
    .alert-detail-hero-actions {
        flex-direction: column;
    }

    .alert-group-hero-actions form,
    .alert-detail-hero-actions form {
        width: 100%;
    }

    .alert-detail-overview-grid {
        grid-template-columns: 1fr;
    }

    .alerts-empty-state,
    .alert-group-empty {
        align-items: flex-start;
        flex-direction: column;
    }
}/* Data Lake / SQL Explorer */

.lake-page,
.sql-main,
.sql-editor,
.report-meta,
.results-panel,
.visualization-panel,
.builder-panel,
.table-item,
.report-item {
    min-width: 0;
}

.lake-shell {
    display: grid;
    grid-template-columns: minmax(264px, 340px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    width: 100%;
}

.lake-sidebar {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-section {
    min-height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-search,
.result-search {
    width: 100%;
    min-width: 0;
}

/* Tabs */

.tab-content {
    display: none;
    min-width: 0;
}

.tab-content.active {
    display: block;
}

.analytics .tab {
    opacity: 0.65;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.analytics .tab.active,
.tab.active {
    opacity: 1;
    font-weight: 600;
    border-bottom: 2px solid var(--accent);
}

/* Sidebar reports */

.report-list {
    max-height: 24vh;
    min-height: 10rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.35rem;
}

.report-item {
    border: 1px solid var(--bg);
    border-radius: 0.9rem;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    background: var(--bg);
    overflow: hidden;
}

.report-item strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.report-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.report-card-main {
    flex: 1;
}

.report-actions {
    margin-top: 1rem;
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.report-actions,
.actions,
.chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.reports-grid {
    display: grid;
    gap: 1.25rem;
}

.report-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(316px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.report-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 170px;
    padding: 1rem;
}

.report-card-main {
    flex: 1;
}

.report-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.report-title-row h3 {
    margin: 0;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    margin-top: .75rem;
    font-size: .85rem;
    color: var(--muted-color);
}

.report-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

@media (max-width: 760px) {
    .report-card-list {
        grid-template-columns: 1fr;
    }

    .report-actions .button {
        flex: 1;
    }
}

/* Sidebar datasets */

.table-list {
    min-height: 20rem;
    max-height: calc(100vh - 18rem);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.35rem;
}

.table-item {
    border: 1px solid var(--bg);
    border-radius: 0.9rem;
    padding: 0.5rem;
    margin-bottom: 0.8rem;
    background: var(--bg);
    overflow: hidden;
}

.table-name {
    display: block;
    font-size: 0.95rem;
    line-height: 1.3;
    font-weight: 700;
    cursor: pointer;
    white-space: normal;
    overflow-wrap: anywhere;
}

.table-name:hover,
.schema-row:hover,
.table-column:hover,
.autocomplete-item:hover,
.autocomplete-item.active,
.data-table tbody tr:hover {
    background: var(--hover-bg);
}

.table-meta {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.45rem;
}

.table-source,
.schema-badge {
    font-size: 0.72rem;
    line-height: 1.2;
    border: 1px solid var(--bg);
    border-radius: 999px;
    padding: 0.18rem 0.5rem;
    color: var(--muted);
    max-width: 100%;
}

.table-versions {
    margin-top: 0.65rem;
    max-height: 16rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.25rem;
}

.table-versions summary {
    cursor: pointer;
    padding: 0.25rem 0;
    user-select: none;
}

.table-version-group {
    min-width: 0;
    padding: 0.4rem 0;
    border-top: 1px solid var(--bg);
}

.schema-title {
    display: block;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.schema-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: start;
    min-height: 2.35rem;
    padding: 0.45rem 0.5rem;
    border-radius: 0.55rem;
    cursor: pointer;
}

.schema-row .schema-title {
    font-size: 0.82rem;
}

/* Main layout */

.sql-main {
    display: grid;
    gap: 1rem;
}

.sql-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    min-width: 0;
}

/* Editor */

#sql-editor {
    width: 100%;
    min-height: 18rem;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--bg);
    border-radius: 0.75rem;
    padding: 0.75rem;
    outline: none;
    transition: border-color 0.15s ease;
}

#sql-editor:focus {
    border-color: var(--accent);
}

.CodeMirror {
    min-height: min(75vh, 960px);
    max-width: 100%;
    border-radius: 0.75rem;
    background: var(--bg);
    color: var(--text);
}

.CodeMirror-gutters {
    background: var(--bg);
    border-right: 1px solid var(--bg);
}

/* Autocomplete */

.autocomplete-box {
    position: absolute;
    width: min(28rem, calc(100vw - 2rem));
    max-height: 14rem;
    overflow-y: auto;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--bg);
    border-radius: 0.75rem;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.autocomplete-item {
    padding: 0.45rem 0.65rem;
    cursor: pointer;
    color: var(--text);
}

/* Results */

.result-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.result-search {
    min-width: min(18rem, 100%);
}

.results-shell,
#query-results {
    min-width: 0;
    max-width: 100%;
    max-height: 58vh;
    overflow: auto;
    border: 1px solid var(--bg);
    border-radius: 0.75rem;
}

.data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 0.85rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.data-table th,
.data-table td {
    padding: 0.45rem 0.6rem;
    max-width: 22rem;
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-bottom: 1px solid var(--bg);
}

.data-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: left;
    font-weight: 600;
    background: var(--bg);
}


/* JSON result tables */

.json-table {
    width: auto;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.json-table td,
.json-table th {
    border: 1px solid var(--bg);
    padding: 0.35rem 0.55rem;
}

.json-key,
.json-table th {
    font-weight: 700;
    background: var(--bg);
}

/* Builder */

.builder-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.table-columns,
#builder-columns,
#builder-filters,
#builder-joins {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.table-column {
    font-size: 0.85rem;
    opacity: 0.8;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.table-column:hover {
    opacity: 1;
    color: var(--accent);
}

/* Generic pre/code */

pre {
    background: var(--bg);
    color: var(--text);
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    overflow-x: auto;
    border: 1px solid var(--bg);
    margin-top: 0.5rem;
}

.uuid {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--accent);
    font-size: 0.8rem;
}

/* Legacy reports layout */

.reports-layout {
    display: grid;
    grid-template-columns: minmax(264px, 316px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    width: 100%;
}

.reports-layout>.panel {
    min-width: 0;
}

.reports-layout .boxed-list {
    width: 100%;
}

.reports-layout .panel:first-child .boxed-list {
    max-height: 65vh;
    overflow-y: auto;
}

@media (max-width: 960px) {

    .lake-shell,
    .reports-layout {
        grid-template-columns: 1fr;
    }

    .lake-sidebar {
        position: static;
        max-height: none;
    }

    .report-list {
        max-height: 16rem;
    }

    .table-list {
        max-height: 24rem;
    }

    .table-versions {
        max-height: 12rem;
    }

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

}

.query-builder {
    display: grid;
    gap: 1.25rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.builder-step {
    display: grid;
    gap: 0.85rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bg);
}

.builder-step:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.builder-step-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: var(--bg);
    color: var(--accent);
    font-weight: 700;
    flex: 0 0 auto;
}

.builder-source-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.builder-card {
    border: 1px solid var(--bg);
    background: var(--panel-muted, rgba(127, 127, 127, 0.04));
    border-radius: 12px;
    padding: 1rem;
}

.builder-columns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
    gap: 0.65rem;
}

.builder-columns-grid label,
.builder-card label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.5rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--bg);
    border-radius: 10px;
    background: var(--panel);
    cursor: pointer;
}

.builder-columns-grid label:hover,
.builder-card label:has(input[type="checkbox"]):hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent);
}

.builder-columns-grid input[type="checkbox"],
.builder-card input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.builder-filters-list,
.builder-joins-list {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.builder-filters-list:empty::before {
    content: "No filters added. Add a filter to narrow the report results.";
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.builder-joins-list:empty::before {
    content: "No joins configured. Add joins only when this report needs related tables.";
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.builder-footer {
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--bg);
}

@media (max-width: 900px) {
    .builder-source-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
    }
}

.visualization-panel[hidden] {
    display: none;
}

.chart-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
    gap: 0.85rem;
    align-items: end;
}

.chart-shell {
    width: 100%;
    min-height: 360px;
    max-height: 516px;
    overflow: hidden;
    margin-top: 1rem;
    border: 1px solid var(--bg);
    border-radius: 12px;
    padding: 1rem;
    background: var(--panel);
}

#chart-canvas {
    width: 100% !important;
    height: 360px !important;
}

#chart-message {
    margin-top: 0.75rem;
}

@media (max-width: 900px) {
    .chart-controls {
        grid-template-columns: 1fr;
    }
}

.builder-column-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.builder-column-toolbar input[type="search"] {
    max-width: 360px;
}

.builder-columns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
    gap: 0.65rem;
}

.builder-column-card {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-height: 2.75rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--bg);
    border-radius: 10px;
    background: var(--panel);
    cursor: pointer;
}

.builder-column-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent);
}

.builder-column-card input[type="checkbox"] {
    margin-top: 0.15rem;
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.builder-column-content {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.builder-column-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.builder-column-meta {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.empty-state {
    padding: 0.85rem;
    border: 1px dashed var(--bg);
    border-radius: 10px;
}

.sql-editor-shell {
    position: relative;
}

.sql-editor-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.sql-editor-shell.is-focus-mode {
    position: fixed;
    inset: 1rem;
    z-index: 2000;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    overflow: auto;
}

.sql-editor-shell.is-focus-mode .CodeMirror,
.sql-editor-shell.is-focus-mode .sql-textarea {
    height: calc(100vh - 14rem) !important;
    max-height: none !important;
    min-height: calc(100vh - 14rem) !important;
}

.sql-editor-shell.is-focus-mode .sql-joins-panel {
    margin-top: 1rem;
}

body.sql-focus-mode {
    overflow: hidden;
}

.sql-focus-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 1999;
}.api-keys-page {
    display: grid;
    gap: 1rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h1 {
    margin: 0;
}

.eyebrow {
    margin: 0 0 .25rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .75rem;
    color: var(--muted-text);
    font-weight: 700;
}

.api-org-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow-x: auto;
}

.api-org-panel code,
.api-key-id {
    font-size: .85rem;
    word-break: break-all;
}

.api-keys-card {
    display: grid;
    gap: 1rem;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    border-bottom: 1px solid var(--bg);
    padding-bottom: .85rem;
}

.card-header-row h2 {
    margin: 0 0 .25rem;
}

.api-key-list {
    display: grid;
    gap: .75rem;
}

.api-key-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--bg);
    border-radius: 14px;
    background: var(--bg);
    box-shadow: var(--shadow);
}

.api-key-row.is-revoked {
    opacity: .68;
    background: var(--bg-subtle);
}

.api-key-title-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .65rem;
}

.api-key-meta {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    color: var(--muted-text);
    font-size: .9rem;
}

.api-key-meta strong {
    display: block;
    color: var(--text);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .15rem;
}

.api-key-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    border: 1px dashed var(--border, var(--border));
    border-radius: 14px;
    background: var(--muted-surface-color, var(--bg));
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: .5rem;
}

.empty-state h3 {
    margin: 0 0 .35rem;
}

@media (max-width: 760px) {
    .api-key-row {
        grid-template-columns: 1fr;
    }

    .api-key-actions {
        justify-content: flex-start;
    }

    .page-header .btn {
        width: 100%;
        text-align: center;
    }
}

.api-example-panel {
    display: grid;
    gap: .75rem;
}

.api-example-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.api-code-block {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;

    border-radius: 14px;
    border: 1px solid var(--bg);

    background: #0f172a;
    color: #e2e8f0;

    font-size: .85rem;
    line-height: 1.55;
}

.api-code-block code {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        monospace;
}.audit-outcome.pass {
    color: #2e7d32;
}

.audit-outcome.conditional {
    color: #ed6c02;
}

.audit-outcome.fail {
    color: #c62828;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.audit-table th {
    background: var(--panel);
    text-align: left;
}


.audit-diff-table th,
.audit-diff-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--bg);
}

.audit-field {
    font-weight: 600;
}

.audit-before {
    color: #7a2e2e;
    background: #ffe0e088;
}

.audit-after {
    color: #065f46;
    background: #d1fae5;
}

.audit-diff summary {
    cursor: pointer;
    font-weight: 500;
}

.audit-action {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    background: var(--bg-subtle);
}

.audit-action.create {
    background: #dafbe1;
    color: #1a7f37;
}

.audit-action.update {
    background: #ddf4ff;
    color: #0969da;
}

.audit-action.finalize {
    background: #ffebe9;
    color: black;
}

.audit-action.delete {
    background: #ffebe9;
    color: #cf222e;
}

.audit-diff summary {
    cursor: pointer;
    color: var(--primary);
    font-size: 0.85rem;
}

.audit-diff pre.diff {
    margin-top: 0.5rem;
    max-height: 300px;
    overflow: auto;
    background: var(--code-bg);
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    line-height: 1.4;
}

.policy-matrix {
    display: grid;
    gap: 1rem;
}

.policy-entity-card {
    border: 1px solid var(--bg);
    border-radius: 12px;
    padding: 1rem;
    background: var(--panel);
}

.policy-entity-header {
    margin-bottom: .75rem;
}

.policy-entity-header h3 {
    margin: 0;
}

.policy-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(264px, 1fr));
    gap: .75rem;
}

.policy-action-card {
    border: 1px solid var(--bg);
    border-radius: 10px;
    background: var(--panel-muted, var(--panel));
    overflow: hidden;
}

.policy-action-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .75rem .9rem;
    cursor: pointer;
    font-weight: 700;
}

.policy-rule-list {
    border-top: 1px solid var(--bg);
    padding: .5rem;
    display: grid;
    gap: .5rem;
}

.policy-rule-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .6rem;
    border-radius: 8px;
    background: var(--background);
}

.empty-state.compact {
    padding: .75rem;
    border: 1px dashed var(--bg);
    border-radius: 10px;
    background: var(--background);
}

.policy-matrix th,
.policy-matrix td {
    border: 1px solid var(--border-subtle);
    padding: 10px;
    text-align: center;
    vertical-align: top;
}

.entity-col {
    text-align: left;
    min-width: 160px;
}

.policy-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.policy-legend {
    margin-bottom: 1rem;
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
}

.policy-legend-panel {
    margin-bottom: 1.5rem;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(216px, 1fr));
    gap: 16px;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.legend-item span {
    font-size: 1.4rem;
}

.matrix-blocked {
    color: #b91c1c;
    font-size: 1.2rem;
}

.matrix-approval {
    color: #f59e0b;
    font-size: 1.2rem;
}

.matrix-allowed {
    color: #16a34a;
    font-size: 1.2rem;
}

.matrix-none {
    color: #9ca3af;
}

.policy-breakdown {
    margin-top: 6px;
    font-size: 0.8rem;
    text-align: left;
}

.rule-list {
    padding-left: 14px;
}

.matrix-section {
    margin-bottom: 2rem;
}


.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.metric-value {
    line-height: 1.2;
}

.metric-card {
    position: relative;
}

.metric-card {
    padding: 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: var(--panel);
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text);
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.metric-breakdown {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
    font-size: 0.85rem;
}

.metric-breakdown div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* reuse your existing colors */
.dot.completed {
    background: var(--color-completed);
}

.dot.failed {
    background: var(--color-failed);
}

.dot.contaminated {
    background: var(--color-contaminated);
}

.dot.archived {
    background: var(--color-archived);
}

.dot.pending {
    background: var(--color-pending);
}

.metric-details {
    margin-top: 12px;
}

.metric-summary {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.summary-inline {
    font-size: 0.85rem;
    color: var(--muted);
}

.metric-details-body {
    margin-top: 12px;
}

/* donut */
.donut-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.donut {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    position: relative;
    place-self: anchor-center;
    background:
        conic-gradient(var(--color-completed) 0 calc(var(--c1) * 1%),
            var(--color-failed) calc(var(--c1) * 1%) calc((var(--c1) + var(--c2)) * 1%),
            var(--color-contaminated) calc((var(--c1) + var(--c2)) * 1%) calc((var(--c1) + var(--c2) + var(--c3)) * 1%),
            var(--color-archived) calc((var(--c1) + var(--c2) + var(--c3)) * 1%) calc((var(--c1) + var(--c2) + var(--c3) + var(--c4)) * 1%),
            var(--color-pending) calc((var(--c1) + var(--c2) + var(--c3) + var(--c4)) * 1%) calc((var(--c1) + var(--c2) + var(--c3) + var(--c4) + var(--c5)) * 1%)),

        var(--panel);
}



.donut::after {
    content: "";
    position: absolute;
    inset: 18px;
    background: var(--panel);
    border-radius: 50%;
}

.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* breakdown grid */
.metric-breakdown {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
    font-size: 0.85rem;
}.framework-view {
    display: grid;
    gap: 1rem;
}

.framework-view__header {
    align-items: flex-start;
}

.framework-view__identity {
    min-width: 0;
}

.framework-view__identity h1 {
    margin: 0;
}

.framework-view__eyebrow,
.framework-policy-preview__eyebrow {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.framework-view__metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
    margin-top: 0.55rem;
    font-size: 0.875rem;
}

.framework-view__metadata span {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
}

.framework-view__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.framework-view__metric {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 92px;
}

.framework-view__metric-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 0.75rem;
    background: var(--bg);
    font-size: 1.2rem;
}

.framework-view__metric div {
    display: grid;
    gap: 0.15rem;
}

.framework-view__metric strong {
    font-size: 1.45rem;
    line-height: 1;
}

.framework-view__metric span:last-child {
    color: var(--muted);
    font-size: 0.85rem;
}

.framework-policy-preview {
    display: grid;
    gap: 1.25rem;
}

.framework-policy-preview__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.framework-policy-preview__header h2,
.framework-policy-preview__header p {
    margin: 0;
}

.framework-policy-preview__header p {
    max-width: 720px;
    margin-top: 0.4rem;
}

.framework-policy-preview__form {
    display: grid;
    gap: 1.25rem;
}

.framework-policy-preview__fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.framework-policy-preview__fields .field-group {
    display: grid;
    align-content: start;
    gap: 0.4rem;
}

.framework-policy-preview__fields select {
    width: 100%;
}

.framework-policy-preview__tags {
    min-width: 0;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.framework-policy-preview__tags legend {
    padding: 0 0.35rem;
    font-weight: 700;
}

.framework-policy-preview__tags p {
    margin-top: 0;
}

.framework-policy-preview__tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.framework-policy-preview__tag-option {
    position: relative;
    cursor: pointer;
}

.framework-policy-preview__tag-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.framework-policy-preview__tag-option .tag {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    border: 2px solid transparent;
    opacity: 0.62;
    transition:
        opacity 120ms ease,
        border-color 120ms ease,
        transform 120ms ease;
}

.framework-policy-preview__tag-option:hover .tag {
    opacity: 0.86;
}

.framework-policy-preview__tag-option input:checked+.tag {
    border-color: currentColor;
    opacity: 1;
    transform: translateY(-1px);
}

.framework-policy-preview__tag-option input:focus-visible+.tag {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.framework-policy-preview__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.framework-policy-preview__summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.framework-policy-preview__summary-card {
    display: grid;
    gap: 0.2rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg);
}

.framework-policy-preview__summary-card strong {
    font-size: 1.6rem;
    line-height: 1;
}

.framework-policy-preview__summary-card span {
    color: var(--muted);
    font-size: 0.85rem;
}

.framework-policy-preview__summary-card.is-required {
    border-color: var(--success-border);
}

.framework-policy-preview__summary-card.is-unconfigured {
    border-color: var(--warning-border);
}

.framework-policy-preview__results {
    display: grid;
    gap: 0.85rem;
}

.framework-policy-preview__empty {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.25rem;
    border: 1px dashed var(--border);
    border-radius: 0.75rem;
}

.framework-policy-preview__empty p {
    margin: 0.3rem 0 0;
}

.framework-policy-preview__empty-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 0.7rem;
    background: var(--bg);
}

.framework-preview-result {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--surface);
}

.framework-preview-result__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}

.framework-preview-result__identity {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.framework-preview-result__identity h3,
.framework-preview-result__identity p {
    margin: 0;
}

.framework-preview-result__identity p {
    margin-top: 0.25rem;
}

.framework-preview-result__icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 0.65rem;
    background: var(--bg);
}

.framework-preview-result__notice {
    margin: 0 1rem 1rem;
    padding: 0.85rem;
    border-radius: 0.65rem;
}

.framework-preview-result__notice p {
    margin: 0.3rem 0 0;
}

.framework-preview-result__notice.warning {
    border: 1px solid var(--warning-border);
    background: var(--warning-background);
}

.framework-preview-result__section {
    display: grid;
    gap: 0.65rem;
    padding: 0 1rem 1rem;
}

.framework-preview-result__section h4 {
    margin: 0;
    font-size: 0.9rem;
}

.framework-preview-scope {
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--bg);
}

.framework-preview-scope>summary {
    padding: 0.75rem;
    cursor: pointer;
}

.framework-preview-scope__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.framework-preview-scope__summary small {
    display: block;
    margin-top: 0.2rem;
    font-weight: 400;
}

.framework-preview-scope__content {
    padding: 0 0.75rem 0.75rem;
}

.framework-preview-conditions {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.framework-preview-conditions li {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.875rem;
}

.framework-preview-conditions li.matched {
    color: var(--success-text);
}

.framework-preview-conditions li.failed {
    color: var(--danger-text);
}

.framework-preview-condition__icon {
    display: inline-flex;
    width: 1rem;
    flex: 0 0 1rem;
    justify-content: center;
    font-weight: 700;
}

.framework-preview-result__rejected {
    margin: 0 1rem 1rem;
}

.framework-preview-result__rejected>summary {
    color: var(--muted);
    cursor: pointer;
    font-size: 0.875rem;
}

.framework-preview-result__rejected-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.framework-preview-result__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.framework-policy-preview__explanation {
    padding: 1rem;
    border-left: 4px solid var(--primary);
    border-radius: 0.5rem;
    background: var(--info-background);
}

.framework-policy-preview__explanation p {
    margin: 0.35rem 0 0;
    line-height: 1.55;
}

.framework-view__section {
    padding: 0;
    overflow: hidden;
}

.framework-view__section-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
}

.framework-view__section-summary>span:first-child {
    display: grid;
    gap: 0.2rem;
}

.framework-view__section-summary small {
    font-weight: 400;
}

.framework-view__section-content {
    display: grid;
    gap: 1rem;
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border);
}

.framework-view__configuration-box {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg);
}

.framework-view__configuration-box p {
    margin: 0.3rem 0 0;
}

.framework-view__inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

.framework-view__inline-form select {
    min-width: min(280px, 100%);
    flex: 1 1 240px;
}

.framework-view__empty-state {
    padding: 1.5rem;
    border: 1px dashed var(--border);
    border-radius: 0.75rem;
    text-align: center;
}

.framework-view__empty-state.compact {
    padding: 1rem;
    text-align: left;
}

.framework-view__empty-state p {
    margin: 0.35rem 0 0;
}

.framework-checklist-list,
.framework-tag-rule-list {
    display: grid;
    gap: 0.75rem;
}

.framework-checklist-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--surface);
}

.framework-checklist-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}

.framework-checklist-card__identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.framework-checklist-card__identity>span:last-child {
    display: grid;
    gap: 0.2rem;
}

.framework-checklist-card__icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 0.65rem;
    background: var(--bg);
}

.framework-checklist-card__body {
    display: grid;
    gap: 0.75rem;
    padding: 0 1rem 1rem;
}

.framework-checklist-card__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.framework-checklist-card__notice {
    padding: 0.85rem;
    border: 1px solid var(--warning-border);
    border-radius: 0.65rem;
    background: var(--warning-background);
}

.framework-checklist-card__notice p {
    margin: 0.3rem 0 0;
}

.framework-checklist-card__scopes>summary {
    color: var(--muted);
    cursor: pointer;
    font-size: 0.875rem;
}

.framework-checklist-card__scope-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.framework-checklist-scope {
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--bg);
}

.framework-checklist-scope header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.framework-checklist-scope header p {
    margin: 0.25rem 0 0;
}

.framework-checklist-scope__sentence {
    margin: 0.75rem 0;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.55;
}

.framework-checklist-scope__tags {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.65rem;
    font-size: 0.85rem;
}

.framework-checklist-scope__tags>div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.framework-checklist-card__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.framework-tag-rule {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.framework-tag-rule__identity {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.framework-tag-rule__level {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.framework-authorization-rule-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.framework-authorization-rule-form .field-group {
    display: grid;
    align-content: start;
    gap: 0.4rem;
}

.framework-authorization-rule-form__effect {
    display: grid;
    grid-column: 1 / -1;
    gap: 0.55rem;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
}

.framework-authorization-rule-form__effect label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    cursor: pointer;
}

.framework-authorization-rule-form__effect label>span {
    display: grid;
    gap: 0.15rem;
}

.framework-authorization-rule-form__effect small {
    color: var(--muted);
}

.framework-authorization-rule-form__actions {
    grid-column: 1 / -1;
}

.framework-rule-view-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.framework-rule-view-toggle [aria-pressed="true"] {
    border-color: var(--primary);
    color: var(--primary);
}

.framework-rule-view {
    display: grid;
    gap: 1rem;
}

.framework-rule-severity,
.framework-policy-matrix {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.framework-rule-severity__header,
.framework-policy-matrix>header {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.framework-rule-severity__entities {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.framework-rule-entity h3 {
    margin: 0 0 0.65rem;
    font-size: 1rem;
}

.framework-rule-list {
    display: grid;
    gap: 0.6rem;
}

.framework-rule-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
}

.framework-rule-card__content {
    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.framework-rule-card__content p {
    margin: 0.25rem 0 0;
}

.framework-policy-matrix__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    font-size: 0.85rem;
}

.framework-policy-matrix__legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.framework-policy-matrix__scroll {
    overflow-x: auto;
}

.framework-policy-matrix .policy-matrix {
    width: 100%;
    min-width: 720px;
}

.framework-policy-matrix .policy-matrix th,
.framework-policy-matrix .policy-matrix td {
    text-align: center;
    vertical-align: middle;
}

.framework-policy-matrix .policy-matrix th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
    text-align: left;
}

.matrix-indicator {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: var(--border);
}

.matrix-indicator--allowed {
    background: var(--success-text);
}

.matrix-indicator--approval {
    background: var(--warning-text);
}

.matrix-indicator--blocked {
    background: var(--danger-text);
}

.matrix-indicator--none {
    background: var(--border);
}

.framework-view__usage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.framework-view__usage h2,
.framework-view__usage p {
    margin: 0;
}

.framework-view__usage p {
    margin-top: 0.35rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {

    .framework-view__metrics,
    .framework-policy-preview__fields,
    .framework-authorization-rule-form {
        grid-template-columns: 1fr;
    }

    .framework-authorization-rule-form__effect,
    .framework-authorization-rule-form__actions {
        grid-column: auto;
    }

    .framework-view__header,
    .framework-policy-preview__header,
    .framework-view__usage {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {

    .framework-view__metrics,
    .framework-policy-preview__summary {
        grid-template-columns: 1fr;
    }

    .framework-view__header-actions,
    .framework-preview-result__footer,
    .framework-checklist-card__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .framework-view__header-actions .button,
    .framework-preview-result__footer .button,
    .framework-checklist-card__footer .button {
        width: 100%;
    }

    .framework-view__inline-form,
    .framework-tag-rule,
    .framework-rule-card,
    .framework-rule-card__content,
    .framework-preview-result__header,
    .framework-checklist-card__header,
    .framework-checklist-scope header {
        align-items: stretch;
        flex-direction: column;
    }
}.auth-container {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
}

.auth-panel {
    width: 100%;
    max-width: 416px;
}

.auth-title {
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    margin-bottom: 2rem;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form input {
    width: 100%;
}

.full-width {
    width: 100%;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}:root {
    --bg: #f6f9f9;
    --logo-bg: #f6f9f9;
    --hover-bg: #eef3f3;
    --bg-subtle: #ecf0f4;
    --panel: #fcfefe;
    --border: #dde5e5;
    --border-muted: #c8cece;

    --color-completed: #16a34a;
    --color-failed: #dc2626;
    --color-contaminated: #d97706;
    --color-archived: #9ca3af;
    --color-pending: #2563eb;
    --color-in-progress: #4f46e5;

    --text: #1f2a2a;
    --text-hover: #1f2a2a;
    --muted: #333c3c;

    --sidebar-bg: #c8d4d4;
    --sidebar-hover: #b7c6c6;

    --primary: #5f8f8f;
    --primary-hover: #4f7a7a;
    --primary-subtle: #e6efef;

    --neutral-btn: #eef3f3;
    --neutral-btn-hover: #dde5e5;

    --success: #3a8f6b;
    --warning: #ffdc96;
    --danger: #c05757;

    --success-subtle: #e8f5ef;
    --success-subtle-hover: #d3f8e7;
    --warning-subtle: #f7f2e6;
    --danger-subtle: #fbeaea;

    --radius: 8px;
    --hour-height: 24px;

    --shadow:
        0 1px 2px rgb(0 0 0 / 0.05),
        0 4px 12px rgb(0 0 0 / 0.08);

    --shadow-lg:
        0 10px 24px rgb(0 0 0 / 0.10),
        0 24px 48px rgb(0 0 0 / 0.12);
}

*,
*::before,
*::after {
    animation-duration: 0.15s;
    animation-iteration-count: 1;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

[data-theme="dark"] {
    --bg: #0f1414;
    --logo-bg: #f6f9f9;
    --hover-bg: #1c2424;
    --bg-subtle: #263131c4;
    --panel: #151b1b;
    --border: #243030;
    --border-muted: rgba(200, 206, 206, 0.479);


    --color-completed: #22c55e;
    --color-failed: #ef4444;
    --color-contaminated: #f59e0b;
    --color-archived: #6b7280;
    --color-pending: #3b82f6;
    --color-in-progress: #6366f1;

    --text: #d6e2e2;
    --text-hover: #d6e2e2;
    --muted: #8fa3a3;

    --sidebar-bg: #1c2626;
    --sidebar-hover: #263333;

    --primary: #7fa9a9;
    --primary-hover: #6e9696;
    --primary-subtle: #1f2a2a;

    --neutral-btn: #1c2424;
    --neutral-btn-hover: #263131;

    --success: #4fa37e;
    --warning: #b17c00;
    --danger: #d16b6b;

    --success-subtle: #1c2a24;
    --warning-subtle: #2a261c;
    --danger-subtle: #2a1c1c;

    --accent: #6f9c9c;
    --accent-hover: color-mix(in oklab, var(--accent) 85%, white);

    --shadow:
        0 1px 2px rgb(0 0 0 / 0.35),
        0 8px 16px rgb(0 0 0 / 0.45);

    --shadow-lg:
        0 16px 32px rgb(0 0 0 / 0.50),
        0 24px 48px rgb(0 0 0 / 0.65);
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] input[type="week"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: var(--panel);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="week"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

[data-theme="dark"] input[type="number"]::-webkit-inner-spin-button,
[data-theme="dark"] input[type="number"]::-webkit-outer-spin-button {
    filter: invert(1);
}

[data-theme="dark"] input[type="file"]::file-selector-button {
    background: var(--panel-alt);
    color: var(--text);
    border: 1px solid var(--border);
}

[data-theme="dark"] .sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
}

[data-theme="dark"] .sidebar a {
    color: #c7d6d6;
}

[data-theme="dark"] .sidebar a:hover {
    background: var(--sidebar-hover);
}

[data-theme="dark"] .nav-section-label {
    color: #6f8585;
}

[data-theme="dark"] .panel {
    background: var(--panel);
    box-shadow: var(--shadow);
}

[data-theme="dark"] .dashboard-card:hover {
    box-shadow: var(--shadow);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #121818;
    border: 1px solid var(--border);
    color: var(--text);
}

[data-theme="dark"] select:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}


[data-theme="dark"] button,
[data-theme="dark"] a.button {
    background: var(--neutral-btn);
    color: var(--text);
    border: 1px solid var(--border);
}

[data-theme="dark"] button:hover {
    background: var(--neutral-btn-hover);
}

[data-theme="dark"] button.primary {
    background: var(--primary);
    color: #0f1414;
}

[data-theme="dark"] .data-table thead {
    background: #1a2222;
}

[data-theme="dark"] .data-table tr:hover {
    background: #182020;
}

[data-theme="dark"] .styled-table tr:nth-child(even) {
    background-color: #141a1a;
}

[data-theme="dark"] .timeline::before {
    background: #2a3434;
}

[data-theme="dark"] .timeline-event::before {
    box-shadow: var(--shadow);
}


.brand-icon {
    background: var(--logo-bg);
    border-radius: 22px;
}

.toggle-track {
    position: relative;
    width: 48px;
    height: 24px;
    background: var(--neutral-btn);
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    padding: 2px;
}

.toggle-track::before {
    content: "☀️";
    position: absolute;
    left: 24px;
    font-size: 10px;
    color: var(--muted);
    transition: left 0.2s ease, opacity 0.2s ease;
}

[data-theme="dark"] .toggle-track::before {
    content: "🌙";
    left: 8px;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.toggle-track {
    width: 48px;
    height: 24px;
    background: var(--neutral-btn);
    border: 1px solid var(--border);
    border-radius: 1024px;
    display: inline-flex;
    align-items: center;
    padding: 6px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.toggle-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    transition: transform 0.25s ease, background 0.25s ease;
}

[data-theme="dark"] .toggle-track {
    background: #1f2a2a;
}

[data-theme="dark"] .toggle-thumb {
    transform: translateX(16px);
    background: #c8d4d4;
}

.theme-toggle:hover .toggle-track {
    border-color: var(--primary);
}

* {
    box-sizing: border-box;
}

h1 {
    font-size: 1.4rem;
}

h2 {
    font-size: 1.15rem;
}

h3 {
    font-size: 1rem;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    padding-bottom: 3rem;
}


.muted {
    color: var(--muted);
    font-size: 0.85rem;
}

.state.muted {
    background: var(--hover-bg);
    color: var(--muted);
}

header {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
}

nav a:hover {
    text-decoration: none;
}

.clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.clickable:hover {
    background: var(--hover-bg);
}

.badge-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.date-box {
    min-width: 0;
    flex: 1 1 auto;

    margin-bottom: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: .75rem;
    margin: 4px;
    width: 100%;
}

.sample-groups {
    width: 100%;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

body.layout {
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

.sidebar {
    width: 264px;
    flex: 0 0 264px;
}

.main-column {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: auto;
}

#main-content {
    flex: 1 0 auto;
    min-width: 0;
    max-width: 100%;
}

.content {
    flex: 1;
}

.btn-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.site-footer {
    margin-top: auto;
    padding: 0.75rem 1rem;

    background: var(--bg);
    border-top: 1px solid var(--bg-subtle);

    font-size: 0.8rem;
    color: var(--text);

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1.2rem;
    width: 100%;
}

.site-footer p {
    margin: 0;
}

.site-footer a {
    color: inherit;
}

.panel {
    margin-bottom: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.panel .panel .panel {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    box-shadow: none;
    background: color-mix(in srgb, var(--panel) 92%, transparent);
}

.panel>h1,
.panel>h2 {
    margin-bottom: 0.75rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-narrow {
    max-width: 516px;
    margin: 0 auto;
}


.callout-info {
    background: #f3f6ff;
    border: 1px solid #dbe2ff;
}

.callout-success {
    background: #f3fff7;
    border: 1px solid #cdeed9;
}

.small {
    font-size: 0.85rem;
}

.center {
    text-align: center;
}

/* Base button */
.button.secondary.pulse {
    position: relative;
}

/* Optional stronger glow on hover */
.button.secondary.pulse:hover {
    box-shadow: var(--shadow);
}

@keyframes softPulse {
    0% {
        box-shadow: var(--shadow);
    }

    50% {
        box-shadow: var(--shadow);
    }

    100% {
        box-shadow: var(--shadow);
    }
}

button,
a.button {
    display: inline-block;
    background: var(--neutral-btn);
    cursor: pointer;
    font-weight: bolder;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

button:hover,
a.button:hover {
    background: var(--neutral-btn-hover);
    border-color: #d1d5db;
}


a.button.action {
    background: var(--muted);
    color: var(--panel);
    border: none;
}


button .primary,
button.primary,
a.button.primary {
    background: var(--primary);
    color: var(--primary-subtle);
    border: none;
}

button.primary:hover,
a.button.primary:hover {
    background: var(--primary-hover);
}

button .success,
button.success,
a.button.success {
    background: var(--success-subtle);
    color: var(--success);
    border: 1px solid #bbf7d0;
}

button.success:hover,
a.button.success:hover {
    background: var(--success-subtle-hover);
    border-color: #86efac;
}

button .failed,
button.failed,
a.button.failed {
    background: var(--danger-subtle);
    color: var(--danger);
    border: 1px solid #f1b0b0;
}

button.danger:hover,
a.button.danger:hover {
    background: #b77800;
}

button.danger,
a.button.danger {
    background: var(--danger);
    color: white;
    border: none;
}

button.danger:hover,
a.button.danger:hover {
    background: #b91c1c;
}


button .contaminated button.contaminated,
a.button.contaminated {
    background: #f4efe3;
    color: #8a6d1d;
    border: none;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.dashboard-subtitle {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.dashboard-section {
    margin-top: 2rem;
}

.legal-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(216px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.dashboard-grid.primary {
    grid-template-columns: repeat(auto-fit, minmax(264px, 1fr));
}

.dashboard-card {
    justify-content: left;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.05s ease, box-shadow 0.1s ease;
}

.dashboard-card:hover {
    box-shadow: var(--shadow);
}

.card-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.card-body strong {
    font-size: 0.95rem;
}

.button-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.panel-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.filters input,
.filters select {
    width: auto;
    min-width: 10rem;
}

.filter-bar {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}

.mobile-header {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
}

.mobile-brand {
    font-weight: 600;
}

@media (max-width: 916px) {
    .mobile-header {
        display: flex;
    }
}

.badge.warning {
    background: var(--warning);
    color: var(--text);
    font-weight: bold;
    border: none;
}

.badge.danger {
    background: var(--danger);
    color: var(--text);
    font-weight: bold;
    border: none;
}

.boxed-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}


.boxed-list>li {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;

    display: flex;
    gap: 0.75rem;

    min-width: 0;
    font-size: 0.85rem;
}


.boxed-list>li:hover {
    background: var(--hover-bg);
}

ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

/* ===== Timeline ===== */
/* SUMMARY LAYOUT */
.timeline-summary {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.summary-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.event-title {
    font-size: 0.95rem;
}

/* META LINKS */
.summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.meta-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
}

/* PREVENT OVERFLOW */
.timeline,
.timeline * {
    max-width: 100%;
    box-sizing: border-box;
}

/* TABLE RESPONSIVENESS */
.audit-diff-table {
    width: 100%;
    border-collapse: collapse;
}

.audit-diff-table td,
.audit-diff-table th {
    word-break: break-word;
    white-space: normal;
}

/* MOBILE TABLE → STACKED */
@media (max-width: 640px) {
    .audit-diff-table thead {
        display: none;
    }

    .audit-diff-table tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid var(--border);
        padding: 0.5rem;
        border-radius: 6px;
    }

    .audit-diff-table td {
        display: block;
        padding: 0.25rem 0;
    }

    .audit-field {
        font-weight: 600;
        font-size: 0.8rem;
        color: var(--muted);
    }
}

/* FILE LIST FIX */
.files li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.files a {
    word-break: break-all;
}

/* ENTITY LIST FIX */
.event-entities li {
    word-break: break-word;
}

/* MARKDOWN EDITOR FIX */
.sample-markdown-editor {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sample-markdown-editor textarea {
    width: 100%;
}

.markdown-preview {
    overflow-x: auto;
}

.panel {
    overflow: hidden;
}

@media (max-width: 640px) {
    .timeline-event {
        margin-bottom: 1rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }

    button {
        width: auto;
    }
}

.timeline {
    list-style: none;
    padding-left: 0;
}

.timeline-event {
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.timeline-event summary {
    cursor: pointer;
    font-weight: 600;
}

.timeline-event details[open] {
    margin-top: 0.5rem;
}

.event-note {
    background: var(--code-bg);
    padding: 0.5rem;
    border-radius: 4px;
    margin: 0.5rem 0;
}

/* ===== Layout ===== */
a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}


.label-with-action {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

@media (max-width: 768px) {
    .label-with-action {
        flex-direction: column;
        align-items: flex-start;
    }
}

main {
    flex: 1;
    padding: 2rem;
    background: var(--bg);
    max-width: 100%;
    width: 100%;
}

@media (max-width: 768px) {
    main {
        padding: 16px;
    }
}

@media (max-width: 916px) {
    main {
        padding: 1rem;
        margin-top: 0;
    }
}

@media (max-width: 916px) {
    main {
        padding-top: 1rem;
    }
}

.sidebar a {
    color: var(--muted);
    font-weight: 500;
}

@media (max-width: 916px) {
    .layout {
        display: block;
    }

}

@media (max-width: 916px) {
    .boxed-list li {
        display: block;
    }

    .panel {
        padding: 3px;
    }


    main {
        padding: 1.25rem;
    }
}

@media (max-width: 916px) {

    body.layout,
    .layout {
        display: block !important;
    }

    .mobile-header {
        display: flex !important;
        position: sticky;
        top: 0;
        z-index: 900;
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;

        width: min(85vw, 316px);
        height: 100dvh;

        z-index: 1100;
        transform: translateX(-100%);
        transition: transform .2s ease;

        background: var(--sidebar-bg);
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(0);
        z-index: 1000;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: rgba(0, 0, 0, .35);
    }

    .sidebar-overlay[hidden] {
        display: none !important;
    }

    .main-column,
    main {
        width: 100% !important;
        min-width: 0;
    }
}

.panel h1,
.panel h2,
.panel h3 {
    margin-top: 0;
}


button.secondary {
    background: var(--primary-subtle);
    color: var(--primary);
}

input,
textarea,
select {
    width: 100%;
    padding: 6px;
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
}

select {
    appearance: none;
    width: 100%;
    text-overflow: ellipsis;
    padding: 14px 42px 14px 16px;

    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);

    background: linear-gradient(145deg, var(--bg-subtle), var(--bg));

    box-shadow: var(--shadow);

    font-size: 16px;
    color: var(--text);

    transition: background-color 0.15s ease, border-color 0.15s ease;
}

select:hover {
    border-color: #9ca3af;
}

select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: var(--shadow);
}

select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}

.select-wrapper {
    position: relative;
    display: inline-block;
}

.select-wrapper::after {
    content: "▾";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 14px;
    color: #6b7280;
}

select option {
    width: 100%;
    max-width: 316px;
    text-overflow: ellipsis;
    padding: 8px;
    color: var(--text);
}

select option:hover {
    background: var(--hover-bg);
}

select option:checked {
    background: var(--success-subtle-hover);
    border-radius: 8px;
    margin: 4px;
}

input[type="checkbox"] {
    width: inherit;
}

textarea {
    resize: vertical;
}

.state {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.state.active {
    background: #ddf4ff;
    color: #0969da;
}

.state.success {
    background: #dafbe1;
    color: #1a7f37;
}

.state.danger {
    background: #ffebe9;
    color: #cf222e;
}

.event-data {
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.event-data th {
    text-align: left;
    padding: 0.25rem 0.5rem;
    color: var(--muted);
    white-space: nowrap;
}

.event-data td {
    padding: 0.25rem 0.5rem;
    font-family: monospace;
}


.markdown {
    font-size: 0.95rem;

}

.markdown h1,
.markdown h2,
.markdown h3 {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.2rem;
}

.markdown code {
    background: var(--code-bg);
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
    font-family: monospace;
}

.markdown pre {
    background: var(--code-bg);
    padding: 0.75rem;
    border-radius: 4px;
    overflow-x: auto;
}

.markdown ul {
    padding-left: 1.25rem;
}

.markdown blockquote {
    border-left: 3px solid var(--border);
    padding-left: 0.75rem;
    color: var(--muted);
}

.sample-row {
    color: var(--text);
    display: block;
    text-decoration: none;
    color: inherit;
}

.sample-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sample-name {
    font-size: 0.9rem;
}

.sample-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.sample-list li:hover {
    background: var(--hover-bg);
}

.sample-markdown-editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.markdown-editor[data-mode="edit"] .preview-pane {
    display: none;
}

.markdown-editor[data-mode="preview"] .editor-pane {
    display: none;
}

.editor-toolbar {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.markdown-preview {
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 4px;
    background: var(--panel);
    white-space: pre-wrap;
}

.action-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.domain-tissueculture {
    background: #1f6feb;
}

.domain-mushroom {
    background: #8250df;
}

.domain-agrobacterium {
    background: #2da44e;
}

.action-btn {
    border: none;
    border-radius: 6px;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
}

.action-btn:hover {
    filter: brightness(1.1);
}

.action-btn.danger {
    background: #cf222e !important;
}

.action-btn:focus {
    outline: 2px solid #0969da;
    outline-offset: 2px;
}

.action-btn::after {
    content: attr(data-key);
    margin-left: 0.4rem;
    opacity: 0.6;
    font-size: 0.7rem;
}

.action-panel {
    border-left: 4px solid var(--color-accent);
}


.inline-form.subtle {
    margin-top: 0.5rem;
    opacity: 0.85;
}

.inline-form.subtle:hover {
    opacity: 1;
}

.boxed-list.compact li {
    padding: 0.25rem 0;
}

.severity-low {
    background: #e0f2fe;
    color: #075985;
}

.severity-medium {
    background: #fef3c7;
    color: #92400e;
}

.severity-high {
    background: #fee2e2;
    color: #991b1b;
}


.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 264px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: width 0.2s ease, transform 0.2s ease;
    z-index: 20;
}

.sidebar a {
    color: #2f3e3e;
}

.sidebar a:hover {
    background: var(--sidebar-hover);
}

.nav-section-label {
    color: #5f6f6f;
}

@media (max-width: 500px) {

    .dashboard-grid,
    .dashboard-grid.primary {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 85vw;
        max-width: 316px;
    }

    .protocol-step .step-config {
        grid-template-columns: 1fr;
    }

    .protocol-steps .protocol-step {
        padding: 2px;
    }

    button,
    a.button {
        margin-top: 4px;
        margin-left: 2px;
    }

    .panel h1,
    .panel h2,
    .panel h3 {
        margin-top: 0;
        padding-left: 5px;
        padding-top: 4px;
    }
}

@media (max-width: 916px) {
    .layout {
        display: block;
    }

    main {
        width: 100%;
    }
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-user,
.sidebar.collapsed a span {
    display: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text);
    padding: 0.25rem 0.5rem;

    font-weight: 700;
}

.sidebar-nav {
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.75rem;
}


.centered {
    text-align: center;
}

.justify-centered {
    justify-self: center;
    min-width: 480px;
    padding: 4px;
}

@media (max-width: 480px) {
    .justify-centered {
        justify-self: center;
        min-width: 316px;
    }
}

@media (max-width: 680px) {
    .justify-centered {
        justify-self: center;
        min-width: 360px;
    }
}

@media (min-width: 1800px) {
    .justify-centered {
        justify-self: center;
        min-width: 516px;
    }
}

.nav-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0.5rem 0;
}

.sidebar a {
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
}

.nav-meta {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}


.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}


.item-main {
    flex: 1;
    font-size: 0.9rem;
}

.toggle-group {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
}

/* Hide radios only inside toggle */
.toggle-group input[type="radio"] {
    display: none;
}

/* Style only toggle labels */
.toggle-group label {
    flex: 1;
    text-align: center;
    padding: 0.6rem 1rem;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}


.toggle-group label:hover {
    background: var(--hover-bg);
}

.toggle-group input[type="radio"]:checked+label {
    background: var(--bg-subtle);
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.toggle-group input {
    display: none;
}

.toggle-group label {
    flex: 1;
    color: var(--muted);
}

.toggle-group label:has(input:checked) {
    background: var(--bg);
    color: var(--text);
    border-color: rgba(134, 239, 172, 0.75);
    outline: 2px solid rgba(134, 239, 172, 0.25);
    box-shadow: none;
}

.field-hint {
    font-size: 0.75rem;
    margin-top: -0.5rem;
    margin-bottom: 0.75rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.filters.inline-form {
    display: grid;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;

    padding: 6px;
    border-radius: 6px;
    border: 1px solid #e3e6eb;
}

.inline-form .field-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.inline-form label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
    margin-right: 0.25rem;
    white-space: nowrap;
}

.inline-form input,
.inline-form select {
    min-width: 7.5rem;
    padding: 0.35rem 0.5rem;
    margin: 0;

    font-size: 0.9rem;
}

.inline-form .button.danger {
    margin-left: auto;
}

.inline-form .divider {
    width: 1px;
    height: 1.5rem;
    background: var(--panel);
}

.bulk-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.bulk-actions label {
    font-size: 0.85rem;
    color: var(--muted);
}

.app-header {
    background: var(--text);
    border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    max-width: 1200px;
    margin: 0 auto;
}

.strong {
    font-weight: bold;
}

.brand-link {
    display: flex;
    align-items: center;
    /* vertical centering */
    gap: 0.5rem;
}

.brand-link span {
    line-height: 1;
}

.brand-link span {
    margin-top: 2px;
    font-weight: bold;
}

.main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.nav-group-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6b7280;
    margin-right: 0.25rem;
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-right a {
    cursor: pointer;
}

.nav-right button {
    background: transparent;
    border: none;
}

.nav-right button,
.nav-right a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.nav-right svg {
    display: block;
}

.nav-greeting {
    font-size: 0.875rem;
    color: #374151;
    margin-right: 0.5rem;
}

.badge.state {
    font-weight: 600;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.75rem;
}

.vertical-margin {
    margin-top: 4px;
    margin-bottom: 4px;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    margin: 4px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    max-height: 22px;
}

.state-pending {
    background: var(--primary-subtle);
    color: var(--primary);
}

.state-in_progress {
    background: var(--bg);
    color: var(--color-in-progress);
}

.state-completed {
    background: var(--success-subtle);
    color: var(--success);
}

.state-contaminated,
.state-failed {
    background: var(--danger-subtle);
    color: var(--danger);
}

.run-pending {
    background: var(--bg);
    color: #9a3412;
}

.run-in_progress {
    background: var(--bg);
    color: #854d0e;
}

.run-completed {
    background: var(--bg);
    color: #166534;
}

.badge.overdue {
    background: #dc2626;
    color: white;
    font-weight: 600;
}

.alert-badge {
    position: relative;
}

.provider-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-left: 5px;
}

.provider-actions form {
    margin: 0;
}

.provider-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.provider-info span.muted {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.provider-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.provider-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.provider-actions form {
    margin: 0;
}

.badge-red {
    background: var(--danger-subtle);
    color: var(--danger);
}

.badge-yellow {
    background: var(--warning-subtle);
    color: var(--text);
}

.badge-warning {
    background: var(--warning);
}

.badge-muted {
    background: var(--bg-subtle);
    color: var(--muted);
}

.badge-critical {
    background: var(--danger);
    color: var(--text);
}

.check-all {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
}

.check-all input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.check-all input[type="checkbox"] {
    accent-color: #2563eb;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 2rem;
}

.report-subtitle {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}


.badge-finalized {
    background: #d1fae5;
    color: #065f46;
}

.metric {
    font-size: 1.8rem;
    font-weight: bold;
}

.metric.warning {
    color: #d97706;
}

.metric.danger {
    color: #dc2626;
}

.metric.small {
    font-size: 0.9rem;
}

.progress-bar {
    position: relative;
    width: 116px;
    height: 6px;
    background: var(--bg-subtle);
    border-radius: 999px;
    overflow: hidden;
}

.mini-bar {
    background: #f5f5f5;
    height: 4px;
    margin-top: 4px;
    border-radius: 2px;
}

.mini-fill {
    background: #888;
    height: 100%;
    border-radius: 2px;
}


.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
    transform-origin: left;
    animation: growBar 0.6s ease-out;
}

@keyframes growBar {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

.progress-completed {
    background-color: #22c55e;
}

.progress-failed {
    background-color: #ef4444;
}

.progress-contaminated {
    background-color: #a855f7;
}

.progress-archived {
    background-color: #9ca3af;
    opacity: 0.7;
    filter: grayscale(20%);
}

.progress-pending {
    background-color: #f59e0b;
}

.progress-checklist {
    background-color: #3b82f6;
}

.progress-promoted {
    background-color: #10b981;
}

.progress-protocol {
    background-color: #6366f1;
}

.progress-fill:hover {
    filter: brightness(1.1);
}

.progress-bar.stacked .progress-fill:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.4);
}

.progress-fill.warning {
    background: var(--warning);
}

.progress-fill.danger {
    background: var(--danger);
}

.risk-indicator {
    font-size: 2rem;
    font-weight: bold;
}

.tag-container {
    margin-top: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    margin: 4px 6px 0 0;
    background: var(--primary-subtle);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--text);
}

.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.tag-option input {
    display: none;
}

.tag-option .tag {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    transition: left 0.2s ease, opacity 0.2s ease;
}

.tag-option:hover .tag {
    background: var(--hover-bg);
    border-color: var(--primary);
}

.tag-option input:checked+.tag {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tag.muted {
    background: var(--danger-subtle);
    color: var(--danger);
    border-color: var(--danger);
}

.tag-option input:checked+.tag.muted {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.tag-option input:checked+.tag {
    transform: scale(1.05);
}

.tag.gmo {
    background: var(--success-subtle);
    color: var(--text);
}

.tag.bsl {
    background: var(--warning-subtle);
    color: var(--text);
}

.styled-table {
    border-collapse: collapse;
    width: 100%;
    font-family: Arial, sans-serif;
}

.tag.pathogen {
    background: var(--danger-subtle);
    color: var(--text);
}

.styled-table th,
.styled-table td {
    padding: 8px 12px;
    text-align: left;
}


.table-wrapper {
    overflow-x: auto;
}

.styled-table tr:nth-child(even) {
    background-color: var(--bg-subtle);
}

.styled-table tr:hover {
    background-color: var(--hover-bg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem;
    width: 100%;
    border-collapse: collapse;
}

.data-table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.data-table tr:hover {
    background: var(--hover-bg);
}

.data-table th,
.data-table td {
    padding: 0px 12px 0px 14px;
    text-align: left;
}

.data-table thead {
    background: var(--bg);
    color: var(--text);
}

.data-table tr {
    border-bottom: 1px solid var(--border);
}

.actions-col {
    width: 1%;
    white-space: nowrap;
}

@media (max-width: 768px) {

    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 16px;
        padding: 14px;
        border-radius: 12px;
        box-shadow: var(--shadow);
    }

    .data-table td {
        display: flex;
        align-items: center;
        padding: 8px 0;
        border: none;
    }

    .data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        margin-right: 12px;
    }

}

.inline-form.compact {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.inline-form.compact select {
    min-width: 7rem;
}


.badge.success {
    background: #e6f6ec;
    color: #1e7f4f;
}

.badge.muted {
    background: var(--bg);
    color: var(--muted);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.copy-input {
    width: 100%;
    font-family: monospace;
    font-size: 0.8rem;
}

.action-buttons {
    display: flex;
    gap: 0.4rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

.details-panel {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 1rem;
    cursor: pointer;
}

details.panel {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 1rem;
}

details.panel>summary {
    cursor: pointer;
    list-style: none;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

details.panel>summary::-webkit-details-marker {
    display: none;
}

details.panel>summary::after {
    content: "▸";
    transition: transform 0.2s ease;
}

details.panel[open]>summary::after {
    transform: rotate(90deg);
}

.panel-body {
    padding: 1rem;
}

summary.title {
    font-size: 1.4rem;
}

summary .hint {
    font-size: 0.85em;
    opacity: 0.6;
}

#sequence_viewer {
    transition: opacity 0.2s ease;
}

#sequence-placeholder {
    padding: 1rem;
    font-style: italic;
    color: var(--muted);
}


details.panel.nested {
    margin-left: 1rem;
}

[hidden] {
    display: none !important;
}

.hidden {
    display: none !important;
}


.error-panel {
    max-width: 716px;
    margin: 3rem auto;
    text-align: center;
}

.error-panel h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.error-panel .error-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.panel.subtle {
    background: var(--panel-muted-bg);
}

.panel.sequence-viewer {
    width: 100%;
}

.nowrap {
    white-space: nowrap;
}

.danger-zone {
    border: 1px solid #fca5a5;
    background: #fff5f5;
}


.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(216px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.info-card {
    background: var(--panel-muted);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.info-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted);
}

.info-card .value {
    font-weight: 500;
    margin-top: 0.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0.75rem 1rem;
    margin-top: 1rem;
}

.callout {
    background: var(--panel-muted);
    border-left: 4px solid var(--primary);
    padding: 1rem;
    border-radius: 4px;
}

.ui-overlay {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 416px;
}

.ui-overlay-card {
    background: var(--panel);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    position: relative;
}

.ui-overlay-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ui-overlay-body {
    font-size: 0.95rem;
    line-height: 1.4;
}

.ui-overlay-actions {
    margin-top: 0.75rem;
}

.ui-overlay-close {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--muted);
}

/* Variants */
.ui-error {
    border-left: 5px solid #e5533d;
}

.ui-warning {
    border-left: 5px solid #f0b429;
}

.ui-info {
    border-left: 5px solid #4c6ef5;
}

.ui-success {
    border-left: 5px solid #2f9e44;
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--bg);
}

.timeline-event {
    position: relative;
    padding-left: 50px;
    margin-bottom: 1.5rem;
}

.timeline-event::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4b6fff;
    border: 3px solid var(--border);
    box-shadow: var(--shadow);
}

.timeline-event summary {
    cursor: pointer;
    font-weight: 600;
}

.event-entities {
    margin-top: 0.5rem;
    margin-left: 0;
    padding-left: 1rem;
}

.event-note {
    margin-top: 0.5rem;
}

/* file section spacing */
.timeline-event details.panel {
    margin-top: 0.75rem;
}

.timeline-event[data-event="sterilize"]::before {
    background: #4b6fff;
}

.timeline-event[data-event="inoculate"]::before {
    background: #20a464;
}

.timeline-event[data-event="fail"]::before {
    background: #d94a4a;
}

.timeline-event[data-event="contaminate"]::before {
    background: #d94a4a;
}

.timeline-event[data-event="archive"]::before {
    background: #777;
}

.timeline-event[data-event="initialize"]::before {
    background: #888;
}

.has-tooltip {
    position: relative;
}

.has-tooltip::after {
    content: attr(data-tooltip);

    position: absolute;
    bottom: 110%;
    left: 0;

    background: #222;
    color: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.35;
    white-space: pre-wrap;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(4px);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        visibility 0.15s ease;

    width: max-content;
    max-width: 250px;
    z-index: 1000;
}

.has-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.policy-action-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-muted);
}

.policy-action-label {
    font-weight: 500;
}

.policy-action-result {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.policy-action-card {
    padding: 14px;
    border: 1px solid var(--border-muted);
    border-radius: 10px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.policy-action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.policy-action-title {
    font-weight: 600;
}

.policy-action-status {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.policy-approval-detail {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.framework-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.policy-rule-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.danger-outline {
    border: 1px solid var(--color-danger, #dc2626);
    background: rgba(220, 38, 38, 0.06);
}

.danger-outline:hover {
    border-color: var(--color-danger, #dc2626);
    box-shadow: var(--shadow);
}

.rule-pill {
    border: 1px solid var(--border-muted);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--bg-subtle);
    min-width: 140px;
}

.rule-pill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.rule-pill-body {
    display: flex;
    gap: 6px;
}

.event-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-muted);

    transition: background 0.15s ease;
}

.event-item:hover {
    background: var(--hover-bg);
}

.event-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.event-sample {
    font-weight: 600;
}

.event-state {
    font-family: var(--font-mono, monospace);
    opacity: 0.75;
}

.event-right {
    font-size: 12px;
    opacity: 0.7;
}

@media (min-width: 768px) {
    .event-item {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 16px;
    }

    .event-left {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .event-right {
        justify-self: end;
        white-space: nowrap;
    }
}

.dashboard-section {
    width: 100%;
}


.stack.small {
    gap: 10px;

    width: 100%;
}

.batch-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;

    cursor: pointer;
    padding: 10px 12px;
}

.batch-summary-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Remove default ugly summary arrow spacing */
details>summary {
    list-style: none;
}

details>summary::-webkit-details-marker {
    display: none;
}

.batch-summary::after {
    content: "▾";
    margin-left: auto;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

details[open] .batch-summary::after {
    transform: rotate(180deg);
}

.icon-button {
    background: transparent;
    border: none;
}

.usage-list {
    margin-top: 10px;
}

.usage-block {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.usage-header {
    margin-bottom: 6px;
}

.usage-body {
    padding-left: 6px;
}

.usage-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.usage-step {
    display: flex;
    gap: 6px;
    align-items: center;
}

.badge.subtle {
    background: var(--bg-subtle);
    color: var(--muted);
}

.date-display {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.2;
}

.date-display .primary {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.date-display .secondary {
    font-size: 0.75rem;
    color: var(--muted);
}

.date-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.date-inline .secondary {
    opacity: 0.6;
    font-size: 0.8em;
}

.tz-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    margin-left: 0.25rem;
}

.date-display::after {
    content: attr(data-relative);
    display: block;
    font-size: 0.7rem;
    color: var(--color-accent);
    margin-top: 2px;
}

.date-display,
.date-inline {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.02em;
}

.date-display {
    padding-left: 0.4rem;
    border-left: 2px solid var(--border);
}

.emoji-icon {
    bottom: -2px;
    position: relative;
}

.add_emoji {
    display: inline-block;

    transform: rotate(45deg);

    transition:
        transform 220ms ease,
        opacity 220ms ease;

    animation: rotate-in 220ms ease forwards;
}

@keyframes rotate-in {
    from {
        transform: rotate(0deg);
        opacity: 0.7;
    }

    to {
        transform: rotate(45deg);
        opacity: 1;
    }
}

[id],
[data-anchor-target] {
    scroll-margin-top: 6rem;
}

.code-block {
    white-space: pre-wrap;
}

.anchor-highlight {
    outline: 2px solid rgba(120, 255, 160, 0.6);
    animation: none;
}

@keyframes anchorFlash {
    0% {
        background: rgba(120, 255, 160, 0.35);
    }

    100% {
        background: transparent;
    }
}

.reviewable-groups {
    display: grid;
    gap: 1rem;
}

.reviewable-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    overflow: hidden;
}

.reviewable-card-summary {
    cursor: pointer;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.reviewable-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: color-mix(in srgb, var(--panel) 88%, var(--accent) 12%);
    border-bottom: 1px solid var(--border);
}

.reviewable-actions {
    display: flex;
    gap: 0.5rem;
}

.reviewable-table {
    display: grid;
}

.reviewable-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.reviewable-row:last-child {
    border-bottom: 0;
}

.reviewable-name {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.reviewable-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-verification {
    padding-bottom: 4px;
}

.print-btn {
    margin-bottom: 4px;
}

select:disabled {
    background-color: var(--surface-muted, #f3f4f6);
    color: var(--muted);
    border-color: var(--border-muted, #d1d5db);
    cursor: not-allowed;
    opacity: 1;
}

select:disabled option {
    background-color: var(--surface-muted, #f3f4f6);
    color: var(--muted);
}

select:disabled option:checked {
    background-color: var(--surface-disabled-selected, #e5e7eb);
    color: var(--muted);
}/* Completed batches get a calmer bar */
.batch-header {
    padding: clamp(1rem, 2vw, 1.5rem);
}

.batch-header-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 1.5rem;
}

.batch-header-main {
    min-width: 0;
}

.batch-heading {
    display: grid;
    gap: 0.35rem;
}

.batch-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.batch-title-row h1 {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.batch-state-badge {
    flex: 0 0 auto;
}

.batch-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    color: var(--muted);
}

.batch-species-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

.batch-species-link:hover {
    color: var(--link-color, currentColor);
    text-decoration: underline;
}

.batch-timestamps {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.batch-timestamp {
    display: grid;
    gap: 0.1rem;
    min-width: 9rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border, #dfe3e8);
    border-radius: 0.55rem;
    background: var(--bg, #f8fafc);
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.batch-timestamp-label {
    color: var(--text, #1f2937);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.batch-timestamp-success {
    border-color: color-mix(in srgb,
            var(--success-color, #15803d) 30%,
            transparent);
}

.batch-timestamp-success .batch-timestamp-label {
    color: var(--success-color, #15803d);
}

.batch-timestamp-danger {
    border-color: color-mix(in srgb,
            var(--danger-color, #b42318) 30%,
            transparent);
}

.batch-timestamp-danger .batch-timestamp-label {
    color: var(--danger-color, #b42318);
}

.batch-regulatory-badges {
    margin-top: 0.9rem;
}

.batch-header-actions {
    width: min(16rem, 100%);
    padding-left: 1.25rem;
    border-left: 1px solid var(--border, #dfe3e8);
}

.batch-action-heading {
    margin-bottom: 0.45rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.batch-action-list {
    display: grid;
    gap: 0.4rem;
}

.batch-action-form {
    margin: 0;
}

.batch-action-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 2.35rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.84rem;
    text-align: left;
}

.batch-action-button .shortcut {
    flex: 0 0 auto;
    opacity: 0.7;
}

.batch-action-status {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem;
    border: 1px solid var(--border, #dfe3e8);
    border-radius: 0.55rem;
    background: var(--bg, #f8fafc);
    font-size: 0.82rem;
}

.batch-action-status div {
    display: grid;
    gap: 0.1rem;
}

.batch-action-status span:last-child {
    color: var(--muted);
}

.batch-action-status-icon {
    line-height: 1.2;
}

@media (max-width: 800px) {
    .batch-header-content {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .batch-header-actions {
        width: 100%;
        padding-top: 0.85rem;
        padding-left: 0;
        border-top: 1px solid var(--border, #dfe3e8);
        border-left: 0;
    }

    .batch-action-list {
        display: flex;
        align-items: stretch;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        scrollbar-width: thin;
    }

    .batch-action-form {
        flex: 0 0 auto;
    }

    .batch-action-button {
        width: auto;
        min-width: max-content;
    }
}

@media (max-width: 520px) {
    .batch-header {
        padding: 1rem;
    }

    .batch-title-row {
        align-items: flex-start;
    }

    .batch-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .batch-timestamps {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .batch-timestamp {
        min-width: 0;
    }

    .batch-action-list {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        overflow: visible;
    }

    .batch-action-form,
    .batch-action-button {
        width: 100%;
    }
}

.batch-header+.action-panel {
    margin-top: 1rem;
}

.batch-state {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.batch-samples {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.batch-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.batch-row.is-completed .progress-fill {
    background: #10b981;
}

.batch-sample {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 0.75rem;

    padding: 0.6rem 0.75rem;
    border: 1px solid var(--bg);
    border-radius: 6px;
}

.batch-sample:hover {
    background: var(--hover-bg);
}

.batch-sample strong {
    font-weight: 600;
}

.batch-sample input[type="checkbox"] {
    margin-right: 0.25rem;
}

.batch-sample.active {
    border-left: 4px solid #1f6feb;
}

.batch-sample.failed,
.batch-sample.contaminated {
    border-left: 4px solid #cf222e;
}

.batch-sample.archived {
    opacity: 0.6;
}

.batch-sample .state.danger {
    background: #ffebe9;
}

.batch-sample .state.muted {
    background: #eaeef2;
}

.batch-row {
    display: block;
    text-decoration: none;
    color: inherit;
}

.batch-row.is-completed {
    opacity: 0.55;
}

.batch-row.is-completed:hover {
    opacity: 0.75;
}

.batch-row.has-overdue {
    border-left: 4px solid #dc2626;
    padding-left: 12px;
}

.badge.overdue {
    background: #fee2e2;
    color: #991b1b;
    font-weight: 600;
}

.batch-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.batch-name {
    font-size: 0.9rem;
}

.batch-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.batch-list li:hover {
    background: var(--hover-bg);
}


.batch-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.promoted-sample {
    padding: 12px;
    text-align: center;
    width: fit-content;
}

.batch-timestamps {
    display: inline-flex;
}

@media (max-width: 640px) {
    .batch-timestamps {
        display: grid;
    }
}

.execution-steps {
    display: grid;
    gap: 1rem;
    padding-left: 0;
    list-style: none;
}

.step-card {
    border: 1px solid var(--bg);
    border-radius: 1rem;
    padding: 1rem;
    background: var(--bg);
}

.step-card.completed {
    opacity: 0.82;
}

.step-card.overdue {
    border-color: var(--danger);
}

.step-card.blocked {
    background: var(--bg-subtle);
}

.step-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.step-card-header h3 {
    margin: 0.2rem 0 0;
}

.eyebrow,
.label {
    font-size: 0.8rem;
    color: var(--muted);
}

.step-status-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.step-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.summary-tile,
.step-panel {
    border: 1px solid var(--bg-subtle);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
}

.summary-tile {
    display: grid;
    gap: 0.25rem;
}

.step-body {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
    gap: 1rem;
}

.step-panel.primary {
    min-width: 0;
}

.detail-list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
}

.detail-list div {
    display: grid;
    gap: 0.15rem;
}

.detail-list dt {
    font-size: 0.8rem;
    color: var(--muted, var(--muted));
}

.detail-list dd {
    margin: 0;
}

.material-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 1rem;
}

.compact-list {
    margin: 0.35rem 0 0;
    padding-left: 1.2rem;
}

.callout {
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin: 0.75rem 0;
}

.callout.warning {
    background: var(--bg);
    border: 1px solid var(--danger-subtle);
}

.expected-outcome {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bg);
}

.json-preview {
    overflow-x: auto;
    white-space: pre-wrap;
    font-size: 0.85rem;
}

.step-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bg);
}

@media (max-width: 800px) {

    .step-card-header,
    .step-body {
        display: grid;
        grid-template-columns: 1fr;
    }

    .step-status-stack {
        justify-content: flex-start;
    }
}

.qr-sample-picker {
    display: grid;
    gap: 1rem;
}

.qr-sample-picker-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.qr-sample-picker-header h4 {
    margin: 0;
}

.qr-sample-picker-header p {
    margin: 0.25rem 0 0;
}

.qr-sample-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.qr-sample-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.9rem 1rem;
    border: 1px solid var(--bg);
    border-radius: 1rem;
    background: var(--bg);
    cursor: pointer;
}

.qr-sample-card:hover {
    border-color: var(--color-pending);
    background: var(--bg-subtle);
}

.qr-sample-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.qr-sample-card-body {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
    flex: 1;
}

.qr-sample-name {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.qr-sample-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.qr-sample-meta strong {
    overflow-wrap: anywhere;
}

.qr-sample-check-ui {
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
    border: 1px solid var(--bg);
    border-radius: 0.4rem;
    background: var(--bg);
}

.qr-sample-card input:checked~.qr-sample-check-ui {
    border-color: var(--color-pending);
    background: var(--color-pending);
}

.qr-sample-card input:checked~.qr-sample-check-ui::after {
    content: "✓";
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
}

.qr-sample-card:has(input:checked) {
    border-color: var(--color-pending);
    background: var(--bg-subtle);
}

@media (max-width: 760px) {
    .qr-sample-grid {
        grid-template-columns: 1fr;
    }
}

.button-glow {
    border: 1px solid #d8a900;
    background: #ffd84d;
    color: #2a2100;
    box-shadow: 0 0 0 2px rgba(255, 216, 77, 0.35);
}.batch-filters,
.sample-filters {
    display: grid;
    grid-template-columns:
        minmax(14rem, 2fr) minmax(10rem, 1fr) minmax(10rem, 1fr);
    gap: 1rem;
    align-items: end;
}

.batch-filters .filter-field,
.sample-filters .filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.batch-filters .filter-field>label,
.batch-filters legend,
.sample-filters .filter-field>label,
.sample-filters legend {
    font-size: 0.8rem;
    font-weight: 600;
}

.batch-filters input,
.batch-filters select,
.sample-filters input,
.sample-filters select {
    width: 100%;
}

.batch-filters .filter-group,
.sample-filters .filter-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.batch-filters .filter-date-range,
.sample-filters .filter-date-range {
    display: grid;
    grid-template-columns: repeat(2, minmax(8rem, 1fr));
    gap: 0.75rem;
}

.batch-filters .filter-actions,
.sample-filters .filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 1000px) {

    .batch-filters,
    .sample-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .batch-filters .filter-search,
    .sample-filters .filter-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {

    .batch-filters,
    .sample-filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .batch-filters .filter-search,
    .batch-filters .filter-group,
    .sample-filters .filter-search,
    .sample-filters .filter-group {
        grid-column: auto;
    }

    .batch-filters .filter-date-range,
    .sample-filters .filter-date-range {
        grid-template-columns: minmax(0, 1fr);
    }

    .batch-filters .filter-actions,
    .sample-filters .filter-actions {
        flex-wrap: wrap;
    }
}.checklist-list li {
    padding: 0.75rem 1rem;
    transition: background 0.15s ease, transform 0.05s ease;
}

.checklist-list li:hover {
    background: var(--hover-bg);
    transform: translateY(-1px);
}

.checklist-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checklist-name {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.checklist-name:hover {
    text-decoration: underline;
}

.checklist-meta {
    font-size: 0.8rem;
    white-space: nowrap;
}

.checklist-section {
    margin-top: 1.5rem;
}

.checklist-add {
    padding-top: 1.25rem;
    border-top: 1px dashed var(--bg);
}

.checklist-subtitle {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.checklist-items li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.checklist-items li.done {
    background: var(--hover-bg);
    opacity: 0.75;
}

.checklist-item-desc {
    font-size: 0.9rem;
}

.file-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
    min-width: 0;
}

.file-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    min-width: 0;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-muted);
    color: inherit;
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.2;
}

.file-pill:hover {
    background: var(--surface-hover);
    text-decoration: none;
}

.file-pill-icon {
    flex: 0 0 auto;
    font-size: 0.9rem;
}

.file-pill-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checklist-reference-files {
    margin-top: 0.75rem;
}

@media (max-width: 640px) {
    .checklist-framework-header {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .checklist-framework-header .tag-list {
        justify-content: flex-start;
    }

    .file-pill-list {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    .file-pill {
        width: 100%;
        border-radius: 0.75rem;
        padding: 0.55rem 0.7rem;
    }

    .checklist-complete-form {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .checklist-complete-form .button {
        width: 100%;
    }

    .file-picker {
        width: 100%;
    }
}

.framework-list {
    list-style: none;
    margin: .5rem 0 0;
    padding: 0;

    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.framework-list li {
    margin: 0;
}

.framework-list a {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    text-decoration: none;
    color: inherit;
}

.framework-list a::before {
    content: "🟢";
    flex: 0 0 auto;
}

.framework-list a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .framework-list a {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}.compliance-dashboard {
    --compliance-border: var(--border);
    --compliance-surface: var(--panel);
    --compliance-subtle: var(--bg-subtle);
    --compliance-text: var(--text);
    --compliance-muted: var(--muted);
    --compliance-accent: var(--primary);

    display: grid;
    gap: 1.25rem;
}

.compliance-dashboard .compliance-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    overflow: hidden;
    position: relative;
}

.compliance-dashboard .compliance-hero::after {
    position: absolute;
    top: -6rem;
    right: -4rem;
    width: 18rem;
    height: 18rem;
    border: 1px solid var(--compliance-border);
    border-radius: 50%;
    content: "";
    opacity: 0.35;
    pointer-events: none;
}

.compliance-dashboard .compliance-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 52rem;
}

.compliance-dashboard .eyebrow,
.compliance-dashboard .compliance-section-kicker {
    margin-bottom: 0.4rem;
    color: var(--compliance-accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.compliance-dashboard .compliance-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
}

.compliance-dashboard .compliance-hero-description {
    max-width: 48rem;
    margin: 0.85rem 0 0;
    color: var(--compliance-muted);
    font-size: 1rem;
    line-height: 1.65;
}

.compliance-dashboard .compliance-hero-actions,
.compliance-dashboard .compliance-section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.compliance-dashboard .compliance-hero-actions {
    position: relative;
    z-index: 1;
    justify-content: flex-end;
    min-width: max-content;
}

.compliance-dashboard .danger-outline {
    border-color: var(--danger-color);
    background: transparent;
    color: var(--danger-color);
}

.compliance-dashboard .danger-outline:hover {
    background: var(--danger-color);
    color: var(--button-text-color);
}

.compliance-dashboard .compliance-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.compliance-dashboard .compliance-metric-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem;
    color: inherit;
    text-decoration: none;
    transition:
        border-color 150ms ease,
        transform 150ms ease,
        box-shadow 150ms ease;
}

.compliance-dashboard .compliance-metric-card:hover {
    border-color: var(--compliance-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.compliance-dashboard .compliance-metric-label {
    color: var(--compliance-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.compliance-dashboard .compliance-metric-value {
    color: var(--compliance-text);
    font-size: 2rem;
    line-height: 1;
}

.compliance-dashboard .compliance-metric-description {
    color: var(--compliance-muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.compliance-dashboard .compliance-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 23rem);
    gap: 1.25rem;
    align-items: start;
}

.compliance-dashboard .compliance-main,
.compliance-dashboard .compliance-sidebar {
    display: grid;
    min-width: 0;
    gap: 1.25rem;
}

.compliance-dashboard .compliance-sidebar {
    position: sticky;
    top: 1rem;
}

.compliance-dashboard .compliance-section,
.compliance-dashboard .compliance-sidebar-card {
    padding: 0;
    overflow: hidden;
}

.compliance-dashboard .compliance-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.4rem 1.5rem;
    border-bottom: 1px solid var(--compliance-border);
}

.compliance-dashboard .compliance-section-header h2,
.compliance-dashboard .compliance-sidebar-header h2,
.compliance-dashboard .compliance-help-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

.compliance-dashboard .compliance-section-header p {
    max-width: 46rem;
    margin: 0.45rem 0 0;
    color: var(--compliance-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.compliance-dashboard .compliance-record-list,
.compliance-dashboard .compliance-event-list,
.compliance-dashboard .compliance-setup-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.compliance-dashboard .compliance-record-list>li+.compliance-dashboard .compliance-record-list>li,
.compliance-dashboard .compliance-event-list>li+.compliance-dashboard .compliance-event-list>li {
    border-top: 1px solid var(--compliance-border);
}

.compliance-dashboard .compliance-record-row,
.compliance-dashboard .compliance-event-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.5rem;
    color: inherit;
    text-decoration: none;
    transition: background 120ms ease;
}

.compliance-dashboard .compliance-record-row:hover,
.compliance-dashboard .compliance-event-row:hover {
    background: var(--compliance-subtle);
}

.compliance-dashboard .compliance-record-icon {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--compliance-border);
    border-radius: 0.6rem;
    background: var(--compliance-subtle);
    color: var(--compliance-accent);
    font-size: 0.8rem;
    font-weight: 800;
}

.compliance-dashboard .compliance-record-content,
.compliance-dashboard .compliance-event-content {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 0.3rem;
}

.compliance-dashboard .compliance-record-title-row,
.compliance-dashboard .compliance-event-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.compliance-dashboard .compliance-record-title-row strong,
.compliance-dashboard .compliance-event-title-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compliance-dashboard .compliance-record-description,
.compliance-dashboard .compliance-event-meta {
    color: var(--compliance-muted);
    font-size: 0.83rem;
    line-height: 1.4;
}

.compliance-dashboard .compliance-record-arrow {
    flex: 0 0 auto;
    color: var(--compliance-muted);
    font-size: 1.5rem;
    line-height: 1;
}

.compliance-dashboard .compliance-empty-state {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
}

.compliance-dashboard .compliance-empty-icon {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px dashed var(--compliance-border);
    border-radius: 0.75rem;
    color: var(--compliance-muted);
    font-weight: 800;
}

.compliance-dashboard .compliance-empty-state h3 {
    margin: 0;
    font-size: 0.98rem;
}

.compliance-dashboard .compliance-empty-state p {
    max-width: 42rem;
    margin: 0.4rem 0 0.9rem;
    color: var(--compliance-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.compliance-dashboard .compliance-filter-bar {
    display: grid;
    grid-template-columns:
        minmax(12rem, 1.6fr) repeat(3, minmax(9rem, 1fr)) auto;
    gap: 0.65rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--compliance-border);
    background: var(--compliance-subtle);
}

.compliance-dashboard .compliance-filter-bar label,
.compliance-dashboard .compliance-filter-bar input,
.compliance-dashboard .compliance-filter-bar select {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.compliance-dashboard .compliance-event-row {
    align-items: flex-start;
}

.compliance-dashboard .compliance-event-indicator {
    width: 0.25rem;
    min-height: 3.2rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--compliance-muted);
}

.compliance-dashboard .compliance-event-description {
    display: -webkit-box;
    overflow: hidden;
    color: var(--compliance-text);
    font-size: 0.88rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.compliance-dashboard .compliance-filter-empty {
    padding: 1.5rem;
    color: var(--compliance-muted);
    text-align: center;
}

.compliance-dashboard .compliance-sidebar-card {
    padding: 1.25rem;
}

.compliance-dashboard .compliance-sidebar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.compliance-dashboard .compliance-sidebar-description,
.compliance-dashboard .compliance-help-card p {
    margin: 0 0 1rem;
    color: var(--compliance-muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

.compliance-dashboard .compliance-setup-list {
    display: grid;
    gap: 1rem;
}

.compliance-dashboard .compliance-setup-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    position: relative;
}

.compliance-dashboard .compliance-setup-list li:not(:last-child)::after {
    position: absolute;
    top: 2rem;
    bottom: -1rem;
    left: 0.95rem;
    width: 1px;
    background: var(--compliance-border);
    content: "";
}

.compliance-dashboard .compliance-setup-number {
    display: grid;
    width: 2rem;
    height: 2rem;
    z-index: 1;
    place-items: center;
    border: 1px solid var(--compliance-border);
    border-radius: 50%;
    background: var(--compliance-surface);
    color: var(--compliance-muted);
    font-size: 0.75rem;
    font-weight: 800;
}

.compliance-dashboard .compliance-setup-list li.complete .compliance-setup-number {
    border-color: var(--success-color);
    background: var(--success-color);
    color: var(--button-text-color);
}

.compliance-dashboard .compliance-setup-list strong {
    display: block;
    font-size: 0.88rem;
}

.compliance-dashboard .compliance-setup-list p {
    margin: 0.25rem 0 0.3rem;
    color: var(--compliance-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.compliance-dashboard .compliance-setup-list a {
    font-size: 0.78rem;
    font-weight: 700;
}

.compliance-dashboard .compliance-document-upload {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.compliance-dashboard .compliance-document-upload .file-picker {
    margin: 0;
}

.compliance-dashboard .compliance-document-list {
    max-height: 24rem;
    overflow-y: auto;
}

.compliance-dashboard .compliance-sidebar-empty {
    padding: 1rem;
    border: 1px dashed var(--compliance-border);
    border-radius: 0.65rem;
    color: var(--compliance-muted);
    font-size: 0.82rem;
    text-align: center;
}

.compliance-dashboard .full-width {
    width: 100%;
    justify-content: center;
}

@media (max-width: 1100px) {
    .compliance-dashboard .compliance-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compliance-dashboard .compliance-layout {
        grid-template-columns: 1fr;
    }

    .compliance-dashboard .compliance-sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compliance-dashboard .compliance-help-card {
        grid-column: 1 / -1;
    }

    .compliance-dashboard .compliance-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compliance-dashboard .compliance-filter-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {

    .compliance-dashboard .compliance-hero,
    .compliance-dashboard .compliance-section-header {
        flex-direction: column;
    }

    .compliance-dashboard .compliance-hero-actions,
    .compliance-dashboard .compliance-section-actions {
        width: 100%;
    }

    .compliance-dashboard .compliance-hero-actions .button,
    .compliance-dashboard .compliance-section-actions .button {
        flex: 1 1 auto;
        justify-content: center;
    }

    .compliance-dashboard .compliance-sidebar,
    .compliance-dashboard .compliance-metrics,
    .compliance-dashboard .compliance-filter-bar {
        grid-template-columns: 1fr;
    }

    .compliance-dashboard .compliance-filter-search {
        grid-column: auto;
    }

    .compliance-dashboard .compliance-record-row,
    .compliance-dashboard .compliance-event-row,
    .compliance-dashboard .compliance-section-header {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .compliance-dashboard .compliance-record-icon {
        display: none;
    }

    .compliance-dashboard .compliance-event-title-row {
        align-items: flex-start;
        flex-direction: column;
    }
}.concentration-block.concentration_readonly {
    opacity: 0.92;
}

.concentration-block.concentration_readonly input,
.concentration-block.concentration_readonly select {
    cursor: default;
}.error-page {
    min-height: calc(100vh - 12rem);
    display: grid;
    place-items: center;
    padding: 3rem 1rem;
}

.error-card {
    width: min(100%, 42rem);
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--bg);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.error-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    height: 2.5rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    background: var(--warning-bg);
    color: var(--warning-fg);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.error-card h1 {
    margin: 0 0 0.75rem;
}

.error-message {
    max-width: 32rem;
    margin: 0 auto 1rem;
    font-size: 1.05rem;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0 1rem;
}.procurement-estimate .estimate-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    gap: 1rem;
}

.procurement-estimate .estimate-summary::after {
    content: "";
    transition: none;
}

.procurement-estimate .estimate-summary-left {
    min-width: 0;
}

.procurement-estimate .estimate-summary-right {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.4rem;
    white-space: nowrap;
}

.procurement-estimate .estimate-body {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.procurement-estimate .estimate-row {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr) max-content;
    align-items: baseline;
    gap: 0.75rem;
}

.procurement-estimate .estimate-row .label {
    color: var(--muted);
    font-size: 0.9rem;
}

.procurement-estimate .estimate-row .value {
    min-width: 0;
}

.procurement-estimate .estimate-row .secondary {
    justify-self: end;
    white-space: nowrap;
}

.procurement-total {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bg);
}

@media (max-width: 700px) {
    .procurement-estimate .estimate-summary {
        grid-template-columns: 1fr;
    }

    .procurement-estimate .estimate-summary-right {
        justify-content: flex-start;
        flex-wrap: wrap;
        white-space: normal;
    }

    .procurement-estimate .estimate-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .procurement-estimate .estimate-row .secondary {
        justify-self: start;
        white-space: normal;
    }

    .procurement-total {
        justify-content: flex-start;
    }
}

.estimate-body {
    margin-top: 0.5rem;
    display: grid;
    gap: 0.4rem;
}

.estimate-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.estimate-row.total {
    font-weight: 600;
    border-top: 1px solid var(--bg);
    padding-top: 0.4rem;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.procurement-block summary {
    display: flex;
    justify-content: space-between;
}

.estimate-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.estimate-summary-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
}

.estimate-cost {
    font-weight: 600;
}

.estimate-divider {
    opacity: 0.6;
}

.estimate-unit-meta {
    opacity: 0.8;
}

.estimate-body {
    margin-top: 0.5rem;
    display: grid;
    gap: 0.4rem;
}

.estimate-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.estimate-row .label {
    color: var(--muted);
}

.estimate-row.total {
    font-weight: 600;
    border-top: 1px solid var(--bg);
    padding-top: 0.4rem;
}.tools-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tool-group-title {
    font-weight: 600;
    color: #555;
    margin-bottom: 0.25rem;
}

.tool-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;

    padding: 0.35rem 0.65rem;
    border: 1px solid #ddd;
    border-radius: 999px;

    background: #fafafa;
    cursor: pointer;
    font-size: 0.9rem;

    transition: left 0.2s ease, opacity 0.2s ease;
}

.tool-chip input {
    display: none;
}

.tool-chip span {
    pointer-events: none;
}

.tool-chip:hover {
    background: #f0f0f0;
}

.tool-chip:has(input:checked) {
    background: #e6f3ff;
    border-color: #3399ff;
}

.tool-chip:has(input:checked) span {
    font-weight: 600;
}

.timeline-summary {
    cursor: pointer;
    list-style: none;
}

.timeline-summary::-webkit-details-marker {
    display: none;
}

.timeline-summary-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    width: 100%;
}

.timeline-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 2rem;
    padding: 0.35rem 0.75rem;

    border-radius: 999px;
    border: 1px solid var(--border);

    background: var(--bg);
    color: var(--text);

    line-height: 1;
    white-space: nowrap;
}

.timeline-chip-primary {
    background: color-mix(in srgb, var(--accent) 12%, var(--bg));
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    font-weight: 600;
}

.timeline-chip-secondary {
    background: color-mix(in srgb, var(--info) 10%, var(--bg));
}

.timeline-chip-date {
    background: color-mix(in srgb, var(--bg) 92%, black);
    font-size: 0.92rem;
}

.timeline-chip-muted {
    background: color-mix(in srgb, var(--bg) 96%, black);
    color: var(--muted);
    font-size: 0.85rem;
}

.event-title {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* custom form */
.entity-block {
    display: grid;
    gap: 0.75rem;
}

.entity-container {
    display: grid;
    gap: 0.75rem;
}

.entity-card {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg);
}

.entity-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.entity-card label {
    display: grid;
    gap: 0.25rem;
}

.entity-card input,
.entity-card select {
    width: 100%;
    min-width: 0;
}

.entity-concentration-details {
    padding-top: 0.25rem;
}

.entity-concentration-details summary {
    cursor: pointer;
    font-weight: 600;
}

.entity-notes-row {
    max-width: 100%;
}.files {
    list-style: none;
    padding-left: 0;
}

.files li {
    font-family: monospace;
    font-size: 0.85rem;
    border-bottom: 3px solid var(--border);
    border-top: 3px solid var(--border);
}

.file-link {
    border: 1px solid var(--border-muted);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--bg-subtle);
}

.files form {
    display: inline-flex;
}

.selectable-files .file-row {
    padding: 0;
}

.file-row input:checked+* {
    font-weight: 500;
}

.file-row-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    width: 100%;
}

.selectable-files {
    border: 1px solid var(--border);
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.file-row-inner:hover {
    background: var(--hover-bg);
}

.file-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.file-text {
    display: flex;
    flex-direction: column;
}

.file-actions {
    display: flex;
    align-items: center;
}

.file-actions input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

.file-explorer {
    margin-top: 1rem;
}

.file-list {
    list-style: none;
    padding-left: 0;
}

.file-icon {
    text-align: center;
}

.file-actions {
    display: flex;
    gap: 0.25rem;
}

.file-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--bg);
    flex-direction: column;
    align-items: stretch;
}

.file-main {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.file-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.file-name {
    font-weight: 600;
    text-decoration: none;
}

.file-context {
    opacity: 0.8;
}

.file-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* CATEGORY COLORS */
.badge.event {
    background: #1e40af;
    color: white;
}

.badge.compliance {
    background: #7c2d12;
    color: white;
}

.badge.general {
    background: #374151;
    color: white;
}

.badge.evidence {
    background: #065f46;
    color: white;
}

/* SUBTLE BUTTON */
.button.subtle {
    background: transparent;
    border: 1px solid var(--bg);
}

.file-hover-wrapper {
    position: relative;
    display: inline-block;
}

.file-preview {
    display: none;
    position: absolute;
    top: 120%;
    left: 0;
    z-index: 50;

    background: #111;
    padding: 6px;
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.file-preview img {
    max-width: 216px;
    max-height: 216px;
    display: block;
}

.file-preview.pdf iframe {
    width: 264px;
    height: 316px;
    border: none;
}

.file-hover-wrapper:hover .file-preview {
    display: block;
}

.file-picker {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 1rem;
    border: 1px dashed var(--bg);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--bg), var(--bg-subtle));
    cursor: pointer;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
    margin-bottom: 4px;
}

.file-picker:hover {
    border-color: var(--bg);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    background: var(--bg);
}

.file-picker:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.file-picker input[type="file"] {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-picker-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    background: var(--bg-subtle);
    font-size: 1.2rem;
}

.file-picker-main {
    min-width: 0;
    display: grid;
    gap: 0.15rem;
}

.file-picker-title {
    font-weight: 700;
    color: var(--text);
}

.file-picker-meta {
    color: var(--muted);
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.file-meta-grid>div {
    border: 1px solid var(--bg);
    border-radius: 10px;
    padding: 0.75rem;
    background: var(--panel-muted);
}

.file-meta-grid span {
    display: block;
    margin-bottom: 0.25rem;
}

.reference-list {
    display: grid;
    gap: 0.5rem;
}

.reference-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--bg);
    border-radius: 10px;
    background: var(--panel-muted);
}

.success-text {
    color: var(--success);
}.ingredient-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.ingredient-form {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #ddd;
}

.ingredient-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.ingredient-name {
    font-size: 0.9rem;
}

.ingredient-desc {
    font-size: 0.8rem;
}

.ingredient-meta {
    display: flex;
    align-items: center;
}

.ingredient-category {
    font-size: 1.25rem;
    opacity: 0.85;
}

.ingredient-list li:hover {
    background: var(--hover-bg);
}


.ingredients {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.ingredients li {
    font-size: 0.85rem;
    padding: 0.25rem 0;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}/* inventory.css */

.inventory-purchase-page {
    display: grid;
    gap: 1.25rem;
}

.inventory-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.inventory-summary-card {
    min-width: 0;
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--panel);
    display: grid;
    gap: 0.3rem;
}

.inventory-summary-card strong {
    color: var(--text);
    font-size: clamp(1.55rem, 3vw, 2.25rem);
    line-height: 1;
}

.inventory-summary-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.inventory-filters {
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg-subtle);
}

.inventory-filters input[type="search"] {
    flex: 1 1 18rem;
}

.inventory-table td {
    vertical-align: middle;
}

.inventory-none-on-hand {
    color: var(--color-failed);
    font-weight: 650;
}

.table-primary-link {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.table-primary-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.inventory-purchase-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.34fr);
    gap: 1rem;
    align-items: start;
}

.inventory-purchase-help {
    position: sticky;
    top: 1rem;
}

.inventory-workflow-list {
    margin: 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 0.75rem;
    color: var(--muted);
}

.read-only-field {
    min-height: 2.7rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    background: var(--bg-subtle);
    color: var(--text);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 960px) {
    .inventory-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-purchase-layout {
        grid-template-columns: 1fr;
    }

    .inventory-purchase-help {
        position: static;
    }
}

@media (max-width: 620px) {
    .inventory-summary-grid {
        grid-template-columns: 1fr;
    }

    .inventory-filters {
        align-items: stretch;
    }

    .inventory-filters>* {
        width: 100%;
    }
}

.procurement-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0.85rem 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--bg-subtle);
}

.procurement-inventory-status {
    font-size: 0.88rem;
    font-weight: 600;
}

.procurement-inventory-status.success,
.inventory-coverage-success {
    color: var(--color-completed);
}

.procurement-inventory-status.warning,
.inventory-coverage-warning {
    color: var(--color-contaminated);
}

.procurement-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.procurement-total-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ---------------------------------------------------------------------
       Inventory index
       Scoped to avoid collisions with shared application components.
    --------------------------------------------------------------------- */

.inventory-page {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    padding-bottom: 2rem;
}

.inventory-page *,
.inventory-page *::before,
.inventory-page *::after {
    box-sizing: border-box;
}

/* ---------------------------------------------------------------------
       Header
    --------------------------------------------------------------------- */

.inventory-page .inventory-header {
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.inventory-page .page-header-main {
    display: grid;
    gap: 1.25rem;
}

.inventory-page .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.inventory-page .breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.inventory-page .breadcrumb a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.inventory-page .breadcrumb [aria-current="page"] {
    color: var(--text);
    font-weight: 650;
}

.inventory-page .page-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.inventory-page .page-heading-copy {
    min-width: 0;
}

.inventory-page .eyebrow-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.inventory-page .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
}

.inventory-page .eyebrow::before {
    width: 0.45rem;
    height: 0.45rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--primary);
    content: "";
}

.inventory-page .page-heading-copy h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.inventory-page .page-description {
    max-width: 50rem;
    margin: 0.85rem 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.inventory-page .page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.inventory-page .page-actions .button {
    white-space: nowrap;
}

/* ---------------------------------------------------------------------
       Summary
    --------------------------------------------------------------------- */

.inventory-page .inventory-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.inventory-page .inventory-summary-card {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.inventory-page .inventory-summary-card strong {
    color: var(--text);
    font-size: clamp(1.65rem, 4vw, 2rem);
    font-weight: 760;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.inventory-page .inventory-summary-label {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: 0.025em;
    line-height: 1.3;
    text-transform: uppercase;
}

.inventory-page .inventory-summary-card .muted {
    font-size: 0.84rem;
    line-height: 1.45;
}

.inventory-page .inventory-summary-card.warning {
    border-color: var(--warning);
    background: var(--warning-subtle);
}

.inventory-page .inventory-summary-card.success {
    border-color: var(--success);
    background: var(--success-subtle);
}

/* ---------------------------------------------------------------------
       Panels
    --------------------------------------------------------------------- */

.inventory-page .inventory-panel {
    display: grid;
    gap: 1.25rem;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.inventory-page .panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.inventory-page .panel-header>div {
    min-width: 0;
}

.inventory-page .panel-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.inventory-page .panel-header p {
    max-width: 48rem;
    margin: 0.4rem 0 0;
    line-height: 1.55;
}

/* ---------------------------------------------------------------------
       Filters
    --------------------------------------------------------------------- */

.inventory-page .inventory-filters {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) minmax(12rem, 16rem) auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}

.inventory-page .inventory-filters input,
.inventory-page .inventory-filters select {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.inventory-page .inventory-filters .button {
    min-height: 2.65rem;
    margin: 0;
    white-space: nowrap;
}

/* ---------------------------------------------------------------------
       Tables
    --------------------------------------------------------------------- */

.inventory-page .table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}

.inventory-page table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.inventory-page th,
.inventory-page td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.inventory-page th {
    background: var(--bg-subtle);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.045em;
    line-height: 1.3;
    text-transform: uppercase;
    white-space: nowrap;
}

.inventory-page tbody tr:last-child td {
    border-bottom: 0;
}

.inventory-page tbody tr {
    transition: background 140ms ease;
}

.inventory-page tbody tr:hover {
    background: var(--hover-bg);
}

.inventory-page .table-primary-link {
    color: var(--text);
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
}

.inventory-page .table-primary-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.inventory-page .table-actions-column {
    width: 1%;
    text-align: right;
}

.inventory-page .table-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.inventory-page .inventory-none-on-hand {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--danger-subtle);
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.inventory-page .inventory-quantity {
    color: var(--text);
    font-weight: 750;
    white-space: nowrap;
}

.inventory-page .inventory-date {
    white-space: nowrap;
}

/* ---------------------------------------------------------------------
       Empty states
    --------------------------------------------------------------------- */

.inventory-page .empty-state {
    display: grid;
    justify-items: center;
    gap: 0.65rem;
    padding: clamp(2rem, 6vw, 4rem) 1.5rem;
    border: 1px dashed var(--border-muted);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    text-align: center;
}

.inventory-page .empty-state.compact {
    padding: 2rem 1.5rem;
}

.inventory-page .empty-state-icon {
    display: inline-flex;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-subtle);
    color: var(--primary);
}

.inventory-page .empty-state-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
}

.inventory-page .empty-state h3 {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.3;
}

.inventory-page .empty-state p {
    max-width: 34rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

/* ---------------------------------------------------------------------
       Accessibility and responsive behavior
    --------------------------------------------------------------------- */

.inventory-page a:focus-visible,
.inventory-page button:focus-visible,
.inventory-page input:focus-visible,
.inventory-page select:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

@media (max-width: 1050px) {
    .inventory-page .inventory-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-page .inventory-filters {
        grid-template-columns: minmax(0, 1fr) minmax(12rem, 16rem);
    }

    .inventory-page .inventory-filters .button {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .inventory-page .page-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .inventory-page .page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .inventory-page .page-actions .button {
        flex: 1 1 auto;
    }

    .inventory-page .panel-header {
        flex-direction: column;
    }

    .inventory-page .panel-header>.button {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .inventory-page {
        gap: 1rem;
    }

    .inventory-page .inventory-header,
    .inventory-page .inventory-panel {
        padding: 1.1rem;
    }

    .inventory-page .inventory-summary-grid,
    .inventory-page .inventory-filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .inventory-page .page-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .inventory-page .page-actions .button {
        width: 100%;
    }

    .inventory-page .inventory-summary-card {
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .inventory-page tbody tr {
        transition: none;
    }
}

/* ---------------------------------------------------------------------
       Purchase order view
       Scoped beneath .purchase-order-page.
    --------------------------------------------------------------------- */

.purchase-order-page {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    padding-bottom: 2rem;
}

.purchase-order-page *,
.purchase-order-page *::before,
.purchase-order-page *::after {
    box-sizing: border-box;
}

/* ---------------------------------------------------------------------
       Header
    --------------------------------------------------------------------- */

.purchase-order-page .purchase-order-header {
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.purchase-order-page .page-header-main {
    display: grid;
    gap: 1.25rem;
}

.purchase-order-page .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.purchase-order-page .breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.purchase-order-page .breadcrumb a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.purchase-order-page .breadcrumb [aria-current="page"] {
    color: var(--text);
    font-weight: 650;
}

.purchase-order-page .page-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.purchase-order-page .page-heading-copy {
    min-width: 0;
}

.purchase-order-page .eyebrow-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.65rem;
}

.purchase-order-page .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
}

.purchase-order-page .eyebrow::before {
    width: 0.45rem;
    height: 0.45rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--primary);
    content: "";
}

.purchase-order-page .page-heading-copy h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.purchase-order-page .page-description {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin: 0.8rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.purchase-order-page .purchase-order-reference {
    color: var(--text);
    font-weight: 700;
}

.purchase-order-page .page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.purchase-order-page .page-actions .button {
    white-space: nowrap;
}

/* ---------------------------------------------------------------------
       Summary
    --------------------------------------------------------------------- */

.purchase-order-page .inventory-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.purchase-order-page .inventory-summary-card {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.purchase-order-page .inventory-summary-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    line-height: 1.3;
    text-transform: uppercase;
}

.purchase-order-page .inventory-summary-card strong {
    color: var(--text);
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.purchase-order-page .inventory-summary-card .inventory-summary-date {
    font-size: 1rem;
    letter-spacing: -0.015em;
    line-height: 1.45;
}

/* ---------------------------------------------------------------------
       Receiving callout
    --------------------------------------------------------------------- */

.purchase-order-page .receiving-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.4rem;
    border: 1px solid var(--primary);
    border-radius: calc(var(--radius) + 2px);
    background: var(--primary-subtle);
}

.purchase-order-page .receiving-callout-copy {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    min-width: 0;
}

.purchase-order-page .receiving-callout-icon {
    display: inline-flex;
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--primary);
}

.purchase-order-page .receiving-callout-icon svg {
    width: 1.35rem;
    height: 1.35rem;
    stroke: currentColor;
}

.purchase-order-page .receiving-callout h2 {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.35;
}

.purchase-order-page .receiving-callout p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.purchase-order-page .receiving-callout-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 0.65rem;
}

/* ---------------------------------------------------------------------
       Panels
    --------------------------------------------------------------------- */

.purchase-order-page .purchase-order-panel {
    display: grid;
    gap: 1.25rem;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.purchase-order-page .panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.purchase-order-page .panel-header>div {
    min-width: 0;
}

.purchase-order-page .panel-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.purchase-order-page .panel-header p {
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

/* ---------------------------------------------------------------------
       Order lines
    --------------------------------------------------------------------- */

.purchase-order-page .inventory-order-lines {
    display: grid;
    gap: 1rem;
}

.purchase-order-page .inventory-order-line {
    display: grid;
    gap: 1.2rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--panel);
}

.purchase-order-page .inventory-order-line.pending-receipt {
    border-color: var(--primary);
}

.purchase-order-page .inventory-order-line.fully-received {
    background: var(--success-subtle);
}

.purchase-order-page .inventory-order-line-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.purchase-order-page .inventory-order-line-heading {
    min-width: 0;
}

.purchase-order-page .inventory-order-line-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.015em;
    line-height: 1.35;
}

.purchase-order-page .inventory-order-line-header p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.purchase-order-page .inventory-order-line-status {
    flex: 0 0 auto;
}

.purchase-order-page .detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}

.purchase-order-page .detail-grid>div {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.purchase-order-page .detail-grid dt {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.045em;
    line-height: 1.3;
    text-transform: uppercase;
}

.purchase-order-page .detail-grid dd {
    margin: 0;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
}

/* ---------------------------------------------------------------------
       Receiving form
    --------------------------------------------------------------------- */

.purchase-order-page .inventory-receive-panel {
    display: grid;
    gap: 1.2rem;
    padding: 1.2rem;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    background: var(--primary-subtle);
}

.purchase-order-page .receive-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.purchase-order-page .receive-panel-header h4 {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.35;
}

.purchase-order-page .receive-panel-header p {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.purchase-order-page .receive-location-action {
    flex: 0 0 auto;
    white-space: nowrap;
}

.purchase-order-page .receive-form {
    display: grid;
    gap: 1rem;
}

.purchase-order-page .receive-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.purchase-order-page .form-field {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.purchase-order-page .form-field label {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.4;
}

.purchase-order-page .form-field input,
.purchase-order-page .form-field select,
.purchase-order-page .form-field textarea {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.purchase-order-page .field-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.purchase-order-page .receive-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.25rem;
}

.purchase-order-page .receive-form-actions .button {
    min-height: 2.8rem;
}

.purchase-order-page .receive-submit {
    min-width: 12rem;
}

/* ---------------------------------------------------------------------
       Completed receiving state
    --------------------------------------------------------------------- */

.purchase-order-page .received-confirmation {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--success);
    border-radius: var(--radius);
    background: var(--success-subtle);
}

.purchase-order-page .received-confirmation-icon {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--success);
    color: var(--panel);
}

.purchase-order-page .received-confirmation-icon svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
}

.purchase-order-page .received-confirmation strong {
    display: block;
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.4;
}

.purchase-order-page .received-confirmation span {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* ---------------------------------------------------------------------
       Notes
    --------------------------------------------------------------------- */

.purchase-order-page .purchase-order-notes {
    display: grid;
    gap: 0.7rem;
}

.purchase-order-page .purchase-order-notes h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 750;
}

.purchase-order-page .purchase-order-notes p {
    margin: 0;
    color: var(--text);
    line-height: 1.65;
    white-space: pre-wrap;
}

/* ---------------------------------------------------------------------
       Accessibility and responsive behavior
    --------------------------------------------------------------------- */

.purchase-order-page a:focus-visible,
.purchase-order-page button:focus-visible,
.purchase-order-page input:focus-visible,
.purchase-order-page select:focus-visible,
.purchase-order-page textarea:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

@media (max-width: 1000px) {
    .purchase-order-page .inventory-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .purchase-order-page .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {

    .purchase-order-page .page-heading-row,
    .purchase-order-page .receiving-callout,
    .purchase-order-page .panel-header,
    .purchase-order-page .receive-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .purchase-order-page .page-actions,
    .purchase-order-page .receiving-callout-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .purchase-order-page .page-actions .button,
    .purchase-order-page .receiving-callout-actions .button,
    .purchase-order-page .receive-location-action {
        flex: 1 1 auto;
    }

    .purchase-order-page .inventory-order-line-header {
        flex-direction: column;
        gap: 0.8rem;
    }

    .purchase-order-page .receive-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .purchase-order-page {
        gap: 1rem;
    }

    .purchase-order-page .purchase-order-header,
    .purchase-order-page .purchase-order-panel {
        padding: 1.1rem;
    }

    .purchase-order-page .inventory-summary-grid,
    .purchase-order-page .detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .purchase-order-page .page-actions,
    .purchase-order-page .receiving-callout-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .purchase-order-page .page-actions .button,
    .purchase-order-page .receiving-callout-actions .button,
    .purchase-order-page .receive-location-action {
        width: 100%;
    }

    .purchase-order-page .inventory-order-line {
        padding: 1rem;
    }

    .purchase-order-page .receive-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .purchase-order-page .receive-submit {
        width: 100%;
    }
}


/* --------------------------------------------------------------------- Inventory locations index Scoped beneath .inventory-locations-page. --------------------------------------------------------------------- */
.inventory-locations-page {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    padding-bottom: 2rem;
}

.inventory-locations-page *,
.inventory-locations-page *::before,
.inventory-locations-page *::after {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------- Header --------------------------------------------------------------------- */
.inventory-locations-page .inventory-locations-header {
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.inventory-locations-page .page-header-main {
    display: grid;
    gap: 1.25rem;
}

.inventory-locations-page .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.inventory-locations-page .breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.inventory-locations-page .breadcrumb a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.inventory-locations-page .breadcrumb [aria-current="page"] {
    color: var(--text);
    font-weight: 650;
}

.inventory-locations-page .page-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.inventory-locations-page .page-heading-copy {
    min-width: 0;
}

.inventory-locations-page .eyebrow-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.inventory-locations-page .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
}

.inventory-locations-page .eyebrow::before {
    width: 0.45rem;
    height: 0.45rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--primary);
    content: "";
}

.inventory-locations-page .page-heading-copy h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.inventory-locations-page .page-description {
    max-width: 50rem;
    margin: 0.85rem 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.inventory-locations-page .page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.inventory-locations-page .page-actions .button {
    white-space: nowrap;
}

/* --------------------------------------------------------------------- Main panel --------------------------------------------------------------------- */
.inventory-locations-page .locations-panel {
    display: grid;
    gap: 1.25rem;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.inventory-locations-page .locations-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.inventory-locations-page .locations-panel-header>div {
    min-width: 0;
}

.inventory-locations-page .locations-panel-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.inventory-locations-page .locations-panel-header p {
    max-width: 46rem;
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

/* --------------------------------------------------------------------- Filters --------------------------------------------------------------------- */
.inventory-locations-page .location-filters {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}

.inventory-locations-page .location-filters input {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.inventory-locations-page .location-filters .button {
    min-height: 2.65rem;
    margin: 0;
    white-space: nowrap;
}

/* --------------------------------------------------------------------- Location grid --------------------------------------------------------------------- */
.inventory-locations-page .inventory-location-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.inventory-locations-page .inventory-location-card {
    display: grid;
    gap: 1rem;
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--panel);
    transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.inventory-locations-page .inventory-location-card:hover {
    border-color: var(--border-muted);
    background: var(--hover-bg);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.inventory-locations-page .inventory-location-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.inventory-locations-page .inventory-location-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    min-width: 0;
}

.inventory-locations-page .inventory-location-icon {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-subtle);
    color: var(--primary);
}

.inventory-locations-page .inventory-location-icon svg {
    width: 1.3rem;
    height: 1.3rem;
    stroke: currentColor;
}

.inventory-locations-page .inventory-location-title {
    min-width: 0;
}

.inventory-locations-page .inventory-location-card h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.015em;
    line-height: 1.35;
}

.inventory-locations-page .inventory-location-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.inventory-locations-page .inventory-location-card h3 a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.inventory-locations-page .inventory-location-parent {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.inventory-locations-page .inventory-location-parent svg {
    width: 0.9rem;
    height: 0.9rem;
    flex: 0 0 auto;
    stroke: currentColor;
}

.inventory-locations-page .inventory-location-card-description {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.inventory-locations-page .inventory-location-card-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
}

/* --------------------------------------------------------------------- Location statistics --------------------------------------------------------------------- */
.inventory-locations-page .location-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.inventory-locations-page .location-detail-grid>div {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}

.inventory-locations-page .location-detail-grid dt {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.045em;
    line-height: 1.3;
    text-transform: uppercase;
}

.inventory-locations-page .location-detail-grid dd {
    margin: 0;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 760;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

/* --------------------------------------------------------------------- Empty state --------------------------------------------------------------------- */
.inventory-locations-page .location-empty-state {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    padding: clamp(2.5rem, 7vw, 4.5rem) 1.5rem;
    border: 1px dashed var(--border-muted);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    text-align: center;
}

.inventory-locations-page .location-empty-icon {
    display: inline-flex;
    width: 3.25rem;
    height: 3.25rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-subtle);
    color: var(--primary);
}

.inventory-locations-page .location-empty-icon svg {
    width: 1.6rem;
    height: 1.6rem;
    stroke: currentColor;
}

.inventory-locations-page .location-empty-state h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 750;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.inventory-locations-page .location-empty-state p {
    max-width: 34rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.inventory-locations-page .location-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

/* --------------------------------------------------------------------- Accessibility and responsive behavior --------------------------------------------------------------------- */
.inventory-locations-page a:focus-visible,
.inventory-locations-page button:focus-visible,
.inventory-locations-page input:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .inventory-locations-page .inventory-location-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {

    .inventory-locations-page .page-heading-row,
    .inventory-locations-page .locations-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .inventory-locations-page .page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .inventory-locations-page .page-actions .button {
        flex: 1 1 auto;
    }

    .inventory-locations-page .location-filters {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }
}

@media (max-width: 600px) {
    .inventory-locations-page {
        gap: 1rem;
    }

    .inventory-locations-page .inventory-locations-header,
    .inventory-locations-page .locations-panel {
        padding: 1.1rem;
    }

    .inventory-locations-page .page-actions,
    .inventory-locations-page .location-filters {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .inventory-locations-page .page-actions .button,
    .inventory-locations-page .location-filters .button {
        width: 100%;
    }

    .inventory-locations-page .inventory-location-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    .inventory-locations-page .inventory-location-card-actions {
        width: 100%;
    }

    .inventory-locations-page .inventory-location-card-actions .button {
        width: 100%;
    }

    .inventory-locations-page .location-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .inventory-locations-page .location-empty-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .inventory-locations-page .location-empty-actions .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .inventory-locations-page .inventory-location-card {
        transition: none;
    }
}


/* ---------------------------------------------------------------------
       Inventory item view
       Scoped beneath .inventory-item-page.
    --------------------------------------------------------------------- */

.inventory-item-page {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    padding-bottom: 2rem;
}

.inventory-item-page *,
.inventory-item-page *::before,
.inventory-item-page *::after {
    box-sizing: border-box;
}

/* ---------------------------------------------------------------------
       Header
    --------------------------------------------------------------------- */

.inventory-item-page .inventory-item-header {
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.inventory-item-page .page-header-main {
    display: grid;
    gap: 1.25rem;
}

.inventory-item-page .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.inventory-item-page .breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.inventory-item-page .breadcrumb a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.inventory-item-page .breadcrumb [aria-current="page"] {
    color: var(--text);
    font-weight: 650;
}

.inventory-item-page .page-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.inventory-item-page .page-heading-copy {
    min-width: 0;
}

.inventory-item-page .eyebrow-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.65rem;
}

.inventory-item-page .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
}

.inventory-item-page .eyebrow::before {
    width: 0.45rem;
    height: 0.45rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--primary);
    content: "";
}

.inventory-item-page .page-heading-copy h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.inventory-item-page .page-description {
    max-width: 50rem;
    margin: 0.85rem 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.inventory-item-page .page-description strong {
    color: var(--text);
}

.inventory-item-page .page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.inventory-item-page .page-actions .button {
    white-space: nowrap;
}

/* ---------------------------------------------------------------------
       Availability summary
    --------------------------------------------------------------------- */

.inventory-item-page .item-availability {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.inventory-item-page .availability-primary,
.inventory-item-page .availability-card {
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.inventory-item-page .availability-primary {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.inventory-item-page .availability-icon {
    display: inline-flex;
    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--primary);
}

.inventory-item-page .availability-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
}

.inventory-item-page .availability-copy {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.inventory-item-page .availability-label {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.055em;
    line-height: 1.3;
    text-transform: uppercase;
}

.inventory-item-page .availability-primary strong {
    color: var(--text);
    font-size: clamp(1.55rem, 4vw, 2rem);
    font-weight: 760;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.inventory-item-page .availability-copy span:last-child {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.inventory-item-page .availability-card {
    display: grid;
    gap: 0.4rem;
}

.inventory-item-page .availability-card strong {
    color: var(--text);
    font-size: 1.65rem;
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

/* ---------------------------------------------------------------------
       Shared panels
    --------------------------------------------------------------------- */

.inventory-item-page .inventory-item-panel {
    display: grid;
    gap: 1.25rem;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.inventory-item-page .panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.inventory-item-page .panel-header>div {
    min-width: 0;
}

.inventory-item-page .panel-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.inventory-item-page .panel-header p {
    max-width: 48rem;
    margin: 0.4rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.inventory-item-page .panel-header-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 0.65rem;
}

/* ---------------------------------------------------------------------
       Inventory lots
    --------------------------------------------------------------------- */

.inventory-item-page .inventory-lot-grid {
    display: grid;
    gap: 1rem;
}

.inventory-item-page .inventory-lot-card {
    display: grid;
    gap: 1.15rem;
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--panel);
}

.inventory-item-page .inventory-lot-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.inventory-item-page .inventory-lot-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    min-width: 0;
}

.inventory-item-page .inventory-lot-icon {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-subtle);
    color: var(--primary);
}

.inventory-item-page .inventory-lot-icon svg {
    width: 1.3rem;
    height: 1.3rem;
    stroke: currentColor;
}

.inventory-item-page .inventory-lot-title {
    min-width: 0;
}

.inventory-item-page .inventory-lot-header h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.015em;
    line-height: 1.35;
}

.inventory-item-page .inventory-lot-id {
    margin: 0.3rem 0 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.4;
}

.inventory-item-page .inventory-lot-status {
    flex: 0 0 auto;
}

.inventory-item-page .lot-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.inventory-item-page .lot-detail-grid>div {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}

.inventory-item-page .lot-detail-grid dt {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.045em;
    line-height: 1.3;
    text-transform: uppercase;
}

.inventory-item-page .lot-detail-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.45;
}

.inventory-item-page .lot-detail-grid .lot-quantity dd {
    font-size: 1.15rem;
    font-weight: 760;
    letter-spacing: -0.025em;
}

/* ---------------------------------------------------------------------
       Quantity adjustment
    --------------------------------------------------------------------- */

.inventory-item-page .inventory-adjustment-panel {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}

.inventory-item-page .inventory-adjustment-panel[open] {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.inventory-item-page .inventory-adjustment-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1.4;
    list-style: none;
}

.inventory-item-page .inventory-adjustment-panel summary::-webkit-details-marker {
    display: none;
}

.inventory-item-page .inventory-adjustment-panel summary::after {
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    content: "";
    transform: rotate(45deg) translateY(-0.15rem);
    transition: transform 140ms ease;
}

.inventory-item-page .inventory-adjustment-panel[open] summary::after {
    transform: rotate(225deg) translate(-0.1rem, -0.1rem);
}

.inventory-item-page .inventory-adjustment-panel summary:hover {
    background: var(--hover-bg);
}

.inventory-item-page .inventory-adjustment-content {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.inventory-item-page .adjustment-guidance {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.8rem;
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    background: var(--warning-subtle);
}

.inventory-item-page .adjustment-guidance svg {
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
    margin-top: 0.1rem;
    stroke: var(--text);
}

.inventory-item-page .adjustment-guidance p {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.inventory-item-page .adjustment-form {
    display: grid;
    gap: 1rem;
}

.inventory-item-page .adjustment-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 0.55fr);
    gap: 1rem;
}

.inventory-item-page .form-field {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.inventory-item-page .form-field label {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.4;
}

.inventory-item-page .form-field input,
.inventory-item-page .form-field select {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.inventory-item-page .field-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.inventory-item-page .adjustment-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ---------------------------------------------------------------------
       Supplier options
    --------------------------------------------------------------------- */

.inventory-item-page .supplier-empty-action {
    margin-top: 0.25rem;
}

.inventory-item-page .table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}

.inventory-item-page table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

.inventory-item-page th,
.inventory-item-page td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.inventory-item-page th {
    background: var(--bg-subtle);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.045em;
    line-height: 1.3;
    text-transform: uppercase;
    white-space: nowrap;
}

.inventory-item-page tbody tr:last-child td {
    border-bottom: 0;
}

.inventory-item-page tbody tr {
    transition: background 140ms ease;
}

.inventory-item-page tbody tr:hover {
    background: var(--hover-bg);
}

.inventory-item-page .supplier-name {
    color: var(--text);
    font-weight: 700;
}

.inventory-item-page .supplier-package,
.inventory-item-page .supplier-price {
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}

.inventory-item-page .table-action-column {
    width: 1%;
    text-align: right;
}

.inventory-item-page .table-action {
    text-align: right;
}

/* ---------------------------------------------------------------------
       Transaction history
    --------------------------------------------------------------------- */

.inventory-item-page .transaction-time {
    white-space: nowrap;
}

.inventory-item-page .transaction-type {
    display: inline-flex;
    align-items: center;
    min-height: 1.65rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.inventory-item-page .transaction-change,
.inventory-item-page .transaction-balance {
    color: var(--text);
    font-weight: 750;
    white-space: nowrap;
}

.inventory-item-page .transaction-reason {
    min-width: 15rem;
    color: var(--muted);
}

/* ---------------------------------------------------------------------
       Empty states
    --------------------------------------------------------------------- */

.inventory-item-page .item-empty-state {
    display: grid;
    justify-items: center;
    gap: 0.7rem;
    padding: clamp(2rem, 6vw, 3.5rem) 1.5rem;
    border: 1px dashed var(--border-muted);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    text-align: center;
}

.inventory-item-page .item-empty-state.compact {
    padding: 2rem 1.5rem;
}

.inventory-item-page .item-empty-icon {
    display: inline-flex;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-subtle);
    color: var(--primary);
}

.inventory-item-page .item-empty-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: currentColor;
}

.inventory-item-page .item-empty-state h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.35;
}

.inventory-item-page .item-empty-state p {
    max-width: 36rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.inventory-item-page .empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

/* ---------------------------------------------------------------------
       Accessibility and responsive behavior
    --------------------------------------------------------------------- */

.inventory-item-page a:focus-visible,
.inventory-item-page button:focus-visible,
.inventory-item-page input:focus-visible,
.inventory-item-page select:focus-visible,
.inventory-item-page summary:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

@media (max-width: 1000px) {
    .inventory-item-page .item-availability {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-item-page .availability-primary {
        grid-column: 1 / -1;
    }

    .inventory-item-page .lot-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {

    .inventory-item-page .page-heading-row,
    .inventory-item-page .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .inventory-item-page .page-actions,
    .inventory-item-page .panel-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .inventory-item-page .page-actions .button,
    .inventory-item-page .panel-header-actions .button {
        flex: 1 1 auto;
    }

    .inventory-item-page .inventory-lot-header {
        flex-direction: column;
        gap: 0.8rem;
    }
}

@media (max-width: 600px) {
    .inventory-item-page {
        gap: 1rem;
    }

    .inventory-item-page .inventory-item-header,
    .inventory-item-page .inventory-item-panel {
        padding: 1.1rem;
    }

    .inventory-item-page .page-actions,
    .inventory-item-page .panel-header-actions,
    .inventory-item-page .item-availability,
    .inventory-item-page .lot-detail-grid,
    .inventory-item-page .adjustment-form-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .inventory-item-page .availability-primary {
        grid-column: auto;
    }

    .inventory-item-page .page-actions .button,
    .inventory-item-page .panel-header-actions .button {
        width: 100%;
    }

    .inventory-item-page .inventory-lot-card {
        padding: 1rem;
    }

    .inventory-item-page .adjustment-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .inventory-item-page .adjustment-actions .button {
        width: 100%;
    }

    .inventory-item-page .empty-state-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .inventory-item-page .empty-state-actions .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {

    .inventory-item-page tbody tr,
    .inventory-item-page .inventory-adjustment-panel summary::after {
        transition: none;
    }
}/* ───────────────────── Landing Page Helpers ───────────────────── */
/* ───────────────── Landing helpers ───────────────── */

.hero {
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(180deg,
            rgba(120, 140, 255, 0.08),
            rgba(120, 140, 255, 0.02));
    border-radius: 12px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.hero-tagline {
    font-size: 1.25rem;
    max-width: 816px;
    margin: 0 auto 2rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Sections */

.landing-section {
    margin: 4rem auto;
    max-width: 1100px;
    padding: 0 1.5rem;
}

.landing-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.muted-panel {
    background: var(--bg-subtle);
    padding: 3rem 1.5rem;
    padding-top: 0.5rem;
    border-radius: 12px;
}

/* Feature list */

.feature-list {
    list-style: none;
    padding: 0;
    max-width: 600px;
    margin: 0 auto;
}

.feature-list li {
    padding: 0.75rem 0;
    font-size: 1.05rem;
}

/* Pricing */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(264px, 1fr));
    gap: 2rem;
}

.pricing-card {
    border: 1px solid var(--bg);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.pricing-card.highlight {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.pricing-card h3 {
    margin-bottom: 0.5rem;
}

.price {
    font-size: 2.25rem;
    margin: 1rem 0;
}

.price span {
    font-size: 1rem;
    color: var(--muted);
}

.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.pricing-card li {
    margin: 0.4rem 0;
}

.landing-screenshot {
    width: min(1400px, 96%);
    margin: 2rem auto 4rem;
}

.landing-screenshot img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;

    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.screenshot-dark {
    display: none;
}

html[data-theme="dark"] .screenshot-light {
    display: none;
}

html[data-theme="dark"] .screenshot-dark {
    display: block;
}

html[data-theme="light"] .screenshot-light {
    display: block;
}

html[data-theme="light"] .screenshot-dark {
    display: none;
}

.screenshot-link {
    display: block;
    position: relative;
    cursor: zoom-in;
}

.screenshot-hint {
    position: absolute;
    right: .75rem;
    bottom: .75rem;
    padding: .35rem .6rem;
    border-radius: 999px;
    font-size: .8rem;
    background: rgba(0, 0, 0, .72);
    color: #fff;
}

.dashboard-preview {
    display: none;
    margin-top: 1rem;
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(0, 0, 0, .08);
}

.dashboard-preview:target {
    display: block;
}

.dashboard-preview-close {
    display: inline-block;
    margin: .75rem;
}

.dashboard-preview-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem 1rem;
}

.dashboard-preview-scroll img {
    display: block;
    width: 1641px;
    max-width: none;
    height: auto;
}

.screenshot-dark {
    display: none;
}

[data-theme="dark"] .screenshot-light {
    display: none;
}

[data-theme="dark"] .screenshot-dark {
    display: block;
}

.cta-pricing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.9rem 1.35rem;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #16a34a);
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.28);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.cta-pricing::after {
    content: "→";
    font-size: 1.05em;
}

.cta-pricing:hover,
.cta-pricing:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(37, 99, 235, 0.34);
    filter: brightness(1.05);
}

.cta-pricing:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 3px;
}

.cta-pricing:active {
    transform: translateY(0);
}#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    z-index: 10000;
    transition: width 0.25s ease;
    overflow: visible;
}

/* moving text */

#loader-text {
    position: absolute;
    top: 6px;
    left: 100%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    color: #334155;
    pointer-events: none;
}

/* overlay */

#submit-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#submit-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* spinner */

.overlay-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-subtle);
    border-top: 4px solid #4facfe;
    border-radius: 50%;
}

.submit-overlay .spinner {
    will-change: transform;
    animation: spinner-rotate 0.8s linear infinite;
}

.submit-overlay:not(.active) .spinner {
    animation-play-state: paused;
}

@keyframes spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;

    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

/* =========================
     Modal Box
  ========================= */

.modal-content {
    padding: 4px;
    background: var(--panel);
    width: 716px;
    max-width: 95%;
    max-height: 90vh;
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    box-shadow: var(--shadow);

    display: flex;
    flex-direction: column;

}

#confirmModal {
    text-align: center;
}

@keyframes modalSlide {
    from {
        transform: translateY(15px);
        opacity: 0.6;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =========================
     Modal Header
  ========================= */

.modal-content h3 {
    margin: 0;
    padding: 18px 22px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 18px;
    font-weight: 600;
}

/* =========================
     Body Layout
  ========================= */

.modal-content textarea {
    width: calc(100% - 40px);
    margin: 18px 16px 10px 16px;
    padding: 12px;

    border-radius: 8px;
    border: 1px solid #d1d5db;

    font-size: 14px;
    resize: vertical;
    min-height: 100px;

    outline: none;
    transition: border 0.2s ease;
}

.modal-content textarea:focus {
    border-color: #7c3aed;
}

/* =========================
     File Input
  ========================= */

.modal-content input[type="file"] {
    margin: 0 16px 15px 16px;
    font-size: 14px;
}


/* =========================
     Buttons
  ========================= */

.modal-content button {
    margin: 0 16px 15px 16px;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

body.modal-open {
    position: fixed;
    width: 100%;
}/* -------------------------------------------------------------------------
   Molecular workbench project
   ------------------------------------------------------------------------- */

.molecular-workbench-page {
    display: grid;
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

.molecular-project-header {
    display: block;
    padding: 1.5rem;
}

.molecular-project-header .page-header-main {
    display: grid;
    gap: 1rem;
}

.molecular-project-header .breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.molecular-project-header .breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.molecular-project-header .breadcrumb a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.molecular-project-header .page-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
}

.molecular-project-header .page-heading-copy {
    display: grid;
    gap: 0.65rem;
    min-width: 0;
}

.molecular-project-header .eyebrow-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.molecular-project-header .eyebrow {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.molecular-project-header h1 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    line-height: 1.15;
}

.molecular-project-header .page-description {
    max-width: 52rem;
    margin: 0;
    line-height: 1.6;
}

.molecular-project-context {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.molecular-project-header .page-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    flex-shrink: 0;
    gap: 0.6rem;
}

/* -------------------------------------------------------------------------
   Workbench navigation
   ------------------------------------------------------------------------- */

.workbench-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    padding: 0.35rem;
    overflow-x: auto;
}

.workbench-tab {
    position: relative;
    display: grid;
    gap: 0.15rem;
    min-width: 8.5rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 0.45rem;
    color: var(--muted);
    text-align: left;
    text-decoration: none;
    transition:
        background-color 140ms ease,
        border-color 140ms ease,
        color 140ms ease;
}

.workbench-tab:hover {
    border-color: var(--border);
    background: var(--hover-bg);
    color: var(--text-hover);
    text-decoration: none;
}

.workbench-tab.active {
    border-color: var(--border);
    background: var(--bg-subtle);
    color: var(--text);
}

.workbench-tab.active::after {
    position: absolute;
    right: 0.75rem;
    bottom: -0.35rem;
    left: 0.75rem;
    height: 0.18rem;
    border-radius: 999px;
    background: var(--primary);
    content: "";
}

.workbench-tab-label {
    font-size: 0.9rem;
    font-weight: 700;
}

.workbench-tab-description {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 400;
}

/* -------------------------------------------------------------------------
   Main project workspace
   ------------------------------------------------------------------------- */

.workbench-layout {
    display: grid;
    grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
    min-width: 0;
}

.workbench-sidebar {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 1rem;
    min-width: 0;
    padding: 1.25rem;
}

.workbench-main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.workbench-sidebar .panel-header {
    margin: 0;
    padding: 0;
    border: 0;
}

.workbench-sidebar .panel-header h2 {
    margin: 0.2rem 0 0;
}

.workbench-sidebar .panel-header p {
    margin: 0.5rem 0 0;
    line-height: 1.5;
}

.workbench-sequence-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.workbench-sequence-actions .button {
    width: 100%;
    justify-content: center;
    text-align: center;
}

/* -------------------------------------------------------------------------
   Sequence list
   ------------------------------------------------------------------------- */

.workbench-sequence-list {
    display: grid;
    gap: 0.5rem;
}

.workbench-sequence-item {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
    transition:
        background-color 140ms ease,
        border-color 140ms ease,
        box-shadow 140ms ease;
}

.workbench-sequence-item:hover {
    border-color: var(--border-muted);
    background: var(--hover-bg);
    color: var(--text-hover);
    text-decoration: none;
}

.workbench-sequence-item.active {
    border-color: var(--primary);
    background: var(--bg-subtle);
    box-shadow: inset 0.2rem 0 0 var(--primary);
}

.workbench-sequence-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.workbench-sequence-item-header strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.workbench-sequence-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.workbench-sequence-item .badge {
    width: fit-content;
}

/* -------------------------------------------------------------------------
   Empty and attach states
   ------------------------------------------------------------------------- */

.molecular-project-empty-state {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px dashed var(--border-muted);
    border-radius: 0.5rem;
    background: var(--bg-subtle);
}

.molecular-project-empty-state h3 {
    margin: 0;
}

.molecular-project-empty-state p {
    margin: 0.4rem 0 0;
    line-height: 1.5;
}

.molecular-project-empty-state .form-actions {
    display: grid;
    gap: 0.5rem;
}

.workbench-attach-sequence {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.workbench-attach-sequence>summary {
    cursor: pointer;
    color: var(--text);
    font-weight: 700;
}

.workbench-attach-sequence>summary:hover {
    color: var(--primary-hover);
}

.workbench-attach-sequence .nested-panel-body {
    display: grid;
    gap: 0.8rem;
    padding-top: 0.8rem;
}

/* -------------------------------------------------------------------------
   Project settings
   ------------------------------------------------------------------------- */

.molecular-project-settings>summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
}

.molecular-project-settings>summary>span {
    display: grid;
    gap: 0.2rem;
}

.molecular-project-settings .collapsible-content {
    padding-top: 1rem;
}

.molecular-project-settings .form-section {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

.molecular-project-settings .form-section:first-child {
    padding-top: 0;
    border-top: 0;
}

.molecular-project-settings .form-section-header h2 {
    margin: 0;
    font-size: 1rem;
}

.molecular-project-settings .form-section-header p {
    margin: 0.25rem 0 0;
}

/* -------------------------------------------------------------------------
   Responsive behavior
   ------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .workbench-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .workbench-tab.active::after {
        display: none;
    }
}

@media (max-width: 900px) {
    .molecular-project-header .page-heading-row {
        display: grid;
        gap: 1rem;
    }

    .molecular-project-header .page-header-actions {
        justify-content: flex-start;
    }

    .workbench-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .workbench-sidebar {
        position: static;
    }

    .workbench-sequence-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .molecular-project-header {
        padding: 1rem;
    }

    .molecular-project-header .page-header-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .molecular-project-header .page-header-actions .button {
        width: 100%;
        justify-content: center;
    }

    .workbench-tabs {
        display: flex;
        padding: 0.35rem;
    }

    .workbench-tab {
        flex: 0 0 9rem;
    }

    .workbench-sequence-actions {
        grid-template-columns: 1fr;
    }

    .form-grid.two-column {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* -------------------------------------------------------------------------
   Molecular sequence version view
   ------------------------------------------------------------------------- */

.molecular-sequence-page {
    display: grid;
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

.molecular-sequence-header {
    display: block;
    padding: 1.5rem;
}

.molecular-sequence-header .page-header-main {
    display: grid;
    gap: 1rem;
}

.molecular-sequence-header .breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.molecular-sequence-header .breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.molecular-sequence-header .breadcrumb a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.molecular-sequence-header .page-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
}

.molecular-sequence-header .page-heading-copy {
    display: grid;
    gap: 0.65rem;
    min-width: 0;
}

.molecular-sequence-header .eyebrow-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.molecular-sequence-header h1 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    line-height: 1.15;
}

.molecular-sequence-header .page-description {
    max-width: 52rem;
    margin: 0;
    line-height: 1.55;
}

.molecular-sequence-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.2rem;
}

.molecular-sequence-header .page-header-actions {
    display: grid;
    justify-items: end;
    gap: 0.55rem;
    flex-shrink: 0;
    max-width: 32rem;
}

.molecular-sequence-header .button-row {
    justify-content: flex-end;
}

.molecular-publish-form {
    display: inline-flex;
    margin: 0;
}

.molecular-publish-note {
    max-width: 28rem;
    margin: 0;
    text-align: right;
    line-height: 1.45;
}

/* -------------------------------------------------------------------------
   Non-current version notice
   ------------------------------------------------------------------------- */

.molecular-sequence-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin: 0;
}

.molecular-sequence-notice p {
    margin: 0.25rem 0 0;
}

/* -------------------------------------------------------------------------
   Metadata
   ------------------------------------------------------------------------- */

.molecular-sequence-overview {
    display: grid;
    gap: 1rem;
}

.molecular-sequence-overview>.panel-header,
.molecular-sequence-content>.panel-header,
.molecular-sequence-detail-panel>.panel-header {
    margin: 0;
}

.molecular-sequence-overview .panel-header h2,
.molecular-sequence-content .panel-header h2,
.molecular-sequence-detail-panel .panel-header h2 {
    margin: 0.15rem 0 0;
}

.molecular-sequence-overview .panel-header p,
.molecular-sequence-content .panel-header p,
.molecular-sequence-detail-panel .panel-header p {
    margin: 0.4rem 0 0;
}

.molecular-sequence-metadata {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.molecular-sequence-metadata .metadata-card {
    display: grid;
    align-content: start;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-subtle);
}

.molecular-sequence-metadata .metadata-card-wide {
    grid-column: span 2;
}

.molecular-sequence-metadata .metadata-label {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.molecular-sequence-metadata .metadata-value {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.molecular-sequence-metadata .metadata-hash {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1.5;
}

.molecular-change-summary .metadata-value {
    font-weight: 400;
    line-height: 1.55;
}

/* -------------------------------------------------------------------------
   Map and nucleotide sequence
   ------------------------------------------------------------------------- */

.molecular-sequence-content {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.molecular-linear-map-container {
    min-width: 0;
    padding: 0.75rem;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-subtle);
}

.sequence-data-details {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--panel);
    overflow: hidden;
}

.sequence-data-details>summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    background: var(--bg-subtle);
}

.sequence-data-details>summary:hover {
    background: var(--hover-bg);
}

.sequence-data-details>summary>span {
    display: grid;
    gap: 0.15rem;
}

.sequence-data-body {
    min-width: 0;
    padding: 1rem;
}

.sequence-data-body .sequence-block {
    max-height: 32rem;
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.65;
}

/* -------------------------------------------------------------------------
   Feature and primer panels
   ------------------------------------------------------------------------- */

.molecular-sequence-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 1rem;
    min-width: 0;
}

.molecular-sequence-detail-panel {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.molecular-sequence-detail-panel .panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.molecular-sequence-detail-panel .empty-state.compact {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px dashed var(--border-muted);
    border-radius: 0.5rem;
    background: var(--bg-subtle);
}

.molecular-sequence-detail-panel .empty-state h3 {
    margin: 0;
    font-size: 1rem;
}

.molecular-sequence-detail-panel .empty-state p {
    margin: 0;
    line-height: 1.5;
}

.coordinate-value {
    white-space: nowrap;
    color: var(--text);
    font-size: 0.8rem;
}

/* -------------------------------------------------------------------------
   Responsive behavior
   ------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .molecular-sequence-metadata {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .molecular-sequence-header .page-heading-row {
        display: grid;
        gap: 1rem;
    }

    .molecular-sequence-header .page-header-actions {
        justify-items: start;
        max-width: none;
    }

    .molecular-sequence-header .button-row {
        justify-content: flex-start;
    }

    .molecular-publish-note {
        text-align: left;
    }

    .molecular-sequence-metadata {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .molecular-sequence-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .molecular-sequence-header {
        padding: 1rem;
    }

    .molecular-sequence-header .button-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .molecular-sequence-header .button,
    .molecular-sequence-header .molecular-publish-form,
    .molecular-sequence-header .molecular-publish-form button {
        width: 100%;
    }

    .molecular-sequence-header .button,
    .molecular-sequence-header .molecular-publish-form button {
        justify-content: center;
    }

    .molecular-sequence-metadata {
        grid-template-columns: minmax(0, 1fr);
    }

    .molecular-sequence-metadata .metadata-card-wide {
        grid-column: auto;
    }

    .sequence-data-body {
        padding: 0.75rem;
    }
}

/* -------------------------------------------------------------------------
   Molecular assembly view
   ------------------------------------------------------------------------- */

.molecular-assembly-page {
    display: grid;
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

.molecular-assembly-header {
    display: block;
    padding: 1.5rem;
}

.molecular-assembly-header .page-header-main {
    display: grid;
    gap: 1rem;
}

.molecular-assembly-header .breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.molecular-assembly-header .breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.molecular-assembly-header .breadcrumb a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.molecular-assembly-header .page-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
}

.molecular-assembly-header .page-heading-copy {
    display: grid;
    gap: 0.65rem;
    min-width: 0;
}

.molecular-assembly-header .eyebrow-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.molecular-assembly-header h1 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    line-height: 1.15;
}

.molecular-assembly-header .page-description {
    max-width: 52rem;
    margin: 0;
    line-height: 1.55;
}

.molecular-assembly-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.molecular-assembly-header .page-header-actions {
    flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Assembly stages
   ------------------------------------------------------------------------- */

.molecular-assembly-stage {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.molecular-assembly-stage>.panel-header {
    align-items: flex-start;
    margin: 0;
}

.molecular-assembly-stage>.panel-header h2 {
    margin: 0.15rem 0 0;
}

.molecular-assembly-stage>.panel-header p {
    margin: 0.4rem 0 0;
    line-height: 1.5;
}

.molecular-assembly-stage>.panel-header .eyebrow {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* -------------------------------------------------------------------------
   Fragment cards
   ------------------------------------------------------------------------- */

.assembly-fragment-list {
    display: grid;
    gap: 0.65rem;
}

.assembly-fragment-card {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.9rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    background: var(--panel);
}

.assembly-fragment-order {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--text);
    font-weight: 700;
}

.assembly-fragment-content {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.assembly-fragment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.assembly-fragment-header h3 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 1rem;
}

.assembly-fragment-header p {
    margin: 0.2rem 0 0;
}

.assembly-fragment-metadata {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.assembly-fragment-field {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.55rem 0.65rem;
    border-radius: 0.4rem;
    background: var(--bg-subtle);
}

.assembly-fragment-field .metadata-label {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.assembly-fragment-field .metadata-value {
    min-width: 0;
    overflow-wrap: anywhere;
}

.assembly-fragment-field code {
    white-space: normal;
    overflow-wrap: anywhere;
}

.assembly-fragment-notes {
    grid-column: 1 / -1;
}

.assembly-fragment-actions form {
    margin: 0;
}

/* -------------------------------------------------------------------------
   Empty state
   ------------------------------------------------------------------------- */

.molecular-assembly-empty-state {
    padding: 1.25rem;
    border: 1px dashed var(--border-muted);
    border-radius: 0.55rem;
    background: var(--bg-subtle);
}

.molecular-assembly-empty-state h3 {
    margin: 0;
}

.molecular-assembly-empty-state p {
    margin: 0.4rem 0 0;
}

/* -------------------------------------------------------------------------
   Add fragment form
   ------------------------------------------------------------------------- */

.molecular-add-fragment {
    border: 1px solid var(--border);
    border-radius: 0.55rem;
    background: var(--panel);
    overflow: hidden;
}

.molecular-add-fragment>summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    cursor: pointer;
    background: var(--bg-subtle);
}

.molecular-add-fragment>summary:hover {
    background: var(--hover-bg);
}

.molecular-add-fragment>summary>span {
    display: grid;
    gap: 0.15rem;
}

.molecular-add-fragment .nested-panel-body {
    padding: 1rem;
}

.molecular-add-fragment .form-section {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
}

.molecular-add-fragment .form-section:first-child {
    padding-top: 0;
    border-top: 0;
}

.molecular-add-fragment .form-section-header h3 {
    margin: 0;
    font-size: 1rem;
}

.molecular-add-fragment .form-section-header p {
    margin: 0.25rem 0 0;
}

/* -------------------------------------------------------------------------
   Simulation
   ------------------------------------------------------------------------- */

.molecular-simulate-form {
    margin: 0;
}

.assembly-simulation-result {
    display: grid;
    gap: 1rem;
}

.assembly-result-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.assembly-result-summary .metadata-card {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--bg-subtle);
}

.assembly-result-summary .metadata-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.assembly-result-summary .metadata-value {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

/* -------------------------------------------------------------------------
   Plasmid creation
   ------------------------------------------------------------------------- */

.molecular-assembly-output-notice {
    margin: 0;
}

.molecular-assembly-output-notice p {
    margin: 0.25rem 0 0;
}

.molecular-create-plasmid-form {
    max-width: 60rem;
}

/* -------------------------------------------------------------------------
   Responsive behavior
   ------------------------------------------------------------------------- */

@media (max-width: 1000px) {
    .assembly-result-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .molecular-assembly-header .page-heading-row {
        display: grid;
        gap: 1rem;
    }

    .assembly-fragment-card {
        grid-template-columns: 2.5rem minmax(0, 1fr);
    }

    .assembly-fragment-actions {
        grid-column: 2;
    }

    .assembly-fragment-header {
        display: grid;
    }
}

@media (max-width: 640px) {
    .molecular-assembly-header {
        padding: 1rem;
    }

    .molecular-assembly-header .page-header-actions,
    .molecular-assembly-header .page-header-actions .button {
        width: 100%;
    }

    .molecular-assembly-header .page-header-actions .button {
        justify-content: center;
    }

    .assembly-fragment-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .assembly-fragment-order {
        width: 2rem;
        height: 2rem;
    }

    .assembly-fragment-actions {
        grid-column: auto;
    }

    .assembly-fragment-metadata,
    .assembly-result-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .assembly-fragment-notes {
        grid-column: auto;
    }

    .molecular-assembly-stage>.panel-header {
        display: grid;
        gap: 0.8rem;
    }

    .molecular-simulate-form,
    .molecular-simulate-form button {
        width: 100%;
    }
}

/* ==========================================================================
   Molecular Studio index
   ========================================================================== */

.molecular-studio-page {
    display: grid;
    gap: 1rem;
}

.molecular-studio-header {
    align-items: flex-end;
    display: flex;
    gap: 2rem;
    justify-content: space-between;
    min-height: 0;
    padding: 1.5rem;
}

.molecular-studio-header-copy {
    max-width: 54rem;
}

.molecular-studio-header-copy .breadcrumb {
    margin-bottom: 0.75rem;
}

.molecular-studio-header-copy .eyebrow-row {
    margin-bottom: 0.6rem;
}

.molecular-studio-header-copy h1 {
    margin: 0;
}

.molecular-studio-intro {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0.55rem 0 0;
    max-width: 48rem;
}

.molecular-studio-header-actions {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 0.6rem;
}

.molecular-studio-summary {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.molecular-summary-card {
    min-width: 0;
    padding: 1rem;
}

.molecular-summary-card strong,
.molecular-summary-card span {
    display: block;
}

.molecular-summary-card strong {
    color: var(--text);
    font-size: 0.95rem;
    margin-top: 0.3rem;
}

.molecular-summary-card p {
    line-height: 1.5;
    margin: 0.55rem 0 0;
}

.molecular-summary-kicker {
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.molecular-studio-section {
    min-width: 0;
    padding: 0;
}

.molecular-section-header {
    align-items: center;
    border-bottom: 1px solid var(--border);
    margin: 0;
    padding: 1.15rem 1.25rem;
}

.molecular-section-title-row {
    align-items: center;
    display: flex;
    gap: 0.55rem;
}

.molecular-section-title-row h2 {
    margin: 0;
}

.molecular-section-header p {
    margin: 0.25rem 0 0;
}

.molecular-project-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 1.25rem;
}

.molecular-project-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 12rem;
    padding: 1rem;
    text-decoration: none;
    transition:
        border-color 120ms ease,
        box-shadow 120ms ease,
        transform 120ms ease;
}

.molecular-project-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0.45rem 1rem rgba(15, 23, 42, 0.08);
    color: var(--text);
    transform: translateY(-1px);
}

.molecular-project-card-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.molecular-project-arrow {
    color: var(--muted);
    font-size: 1.1rem;
    transition: transform 120ms ease;
}

.molecular-project-card:hover .molecular-project-arrow {
    transform: translateX(0.2rem);
}

.molecular-project-card-body {
    flex: 1;
    padding: 1rem 0;
}

.molecular-project-card-body h3 {
    font-size: 1rem;
    margin: 0;
}

.molecular-project-card-body p {
    display: -webkit-box;
    line-height: 1.5;
    margin: 0.45rem 0 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.molecular-project-metrics {
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1.5rem;
    padding-top: 0.8rem;
}

.molecular-project-metrics>div {
    align-items: baseline;
    display: flex;
    gap: 0.3rem;
}

.molecular-studio-empty-state {
    border: 0;
    margin: 0;
    padding: 3rem 1.25rem;
}

.molecular-empty-mark {
    align-items: center;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    font-size: 0.7rem;
    font-weight: 800;
    height: 3rem;
    justify-content: center;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
    width: 3rem;
}

.molecular-primer-empty {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.25rem;
}

.molecular-primer-empty p {
    margin: 0.3rem 0 0;
}

.molecular-primer-name {
    font-weight: 700;
}

.molecular-table-action {
    text-align: right;
    width: 3rem;
}

.molecular-table-action a {
    align-items: center;
    border-radius: 0.35rem;
    color: var(--muted);
    display: inline-flex;
    height: 1.8rem;
    justify-content: center;
    text-decoration: none;
    width: 1.8rem;
}

.molecular-table-action a:hover {
    background: var(--hover-bg);
    color: var(--text);
}

@media (max-width: 1100px) {
    .molecular-studio-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .molecular-project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .molecular-studio-header {
        align-items: stretch;
        flex-direction: column;
        gap: 1rem;
    }

    .molecular-studio-header-actions {
        flex-wrap: wrap;
    }

    .molecular-studio-summary,
    .molecular-project-grid {
        grid-template-columns: 1fr;
    }

    .molecular-section-header,
    .molecular-primer-empty {
        align-items: stretch;
        flex-direction: column;
    }

    .molecular-section-header .button-row,
    .molecular-studio-header-actions {
        width: 100%;
    }

    .molecular-section-header .button,
    .molecular-studio-header-actions .button {
        justify-content: center;
    }
}


/* ==========================================================================
   Molecular Studio — sequence import
   ========================================================================== */

.molecular-sequence-import-page {
    display: grid;
    gap: 1rem;
}

.molecular-import-header {
    align-items: flex-end;
    display: flex;
    gap: 2rem;
    justify-content: space-between;
    padding: 1.5rem;
}

.molecular-import-header-copy {
    max-width: 56rem;
}

.molecular-import-header-copy .eyebrow-row {
    margin-bottom: 0.6rem;
}

.molecular-import-header h1 {
    margin: 0;
}

.molecular-import-intro {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0.55rem 0 0;
    max-width: 52rem;
}

.molecular-import-header-actions {
    flex: 0 0 auto;
}

.molecular-import-benefits {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.molecular-import-benefit {
    min-width: 0;
    padding: 1rem;
}

.molecular-import-benefit strong,
.molecular-import-benefit span {
    display: block;
}

.molecular-import-benefit strong {
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.molecular-import-benefit p {
    line-height: 1.5;
    margin: 0.5rem 0 0;
}

.molecular-import-benefit-label,
.molecular-import-sidebar-label {
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.molecular-import-form {
    display: grid;
    gap: 1rem;
}

.molecular-import-layout {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 19rem);
}

.molecular-import-main,
.molecular-import-sidebar {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.molecular-import-section {
    min-width: 0;
    overflow: hidden;
    padding: 0;
}

.molecular-import-section-header {
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 1.25rem;
}

.molecular-import-section-header h2 {
    font-size: 1.05rem;
    margin: 0.2rem 0 0;
}

.molecular-import-section-header p {
    line-height: 1.5;
    margin: 0.3rem 0 0;
    max-width: 48rem;
}

.molecular-import-step {
    color: var(--primary);
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.molecular-import-section-body {
    display: grid;
    gap: 1.25rem;
    padding: 1.25rem;
}

.molecular-import-section-body .form-grid {
    margin: 0;
}

.molecular-import-section-body .field-group {
    min-width: 0;
}

.molecular-import-section-body label {
    align-items: baseline;
    display: flex;
    gap: 0.4rem;
}

.label-optional {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 400;
}

.field-hint {
    color: var(--muted);
    display: block;
    font-size: 0.74rem;
    line-height: 1.45;
    margin-top: 0.4rem;
}

.molecular-import-source-grid {
    align-items: stretch;
    display: grid;
    gap: 1rem;
    grid-template-columns:
        minmax(15rem, 0.8fr) auto minmax(0, 1.5fr);
}

.molecular-file-field,
.molecular-paste-field {
    margin: 0;
}

.molecular-file-dropzone {
    align-items: center;
    background: var(--bg-subtle);
    border: 1px dashed var(--border-muted);
    border-radius: 0.75rem;
    cursor: pointer;
    display: flex;
    gap: 0.8rem;
    min-height: 8.5rem;
    overflow: hidden;
    padding: 1rem;
    position: relative;
    transition:
        background 120ms ease,
        border-color 120ms ease;
}

.molecular-file-dropzone:hover,
.molecular-file-dropzone:focus-within {
    background: var(--hover-bg);
    border-color: var(--primary);
}

.molecular-file-dropzone.has-file {
    border-style: solid;
    border-color: var(--primary);
}

.molecular-file-dropzone input[type="file"] {
    cursor: pointer;
    inset: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
}

.molecular-file-dropzone-mark {
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    color: var(--primary);
    display: inline-flex;
    flex: 0 0 auto;
    height: 2.75rem;
    justify-content: center;
    width: 2.75rem;
}

.molecular-file-dropzone-mark svg {
    height: 1.4rem;
    width: 1.4rem;
}

.molecular-file-dropzone-copy {
    min-width: 0;
}

.molecular-file-dropzone-copy strong,
.molecular-file-dropzone-copy span {
    display: block;
}

.molecular-file-dropzone-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.molecular-file-dropzone-copy span {
    margin-top: 0.25rem;
}

.molecular-file-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.68rem;
    gap: 0.4rem 0.8rem;
    justify-content: space-between;
    margin-top: 0.4rem;
}

.molecular-import-source-divider {
    align-items: center;
    color: var(--muted);
    display: flex;
    justify-content: center;
    padding-top: 1.8rem;
    position: relative;
    width: 2rem;
}

.molecular-import-source-divider::before,
.molecular-import-source-divider::after {
    background: var(--border);
    content: "";
    height: calc(50% - 1.5rem);
    left: 50%;
    position: absolute;
    width: 1px;
}

.molecular-import-source-divider::before {
    top: 1.8rem;
}

.molecular-import-source-divider::after {
    bottom: 0;
}

.molecular-import-source-divider span {
    background: var(--panel);
    font-size: 0.7rem;
    padding: 0.35rem 0;
    position: relative;
    text-transform: uppercase;
    z-index: 1;
}

.molecular-import-sequence-input {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.82rem;
    line-height: 1.65;
    min-height: 15rem;
    resize: vertical;
    white-space: pre;
}

.molecular-sequence-input-footer {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 0.4rem;
}

.molecular-import-format-note {
    align-items: flex-start;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem;
}

.molecular-import-format-note-icon {
    align-items: center;
    border: 1px solid var(--border-muted);
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 800;
    height: 1.6rem;
    justify-content: center;
    width: 1.6rem;
}

.molecular-import-format-note p {
    line-height: 1.5;
    margin: 0.25rem 0 0;
}

.molecular-import-sidebar {
    position: sticky;
    top: 1rem;
}

.molecular-import-sidebar-card {
    padding: 1rem;
}

.molecular-import-sidebar-card h2 {
    font-size: 0.95rem;
    margin: 0.3rem 0 0;
}

.molecular-import-sidebar-card>p {
    line-height: 1.55;
    margin: 0.55rem 0 0;
}

.molecular-import-checklist {
    display: grid;
    gap: 0.65rem;
    list-style: none;
    margin: 0.9rem 0 0;
    padding: 0;
}

.molecular-import-checklist li {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
    padding-left: 1.25rem;
    position: relative;
}

.molecular-import-checklist li::before {
    color: var(--primary);
    content: "✓";
    font-size: 0.72rem;
    font-weight: 800;
    left: 0;
    position: absolute;
    top: 0.05rem;
}

.molecular-import-status-list {
    border-top: 1px solid var(--border);
    display: grid;
    gap: 0.55rem;
    margin-top: 0.9rem;
    padding-top: 0.8rem;
}

.molecular-import-status-list>div {
    align-items: center;
    display: flex;
    font-size: 0.76rem;
    gap: 0.5rem;
}

.molecular-import-status-list .status-dot {
    border-radius: 999px;
    display: inline-block;
    height: 0.45rem;
    width: 0.45rem;
}

.molecular-import-status-list .status-dot.completed {
    background: var(--color-completed);
}

.molecular-import-status-list .status-dot.pending {
    background: var(--color-pending);
}

.molecular-import-actions {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

.molecular-import-actions-copy strong,
.molecular-import-actions-copy span {
    display: block;
}

.molecular-import-actions-copy span {
    margin-top: 0.15rem;
}

@media (max-width: 1100px) {
    .molecular-import-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .molecular-import-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        position: static;
    }
}

@media (max-width: 820px) {
    .molecular-import-header {
        align-items: stretch;
        flex-direction: column;
        gap: 1rem;
    }

    .molecular-import-benefits {
        grid-template-columns: 1fr;
    }

    .molecular-import-source-grid {
        grid-template-columns: 1fr;
    }

    .molecular-import-source-divider {
        height: 2rem;
        padding: 0;
        width: 100%;
    }

    .molecular-import-source-divider::before,
    .molecular-import-source-divider::after {
        height: 1px;
        top: 50%;
        width: calc(50% - 1.5rem);
    }

    .molecular-import-source-divider::before {
        left: 0;
    }

    .molecular-import-source-divider::after {
        left: auto;
        right: 0;
    }

    .molecular-import-source-divider span {
        padding: 0 0.5rem;
    }

    .molecular-import-sidebar {
        grid-template-columns: 1fr;
    }

    .molecular-import-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .molecular-import-actions .button-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .molecular-import-actions .button {
        justify-content: center;
    }
}

@media (max-width: 560px) {

    .molecular-import-section-header,
    .molecular-import-section-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .molecular-sequence-input-footer,
    .molecular-file-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .molecular-import-actions .button-row {
        grid-template-columns: 1fr;
        width: 100%;
    }
}


.ai-project-scaffold-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.ai-project-scaffold-modal[hidden] {
    display: none;
}

.ai-project-scaffold-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(31 42 42 / 0.58);
    backdrop-filter: blur(4px);
}

.ai-project-scaffold-dialog {
    position: relative;
    width: min(920px, 100%);
    max-height: min(860px, calc(100vh - 3rem));
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--panel);
    box-shadow: 0 1.5rem 4rem rgb(31 42 42 / 0.24);
}

.ai-project-scaffold-header,
.ai-project-scaffold-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.ai-project-scaffold-header {
    border-bottom: 1px solid var(--border);
}

.ai-project-scaffold-footer {
    position: sticky;
    bottom: 0;
    align-items: center;
    border-top: 1px solid var(--border);
    background: var(--panel);
}

.ai-project-scaffold-footer-actions {
    display: flex;
    gap: 0.75rem;
}

.ai-project-scaffold-progress {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}

.ai-project-scaffold-progress-track {
    height: 0.35rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border-muted);
}

.ai-project-scaffold-progress-bar {
    width: 33.333%;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 180ms ease;
}

.ai-project-scaffold-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}

.ai-project-scaffold-steps li {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
}

.ai-project-scaffold-steps li.is-active {
    color: var(--text);
}

.ai-project-scaffold-stage {
    padding: 1.5rem;
}

.ai-project-scaffold-stage textarea {
    min-height: 12rem;
    resize: vertical;
}

.ai-project-scaffold-summary {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.ai-project-scaffold-summary>div {
    display: grid;
    gap: 0.3rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg-subtle);
}

.ai-project-scaffold-review-list {
    display: grid;
    gap: 0.75rem;
}

.ai-project-scaffold-fragment {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: start;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.ai-project-scaffold-fragment-order {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    font-weight: 700;
}

.ai-project-scaffold-fragment-copy {
    display: grid;
    gap: 0.35rem;
}

.ai-project-scaffold-fragment-meta {
    color: var(--muted);
    font-size: 0.86rem;
}

.ai-project-scaffold-json {
    margin-top: 1rem;
}

.ai-project-scaffold-json pre {
    max-height: 18rem;
    overflow: auto;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg-subtle);
    white-space: pre-wrap;
}

body.ai-project-scaffold-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .ai-project-scaffold-modal {
        padding: 0;
    }

    .ai-project-scaffold-dialog {
        width: 100%;
        max-height: 100vh;
        min-height: 100vh;
        border-radius: 0;
    }

    .ai-project-scaffold-summary {
        grid-template-columns: 1fr;
    }

    .ai-project-scaffold-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .ai-project-scaffold-footer-actions {
        display: grid;
    }
}

/* SEQUENCE PREVIEW */

.sequence-preview {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--panel);
}

.sequence-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.sequence-preview-header h3 {
    margin: 0.2rem 0 0;
}

.sequence-preview-header p {
    margin: 0.4rem 0 0;
}

.sequence-preview-badges {
    justify-content: flex-end;
    flex-shrink: 0;
}

.sequence-preview-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.sequence-preview-stat {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--bg);
}

.sequence-preview-stat-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sequence-preview-stat strong {
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.sequence-preview-visualization {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg);
}

.sequence-preview-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
}

.sequence-preview-map-toolbar .button-group,
.sequence-preview-map-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.sequence-preview-map-toolbar .button.active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--panel);
}

.sequence-preview-map {
    position: relative;
    min-height: 16rem;
    padding: 1rem;
}

.sequence-preview-linear-map {
    overflow-x: auto;
}

.sequence-preview-linear-canvas {
    position: relative;
    min-width: 42rem;
    height: 13rem;
}

.sequence-preview-ruler {
    position: absolute;
    top: 1.25rem;
    right: 1rem;
    left: 1rem;
    height: 2.4rem;
    border-top: 3px solid var(--primary);
}

.sequence-preview-ruler::before,
.sequence-preview-ruler::after {
    position: absolute;
    top: -0.45rem;
    width: 2px;
    height: 0.8rem;
    background: var(--primary);
    content: "";
}

.sequence-preview-ruler::before {
    left: 0;
}

.sequence-preview-ruler::after {
    right: 0;
}

.sequence-preview-ruler-tick {
    position: absolute;
    top: -0.35rem;
    width: 1px;
    height: 0.7rem;
    background: var(--border-muted);
    transform: translateX(-50%);
}

.sequence-preview-ruler-label {
    position: absolute;
    top: 0.75rem;
    color: var(--muted);
    font-size: 0.72rem;
    white-space: nowrap;
    transform: translateX(-50%);
}

.sequence-preview-feature-tracks {
    position: absolute;
    top: 4.75rem;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
}

.sequence-preview-feature {
    position: absolute;
    top: calc(var(--feature-track, 0) * 2.25rem);
    left: var(--feature-left, 0%);
    width: max(var(--feature-width, 1%), 0.8rem);
    height: 1.7rem;
    overflow: hidden;
    padding: 0 0.5rem;
    border: 0;
    border-radius: 0.4rem;
    background: var(--primary);
    color: var(--panel);
    cursor: pointer;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.7rem;
    text-align: left;
    white-space: nowrap;
}

.sequence-preview-feature:hover,
.sequence-preview-feature:focus-visible,
.sequence-preview-feature.is-active {
    filter: brightness(0.92);
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.sequence-preview-feature-forward {
    clip-path: polygon(0 0,
            calc(100% - 0.65rem) 0,
            100% 50%,
            calc(100% - 0.65rem) 100%,
            0 100%);
}

.sequence-preview-feature-reverse {
    clip-path: polygon(0.65rem 0,
            100% 0,
            100% 100%,
            0.65rem 100%,
            0 50%);
}

.sequence-preview-feature-promoter,
.sequence-preview-feature-regulatory,
.sequence-preview-feature-enhancer,
.sequence-preview-feature-operator {
    background: var(--color-pending);
}

.sequence-preview-feature-gene,
.sequence-preview-feature-cds,
.sequence-preview-feature-protein {
    background: var(--color-in-progress);
}

.sequence-preview-feature-terminator {
    background: var(--color-failed);
}

.sequence-preview-feature-origin_of_replication,
.sequence-preview-feature-rep_origin {
    background: var(--color-completed);
}

.sequence-preview-feature-selectable_marker,
.sequence-preview-feature-reporter {
    background: var(--color-contaminated);
}

.sequence-preview-feature-primer_binding_site,
.sequence-preview-feature-restriction_site {
    background: var(--primary);
}

.sequence-preview-empty-map {
    display: grid;
    place-items: center;
    min-height: 10rem;
    padding: 1rem;
    color: var(--muted);
    text-align: center;
}

.sequence-preview-circular-map {
    display: grid;
    place-items: center;
    min-height: 26rem;
}

.sequence-preview-circular-map[hidden],
.sequence-preview-linear-map[hidden] {
    display: none;
}

.sequence-preview-circular-map svg {
    display: block;
    width: min(100%, 32rem);
    height: auto;
    overflow: visible;
}

.sequence-preview-plasmid-backbone {
    fill: none;
    stroke: var(--border-muted);
    stroke-width: 14;
}

.sequence-preview-circular-feature {
    fill: none;
    stroke-width: 22;
    cursor: pointer;
}

.sequence-preview-circular-feature:hover,
.sequence-preview-circular-feature:focus {
    stroke-width: 28;
    outline: none;
}

.sequence-preview-circular-feature-label {
    fill: var(--text);
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}

.sequence-preview-plasmid-name {
    fill: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.sequence-preview-plasmid-length {
    fill: var(--muted);
    font-size: 13px;
}

.sequence-preview-feature-details,
.sequence-preview-sequence-details {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: var(--bg);
}

.sequence-preview-feature-details>summary,
.sequence-preview-sequence-details>summary {
    padding: 0.9rem 1rem;
    background: var(--panel);
    cursor: pointer;
}

.sequence-preview-feature-details>summary>span,
.sequence-preview-sequence-details>summary>span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.sequence-preview-feature-list {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--border);
}

.sequence-preview-feature-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sequence-preview-feature-row:last-child {
    border-bottom: 0;
}

.sequence-preview-feature-row:hover,
.sequence-preview-feature-row:focus-visible,
.sequence-preview-feature-row.is-active {
    background: var(--hover-bg);
}

.sequence-preview-feature-symbol {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    background: var(--primary);
}

.sequence-preview-feature-copy {
    display: grid;
    min-width: 0;
}

.sequence-preview-sequence-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
}

.sequence-preview-wrap-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.85rem;
}

.sequence-preview-sequence {
    max-height: 24rem;
    margin: 0;
    padding: 1rem;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg-subtle);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow: auto;
    font-size: 0.82rem;
    line-height: 1.75;
}

.sequence-preview-sequence.no-wrap {
    white-space: pre;
    overflow-wrap: normal;
}

.sequence-preview-tooltip {
    position: fixed;
    z-index: 1000;
    max-width: 18rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    background: var(--text);
    color: var(--panel);
    box-shadow: 0 0.4rem 1.25rem rgb(0 0 0 / 15%);
    font-size: 0.78rem;
    pointer-events: none;
}

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

    .sequence-preview-header,
    .sequence-preview-map-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .sequence-preview-badges {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .sequence-preview {
        padding: 0.85rem;
    }

    .sequence-preview-stat-grid {
        grid-template-columns: 1fr;
    }

    .sequence-preview-feature-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .sequence-preview-feature-row code,
    .sequence-preview-feature-row .badge {
        grid-column: 2;
        justify-self: start;
    }

    .sequence-preview-sequence-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ---------------------------------------------------------------------
       New molecular design project
       Scoped beneath .molecular-project-create-page.
    --------------------------------------------------------------------- */

.molecular-project-create-page {
    display: grid;
    gap: 1.5rem;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.molecular-project-create-page *,
.molecular-project-create-page *::before,
.molecular-project-create-page *::after {
    box-sizing: border-box;
}

/* ---------------------------------------------------------------------
       Header
    --------------------------------------------------------------------- */

.molecular-project-create-page .molecular-create-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.molecular-project-create-page .molecular-create-heading {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
}

.molecular-project-create-page .molecular-create-icon {
    display: inline-flex;
    width: 3.25rem;
    height: 3.25rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--radius) + 2px);
    background: var(--primary-subtle);
    color: var(--primary);
}

.molecular-project-create-page .molecular-create-icon svg {
    width: 1.65rem;
    height: 1.65rem;
    stroke: currentColor;
}

.molecular-project-create-page .molecular-create-heading-copy {
    min-width: 0;
}

.molecular-project-create-page .molecular-create-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.65rem;
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    line-height: 1.2;
    text-transform: uppercase;
}

.molecular-project-create-page .molecular-create-eyebrow::before {
    width: 0.45rem;
    height: 0.45rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--primary);
    content: "";
}

.molecular-project-create-page .molecular-create-title {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.molecular-project-create-page .molecular-create-description {
    max-width: 48rem;
    margin: 0.8rem 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.molecular-project-create-page .molecular-create-header-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ---------------------------------------------------------------------
       Workflow overview
    --------------------------------------------------------------------- */

.molecular-project-create-page .molecular-create-overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.molecular-project-create-page .molecular-create-overview-card {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 2px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.molecular-project-create-page .molecular-create-overview-number {
    display: inline-flex;
    width: 1.9rem;
    height: 1.9rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.molecular-project-create-page .molecular-create-overview-copy {
    min-width: 0;
}

.molecular-project-create-page .molecular-create-overview-copy strong {
    display: block;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 750;
    line-height: 1.4;
}

.molecular-project-create-page .molecular-create-overview-copy span {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

/* ---------------------------------------------------------------------
       Form shell
    --------------------------------------------------------------------- */

.molecular-project-create-page .molecular-create-form {
    display: grid;
    gap: 1.5rem;
}

.molecular-project-create-page .molecular-form-section {
    display: grid;
    grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
    gap: 2rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.molecular-project-create-page .molecular-section-intro {
    min-width: 0;
}

.molecular-project-create-page .molecular-section-number {
    display: inline-flex;
    width: 1.9rem;
    height: 1.9rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    border-radius: 999px;
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.molecular-project-create-page .molecular-section-title {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 750;
    letter-spacing: -0.015em;
    line-height: 1.35;
}

.molecular-project-create-page .molecular-section-description {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.molecular-project-create-page .molecular-section-fields {
    display: grid;
    gap: 1.2rem;
    min-width: 0;
}

/* ---------------------------------------------------------------------
       Fields
    --------------------------------------------------------------------- */

.molecular-project-create-page .molecular-field {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.molecular-project-create-page .molecular-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.molecular-project-create-page .molecular-field-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.4;
}

.molecular-project-create-page .molecular-field-optional {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.molecular-project-create-page .molecular-field input,
.molecular-project-create-page .molecular-field select,
.molecular-project-create-page .molecular-field textarea {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.molecular-project-create-page .molecular-field textarea {
    resize: vertical;
}

.molecular-project-create-page .molecular-field-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.molecular-project-create-page .molecular-field-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}

.molecular-project-create-page .molecular-field-callout svg {
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
    margin-top: 0.1rem;
    color: var(--primary);
    stroke: currentColor;
}

.molecular-project-create-page .molecular-field-callout p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

/* ---------------------------------------------------------------------
       Footer actions
    --------------------------------------------------------------------- */

.molecular-project-create-page .molecular-create-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.molecular-project-create-page .molecular-create-footer-copy {
    min-width: 0;
}

.molecular-project-create-page .molecular-create-footer-copy strong {
    display: block;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.4;
}

.molecular-project-create-page .molecular-create-footer-copy span {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.molecular-project-create-page .molecular-create-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.molecular-project-create-page .molecular-create-submit {
    min-width: 12rem;
}

/* ---------------------------------------------------------------------
       Accessibility and responsive behavior
    --------------------------------------------------------------------- */

.molecular-project-create-page a:focus-visible,
.molecular-project-create-page button:focus-visible,
.molecular-project-create-page input:focus-visible,
.molecular-project-create-page select:focus-visible,
.molecular-project-create-page textarea:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .molecular-project-create-page .molecular-create-overview {
        grid-template-columns: minmax(0, 1fr);
    }

    .molecular-project-create-page .molecular-form-section {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
    }

    .molecular-project-create-page .molecular-section-intro {
        max-width: 44rem;
    }
}

@media (max-width: 760px) {

    .molecular-project-create-page .molecular-create-header,
    .molecular-project-create-page .molecular-create-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .molecular-project-create-page .molecular-create-header-actions,
    .molecular-project-create-page .molecular-create-actions {
        width: 100%;
    }

    .molecular-project-create-page .molecular-create-header-actions .button,
    .molecular-project-create-page .molecular-create-actions .button {
        flex: 1 1 auto;
    }

    .molecular-project-create-page .molecular-field-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .molecular-project-create-page {
        gap: 1rem;
    }

    .molecular-project-create-page .molecular-create-header,
    .molecular-project-create-page .molecular-form-section,
    .molecular-project-create-page .molecular-create-footer {
        padding: 1.1rem;
    }

    .molecular-project-create-page .molecular-create-heading {
        flex-direction: column;
    }

    .molecular-project-create-page .molecular-create-header-actions,
    .molecular-project-create-page .molecular-create-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .molecular-project-create-page .molecular-create-header-actions .button,
    .molecular-project-create-page .molecular-create-actions .button,
    .molecular-project-create-page .molecular-create-submit {
        width: 100%;
    }
}/* =========================================================
   Shared note foundations
   ========================================================= */

.note-workspace,
.notes-page,
.note-view-page {
    min-width: 0;
}

.full-width {
    width: 100%;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;

    color: var(--text);
    font-size: 0.875rem;
    text-decoration: none;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.tag-pill:hover {
    background: var(--hover-bg);
    border-color: var(--border-muted);
}

.tag-pill.removable {
    cursor: pointer;
}

.tag-remove-form {
    display: inline;
}

/* =========================================================
      Rendered note document
      ========================================================= */

.note-rendered-document {
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.note-rendered-document> :first-child {
    margin-top: 0;
}

.note-rendered-document> :last-child {
    margin-bottom: 0;
}

.note-rendered-document img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1rem auto;

    border-radius: var(--radius);
}

.note-rendered-document pre {
    max-width: 100%;
    padding: 1rem;
    overflow-x: auto;

    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.note-rendered-document table {
    width: 100%;
    border-collapse: collapse;
}

.note-rendered-document th,
.note-rendered-document td {
    padding: 0.5rem;
    border: 1px solid var(--border);
}

.note-rendered-document th {
    background: var(--bg-subtle);
}

.note-rendered-document blockquote {
    margin-left: 0;
    padding-left: 1rem;

    color: var(--muted);
    border-left: 3px solid var(--border-muted);
}

.note-rendered-document input[type="checkbox"] {
    width: auto;
    margin-right: 0.4rem;
}

/* =========================================================
      Note editor workspace
      ========================================================= */

.note-workspace {
    width: 100%;
}

.note-document-form {
    display: block;
    width: 100%;
    margin: 0;
}

.note-app-header {
    position: sticky;
    top: 0;
    z-index: 40;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    min-height: 72px;
    padding: 0.75rem 1.25rem;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}

.note-app-header-main {
    display: flex;
    align-items: center;
    gap: 0.9rem;

    flex: 1 1 auto;
    min-width: 0;
}

.note-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;
    width: 34px;
    height: 34px;

    color: var(--text);
    border-radius: var(--radius);
    text-decoration: none;
}

.note-back-button:hover {
    background: var(--hover-bg);
}

.note-title-group {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.25rem;

    min-width: 0;
}

.note-title-input {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0.2rem 0;

    color: var(--text);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;

    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.note-title-input:focus {
    outline: none;
    border: 0;
    box-shadow: none;
}

.note-document-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;

    color: var(--muted);
    font-size: 0.82rem;
}

.note-visibility-control {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.note-visibility-control input {
    width: auto;
    margin: 0;
}

.note-save-status.is-dirty {
    color: var(--color-contaminated);
}

.note-app-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;

    flex: 0 0 auto;
}

.note-app-actions .button {
    margin: 0;
    white-space: nowrap;
}

/* =========================================================
      Editor toolbar
      ========================================================= */

.note-toolbar-wrapper {
    position: sticky;
    top: 73px;
    z-index: 35;

    width: 100%;
    padding: 0.45rem 0.75rem;

    background: var(--panel);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.note-toolbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;

    width: 100%;
    min-width: 0;

    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.note-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;

    flex: 0 0 auto;
}

.note-toolbar-divider {
    display: block;
    flex: 0 0 auto;

    width: 1px;
    height: 24px;
    margin: 0 0.25rem;

    background: var(--border);
}

.note-toolbar-spacer {
    flex: 1 1 auto;
    min-width: 1rem;
}

.note-tool-button,
.note-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;

    min-width: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0.35rem 0.55rem;

    color: var(--text);
    white-space: nowrap;
    line-height: 1;

    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
}

.note-tool-button:hover,
.note-view-button:hover {
    background: var(--hover-bg);
    border-color: var(--border);
}

.note-tool-button:focus-visible,
.note-view-button:focus-visible {
    border-color: var(--primary);
    outline: 2px solid var(--primary-subtle);
    outline-offset: 1px;
}

.note-format-select {
    width: auto;
    min-width: 140px;
    max-width: 180px;
    height: 34px;
    margin: 0;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.note-view-switcher {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;

    flex: 0 0 auto;
    padding: 0.2rem;

    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.note-view-button.active {
    color: var(--text);
    background: var(--panel);
    border-color: var(--border-muted);
    box-shadow: var(--shadow);
}

/* =========================================================
      Workspace layout
      ========================================================= */

.note-workspace-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    align-items: start;
    gap: 1rem;

    width: 100%;
    min-width: 0;
    padding: 1rem;

    background: var(--bg);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
}

.note-editor-area,
.note-source-pane,
.note-preview-pane {
    min-width: 0;
}

.note-document-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;

    width: 100%;
    min-width: 0;
}

.note-document-shell[data-current-view="split"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.note-source-pane[hidden],
.note-preview-pane[hidden] {
    display: none !important;
}

.note-page {
    width: min(100%, 920px);
    min-height: calc(100vh - 245px);
    margin: 0 auto;
    padding: 3.5rem 4rem;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.note-document-editor {
    display: block;
    width: 100%;
    min-height: calc(100vh - 340px);
    margin: 0;
    padding: 0;

    resize: vertical;

    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.7;

    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.note-document-editor:focus {
    outline: none;
    border: 0;
    box-shadow: none;
}

.note-document-editor::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

/* =========================================================
      Inspector
      ========================================================= */

.note-inspector {
    position: sticky;
    top: 132px;

    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    min-width: 0;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.note-inspector-section {
    margin: 0;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.note-inspector-section>summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;

    padding: 0.75rem 0.85rem;

    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.note-inspector-section>summary::-webkit-details-marker {
    display: none;
}

.note-inspector-section>summary::after {
    content: "⌄";
    margin-left: auto;

    color: var(--muted);
    transition: transform 120ms ease;
}

.note-inspector-section[open]>summary::after {
    transform: rotate(180deg);
}

.note-inspector-body {
    padding: 0 0.85rem 0.85rem;
}

.note-detail-list {
    display: grid;
    gap: 0.65rem;
    margin: 0;
}

.note-detail-list>div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
}

.note-detail-list dt {
    color: var(--muted);
}

.note-detail-list dd {
    margin: 0;
    text-align: right;
    overflow-wrap: anywhere;
}

.note-embed-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.note-embed-shortcuts button {
    width: 100%;
    margin: 0;
    padding: 0.5rem;

    text-align: left;
    white-space: normal;
}

/* =========================================================
      Editable tags and files
      ========================================================= */

.note-tags.editable {
    gap: 0.4rem;
}

.note-tag-item {
    display: inline-flex;
    align-items: center;

    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.note-tag-item .tag-pill {
    border: 0;
    border-radius: 0;
}

.tag-remove-trigger {
    width: 28px;
    min-width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;

    color: var(--muted);

    background: transparent;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
}

.tag-remove-trigger:hover {
    color: var(--danger);
    background: var(--danger-subtle);
}

.note-tag-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.note-tag-entry input,
.note-tag-entry button {
    margin: 0;
}

.note-file-list {
    display: grid;
    gap: 0.5rem;

    margin: 0 0 0.75rem;
    padding: 0;

    list-style: none;
}

.note-file-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;

    padding: 0.5rem;

    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.note-file-row-main {
    min-width: 0;
}

.note-file-embed-button {
    margin: 0;
    padding: 0.35rem 0.5rem;
}

/* =========================================================
      Embedded records
      ========================================================= */

.note-data-embed {
    display: block;
    margin: 1.25rem 0;
    padding: 0;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.note-data-embed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    padding: 0.65rem 0.85rem;

    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
}

.note-data-embed-kind {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.note-data-embed-type {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.note-data-embed-body {
    padding: 0.85rem;
}

.note-data-embed-title {
    display: inline-block;

    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
}

.note-data-embed-description,
.note-data-embed-caption {
    margin: 0.4rem 0 0;
}

.note-data-embed-caption {
    color: var(--muted);
    font-style: italic;
}

.note-data-embed.compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    padding: 0.6rem 0.75rem;
}

.note-data-embed.missing {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;

    padding: 0.75rem;

    background: var(--bg-subtle);
    border-style: dashed;
}

/* =========================================================
      Note dialogs
      ========================================================= */

.note-dialog {
    width: min(680px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 0;

    color: var(--text);
    background: transparent;
    border: 0;
}

.note-dialog::backdrop {
    background: rgb(0 0 0 / 65%);
}

.note-dialog-card {
    display: flex;
    flex-direction: column;

    max-height: calc(100vh - 2rem);
    margin: 0;
    padding: 0;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.note-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;

    padding: 1rem 1.1rem;

    border-bottom: 1px solid var(--border);
}

.note-dialog-header h2,
.note-dialog-header p {
    margin-top: 0;
}

.dialog-close-button {
    flex: 0 0 auto;

    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
}

.note-dialog-content {
    display: grid;
    gap: 1rem;

    padding: 1rem 1.1rem;
    overflow-y: auto;
}

.note-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;

    padding: 0.85rem 1.1rem;

    border-top: 1px solid var(--border);
}

.note-dialog-actions button {
    margin: 0;
}

.note-embed-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
}

.note-embed-search-row input,
.note-embed-search-row button {
    margin: 0;
}

.note-embed-results {
    display: grid;
    gap: 0.4rem;

    min-height: 100px;
    max-height: 280px;
    padding: 0.4rem;

    overflow-y: auto;

    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.note-embed-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    width: 100%;
    margin: 0;
    padding: 0.65rem;

    color: var(--text);
    text-align: left;

    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
}

.note-embed-result:hover {
    background: var(--hover-bg);
    border-color: var(--border);
}

.note-embed-result.is-selected {
    background: var(--success-subtle);
    border-color: var(--success);
}

.note-embed-result-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.note-embed-result-main span,
.note-embed-result-type {
    color: var(--muted);
}

.note-embed-result-main span {
    font-size: 0.82rem;
}

.note-embed-result-type {
    flex: 0 0 auto;

    font-size: 0.76rem;
    text-transform: uppercase;
}

/* =========================================================
      Notes index
      ========================================================= */

.notes-page {
    display: grid;
    gap: 1rem;
}

.notes-page-header,
.notes-filter-panel,
.notes-result-section,
.notes-guidance {
    margin: 0;
}

.notes-page-heading,
.notes-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.notes-page-heading h1,
.notes-section-header h2 {
    margin: 0;
}

.notes-page-heading p,
.notes-section-header p {
    margin: 0.35rem 0 0;
}

.eyebrow {
    display: block;
    margin-bottom: 0.3rem;

    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notes-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    flex: 0 0 auto;
}

.notes-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.notes-summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;

    min-width: 0;
    padding: 0.85rem 1rem;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.notes-summary-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}

.notes-summary-label {
    color: var(--muted);
    font-size: 0.8rem;
}

/* =========================================================
      Notes filters
      ========================================================= */

.notes-filter-panel {
    position: relative;
    z-index: 20;
    overflow: visible;
}

.notes-filter-form {
    display: grid;
    grid-template-columns:
        minmax(320px, 2fr) minmax(180px, 0.8fr) minmax(220px, 1fr) auto;
    align-items: end;
    gap: 0.75rem;

    margin-top: 1rem;
    overflow: visible;
}

.notes-filter-form .form-field,
.notes-search-field {
    display: grid;
    gap: 0.35rem;
    margin: 0;
}

.notes-filter-form label {
    font-size: 0.82rem;
    font-weight: 600;
}

.notes-search-input {
    position: relative;
}

.notes-search-input input {
    width: 100%;
    margin: 0;
    padding-left: 2.2rem;
}

.notes-search-icon {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    z-index: 1;

    color: var(--muted);
    pointer-events: none;

    transform: translateY(-50%);
}

.notes-filter-form select {
    width: 100%;
    margin: 0;
}

.field-help {
    color: var(--muted);
    font-size: 0.72rem;
}

.notes-filter-actions {
    display: flex;
    align-items: center;
}

.notes-filter-actions .button {
    margin: 0;
    white-space: nowrap;
}

.notes-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;

    margin-top: 1rem;
    padding-top: 0.85rem;

    border-top: 1px solid var(--border);
    font-size: 0.8rem;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;

    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.notes-tag-filter {
    position: relative;
    z-index: 30;

    min-width: 0;
    overflow: visible;
}

.notes-filter-dropdown {
    position: relative;
    margin: 0;
    overflow: visible;
}

.notes-filter-dropdown>summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;

    min-height: 42px;
    padding: 0.55rem 0.75rem;

    cursor: pointer;
    list-style: none;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.notes-filter-dropdown>summary:hover {
    background: var(--hover-bg);
}

.notes-filter-dropdown>summary::-webkit-details-marker {
    display: none;
}

.notes-filter-dropdown[open]>summary {
    border-color: var(--border-muted);
}

.notes-filter-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 1000;

    width: max(100%, 260px);
    min-width: 260px;
    max-width: min(380px, calc(100vw - 2rem));
    max-height: min(320px, 50vh);
    padding: 0.5rem;

    overflow-x: hidden;
    overflow-y: auto;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.notes-filter-dropdown-menu>p {
    margin: 0;
    padding: 0.55rem;
}

.notes-tag-options {
    display: grid;
    gap: 0.25rem;
}

.notes-tag-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;

    margin: 0;
    padding: 0.5rem 0.55rem;

    cursor: pointer;
    border-radius: var(--radius);
}

.notes-tag-option:hover {
    background: var(--hover-bg);
}

.notes-tag-option input {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
}

.notes-tag-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* =========================================================
      Notes results
      ========================================================= */

.notes-results-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 1rem;
}

.notes-results-main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.notes-card-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.note-index-card {
    display: grid;
    min-width: 0;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;

    transition:
        border-color 120ms ease,
        transform 120ms ease,
        box-shadow 120ms ease;
}

.note-index-card:hover {
    border-color: var(--border-muted);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.note-index-card.organization-note {
    border-left: 3px solid var(--primary);
}

.note-index-card-main {
    min-width: 0;
    padding: 1rem;
}

.note-index-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.note-index-title-group {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.note-index-title {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.note-index-title:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.note-index-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.note-index-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;

    flex: 0 0 auto;
}

.note-index-actions .button {
    margin: 0;
}

.note-index-preview {
    display: -webkit-box;
    margin: 0.8rem 0 0;

    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.55;

    overflow: hidden;
    overflow-wrap: anywhere;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.note-index-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;

    padding: 0.65rem 1rem;

    color: var(--muted);
    background: var(--bg-subtle);
    border-top: 1px solid var(--border);
    font-size: 0.76rem;
}

.note-author {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* =========================================================
      Empty states and guidance
      ========================================================= */

.notes-section-empty {
    padding: 1.5rem 0 0;
}

.notes-empty-state {
    display: grid;
    justify-items: center;
    gap: 0.75rem;

    padding: 3rem 1.5rem;
    text-align: center;
}

.notes-empty-state h2,
.notes-empty-state p {
    margin: 0;
}

.notes-empty-icon {
    font-size: 2.5rem;
}

.notes-guidance {
    position: sticky;
    top: 1rem;
}

.notes-guidance h2 {
    margin-top: 0;
    font-size: 1rem;
}

.notes-guidance-list {
    display: grid;
    gap: 1rem;
}

.notes-guidance-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.65rem;
}

.notes-guidance-item p {
    margin: 0.25rem 0 0;
}

.notes-guidance-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    color: var(--primary-hover);
    background: var(--primary-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.notes-pagination {
    display: flex;
    justify-content: center;
}

/* =========================================================
      Read-only note view
      ========================================================= */

.note-view-page {
    display: grid;
    gap: 1rem;
}

.note-view-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;

    margin: 0;
    padding: 1rem 1.25rem;
}

.note-view-header-main {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;

    flex: 1 1 auto;
    min-width: 0;
}

.note-view-title-group {
    display: grid;
    flex: 1 1 auto;
    gap: 0.35rem;

    min-width: 0;
}

.note-view-title-group h1 {
    margin: 0;

    font-size: clamp(1.4rem, 2vw, 2rem);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.note-view-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;

    color: var(--muted);
    font-size: 0.8rem;
}

.note-view-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;

    flex: 0 0 auto;
}

.note-view-actions .button {
    margin: 0;
}

.note-view-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 1rem;

    min-width: 0;
}

.note-view-main {
    min-width: 0;
}

.note-view-document {
    width: min(100%, 920px);
    min-height: calc(100vh - 220px);
    margin: 0 auto;
    padding: 3.5rem 4rem;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.note-view-document h1,
.note-view-document h2,
.note-view-document h3,
.note-view-document h4 {
    scroll-margin-top: 1rem;
}

.note-view-document table {
    display: block;
    width: 100%;

    overflow-x: auto;
    border-collapse: collapse;
}

.note-view-sidebar {
    position: sticky;
    top: 1rem;

    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    min-width: 0;
}

.note-view-sidebar-section {
    margin: 0;
}

.note-view-sidebar-section h2 {
    margin: 0 0 0.8rem;
    font-size: 1rem;
}

.note-sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.note-sidebar-heading h2 {
    margin: 0;
}

.note-view-file-list {
    display: grid;
    gap: 0.5rem;

    margin: 0.75rem 0 0;
    padding: 0;

    list-style: none;
}

.note-view-file-item {
    min-width: 0;
    padding: 0.55rem;

    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.note-view-file-item a {
    overflow-wrap: anywhere;
}

/* =========================================================
      Read-only embedded records
      ========================================================= */

.note-view-document .note-data-embed {
    margin: 1.5rem 0;
}

.note-view-document .note-inline-embed {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;

    padding: 0.08rem 0.35rem;

    color: var(--text);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 0.3rem;
    text-decoration: none;
}

.note-view-document .note-inline-embed:hover {
    background: var(--hover-bg);
    border-color: var(--border-muted);
}

.note-view-document .note-data-embed.compact {
    display: flex;
    align-items: center;
    gap: 0.6rem;

    padding: 0.7rem 0.85rem;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.note-view-document .note-data-embed.table-embed {
    padding: 0.75rem;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.note-view-document .note-data-embed.table-embed table {
    display: table;
    margin: 0;
}

.note-view-document .note-data-embed.table-embed th {
    width: 130px;
    text-align: left;
}

.note-view-document .note-data-embed.missing {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;

    padding: 0.85rem;

    background: var(--bg-subtle);
    border: 1px dashed var(--border-muted);
    border-radius: var(--radius);
}

.note-view-document .note-data-embed.missing p {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

/* =========================================================
      Page actions and export menu
      ========================================================= */

.note-page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.action-menu {
    position: relative;
}

.action-menu>summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.action-menu>summary::-webkit-details-marker {
    display: none;
}

.action-menu>summary::after {
    content: "▾";
    margin-left: 0.45rem;
    font-size: 0.75em;
}

.action-menu[open]>summary::after {
    content: "▴";
}

.action-menu-popover {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 40;

    width: min(22rem, calc(100vw - 2rem));
    padding: 0.5rem;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.action-menu-popover a {
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;

    padding: 0.75rem;

    color: var(--text);
    border-radius: var(--radius);
    text-decoration: none;
}

.action-menu-icon {
    display: grid;
    place-items: center;

    min-height: 2rem;
    padding: 0.2rem;

    color: var(--muted);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.action-menu-popover a:hover,
.action-menu-popover a:focus-visible {
    background: var(--hover-bg);
}

.action-menu-popover strong,
.action-menu-popover small {
    display: block;
}

.action-menu-popover small {
    margin-top: 0.125rem;

    color: var(--muted);
    line-height: 1.35;
}

/* =========================================================
   Note sharing
   ========================================================= */

.note-share-created-result {
    margin-bottom: 1.25rem;
    padding: 1.1rem;

    background: var(--success-subtle);
    border: 1px solid var(--success);
    border-radius: var(--radius);
}

.note-share-created-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 1rem;
}

.note-share-created-result-header h3 {
    margin: 0.25rem 0 0.35rem;
}

.note-share-created-result-header p {
    margin: 0;
}

.note-share-page {
    min-width: 0;
}

.note-share-heading-row {
    align-items: flex-start;
    gap: 2rem;
}

.note-share-page .page-heading-copy {
    min-width: 0;
    max-width: 52rem;
}

.note-share-page .eyebrow-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.625rem;

    margin-bottom: 0.75rem;
}

.note-share-page .page-lead {
    max-width: 48rem;
    margin: 0.75rem 0 0;

    color: var(--muted);
    font-size: 1.025rem;
    line-height: 1.65;
}

.note-share-layout {
    align-items: start;
}

.note-share-layout .content-main,
.note-share-sidebar {
    min-width: 0;
}

.note-share-page .section-kicker {
    margin: 0 0 0.35rem;

    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.security-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;

    flex: 0 0 auto;
    padding: 0.45rem 0.7rem;

    color: var(--muted);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 999px;

    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.security-indicator-dot {
    width: 0.5rem;
    height: 0.5rem;

    background: var(--success);
    border: 3px solid var(--success-subtle);
    border-radius: 999px;
}

.note-share-form {
    margin-top: 1.25rem;
}

.note-share-page .optional-label {
    margin-left: 0.35rem;

    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.note-share-page .field-help {
    display: block;
    margin-top: 0.4rem;

    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.note-share-warning {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: 0.875rem;

    padding: 1rem;

    background: var(--warning-subtle);
    border: 1px solid var(--warning);
    border-radius: var(--radius);
}

.note-share-warning-icon {
    display: grid;
    place-items: center;

    width: 2rem;
    height: 2rem;

    color: var(--warning);
    background: var(--panel);
    border: 1px solid var(--warning);
    border-radius: 999px;

    font-weight: 800;
}

.note-share-warning strong {
    display: block;
    margin-bottom: 0.25rem;
}

.note-share-warning p {
    margin: 0;

    color: var(--muted);
    line-height: 1.55;
}

.note-share-form-actions {
    align-items: center;
    gap: 1rem;
}

.note-share-form-actions p {
    margin: 0;
}

.note-share-url-label {
    display: block;
    margin-bottom: 0.45rem;

    font-size: 0.82rem;
    font-weight: 700;
}

.note-share-url-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.55rem;
}

.note-share-url-input {
    width: 100%;
    min-width: 0;
    margin: 0;

    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
    font-size: 0.82rem;
}

.note-share-copy-button.copy-success {
    color: var(--success);
    background: var(--success-subtle);
    border-color: var(--success);
}

.note-share-copy-button:disabled {
    cursor: default;
    opacity: 1;
}

.note-share-list {
    display: grid;
    gap: 1rem;

    margin-top: 1rem;
}

.note-share-card {
    padding: 1.1rem;

    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.note-share-card-inactive {
    background: var(--bg-subtle);
    opacity: 0.78;
}

.note-share-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.note-share-card-header h3 {
    margin: 0.55rem 0 0;
    font-size: 1rem;
}

.note-share-card-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.note-share-created-label {
    color: var(--muted);
    font-size: 0.82rem;
}

.note-share-metadata {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;

    margin: 1rem 0 0;
}

.note-share-metadata>div {
    min-width: 0;
}

.note-share-metadata dt {
    margin-bottom: 0.3rem;

    color: var(--muted);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.note-share-metadata dd {
    margin: 0;

    color: var(--text);
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.note-share-empty-state {
    padding-block: 3rem;
}

.note-share-empty-state .empty-state-icon {
    display: grid;
    place-items: center;

    width: 2.75rem;
    height: 2.75rem;
    margin: 0 auto 0.9rem;

    color: var(--primary);
    background: var(--primary-subtle);
    border-radius: var(--radius);

    font-size: 1.3rem;
    font-weight: 700;
}

.note-share-sidebar {
    display: grid;
    gap: 1rem;
}

.note-share-summary-panel h2,
.note-share-protection-panel h2,
.note-share-guidance-panel h2 {
    margin-top: 0;
}

.note-share-detail-list {
    margin-top: 1rem;
}

.note-share-feature-list {
    display: grid;
    gap: 0.8rem;

    margin: 1rem 0 0;
    padding: 0;

    list-style: none;
}

.note-share-feature-list li {
    display: grid;
    grid-template-columns: 1.35rem minmax(0, 1fr);
    align-items: start;
    gap: 0.55rem;
}

.note-share-feature-list .feature-check {
    display: grid;
    place-items: center;

    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.05rem;

    color: var(--success);
    background: var(--success-subtle);
    border-radius: 999px;

    font-size: 0.75rem;
    font-weight: 800;
}



/* =========================================================
      Responsive layouts
      ========================================================= */

@media (max-width: 1100px) {

    .note-workspace-layout,
    .notes-results-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .note-inspector {
        position: static;

        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));

        max-height: none;
    }

    .notes-guidance {
        position: static;
    }

    .notes-guidance-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1050px) {
    .note-share-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .note-share-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .note-share-guidance-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 850px) {
    .notes-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .notes-filter-actions {
        align-self: end;
    }

    .notes-filter-dropdown-menu {
        width: min(340px, calc(100vw - 2rem));
        min-width: 0;
        max-height: 45vh;
    }
}

@media (max-width: 760px) {
    .note-app-header {
        position: static;

        align-items: flex-start;
        flex-direction: column;
    }

    .note-app-header-main,
    .note-app-actions {
        width: 100%;
    }

    .note-app-actions {
        justify-content: flex-end;
    }

    .note-toolbar-wrapper {
        position: static;
    }

    .note-toolbar-spacer,
    .note-toolbar-divider {
        display: none;
    }

    .note-workspace-layout {
        padding: 0.5rem;
    }

    .note-document-shell[data-current-view="split"] {
        grid-template-columns: minmax(0, 1fr);
    }

    .note-page,
    .note-view-document {
        min-height: 65vh;
        padding: 1.5rem 1.25rem;
    }

    .note-inspector,
    .note-view-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .note-view-switcher {
        margin-left: 0;
    }

    .note-view-header {
        flex-direction: column;
    }

    .note-view-actions {
        width: 100%;
    }

    .note-view-actions .button {
        flex: 1 1 auto;
        justify-content: center;
    }

    .note-share-heading-row {
        display: grid;
        gap: 1.25rem;
    }

    .note-share-page .note-page-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .note-share-created-result-header {
        flex-direction: column;
    }

    .note-share-metadata {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .note-share-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .note-share-guidance-panel {
        grid-column: auto;
    }
}


@media (max-width: 640px) {
    .note-page-actions {
        width: 100%;
    }

    .note-page-actions>.button,
    .note-page-actions>.action-menu {
        flex: 1 1 auto;
    }

    .action-menu>summary {
        justify-content: center;
        width: 100%;
    }

    .action-menu-popover {
        right: auto;
        left: 0;
    }
}

@media (max-width: 620px) {

    .notes-page-heading,
    .notes-section-header,
    .note-index-card-header {
        flex-direction: column;
    }

    .notes-header-actions,
    .note-index-actions {
        width: 100%;
    }

    .notes-header-actions .button,
    .note-index-actions .button {
        flex: 1 1 auto;
        justify-content: center;
    }

    .notes-summary-grid,
    .notes-filter-form,
    .notes-guidance-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .note-index-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .note-share-page .note-page-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .note-share-page .note-page-actions>.button,
    .note-share-page .note-page-actions>.action-menu {
        width: 100%;
    }

    .note-share-page .action-menu>summary {
        justify-content: center;
        width: 100%;
    }

    .note-share-page .action-menu-popover {
        right: auto;
        left: 0;
    }

    .note-share-page .form-grid.two-columns {
        grid-template-columns: minmax(0, 1fr);
    }

    .note-share-card-header {
        display: grid;
    }

    .note-share-card-header form,
    .note-share-card-header button {
        width: 100%;
    }

    .note-share-url-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .note-share-url-input {
        grid-column: 1 / -1;
    }

    .note-share-url-row .button {
        justify-content: center;
    }

    .note-share-metadata {
        grid-template-columns: minmax(0, 1fr);
    }

    .note-share-form-actions {
        align-items: stretch;
    }

    .note-share-form-actions .button {
        width: 100%;
    }
}.storage-panel {
    max-width: 42rem;
}

.storage-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.storage-panel-header h2 {
    margin-bottom: 0.2rem;
}

.storage-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    white-space: nowrap;
}

.storage-stat strong {
    font-size: 1rem;
    line-height: 1.1;
}

.storage-footer {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.usage-meter {
    height: 0.7rem;
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface-muted);
}

.usage-meter>div {
    height: 100%;
    border-radius: inherit;
}

.usage-meter.ok>div {
    background: var(--success);
}

.usage-meter.warning>div {
    background: var(--warning);
}

.usage-meter.danger>div {
    background: var(--danger);
}

.invite-link-cell {
    width: 116px;
}

.copy-field {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.copy-input {
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    padding: .35rem .25rem;
    color: transparent;
    cursor: default;
}

.copy-input:focus {
    color: var(--text);
    width: 280px;
    max-width: 280px;
    position: relative;
    z-index: 2;
}

.copy-button {
    flex-shrink: 0;
}


.organization-dashboard {
    display: grid;
    gap: 1.5rem;
    max-width: 1440px;
    margin: 0 auto;
}

.organization-dashboard *,
.organization-dashboard *::before,
.organization-dashboard *::after {
    box-sizing: border-box;
}

.organization-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--panel);
}

.organization-hero-copy {
    min-width: 0;
}

.organization-eyebrow {
    margin: 0 0 0.35rem;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.organization-hero h1 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.65rem);
    line-height: 1.05;
}

.organization-hero-description {
    max-width: 760px;
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.organization-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.organization-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.organization-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.organization-main,
.organization-sidebar {
    display: grid;
    gap: 1.5rem;
    min-width: 0;
}

.organization-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--panel);
}

.organization-card>summary {
    list-style: none;
    cursor: pointer;
}

.organization-card>summary::-webkit-details-marker {
    display: none;
}

.organization-card-header,
.organization-card>summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
}

.organization-card>summary:hover {
    background: var(--hover-bg);
}

.organization-card-heading {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    min-width: 0;
}

.organization-card-icon {
    display: inline-grid;
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg-subtle);
    font-size: 1.1rem;
}

.organization-card-title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.25;
}

.organization-card-description {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.organization-card-chevron {
    color: var(--muted);
    transition: transform 0.15s ease;
}

details[open]>summary .organization-card-chevron {
    transform: rotate(180deg);
}

.organization-card-body {
    padding: 0 1.35rem 1.35rem;
}

.organization-divider {
    height: 1px;
    margin: 0 0 1.25rem;
    border: 0;
    background: var(--border);
}

.organization-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.organization-field {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.organization-field-full {
    grid-column: 1 / -1;
}

.organization-field label {
    font-weight: 650;
}

.organization-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.organization-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.organization-warning-setting {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--bg-subtle);
}

.organization-warning-setting input {
    margin-top: 0.2rem;
}

.organization-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.organization-stat {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--bg);
}

.organization-stat-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.organization-stat-value {
    display: block;
    font-size: 1.35rem;
    line-height: 1.15;
}

.organization-storage {
    display: grid;
    gap: 1rem;
}

.organization-storage-summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-end;
}

.organization-storage-amount {
    text-align: right;
}

.organization-storage-amount strong,
.organization-storage-amount span {
    display: block;
}

.organization-storage-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.organization-section-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.organization-section-toolbar h3,
.organization-subsection h3 {
    margin: 0;
}

.organization-subsection {
    display: grid;
    gap: 1rem;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.organization-empty-state {
    display: grid;
    gap: 0.6rem;
    justify-items: start;
    padding: 1.25rem;
    border: 1px dashed var(--border-muted);
    border-radius: 0.8rem;
    background: var(--bg);
}

.organization-empty-state strong,
.organization-empty-state p {
    margin: 0;
}

.organization-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.organization-table-shell {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
}

.organization-table-shell .data-table {
    margin: 0;
    border: 0;
    border-radius: 0;
}

.organization-table-shell .data-table th,
.organization-table-shell .data-table td {
    vertical-align: middle;
}

.organization-member {
    display: grid;
    gap: 0.15rem;
    min-width: 140px;
}

.organization-member-actions,
.organization-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.organization-role-form {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    gap: 0.5rem;
    min-width: 220px;
}

.organization-certification-summary {
    display: grid;
    gap: 0.5rem;
    min-width: 150px;
}

.organization-invite-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
}

.organization-copy-field {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 0.5rem;
    min-width: 320px;
}

.organization-copy-field input {
    min-width: 0;
}

.organization-billing-plan {
    display: grid;
    gap: 1rem;
}

.organization-plan-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.organization-plan-name {
    margin: 0;
    font-size: 1.4rem;
}

.organization-callout {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--bg-subtle);
}

.organization-callout strong,
.organization-callout p {
    margin: 0;
}

.organization-callout p {
    margin-top: 0.35rem;
    color: var(--muted);
}

.organization-service-list {
    display: grid;
    gap: 0.75rem;
}

.organization-service {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
}

.organization-service:last-child {
    border-bottom: 0;
}

.organization-service-copy {
    min-width: 0;
}

.organization-service-copy strong,
.organization-service-copy span {
    display: block;
}

.organization-service-copy span {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.organization-danger-dialog {
    width: min(620px, calc(100vw - 2rem));
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--panel);
    color: var(--text);
}

.organization-danger-dialog::backdrop {
    background: var(--text);
    opacity: 0.45;
}

.organization-danger-dialog form {
    padding: 1.5rem;
}

.organization-danger-dialog h3 {
    margin-top: 0;
}

.organization-danger-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

@media (max-width: 1000px) {
    .organization-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .organization-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .organization-hero {
        grid-template-columns: 1fr;
    }

    .organization-hero-actions {
        justify-content: flex-start;
    }

    .organization-form-grid,
    .organization-stat-grid,
    .organization-sidebar,
    .organization-invite-grid {
        grid-template-columns: 1fr;
    }

    .organization-role-form,
    .organization-copy-field {
        grid-template-columns: 1fr;
        min-width: 220px;
    }

    .organization-card-header,
    .organization-card>summary {
        padding: 1rem;
    }

    .organization-card-body {
        padding: 0 1rem 1rem;
    }
}.level-0 {
    background: #888;
}

.level-1 {
    background: #4caf50;
}

.level-2 {
    background: #ff9800;
}

.level-3 {
    background: #f44336;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 4px 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.page-btn {
    min-width: 24px;
    padding: 3px;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    background: white;
    border: 1px solid var(--border-subtle);
    color: #374151;
    font-weight: 500;
    transition: left 0.2s ease, opacity 0.2s ease;
}

.page-btn:hover {
    background: var(--hover-bg);
    border-color: #d1d5db;
}

.page-btn.active {
    background: #111827;
    color: white;
    border-color: #111827;
    cursor: default;
}

.page-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-current {
    font-weight: 600;
    color: #374151;
}.plasmid-detail .title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metadata-panel {
    overflow: hidden;
}

.panel-summary {
    cursor: pointer;
    list-style: none;
}

.panel-summary::-webkit-details-marker {
    display: none;
}

.panel-summary-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.panel-summary h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(216px, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.metadata-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;

    min-width: 0;

    padding: 0.9rem;

    border: 1px solid var(--bg);
    border-radius: 0.9rem;

    background: var(--bg);

    box-shadow: var(--shadow);
}

.metadata-card-wide {
    grid-column: 1 / -1;
}

.metadata-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    color: var(--muted);
}

.metadata-value {
    font-size: 0.95rem;
    line-height: 1.4;

    color: var(--text);

    overflow-wrap: anywhere;
}

.metadata-empty {
    font-size: 0.9rem;
    color: var(--muted);
    font-style: italic;
}

.metadata-hash {
    display: block;

    width: 100%;

    padding: 0.7rem 0.8rem;

    overflow-x: auto;

    border: 1px solid var(--bg);
    border-radius: 0.7rem;

    background: var(--bg-elevated);

    font-size: 0.82rem;
    line-height: 1.45;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;

    color: var(--text);

    white-space: nowrap;
}

@media (max-width: 716px) {
    .panel-summary-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
    }
}

.plasmid-molecular-studio-panel {
    display: grid;
    gap: 1.25rem;
    border-color: var(--primary);
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--primary) 8%, var(--panel)),
            var(--panel) 55%);
}

.plasmid-studio-header,
.plasmid-studio-heading,
.section-heading-row,
.studio-release-summary,
.plasmid-studio-project-card,
.sequence-release-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.plasmid-studio-heading {
    justify-content: flex-start;
    align-items: flex-start;
}

.plasmid-studio-heading h2,
.plasmid-studio-heading p,
.plasmid-studio-editor-handoff h2,
.plasmid-studio-editor-handoff p {
    margin: 0;
}

.plasmid-studio-heading p,
.plasmid-studio-editor-handoff p {
    margin-top: 0.35rem;
}

.plasmid-studio-icon {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 2.75rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--panel);
    font-size: 1.25rem;
}

.plasmid-studio-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
}

.plasmid-studio-project-list {
    display: grid;
    gap: 0.65rem;
}

.plasmid-studio-project-card {
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
}

.plasmid-studio-project-card:hover {
    border-color: var(--primary);
    background: var(--hover-bg);
}

.plasmid-studio-project-main {
    display: grid;
    gap: 0.2rem;
}

.studio-release-summary {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg);
}

.studio-release-primary {
    display: grid;
    gap: 0.2rem;
}

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

@media (max-width: 640px) {

    .plasmid-studio-header,
    .plasmid-studio-heading,
    .section-heading-row,
    .studio-release-summary,
    .sequence-release-meta {
        align-items: stretch;
        flex-direction: column;
    }

    .plasmid-studio-heading {
        flex-direction: row;
    }

    .plasmid-studio-metrics {
        grid-template-columns: 1fr;
    }
}

.plasmid-create-page {
    display: grid;
    gap: 1.5rem;
    width: min(100%, 1280px);
    margin: 0 auto;
}

.plasmid-create-page *,
.plasmid-create-page *::before,
.plasmid-create-page *::after {
    box-sizing: border-box;
}

.plasmid-create-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--panel);
}

.plasmid-create-heading {
    min-width: 0;
}

.plasmid-create-eyebrow {
    margin: 0 0 0.35rem;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plasmid-create-hero h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.65rem);
    line-height: 1.05;
}

.plasmid-create-description {
    max-width: 760px;
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.plasmid-create-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.plasmid-create-form {
    display: grid;
    gap: 1.5rem;
}

.plasmid-create-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.plasmid-create-main,
.plasmid-create-sidebar {
    display: grid;
    gap: 1.5rem;
    min-width: 0;
}

.plasmid-create-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--panel);
}

.plasmid-create-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    border-bottom: 1px solid var(--border);
}

.plasmid-create-card-heading {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    min-width: 0;
}

.plasmid-create-card-icon {
    display: inline-grid;
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg-subtle);
    font-size: 1.1rem;
}

.plasmid-create-card-title {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.25;
}

.plasmid-create-card-description {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.plasmid-create-card-body {
    display: grid;
    gap: 1rem;
    padding: 1.35rem;
}

.plasmid-create-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.plasmid-create-grid.three-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plasmid-create-field {
    display: grid;
    gap: 0.45rem;
    align-content: start;
    min-width: 0;
}

.plasmid-create-field.full-width {
    grid-column: 1 / -1;
}

.plasmid-create-field label {
    font-weight: 650;
}

.plasmid-create-required {
    color: var(--color-failed);
}

.plasmid-create-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
}

.plasmid-create-sequence {
    min-height: 240px;
    resize: vertical;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.55;
    letter-spacing: 0.03em;
}

.plasmid-create-sequence-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.plasmid-create-note {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--bg-subtle);
}

.plasmid-create-note strong,
.plasmid-create-note p {
    margin: 0;
}

.plasmid-create-note p {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.plasmid-create-checklist {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.plasmid-create-checklist li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: flex-start;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.plasmid-create-checklist-marker {
    display: inline-grid;
    width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-subtle);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
}

.plasmid-create-actions {
    position: sticky;
    bottom: 1rem;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--panel);
}

.plasmid-create-actions-copy {
    min-width: 0;
}

.plasmid-create-actions-copy strong,
.plasmid-create-actions-copy span {
    display: block;
}

.plasmid-create-actions-copy span {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.plasmid-create-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

@media (max-width: 1000px) {
    .plasmid-create-layout {
        grid-template-columns: 1fr;
    }

    .plasmid-create-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .plasmid-create-hero {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }

    .plasmid-create-hero-actions {
        justify-content: flex-start;
    }

    .plasmid-create-grid,
    .plasmid-create-grid.three-column,
    .plasmid-create-sidebar {
        grid-template-columns: 1fr;
    }

    .plasmid-create-card-header,
    .plasmid-create-card-body {
        padding: 1rem;
    }

    .plasmid-create-actions {
        position: static;
        align-items: stretch;
    }

    .plasmid-create-action-buttons {
        width: 100%;
    }

    .plasmid-create-action-buttons .button,
    .plasmid-create-action-buttons button {
        flex: 1 1 auto;
        text-align: center;
    }
}

.plasmid-product-page {
    display: grid;
    gap: 1.5rem;
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.plasmid-product-page *,
.plasmid-product-page *::before,
.plasmid-product-page *::after {
    box-sizing: border-box;
}

.plasmid-product-page>.panel-header {
    display: grid;
    gap: 1.25rem;
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--panel);
}

.plasmid-product-page .panel-header-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: start;
}

.plasmid-product-page .page-heading-copy {
    min-width: 0;
}

.plasmid-product-page .eyebrow-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.55rem;
}

.plasmid-product-page .eyebrow {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plasmid-product-page .title {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    margin: 0;
    font-size: clamp(1.85rem, 3vw, 2.75rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.plasmid-product-page .subtitle {
    margin-top: 0.65rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.plasmid-product-page .badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.plasmid-product-page .page-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
    max-width: 520px;
}

.plasmid-product-page .panel-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.plasmid-product-page .date-box {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg-subtle);
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.plasmid-product-page>section,
.plasmid-product-page>details,
.plasmid-product-page>form,
.plasmid-product-page>.plasmid-summary {
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--panel);
}

.plasmid-product-page>form {
    display: grid;
    gap: 1.5rem;
    padding: 1.5rem;
}

.plasmid-product-page .panel.nested {
    margin: 0;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--bg);
}

.plasmid-product-page .section-heading,
.plasmid-product-page .section-heading-row,
.plasmid-product-page .plasmid-studio-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.plasmid-product-page .section-heading h2,
.plasmid-product-page .section-heading h3,
.plasmid-product-page .section-heading-row h2,
.plasmid-product-page .section-heading-row h3,
.plasmid-product-page .plasmid-studio-header h2 {
    margin: 0;
}

.plasmid-product-page .section-heading p,
.plasmid-product-page .section-heading-row p,
.plasmid-product-page .plasmid-studio-header p {
    max-width: 760px;
    margin: 0.35rem 0 0;
    line-height: 1.5;
}

.plasmid-product-page .form-stack {
    gap: 1rem;
}

.plasmid-product-page label {
    font-weight: 650;
}

.plasmid-product-page input,
.plasmid-product-page select,
.plasmid-product-page textarea {
    width: 100%;
}

.plasmid-product-page textarea {
    resize: vertical;
}

.plasmid-product-page .form-actions,
.plasmid-product-page .button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.plasmid-product-page>form>.form-actions {
    position: sticky;
    bottom: 1rem;
    z-index: 5;
    justify-content: flex-end;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--panel);
}

.plasmid-product-page .plasmid-summary {
    display: grid;
    gap: 1.25rem;
    padding: 1.5rem;
}

.plasmid-product-page .card-grid,
.plasmid-product-page .plasmid-studio-metrics,
.plasmid-product-page .metadata-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.plasmid-product-page .info-card,
.plasmid-product-page .metadata-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--bg);
}

.plasmid-product-page .info-card .label,
.plasmid-product-page .metadata-label,
.plasmid-product-page .studio-release-summary .label {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.plasmid-product-page .info-card .value,
.plasmid-product-page .metadata-value,
.plasmid-product-page .studio-release-summary .value {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.plasmid-product-page .metadata-empty {
    color: var(--muted);
}

.plasmid-product-page .metadata-card-wide {
    grid-column: 1 / -1;
}

.plasmid-product-page .metadata-hash {
    display: block;
    overflow-x: auto;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--bg-subtle);
    white-space: nowrap;
}

.plasmid-product-page .plasmid-molecular-studio-panel {
    display: grid;
    gap: 1.25rem;
    padding: 1.5rem;
    overflow: hidden;
}

.plasmid-product-page .plasmid-studio-heading {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    min-width: 0;
}

.plasmid-product-page .plasmid-studio-icon {
    display: inline-grid;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--bg-subtle);
    font-size: 1.25rem;
}

.plasmid-product-page .plasmid-studio-project-list {
    display: grid;
    gap: 0.65rem;
}

.plasmid-product-page .plasmid-studio-project-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}

.plasmid-product-page .plasmid-studio-project-card:hover {
    background: var(--hover-bg);
    border-color: var(--border-muted);
}

.plasmid-product-page .plasmid-studio-project-main {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.plasmid-product-page .studio-release-summary,
.plasmid-product-page .sequence-release-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--bg-subtle);
}

.plasmid-product-page details.collapsible {
    overflow: hidden;
}

.plasmid-product-page details.collapsible>summary,
.plasmid-product-page .panel-summary {
    list-style: none;
    cursor: pointer;
    padding: 1.2rem 1.35rem;
}

.plasmid-product-page details.collapsible>summary::-webkit-details-marker,
.plasmid-product-page .panel-summary::-webkit-details-marker {
    display: none;
}

.plasmid-product-page details.collapsible>summary:hover,
.plasmid-product-page .panel-summary:hover {
    background: var(--hover-bg);
}

.plasmid-product-page .panel-summary-main {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.plasmid-product-page .panel-summary-main h3 {
    margin: 0;
}

.plasmid-product-page .panel-summary-main p {
    margin: 0.3rem 0 0;
    line-height: 1.45;
}

.plasmid-product-page details.collapsible> :not(summary) {
    margin-left: 1.35rem;
    margin-right: 1.35rem;
}

.plasmid-product-page details.collapsible> :last-child {
    margin-bottom: 1.35rem;
}

.plasmid-product-page .metadata-grid {
    padding-top: 0.1rem;
}

.plasmid-product-page .plasmid-released-sequence .sequence-release-meta {
    margin-top: 0;
}

.plasmid-product-page .sequence-block {
    max-height: 520px;
    overflow: auto;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--bg);
    font-family: monospace;
    font-size: 0.82rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.plasmid-product-page .plasmid-notes-panel,
.plasmid-product-page .plasmid-strains-panel {
    padding: 1.5rem;
}

.plasmid-product-page .callout,
.plasmid-product-page .empty-state {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--bg-subtle);
}

.plasmid-product-page .empty-state.compact {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.plasmid-product-page .empty-state strong,
.plasmid-product-page .empty-state p {
    margin: 0;
}

.plasmid-product-page .empty-state p {
    margin-top: 0.35rem;
    line-height: 1.5;
}

.plasmid-product-page .table-scroll {
    overflow-x: auto;
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
}

.plasmid-product-page .table-scroll .data-table {
    margin: 0;
    border: 0;
    border-radius: 0;
}

.plasmid-product-page .data-table th,
.plasmid-product-page .data-table td {
    vertical-align: middle;
}

.plasmid-product-page .plasmid-strains-panel>details {
    margin-top: 1.25rem;
}

.plasmid-product-page .checkbox-field {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: var(--bg-subtle);
}

.plasmid-product-page .checkbox-field input {
    width: auto;
}

.plasmid-product-page .files {
    display: grid;
    gap: 0.75rem;
    padding: 0;
    list-style: none;
}

.plasmid-product-page .file-picker {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding: 1rem;
    border: 1px dashed var(--border-muted);
    border-radius: 0.8rem;
    background: var(--bg);
    cursor: pointer;
}

.plasmid-product-page .file-picker:hover {
    background: var(--hover-bg);
}

.plasmid-product-page .file-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.plasmid-product-page .file-picker-icon {
    display: inline-grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    background: var(--bg-subtle);
}

.plasmid-product-page .file-picker-main,
.plasmid-product-page .file-picker-title,
.plasmid-product-page .file-picker-meta {
    display: block;
}

.plasmid-product-page .file-picker-title {
    font-weight: 700;
}

.plasmid-product-page .file-picker-meta {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.plasmid-product-page .danger-zone {
    padding: 1.5rem;
    border-color: var(--color-failed);
}

.plasmid-product-page .danger-zone .section-heading {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.plasmid-product-page+.panel,
.plasmid-product-page~.panel {
    width: min(100%, 1440px);
    margin-right: auto;
    margin-left: auto;
}

@media (max-width: 1000px) {
    .plasmid-product-page .panel-header-main {
        grid-template-columns: 1fr;
    }

    .plasmid-product-page .page-header-actions {
        justify-content: flex-start;
        max-width: none;
    }

    .plasmid-product-page .card-grid,
    .plasmid-product-page .plasmid-studio-metrics,
    .plasmid-product-page .metadata-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {

    .plasmid-product-page>.panel-header,
    .plasmid-product-page .plasmid-summary,
    .plasmid-product-page .plasmid-molecular-studio-panel,
    .plasmid-product-page .plasmid-notes-panel,
    .plasmid-product-page .plasmid-strains-panel,
    .plasmid-product-page .danger-zone {
        padding: 1rem;
    }

    .plasmid-product-page .card-grid,
    .plasmid-product-page .plasmid-studio-metrics,
    .plasmid-product-page .metadata-grid {
        grid-template-columns: 1fr;
    }

    .plasmid-product-page .metadata-card-wide {
        grid-column: auto;
    }

    .plasmid-product-page .section-heading,
    .plasmid-product-page .section-heading-row,
    .plasmid-product-page .plasmid-studio-header,
    .plasmid-product-page .studio-release-summary,
    .plasmid-product-page .sequence-release-meta,
    .plasmid-product-page .empty-state.compact {
        align-items: stretch;
        flex-direction: column;
    }

    .plasmid-product-page .page-header-actions,
    .plasmid-product-page .button-row,
    .plasmid-product-page .form-actions {
        width: 100%;
    }

    .plasmid-product-page .page-header-actions .button,
    .plasmid-product-page .button-row .button,
    .plasmid-product-page .button-row form,
    .plasmid-product-page .button-row form button {
        width: 100%;
    }

    .plasmid-product-page>form>.form-actions {
        position: static;
    }

    .plasmid-product-page details.collapsible>summary,
    .plasmid-product-page .panel-summary {
        padding: 1rem;
    }

    .plasmid-product-page details.collapsible> :not(summary) {
        margin-left: 1rem;
        margin-right: 1rem;
    }
}.mark-step-complete {
    margin: 8px;
}

.protocol-step h3 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.protocol-step h4 {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--muted);
}


.protocol-groups {
    list-style: none;
    padding: 0;
    margin: 0;
}

.protocol-group {
    border: 1px solid var(--bg);
    border-left: 6px solid var(--accent);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bg);
}

.protocol-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.protocol-group-actions a {
    margin-left: 0.5rem;
}

.protocol-steps {
    margin: 0;
    padding-left: 1rem;
}

.completed {
    border: 1px solid var(--bg-subtle);
    box-shadow: var(--shadow);
}

.batch-step.completed {
    opacity: 0.7;
}

.breadcrumb {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.protocol-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.step-title {
    font-size: 0.95rem;
}

.subnav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.subnav-link {
    text-decoration: none;
    color: var(--link);
}

.subnav-current {
    font-weight: 600;
}

.spacer {
    flex: 1;
}

details>*:not(summary) {
    overflow: hidden;
}

details[open]>*:not(summary) {
    animation: details-reveal 220ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
    details[open]>*:not(summary) {
        animation: none;
    }
}

@keyframes details-reveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview_checklist_results {
    width: 100%;
}

.workflow-panel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workflow-link {
    font-weight: 600;
    text-decoration: none;
}

.workflow-link:hover {
    text-decoration: underline;
}

.file-badge {
    font-size: 0.7rem;
    padding: 0.2em 0.5em;
    border-radius: 6px;
    background: var(--bg);
    color: #0369a1;
    font-weight: 600;
}

.file-badge.evidence {
    background: #dcfce7;
    color: #166534;
}


.create-link {
    font-size: 0.85em;
    font-weight: normal;
    color: var(--muted-text);
    text-decoration: none;
}

.create-link:hover {
    text-decoration: underline;
    color: var(--link-color);
}

.button.ghost {
    background: none;
    border: 1px dashed transparent;
    color: var(--muted-text);
}

.button.ghost:hover {
    border-color: var(--border-muted);
    color: var(--text);
}

.button.tiny {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
}

.form-hint {
    color: var(--muted-text);
    font-size: 0.8rem;
    margin-top: -0.25rem;
}

.icon-action {
    font-size: 0.9em;
    color: var(--muted-text);
    text-decoration: none;
}

.icon-action:hover {
    color: var(--link-color);
}

.validation-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}


.form-designer-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;

    padding: 1rem;
    border: 1px solid var(--bg);
    border-radius: 12px;
    background: var(--panel);
}

.form-designer-row-main {
    display: grid;
    grid-template-columns:
        minmax(216px, 2fr) minmax(180px, 1fr);
    gap: 0.75rem;
}

.form-designer-row-main>* {
    min-width: 0;
    width: 100%;
}

.field-category-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field-category {
    width: 100%;
    min-height: 8rem;
    max-height: 14rem;
}

.form-designer-row-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

@media (max-width: 800px) {
    .form-designer-row-main {
        grid-template-columns: 1fr;
    }

    .form-designer-row-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
}

.hidden {
    display: none;
}

.protocol-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    list-style: none;
    border: 1px solid var(--border, var(--bg));
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.protocol-step {
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.protocol-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.protocol-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.protocol-name {
    font-size: 0.9rem;
}

.protocol-meta {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.protocol-list li:hover {
    background: var(--hover-bg);
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding-bottom: 0.5rem;
    margin-bottom: 1rem;

    border-bottom: 1px solid var(--border, var(--bg));
}

.step-header strong {
    font-size: 1.05rem;
}

.step-badges {
    display: flex;
    gap: 0.5rem;
}

details.panel.nested {
    border: 1px dashed var(--bg);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

details.panel.nested>summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.step-body {
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}


.step-section {
    border: 1px solid var(--bg);
    border-radius: 6px;
    padding: 0.75rem;
}

.step-section:hover {
    cursor: pointer;
    transition: background 0.15s ease;
}

.step-section h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.protocol-step::before {
    content: "";
    display: block;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, var(--bg), transparent);
    margin-bottom: 0.75rem;
}

.tabs {
    display: inline-flex;
    gap: 4px;
    border-bottom: 1px solid var(--bg);
}

.tab {
    cursor: pointer;
    display: inline-block;
}

/* hide radio safely */
.tab input[type="radio"] {
    display: none;
}

/* visible tab surface */
.tab span {
    height: -webkit-fill-available;
    display: block;
    padding: 8px 14px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    transition: left 0.2s ease, opacity 0.2s ease;
}

/* hover */
.tab span:hover {
    background: var(--hover-bg);
    color: var(--text);
}

/* active */
.tab input[type="radio"]:checked+span {
    background: var(--hover-bg);
    color: #007bff;
    border-color: var(--bg);
    border-bottom: 1px solid var(--bg);
    font-weight: 500;
}

/* Hidden by default */
.data-form-designer {
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
}

/* Visible */
.data-form-designer.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* CONTAINER */
.protocol-header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* TITLE */
.protocol-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    word-break: break-word;
}

/* META ROW */
.protocol-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--muted);
}

/* INDIVIDUAL ITEMS */
.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

/* SMALL LABEL (v) */
.meta-label {
    opacity: 0.7;
}

/* SEPARATOR */
.meta-separator {
    opacity: 0.5;
}

/* MOBILE OPTIMIZATION */
@media (max-width: 640px) {
    .protocol-meta {
        gap: 0.25rem;
    }

    .meta-separator {
        display: none;
        /* remove clutter */
    }

    .protocol-meta {
        flex-direction: row;
    }

    .meta-item {
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 4px;
        padding: 0.1rem 0.35rem;
    }
}

.entity-diff-table td {
    vertical-align: top;
}

.diff-cell {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.diff-main {
    font-weight: 600;
}

.diff-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.82rem;
    color: var(--muted-text);
}

.nowrap {
    white-space: nowrap;
}

.empty-state.compact {
    padding: 0.75rem 1rem;
    border: 1px solid var(--bg);
    border-radius: 0.75rem;
}

.required-materials-panel {
    display: grid;
    gap: 1rem;
}

.section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.section-heading-row h4 {
    margin: 0;
}

.section-heading-row p {
    margin: 0.25rem 0 0;
}

.material-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.85rem;
    align-items: start;
}

.material-group-card {
    border: 1px solid var(--bg);
    border-radius: 1rem;
    background: var(--bg);
    padding: 0.9rem;
    box-shadow: var(--shadow);
}

.material-group-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.material-group-header h5 {
    margin: 0;
    flex: 1;
    font-size: 0.9rem;
    font-weight: 700;
}

.material-group-icon {
    display: inline-grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.75rem;
    background: var(--bg-subtle);
}

.material-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.material-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: var(bg-subtle);
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .material-groups {
        grid-template-columns: 1fr;
    }

    .material-group-card {
        padding: 0.8rem;
    }
}

.step-config {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.step-section {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.step-section>summary {
    overflow-wrap: anywhere;
}

.step-section form,
.step-section select,
.step-section input,
.step-section button {
    max-width: 100%;
}

.step-section form {
    min-width: 0;
}

.step-section select,
.step-section input {
    width: 100%;
    box-sizing: border-box;
}

.boxed-list,
.boxed-list li {
    min-width: 0;
    max-width: 100%;
}

.protocol-step-view {
    display: grid;
    gap: 1rem;
}

.protocol-step-view-header,
.protocol-step-view-heading,
.protocol-step-navigation,
.protocol-step-resource-grid .boxed-list>li {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.protocol-step-view-header,
.protocol-step-navigation {
    justify-content: space-between;
}

.protocol-step-view-heading {
    align-items: flex-start;
}

.protocol-step-view-heading h1 {
    margin-bottom: 0.25rem;
}

.protocol-step-navigation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.protocol-step-navigation> :last-child {
    text-align: right;
}

.protocol-step-summary {
    display: grid;
    gap: 1rem;
}

.protocol-step-outcome {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
}

.protocol-step-outcome p {
    margin: 0.25rem 0 0;
}

.protocol-step-resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.protocol-step-resource-grid .step-section {
    min-width: 0;
}

.protocol-step-resource-grid .step-section>summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.protocol-step-resource-grid .boxed-list>li {
    justify-content: space-between;
    align-items: flex-start;
}

.definition-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.definition-grid>div {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.definition-grid dt {
    color: var(--muted-text);
    font-size: 0.875rem;
}

.definition-grid dd {
    margin: 0.25rem 0 0;
    font-weight: 600;
}

@media (max-width: 900px) {

    .protocol-step-resource-grid,
    .definition-grid {
        grid-template-columns: 1fr;
    }

    .protocol-step-navigation {
        grid-template-columns: 1fr;
    }

    .protocol-step-navigation> :last-child {
        text-align: left;
    }

    .protocol-step-view-header {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* ==========================================================================
   Protocol creation
   ========================================================================== */

.protocol-create-page {
    width: min(100%, 1180px);
    margin: 0 auto;
}

.protocol-create-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.protocol-create-breadcrumb a {
    color: var(--muted);
    font-weight: 600;
}

.protocol-create-breadcrumb a:hover {
    color: var(--primary);
}

.protocol-create-breadcrumb span[aria-current="page"] {
    color: var(--text);
    font-weight: 600;
}

.protocol-create-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    overflow: hidden;
    margin-bottom: 1.25rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        radial-gradient(circle at 92% 8%,
            color-mix(in srgb, var(--primary) 20%, transparent),
            transparent 38%),
        linear-gradient(135deg,
            var(--panel),
            color-mix(in srgb, var(--primary-subtle) 58%, var(--panel)));
    box-shadow: var(--shadow);
}

.protocol-create-hero::after {
    position: absolute;
    right: -3rem;
    bottom: -5rem;
    width: 14rem;
    height: 14rem;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.protocol-create-hero-content {
    position: relative;
    z-index: 1;
    max-width: 690px;
}

.protocol-create-eyebrow,
.protocol-create-guide-eyebrow,
.protocol-reference-batch-label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.65rem;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.protocol-create-hero h1 {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.protocol-create-hero-content>p {
    max-width: 650px;
    margin: 0.85rem 0 0;
    color: var(--muted);
    font-size: clamp(0.95rem, 2vw, 1.05rem);
}

.protocol-create-hero-badge {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 min(100%, 285px);
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    box-shadow: var(--shadow);
}

.protocol-create-hero-badge-icon {
    display: grid;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border-radius: 50%;
    background: var(--success-subtle);
    color: var(--success);
    font-weight: 900;
}

.protocol-create-hero-badge>span:last-child {
    display: grid;
    gap: 0.1rem;
}

.protocol-create-hero-badge strong {
    font-size: 0.87rem;
}

.protocol-create-hero-badge small {
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.35;
}

.protocol-create-form {
    display: grid;
    gap: 1.25rem;
}

.protocol-create-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 1.25rem;
    align-items: start;
}

.protocol-create-main {
    display: grid;
    min-width: 0;
    gap: 1.25rem;
}

.protocol-create-section {
    margin: 0;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    overflow: visible;
}

.protocol-create-section-header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.protocol-create-section-number {
    display: grid;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 9px;
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 800;
}

.protocol-create-section-header h2 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.35;
}

.protocol-create-section-header p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.83rem;
}

.protocol-create-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.protocol-create-field {
    min-width: 0;
}

.protocol-create-field+.protocol-create-field {
    margin-top: 1.25rem;
}

.protocol-create-field-grid .protocol-create-field {
    margin-top: 0;
}

.protocol-create-field-full {
    grid-column: 1 / -1;
}

.protocol-create-field label,
.protocol-reference-batch-input label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 750;
}

.required-marker {
    color: var(--danger);
}

.optional-marker {
    display: inline-flex;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.protocol-create-field input,
.protocol-create-field textarea,
.protocol-create-field select,
.protocol-reference-batch-input input {
    margin: 0;
}

.protocol-create-field input,
.protocol-create-field textarea,
.protocol-reference-batch-input input {
    min-height: 46px;
    padding: 0.72rem 0.85rem;
    border-radius: 10px;
    background: var(--panel);
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background-color 150ms ease;
}

.protocol-create-field textarea {
    min-height: 112px;
    line-height: 1.5;
}

.protocol-create-field input:hover,
.protocol-create-field textarea:hover,
.protocol-reference-batch-input input:hover {
    border-color: var(--border-muted);
}

.protocol-create-field input:focus,
.protocol-create-field textarea:focus,
.protocol-reference-batch-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.protocol-create-field .select-wrapper {
    display: block;
    width: 100%;
}

.protocol-create-field select {
    min-height: 46px;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    border-color: var(--border);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: none;
    font-size: 0.9rem;
}

.protocol-create-field select:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.protocol-view-page {
    width: min(100%, 1320px);
    margin: 0 auto;
}

.protocol-view-page,
.protocol-view-page * {
    min-width: 0;
}

.protocol-view-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.protocol-view-breadcrumb a {
    color: var(--muted);
    font-weight: 700;
}

.protocol-view-breadcrumb a:hover {
    color: var(--primary);
}

.protocol-view-breadcrumb span[aria-current="page"] {
    max-width: min(34rem, 60vw);
    overflow: hidden;
    color: var(--text);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.protocol-view-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        radial-gradient(circle at 94% 0%,
            color-mix(in srgb, var(--primary) 22%, transparent),
            transparent 36%),
        linear-gradient(135deg,
            var(--panel),
            color-mix(in srgb, var(--primary-subtle) 62%, var(--panel)));
    box-shadow: var(--shadow);
}

.protocol-view-hero::after {
    position: absolute;
    right: -5rem;
    bottom: -8rem;
    width: 19rem;
    height: 19rem;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.protocol-view-hero-main {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: start;
    padding: clamp(1.4rem, 3vw, 2.25rem);
}

.protocol-view-title-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.protocol-view-icon {
    display: grid;
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--primary-subtle) 76%, var(--panel));
    color: var(--primary);
    font-size: 1.05rem;
    font-weight: 900;
    box-shadow: var(--shadow);
}

.protocol-view-title-copy {
    min-width: 0;
}

.protocol-view-eyebrow,
.protocol-view-section-eyebrow {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.085em;
    text-transform: uppercase;
}

.protocol-view-title-copy h1 {
    margin: 0;
    max-width: 760px;
    overflow-wrap: anywhere;
    font-size: clamp(1.7rem, 4vw, 2.55rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.protocol-view-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.8rem;
}

.protocol-view-meta-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.24rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--panel) 82%, transparent);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.protocol-view-status-row {
    display: grid;
    gap: 0.65rem;
    width: min(100%, 330px);
}

.protocol-view-status {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel) 90%, transparent);
}

.protocol-view-status-icon {
    display: grid;
    flex: 0 0 1.8rem;
    width: 1.8rem;
    height: 1.8rem;
    place-items: center;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 900;
}

.protocol-view-status>span:last-child {
    display: grid;
    gap: 0.12rem;
}

.protocol-view-status strong {
    font-size: 0.76rem;
}

.protocol-view-status small {
    color: var(--muted);
    font-size: 0.67rem;
    line-height: 1.4;
}

.protocol-view-status small a {
    font-weight: 700;
}

.protocol-view-status.is-reviewed {
    border-color: color-mix(in srgb, var(--success) 28%, var(--border));
    background: color-mix(in srgb, var(--success-subtle) 72%, var(--panel));
}

.protocol-view-status.is-reviewed .protocol-view-status-icon {
    background: var(--success);
    color: white;
}

.protocol-view-status.is-draft {
    border-color: color-mix(in srgb, var(--warning) 50%, var(--border));
    background: color-mix(in srgb, var(--warning-subtle) 80%, var(--panel));
}

.protocol-view-status.is-draft .protocol-view-status-icon {
    background: var(--warning);
    color: var(--text);
}

.protocol-view-status.is-ai .protocol-view-status-icon {
    border-radius: 7px;
    background: var(--primary-subtle);
    color: var(--primary);
}

.protocol-view-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    padding: 1rem clamp(1.4rem, 3vw, 2.25rem);
    border-top: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
    background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.protocol-view-hero-actions .button,
.protocol-view-hero-actions button,
.protocol-view-inline-form {
    margin: 0;
}

.protocol-view-inline-form {
    display: inline-flex;
}

.protocol-view-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 1.25rem;
    align-items: start;
}

.protocol-view-main-column {
    display: grid;
    gap: 1.25rem;
}

.protocol-view-card,
.protocol-view-sidebar-card {
    margin: 0;
    overflow: visible;
}

.protocol-view-card {
    padding: clamp(1rem, 2.4vw, 1.5rem);
}

.protocol-view-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.protocol-view-section-header h2,
.protocol-view-sidebar-card h2,
.protocol-view-danger-zone h2 {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.35;
}

.protocol-view-section-header p,
.protocol-view-danger-zone p {
    max-width: 760px;
    margin: 0.28rem 0 0;
    color: var(--muted);
    font-size: 0.79rem;
}

.protocol-view-access-badge,
.protocol-view-count-badge,
.protocol-view-resource-count {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 1.75rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
    border-radius: 999px;
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 800;
}

.protocol-view-access-badge.is-readonly {
    border-color: var(--border);
    background: var(--bg-subtle);
    color: var(--muted);
}

.protocol-view-form {
    display: grid;
    gap: 1.35rem;
}

.protocol-view-fieldset {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-subtle) 52%, var(--panel));
}

.protocol-view-fieldset legend {
    padding: 0 0.45rem;
    color: var(--text);
    font-size: 0.79rem;
    font-weight: 800;
}

.protocol-view-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
}

.protocol-view-field-full {
    grid-column: 1 / -1;
}

.protocol-view-field label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.35rem;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 780;
}

.protocol-view-field input,
.protocol-view-field textarea,
.protocol-view-field select,
.protocol-view-number-input input {
    margin: 0;
}

.protocol-view-field input,
.protocol-view-field textarea,
.protocol-view-number-input input {
    min-height: 44px;
    padding: 0.68rem 0.8rem;
    border-radius: 10px;
    background: var(--panel);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.protocol-view-field textarea {
    min-height: 106px;
    line-height: 1.5;
}

.protocol-view-field .select-wrapper {
    display: block;
    width: 100%;
}

.protocol-view-field select {
    min-height: 44px;
    padding-top: 0.64rem;
    padding-bottom: 0.64rem;
    border-color: var(--border);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: none;
    font-size: 0.87rem;
}

.protocol-view-field input:focus,
.protocol-view-field textarea:focus,
.protocol-view-field select:focus,
.protocol-view-number-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.protocol-view-field input:disabled,
.protocol-view-field textarea:disabled,
.protocol-view-field select:disabled,
.protocol-view-number-input input:disabled {
    cursor: not-allowed;
    opacity: 0.78;
    background: var(--bg-subtle);
}

.protocol-view-field-help {
    display: block;
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 0.71rem;
    line-height: 1.45;
}

.protocol-view-readonly-field {
    min-height: 44px;
    margin: 0;
    border-radius: 10px;
}

.protocol-view-info-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 0.65rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary-subtle) 54%, var(--panel));
}

.protocol-view-info-callout>span {
    display: grid;
    flex: 0 0 1.35rem;
    width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: var(--panel);
    font-family: Georgia, serif;
    font-size: 0.72rem;
    font-weight: 900;
}

.protocol-view-info-callout p {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.48;
}

.protocol-view-number-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
}

.protocol-view-number-input input {
    border-radius: 10px 0 0 10px;
}

.protocol-view-number-input>span {
    display: flex;
    align-items: center;
    padding: 0 0.78rem;
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: var(--panel);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
}

.protocol-view-save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.protocol-view-save-bar>div {
    display: grid;
    gap: 0.08rem;
}

.protocol-view-save-bar strong {
    font-size: 0.78rem;
}

.protocol-view-save-bar span,
.protocol-view-readonly-notice {
    color: var(--muted);
    font-size: 0.7rem;
}

.protocol-view-save-bar button {
    margin: 0;
}

.protocol-view-readonly-notice {
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-subtle);
}

.protocol-view-sidebar {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 1rem;
}

.protocol-view-sidebar-card {
    padding: 1.2rem;
}

.protocol-view-stat-list {
    display: grid;
    gap: 0;
    margin: 0.9rem 0 0;
}

.protocol-view-stat-list>div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}

.protocol-view-stat-list>div:last-child {
    border-bottom: 0;
}

.protocol-view-stat-list dt {
    color: var(--muted);
    font-size: 0.72rem;
}

.protocol-view-stat-list dd {
    margin: 0;
    color: var(--text);
    font-size: 0.76rem;
    font-weight: 800;
    text-align: right;
}

.protocol-view-state {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.48rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 850;
}

.protocol-view-state.is-ready {
    background: var(--success-subtle);
    color: var(--success);
}

.protocol-view-state.is-pending {
    background: var(--warning-subtle);
    color: color-mix(in srgb, var(--text) 82%, #8a6d1d);
}

.protocol-view-page-nav {
    display: grid;
}

.protocol-view-page-nav h2 {
    margin-bottom: 0.65rem;
}

.protocol-view-page-nav>a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.62rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.protocol-view-page-nav>a:last-child {
    border-bottom: 0;
}

.protocol-view-page-nav>a:hover {
    color: var(--primary);
}

.protocol-view-sidebar-procurement>.panel,
.protocol-view-sidebar-procurement .panel {
    margin: 0;
}

.protocol-view-steps-header {
    margin-bottom: 1rem;
}

.protocol-view-add-step {
    margin-bottom: 1.1rem;
    border: 1px dashed color-mix(in srgb, var(--primary) 42%, var(--border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--primary-subtle) 44%, var(--panel));
}

.protocol-view-add-step>summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    list-style: none;
}

.protocol-view-add-step>summary::-webkit-details-marker,
.protocol-view-step-summary::-webkit-details-marker,
.protocol-view-resource-card>summary::-webkit-details-marker,
.protocol-view-support-disclosure>summary::-webkit-details-marker,
.protocol-view-step-editor>summary::-webkit-details-marker {
    display: none;
}

.protocol-view-add-step>summary::after,
.protocol-view-resource-card>summary::after,
.protocol-view-support-disclosure>summary::after,
.protocol-view-step-editor>summary::after {
    margin-left: auto;
    color: var(--muted);
    content: "+";
    font-size: 1rem;
    font-weight: 800;
}

.protocol-view-add-step[open]>summary::after,
.protocol-view-resource-card[open]>summary::after,
.protocol-view-support-disclosure[open]>summary::after,
.protocol-view-step-editor[open]>summary::after {
    content: "−";
}

.protocol-view-add-step-icon {
    display: grid;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 9px;
    background: var(--primary);
    color: var(--panel);
    font-size: 1.1rem;
    font-weight: 800;
}

.protocol-view-add-step summary>span:nth-child(2),
.protocol-view-step-editor summary>span,
.protocol-view-support-disclosure summary>span:first-child,
.protocol-view-resource-card summary>span:first-child {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.protocol-view-add-step summary>span:nth-child(2),
.protocol-view-step-editor summary>span {
    display: grid;
    gap: 0.1rem;
}

.protocol-view-add-step summary strong,
.protocol-view-step-editor summary strong {
    font-size: 0.78rem;
}

.protocol-view-add-step summary small,
.protocol-view-step-editor summary small,
.protocol-view-support-disclosure summary small,
.protocol-view-resource-card summary small {
    color: var(--muted);
    font-size: 0.68rem;
}

.protocol-view-add-step-body,
.protocol-view-step-editor-body {
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--panel);
}

.protocol-view-empty-state {
    display: grid;
    justify-items: center;
    padding: clamp(2rem, 6vw, 4rem) 1.25rem;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-subtle) 54%, var(--panel));
    text-align: center;
}

.protocol-view-empty-icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    margin-bottom: 0.8rem;
    border-radius: 14px;
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 900;
}

.protocol-view-empty-state h3 {
    margin: 0;
    font-size: 0.95rem;
}

.protocol-view-empty-state p {
    max-width: 560px;
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.protocol-view-step-list {
    display: grid;
    gap: 0.85rem;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 0;
}

.protocol-view-step-item {
    margin: 0;
    padding: 0;
}

.protocol-view-step-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.protocol-view-step-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.95rem 1rem;
    cursor: pointer;
    list-style: none;
    transition: background-color 150ms ease;
}

.protocol-view-step-summary:hover {
    background: var(--hover-bg);
}

.protocol-view-step-summary::after {
    grid-column: 4;
    color: var(--muted);
    content: "+";
    font-size: 1rem;
    font-weight: 850;
}

.protocol-view-step-card[open]>.protocol-view-step-summary::after {
    content: "−";
}

.protocol-view-step-order {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border));
    border-radius: 10px;
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 900;
}

.protocol-view-step-heading {
    display: grid;
    gap: 0.12rem;
}

.protocol-view-step-heading strong {
    overflow-wrap: anywhere;
    font-size: 0.84rem;
}

.protocol-view-step-heading small {
    color: var(--muted);
    font-size: 0.66rem;
}

.protocol-view-step-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
}

.protocol-view-step-content {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-subtle) 28%, var(--panel));
}

.protocol-view-step-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.protocol-view-step-toolbar h3 {
    margin: 0;
    font-size: 1rem;
}

.protocol-view-step-toolbar .button {
    margin: 0;
}

.protocol-view-outcome {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid color-mix(in srgb, var(--success) 24%, var(--border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--success-subtle) 66%, var(--panel));
}

.protocol-view-outcome-icon {
    display: grid;
    flex: 0 0 1.7rem;
    width: 1.7rem;
    height: 1.7rem;
    place-items: center;
    border-radius: 50%;
    background: var(--success);
    color: white;
    font-size: 0.68rem;
    font-weight: 900;
}

.protocol-view-outcome strong {
    font-size: 0.75rem;
}

.protocol-view-outcome p {
    margin: 0.18rem 0 0;
    color: var(--muted);
    font-size: 0.73rem;
}

.protocol-view-instructions {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.protocol-view-subsection-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}

.protocol-view-subsection-heading h4 {
    margin: 0;
    font-size: 0.78rem;
}

.protocol-view-subsection-heading span {
    color: var(--muted);
    font-size: 0.66rem;
}

.protocol-view-instructions .step-body {
    margin: 0;
    padding: 0.9rem;
    background: var(--panel);
}

.protocol-view-step-procurement>.panel,
.protocol-view-step-procurement .panel {
    margin: 0;
}

.protocol-view-step-editor {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.protocol-view-step-editor>summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    cursor: pointer;
    list-style: none;
}

.protocol-view-resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.protocol-view-resource-card {
    align-self: start;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}

.protocol-view-resource-card>summary {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 0.85rem;
    cursor: pointer;
    list-style: none;
    background: color-mix(in srgb, var(--bg-subtle) 55%, var(--panel));
}

.protocol-view-resource-card>summary>span:first-child {
    flex: 1 1 auto;
}

.protocol-view-resource-card>summary>span:first-child>span:last-child {
    display: grid;
    gap: 0.08rem;
}

.protocol-view-resource-card summary strong {
    font-size: 0.75rem;
}

.protocol-view-resource-icon,
.protocol-view-support-icon {
    display: grid;
    flex: 0 0 1.85rem;
    width: 1.85rem;
    height: 1.85rem;
    place-items: center;
    border-radius: 8px;
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: 0.67rem;
    font-weight: 900;
}

.protocol-view-resource-body {
    display: grid;
    gap: 0.8rem;
    padding: 0.8rem;
    border-top: 1px solid var(--border);
}

.protocol-view-resource-list {
    display: grid;
    gap: 0.5rem;
}

.protocol-view-resource-list>li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: color-mix(in srgb, var(--bg-subtle) 40%, var(--panel));
}

.protocol-view-resource-main {
    display: grid;
    gap: 0.18rem;
}

.protocol-view-resource-main a {
    overflow-wrap: anywhere;
    font-size: 0.73rem;
}

.protocol-view-resource-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.45rem;
    color: var(--muted);
    font-size: 0.65rem;
}

.protocol-view-resource-meta span+span::before {
    margin-right: 0.45rem;
    content: "·";
    opacity: 0.55;
}

.protocol-view-remove-form {
    flex: 0 0 auto;
}

.protocol-view-remove-form button {
    margin: 0;
}

.protocol-view-resource-empty {
    margin: 0;
    padding: 0.7rem;
    border: 1px dashed var(--border);
    border-radius: 9px;
    color: var(--muted);
    font-size: 0.69rem;
    text-align: center;
}

.protocol-view-resource-empty.is-subtle {
    padding: 0.5rem;
    border: 0;
    background: var(--bg-subtle);
}

.protocol-view-resource-form {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-subtle);
}

.protocol-view-resource-form label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
}

.protocol-view-resource-form input,
.protocol-view-resource-form select,
.protocol-view-resource-form button {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.protocol-view-resource-form select {
    min-height: 42px;
    padding-top: 0.58rem;
    padding-bottom: 0.58rem;
    border-color: var(--border);
    border-radius: 9px;
    background: var(--panel);
    box-shadow: none;
    font-size: 0.77rem;
}

.protocol-view-resource-form input {
    min-height: 40px;
    padding: 0.58rem 0.68rem;
    border-radius: 9px;
    background: var(--panel);
}

.protocol-view-support-section {
    margin-top: 1.25rem;
    padding: 0;
    overflow: hidden;
}

.protocol-view-support-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.protocol-view-support-grid .protocol-view-support-section {
    margin-top: 1.25rem;
}

.protocol-view-support-disclosure>summary {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.1rem;
    cursor: pointer;
    list-style: none;
}

.protocol-view-support-disclosure>summary>span:first-child {
    flex: 1 1 auto;
}

.protocol-view-support-disclosure>summary>span:first-child>span:last-child {
    display: grid;
    gap: 0.1rem;
}

.protocol-view-support-disclosure summary strong {
    font-size: 0.82rem;
}

.protocol-view-disclosure-action {
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 700;
}

.protocol-view-support-body {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-subtle) 25%, var(--panel));
}

.protocol-view-inner-panel {
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--panel);
}

.protocol-view-inner-panel>.panel,
.protocol-view-inner-panel .panel {
    margin-bottom: 0.75rem;
    box-shadow: none;
}

.protocol-view-file-list {
    display: grid;
    gap: 0.55rem;
}

.protocol-view-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: end;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
}

.protocol-view-upload-form .file-picker,
.protocol-view-upload-form button {
    margin: 0;
}

.protocol-view-compact-empty {
    display: grid;
    gap: 0.18rem;
    padding: 1rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: var(--bg-subtle);
    text-align: center;
}

.protocol-view-compact-empty strong {
    font-size: 0.76rem;
}

.protocol-view-compact-empty span {
    color: var(--muted);
    font-size: 0.68rem;
}

.protocol-view-workflow-list {
    display: grid;
    gap: 0.55rem;
}

.protocol-view-workflow-list li {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
}

.protocol-view-workflow-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.8rem;
    color: var(--text);
}

.protocol-view-workflow-list a:hover {
    background: var(--hover-bg);
}

.protocol-view-workflow-main {
    display: grid;
    gap: 0.28rem;
}

.protocol-view-workflow-main>strong {
    overflow-wrap: anywhere;
    font-size: 0.76rem;
}

.protocol-view-workflow-main>span {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.protocol-view-danger-zone {
    display: flex;
    padding: 1.25rem;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1.25rem;
    margin-bottom: 0;
    border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
    background: color-mix(in srgb, var(--danger-subtle) 55%, var(--panel));
}

.protocol-view-danger-zone form {
    display: grid;
    flex: 0 0 auto;
    justify-items: end;
    gap: 0.35rem;
}

.protocol-view-danger-zone button {
    margin: 0;
}

.protocol-view-danger-zone button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.protocol-view-danger-zone small {
    max-width: 300px;
    color: var(--muted);
    font-size: 0.66rem;
    text-align: right;
}

[data-theme="dark"] .protocol-view-hero {
    background:
        radial-gradient(circle at 94% 0%,
            color-mix(in srgb, var(--primary) 15%, transparent),
            transparent 36%),
        linear-gradient(135deg,
            var(--panel),
            color-mix(in srgb, var(--primary-subtle) 44%, var(--panel)));
}

[data-theme="dark"] .protocol-view-status,
[data-theme="dark"] .protocol-view-meta-chip,
[data-theme="dark"] .protocol-view-hero-actions {
    background: color-mix(in srgb, var(--panel) 92%, transparent);
}

[data-theme="dark"] .protocol-view-fieldset,
[data-theme="dark"] .protocol-view-step-content,
[data-theme="dark"] .protocol-view-support-body {
    background: color-mix(in srgb, var(--bg-subtle) 22%, var(--panel));
}

@media (max-width: 1080px) {
    .protocol-view-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .protocol-view-sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .protocol-view-sidebar-procurement {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .protocol-view-hero-main {
        grid-template-columns: 1fr;
    }

    .protocol-view-status-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .protocol-view-field-grid,
    .protocol-view-resource-grid,
    .protocol-view-support-grid {
        grid-template-columns: 1fr;
    }

    .protocol-view-support-grid .protocol-view-support-section {
        margin-top: 1.25rem;
    }

    .protocol-view-step-summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .protocol-view-step-badges {
        grid-column: 2 / -1;
        justify-content: flex-start;
    }

    .protocol-view-step-summary::after {
        grid-column: 3;
        grid-row: 1;
    }
}

@media (max-width: 640px) {
    .protocol-view-breadcrumb span[aria-current="page"] {
        max-width: 55vw;
    }

    .protocol-view-hero {
        border-radius: 14px;
    }

    .protocol-view-hero-main {
        padding: 1.2rem;
    }

    .protocol-view-title-row {
        gap: 0.75rem;
    }

    .protocol-view-icon {
        flex-basis: 2.55rem;
        width: 2.55rem;
        height: 2.55rem;
        border-radius: 11px;
    }

    .protocol-view-title-copy h1 {
        font-size: 1.65rem;
    }

    .protocol-view-status-row,
    .protocol-view-sidebar {
        grid-template-columns: 1fr;
    }

    .protocol-view-hero-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0.9rem 1.2rem 1.2rem;
    }

    .protocol-view-hero-actions .button,
    .protocol-view-hero-actions button,
    .protocol-view-inline-form {
        width: 100%;
    }

    .protocol-view-hero-actions .button,
    .protocol-view-hero-actions button {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .protocol-view-section-header,
    .protocol-view-save-bar,
    .protocol-view-step-toolbar,
    .protocol-view-danger-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .protocol-view-save-bar button,
    .protocol-view-step-toolbar .button,
    .protocol-view-danger-zone button {
        width: 100%;
    }

    .protocol-view-danger-zone form {
        width: 100%;
        justify-items: stretch;
    }

    .protocol-view-danger-zone small {
        max-width: none;
        text-align: left;
    }

    .protocol-view-step-summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding: 0.8rem;
    }

    .protocol-view-step-heading small {
        display: none;
    }

    .protocol-view-step-content {
        padding: 0.8rem;
    }

    .protocol-view-resource-list>li {
        align-items: stretch;
        flex-direction: column;
    }

    .protocol-view-remove-form button {
        width: 100%;
    }

    .protocol-view-upload-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {

    /* Override the global mobile .panel padding: 3px rule for this workspace. */
    .protocol-view-card,
    .protocol-view-sidebar-card,
    .protocol-view-danger-zone {
        padding: 1rem;
    }

    .protocol-view-support-section {
        padding: 0;
    }

    .protocol-view-hero-actions {
        grid-template-columns: 1fr;
    }

    .protocol-view-fieldset {
        padding: 0.9rem;
    }

    .protocol-view-section-header {
        margin-bottom: 1rem;
    }

    .protocol-view-step-badges {
        grid-column: 1 / -1;
    }

    .protocol-view-subsection-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .protocol-view-step-summary,
    .protocol-view-field input,
    .protocol-view-field textarea,
    .protocol-view-field select,
    .protocol-view-number-input input {
        transition: none;
    }
}

.protocol-field-hint {
    display: block;
    margin-top: 0.42rem;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.protocol-field-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 0.7rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    border-radius: 10px;
    background: color-mix(in srgb,
            var(--primary-subtle) 55%,
            var(--panel));
}

.protocol-field-callout-icon {
    display: grid;
    flex: 0 0 1.35rem;
    width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    margin-top: 0.05rem;
    border-radius: 50%;
    background: var(--primary);
    color: var(--panel);
    font-family: Georgia, serif;
    font-size: 0.75rem;
    font-weight: 800;
}

.protocol-field-callout p {
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

.protocol-reference-batch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 1.5rem;
    align-items: center;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(135deg,
            var(--bg-subtle),
            color-mix(in srgb, var(--panel) 86%, var(--bg-subtle)));
}

.protocol-reference-batch-content h3 {
    margin: 0;
    font-size: 1rem;
}

.protocol-reference-batch-content p {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.protocol-reference-batch-label {
    margin-bottom: 0.4rem;
}

.protocol-number-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
}

.protocol-number-input input {
    border-radius: 10px 0 0 10px;
}

.protocol-number-input span {
    display: flex;
    align-items: center;
    padding: 0 0.8rem;
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: var(--panel);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.protocol-create-sidebar {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 1rem;
}

.protocol-create-guide {
    margin: 0;
    padding: 1.35rem;
    overflow: visible;
}

.protocol-create-guide h2 {
    margin: 0;
    font-size: 1.05rem;
}

.protocol-create-guide>p {
    margin: 0.55rem 0 1.25rem;
    color: var(--muted);
    font-size: 0.79rem;
}

.protocol-create-guide-list {
    display: grid;
    gap: 1rem;
    counter-reset: none;
}

.protocol-create-guide-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.protocol-create-guide-list li>span {
    display: grid;
    flex: 0 0 1.65rem;
    width: 1.65rem;
    height: 1.65rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-subtle);
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 800;
}

.protocol-create-guide-list li>div {
    display: grid;
    min-width: 0;
    gap: 0.12rem;
}

.protocol-create-guide-list strong {
    font-size: 0.78rem;
}

.protocol-create-guide-list small {
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.4;
}

.protocol-create-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 1rem;
    border: 1px solid color-mix(in srgb, var(--success) 26%, var(--border));
    border-radius: 12px;
    background: var(--success-subtle);
}

.protocol-create-tip>span {
    display: grid;
    flex: 0 0 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    place-items: center;
    border-radius: 50%;
    background: var(--success);
    color: white;
    font-size: 0.72rem;
    font-weight: 900;
}

.protocol-create-tip p {
    margin: 0;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.45;
}

.protocol-create-tip strong {
    display: block;
    margin-bottom: 0.15rem;
    color: var(--text);
}

.protocol-create-actions {
    position: sticky;
    z-index: 20;
    bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
}

.protocol-create-actions-copy {
    display: grid;
    min-width: 0;
    gap: 0.1rem;
}

.protocol-create-actions-copy strong {
    font-size: 0.82rem;
}

.protocol-create-actions-copy span {
    color: var(--muted);
    font-size: 0.72rem;
}

.protocol-create-action-buttons {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.65rem;
}

.protocol-create-action-buttons .button,
.protocol-create-action-buttons button {
    min-height: 42px;
    margin: 0;
    padding: 0.65rem 1rem;
}

.protocol-create-action-buttons button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

[data-theme="dark"] .protocol-create-hero {
    background:
        radial-gradient(circle at 92% 8%,
            color-mix(in srgb, var(--primary) 16%, transparent),
            transparent 38%),
        linear-gradient(135deg,
            var(--panel),
            color-mix(in srgb, var(--primary-subtle) 45%, var(--panel)));
}

[data-theme="dark"] .protocol-create-hero-badge,
[data-theme="dark"] .protocol-create-actions {
    background: color-mix(in srgb, var(--panel) 94%, transparent);
}

[data-theme="dark"] .protocol-reference-batch {
    background:
        linear-gradient(135deg,
            var(--bg-subtle),
            color-mix(in srgb, var(--panel) 80%, var(--bg-subtle)));
}

@media (max-width: 1000px) {
    .protocol-create-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .protocol-create-sidebar {
        position: static;
        grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.75fr);
    }
}

@media (max-width: 760px) {
    .protocol-create-page {
        width: 100%;
    }

    .protocol-create-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.25rem;
        border-radius: 14px;
    }

    .protocol-create-hero-badge {
        flex-basis: auto;
        width: 100%;
    }

    .protocol-create-field-grid,
    .protocol-reference-batch,
    .protocol-create-sidebar {
        grid-template-columns: 1fr;
    }

    .protocol-create-actions {
        position: static;
        align-items: stretch;
        flex-direction: column;
    }

    .protocol-create-action-buttons {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
    }
}

@media (max-width: 500px) {
    .protocol-create-breadcrumb {
        margin-bottom: 0.75rem;
    }

    .protocol-create-hero {
        padding: 1.25rem;
    }

    .protocol-create-hero h1 {
        font-size: 1.7rem;
    }

    /*
     * Overrides the global mobile .panel padding: 3px rule only for this page.
     */
    .protocol-create-section,
    .protocol-create-guide {
        padding: 1rem;
    }

    .protocol-create-section-header {
        gap: 0.65rem;
    }

    .protocol-reference-batch {
        padding: 1rem;
    }

    .protocol-create-action-buttons {
        grid-template-columns: 1fr;
    }

    .protocol-create-action-buttons .button,
    .protocol-create-action-buttons button {
        width: 100%;
    }

    .protocol-create-action-buttons .button {
        order: 2;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {

    .protocol-create-field input,
    .protocol-create-field textarea,
    .protocol-create-field select,
    .protocol-reference-batch-input input {
        transition: none;
    }
}.qr-panel {
    margin-top: 1rem;
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.qr-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;

    padding: 0.75rem;
    border: 1px solid var(--bg);
    border-radius: 10px;
    background: var(--panel);

    text-decoration: none;
    color: inherit;
    text-align: center;

    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.qr-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.qr-card img {
    width: 128px;
    height: 128px;
    border-radius: 6px;
    padding: 6px;
}

.qr-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.qr-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
}

.qr-preview {
    border: 1px solid var(--bg);
    border-radius: 6px;
    background: var(--panel);
    padding: 6px;
    width: 128px;
    height: 128px;
}

.qr-preview.small {
    width: 96px;
    height: 96px;
}

.qr-link:hover .qr-preview {
    box-shadow: var(--shadow);
}

.qr-print-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.qr-print-sheet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(2.4in, 1fr));
    gap: 0.15in;
    padding: 0.15in;
    background: #fff;
}

.qr-print-label {
    break-inside: avoid;
    page-break-inside: avoid;
}

.qr-print-cutline {
    border: 1.5px dotted #777;
    border-radius: 10px;
    padding: 0.08in;
    background: #fff;
}

.qr-print-inner {
    min-height: 1.15in;
    display: grid;
    grid-template-columns: 0.85in 1fr;
    gap: 0.08in;
    align-items: center;
}

.qr-print-image {
    width: 0.85in;
    height: 0.85in;
    object-fit: contain;
}

.qr-print-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.02in;
    line-height: 1.15;
}

.qr-print-title {
    font-size: 10pt;
    color: #111;
    overflow-wrap: anywhere;
}

.qr-print-subtitle {
    font-size: 8pt;
    color: #333;
}

.qr-print-help {
    font-size: 7pt;
    color: #555;
}

.qr-print-id {
    font-size: 5.5pt;
    color: #777;
    overflow-wrap: anywhere;
}

@media print {
    body * {
        visibility: hidden !important;
    }

    .qr-print-sheet,
    .qr-print-sheet * {
        visibility: visible !important;
    }

    .qr-print-sheet {
        position: absolute !important;
        left: 0;
        top: 0;
        width: 100% !important;

        display: grid !important;
        grid-template-columns: repeat(3, 2.45in);
        gap: 0.12in;
        padding: 0 !important;
        background: #fff !important;
    }

    .qr-print-label {
        display: block !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .qr-print-cutline {
        border: 1px dotted #555 !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    .qr-print-image {
        display: block !important;
        width: 0.82in;
        height: 0.82in;
    }
}.batch-report-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
}

.batch-report-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.batch-report-body {
    margin-top: 1rem;
    display: grid;
    gap: 1rem;
}

.event-preview-list {
    display: grid;
    gap: .5rem;
}

.event-preview-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    border: 1px solid var(--bg);
    border-radius: 8px;
    background: var(--background);
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.organization-batch-table {
    width: max-content;
    min-width: 100%;
}.reviewables-page {
    display: grid;
    gap: 1.5rem;
}

.reviewables-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.reviewables-page-heading {
    display: grid;
    gap: 0.5rem;
    max-width: 52rem;
}

.reviewables-page-heading h1,
.reviewables-page-heading p {
    margin: 0;
}

.reviewables-page-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--primary-subtle);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.reviewables-guidance {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.reviewables-guidance-card {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}

.reviewables-guidance-card.warning {
    border-color: var(--border-muted);
    background: var(--warning-subtle);
}

.reviewables-guidance-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    font-size: 1rem;
}

.reviewables-guidance-copy {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.reviewables-guidance-copy strong,
.reviewables-guidance-copy p {
    margin: 0;
}

.reviewables-guidance-copy p {
    line-height: 1.5;
}

.reviewables-global-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}

.reviewables-global-actions-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.reviewables-global-actions-copy strong,
.reviewables-global-actions-copy span {
    margin: 0;
}

.reviewables-global-action-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.reviewables-global-action-buttons form,
.reviewable-group-actions form,
.reviewable-actions form {
    margin: 0;
}

.reviewable-groups {
    display: grid;
    gap: 0.8rem;
}

.reviewable-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.reviewable-card[open] {
    border-color: var(--border-muted);
}

.reviewable-card-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    cursor: pointer;
    list-style: none;
    background: var(--panel);
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.reviewable-card-summary::-webkit-details-marker {
    display: none;
}

.reviewable-card-summary:hover {
    background: var(--hover-bg);
    color: var(--text-hover);
}

.reviewable-card-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.reviewable-card-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reviewable-card-count {
    min-width: 1.75rem;
    text-align: center;
}

.reviewable-card-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: var(--radius);
    background: var(--neutral-btn);
    transition: transform 0.15s ease;
}

.reviewable-card[open] .reviewable-card-chevron {
    transform: rotate(180deg);
}

.reviewable-card-content {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.reviewable-group-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.reviewable-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}

.reviewable-toolbar .checkbox-row {
    margin: 0;
}

.reviewable-selection-status {
    min-width: 0;
}

.reviewable-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reviewable-table {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}

.reviewable-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.reviewable-row:last-child {
    border-bottom: 0;
}

.reviewable-row:hover {
    background: var(--hover-bg);
}

.reviewable-row.is-selected {
    background: var(--primary-subtle);
}

.reviewable-row.is-locked {
    background: var(--warning-subtle);
}

.reviewable-row.is-locked:hover {
    background: var(--warning-subtle);
}

.reviewable-name {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.reviewable-name input[type="checkbox"] {
    margin-top: 0.25rem;
}

.reviewable-name input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.reviewable-row.is-locked .reviewable-name {
    cursor: not-allowed;
}

.reviewable-label-group {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.reviewable-primary-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
}

.reviewable-record-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 650;
    color: var(--text);
}

.reviewable-lock-message {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    max-width: 48rem;
    line-height: 1.45;
}

.reviewable-lock-message::before {
    content: "↳";
    flex: 0 0 auto;
    color: var(--muted);
}

.reviewable-open-action {
    align-self: center;
    white-space: nowrap;
}

.reviewables-dependency-order {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.reviewables-dependency-step {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.reviewables-dependency-step:not(:last-child)::after {
    content: "→";
    color: var(--muted);
}

.reviewables-dependency-label {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.2rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 650;
}

.reviewables-empty-state {
    display: grid;
    justify-items: center;
    gap: 0.65rem;
    padding: 3.5rem 1.5rem;
    border: 1px dashed var(--border-muted);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    text-align: center;
}

.reviewables-empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    font-size: 1.35rem;
}

.reviewables-empty-state h2,
.reviewables-empty-state p {
    margin: 0;
}

.reviewables-empty-state p {
    max-width: 36rem;
}

@media (max-width: 900px) {
    .reviewables-guidance {
        grid-template-columns: 1fr;
    }

    .reviewables-global-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .reviewables-global-action-buttons {
        justify-content: flex-start;
        width: 100%;
    }

    .reviewable-toolbar {
        grid-template-columns: 1fr auto;
    }

    .reviewable-selection-status {
        text-align: right;
    }

    .reviewable-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .reviewables-page {
        gap: 1rem;
    }

    .reviewables-page-header {
        display: block;
    }

    .reviewables-guidance-card {
        padding: 0.85rem;
    }

    .reviewables-global-actions {
        padding: 0.85rem;
    }

    .reviewables-global-action-buttons,
    .reviewable-group-actions,
    .reviewable-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .reviewables-global-action-buttons form,
    .reviewable-group-actions form,
    .reviewable-actions form,
    .reviewables-global-action-buttons .button,
    .reviewable-group-actions .button,
    .reviewable-actions .button {
        width: 100%;
    }

    .reviewable-card-summary {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.6rem;
        padding: 0.9rem;
    }

    .reviewable-card-summary-selection {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .reviewable-card-content {
        padding: 0.75rem;
    }

    .reviewable-toolbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.65rem;
    }

    .reviewable-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.85rem;
    }

    .reviewable-open-action {
        width: 100%;
    }

    .reviewable-open-action .button {
        width: 100%;
    }

    .reviewables-dependency-order {
        align-items: flex-start;
        flex-direction: column;
    }

    .reviewables-dependency-step:not(:last-child)::after {
        content: "↓";
    }
}.sample-timestamps {
    display: inline-flex;
}

@media (max-width: 640px) {
    .sample-timestamps {
        display: grid;
    }
}

.sample-header-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.sample-header-links .button {
    margin: 0;
}

@media (max-width: 720px) {
    .sample-header-links {
        align-items: stretch;
    }

    .sample-header-links .button {
        width: 100%;
        justify-content: flex-start;
    }
}/* ==========================================================================
   Schedule layout
   ========================================================================== */

.schedule-header,
.schedule-toolbar,
.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.schedule-header {
    align-items: center;
    margin-bottom: 1.5rem;
}

.schedule-header h1,
.schedule-toolbar h1,
.schedule-toolbar h2 {
    margin: 0;
}

.schedule-header h1 {
    flex: 1;
}

.schedule-toolbar {
    margin-bottom: 1rem;
}

.schedule-print-area {
    min-width: 0;
}

.view-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.view-toggle .button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text);
}

.schedule-print-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}


/* ==========================================================================
      Schedule legend
      ========================================================================== */

.schedule-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;

    margin: 1rem 0;
    padding: 0.7rem 0.85rem;

    border-radius: 8px;
    background: var(--panel-muted);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.legend-dot {
    width: 0.65rem;
    height: 0.65rem;
    flex: 0 0 0.65rem;

    border-radius: 999px;
    background: var(--accent);
}

.legend-dot.done {
    background: var(--success);
}

.legend-dot.critical {
    background: var(--danger);
}

.legend-dot.hold {
    background: var(--warning);
}


/* ==========================================================================
      Table / overview schedule
      ========================================================================== */

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.schedule-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;

    padding: 0.75rem 1rem;

    border-radius: 8px;
    border-left: 4px solid transparent;
    background: var(--bg);
}

.schedule-row.done {
    opacity: 0.65;
}

.schedule-row.critical {
    border-left-color: var(--danger);
}

.schedule-row.hold {
    border-left-color: var(--warning);
}

.schedule-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.schedule-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}


/* ==========================================================================
      Gantt
      ========================================================================== */

.gantt {
    --gantt-label-width: 264px;

    position: relative;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.gantt-protocol {
    margin-bottom: 1.5rem;
}

.gantt-protocol:last-child {
    margin-bottom: 0;
}

.gantt-protocol-label {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.schedule-protocol {
    margin-bottom: 1.5rem;
}

.gantt-link {
    color: var(--text);
}

.gantt-link:hover {
    color: inherit;
    text-decoration: none;
    background: inherit;
}


/* Gantt header and rows share the same grid */

.gantt-header,
.gantt-row {
    display: grid;
    grid-template-columns:
        minmax(var(--gantt-label-width), var(--gantt-label-width)) minmax(720px, 1fr);

    align-items: center;
}

.gantt-header {
    position: sticky;
    top: 0;
    z-index: 4;

    min-width: calc(var(--gantt-label-width) + 720px);
    margin-bottom: 10px;

    background: var(--panel);
}

.gantt-row {
    min-width: calc(var(--gantt-label-width) + 720px);
    margin: 6px 0;
}

.gantt-header-label {
    position: sticky;
    left: 0;
    z-index: 5;

    align-self: stretch;
    display: flex;
    align-items: center;

    min-width: 0;
    padding-right: 0.75rem;

    background: var(--panel);
    font-size: 0.85rem;
    font-weight: 700;
}

.gantt-header-track {
    position: relative;
    height: 34px;
    min-width: 0;

    border-bottom: 1px solid var(--border);
}

.gantt-tick {
    position: absolute;
    top: 6px;
    z-index: 2;

    max-width: 7rem;
    padding: 0 0.25rem;

    color: var(--muted);
    background: var(--panel);

    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;

    transform: translateX(-50%);
}

/* Keep edge labels inside the available track. */

.gantt-tick:first-child {
    transform: none;
    text-align: left;
}

.gantt-tick:last-child {
    transform: translateX(-100%);
    text-align: right;
}

.gantt-label {
    position: sticky;
    left: 0;
    z-index: 3;

    width: auto;
    min-width: 0;
    padding: 0.35rem 0.75rem 0.35rem 0;

    background: var(--panel);
    font-size: 0.85rem;
}

.gantt-label strong,
.gantt-label span,
.gantt-label small {
    display: block;
    min-width: 0;
}

.gantt-label strong,
.gantt-label>span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gantt-label small {
    margin-top: 0.2rem;
    line-height: 1.3;
}

.gantt-track {
    position: relative;

    min-width: 0;
    height: 30px;

    overflow: hidden;

    border-radius: 4px;
    background:
        repeating-linear-gradient(to right,
            transparent,
            transparent 116px,
            color-mix(in srgb, var(--text) 6%, transparent) 120px,
            color-mix(in srgb, var(--text) 6%, transparent) 121px),
        var(--panel-muted);
}

.gantt-bar {
    position: absolute;
    top: 0;
    bottom: 0;

    display: flex;
    align-items: center;

    min-width: 3px;
    padding: 2px 6px;

    overflow: hidden;

    border: 1px solid transparent;
    border-radius: 4px;

    background: var(--accent);
    color: var(--text);

    font-size: 0.75rem;
    line-height: 1;
    white-space: nowrap;
}

.gantt-bar>span {
    display: block;

    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gantt-bar.clickable {
    cursor: pointer;
    text-decoration: none;

    transition:
        filter 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.gantt-bar.clickable:hover {
    z-index: 2;

    color: var(--text);
    text-decoration: none;

    filter: brightness(1.04);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.gantt-bar.done {
    background: var(--success);
}

.gantt-bar.critical {
    border: 2px solid var(--danger);
}

.gantt-bar.hold {
    background:
        repeating-linear-gradient(45deg,
            var(--warning),
            var(--warning) 6px,
            transparent 6px,
            transparent 12px),
        var(--panel-muted);
}


/* ==========================================================================
      Organization Gantt
      ========================================================================== */

.organization-gantt {
    --gantt-label-width: 264px;
}

.organization-gantt .gantt-label {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.organization-gantt .gantt-row {
    min-height: 38px;
}

.organization-gantt .gantt-track {
    height: 30px;
}

.organization-gantt .gantt-label .badge,
.organization-gantt .gantt-label .muted {
    margin-top: 0.15rem;
}

.organization-gantt .gantt-bar {
    font-weight: 600;
}


/* ==========================================================================
      Calendar
      ========================================================================== */

.calendar {
    display: grid;
    gap: 6px;

    width: 100%;
    min-width: 0;
    padding: 0.75rem;

    overflow-x: auto;

    border-radius: 12px;
    background: var(--panel);
}

.calendar-week {
    min-width: 1160px;
    margin-bottom: 1rem;
}

.calendar-week:last-child {
    margin-bottom: 0;
}

.calendar-header,
.calendar-row {
    display: grid;
    grid-template-columns: 180px repeat(7, minmax(140px, 1fr));
}

.calendar-header {
    margin-bottom: 6px;

    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.calendar-corner {
    display: flex;
    align-items: center;

    padding: 0.6rem 0.75rem;

    font-weight: 700;
}

.calendar-row {
    margin-bottom: 8px;
    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--bg);

    transition:
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.calendar-row:hover {
    background: var(--hover-bg);
    box-shadow: var(--shadow);
}

.calendar-day-header {
    padding: 0.6rem 0;

    border-left: 1px solid var(--border);
    border-bottom: none;

    font-weight: 600;
    text-align: center;
}

.calendar-day-header.today {
    background:
        color-mix(in srgb,
            var(--accent) 28%,
            var(--panel));
}

.calendar-day-label {
    color: var(--muted);
    font-size: 0.7rem;
}

.calendar-day-number {
    margin-top: 0.1rem;

    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
}

.calendar-label {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    min-width: 0;
    padding: 0.75rem 0.9rem;

    border-right: 1px solid var(--border);

    font-size: 0.9rem;
}

.calendar-label strong,
.calendar-label span {
    display: block;
    min-width: 0;
}

.calendar-label strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-label .muted {
    margin-top: 0.2rem;
    line-height: 1.3;
}

.calendar-cell {
    position: relative;

    min-width: 0;
    height: 96px;
    min-height: 96px;

    overflow-x: hidden;
    overflow-y: auto;

    border-left: 1px solid var(--border);

    background:
        repeating-linear-gradient(to bottom,
            transparent,
            transparent 15px,
            color-mix(in srgb, var(--text) 5%, transparent) 16px);
}

.calendar-cell.today {
    background:
        repeating-linear-gradient(to bottom,
            transparent,
            transparent 15px,
            color-mix(in srgb, var(--text) 5%, transparent) 16px),
        color-mix(in srgb,
            var(--accent) 8%,
            transparent);
}

.calendar-cell::-webkit-scrollbar {
    width: 6px;
}

.calendar-cell::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background:
        color-mix(in srgb,
            var(--text) 22%,
            transparent);
}

.calendar-event {
    position: relative;

    display: flex;
    align-items: flex-start;
    gap: 0.2rem;

    width: calc(100% - 12px);
    min-width: 0;
    margin: 2px 6px 0;
    padding: 4px 6px;

    overflow: hidden;

    border: 1px solid transparent;
    border-radius: 6px;

    background:
        linear-gradient(180deg,
            var(--accent),
            color-mix(in srgb, var(--accent) 80%, black));

    color: var(--text);

    box-shadow: var(--shadow);

    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        filter 0.15s ease;
}

.calendar-event strong,
.calendar-event span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event:hover {
    z-index: 2;

    color: var(--text);
    text-decoration: none;

    filter: brightness(1.04);
    box-shadow: var(--shadow);
    transform: scale(1.02);
}

/*
    * State classes are applied directly to .calendar-event in the templates.
    * The previous .calendar-row.done .calendar-event selectors did not match.
    */

.calendar-event.done {
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--success) 68%, white),
            var(--success));

    opacity: 0.82;
}

.calendar-event.critical {
    border: 2px solid var(--danger);
}

.calendar-event.hold {
    background:
        repeating-linear-gradient(45deg,
            var(--warning),
            var(--warning) 6px,
            transparent 6px,
            transparent 12px),
        var(--panel-muted);
}


/* ==========================================================================
      Organization calendar
      ========================================================================== */

.organization-calendar .calendar-row {
    min-height: 112px;
}

.organization-calendar .calendar-cell {
    height: 112px;
    min-height: 112px;
}

.organization-calendar .calendar-event {
    flex-direction: column;
    align-items: stretch;
}

.organization-calendar .calendar-event strong,
.organization-calendar .calendar-event span {
    display: block;
}


/* ==========================================================================
      Responsive
      ========================================================================== */

@media (max-width: 1000px) {

    .schedule-toolbar,
    .panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        justify-content: flex-start;
    }

    .gantt {
        --gantt-label-width: 220px;
    }

    .organization-gantt {
        --gantt-label-width: 220px;
    }
}

@media (max-width: 700px) {
    .schedule-legend {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.45rem;
    }

    .gantt {
        --gantt-label-width: 180px;
    }

    .organization-gantt {
        --gantt-label-width: 180px;
    }

    .gantt-header,
    .gantt-row {
        grid-template-columns:
            minmax(var(--gantt-label-width), var(--gantt-label-width)) minmax(620px, 1fr);

        min-width: calc(var(--gantt-label-width) + 620px);
    }

    .gantt-label {
        font-size: 0.78rem;
    }

    .calendar {
        padding: 0.5rem;
    }

    .calendar-week {
        min-width: 1080px;
    }
}


/* ==========================================================================
      Print
      ========================================================================== */

@media print {
    @page {
        size: landscape;
        margin: 0.4in;
    }

    html,
    body {
        background: #fff !important;
        color: #000 !important;
    }

    body * {
        visibility: hidden !important;
    }

    .schedule-print-area,
    .schedule-print-area * {
        visibility: visible !important;
    }

    .schedule-print-area {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;

        width: 100% !important;

        background: #fff !important;
        color: #000 !important;
    }

    .no-print,
    .schedule-print-button,
    .view-toggle {
        display: none !important;
        visibility: hidden !important;
    }

    .gantt,
    .calendar,
    .calendar-week {
        overflow: visible !important;

        background: #fff !important;
        color: #000 !important;
    }

    .gantt-header,
    .gantt-row {
        min-width: 100% !important;
        grid-template-columns: 220px minmax(0, 1fr) !important;
    }

    .gantt-header,
    .gantt-header-label,
    .gantt-label {
        position: static !important;
        background: #fff !important;
    }

    .gantt-header-track,
    .gantt-track {
        border-color: #ccc !important;
        background-color: #fff !important;
    }

    .gantt-tick {
        background: #fff !important;
        color: #333 !important;
    }

    .calendar-week {
        min-width: 100% !important;
        break-inside: avoid;
    }

    .calendar-header,
    .calendar-row {
        grid-template-columns: 150px repeat(7, minmax(0, 1fr));
    }

    .calendar-row,
    .calendar-day-header,
    .calendar-label,
    .calendar-cell {
        border-color: #ccc !important;
    }
}

.schedule-range-toggle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.schedule-range-toggle .button.active {
    color: var(--text);
    background: var(--accent);
    border-color: var(--accent);
}

.schedule-range-empty {
    min-height: 12rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}.search-modal.hidden {
    display: none;
}

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

/* === SEARCH BOX === */
.search-box {
    position: relative;
    max-width: 600px;
    margin: 10vh auto;
    background: var(--panel);
    border-radius: var(--radius);
    padding: 1rem;
    z-index: 1001;
    border: 1px solid var(--bg);
    box-shadow: var(--shadow);
}

.search-result-item.active .title {
    color: var(--primary);
}

/* === INPUT === */
.search-box input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--panel);
}

/* === RESULTS CONTAINER === */
.search-results {
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

/* === GROUP === */
.search-group {
    margin-bottom: 1rem;
}

.search-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.5rem 0.5rem 0.25rem;
}

/* === RESULT ITEM === */
.search-result-item {
    padding: 0.5rem;
    border-radius: 6px;
    border-bottom: 1px solid var(--bg);
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: var(--hover-bg);
}

.search-result-item.active {
    background: var(--primary-subtle);
}

.search-result-item:focus {
    outline: none;
    background: var(--primary-subtle);
}

.search-result-item:focus .title {
    color: var(--primary);
}

/* === RESULT ROW === */
.result-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.emoji {
    font-size: 1.25rem;
    line-height: 1.5;
}

/* === TEXT CONTENT === */
.result-content .title {
    font-weight: 500;
    color: var(--text);
}

.result-content .snippet {
    font-size: 0.85rem;
    color: var(--muted);
}  /* ---------------------------------------------------------------------
       Electronic signature modal
       --------------------------------------------------------------------- */

  .access-signature-modal[hidden] {
      display: none;
  }

  .access-signature-modal {
      position: fixed;
      inset: 0;
      z-index: 10000;
      display: grid;
      place-items: center;
      padding: 1rem;
  }

  .access-signature-modal__backdrop {
      position: absolute;
      inset: 0;
      background: rgb(15 23 42 / 72%);
      backdrop-filter: blur(3px);
  }

  .access-signature-modal__dialog {
      position: relative;
      width: min(100%, 620px);
      max-height: calc(100vh - 2rem);
      overflow-y: auto;
      border: 1px solid var(--border);
      border-radius: 16px;
      background: var(--panel);
      box-shadow: 0 24px 80px rgb(0 0 0 / 30%);
  }

  .access-signature-modal__header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 1rem;
      padding: 1.25rem 1.25rem 1rem;
      border-bottom: 1px solid var(--border);
  }

  .access-signature-modal__header h2 {
      margin: 0;
  }

  .access-signature-modal__header p {
      margin: 0.35rem 0 0;
  }

  .access-signature-modal__close {
      display: grid;
      width: 2.25rem;
      height: 2.25rem;
      flex: 0 0 auto;
      place-items: center;
      padding: 0;
      border: 0;
      border-radius: 999px;
      background: transparent;
      color: var(--text);
      font-size: 1.4rem;
      line-height: 1;
      cursor: pointer;
  }

  .access-signature-modal__close:hover {
      background: var(--hover-bg);
  }

  .access-signature-modal__form {
      margin: 0;
  }

  .access-signature-modal__body {
      display: grid;
      gap: 1rem;
      padding: 1.25rem;
  }

  .access-signature-modal__context {
      padding: 1rem;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--bg-subtle);
  }

  .access-signature-modal__context h3 {
      margin: 0 0 0.75rem;
      font-size: 0.95rem;
  }

  .access-signature-modal__context-grid {
      display: grid;
      grid-template-columns: minmax(120px, auto) 1fr;
      gap: 0.45rem 1rem;
      margin: 0;
  }

  .access-signature-modal__context-grid dt {
      color: var(--muted);
      font-size: 0.875rem;
  }

  .access-signature-modal__context-grid dd {
      min-width: 0;
      margin: 0;
      overflow-wrap: anywhere;
      color: var(--text);
      font-weight: 600;
  }

  .access-signature-modal__attestation {
      padding: 0.9rem 1rem;
      border-left: 4px solid var(--primary);
      border-radius: 8px;
      background: var(--bg-subtle);
      line-height: 1.5;
  }

  .access-signature-modal__field {
      display: grid;
      gap: 0.4rem;
  }

  .access-signature-modal__field label {
      font-weight: 700;
  }

  .access-signature-modal__field textarea {
      min-height: 92px;
      resize: vertical;
  }

  .access-signature-modal__field--note textarea {
      min-height: 76px;
  }

  .access-signature-modal__error {
      padding: 0.75rem 0.9rem;
      border: 1px solid var(--color-failed);
      border-radius: 8px;
      color: var(--color-failed);
      background: rgb(220 38 38 / 8%);
  }

  .access-signature-modal__actions {
      display: flex;
      justify-content: flex-end;
      gap: 0.75rem;
      padding-top: 0.25rem;
  }

  .access-signature-modal__submit[disabled] {
      cursor: wait;
      opacity: 0.65;
  }

  body.access-signature-modal-open {
      overflow: hidden;
  }

  @media (max-width: 900px) {
      .access-request-header {
          display: none;
      }

      .access-request-row {
          grid-template-columns: 1fr;
          gap: 0.75rem;
          align-items: start;
      }

      .access-request-actions {
          justify-content: flex-start;
      }
  }

  @media (max-width: 640px) {
      .access-signature-modal {
          padding: 0;
          align-items: end;
      }

      .access-signature-modal__dialog {
          width: 100%;
          max-height: 94vh;
          border-right: 0;
          border-bottom: 0;
          border-left: 0;
          border-radius: 18px 18px 0 0;
      }

      .access-signature-modal__context-grid {
          grid-template-columns: 1fr;
          gap: 0.2rem;
      }

      .access-signature-modal__context-grid dd {
          margin-bottom: 0.55rem;
      }

      .access-signature-modal__actions {
          flex-direction: column-reverse;
      }

      .access-signature-modal__actions button {
          width: 100%;
      }
  }

  /* ---------------------------------------------------------------------
       Electronic signature views
       --------------------------------------------------------------------- */
  .signature-view {
      display: grid;
      gap: 1.25rem;
  }

  .signature-view-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 1.5rem;
      padding: 1.5rem;
      border: 1px solid var(--border);
      border-radius: 16px;
      background: var(--panel);
  }

  .signature-view-header-copy {
      min-width: 0;
  }

  .signature-view-header .eyebrow {
      margin: 0 0 0.4rem;
      color: var(--primary);
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
  }

  .signature-view-header h1 {
      margin: 0;
  }

  .signature-view-header .muted {
      max-width: 680px;
      margin: 0.55rem 0 0;
  }

  .signature-view-header-actions {
      display: flex;
      flex: 0 0 auto;
      align-items: center;
      gap: 0.75rem;
  }

  .signature-record-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
      gap: 1.25rem;
      align-items: start;
  }

  .signature-panel {
      min-width: 0;
      overflow: hidden;
      border: 1px solid var(--border);
      border-radius: 16px;
      background: var(--panel);
  }

  .signature-panel--full {
      grid-column: 1 / -1;
  }

  .signature-panel-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 1rem;
      padding: 1.2rem 1.25rem;
      border-bottom: 1px solid var(--border);
      background: var(--bg-subtle);
  }

  .signature-panel-header-copy {
      min-width: 0;
  }

  .signature-panel-header h2 {
      margin: 0;
      font-size: 1.05rem;
  }

  .signature-panel-header p {
      margin: 0.35rem 0 0;
  }

  .signature-panel-body {
      min-width: 0;
      padding: 1.25rem;
  }

  .signature-status {
      display: inline-flex;
      flex: 0 0 auto;
      align-items: center;
      gap: 0.45rem;
      padding: 0.4rem 0.7rem;
      border: 1px solid var(--color-completed);
      border-radius: 999px;
      color: var(--color-completed);
      background: var(--panel);
      font-size: 0.78rem;
      font-weight: 700;
      white-space: nowrap;
  }

  .signature-status-dot {
      width: 0.48rem;
      height: 0.48rem;
      border-radius: 999px;
      background: var(--color-completed);
  }

  .signature-id {
      display: block;
      max-width: 100%;
      margin-top: 0.45rem;
      overflow-wrap: anywhere;
      color: var(--muted);
      font-size: 0.78rem;
  }

  .signature-definition-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0;
      margin: 0;
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
  }

  .signature-definition-item {
      min-width: 0;
      padding: 1rem;
      border-right: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
  }

  .signature-definition-item:nth-child(2n) {
      border-right: 0;
  }

  .signature-definition-item:nth-last-child(-n + 2) {
      border-bottom: 0;
  }

  .signature-definition-item--full {
      grid-column: 1 / -1;
      border-right: 0;
  }

  .signature-definition-grid dt {
      margin: 0 0 0.35rem;
      color: var(--muted);
      font-size: 0.76rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
  }

  .signature-definition-grid dd {
      min-width: 0;
      margin: 0;
      color: var(--text);
      line-height: 1.5;
      overflow-wrap: anywhere;
  }

  .signature-definition-grid time {
      color: inherit;
  }

  .signature-person {
      display: grid;
      gap: 0.15rem;
  }

  .signature-target-summary {
      display: grid;
      gap: 1rem;
  }

  .signature-target-type {
      display: inline-flex;
      width: fit-content;
      max-width: 100%;
      align-items: center;
      padding: 0.4rem 0.7rem;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: var(--bg-subtle);
      color: var(--text);
      font-size: 0.82rem;
      font-weight: 700;
  }

  .signature-target-id {
      display: grid;
      gap: 0.35rem;
      min-width: 0;
      padding: 0.9rem 1rem;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--bg);
  }

  .signature-target-id-label {
      color: var(--muted);
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
  }

  .signature-target-id-value {
      min-width: 0;
      overflow-wrap: anywhere;
      color: var(--text);
  }

  .signature-panel-actions {
      display: flex;
      justify-content: flex-end;
      gap: 0.75rem;
      padding: 1rem 1.25rem;
      border-top: 1px solid var(--border);
      background: var(--bg-subtle);
  }

  .signature-integrity-intro {
      display: flex;
      align-items: flex-start;
      gap: 0.85rem;
      margin-bottom: 1rem;
      padding: 0.9rem 1rem;
      border-left: 4px solid var(--primary);
      border-radius: 8px;
      background: var(--bg-subtle);
  }

  .signature-integrity-intro strong {
      display: block;
      margin-bottom: 0.2rem;
  }

  .signature-hash-list {
      display: grid;
      gap: 0.8rem;
      min-width: 0;
  }

  .signature-hash-item {
      min-width: 0;
      padding: 0.9rem 1rem;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--bg);
  }

  .signature-hash-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      margin-bottom: 0.45rem;
  }

  .signature-hash-label {
      color: var(--muted);
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
  }

  .signature-hash-value {
      display: block;
      width: 100%;
      min-width: 0;
      margin: 0;
      overflow-wrap: anywhere;
      word-break: break-word;
      color: var(--text);
      font-size: 0.78rem;
      line-height: 1.6;
      white-space: normal;
  }

  .signature-genesis {
      display: inline-flex;
      align-items: center;
      width: fit-content;
      padding: 0.3rem 0.55rem;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: var(--bg-subtle);
      color: var(--muted);
      font-size: 0.76rem;
      font-weight: 700;
  }

  .signature-context-wrap {
      min-width: 0;
  }

  .signature-context-code {
      display: block;
      width: 100%;
      max-width: 100%;
      max-height: 460px;
      margin: 0;
      overflow: auto;
      padding: 1rem;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--bg);
      color: var(--text);
      font-size: 0.8rem;
      line-height: 1.65;
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      word-break: break-word;
  }

  .signature-context-code code {
      font: inherit;
      white-space: inherit;
  }

  .signature-record-meta {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 0.75rem;
      margin-top: 1rem;
  }

  .signature-record-meta-item {
      min-width: 0;
      padding: 0.8rem 0.9rem;
      border: 1px solid var(--border);
      border-radius: 10px;
      background: var(--bg-subtle);
  }

  .signature-record-meta-label {
      display: block;
      margin-bottom: 0.3rem;
      color: var(--muted);
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
  }

  .signature-record-meta-value {
      display: block;
      min-width: 0;
      overflow-wrap: anywhere;
      color: var(--text);
      font-size: 0.82rem;
  }

  @media (max-width: 980px) {
      .signature-record-grid {
          grid-template-columns: 1fr;
      }

      .signature-panel--full {
          grid-column: auto;
      }
  }

  @media (max-width: 720px) {
      .signature-view-header {
          flex-direction: column;
          padding: 1.15rem;
      }

      .signature-view-header-actions,
      .signature-view-header-actions .button {
          width: 100%;
      }

      .signature-definition-grid {
          grid-template-columns: 1fr;
      }

      .signature-definition-item,
      .signature-definition-item:nth-child(2n),
      .signature-definition-item:nth-last-child(-n + 2) {
          border-right: 0;
          border-bottom: 1px solid var(--border);
      }

      .signature-definition-item:last-child {
          border-bottom: 0;
      }

      .signature-definition-item--full {
          grid-column: auto;
      }

      .signature-record-meta {
          grid-template-columns: 1fr;
      }

      .signature-panel-header {
          flex-direction: column;
      }

      .signature-status {
          align-self: flex-start;
      }

      .signature-panel-actions {
          justify-content: stretch;
      }

      .signature-panel-actions .button {
          width: 100%;
      }
  }.species-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
    gap: 1rem;
}

.species-name {
    font-size: 0.9rem;
}

.species-list li:hover {
    background: var(--hover-bg);
}

.variant-card-list {
    display: grid;
    gap: 0.75rem;
}

.variant-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--bg);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    background: var(--bg);
}

.variant-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}

@media (max-width: 640px) {
    .variant-card {
        align-items: stretch;
        flex-direction: column;
    }

    .variant-card .button {
        width: 100%;
        text-align: center;
    }
}


.lineage-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(216px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.lineage-summary-card {
    background: var(--bg);
    border: 1px solid var(--bg);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.lineage-summary-card strong {
    display: block;
    font-size: 1.75rem;
    line-height: 1;
}

.lineage-summary-card span {
    color: var(--muted);
    font-size: 0.9rem;
}

.lineage-forest {
    display: grid;
    gap: 1.25rem;
}

.lineage-node {
    position: relative;
}

.lineage-card {
    position: relative;
    background: linear-gradient(135deg, var(--bg), var(--surface-muted));
    border: 1px solid var(--bg);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    box-shadow: var(--shadow-sm);
}

.lineage-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    font-size: 1rem;
}

.lineage-title a {
    color: var(--text);
    text-decoration: none;
}

.lineage-title a:hover {
    text-decoration: underline;
}

.lineage-icon {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-muted);
}

.lineage-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
    margin-left: 2.3rem;
}

.lineage-chip {
    font-size: 0.78rem;
    color: var(--muted);
    border: 1px solid var(--bg);
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    background: var(--bg);
}

.lineage-children {
    margin-left: 1.4rem;
    padding-left: 1.4rem;
    border-left: 2px solid var(--bg);
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.lineage-children>.lineage-node::before {
    content: "";
    position: absolute;
    top: 1.55rem;
    left: -1.4rem;
    width: 1.4rem;
    border-top: 2px solid var(--bg);
}

@media (max-width: 700px) {
    .lineage-children {
        margin-left: 0.6rem;
        padding-left: 1rem;
    }

    .lineage-meta {
        margin-left: 0;
    }
}.supplier-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.supplier-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
}

.supplier-item-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.supplier-item-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.supplier-item-units {
    font-size: 0.85rem;
    color: var(--muted);
    white-space: nowrap;
}

.supplier-item-actions {
    text-align: right;
}


.supplier-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
    gap: 1rem;
}

.supplier-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.supplier-count {
    font-size: 0.8rem;
}

.supplier-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.supplier-name {
    font-size: 0.9rem;
}

.supplier-website {
    font-size: 0.8rem;
}

.supplier-list li:hover {
    background: var(--hover-bg);
}

.supplier-items {
    display: grid;
    gap: 1rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.supplier-item-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.supplier-item-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.supplier-item-title {
    font-weight: 700;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: baseline;
}

.supplier-item-price {
    display: flex;
    gap: .5rem;
    align-items: center;
    white-space: nowrap;
}

.supplier-item-body {
    display: grid;
    grid-template-columns: minmax(12rem, 18rem) minmax(20rem, 1fr);
    gap: 1rem;
    padding: 1rem 0;
}

.supplier-item-summary {
    display: grid;
    gap: .4rem;
    align-content: start;
    color: var(--muted);
}

.supplier-item-quantity {
    max-width: 42rem;
}

.supplier-item-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding-top: .75rem;
    border-top: 1px solid var(--border-subtle);
}

.supplier-item-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

@media (max-width: 800px) {

    .supplier-item-header,
    .supplier-item-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .supplier-item-body {
        grid-template-columns: 1fr;
    }
}.tool-row {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.tool-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tool-name {
    font-size: 0.9rem;
}

.tool-meta {
    font-size: 0.8rem;
}

.tools li {
    font-size: 0.85rem;
    color: var(--muted);
}

.tool-list li:hover {
    background: var(--hover-bg);
}.workflow-row {
    display: block;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    flex: 1 1 auto;
}

.workflow-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.25rem;
}

.workflow-name {
    display: flex;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    min-width: 0;
    overflow: hidden;

    /* critical */
    overflow-wrap: anywhere;
    word-break: break-word;
}

.workflow-meta .muted {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.workflow-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.workflow-list li:hover {
    background: var(--hover-bg);
}

.workflow-protocol-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.workflow-protocol-item:hover {
    background: var(--hover-bg);
}

.workflow-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
}

.workflow-center {
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
    color: inherit;

    display: flex;
    gap: 0.5rem;
    align-items: center;

    overflow-wrap: anywhere;
}

.workflow-right {
    flex-shrink: 0;
}

.ai-import-modal {
    max-width: 516px;
    text-align: center;
}

.ai-import-orb {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 999px;
    background:
        radial-gradient(circle, var(--accent) 0 22%, transparent 23%),
        radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
        0 0 24px color-mix(in srgb, var(--accent) 18%, transparent);

    opacity: 0.5;
    transform: scale(1);
    animation: ai-orb-pulse 1.8s ease-in-out infinite;
    animation-play-state: paused;
    will-change: auto;
}

#aiImportModal:not(.hidden) .ai-import-orb {
    opacity: 0.72;
    animation-play-state: running;
    will-change: transform, opacity;
}

@keyframes ai-orb-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.68;
    }

    50% {
        transform: scale(1.08);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {

    .ai-import-orb,
    #aiImportModal:not(.hidden) .ai-import-orb {
        animation: none;
        transform: none;
        opacity: 0.65;
        will-change: auto;
    }
}

.ai-import-steps {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
    text-align: left;
}

.ai-import-step {
    padding: 0.65rem 0.8rem;
    border-radius: 0.75rem;
    background: var(--bg-subtle);
    color: var(--muted-text);
    font-size: 0.9rem;
}

.ai-import-step.active {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--text);
    font-weight: 700;
}

.ai-import-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bg-subtle);
    margin: 1rem 0;
}

#aiImportProgressBar {
    width: 8%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.6s ease;
}

.recipe-sheet {
    margin-inline: auto;
}

.recipe-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.recipe-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recipe-step-card {
    margin-bottom: 1rem;
    break-inside: avoid;
    page-break-inside: avoid;
}

.recipe-step-header {
    cursor: default;
}

.recipe-summary-grid {
    margin-top: 0.75rem;
}

.recipe-step-body {
    margin-top: 1rem;
}

.recipe-data-needed {
    margin-top: 1rem;
}

.recipe-signoff {
    display: none;
}

@media print {
    .recipe-signoff {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        margin-top: 1rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border);
        font-size: 0.85rem;
    }

    .recipe-step-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
        margin-bottom: 0.5rem !important;
        padding-bottom: 0.35rem !important;
        border-bottom: 1px solid #ccc !important;
    }

    .recipe-step-header .eyebrow {
        display: block !important;
        visibility: visible !important;
        color: #333 !important;
        font-size: 0.8rem !important;
        font-weight: 700 !important;
        text-transform: none !important;
        letter-spacing: 0 !important;
        margin-bottom: 0.2rem !important;
    }

    .recipe-step-header h3 {
        display: block !important;
        visibility: visible !important;
        color: #000 !important;
        font-size: 1.05rem !important;
        line-height: 1.2 !important;
        margin: 0 !important;
    }

    .step-status-stack {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
        gap: 0.25rem !important;
    }

    .badge {
        color: #000 !important;
        background: #fff !important;
        border: 1px solid #999 !important;
        box-shadow: none !important;
    }
}


@media print {

    html,
    body {
        background: #fff !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    body * {
        visibility: hidden !important;
    }

    #recipeSheet,
    #recipeSheet * {
        visibility: visible !important;
    }

    #recipeSheet {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;

        display: block !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;

        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
    }


    #recipeSheet>h3 {
        display: block !important;
        margin: 0 0 0.25rem 0 !important;
        padding: 0 !important;
        font-size: 1.1rem !important;
        line-height: 1.2 !important;
        break-after: avoid !important;
        page-break-after: avoid !important;
    }

    .no-print,
    .step-actions,
    button {
        display: none !important;
    }

    .recipe-step-card {
        break-inside: avoid-page;
        page-break-inside: avoid;
        border: 1px solid #bbb !important;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        box-shadow: none !important;
    }

    .step-card-header,
    .recipe-step-header,
    .step-summary-grid,
    .recipe-summary-grid {
        break-inside: avoid;
        page-break-inside: avoid;
        break-after: avoid;
        page-break-after: avoid;
    }

    .step-panel,
    .summary-tile {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none !important;
    }

    .recipe-step-body {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 0.75rem;
    }

    a,
    a:visited {
        color: inherit !important;
        text-decoration: none !important;
    }

    @page {
        size: letter;
        margin: 0.5in;
    }
}

.workflow-create-page,
.workflow-view-page {
    width: min(100%, 1220px);
    margin: 0 auto;
}

.workflow-breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    color: var(--muted);
    font-size: .8rem;
}

.workflow-breadcrumb a {
    color: var(--muted);
    font-weight: 700;
}

.workflow-breadcrumb a:hover {
    color: var(--primary);
}

.workflow-breadcrumb span[aria-current="page"] {
    color: var(--text);
    font-weight: 700;
}

.workflow-eyebrow {
    display: inline-flex;
    margin-bottom: .55rem;
    color: var(--primary);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.workflow-create-hero,
.workflow-view-hero {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    overflow: hidden;
    margin-bottom: 1.25rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        radial-gradient(circle at 94% 10%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 38%),
        linear-gradient(135deg, var(--panel), color-mix(in srgb, var(--primary-subtle) 58%, var(--panel)));
    box-shadow: var(--shadow);
}

.workflow-create-hero::after,
.workflow-view-hero::after {
    position: absolute;
    right: -4rem;
    bottom: -6rem;
    width: 16rem;
    height: 16rem;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.workflow-create-hero>*,
.workflow-view-hero>* {
    position: relative;
    z-index: 1;
}

.workflow-create-hero h1,
.workflow-view-hero h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.1;
    letter-spacing: -.035em;
}

.workflow-create-hero p,
.workflow-view-hero p {
    max-width: 720px;
    margin: .8rem 0 0;
    color: var(--muted);
    font-size: .98rem;
}

.workflow-create-hero-proof {
    display: flex;
    flex: 0 0 min(100%, 300px);
    align-items: center;
    gap: .8rem;
    align-self: center;
    padding: 1rem;
    border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--panel) 90%, transparent);
    box-shadow: var(--shadow);
}

.workflow-create-hero-proof>span {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: .75rem;
    font-weight: 900;
}

.workflow-create-hero-proof div {
    display: grid;
    gap: .1rem;
}

.workflow-create-hero-proof strong {
    font-size: .86rem;
}

.workflow-create-hero-proof small {
    color: var(--muted);
    font-size: .72rem;
}

.workflow-create-mode {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
    margin: 0 0 1.25rem;
    padding: 0;
    border: 0;
}

.workflow-create-mode legend {
    width: 100%;
    margin-bottom: .65rem;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.workflow-create-mode-option {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .8rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
    cursor: pointer;
    box-shadow: var(--shadow);
}

.workflow-create-mode-option:has(input:checked) {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary-subtle) 45%, var(--panel));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.workflow-create-mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.workflow-create-mode-icon {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border-radius: 10px;
    background: var(--bg-subtle);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 900;
}

.workflow-create-mode-option>span:nth-of-type(2) {
    display: grid;
    gap: .12rem;
}

.workflow-create-mode-option strong {
    font-size: .86rem;
}

.workflow-create-mode-option small {
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.4;
}

.workflow-create-mode-check {
    display: grid;
    width: 1.45rem;
    height: 1.45rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: transparent;
    font-size: .68rem;
    font-weight: 900;
}

.workflow-create-mode-option:has(input:checked) .workflow-create-mode-check {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--panel);
}

.workflow-create-panel[hidden] {
    display: none !important;
}

.workflow-create-layout,
.workflow-import-layout,
.workflow-view-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(275px, 340px);
    gap: 1.25rem;
    align-items: start;
}

.workflow-create-main,
.workflow-view-main {
    display: grid;
    min-width: 0;
    gap: 1.25rem;
}

.workflow-create-sidebar,
.workflow-view-sidebar {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 1rem;
}

.workflow-create-section,
.workflow-import-card,
.workflow-import-explainer,
.workflow-view-section,
.workflow-overview-card,
.workflow-sidebar-procurement {
    margin: 0;
    padding: clamp(1.2rem, 3vw, 1.65rem);
    overflow: visible;
}

.workflow-section-heading {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    margin-bottom: 1.35rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.workflow-section-heading>span {
    display: grid;
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 9px;
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 900;
}

.workflow-section-heading h2 {
    margin: 0;
    font-size: 1.04rem;
}

.workflow-section-heading p {
    margin: .2rem 0 0;
    color: var(--muted);
    font-size: .78rem;
}

.workflow-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
}

.workflow-field {
    min-width: 0;
}

.workflow-field+.workflow-field {
    margin-top: 1.15rem;
}

.workflow-field-grid .workflow-field {
    margin-top: 0;
}

.workflow-field-full {
    grid-column: 1 / -1;
}

.workflow-field label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-bottom: .35rem;
    font-size: .82rem;
    font-weight: 750;
}

.workflow-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.workflow-inline-links {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
    font-size: .7rem;
}

.workflow-field input,
.workflow-field textarea,
.workflow-field select,
.workflow-definition-form input,
.workflow-definition-form textarea,
.workflow-definition-form select {
    margin: 0;
}

.workflow-field input,
.workflow-field textarea,
.workflow-definition-form input,
.workflow-definition-form textarea {
    min-height: 46px;
    padding: .72rem .85rem;
    border-radius: 10px;
    background: var(--panel);
}

.workflow-field textarea,
.workflow-definition-form textarea {
    line-height: 1.5;
}

.workflow-field select,
.workflow-definition-form select {
    min-height: 46px;
    padding-top: .7rem;
    padding-bottom: .7rem;
    border-color: var(--border);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: none;
    font-size: .88rem;
}

.workflow-field input:focus,
.workflow-field textarea:focus,
.workflow-field select:focus,
.workflow-definition-form input:focus,
.workflow-definition-form textarea:focus,
.workflow-definition-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.workflow-field>small,
.workflow-definition-form .workflow-field>small {
    display: block;
    margin-top: .4rem;
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.45;
}

.workflow-next-panel {
    margin: 0;
    padding: 1.35rem;
}

.workflow-next-panel h2,
.workflow-import-explainer h2,
.workflow-overview-card h2,
.workflow-sidebar-procurement h2 {
    margin: 0;
    font-size: 1.05rem;
}

.workflow-next-panel>p,
.workflow-import-explainer>p {
    margin: .5rem 0 1.25rem;
    color: var(--muted);
    font-size: .78rem;
}

.workflow-next-panel ol,
.workflow-import-explainer ul {
    display: grid;
    gap: 1rem;
}

.workflow-next-panel li,
.workflow-import-explainer li {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
}

.workflow-next-panel li>span,
.workflow-import-explainer li>span {
    display: grid;
    flex: 0 0 1.7rem;
    width: 1.7rem;
    height: 1.7rem;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-subtle);
    color: var(--primary);
    font-size: .64rem;
    font-weight: 900;
}

.workflow-next-panel li div,
.workflow-import-explainer li div {
    display: grid;
    gap: .1rem;
}

.workflow-next-panel li strong,
.workflow-import-explainer li strong {
    font-size: .77rem;
}

.workflow-next-panel li small,
.workflow-import-explainer li small {
    color: var(--muted);
    font-size: .69rem;
    line-height: 1.4;
}

.workflow-create-actions {
    position: sticky;
    z-index: 20;
    bottom: .75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 1rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
}

.workflow-create-actions>div:first-child {
    display: grid;
    gap: .1rem;
}

.workflow-create-actions strong {
    font-size: .8rem;
}

.workflow-create-actions span {
    color: var(--muted);
    font-size: .7rem;
}

.workflow-create-actions>div:last-child,
.workflow-import-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.workflow-create-actions .button,
.workflow-create-actions button,
.workflow-import-actions .button,
.workflow-import-actions button {
    margin: 0;
    min-height: 42px;
}

.workflow-import-card {
    min-height: 100%;
}

.workflow-import-form {
    display: grid;
    gap: 1.1rem;
}

.workflow-import-picker {
    min-height: 120px;
    border: 1px dashed var(--border-muted);
    border-radius: 14px;
    background: var(--bg-subtle);
}

.workflow-import-notice {
    padding: .9rem 1rem;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    border-radius: 11px;
    background: color-mix(in srgb, var(--primary-subtle) 48%, var(--panel));
}

.workflow-import-notice strong {
    font-size: .78rem;
}

.workflow-import-notice p {
    margin: .25rem 0 0;
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.5;
}

.workflow-import-actions {
    justify-content: flex-end;
    padding-top: .9rem;
    border-top: 1px solid var(--border);
}

.workflow-ai-empty-state {
    display: grid;
    justify-items: start;
    gap: .65rem;
    padding: 1.25rem;
    border: 1px dashed var(--border-muted);
    border-radius: 14px;
    background: var(--bg-subtle);
}

.workflow-ai-empty-icon {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 900;
}

.workflow-ai-empty-state h3 {
    margin: 0;
}

.workflow-ai-empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: .78rem;
}

/* View workspace */

.workflow-view-identity {
    min-width: 0;
}

.workflow-view-kicker,
.workflow-view-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}

.workflow-view-kicker {
    margin-bottom: .65rem;
}

.workflow-view-kicker>span,
.workflow-view-meta>span {
    display: inline-flex;
    padding: .2rem .5rem;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--panel) 86%, transparent);
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
}

.workflow-status.reviewed {
    background: var(--success-subtle);
    color: var(--success);
}

.workflow-status.draft {
    background: var(--warning-subtle);
    color: var(--text);
}

.workflow-view-meta {
    margin-top: .8rem;
}

.workflow-view-hero-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-end;
    gap: .55rem;
    max-width: 360px;
}

.workflow-view-hero-actions .button {
    margin: 0;
}

.workflow-view-actionbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: .85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.workflow-review-note {
    color: var(--muted);
    font-size: .74rem;
}

.workflow-view-action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
}

.workflow-view-action-buttons form,
.workflow-view-action-buttons button {
    margin: 0;
}

.workflow-view-section>summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
}

.workflow-view-section>summary::-webkit-details-marker {
    display: none;
}

.workflow-view-section>summary>span:first-child {
    display: grid;
    gap: .12rem;
}

.workflow-view-section>summary strong {
    font-size: .92rem;
}

.workflow-view-section>summary small {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 400;
}

.workflow-summary-count,
.workflow-summary-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--muted);
    font-size: .67rem;
    font-weight: 800;
}

.workflow-view-section[open]>summary {
    margin-bottom: 1.15rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid var(--border);
}

.workflow-definition-form {
    display: grid;
    gap: 1rem;
}

.workflow-definition-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.workflow-protocols-section .form-stack {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-subtle);
}

.workflow-protocol-list {
    gap: .7rem;
}

.workflow-protocol-item {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .85rem;
    padding: .85rem !important;
    border-radius: 11px !important;
}

.workflow-left {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.workflow-left button {
    min-width: 2rem;
    margin: 0;
    padding: .3rem .5rem;
}

.workflow-center {
    display: grid;
    min-width: 0;
    gap: .12rem;
    color: inherit;
}

.workflow-center strong {
    font-size: .83rem;
}

.workflow-center .muted {
    font-size: .7rem;
}

.workflow-right button {
    margin: 0;
}

.workflow-derived-section .boxed-list>li {
    border-radius: 10px;
    padding: .8rem;
}

.workflow-overview-card dl {
    display: grid;
    gap: 0;
    margin: 1rem 0;
    border: 1px solid var(--border);
    border-radius: 11px;
    overflow: hidden;
}

.workflow-overview-card dl>div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem .75rem;
    border-bottom: 1px solid var(--border);
}

.workflow-overview-card dl>div:last-child {
    border-bottom: 0;
}

.workflow-overview-card dt {
    color: var(--muted);
    font-size: .72rem;
}

.workflow-overview-card dd {
    margin: 0;
    font-size: .76rem;
    font-weight: 800;
}

.workflow-readiness-status {
    display: grid;
    gap: .12rem;
    padding: .8rem;
    border-radius: 10px;
}

.workflow-readiness-status.ready {
    background: var(--success-subtle);
}

.workflow-readiness-status.draft {
    background: var(--warning-subtle);
}

.workflow-readiness-status strong {
    font-size: .76rem;
}

.workflow-readiness-status span {
    color: var(--muted);
    font-size: .69rem;
}

.workflow-danger-zone {
    margin-top: 1.25rem;
    border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}

[data-theme="dark"] .workflow-create-hero,
[data-theme="dark"] .workflow-view-hero {
    background:
        radial-gradient(circle at 94% 10%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 38%),
        linear-gradient(135deg, var(--panel), color-mix(in srgb, var(--primary-subtle) 42%, var(--panel)));
}

[data-theme="dark"] .workflow-create-actions,
[data-theme="dark"] .workflow-view-kicker>span,
[data-theme="dark"] .workflow-view-meta>span {
    background: color-mix(in srgb, var(--panel) 94%, transparent);
}

@media (max-width: 1000px) {

    .workflow-create-layout,
    .workflow-import-layout,
    .workflow-view-layout {
        grid-template-columns: 1fr;
    }

    .workflow-create-sidebar,
    .workflow-view-sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {

    .workflow-create-hero,
    .workflow-view-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        border-radius: 14px;
    }

    .workflow-create-hero-proof {
        flex-basis: auto;
        width: 100%;
    }

    .workflow-create-mode,
    .workflow-field-grid,
    .workflow-create-sidebar,
    .workflow-view-sidebar {
        grid-template-columns: 1fr;
    }

    .workflow-view-hero-actions {
        justify-content: flex-start;
        max-width: none;
    }

    .workflow-view-actionbar {
        align-items: stretch;
        flex-direction: column;
    }

    .workflow-view-action-buttons {
        justify-content: flex-start;
    }

    .workflow-create-actions {
        position: static;
        align-items: stretch;
        flex-direction: column;
    }

    .workflow-create-actions>div:last-child,
    .workflow-import-actions {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .workflow-protocol-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .workflow-right {
        grid-column: 2;
    }
}

@media (max-width: 500px) {

    .workflow-create-section,
    .workflow-import-card,
    .workflow-import-explainer,
    .workflow-view-section,
    .workflow-overview-card,
    .workflow-sidebar-procurement {
        padding: 1rem;
    }

    .workflow-create-mode-option {
        padding: .85rem;
    }

    .workflow-label-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .workflow-inline-links {
        justify-content: flex-start;
    }

    .workflow-create-actions>div:last-child,
    .workflow-import-actions {
        grid-template-columns: 1fr;
    }

    .workflow-create-actions .button,
    .workflow-create-actions button,
    .workflow-import-actions .button,
    .workflow-import-actions button {
        width: 100%;
        text-align: center;
    }

    .workflow-view-hero-actions,
    .workflow-view-action-buttons {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .workflow-view-hero-actions .button,
    .workflow-view-action-buttons button {
        width: 100%;
        text-align: center;
    }

    .workflow-protocol-item {
        grid-template-columns: 1fr !important;
    }

    .workflow-left {
        flex-direction: row;
    }

    .workflow-right {
        grid-column: auto;
    }

    .workflow-right button {
        width: 100%;
    }
}