.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(--panel-bg);
}

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


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

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

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

.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(--panel-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;
    }
}#aiResponse {
    margin: 0 16px 16px 16px;
    padding: 12px;

    background: var(--bg-subtle);
    /* ✅ add */
    border: 1px solid var(--bg);
    /* ✅ fixed var */
    border-radius: var(--radius);

    font-family: monospace;
    font-size: 13px;

    white-space: pre-wrap;
    overflow-y: auto;
    max-height: 264px;
}

.ai-panel {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--bg);
    border-radius: var(--radius);
}

.ai-empty-state {
    padding: 16px;
    border: 1px solid var(--bg);
    border-radius: var(--radius);
    text-align: center;
    background: var(--panel);
}

.ai-form .form-group {
    margin-bottom: 16px;
}

.ai-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.preview-box {
    padding: 0.5rem;
    margin-top: 0.5rem;
    border-radius: 6px;
    background: var(--bg-subtle);
}

.alert-panel {
    max-width: 900px;
    margin: 0 auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.relative-time {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.danger-text {
    color: var(--danger);
    font-weight: 600;
}

.options {
    display: grid;
    grid-template-columns: 1fr 116px 140px;
    gap: 12px;
    margin: 0 16px 16px 16px;
}

.options input {
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--bg);
    font-size: 14px;
    outline: none;
    transition: border 0.2s ease;
    background: var(--bg);
    color: var(--text);
}

.options input:focus {
    border-color: var(--primary);
}

.ai-modal::backdrop {
    background: color-mix(in srgb, var(--bg) 70%, black);
}

.ai-modal {
    border: solid 1px;
    border-radius: 12px;
    padding: 1em;
    max-width: 800px;
    width: 90%;
    background: var(--panel);
    color: var(--text);
}

.modal-content {
    padding: 16px;
    border: 4px solid var(--border-muted)
}

.ai-frame {
    width: 100%;
    height: 264px;
    border: 1px solid var(--bg);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    color: var(--text);
}

.ai-response-content {
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
    padding: 10px;
    color: var(--text);
}.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%;
}/* 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;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-section {
    min-height: 0;
    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(--panel-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(--panel-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(--panel-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(--panel-bg);
    color: var(--text);
}

.CodeMirror-gutters {
    background: var(--panel-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(--panel-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(--panel-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(--panel-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(--panel-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(--accent-soft);
    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-subtle, 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-soft);
}

.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-soft);
}

.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;
}.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-color, var(--border-color));
    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;
}.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;
    --hover-bg: #eef3f3;
    --bg-subtle: #f1f5f9;
    --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: #6b7c7c;

    /* === BRAND CORE === */
    --sidebar-bg: #c8d4d4;
    --sidebar-hover: #b7c6c6;

    /* Soft sterile accent (teal-leaning) */
    --primary: #5f8f8f;
    --primary-hover: #4f7a7a;
    --primary-subtle: #e6efef;

    /* Secondary neutral (lab UI feel) */
    --neutral-btn: #eef3f3;
    --neutral-btn-hover: #dde5e5;

    /* Status colors (slightly desaturated for “clinical” tone) */
    --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);
}

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

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {

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

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


    --color-completed: #22c55e;
    /* green */
    --color-failed: #ef4444;
    /* red */
    --color-contaminated: #f59e0b;
    /* amber */
    --color-archived: #6b7280;
    /* gray */
    --color-pending: #3b82f6;
    /* blue */
    --color-in-progress: #6366f1;
    /* indigo (fallback/other states) */

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

    /* Sidebar (derived from your brand color) */
    --sidebar-bg: #1c2626;
    --sidebar-hover: #263333;

    /* Primary (cool sterile teal, slightly brighter for contrast) */
    --primary: #7fa9a9;
    --primary-hover: #6e9696;
    --primary-subtle: #1f2a2a;

    /* Neutral surfaces */
    --neutral-btn: #1c2424;
    --neutral-btn-hover: #263131;

    /* Status colors (muted, not glowing) */
    --success: #4fa37e;
    --warning: #b17c00;
    --danger: #d16b6b;

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

    /* Optional accent */
    --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);
}

/* Text-like inputs */
[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);
}

/* Calendar / time picker icons */
[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);
}

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

/* File picker */
[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 {
    border-radius: 22px;
}

.toggle-track {
    position: relative;
    /* REQUIRED */
    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;
    /* align with thumb */
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Track */
.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;
}

/* Thumb */
.toggle-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    transition: transform 0.25s ease, background 0.25s ease;
}

/* ACTIVE (dark mode) */
[data-theme="dark"] .toggle-track {
    background: #1f2a2a;
}

[data-theme="dark"] .toggle-thumb {
    transform: translateX(16px);
    background: #c8d4d4;
    /* ties back to your brand color */
}

.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);
}

/* ===== Layout ===== */

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;
    /* important */
}

#main-content {
    flex: 1 0 auto;
    min-width: 0;
    max-width: 100%;
}

.content {
    flex: 1;
}

.site-footer {
    margin-top: auto;
    padding: 0.75rem 1rem;

    background: rgba(255, 255, 255, 0.035);
    border-top: 1px solid rgba(255, 255, 255, 0.06);

    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.58);

    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;
}

/* Neutral hover */
button:hover,
a.button:hover {
    background: var(--neutral-btn-hover);
    border-color: #d1d5db;
}

/* Primary */
button .primary,
button.primary,
a.button.primary {
    background: var(--primary);
    color: white;
    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;
    /* soft green border */
}

button.success:hover,
a.button.success:hover {
    background: var(--success-subtle-hover);
    /* slightly stronger but still subtle */
    border-color: #86efac;
}

/* FAil */
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;
}

/* Danger */
button.danger,
a.button.danger {
    background: var(--danger);
    color: white;
    border: none;
}

button.danger:hover,
a.button.danger:hover {
    background: #b91c1c;
}


button .contaminated

/* 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-color);
        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 FIX */
.panel {
    overflow: hidden;
}

/* MOBILE POLISH */
@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;
}

/* ===== Notes ===== */

.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%;
}

/* Prevent squishing */
@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;
    }
}

/* ===== Panels ===== */


.panel h1,
.panel h2,
.panel h3 {
    margin-top: 0;
}


button.secondary {
    background: var(--primary-subtle);
    color: var(--primary);
}

/* ===== Forms ===== */

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;
}

/* Hover */
select:hover {
    border-color: #9ca3af;
}

/* Focus */
select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: var(--shadow);
}

/* Disabled */
select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Custom arrow */
.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);
    color: var(--text);
    border-radius: 8px;
    margin: 4px;
}

input[type="checkbox"] {
    width: inherit;
}

textarea {
    resize: vertical;
}

/* ===== Files ===== */

.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;
}

/* ===== State badges ===== */

.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 ===== */

.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;
}

/* Group related controls */
.inline-form .field-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Labels inside inline forms */
.inline-form label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
    margin-right: 0.25rem;
    white-space: nowrap;
}

/* Inputs / selects */
.inline-form input,
.inline-form select {
    /* width: auto; */
    min-width: 7.5rem;
    padding: 0.35rem 0.5rem;
    margin: 0;

    font-size: 0.9rem;
}

/* Emphasize dangerous actions */
.inline-form .button.danger {
    margin-left: auto;
}

/* Visual separator for logic */
.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;
}

.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;
    /* removes inline spacing issues */
}

.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 colors */
.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;
}

/* Failed → red */
.progress-failed {
    background-color: #ef4444;
}

/* Contaminated → purple (distinct + “danger-ish”) */
.progress-contaminated {
    background-color: #a855f7;
}

/* Archived → muted gray (inactive state) */
.progress-archived {
    background-color: #9ca3af;
    opacity: 0.7;
    filter: grayscale(20%);
}

/* Pending → amber (in-progress / waiting) */
.progress-pending {
    background-color: #f59e0b;
}

/* Checklist progress (already used elsewhere) */
.progress-checklist {
    background-color: #3b82f6;
    /* blue */
}

/* Promoted progress */
.progress-promoted {
    background-color: #10b981;
    /* teal/green */
}

/* Protocol progress */
.progress-protocol {
    background-color: #6366f1;
    /* indigo */
}

.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);
}

/* GRID */
.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* CLICKABLE TAG */
.tag-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.tag-option input {
    display: none;
}

/* DEFAULT STATE */
.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;
}

/* HOVER */
.tag-option:hover .tag {
    background: var(--hover-bg);
    border-color: var(--primary);
}

/* SELECTED */
.tag-option input:checked+.tag {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* MUTED (excluded tags) */
.tag.muted {
    background: var(--danger-subtle);
    color: var(--danger);
    border-color: var(--danger);
}

/* SELECTED MUTED */
.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(--success);
}

.tag.bsl {
    background: var(--warning-subtle);
    color: var(--warning);
}

.styled-table {
    border-collapse: collapse;
    width: 100%;
    font-family: Arial, sans-serif;
}

.tag.pathogen {
    background: var(--danger-subtle);
    color: var(--danger);
}

.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: 12px 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 forms ───────── */

.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);
}

/* ───────── Layout helpers ───────── */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.copy-input {
    width: 100%;
    font-family: monospace;
    font-size: 0.8rem;
}

/* ───────── Buttons spacing ───────── */

.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;
}

/* vertical line */
.timeline::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--bg);
}

/* event */
.timeline-event {
    position: relative;
    padding-left: 50px;
    margin-bottom: 1.5rem;
}

/* timeline dot */
.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);
}

/* header row */
.timeline-event summary {
    cursor: pointer;
    font-weight: 600;
}

/* entities */
.event-entities {
    margin-top: 0.5rem;
    margin-left: 0;
    padding-left: 1rem;
}

/* note area */
.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);
    bottom: 110%;
    left: 0;

    background: #222;
    color: #fff;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    white-space: pre-wrap;

    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;

    width: max-content;
    max-width: 250px;
    z-index: 1000;
}

.has-tooltip:hover::after {
    opacity: 1;
    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(--panel-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(--bg-hover);
}

.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(--panel-bg);
    border: 1px solid var(--border-color);
    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-color);
}

.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;
}/* Completed batches get a calmer bar */

.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);
    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;
    }
}.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;
}.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-color);
    border-radius: 1rem;
    background: var(--panel-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-color);

    background: var(--panel-bg);
    color: var(--text-color);

    line-height: 1;
    white-space: nowrap;
}

.timeline-chip-primary {
    background: color-mix(in srgb, var(--accent) 12%, var(--panel-bg));
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border-color));
    font-weight: 600;
}

.timeline-chip-secondary {
    background: color-mix(in srgb, var(--info) 10%, var(--panel-bg));
}

.timeline-chip-date {
    background: color-mix(in srgb, var(--panel-bg) 92%, black);
    font-size: 0.92rem;
}

.timeline-chip-muted {
    background: color-mix(in srgb, var(--panel-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, #ddd);
    border-radius: 0.75rem;
    background: var(--panel-bg, #fff);
}

.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%;
}.file-explorer {
    margin-top: 1rem;
}

.file-list {
    list-style: none;
    padding-left: 0;
}

.file-row {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 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;
}/* ───────────────────── 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: rgba(0, 0, 0, 0.03);
    padding: 3rem 1.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-color);
    background: var(--panel-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;
}#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%;
}.markdown-editor-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.markdown-editor {
    width: 100%;
    min-height: 34rem;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    line-height: 1.5;
    tab-size: 2;
}

.markdown-body {
    line-height: 1.65;
}

.markdown-body img,
.note-image img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.markdown-body pre {
    overflow: auto;
    padding: 1rem;
    border-radius: 0.5rem;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    overflow: auto;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--border-color, #ddd);
    padding: 0.5rem;
}

.file-list,
.note-attachments {
    display: grid;
    gap: 0.75rem;
}

.file-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 0.5rem;
}

.note-image {
    margin: 0;
}

.note-image figcaption {
    margin-top: 0.35rem;
    color: var(--muted-color, #666);
    font-size: 0.9rem;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.875rem;
    text-decoration: none;
    background: var(--panel-bg, #fff);
}

.tag-remove-form {
    display: inline;
}

.tag-pill.removable {
    cursor: pointer;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .markdown-editor-shell {
        grid-template-columns: 1fr;
    }
}.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;
}.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(--panel-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;
    }
}.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(--panel-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(--panel-bg);
        border: 1px solid var(--border-color);
        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%;
}.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 {
    @page {
        size: letter;
        margin: 0.35in;
    }

    body {
        background: #fff !important;
    }

    .nav-right {
        display: none !important;
    }

    .print-hidden,
    nav,
    header,
    footer,
    .sidebar,
    .flash,
    .global-loader {
        display: none !important;
    }

    main,
    .content,
    .container {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

    .qr-print-sheet {
        display: grid;
        grid-template-columns: repeat(3, 2.45in);
        gap: 0.12in;
        padding: 0;
        background: #fff !important;
    }

    .qr-print-cutline {
        border: 1px dotted #555;
        box-shadow: var(--shadow);
    }

    .qr-print-inner {
        min-height: 1.05in;
        grid-template-columns: 0.82in 1fr;
    }

    .qr-print-image {
        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);
}.sample-timestamps {
    display: inline-flex;
}

@media (max-width: 640px) {
    .sample-timestamps {
        display: grid;
    }
}.calendar {
    display: grid;
    gap: 6px;

    padding: 0.75rem;
    border-radius: 12px;

    background: var(--panel);
}

.calendar-row {
    display: grid;
    grid-template-columns: 216px repeat(7, 1fr);

    border-radius: 10px;
    overflow: hidden;

    background: var(--panel-bg);
    border: 1px solid var(--bg);

    margin-bottom: 8px;

    transition: box-shadow 0.15s ease;
}

.calendar-row:hover {
    background: var(--hover-bg);
}

.calendar-header {
    display: grid;
    grid-template-columns: 216px repeat(7, 1fr);

    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: .05em;

    margin-bottom: 6px;
}

.calendar-day-header {
    text-align: center;
    padding: 0.6rem 0;

    border: 1px solid var(--bg);
    border-bottom: none;

    font-weight: 600;
}

.calendar-label {
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;

    border-right: 1px solid var(--bg);

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.calendar-label strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-cell {
    position: relative;
    border-left: 1px solid var(--bg);
    height: 96px;
    overflow-y: auto;
    overflow-x: hidden;
    border-left: 1px solid var(--bg);
    background:
        repeating-linear-gradient(to bottom,
            transparent,
            transparent 15px,
            rgba(0, 0, 0, 0.04) 16px);
}

.calendar-cell::-webkit-scrollbar {
    width: 6px;
}

.calendar-cell::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.calendar-event:hover {
    transform: scale(1.03);
    z-index: 2;
    box-shadow: var(--shadow);
}

.calendar-day-header.today {
    background: var(--accent);
}

.calendar-event {
    position: relative;
    left: 6px;
    right: 6px;
    margin-top: 2px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    background: linear-gradient(180deg,
            var(--accent),
            color-mix(in srgb, var(--accent) 80%, black));

    font-size: 0.75rem;
    border-radius: 6px;
    padding: 4px 6px;

    font-weight: 500;

    box-shadow: var(--shadow);

    display: flex;
    align-items: flex-start;
}

.calendar-row.done .calendar-event {
    background: linear-gradient(180deg,
            #b2fdce,
            #15803d);
    opacity: 0.8;
}

.calendar-row.critical .calendar-event {
    background: linear-gradient(180deg,
            #ef4444,
            #b91c1c);
}

.calendar-row.hold .calendar-event {
    background: linear-gradient(180deg,
            #f59e0b,
            #b45309);
}


.gantt-protocol {
    margin-bottom: 1.5rem;
}

.gantt-protocol-label {
    font-weight: 600;
    margin-bottom: .5rem;
}

.schedule-protocol {
    margin-bottom: 1.5rem;
}


.gantt {
    position: relative;
    overflow-x: auto;
}

.gantt-link {
    color: var(--text);
}

.gantt-link:hover {
    color: inherit;
    text-decoration: none;
    background: inherit;
}

.gantt-header {
    display: grid;
    grid-template-columns: 264px 1fr;
    align-items: center;
    margin-bottom: 10px;
}

.gantt-header-track {
    position: relative;
    height: 30px;
}

.gantt-row {
    display: grid;
    grid-template-columns: 264px 1fr;
    align-items: center;
    margin: 6px 0;
}


.gantt-tick {
    position: absolute;
    top: 0;
    font-size: 0.75rem;
    transform: translateX(-50%);
    color: var(--muted);
}


.gantt-label {
    width: 264px;
    font-size: 0.85rem;
    padding-right: 8px;
}

.gantt-track {
    position: relative;
    flex: 1;
    height: 28px;
    background: var(--panel-subtle);
    border-radius: 4px;
    min-width: 100%;
    background:
        repeating-linear-gradient(to right,
            transparent,
            transparent 116px,
            rgba(0, 0, 0, 0.05) 121px);
}

.gantt-bar {
    position: absolute;
    height: 100%;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    background: var(--accent);
    color: var(--text);
    overflow: hidden;
    white-space: nowrap;
}

.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);
}



.schedule-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.schedule-header h1 {
    flex: 1;
    margin: 0;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.schedule-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--panel-bg);
    border-left: 4px solid transparent;
}

.schedule-row.done {
    opacity: 0.65;
}

.schedule-row.critical {
    border-left-color: #d33;
}

.schedule-row.hold {
    border-left-color: #e6b800;
}

.schedule-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.schedule-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}.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);
}.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(--panel-bg);
}

.variant-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

@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(--panel-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(--panel-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(--panel-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(--bg);
    border-radius: var(--radius-lg);
    background: var(--surface);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.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: 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;
}


@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;
    }

    .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;
    }
}