:root {
    --acid: #d8ff45;
    --acid-strong: #b9eb22;
    --acid-soft: rgba(216, 255, 69, 0.16);
    --cyan: #62d6d0;
    --ink: #111615;
    --ink-2: #262d2b;
    --muted: #6e7874;
    --muted-2: #98a19e;
    --canvas: #eef1ed;
    --surface: #fbfcf8;
    --surface-2: #f3f5f1;
    --line: #d7ddd7;
    --line-dark: #bcc5bd;
    --danger: #e7684f;
    --warning: #f2b33d;
    --ok: #78b83d;
    --sidebar: #111615;
    --sidebar-ink: #edf2eb;
    --shadow: 0 18px 46px rgba(23, 34, 29, 0.08);
    --sidebar-width: 248px;
    --topbar-height: 72px;
}

html[lang="en"] body {
    word-break: normal;
}

html[lang="en"] .nav-item > span:not(.nav-code),
html[lang="en"] .button,
html[lang="en"] .data-table,
html[lang="en"] input,
html[lang="en"] textarea,
html[lang="en"] select {
    letter-spacing: .01em;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background:
        linear-gradient(rgba(17, 22, 21, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(17, 22, 21, 0.028) 1px, transparent 1px),
        var(--canvas);
    background-size: 40px 40px;
    font-family: var(--font-interface);
    font-size: 14px;
    transition: color .25s ease, background-color .25s ease;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 5000;
    padding: 10px 16px;
    color: var(--sidebar);
    background: var(--acid);
    font-weight: 800;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    min-height: 100vh;
    overflow: hidden auto;
    color: var(--sidebar-ink);
    background:
        linear-gradient(135deg, transparent 0 83%, rgba(216, 255, 69, .05) 83% 83.5%, transparent 83.5%),
        var(--sidebar);
    border-right: 1px solid #2c3532;
}

.sidebar::after {
    content: "RL\A RESEARCH\A FACILITY";
    position: absolute;
    right: -12px;
    bottom: 196px;
    color: rgba(255, 255, 255, .025);
    white-space: pre;
    font: 900 42px/.82 var(--font-interface);
    text-align: right;
    transform: rotate(-90deg) translateX(100%);
    transform-origin: right bottom;
    pointer-events: none;
}

.brand-lockup {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 86px;
    padding: 18px 22px;
    border-bottom: 1px solid #2d3633;
}

.brand-lockup::after {
    content: "07";
    position: absolute;
    top: 8px;
    right: 10px;
    color: #4a5550;
    font: 700 9px/1 var(--font-interface);
}

.brand-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    overflow: hidden;
    color: var(--sidebar);
    background: var(--acid);
    clip-path: polygon(0 0, 76% 0, 100% 24%, 100% 100%, 24% 100%, 0 76%);
}

.brand-mark::before,
.brand-mark::after {
    content: "";
    position: absolute;
    background: var(--sidebar);
    opacity: .18;
}

.brand-mark::before {
    width: 80px;
    height: 1px;
    transform: rotate(-45deg);
}

.brand-mark::after {
    width: 1px;
    height: 80px;
    transform: rotate(-45deg);
}

.brand-mark span {
    position: relative;
    z-index: 1;
    font: 900 25px/1 var(--font-interface);
}

.brand-lockup strong {
    display: block;
    letter-spacing: .08em;
    font-size: 16px;
}

.brand-lockup small {
    display: block;
    margin-top: 4px;
    color: #818c87;
    font-size: 10px;
    letter-spacing: .08em;
}

.facility-chip {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    margin: 18px 22px 8px;
    padding: 7px 10px;
    border: 1px solid #35403c;
    color: #9ca8a3;
    font: 700 9px/1.1 var(--font-interface);
    letter-spacing: .08em;
}

.facility-chip i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--acid);
    box-shadow: 0 0 0 4px rgba(216, 255, 69, .08);
}

.primary-nav {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 3px;
    padding: 14px 13px 20px;
}

.nav-label,
.micro-label {
    margin: 0;
    color: var(--muted);
    font: 800 9px/1.2 var(--font-interface);
    letter-spacing: .14em;
    text-transform: uppercase;
}

.nav-label {
    padding: 0 12px 10px;
    color: #63706b;
}

.nav-item {
    position: relative;
    display: grid;
    grid-template-columns: 26px 1fr;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 8px 12px;
    border: 0;
    color: #a7b0ac;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.nav-item::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -13px;
    width: 3px;
    background: var(--acid);
    opacity: 0;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, .045);
    transform: translateX(2px);
}

.nav-item.active {
    color: var(--sidebar);
    background: var(--acid);
    font-weight: 800;
}

.nav-item.active::after {
    opacity: 1;
}

.nav-item b {
    grid-column: 2;
    margin-top: -8px;
    font: 600 8px/1 var(--font-interface);
    letter-spacing: .12em;
    opacity: .48;
}

.nav-code {
    grid-row: 1 / span 2;
    color: #5f6a66;
    font: 700 10px/1 var(--font-interface);
}

.nav-item.active .nav-code {
    color: #596a10;
}

.sidebar-foot {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    margin-top: auto;
    padding: 18px 18px 22px;
    border-top: 1px solid #2b3431;
}

.system-status {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, .035);
}

.pulse-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--acid-strong);
    box-shadow: 0 0 0 4px rgba(216, 255, 69, .11);
    animation: statusPulse 2s ease infinite;
}

@keyframes statusPulse {
    50% { box-shadow: 0 0 0 7px rgba(216, 255, 69, 0); }
}

.system-status strong,
.system-status small {
    display: block;
}

.system-status strong {
    font-size: 11px;
}

.system-status small {
    margin-top: 3px;
    color: #74807b;
    font-size: 8px;
}

.system-status b {
    color: var(--acid);
    font: 700 9px/1 var(--font-interface);
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    color: #87918d;
    text-decoration: none;
    font-size: 11px;
    transition: color .18s ease;
}

.back-link:hover {
    color: var(--acid);
}

.app-stage {
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    margin-left: var(--sidebar-width);
}

.topbar {
    position: fixed;
    inset: 0 0 auto var(--sidebar-width);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 24px;
    height: var(--topbar-height);
    padding: 0 28px;
    background: rgba(251, 252, 248, .9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    padding: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.menu-toggle i {
    display: block;
    width: 19px;
    height: 2px;
    margin: 4px auto;
    background: currentColor;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 205px;
    font-size: 11px;
}

.breadcrumb span,
.breadcrumb i {
    color: var(--muted-2);
    font: 700 9px/1 var(--font-interface);
    letter-spacing: .1em;
}

.breadcrumb i {
    font-style: normal;
}

.global-search {
    position: relative;
    display: flex;
    align-items: center;
    width: min(440px, 38vw);
    height: 38px;
    margin-left: auto;
    border-bottom: 1px solid var(--line-dark);
}

.global-search > span,
.inline-search > span,
.dialog-search > span {
    color: var(--muted);
    font: 700 19px/1 var(--font-interface);
    transform: rotate(-15deg);
}

.global-search input,
.inline-search input,
.dialog-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
}

.global-search input {
    height: 100%;
    padding: 0 62px 0 12px;
    font-size: 12px;
}

.global-search kbd {
    position: absolute;
    right: 0;
    padding: 4px 6px;
    color: var(--muted-2);
    background: var(--surface-2);
    border: 1px solid var(--line);
    font: 700 8px/1 var(--font-interface);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.icon-button,
.square-button,
.close-button,
.dialog-close,
.date-switch button {
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--ink);
    background: var(--surface);
    cursor: pointer;
}

.icon-button {
    width: 34px;
    height: 34px;
    font-size: 15px;
}

.notice-button {
    position: relative;
    color: var(--danger);
    font-weight: 900;
}

.notice-button::after {
    content: "3";
    position: absolute;
    top: -5px;
    right: -5px;
    display: grid;
    place-items: center;
    width: 15px;
    height: 15px;
    color: #fff;
    background: var(--danger);
    border: 2px solid var(--surface);
    border-radius: 50%;
    font: 800 8px/1 var(--font-interface);
}

.operator {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: 6px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--sidebar);
    background: var(--acid);
    border: 1px solid #adcf2e;
    font: 900 10px/1 var(--font-interface);
}

.operator strong,
.operator small {
    display: block;
}

.operator strong {
    font-size: 11px;
}

.operator small {
    margin-top: 3px;
    color: var(--muted);
    font: 700 7px/1 var(--font-interface);
    letter-spacing: .08em;
}

main {
    width: min(1560px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(var(--topbar-height) + 32px) clamp(24px, 3.1vw, 54px) 64px;
}

.view {
    display: none;
    animation: viewEnter .36s ease both;
}

.view.active {
    display: block;
}

@keyframes viewEnter {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-hero,
.page-heading {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    min-height: 176px;
    padding: 28px 152px 30px 34px;
    overflow: hidden;
    color: #eff5ed;
    background:
        linear-gradient(115deg, rgba(216, 255, 69, .08) 0 24%, transparent 24%),
        linear-gradient(160deg, #151c1a, #202a27);
    border-left: 5px solid var(--acid);
    box-shadow: var(--shadow);
}

.dashboard-hero::before,
.page-heading::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(90deg, transparent, #000 55%);
}

.hero-copy,
.hero-actions,
.page-heading > * {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 14px;
    color: #8e9a95;
    font: 700 9px/1.3 var(--font-interface);
    letter-spacing: .14em;
}

.eyebrow span {
    color: var(--acid-strong);
}

.hero-copy h1,
.page-heading h1 {
    margin: 0;
    font-size: clamp(30px, 3.7vw, 52px);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.hero-copy > p:last-child,
.page-heading > div > p:last-child {
    max-width: 660px;
    margin: 14px 0 0;
    color: #aeb8b3;
    line-height: 1.7;
}

.hero-copy > p:last-child strong {
    color: var(--acid);
    font-weight: 700;
}

.hero-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
}

.hero-index {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    width: 132px;
    padding: 18px;
    border-left: 1px solid rgba(255, 255, 255, .1);
    color: #6f7d77;
}

.hero-index::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(-45deg, transparent 0 8px, rgba(216, 255, 69, .045) 8px 10px);
}

.hero-index small,
.hero-index span {
    position: relative;
    font: 700 8px/1 var(--font-interface);
    letter-spacing: .12em;
}

.hero-index strong {
    position: relative;
    color: var(--acid);
    font: 800 64px/.9 var(--font-interface);
    letter-spacing: -.08em;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 17px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button.primary {
    color: #151a18;
    background: var(--acid);
    border-color: var(--acid);
}

.button.primary:hover {
    background: #e4ff7c;
}

.button.ghost {
    color: inherit;
    background: transparent;
    border-color: rgba(255, 255, 255, .24);
}

.button.danger {
    color: #a33e32;
    background: rgba(204, 76, 58, .06);
    border-color: rgba(204, 76, 58, .28);
}

.button.danger:hover {
    color: #fff;
    background: #b9493b;
    border-color: #b9493b;
}

.button:disabled {
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: .38;
}

.technical-heading {
    min-height: 164px;
    align-items: center;
    margin-bottom: 22px;
}

.heading-code {
    position: absolute;
    right: 26px;
    bottom: -15px;
    color: rgba(216, 255, 69, .14);
    font: 900 122px/.8 var(--font-interface);
    letter-spacing: -.08em;
    pointer-events: none;
}

.technical-heading .button {
    flex: 0 0 auto;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.metric-card {
    position: relative;
    min-height: 132px;
    padding: 20px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(25, 34, 30, .035);
}

.metric-card::after {
    content: attr(data-index);
    position: absolute;
    right: 10px;
    bottom: -8px;
    color: rgba(17, 22, 21, .035);
    font: 900 68px/1 var(--font-interface);
}

.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.metric-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: #52604e;
    background: var(--acid-soft);
    border-left: 2px solid var(--acid-strong);
    font: 900 8px/1 var(--font-interface);
}

.metric-trend {
    color: var(--ok);
    font: 700 9px/1 var(--font-interface);
}

.metric-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 16px;
}

.metric-value strong {
    font: 800 32px/1 var(--font-interface);
    letter-spacing: -.04em;
}

.metric-value span {
    color: var(--muted);
    font-size: 10px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, .82fr);
    gap: 14px;
}

.panel {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(25, 34, 30, .035);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 70px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2,
.table-panel h2,
.utilization-panel h2 {
    margin: 5px 0 0;
    font-size: 16px;
    letter-spacing: -.015em;
}

.text-button,
.full-link {
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
}

.text-button:hover,
.full-link:hover {
    color: var(--ink);
}

.square-button {
    width: 31px;
    height: 31px;
    font-size: 20px;
}

.project-list {
    display: grid;
}

.project-row {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(160px, 1.2fr) minmax(130px, .75fr) 92px;
    align-items: center;
    gap: 14px;
    min-height: 82px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background .16s ease;
}

.project-row:last-child {
    border-bottom: 0;
}

.project-row:hover {
    background: var(--surface-2);
}

.project-code {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--ink);
    background: var(--acid-soft);
    border: 1px solid rgba(183, 225, 47, .48);
    font: 800 9px/1 var(--font-interface);
}

.project-row h3 {
    margin: 0 0 5px;
    font-size: 13px;
}

.project-row p,
.project-row small {
    margin: 0;
    color: var(--muted);
    font-size: 9px;
}

.progress-track {
    height: 4px;
    margin: 7px 0 5px;
    overflow: hidden;
    background: var(--line);
}

.progress-track i {
    display: block;
    height: 100%;
    background: var(--acid-strong);
}

.project-percent {
    color: var(--muted);
    text-align: right;
    font: 700 10px/1 var(--font-interface);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    min-height: 23px;
    padding: 0 8px;
    color: #536156;
    background: #eef4e7;
    border: 1px solid #d6e2c8;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

.status-chip::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ok);
}

.status-chip.processing {
    color: #3f7472;
    background: rgba(98, 214, 208, .11);
    border-color: rgba(98, 214, 208, .35);
}

.status-chip.processing::before { background: var(--cyan); }
.status-chip.caution { color: #89622b; background: #fff8e8; border-color: #eedba9; }
.status-chip.caution::before { background: var(--warning); }
.status-chip.danger { color: #9a4d3e; background: #fff0ec; border-color: #efc8be; }
.status-chip.danger::before { background: var(--danger); }
.status-chip.neutral { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.status-chip.neutral::before { background: var(--muted-2); }

.today-list {
    display: grid;
    padding: 6px 18px 0;
}

.today-item {
    display: grid;
    grid-template-columns: 48px 11px 1fr auto;
    align-items: center;
    gap: 9px;
    min-height: 55px;
    border-bottom: 1px dashed var(--line);
}

.today-item time {
    color: var(--muted);
    font: 700 10px/1 var(--font-interface);
}

.task-marker {
    width: 7px;
    height: 7px;
    background: var(--cyan);
    transform: rotate(45deg);
}

.task-marker.animal { background: var(--acid-strong); }
.task-marker.analysis { background: var(--warning); }
.task-marker.meeting { background: #9d8ad1; }

.today-item strong,
.today-item small {
    display: block;
}

.today-item strong {
    font-size: 11px;
}

.today-item small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 8px;
}

.task-check {
    width: 20px;
    height: 20px;
    border: 1px solid var(--line-dark);
    background: transparent;
    cursor: pointer;
}

.today-item.done {
    opacity: .52;
}

.today-item.done strong {
    text-decoration: line-through;
}

.today-item.done .task-check {
    background: var(--acid);
    border-color: var(--acid-strong);
}

.today-item.done .task-check::after {
    content: "✓";
    font-size: 10px;
}

.full-link {
    width: calc(100% - 36px);
    min-height: 38px;
    margin: 10px 18px 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.alert-panel {
    grid-column: 1;
}

.alert-table-wrap,
.table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    height: 38px;
    padding: 0 16px;
    color: var(--muted);
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    font: 700 8px/1 var(--font-interface);
    letter-spacing: .09em;
    text-transform: uppercase;
}

.data-table td {
    height: 58px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 11px;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr {
    transition: background .16s ease;
}

.data-table tbody tr:hover {
    background: var(--surface-2);
}

.data-table strong,
.data-table small {
    display: block;
}

.data-table small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 8px;
}

.compact-table th,
.compact-table td {
    padding-right: 12px;
    padding-left: 12px;
}

.row-arrow,
.row-action {
    width: 27px;
    height: 27px;
    border: 1px solid var(--line);
    background: transparent;
    cursor: pointer;
}

.activity-stream {
    position: relative;
    display: grid;
    padding: 9px 20px 16px;
}

.activity-stream::before {
    content: "";
    position: absolute;
    top: 24px;
    bottom: 28px;
    left: 28px;
    width: 1px;
    background: var(--line);
}

.activity-item {
    position: relative;
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    padding: 10px 0;
}

.activity-item > i {
    position: relative;
    z-index: 1;
    width: 9px;
    height: 9px;
    margin: 4px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 1px var(--line);
}

.activity-item p {
    margin: 0;
    font-size: 10px;
    line-height: 1.5;
}

.activity-item time {
    display: block;
    margin-top: 3px;
    color: var(--muted-2);
    font: 700 8px/1 var(--font-interface);
}

.live-label {
    color: var(--ok);
    font: 700 8px/1 var(--font-interface);
    letter-spacing: .1em;
}

.live-label i {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--ok);
}

.module-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 58px;
    margin-bottom: 14px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.module-toolbar.in-panel {
    min-height: 68px;
    margin: 0;
    padding: 10px 18px;
    border: 0;
    border-bottom: 1px solid var(--line);
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.filter-tabs button {
    min-height: 32px;
    padding: 0 13px;
    border: 1px solid transparent;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
}

.filter-tabs button:hover,
.filter-tabs button.active {
    color: var(--ink);
    background: var(--acid-soft);
    border-color: rgba(183, 225, 47, .34);
}

.inline-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(300px, 40vw);
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: var(--surface-2);
}

.inline-search input {
    font-size: 10px;
}

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

.record-card {
    position: relative;
    min-height: 236px;
    padding: 20px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.record-card:hover {
    border-color: var(--line-dark);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.record-card::after {
    content: attr(data-code);
    position: absolute;
    right: -5px;
    bottom: -13px;
    color: rgba(17, 22, 21, .035);
    font: 900 64px/1 var(--font-interface);
}

.record-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.record-card h2 {
    margin: 21px 0 8px;
    font-size: 17px;
    line-height: 1.4;
}

.record-card > p {
    min-height: 44px;
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.65;
}

.record-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.record-meta small,
.record-meta strong {
    display: block;
}

.record-meta small {
    color: var(--muted-2);
    font: 700 8px/1 var(--font-interface);
}

.record-meta strong {
    margin-top: 5px;
    font-size: 10px;
}

.empty-card {
    grid-column: 1 / -1;
    padding: 52px;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--line-dark);
    text-align: center;
}

.mini-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.mini-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 82px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
}

.mini-metric small,
.mini-metric strong {
    display: block;
}

.mini-metric small {
    color: var(--muted);
    font-size: 9px;
}

.mini-metric strong {
    margin-top: 6px;
    font: 800 22px/1 var(--font-interface);
}

.mini-metric i {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    color: #667151;
    background: var(--acid-soft);
    font: 800 8px/1 var(--font-interface);
    font-style: normal;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 11px;
}

.section-index {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    color: var(--sidebar);
    background: var(--acid);
    font: 900 11px/1 var(--font-interface);
}

.amount-meter {
    width: 100px;
}

.amount-meter div {
    height: 4px;
    margin-bottom: 5px;
    overflow: hidden;
    background: var(--line);
}

.amount-meter i {
    display: block;
    height: 100%;
    background: var(--acid-strong);
}

.amount-meter.low i { background: var(--danger); }
.amount-meter span { color: var(--muted); font: 700 8px/1 var(--font-interface); }

.biobank-layout,
.schedule-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(290px, .72fr);
    gap: 14px;
}

.freezer-panel {
    padding-bottom: 24px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    color: var(--muted);
    font-size: 8px;
}

.legend span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend .cell {
    width: 10px;
    height: 10px;
    border: 1px solid var(--line-dark);
}

.legend .cell.occupied { background: #cbd3ca; }
.legend .cell.selected { background: var(--acid); border-color: #a9cf1e; }

.cryo-matrix {
    display: grid;
    grid-template-columns: repeat(8, minmax(36px, 1fr));
    gap: 7px;
    padding: 24px;
}

.cryo-cell {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    color: var(--muted-2);
    background: var(--surface-2);
    cursor: pointer;
    font: 700 8px/1 var(--font-interface);
    transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.cryo-cell:hover {
    border-color: var(--cyan);
    transform: scale(1.06);
}

.cryo-cell.occupied {
    color: var(--ink);
    background: #dfe4dd;
    border-color: #c5cdc5;
}

.cryo-cell.selected {
    color: #151a18;
    background: var(--acid);
    border-color: #a6cc1b;
    box-shadow: 0 0 0 3px rgba(216, 255, 69, .2);
}

.sample-detail {
    position: relative;
    min-height: 380px;
    padding: 24px;
    overflow: hidden;
}

.sample-detail::after {
    content: "BIO\A SAMPLE";
    position: absolute;
    right: -10px;
    bottom: -7px;
    color: rgba(17, 22, 21, .04);
    white-space: pre;
    font: 900 52px/.78 var(--font-interface);
    text-align: right;
}

.sample-vial {
    position: relative;
    width: 70px;
    height: 94px;
    margin: 20px auto 24px;
    border: 2px solid var(--line-dark);
    border-top: 12px solid var(--ink-2);
    background: linear-gradient(to top, rgba(98, 214, 208, .38) 0 42%, transparent 42%);
}

.sample-vial::after {
    content: attr(data-code);
    position: absolute;
    top: 31px;
    left: 6px;
    right: 6px;
    padding: 6px 2px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    text-align: center;
    font: 700 7px/1 var(--font-interface);
}

.sample-detail h2 {
    position: relative;
    z-index: 1;
    margin: 0 0 4px;
    font-size: 19px;
    text-align: center;
}

.sample-detail > p {
    position: relative;
    z-index: 1;
    margin: 0 0 20px;
    color: var(--muted);
    text-align: center;
    font-size: 10px;
}

.detail-list {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0;
    margin: 0;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.detail-list dt {
    color: var(--muted);
    font-size: 9px;
}

.detail-list dd {
    margin: 0;
    font-size: 10px;
    font-weight: 800;
    text-align: right;
}

.sample-detail-open {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 16px;
    padding: 12px 14px;
    color: #1f2918;
    background: var(--acid-soft);
    border: 1px solid rgba(151, 191, 31, .3);
    border-radius: 10px 3px 10px 3px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 900;
}

.sample-detail-open:hover,
.sample-detail-open:focus-visible {
    background: var(--acid);
    outline: 0;
}

.sample-list-panel {
    margin-top: 14px;
}

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

.protocol-card {
    position: relative;
    min-height: 244px;
    padding: 22px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    transition: transform .18s ease, box-shadow .18s ease;
}

.protocol-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.protocol-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 44px;
    height: 4px;
    background: var(--acid-strong);
}

.protocol-card .protocol-number {
    color: var(--muted-2);
    font: 700 9px/1 var(--font-interface);
}

.protocol-card h2 {
    margin: 25px 0 9px;
    font-size: 17px;
}

.protocol-card p {
    min-height: 50px;
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.7;
}

.protocol-steps {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 18px 0;
}

.protocol-steps i {
    width: 20px;
    height: 4px;
    background: var(--line);
}

.protocol-steps i.active {
    background: var(--acid-strong);
}

.protocol-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.protocol-foot span {
    color: var(--muted);
    font: 700 8px/1 var(--font-interface);
}

.protocol-foot a {
    text-decoration: none;
    font-size: 10px;
    font-weight: 800;
}

.timeline-panel {
    min-height: 570px;
}

.date-switch {
    display: flex;
    align-items: center;
    gap: 7px;
}

.date-switch button {
    width: 27px;
    height: 27px;
}

.date-switch span {
    min-width: 42px;
    color: var(--muted);
    text-align: center;
    font-size: 9px;
}

.day-timeline {
    padding: 12px 20px 26px;
}

.timeline-row {
    display: grid;
    grid-template-columns: 52px 1fr;
    min-height: 58px;
}

.timeline-time {
    position: relative;
    padding-top: 8px;
    color: var(--muted);
    border-right: 1px solid var(--line);
    font: 700 9px/1 var(--font-interface);
}

.timeline-time::after {
    content: "";
    position: absolute;
    top: 10px;
    right: -4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--line-dark);
}

.timeline-content {
    padding: 4px 0 11px 18px;
}

.timeline-task {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 43px;
    padding: 9px 11px;
    background: var(--surface-2);
    border-left: 3px solid var(--cyan);
}

.timeline-task.animal { border-left-color: var(--acid-strong); }
.timeline-task.analysis { border-left-color: var(--warning); }
.timeline-task.meeting { border-left-color: #9d8ad1; }

.timeline-task strong,
.timeline-task small {
    display: block;
}

.timeline-task strong { font-size: 10px; }
.timeline-task small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.timeline-task button { width: 24px; height: 24px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }

.utilization-panel {
    padding: 23px;
}

.load-item {
    margin-top: 24px;
}

.load-item header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 10px;
}

.load-item header span:last-child {
    color: var(--muted);
    font: 700 9px/1 var(--font-interface);
}

.load-track {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
}

.load-track i {
    height: 9px;
    background: var(--line);
}

.load-track i.active { background: var(--acid-strong); }
.load-track.high i.active { background: var(--warning); }

.safety-note {
    display: flex;
    gap: 12px;
    margin-top: 36px;
    padding: 16px;
    color: #e3e9df;
    background: var(--ink-2);
    border-left: 4px solid var(--warning);
}

.safety-note > span {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    color: var(--ink);
    background: var(--warning);
    font-weight: 900;
}

.safety-note strong { font-size: 10px; }
.safety-note p { margin: 5px 0 0; color: #9fa9a4; font-size: 9px; line-height: 1.6; }

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: start center;
    padding: 11vh 20px 20px;
}

.search-overlay[hidden] {
    display: none;
}

.search-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(10, 14, 13, .72);
    backdrop-filter: blur(7px);
}

.search-dialog {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    max-height: 76vh;
    overflow: hidden;
    color: var(--ink);
    background: var(--surface);
    border-top: 4px solid var(--acid);
    box-shadow: 0 36px 90px rgba(0, 0, 0, .32);
    animation: searchEnter .2s ease both;
}

@keyframes searchEnter {
    from { opacity: 0; transform: translateY(-12px) scale(.98); }
}

.search-dialog > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
}

.search-dialog h2 {
    margin: 5px 0 0;
    font-size: 17px;
}

.close-button {
    width: 41px;
    height: 27px;
    color: var(--muted);
    font: 700 8px/1 var(--font-interface);
}

.dialog-search {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 58px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.dialog-search input {
    font-size: 15px;
}

.search-results {
    max-height: calc(76vh - 132px);
    overflow-y: auto;
    padding: 10px;
}

.search-result {
    display: grid;
    grid-template-columns: 74px 1fr auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 60px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.search-result:hover {
    background: var(--surface-2);
}

.search-result > span:first-child {
    color: var(--muted);
    font: 700 8px/1 var(--font-interface);
}

.search-result strong,
.search-result small { display: block; }
.search-result strong { font-size: 11px; }
.search-result small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.search-result > b { color: var(--muted-2); font-size: 13px; }
.search-empty { padding: 46px 20px; color: var(--muted); text-align: center; }

.entry-dialog {
    width: min(680px, calc(100% - 28px));
    max-height: calc(100vh - 34px);
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    background: var(--surface);
    border: 0;
    border-top: 4px solid var(--acid);
    box-shadow: 0 36px 100px rgba(0, 0, 0, .35);
}

.entry-dialog::backdrop {
    background: rgba(10, 14, 13, .7);
    backdrop-filter: blur(6px);
}

.entry-dialog form {
    max-height: calc(100vh - 34px);
    overflow-y: auto;
}

.entry-dialog header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--line);
}

.entry-dialog h2 {
    margin: 5px 0 0;
    font-size: 19px;
}

.dialog-close {
    width: 33px;
    height: 33px;
    font-size: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
    padding: 22px;
}

.form-field {
    display: grid;
    gap: 7px;
}

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

.form-field label {
    color: var(--muted);
    font: 700 9px/1 var(--font-interface);
    letter-spacing: .05em;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 41px;
    padding: 9px 11px;
    border: 1px solid var(--line-dark);
    outline: 0;
    color: var(--ink);
    background: var(--surface-2);
}

.form-field textarea {
    min-height: 88px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(98, 214, 208, .12);
}

.form-field.locked-record-key input {
    color: var(--muted);
    background:
        repeating-linear-gradient(135deg, transparent 0 8px, rgba(75, 88, 79, .035) 8px 9px),
        var(--surface-2);
    cursor: not-allowed;
}

.entry-dialog footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 22px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
}

.entry-dialog footer p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--muted);
    font-size: 9px;
}

.entry-dialog footer > div {
    display: flex;
    gap: 9px;
}

.entry-dialog footer .button.ghost {
    color: var(--ink);
    border-color: var(--line-dark);
}

.toast {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 4000;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    padding: 13px 16px;
    color: #eef4eb;
    background: var(--ink-2);
    border-left: 4px solid var(--acid);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px);
    transition: opacity .2s ease, transform .2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast span {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    color: var(--ink);
    background: var(--acid);
    font-size: 10px;
    font-weight: 900;
}

.toast p {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
}

.mobile-scrim {
    display: none;
}

body.dark-theme {
    --ink: #eef3ed;
    --ink-2: #d7ded8;
    --muted: #9aa69f;
    --muted-2: #6e7a74;
    --canvas: #111614;
    --surface: #171d1b;
    --surface-2: #1d2522;
    --line: #303a36;
    --line-dark: #46524d;
    --shadow: 0 18px 46px rgba(0, 0, 0, .26);
    background-color: var(--canvas);
}

.dark-theme .topbar {
    background: rgba(23, 29, 27, .9);
}

.dark-theme .metric-card::after,
.dark-theme .record-card::after,
.dark-theme .sample-detail::after {
    color: rgba(255, 255, 255, .035);
}

.dark-theme .button.primary,
.dark-theme .avatar,
.dark-theme .section-index {
    color: #151a18;
}

.dark-theme .status-chip { color: #b9ceb0; background: rgba(120, 184, 61, .1); border-color: rgba(120, 184, 61, .26); }
.dark-theme .status-chip.processing { color: #91d8d4; background: rgba(98, 214, 208, .08); border-color: rgba(98, 214, 208, .25); }
.dark-theme .status-chip.caution { color: #e7bc6d; background: rgba(242, 179, 61, .08); border-color: rgba(242, 179, 61, .24); }
.dark-theme .status-chip.danger { color: #e99383; background: rgba(231, 104, 79, .08); border-color: rgba(231, 104, 79, .24); }
.dark-theme .status-chip.neutral { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.dark-theme .cryo-cell.occupied { color: var(--ink); background: #2a342f; border-color: #3b4842; }
.dark-theme .sample-vial { background: linear-gradient(to top, rgba(98, 214, 208, .28) 0 42%, transparent 42%); }
.dark-theme .notice-button::after { border-color: var(--surface); }
.dark-theme .safety-note { color: #e3e9df; background: #242c29; }

@media (max-width: 1220px) {
    :root { --sidebar-width: 220px; }
    .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .record-grid,
    .protocol-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-row { grid-template-columns: 40px 1fr 120px; }
    .project-percent { display: none; }
}

@media (max-width: 960px) {
    :root { --sidebar-width: 248px; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform .24s ease;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .app-stage { width: 100%; margin-left: 0; }
    .topbar { left: 0; padding: 0 18px; }
    .menu-toggle { display: block; }
    .breadcrumb { min-width: 150px; }
    .operator > div:last-child { display: none; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .alert-panel { grid-column: auto; }
    .activity-panel { grid-column: auto; }
    .biobank-layout,
    .schedule-layout { grid-template-columns: 1fr; }
    .mobile-scrim {
        position: fixed;
        inset: 0;
        z-index: 1100;
        background: rgba(7, 10, 9, .58);
    }
    body.sidebar-open .mobile-scrim { display: block; }
}

@media (max-width: 700px) {
    :root { --topbar-height: 62px; }
    .topbar { gap: 10px; padding: 0 12px; }
    .breadcrumb { min-width: 0; }
    .breadcrumb span,
    .breadcrumb i { display: none; }
    .global-search { width: auto; flex: 1; }
    .global-search kbd { display: none; }
    .global-search input { padding-right: 4px; }
    .top-actions .icon-button:first-child { display: none; }
    .operator { display: none; }
    main { padding: calc(var(--topbar-height) + 16px) 12px 40px; }
    .dashboard-hero,
    .page-heading { min-height: 230px; align-items: flex-start; flex-direction: column; padding: 24px 80px 24px 24px; }
    .hero-actions { flex-wrap: wrap; }
    .hero-index { width: 65px; padding: 10px; }
    .hero-index strong { font-size: 42px; }
    .heading-code { right: 13px; font-size: 78px; }
    .technical-heading .button { margin-top: auto; }
    .metrics-grid,
    .mini-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-card { min-height: 118px; padding: 15px; }
    .module-toolbar,
    .module-toolbar.in-panel { align-items: stretch; flex-direction: column; padding: 12px; }
    .inline-search { width: 100%; }
    .record-grid,
    .protocol-grid { grid-template-columns: 1fr; }
    .project-row { grid-template-columns: 40px 1fr auto; padding: 13px 14px; }
    .project-progress { display: none; }
    .panel-head { padding: 14px; }
    .cryo-matrix { grid-template-columns: repeat(8, minmax(24px, 1fr)); gap: 4px; padding: 15px; }
    .legend { display: none; }
    .form-grid { grid-template-columns: 1fr; padding: 18px; }
    .form-field.full { grid-column: auto; }
    .entry-dialog footer { align-items: stretch; flex-direction: column; }
    .entry-dialog footer > div { justify-content: flex-end; }
    .search-overlay { padding: 6vh 10px 10px; }
    .search-result { grid-template-columns: 62px 1fr auto; }
    .toast { right: 12px; bottom: 12px; left: 12px; }
}

/* Independent language dock: it is outside the top bar so utility controls can never push it away. */
.language-dock {
    position: fixed;
    z-index: 1250;
    top: calc(var(--topbar-height) + 15px);
    right: 18px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 6px 6px 12px;
    color: #f4f7f0;
    background: rgba(31, 40, 36, .94);
    border: 1px solid rgba(216, 255, 69, .48);
    border-radius: 5px 0 0 18px;
    box-shadow: 0 16px 40px rgba(31, 40, 36, .23), 0 0 0 4px rgba(216, 255, 69, .09);
    backdrop-filter: blur(18px);
}

.language-dock::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    background: var(--acid);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(216, 255, 69, .13);
}

.language-dock-label {
    color: #eef4e9;
    font: 900 7px/1 var(--font-interface);
    letter-spacing: .17em;
}

.language-dock button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 78px;
    min-height: 34px;
    padding: 0 11px;
    color: #26301e;
    background: var(--acid);
    border: 0;
    border-radius: 3px 0 0 12px;
    cursor: pointer;
    font-family: var(--font-interface);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
}

.language-dock button i {
    color: rgba(38, 48, 30, .45);
    font-style: normal;
}

.language-dock button span {
    opacity: .4;
    transition: color .18s ease, opacity .18s ease;
}

.language-dock button span.active {
    color: #151b11;
    opacity: 1;
}

.language-dock button:hover,
.language-dock button:focus-visible {
    background: #e4ff7d;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.dark-theme .language-dock {
    background: rgba(15, 21, 18, .96);
    border-color: rgba(216, 255, 69, .55);
}

@media (max-width: 700px) {
    .top-actions #themeToggle {
        display: none;
    }

    .language-dock {
        top: calc(var(--topbar-height) + 8px);
        right: 0;
        gap: 7px;
        padding-left: 9px;
        border-radius: 4px 0 0 15px;
    }

    .language-dock-label {
        display: none;
    }

    .language-dock button {
        min-width: 70px;
        min-height: 32px;
        padding: 0 9px;
    }
}

.brand-lockup {
    gap: 10px;
}

.brand-logo {
    width: 102px;
}

.brand-terminal {
    min-width: 0;
    font-size: 10px;
    letter-spacing: .035em;
    white-space: normal;
}

.photo-capture-button strong {
    font-size: 15px !important;
    line-height: 1.4;
}

.photo-capture-preview > span {
    color: var(--muted);
    font-size: 14px !important;
    line-height: 1.45;
}

/* Readability pass: slightly larger interface type without changing the layout hierarchy. */
body {
    font-size: 15px;
}

html[lang="en"] body,
html[lang="en"] button,
html[lang="en"] input,
html[lang="en"] select,
html[lang="en"] textarea {
    font-family: var(--font-interface);
}

.nav-item {
    font-size: 15px;
}

.nav-label,
.micro-label,
.eyebrow {
    font-size: 10px;
}

.nav-item b,
.global-search kbd,
.data-table th {
    font-size: 9px;
}

.nav-code,
.breadcrumb {
    font-size: 11px;
}

.global-search input,
.button {
    font-size: 13px;
}

.data-table td {
    font-size: 12px;
}

.data-table small,
.mini-metric small,
.detail-list dt,
.record-detail-field small,
.record-history-item p,
.record-history-empty {
    font-size: 9.5px;
}

.detail-list dd,
.record-timeline strong {
    font-size: 11px;
}

.record-detail-field strong {
    font-size: 13px;
}

@media (max-width: 430px) {
    body {
        font-size: 14.5px;
    }

    .button {
        font-size: 12px;
    }
}

@media (max-width: 430px) {
    .top-actions { display: none; }
    .metrics-grid,
    .mini-metrics { grid-template-columns: 1fr 1fr; }
    .mini-metric { min-height: 72px; padding: 12px; }
    .mini-metric i { display: none; }
    .today-item { grid-template-columns: 42px 9px 1fr auto; }
    .filter-tabs { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
    .cryo-cell { font-size: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Rhine identity, interactive biobank slots and scalable protocol maps. */
.brand-logo {
    display: block;
    width: 112px;
    height: auto;
    flex: 0 0 auto;
}

.brand-terminal {
    color: #68746e;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.55;
    letter-spacing: .08em;
    white-space: nowrap;
}

.matrix-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
}

.cryo-cell > span {
    position: relative;
    z-index: 1;
}

.cryo-cell.empty {
    border-style: dashed;
}

.cryo-cell.empty::before {
    content: "+";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--ink);
    font-size: 19px;
    font-weight: 400;
    opacity: 0;
    transform: scale(.7);
    transition: opacity .16s ease, transform .16s ease;
}

.cryo-cell.empty:hover,
.cryo-cell.empty:focus-visible {
    color: transparent;
    background: var(--acid-soft);
    border-color: var(--acid-strong);
}

.cryo-cell.empty:hover::before,
.cryo-cell.empty:focus-visible::before {
    opacity: 1;
    transform: scale(1);
}

.protocol-path-preview {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto 1fr auto auto;
    align-items: center;
    gap: 6px;
    margin: 18px 0;
    color: #647068;
    font-size: 8px;
    font-weight: 900;
}

.protocol-path-preview i {
    height: 1px;
    background: linear-gradient(90deg, var(--line-dark), var(--acid-strong));
}

.protocol-path-preview b {
    margin-left: 4px;
    padding: 5px 7px;
    color: #4c5b50;
    background: var(--acid-soft);
    border-radius: 999px;
    white-space: nowrap;
}

.protocol-flow-map {
    position: relative;
    display: grid;
    gap: 14px;
    padding: 2px 0 2px 3px;
}

.protocol-flow-map::before {
    content: "";
    position: absolute;
    top: 24px;
    bottom: 24px;
    left: 13px;
    width: 2px;
    background: linear-gradient(var(--acid-strong), var(--cyan), var(--orange));
    opacity: .68;
}

.protocol-flow-map .protocol-flow-phase {
    position: relative;
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 16px;
    margin-top: 0;
    padding: 12px 12px 12px 42px;
    background: rgba(255, 255, 255, .36);
    border: 1px solid var(--line);
    border-radius: 5px 15px 15px 5px;
}

.protocol-flow-phase > header {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.flow-phase-dot {
    position: absolute;
    top: 50%;
    left: -37px;
    z-index: 1;
    width: 16px;
    height: 16px;
    background: var(--surface);
    border: 4px solid var(--acid-strong);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(174, 210, 55, .12);
    transform: translateY(-50%);
}

.protocol-flow-phase header strong,
.protocol-flow-phase header small {
    display: block;
}

.protocol-flow-phase header strong {
    font-size: 12px;
}

.protocol-flow-phase header small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .13em;
}

.protocol-flow-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.protocol-flow-node {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 11px 12px 11px 30px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px 3px 10px 3px;
    box-shadow: 0 7px 18px rgba(37, 48, 42, .04);
}

.protocol-flow-node i {
    position: absolute;
    left: 13px;
    width: 8px;
    height: 8px;
    background: var(--acid-strong);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.protocol-flow-node p {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.55;
}

.dark-theme .brand-logo {
    filter: invert(1) brightness(1.4);
}

.dark-theme .brand-terminal {
    color: #9ca8a1;
}

.dark-theme .protocol-flow-map .protocol-flow-phase,
.dark-theme .protocol-flow-node {
    background: rgba(255, 255, 255, .035);
    border-color: rgba(255, 255, 255, .08);
}

.dark-theme .flow-phase-dot {
    background: var(--canvas);
}

@media (max-width: 700px) {
    .brand-logo { width: 108px; }

    .protocol-flow-map .protocol-flow-phase {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .protocol-flow-steps {
        grid-template-columns: 1fr;
    }

    .protocol-path-preview {
        grid-template-columns: auto 1fr auto 1fr auto auto;
    }

    .protocol-path-preview span:nth-of-type(3),
    .protocol-path-preview i:nth-of-type(3) {
        display: none;
    }
}

/* Calendar, Protocol builder and reagent forecasting. */
.heading-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 62px;
    margin-bottom: 14px;
    padding: 9px 12px;
    background: rgba(250, 250, 246, .76);
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 16px 5px 16px 5px;
    box-shadow: 0 12px 32px rgba(45, 57, 50, .05);
    backdrop-filter: blur(16px);
}

.calendar-modes,
.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 5px;
}

.calendar-modes button,
.calendar-navigation button {
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    font-weight: 900;
}

.calendar-modes button:hover,
.calendar-modes button.active,
.calendar-navigation button:hover {
    color: var(--ink);
    background: var(--acid-soft);
    border-color: rgba(145, 187, 40, .2);
}

.calendar-navigation strong {
    min-width: 190px;
    margin-left: 10px;
    font-family: var(--font-interface);
    font-size: 14px;
    text-align: right;
}

.calendar-view {
    display: none;
    animation: viewEnter .26s ease both;
}

.calendar-view.active {
    display: block;
}

.calendar-view[hidden] {
    display: none !important;
}

.drag-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 9px;
}

.drag-hint i {
    width: 16px;
    height: 8px;
    border: 1px dashed var(--acid-strong);
    border-radius: 3px;
    background: var(--acid-soft);
}

.timeline-panel {
    min-height: 880px;
}

.day-timeline {
    position: relative;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: repeat(24, 32px);
    padding: 16px 20px 30px 8px;
    user-select: none;
    touch-action: none;
}

.calendar-time-label {
    grid-column: 1;
    align-self: start;
    padding: 0 12px 0 0;
    color: var(--muted);
    text-align: right;
    font: 700 9px/1 var(--font-interface);
    transform: translateY(-4px);
}

.calendar-time-slot {
    position: relative;
    grid-column: 2;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    border-top: 1px solid rgba(76, 89, 81, .09);
    background: transparent;
    cursor: crosshair;
}

.calendar-time-slot:nth-of-type(even) {
    border-top-style: dashed;
    border-top-color: rgba(76, 89, 81, .055);
}

.calendar-time-slot:hover,
.calendar-time-slot.selecting {
    background: rgba(182, 219, 58, .13);
}

.calendar-time-slot.selecting {
    border-top-color: rgba(145, 187, 40, .36);
}

.schedule-block {
    position: relative;
    z-index: 4;
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 29px;
    width: calc(var(--event-width, 100%) - 17px);
    min-width: 0;
    margin: 2px 0 2px calc(var(--event-left, 0%) + 8px);
    padding: 6px 9px 6px 12px;
    overflow: hidden;
    color: var(--ink);
    background: rgba(218, 238, 237, .94);
    border-left: 4px solid var(--cyan);
    border-radius: 4px 12px 12px 4px;
    box-shadow: 0 7px 20px rgba(61, 93, 89, .09);
}

.day-timeline.dragging .schedule-block {
    pointer-events: none;
    opacity: .72;
}

.schedule-block[data-overlap-count="2"] {
    padding-right: 7px;
    padding-left: 9px;
}

.schedule-block[data-overlap-count="3"] small,
.schedule-block[data-overlap-count="4"] small {
    display: none;
}

.schedule-block.animal { background: rgba(229, 239, 196, .95); border-left-color: var(--acid-strong); }
.schedule-block.analysis { background: rgba(250, 234, 202, .95); border-left-color: var(--warning); }
.schedule-block.meeting { background: rgba(231, 222, 244, .94); border-left-color: #9d8ad1; }
.schedule-block.done { opacity: .58; }
.schedule-block.done strong { text-decoration: line-through; }

.schedule-block strong,
.schedule-block small {
    display: block;
}

.schedule-block strong {
    overflow: hidden;
    font-family: var(--font-interface);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-block small {
    margin-top: 3px;
    overflow: hidden;
    color: #69736e;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-block button {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(57, 71, 63, .16);
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
    font-size: 10px;
}

.month-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, .55fr);
    gap: 14px;
}

.month-panel {
    overflow: hidden;
}

.month-weekdays,
.month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(90px, 1fr));
}

.month-weekdays {
    min-width: 700px;
    background: rgba(225, 230, 222, .53);
    border-bottom: 1px solid var(--line);
}

.month-weekdays span {
    padding: 13px 10px;
    color: var(--muted);
    text-align: center;
    font-size: 9px;
    font-weight: 800;
}

.month-grid {
    min-width: 700px;
}

.month-day {
    position: relative;
    min-height: 118px;
    padding: 10px;
    overflow: hidden;
    border: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    background: rgba(255, 255, 255, .18);
    cursor: pointer;
    text-align: left;
    transition: background .16s ease;
}

.month-day:nth-child(7n) {
    border-right: 0;
}

.month-day:hover {
    background: rgba(255, 255, 255, .55);
}

.month-day.outside {
    color: var(--muted-2);
    background: rgba(228, 232, 225, .3);
}

.month-day.selected {
    background: rgba(182, 219, 58, .13);
    box-shadow: inset 0 0 0 2px rgba(145, 187, 40, .34);
}

.month-day > time {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    margin-bottom: 5px;
    border-radius: 50%;
    font: 800 10px/1 var(--font-interface);
}

.month-day.today > time {
    color: #27301f;
    background: var(--acid);
}

.month-task {
    display: block;
    margin-top: 4px;
    padding: 5px 6px;
    overflow: hidden;
    color: #4d5d58;
    background: rgba(109, 181, 173, .13);
    border-radius: 5px;
    font-size: 8px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.month-task i {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--cyan);
}

.month-task.animal { background: rgba(182, 219, 58, .14); }
.month-task.animal i { background: var(--acid-strong); }
.month-task.analysis { background: rgba(242, 179, 61, .13); }
.month-task.analysis i { background: var(--warning); }
.month-task.meeting { background: rgba(157, 138, 209, .13); }
.month-task.meeting i { background: #9d8ad1; }
.month-task.done { opacity: .5; text-decoration: line-through; }

.month-day > div > small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 8px;
}

.month-agenda {
    align-self: start;
    padding: 22px;
}

.month-agenda h2 {
    margin: 6px 0 16px;
    font-family: var(--font-interface);
    font-size: 17px;
}

.month-agenda .today-item {
    grid-template-columns: 42px 8px 1fr auto;
}

.month-agenda > .button {
    width: 100%;
    margin-top: 18px;
}

.month-empty {
    padding: 28px 4px;
    color: var(--muted);
    text-align: center;
    font-size: 10px;
}

.protocol-card {
    width: 100%;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.protocol-card:focus-visible {
    outline-color: var(--acid-strong);
}

.protocol-card:hover .protocol-foot strong {
    transform: translateX(3px);
}

.protocol-foot strong {
    transition: transform .16s ease;
}

.protocol-detail-dialog {
    width: min(780px, calc(100% - 28px));
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    background: rgba(248, 249, 244, .98);
    border: 0;
    border-radius: 24px 7px 24px 7px;
    box-shadow: 0 40px 110px rgba(34, 43, 38, .34);
}

.protocol-detail-dialog::backdrop {
    background: rgba(38, 45, 41, .5);
    backdrop-filter: blur(14px) saturate(.7);
}

.protocol-detail-dialog > article {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.protocol-detail-dialog header,
.protocol-detail-dialog footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
}

.protocol-detail-dialog header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(248, 249, 244, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.protocol-detail-dialog header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 24px;
    width: 74px;
    height: 5px;
    background: var(--orange);
    border-radius: 0 0 5px 5px;
}

.protocol-detail-dialog h2 {
    margin: 6px 0 0;
    font-family: var(--font-interface);
    font-size: 23px;
}

.protocol-detail-body {
    padding: 24px;
}

.protocol-detail-summary {
    margin: 0;
    padding: 17px 19px;
    color: #5d6963;
    background: var(--acid-soft);
    border-left: 4px solid var(--acid-strong);
    border-radius: 4px 13px 13px 4px;
    line-height: 1.75;
}

.protocol-detail-body section {
    margin-top: 27px;
}

.protocol-detail-body h3 {
    margin: 7px 0 15px;
    font-family: var(--font-interface);
    font-size: 16px;
}

.protocol-detail-body ol {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: protocol-step;
}

.protocol-detail-body li {
    position: relative;
    min-height: 44px;
    padding: 13px 12px 11px 48px;
    border-bottom: 1px solid var(--line);
    counter-increment: protocol-step;
    line-height: 1.55;
}

.protocol-detail-body li::before {
    content: counter(protocol-step, decimal-leading-zero);
    position: absolute;
    top: 11px;
    left: 8px;
    color: #75931e;
    font: 800 10px/1.5 var(--font-interface);
}

.protocol-usage-table {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px 4px 12px 4px;
}

.protocol-usage-table table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.protocol-usage-table th,
.protocol-usage-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 10px;
}

.protocol-usage-table th {
    color: var(--muted);
    background: var(--surface-2);
    font-size: 8px;
}

.protocol-usage-table tr:last-child td {
    border-bottom: 0;
}

.protocol-usage-table strong,
.protocol-usage-table small {
    display: block;
}

.protocol-usage-table small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 8px;
}

.protocol-no-reagent {
    padding: 22px;
    color: var(--muted);
    background: var(--surface-2);
    text-align: center;
}

.protocol-detail-dialog footer {
    position: sticky;
    bottom: 0;
    background: rgba(235, 239, 232, .96);
    border-top: 1px solid var(--line);
}

.protocol-detail-dialog footer > span {
    color: var(--muted);
    font-size: 9px;
}

.field-note {
    color: var(--muted);
    font-size: 8px;
    line-height: 1.45;
}

.protocol-reagent-editor {
    padding: 13px;
    background: rgba(235, 239, 232, .62);
    border: 1px solid var(--line);
    border-radius: 12px 4px 12px 4px;
}

#protocolReagentRows {
    display: grid;
    gap: 8px;
}

.protocol-reagent-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 110px 100px 28px;
    align-items: center;
    gap: 8px;
}

.protocol-reagent-row select,
.protocol-reagent-row input {
    width: 100%;
    min-height: 37px;
    padding: 7px 9px;
    border: 1px solid var(--line-dark);
    border-radius: 8px 3px 8px 3px;
    color: var(--ink);
    background: rgba(255, 255, 255, .55);
}

.protocol-reagent-row > span {
    color: var(--muted);
    font-size: 8px;
}

.protocol-reagent-row > button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    background: rgba(255, 255, 255, .5);
    cursor: pointer;
}

.add-reagent-row {
    margin-top: 10px;
    padding: 7px 10px;
    border: 1px dashed rgba(145, 187, 40, .42);
    border-radius: 999px;
    color: #668319;
    background: var(--acid-soft);
    cursor: pointer;
    font-size: 9px;
    font-weight: 800;
}

.protocol-reagent-editor > p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 8px;
}

.theory-quantity strong,
.theory-quantity small {
    display: block;
}

.theory-quantity strong {
    color: #668319;
    font-size: 11px;
}

.theory-quantity small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 8px;
}

.theory-quantity.low strong {
    color: var(--danger);
}

.dark-theme .calendar-toolbar,
.dark-theme .protocol-detail-dialog,
.dark-theme .protocol-detail-dialog header,
.dark-theme .protocol-detail-dialog footer {
    background: rgba(28, 35, 32, .96);
    border-color: rgba(255, 255, 255, .08);
}

.dark-theme .calendar-time-slot {
    border-top-color: rgba(255, 255, 255, .06);
}

.dark-theme .calendar-time-slot:hover,
.dark-theme .calendar-time-slot.selecting,
.dark-theme .month-day.selected {
    background: rgba(182, 219, 58, .08);
}

.dark-theme .schedule-block {
    color: #e9efea;
    background: rgba(71, 109, 105, .64);
}

.dark-theme .schedule-block.animal { background: rgba(100, 124, 46, .64); }
.dark-theme .schedule-block.analysis { background: rgba(127, 91, 42, .64); }
.dark-theme .schedule-block.meeting { background: rgba(82, 70, 113, .7); }
.dark-theme .schedule-block small { color: #c1cbc5; }

.dark-theme .month-weekdays,
.dark-theme .month-day.outside,
.dark-theme .protocol-reagent-editor,
.dark-theme .protocol-no-reagent {
    background: rgba(255, 255, 255, .025);
}

.dark-theme .month-day {
    color: var(--ink);
    background: rgba(255, 255, 255, .012);
}

.dark-theme .month-day:hover {
    background: rgba(255, 255, 255, .045);
}

.dark-theme .protocol-detail-summary {
    color: #c6d0ca;
}

.dark-theme .protocol-reagent-row select,
.dark-theme .protocol-reagent-row input {
    color: var(--ink);
    background: rgba(255, 255, 255, .045);
    border-color: rgba(255, 255, 255, .09);
}

@media (max-width: 1050px) {
    .month-layout {
        grid-template-columns: 1fr;
    }

    .month-agenda {
        position: static;
    }
}

@media (max-width: 700px) {
    .heading-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .calendar-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .calendar-navigation {
        justify-content: space-between;
    }

    .calendar-navigation strong {
        min-width: 0;
        margin-left: auto;
        font-size: 11px;
    }

    .drag-hint {
        display: none;
    }

    .timeline-panel {
        min-height: 860px;
    }

    .day-timeline {
        grid-template-columns: 48px minmax(0, 1fr);
        padding-right: 8px;
        padding-left: 2px;
    }

    .month-panel {
        overflow-x: auto;
    }

    .month-day {
        min-height: 96px;
    }

    .protocol-reagent-row {
        grid-template-columns: minmax(0, 1fr) 90px 28px;
    }

    .protocol-reagent-row > span {
        display: none;
    }

    .protocol-detail-dialog footer {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Standalone workspace typography and notification center. */
.primary-nav {
    font-family: var(--font-interface);
}

.primary-nav .nav-label {
    padding-top: 4px;
    padding-bottom: 13px;
    font-family: var(--font-interface);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
}

.nav-item {
    min-height: 58px;
    font-family: var(--font-interface);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: .015em;
}

.nav-item b {
    margin-top: -7px;
    font-size: 8px;
    font-weight: 700;
}

.nav-code {
    font-size: 11px;
}

.heading-status {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 15px;
    color: #59645e;
    background: rgba(255, 255, 255, .4);
    border: 1px solid rgba(255, 255, 255, .68);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.heading-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--acid-strong);
    box-shadow: 0 0 0 5px rgba(145, 187, 40, .1);
}

.protocol-foot strong {
    color: #6d851f;
    font-size: 9px;
}

.notice-button::after {
    content: none;
}

.notice-button > span {
    position: absolute;
    top: -6px;
    right: -6px;
    display: grid;
    place-items: center;
    width: 17px;
    height: 17px;
    color: #fff;
    background: var(--danger);
    border: 2px solid rgba(245, 247, 242, .94);
    border-radius: 50%;
    font: 800 8px/1 var(--font-interface);
    transition: opacity .18s ease, transform .18s ease;
}

.notice-button > span:empty,
.notice-button.is-read > span {
    opacity: 0;
    transform: scale(.6);
}

.notice-button[aria-expanded="true"] {
    color: #2b332f;
    background: var(--acid);
    border-color: rgba(137, 174, 35, .45);
}

.notification-panel {
    position: fixed;
    top: calc(var(--topbar-height) + 12px);
    right: 25px;
    z-index: 1600;
    width: min(390px, calc(100vw - 30px));
    overflow: hidden;
    color: var(--ink);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .42), transparent 54%),
        rgba(248, 249, 244, .94);
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 21px 6px 21px 6px;
    box-shadow: 0 28px 80px rgba(40, 52, 45, .2);
    backdrop-filter: blur(24px) saturate(.86);
    transform-origin: top right;
    animation: notificationEnter .2s ease both;
}

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

@keyframes notificationEnter {
    from { opacity: 0; transform: translateY(-8px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.notification-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 22px;
    width: 68px;
    height: 4px;
    background: var(--orange);
    border-radius: 0 0 4px 4px;
}

.notification-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 72px;
    padding: 15px 18px 13px 20px;
    border-bottom: 1px solid var(--line);
}

.notification-panel h2 {
    margin: 5px 0 0;
    font-family: var(--font-interface);
    font-size: 18px;
}

.notification-close {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    background: rgba(255, 255, 255, .42);
    cursor: pointer;
    font-size: 18px;
}

.notification-list {
    display: grid;
    padding: 7px 12px;
}

.notification-item {
    position: relative;
    display: grid;
    grid-template-columns: 11px 1fr auto;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 70px;
    padding: 11px 9px;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background .16s ease, transform .16s ease;
}

.notification-item:last-child {
    border-bottom: 0;
}

.notification-item:hover {
    background: rgba(255, 255, 255, .48);
    transform: translateX(2px);
}

.notification-item > i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 5px rgba(109, 181, 173, .1);
}

.notification-item > i.warning {
    background: var(--warning);
    box-shadow: 0 0 0 5px rgba(242, 179, 61, .1);
}

.notification-item > i.danger {
    background: var(--danger);
    box-shadow: 0 0 0 5px rgba(231, 104, 79, .1);
}

.notification-item strong,
.notification-item small {
    display: block;
}

.notification-item strong {
    font-family: var(--font-interface);
    font-size: 12px;
}

.notification-item small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.45;
}

.notification-item > b {
    color: var(--muted-2);
    font-size: 13px;
}

.notification-item:not(.unread) {
    opacity: .58;
}

.notification-item:not(.unread) > i {
    background: var(--muted-2);
    box-shadow: none;
}

.notification-panel > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 51px;
    padding: 9px 18px;
    background: rgba(229, 234, 225, .56);
    border-top: 1px solid var(--line);
}

.notification-panel > footer > span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 8px;
}

.notification-panel > footer button {
    padding: 0;
    border: 0;
    color: #668319;
    background: transparent;
    cursor: pointer;
    font-size: 9px;
    font-weight: 800;
}

.dark-theme .notice-button > span {
    border-color: rgba(24, 31, 28, .95);
}

.dark-theme .heading-status {
    color: #cad3cc;
    background: rgba(255, 255, 255, .045);
    border-color: rgba(255, 255, 255, .08);
}

.dark-theme .notice-button[aria-expanded="true"] {
    color: #252c23;
    background: var(--acid);
}

.dark-theme .notification-panel {
    background: linear-gradient(145deg, rgba(255, 255, 255, .025), transparent 54%), rgba(28, 35, 32, .96);
    border-color: rgba(255, 255, 255, .08);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .4);
}

.dark-theme .notification-close,
.dark-theme .notification-item:hover {
    background: rgba(255, 255, 255, .045);
}

.dark-theme .notification-panel > footer {
    background: rgba(255, 255, 255, .035);
}

@media (max-width: 700px) {
    .notification-panel {
        top: calc(var(--topbar-height) + 8px);
        right: 10px;
        width: calc(100vw - 20px);
    }

    .top-actions {
        display: flex;
    }

    .top-actions .icon-button:first-child {
        display: none;
    }
}

@media print {
    .sidebar,
    .topbar,
    .hero-actions,
    .module-toolbar,
    .button,
    .toast { display: none !important; }
    .app-stage { width: 100%; margin: 0; }
    main { padding: 0; }
    body { background: #fff; }
    .panel,
    .record-card { box-shadow: none; break-inside: avoid; }
}

/* Reference-led visual refinement: soft Rhine research campus atmosphere. */
:root {
    --acid: #b6db3a;
    --acid-strong: #91bb28;
    --acid-soft: rgba(182, 219, 58, .17);
    --cyan: #6db5ad;
    --orange: #e89b3a;
    --orange-soft: rgba(232, 155, 58, .14);
    --ink: #202724;
    --ink-2: #303936;
    --muted: #74807a;
    --muted-2: #9ba49f;
    --canvas: #e9ece5;
    --surface: rgba(250, 250, 246, .88);
    --surface-2: rgba(235, 239, 232, .78);
    --line: rgba(67, 79, 72, .13);
    --line-dark: rgba(54, 66, 59, .23);
    --sidebar: rgba(242, 243, 236, .91);
    --sidebar-ink: #222a26;
    --shadow: 0 22px 55px rgba(45, 58, 50, .09);
    --sidebar-width: 258px;
    --topbar-height: 78px;
}

body {
    background:
        radial-gradient(circle at 77% -12%, rgba(255, 255, 255, .96) 0 13%, rgba(255, 255, 255, 0) 42%),
        radial-gradient(ellipse at 54% 108%, rgba(171, 211, 54, .36) 0 9%, rgba(171, 211, 54, 0) 46%),
        linear-gradient(118deg, rgba(255, 255, 255, .6), transparent 38%),
        var(--canvas);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(118deg, transparent 0 18%, rgba(255, 255, 255, .34) 18.2% 18.45%, transparent 18.65%),
        linear-gradient(64deg, transparent 0 73%, rgba(75, 91, 81, .045) 73.1% 73.3%, transparent 73.5%),
        linear-gradient(rgba(48, 61, 53, .018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(48, 61, 53, .018) 1px, transparent 1px);
    background-size: auto, auto, 48px 48px, 48px 48px;
}

body::after {
    content: "";
    position: fixed;
    right: -16vw;
    bottom: -31vw;
    z-index: -1;
    width: 72vw;
    height: 58vw;
    min-width: 680px;
    min-height: 560px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, .52);
    border-radius: 50% 50% 0 0;
    background: radial-gradient(ellipse at 44% 12%, rgba(206, 226, 168, .38), rgba(163, 199, 68, .1) 43%, transparent 70%);
    filter: blur(2px);
}

.sidebar {
    color: var(--sidebar-ink);
    background:
        linear-gradient(155deg, rgba(255, 255, 255, .74), rgba(235, 239, 230, .76) 58%, rgba(216, 226, 202, .72)),
        var(--sidebar);
    border-right: 1px solid rgba(255, 255, 255, .72);
    box-shadow: 14px 0 46px rgba(45, 58, 50, .08);
    backdrop-filter: blur(24px) saturate(.85);
}

.sidebar::before {
    content: "";
    position: absolute;
    right: -115px;
    bottom: 12%;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(130, 163, 45, .13);
    border-radius: 50%;
    box-shadow:
        0 0 0 25px rgba(255, 255, 255, .12),
        0 0 0 54px rgba(150, 185, 57, .045);
    pointer-events: none;
}

.sidebar::after {
    content: "RHINE\A LIFE SCIENCE";
    right: -8px;
    bottom: 178px;
    color: rgba(34, 42, 38, .045);
    font-size: 36px;
}

.brand-lockup {
    min-height: 94px;
    border-bottom-color: rgba(58, 70, 63, .11);
}

.brand-lockup::after {
    color: rgba(50, 62, 55, .35);
}

.brand-mark {
    width: 50px;
    height: 36px;
    overflow: visible;
    color: var(--ink);
    background: transparent;
    clip-path: none;
}

.brand-mark::before,
.brand-mark::after {
    content: none;
}

.brand-mark span {
    position: relative;
    display: block;
    width: 48px;
    height: 28px;
}

.brand-mark span::before,
.brand-mark span::after {
    content: "";
    position: absolute;
    top: 3px;
    width: 21px;
    height: 21px;
    border: 4px solid currentColor;
    border-radius: 50% 50% 48% 52%;
}

.brand-mark span::before {
    left: 5px;
    border-right-color: transparent;
    transform: rotate(37deg);
}

.brand-mark span::after {
    right: 5px;
    border-left-color: transparent;
    transform: rotate(-37deg);
}

.brand-lockup strong {
    letter-spacing: .18em;
}

.brand-lockup small,
.facility-chip,
.nav-label,
.nav-item b,
.nav-code,
.system-status small,
.system-status b,
.back-link {
    color: #75817b;
}

.facility-chip {
    border-color: rgba(56, 69, 61, .13);
    background: rgba(255, 255, 255, .28);
    border-radius: 999px;
}

.facility-chip i {
    background: var(--acid-strong);
    box-shadow: 0 0 0 5px rgba(145, 187, 40, .1);
}

.primary-nav {
    gap: 5px;
    padding-right: 17px;
    padding-left: 17px;
}

.nav-item {
    color: #58635e;
    border-radius: 14px;
}

.nav-item::after {
    left: -17px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--acid-strong);
}

.nav-item:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, .52);
    box-shadow: 0 7px 18px rgba(50, 63, 55, .05);
}

.nav-item.active {
    color: #29301f;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, .62), transparent 48%),
        rgba(183, 215, 75, .6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .58),
        0 8px 24px rgba(117, 148, 35, .12);
}

.nav-item.active .nav-code {
    color: #657a27;
}

.sidebar-foot {
    border-top-color: rgba(56, 68, 61, .11);
    background: rgba(255, 255, 255, .18);
}

.system-status {
    background: rgba(255, 255, 255, .38);
    border: 1px solid rgba(255, 255, 255, .58);
    border-radius: 12px;
}

.system-status strong {
    color: var(--ink);
}

.system-status b {
    color: #698f15;
}

.back-link:hover {
    color: #607c1a;
}

.topbar {
    height: 78px;
    background: rgba(245, 247, 242, .72);
    border-bottom: 1px solid rgba(255, 255, 255, .74);
    box-shadow: 0 8px 30px rgba(48, 60, 53, .045);
    backdrop-filter: blur(22px) saturate(.82);
}

.breadcrumb span {
    color: #768976;
}

.global-search {
    height: 42px;
    padding: 0 13px;
    border: 1px solid rgba(63, 75, 68, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .48);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .68);
}

.global-search input {
    padding-left: 10px;
}

.global-search kbd {
    right: 10px;
    border-radius: 6px;
    background: rgba(226, 231, 222, .75);
}

.icon-button,
.menu-toggle {
    border-color: rgba(63, 75, 68, .12);
    border-radius: 50%;
    background: rgba(255, 255, 255, .46);
}

.avatar {
    color: #fff;
    background: #343c38;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(182, 219, 58, .16);
}

main {
    padding-top: calc(var(--topbar-height) + 34px);
}

.dashboard-hero {
    min-height: 224px;
    padding: 34px 170px 34px 42px;
    color: var(--ink);
    background:
        radial-gradient(circle at 84% 20%, rgba(255, 255, 255, .92), transparent 28%),
        radial-gradient(ellipse at 45% 118%, rgba(166, 204, 59, .55), rgba(166, 204, 59, 0) 53%),
        linear-gradient(126deg, rgba(255, 255, 255, .9), rgba(223, 229, 220, .86) 58%, rgba(196, 207, 187, .78));
    border: 1px solid rgba(255, 255, 255, .74);
    border-left: 0;
    border-radius: 30px 8px 30px 8px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .82),
        0 26px 70px rgba(47, 60, 52, .12);
}

.dashboard-hero::before {
    inset: auto 0 0;
    height: 46%;
    background: linear-gradient(180deg, transparent, rgba(148, 190, 35, .2));
    mask-image: none;
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(151, 193, 36, .76) 22% 75%, transparent);
}

.hero-copy {
    max-width: 690px;
}

.hero-copy h1 {
    color: #27302c;
    font-weight: 650;
    letter-spacing: -.045em;
}

.hero-copy > p:last-of-type {
    color: #5f6a65;
}

.hero-copy > p:last-of-type strong {
    color: #5d7d18;
}

.hero-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(410px, 100%);
    margin-top: 24px;
    color: rgba(60, 73, 65, .53);
    font: 700 8px/1 var(--font-interface);
    letter-spacing: .16em;
}

.hero-progress i {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 1px 0 rgba(69, 83, 75, .16);
}

.hero-actions .button.ghost {
    color: var(--ink);
    background: rgba(255, 255, 255, .32);
    border-color: rgba(58, 70, 63, .16);
}

.hero-actions .button.primary {
    background: rgba(43, 51, 47, .94);
    border-color: rgba(43, 51, 47, .94);
    color: #fff;
    box-shadow: 0 10px 25px rgba(36, 45, 40, .16);
}

.hero-atmosphere {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.light-arc {
    position: absolute;
    display: block;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 50%;
    box-shadow: 0 0 45px rgba(255, 255, 255, .24);
}

.arc-one {
    top: -235px;
    right: 40px;
    width: 430px;
    height: 430px;
}

.arc-two {
    right: -65px;
    bottom: -245px;
    width: 430px;
    height: 430px;
    border-color: rgba(126, 156, 51, .16);
}

.hero-atmosphere i {
    position: absolute;
    width: 36px;
    height: 40px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .5);
    clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}

.hero-atmosphere i:nth-of-type(1) { top: 30px; right: 275px; }
.hero-atmosphere i:nth-of-type(2) { top: 68px; right: 253px; }
.hero-atmosphere i:nth-of-type(3) { top: 106px; right: 275px; }
.hero-atmosphere i:nth-of-type(4) { top: 68px; right: 297px; }
.hero-atmosphere i:nth-of-type(5) { top: 144px; right: 253px; opacity: .55; }
.hero-atmosphere i:nth-of-type(6) { top: 144px; right: 297px; background: rgba(232, 155, 58, .12); border-color: rgba(232, 155, 58, .22); }

.hero-index {
    top: 18px;
    right: 18px;
    bottom: 18px;
    width: 118px;
    padding: 18px;
    color: #7a8680;
    background: rgba(255, 255, 255, .25);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 20px 5px 20px 5px;
    backdrop-filter: blur(10px);
}

.hero-index::before {
    background: repeating-linear-gradient(-45deg, transparent 0 9px, rgba(91, 111, 82, .035) 9px 10px);
}

.hero-index strong {
    color: #718e23;
    font-weight: 650;
}

.page-heading.technical-heading {
    min-height: 186px;
    padding: 30px 166px 30px 38px;
    color: var(--ink);
    background:
        linear-gradient(114deg, rgba(255, 255, 255, .86), rgba(236, 239, 232, .84) 57%, rgba(230, 224, 210, .78)),
        var(--surface);
    border: 1px solid rgba(255, 255, 255, .74);
    border-left: 0;
    border-radius: 25px 7px 25px 7px;
    box-shadow: var(--shadow);
}

.page-heading.technical-heading::before {
    inset: 0 0 0 auto;
    width: 46%;
    height: auto;
    background:
        linear-gradient(126deg, transparent 0 47%, rgba(232, 155, 58, .12) 47.5% 60%, transparent 60.5%),
        linear-gradient(rgba(72, 84, 76, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(72, 84, 76, .025) 1px, transparent 1px);
    background-size: auto, 28px 28px, 28px 28px;
    mask-image: none;
}

.page-heading.technical-heading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 38px;
    width: 82px;
    height: 4px;
    background: var(--orange);
    border-radius: 0 0 4px 4px;
}

.page-heading.technical-heading h1 {
    color: #27302c;
    font-weight: 650;
}

.page-heading.technical-heading > div > p:last-child {
    color: #65716b;
}

.heading-code {
    right: 30px;
    bottom: -16px;
    color: rgba(86, 102, 92, .07);
    font-weight: 650;
}

.button {
    border-radius: 999px;
}

.button.primary {
    background: var(--acid);
    border-color: rgba(137, 174, 35, .45);
    box-shadow: 0 9px 21px rgba(116, 150, 31, .12);
}

.technical-heading .button.primary {
    color: #fff;
    background: #303835;
    border-color: #303835;
}

.metrics-grid {
    gap: 16px;
    margin: 18px 0;
}

.metric-card,
.mini-metric {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .56), transparent 55%),
        var(--surface);
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 18px 5px 18px 5px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .72),
        0 14px 35px rgba(45, 57, 50, .055);
    backdrop-filter: blur(14px);
}

.metric-card {
    min-height: 142px;
    padding: 22px;
}

.metric-card:nth-child(2) .metric-icon,
.metric-card:nth-child(4) .metric-icon {
    background: var(--orange-soft);
    border-left-color: var(--orange);
}

.metric-card::after,
.record-card::after,
.sample-detail::after {
    color: rgba(54, 66, 59, .035);
    font-weight: 650;
}

.metric-icon,
.mini-metric i {
    border: 0;
    border-radius: 50%;
    background: rgba(182, 219, 58, .19);
}

.metric-value strong,
.mini-metric strong {
    font-weight: 650;
}

.dashboard-grid {
    gap: 18px;
}

.panel,
.record-card,
.protocol-card {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .3), transparent 48%),
        var(--surface);
    border: 1px solid rgba(255, 255, 255, .68);
    border-radius: 18px 5px 18px 5px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .63),
        0 16px 42px rgba(46, 58, 51, .06);
    backdrop-filter: blur(14px);
}

.panel-head {
    border-bottom-color: var(--line);
}

.square-button,
.row-arrow,
.row-action,
.date-switch button,
.timeline-task button,
.task-check,
.close-button,
.dialog-close {
    border-radius: 50%;
    background: rgba(255, 255, 255, .44);
}

.project-row:hover,
.data-table tbody tr:hover {
    background: rgba(255, 255, 255, .38);
}

.project-code {
    border: 0;
    border-radius: 12px 4px 12px 4px;
    background: linear-gradient(145deg, rgba(190, 222, 83, .38), rgba(190, 222, 83, .12));
}

.progress-track,
.amount-meter div {
    height: 5px;
    border-radius: 999px;
    background: rgba(83, 96, 88, .1);
}

.progress-track i,
.amount-meter i {
    border-radius: inherit;
    background: linear-gradient(90deg, #8eb428, #bfdc58);
}

.status-chip {
    border-radius: 999px;
}

.task-marker {
    border-radius: 50%;
    transform: none;
}

.full-link,
.module-toolbar,
.inline-search {
    background: rgba(255, 255, 255, .38);
    border-color: rgba(255, 255, 255, .64);
}

.full-link,
.module-toolbar {
    border-radius: 14px 4px 14px 4px;
}

.inline-search {
    border-radius: 999px;
}

.module-toolbar.in-panel {
    border-radius: 18px 5px 0 0;
}

.filter-tabs button {
    border-radius: 999px;
}

.filter-tabs button:hover,
.filter-tabs button.active {
    background: rgba(183, 215, 75, .25);
    border-color: rgba(151, 185, 57, .25);
}

.data-table th {
    background: rgba(225, 230, 222, .53);
}

.record-card,
.protocol-card {
    border-radius: 20px 6px 20px 6px;
}

.record-card:hover,
.protocol-card:hover {
    border-color: rgba(255, 255, 255, .92);
    box-shadow: 0 25px 65px rgba(46, 58, 51, .12);
    transform: translateY(-5px);
}

.protocol-card::before {
    width: 76px;
    height: 5px;
    border-radius: 0 0 5px 0;
    background: linear-gradient(90deg, var(--orange), #f1bf70);
}

.cryo-cell {
    border-color: rgba(72, 85, 77, .12);
    border-radius: 10px 3px 10px 3px;
    background: rgba(235, 239, 231, .72);
}

.cryo-cell.occupied {
    background: rgba(201, 210, 198, .74);
    border-color: rgba(82, 97, 88, .16);
}

.cryo-cell.selected {
    background: linear-gradient(145deg, #c5e36a, #9dc52d);
    border-color: #92b829;
    box-shadow: 0 8px 22px rgba(118, 151, 35, .24);
}

.sample-vial {
    border-radius: 4px 4px 13px 13px;
    background: linear-gradient(to top, rgba(109, 181, 173, .34) 0 42%, transparent 42%);
}

.timeline-task {
    border-left-width: 4px;
    border-radius: 4px 13px 13px 4px;
    background: rgba(236, 239, 232, .72);
}

.safety-note {
    border: 0;
    border-radius: 16px 5px 16px 5px;
    background:
        linear-gradient(135deg, rgba(232, 155, 58, .12), transparent 55%),
        #343c38;
}

.search-dialog,
.entry-dialog {
    overflow: hidden;
    border-top: 0;
    border-radius: 24px 7px 24px 7px;
    box-shadow: 0 40px 110px rgba(34, 43, 38, .3);
}

.search-dialog::before,
.entry-dialog::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    left: 25px;
    width: 74px;
    height: 5px;
    border-radius: 0 0 5px 5px;
    background: var(--acid);
}

.search-backdrop,
.entry-dialog::backdrop {
    background: rgba(38, 45, 41, .48);
    backdrop-filter: blur(14px) saturate(.7);
}

.form-field input,
.form-field select,
.form-field textarea {
    border-color: rgba(70, 82, 75, .15);
    border-radius: 10px 3px 10px 3px;
    background: rgba(235, 239, 232, .66);
}

.toast {
    border-left: 0;
    border-radius: 15px 4px 15px 4px;
    background: rgba(48, 57, 53, .93);
    backdrop-filter: blur(12px);
}

body.dark-theme {
    --ink: #edf2ec;
    --ink-2: #d4dcd6;
    --muted: #9ba7a0;
    --muted-2: #718078;
    --canvas: #171d1a;
    --surface: rgba(28, 35, 32, .87);
    --surface-2: rgba(35, 43, 39, .76);
    --line: rgba(229, 237, 230, .1);
    --line-dark: rgba(229, 237, 230, .18);
    --sidebar: rgba(28, 35, 32, .92);
    --sidebar-ink: #edf2ec;
    background:
        radial-gradient(circle at 75% -10%, rgba(90, 107, 97, .28), transparent 36%),
        radial-gradient(ellipse at 56% 112%, rgba(121, 156, 37, .22), transparent 44%),
        #171d1a;
}

.dark-theme .sidebar {
    background: linear-gradient(155deg, rgba(39, 47, 43, .97), rgba(25, 32, 29, .95));
    border-right-color: rgba(255, 255, 255, .07);
}

.dark-theme .brand-lockup,
.dark-theme .system-status strong,
.dark-theme .nav-item,
.dark-theme .back-link {
    color: #dfe6e0;
}

.dark-theme .brand-lockup small,
.dark-theme .facility-chip,
.dark-theme .nav-label,
.dark-theme .nav-item b,
.dark-theme .nav-code,
.dark-theme .system-status small {
    color: #84918a;
}

.dark-theme .nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, .06);
}

.dark-theme .nav-item.active {
    color: #242b21;
    background: rgba(182, 219, 58, .76);
}

.dark-theme .topbar {
    background: rgba(24, 31, 28, .75);
    border-bottom-color: rgba(255, 255, 255, .07);
}

.dark-theme .global-search,
.dark-theme .icon-button,
.dark-theme .menu-toggle,
.dark-theme .system-status {
    background: rgba(255, 255, 255, .045);
    border-color: rgba(255, 255, 255, .08);
}

.dark-theme .dashboard-hero {
    color: var(--ink);
    background:
        radial-gradient(circle at 84% 20%, rgba(102, 117, 108, .2), transparent 28%),
        radial-gradient(ellipse at 45% 118%, rgba(125, 161, 35, .36), transparent 52%),
        linear-gradient(126deg, rgba(47, 56, 51, .96), rgba(31, 39, 35, .95) 62%, rgba(37, 47, 41, .92));
    border-color: rgba(255, 255, 255, .08);
}

.dark-theme .hero-progress {
    color: rgba(238, 243, 237, .72);
}

.dark-theme .hero-copy h1,
.dark-theme .page-heading.technical-heading h1 {
    color: #eef3ed;
}

.dark-theme .hero-copy > p:last-of-type,
.dark-theme .page-heading.technical-heading > div > p:last-child {
    color: #aab5ae;
}

.dark-theme .hero-actions .button.ghost {
    color: #e9eee9;
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .12);
}

.dark-theme .hero-actions .button.primary,
.dark-theme .technical-heading .button.primary {
    color: #242b21;
    background: var(--acid);
    border-color: var(--acid);
}

.dark-theme .page-heading.technical-heading {
    color: var(--ink);
    background: linear-gradient(114deg, rgba(42, 50, 46, .96), rgba(28, 35, 32, .93));
    border-color: rgba(255, 255, 255, .08);
}

.dark-theme .metric-card,
.dark-theme .mini-metric,
.dark-theme .panel,
.dark-theme .record-card,
.dark-theme .protocol-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, .025), transparent 50%), var(--surface);
    border-color: rgba(255, 255, 255, .07);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .2);
}

.dark-theme .module-toolbar,
.dark-theme .inline-search,
.dark-theme .full-link,
.dark-theme .project-row:hover,
.dark-theme .data-table tbody tr:hover,
.dark-theme .data-table th,
.dark-theme .timeline-task {
    background: rgba(255, 255, 255, .035);
    border-color: rgba(255, 255, 255, .07);
}

.dark-theme .cryo-cell {
    background: rgba(255, 255, 255, .035);
    border-color: rgba(255, 255, 255, .07);
}

.dark-theme .cryo-cell.occupied {
    background: rgba(255, 255, 255, .09);
}

.dark-theme .form-field input,
.dark-theme .form-field select,
.dark-theme .form-field textarea {
    color: var(--ink);
    background: rgba(255, 255, 255, .045);
    border-color: rgba(255, 255, 255, .09);
}

@media (max-width: 1220px) {
    :root { --sidebar-width: 226px; }
}

@media (max-width: 960px) {
    :root { --sidebar-width: 258px; }
}

@media (max-width: 700px) {
    :root { --topbar-height: 64px; }

    .topbar { height: var(--topbar-height); }

    .dashboard-hero,
    .page-heading.technical-heading {
        padding: 27px 76px 26px 25px;
        border-radius: 22px 6px 22px 6px;
    }

    .hero-atmosphere i {
        opacity: .45;
    }

    .hero-index {
        top: 13px;
        right: 13px;
        bottom: 13px;
        width: 54px;
        padding: 7px;
        border-radius: 14px 4px 14px 4px;
    }

    .hero-index small,
    .hero-index span {
        display: none;
    }

    .hero-progress {
        width: 100%;
    }

    .metric-card,
    .mini-metric,
    .panel,
    .record-card,
    .protocol-card {
        border-radius: 15px 4px 15px 4px;
    }
}

/* Multi-box biobank, experiment usage ledger and photo-assisted intake. */
.freezer-manager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding: 12px;
    overflow: hidden;
}

.freezer-box-tabs {
    display: flex;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: thin;
}

.freezer-box-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 205px;
    padding: 11px 13px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px 4px 12px 4px;
    cursor: pointer;
    text-align: left;
}

.freezer-box-tab span,
.freezer-box-tab strong,
.freezer-box-tab small {
    display: block;
}

.freezer-box-tab strong {
    font-size: 11px;
}

.freezer-box-tab strong em {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 5px;
    color: #53661a;
    background: var(--acid-soft);
    border-radius: 999px;
    font-size: 7px;
    font-style: normal;
}

.freezer-box-tab small {
    max-width: 145px;
    margin-top: 5px;
    overflow: hidden;
    color: var(--muted);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.freezer-box-tab b {
    color: var(--muted);
    font-size: 9px;
    white-space: nowrap;
}

.freezer-box-tab.active {
    background: var(--acid-soft);
    border-color: var(--acid-strong);
    box-shadow: inset 4px 0 0 var(--acid-strong);
}

.freezer-manager-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.freezer-manager-actions .button {
    min-height: 38px;
    padding: 0 13px;
}

.record-card {
    width: 100%;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.record-usage-line {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
}

.record-usage-line strong {
    color: #667d26;
    white-space: nowrap;
}

.photo-badge,
.table-photo-mark {
    display: inline-block;
    margin-right: 5px;
    padding: 3px 5px;
    color: #526615;
    background: var(--acid-soft);
    border-radius: 999px;
    font-size: 7px;
    vertical-align: middle;
}

.sample-record-photo {
    display: block;
    width: min(100%, 220px);
    max-height: 150px;
    margin: 18px auto 22px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 14px 4px 14px 4px;
}

.experiment-detail-dialog,
.freezer-scan-dialog {
    width: min(880px, calc(100% - 28px));
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    background: rgba(248, 249, 244, .99);
    border: 0;
    border-radius: 24px 7px 24px 7px;
    box-shadow: 0 40px 110px rgba(34, 43, 38, .34);
}

.experiment-detail-dialog::backdrop,
.freezer-scan-dialog::backdrop {
    background: rgba(38, 45, 41, .52);
    backdrop-filter: blur(14px) saturate(.7);
}

.experiment-detail-dialog form,
.freezer-scan-dialog > article {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.experiment-detail-dialog header,
.experiment-detail-dialog footer,
.freezer-scan-dialog header,
.freezer-scan-dialog footer {
    position: sticky;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 22px;
    background: rgba(248, 249, 244, .95);
    backdrop-filter: blur(16px);
}

.experiment-detail-dialog header,
.freezer-scan-dialog header {
    top: 0;
    border-bottom: 1px solid var(--line);
}

.experiment-detail-dialog header::before,
.freezer-scan-dialog header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 24px;
    width: 76px;
    height: 5px;
    background: var(--acid-strong);
    border-radius: 0 0 5px 5px;
}

.experiment-detail-dialog footer,
.freezer-scan-dialog footer {
    bottom: 0;
    border-top: 1px solid var(--line);
    background: rgba(235, 239, 232, .97);
}

.experiment-detail-dialog footer > div {
    display: flex;
    gap: 8px;
}

.experiment-detail-dialog h2,
.freezer-scan-dialog h2 {
    margin: 6px 0 0;
    font-size: 22px;
}

.freezer-scan-dialog header small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 8px;
}

.experiment-detail-body,
.freezer-scan-body {
    padding: 22px;
}

.experiment-detail-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.experiment-detail-fields label {
    display: grid;
    gap: 7px;
}

.experiment-detail-fields label.full {
    grid-column: 1 / -1;
}

.experiment-detail-fields label > span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
}

.experiment-detail-fields select,
.experiment-detail-fields textarea {
    width: 100%;
    min-height: 43px;
    padding: 10px 12px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line-dark);
    border-radius: 10px 3px 10px 3px;
}

.experiment-detail-fields textarea {
    min-height: 92px;
    resize: vertical;
}

.experiment-usage-section,
.experiment-photo-panel {
    margin-top: 22px;
    padding: 18px;
    background: rgba(255, 255, 255, .38);
    border: 1px solid var(--line);
    border-radius: 15px 4px 15px 4px;
}

.experiment-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.experiment-section-head h3,
.experiment-photo-panel h3 {
    margin: 5px 0 0;
    font-size: 16px;
}

.usage-source-badge {
    padding: 7px 10px;
    color: #526718;
    background: var(--acid-soft);
    border: 1px solid rgba(148, 187, 42, .25);
    border-radius: 999px;
    font-size: 8px;
    font-weight: 900;
}

.usage-source-badge.modified {
    color: #8a521c;
    background: var(--orange-soft);
    border-color: rgba(232, 155, 58, .3);
}

.experiment-usage-help {
    margin: 12px 0 14px;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.65;
}

.experiment-usage-rows {
    display: grid;
    gap: 8px;
}

.experiment-reagent-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 105px 72px 34px;
    gap: 8px;
    align-items: center;
}

.experiment-reagent-row select,
.experiment-reagent-row input {
    width: 100%;
    min-height: 39px;
    padding: 8px 9px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px 3px 9px 3px;
}

.experiment-reagent-row > span {
    color: var(--muted);
    font-size: 8px;
}

.experiment-reagent-row > button {
    width: 34px;
    height: 34px;
    color: var(--danger);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
}

.experiment-usage-empty {
    margin: 0;
    padding: 20px;
    color: var(--muted);
    background: var(--surface-2);
    text-align: center;
    font-size: 9px;
}

.experiment-usage-section .add-reagent-row {
    margin-top: 10px;
}

.experiment-photo-panel {
    display: grid;
    grid-template-columns: 1fr minmax(160px, 250px);
    align-items: center;
    gap: 18px;
}

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

.experiment-photo-panel img {
    width: 100%;
    max-height: 170px;
    object-fit: cover;
    border-radius: 12px 4px 12px 4px;
}

#experimentUsageImpact {
    color: var(--muted);
    font-size: 9px;
}

#experimentUsageImpact.will-consume {
    color: #6b7e2d;
    font-weight: 900;
}

.photo-capture {
    display: grid;
    grid-template-columns: minmax(180px, .75fr) 1fr;
    gap: 10px;
}

.photo-capture-input {
    position: absolute;
    width: 1px !important;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.photo-capture-button,
.photo-capture-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    padding: 14px;
    overflow: hidden;
    border: 1px dashed var(--line-dark);
    border-radius: 13px 4px 13px 4px;
    text-align: center;
}

.photo-capture-button {
    flex-direction: column;
    cursor: pointer;
}

.photo-capture-button > span {
    font-size: 24px;
}

.photo-capture-button strong,
.photo-capture-button small {
    display: block;
}

.photo-capture-button strong {
    margin-top: 6px;
    color: var(--ink);
    font-size: 10px;
}

.photo-capture-button small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 8px;
    line-height: 1.5;
}

.photo-capture-preview {
    color: var(--muted);
    background: var(--surface-2);
    font-size: 9px;
}

.photo-capture-preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-capture-preview button {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 1;
    width: 27px;
    height: 27px;
    color: #fff;
    background: rgba(20, 25, 23, .72);
    border: 0;
    border-radius: 50%;
}

.photo-capture-status {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 8px;
}

.scan-upload {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 16px;
    color: var(--ink);
    background: var(--acid-soft);
    border: 1px dashed rgba(133, 169, 37, .5);
    border-radius: 13px 4px 13px 4px;
    cursor: pointer;
}

.scan-upload input {
    position: absolute;
    width: 1px;
    opacity: 0;
}

.scan-upload span {
    font-size: 11px;
    font-weight: 900;
}

.scan-upload small {
    color: var(--muted);
    font-size: 8px;
}

.scan-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
    gap: 16px;
    margin-top: 16px;
}

.scan-image-stage,
.scan-result-panel {
    min-height: 350px;
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 15px 4px 15px 4px;
}

.scan-image-stage {
    display: grid;
    place-items: center;
    overflow: hidden;
}

.scan-image-stage canvas {
    display: block;
    width: 100%;
    max-height: 410px;
    object-fit: contain;
}

.scan-image-stage canvas[hidden] {
    display: none;
}

.scan-image-stage p {
    max-width: 260px;
    color: var(--muted);
    text-align: center;
    font-size: 9px;
    line-height: 1.65;
}

.scan-control {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 7px 12px;
    align-items: center;
}

.scan-control label,
.scan-control span {
    font-size: 8px;
    font-weight: 800;
}

.scan-control span {
    grid-column: 1 / -1;
    color: var(--muted);
}

.scan-position-grid {
    display: grid;
    gap: 5px;
    margin-top: 14px;
}

.scan-position {
    aspect-ratio: 1;
    min-width: 0;
    padding: 0;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px 2px 5px 2px;
    cursor: pointer;
    font-size: 7px;
    font-weight: 900;
}

.scan-position.detected {
    color: #31420d;
    background: var(--acid);
    border-color: var(--acid-strong);
    box-shadow: 0 4px 10px rgba(142, 177, 42, .18);
}

.scan-position.occupied {
    color: #8b9690;
    background: #d9ded9;
    border-color: #c4cbc5;
    cursor: not-allowed;
}

.scan-result-panel > p {
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 8px;
    line-height: 1.55;
}

.dark-theme .freezer-box-tab,
.dark-theme .experiment-usage-section,
.dark-theme .experiment-photo-panel,
.dark-theme .scan-image-stage,
.dark-theme .scan-result-panel,
.dark-theme .scan-position {
    background: rgba(255, 255, 255, .035);
    border-color: rgba(255, 255, 255, .08);
}

.dark-theme .experiment-detail-dialog,
.dark-theme .freezer-scan-dialog,
.dark-theme .experiment-detail-dialog header,
.dark-theme .freezer-scan-dialog header {
    color: var(--ink);
    background: rgba(28, 35, 32, .98);
}

.dark-theme .experiment-detail-dialog footer,
.dark-theme .freezer-scan-dialog footer {
    background: rgba(35, 43, 39, .98);
}

.dark-theme .experiment-detail-fields select,
.dark-theme .experiment-detail-fields textarea,
.dark-theme .experiment-reagent-row select,
.dark-theme .experiment-reagent-row input {
    color: var(--ink);
    background: rgba(255, 255, 255, .045);
    border-color: rgba(255, 255, 255, .1);
}

@media (max-width: 800px) {
    .freezer-manager {
        align-items: stretch;
        flex-direction: column;
    }

    .freezer-manager-actions .button {
        flex: 1;
    }

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

    .scan-image-stage,
    .scan-result-panel {
        min-height: 280px;
    }
}

@media (max-width: 600px) {
    .experiment-detail-fields,
    .photo-capture,
    .experiment-photo-panel {
        grid-template-columns: 1fr;
    }

    .experiment-reagent-row {
        grid-template-columns: minmax(0, 1fr) 86px 32px;
    }

    .experiment-reagent-row > span {
        display: none;
    }

    .experiment-detail-dialog footer {
        align-items: stretch;
        flex-direction: column;
    }

    .experiment-detail-dialog footer > div,
    .freezer-scan-dialog footer .button {
        width: 100%;
    }

    .experiment-detail-dialog footer .button {
        flex: 1;
    }
}

/* Personal / lab-wide workspace scope. */
.workspace-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: rgba(92, 105, 98, .08);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.workspace-mode-toggle button {
    min-height: 30px;
    padding: 0 11px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}

.workspace-mode-toggle button.active {
    color: #273018;
    background: var(--acid);
    box-shadow: 0 4px 12px rgba(132, 164, 38, .16);
}

.workspace-scope-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
    padding: 18px 22px;
    color: #edf3e9;
    background:
        linear-gradient(110deg, rgba(216, 255, 69, .1), transparent 38%),
        linear-gradient(135deg, #303a35, #222a26);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 17px 5px 17px 5px;
    box-shadow: 0 16px 38px rgba(35, 45, 39, .12);
}

.workspace-scope-banner[hidden] {
    display: none;
}

.workspace-scope-banner h2 {
    margin: 6px 0 4px;
    font-size: 17px;
}

.workspace-scope-banner > div:first-child > span {
    color: #aeb9b2;
    font-size: 9px;
}

.workspace-scope-banner .micro-label {
    color: var(--acid);
}

.workspace-scope-stats {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.workspace-scope-stats > div {
    min-width: 88px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 11px 3px 11px 3px;
}

.workspace-scope-stats small,
.workspace-scope-stats strong {
    display: block;
}

.workspace-scope-stats small {
    color: #97a39c;
    font-size: 7px;
}

.workspace-scope-stats strong {
    margin-top: 5px;
    color: #f0f5ed;
    font-size: 17px;
}

.lab-workspace .freezer-box-tab.active {
    border-color: var(--cyan);
    box-shadow: inset 4px 0 0 var(--cyan);
}

.cryo-matrix {
    gap: 5px;
    padding: 20px;
}

.dark-theme .workspace-mode-toggle {
    background: rgba(255, 255, 255, .045);
    border-color: rgba(255, 255, 255, .08);
}

@media (max-width: 1100px) {
    .topbar {
        gap: 14px;
        padding-right: 18px;
        padding-left: 18px;
    }

    .workspace-mode-toggle button {
        padding: 0 8px;
    }
}

@media (max-width: 800px) {
    .workspace-scope-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-scope-stats > div {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 700px) {
    .workspace-mode-toggle {
        position: fixed;
        right: 82px;
        bottom: 14px;
        z-index: 1250;
        background: rgba(248, 250, 245, .94);
        box-shadow: 0 8px 28px rgba(34, 43, 38, .18);
        backdrop-filter: blur(12px);
    }

    .dark-theme .workspace-mode-toggle {
        background: rgba(31, 39, 35, .94);
    }

    .workspace-scope-stats {
        width: 100%;
    }

    .cryo-matrix {
        gap: 3px;
        padding: 12px;
    }
}

/* Installable app and cross-device synchronization. */
.sync-control {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 11px;
    color: var(--muted);
    background: rgba(255, 255, 255, .54);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
}

.sync-control > i {
    width: 7px;
    height: 7px;
    background: var(--muted-2);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(116, 128, 122, .1);
}

.sync-control[data-sync-state="connecting"] > i {
    background: var(--warning);
    animation: pulse 1.1s infinite;
}

.sync-control[data-sync-state="synced"] > i {
    background: var(--ok);
    box-shadow: 0 0 0 4px rgba(120, 184, 61, .14);
}

.sync-control[data-sync-state="readonly"] > i {
    background: var(--cyan);
    box-shadow: 0 0 0 4px rgba(109, 181, 173, .14);
}

.sync-control[data-sync-state="offline"] > i,
.sync-control[data-sync-state="warning"] > i,
.sync-control[data-sync-state="error"] > i {
    background: var(--orange);
    box-shadow: 0 0 0 4px rgba(232, 155, 58, .14);
}

.sync-dialog {
    width: min(620px, calc(100% - 28px));
    max-height: calc(100vh - 28px);
    padding: 0;
    overflow: hidden auto;
    color: var(--ink);
    background: rgba(248, 249, 244, .99);
    border: 0;
    border-radius: 24px 7px 24px 7px;
    box-shadow: 0 40px 110px rgba(34, 43, 38, .34);
}

.sync-dialog::backdrop {
    background: rgba(38, 45, 41, .52);
    backdrop-filter: blur(14px) saturate(.7);
}

.sync-dialog [hidden] {
    display: none !important;
}

.sync-dialog header,
.sync-dialog footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
}

.sync-dialog header {
    border-bottom: 1px solid var(--line);
}

.sync-dialog footer {
    justify-content: flex-end;
    flex-wrap: wrap;
    background: var(--surface-2);
    border-top: 1px solid var(--line);
}

.sync-dialog h2 {
    margin: 4px 0 0;
    font-size: 21px;
}

.sync-intro {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: center;
    gap: 18px;
    margin: 22px;
    padding: 20px;
    background: linear-gradient(125deg, rgba(182, 219, 58, .16), rgba(109, 181, 173, .08));
    border: 1px solid rgba(145, 187, 40, .22);
    border-radius: 18px 5px 18px 5px;
}

.sync-intro strong,
.sync-intro p {
    display: block;
    margin: 0;
}

.sync-intro p {
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.sync-orbit {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid rgba(32, 39, 36, .2);
    border-radius: 50%;
}

.sync-orbit::before,
.sync-orbit::after,
.sync-orbit i {
    content: "";
    position: absolute;
    border-radius: 50%;
}

.sync-orbit::before {
    inset: 10px;
    border: 1px dashed rgba(32, 39, 36, .3);
}

.sync-orbit::after {
    width: 12px;
    height: 12px;
    background: var(--acid);
    box-shadow: 0 0 0 5px rgba(182, 219, 58, .18);
}

.sync-orbit i {
    top: 6px;
    left: 24px;
    width: 8px;
    height: 8px;
    background: var(--cyan);
    transform-origin: 5px 23px;
    animation: sync-orbit 3.6s linear infinite;
}

@keyframes sync-orbit {
    to { transform: rotate(360deg); }
}

.sync-login-form {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 10px;
    padding: 0 22px 18px;
}

.sync-otp-form {
    padding-top: 0;
}

.sync-login-form label,
.sync-account > div {
    display: grid;
    gap: 7px;
}

.sync-login-form label > span,
.sync-account small {
    color: var(--muted);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .1em;
}

.sync-login-form input {
    min-height: 42px;
    padding: 0 13px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px 3px 10px 3px;
}

.sync-account {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 22px 18px;
}

.sync-account:not([hidden]) {
    display: grid;
}

.sync-account > div {
    padding: 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px 4px 12px 4px;
}

.sync-message {
    margin: 0;
    padding: 0 22px 22px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.7;
}

.workspace-readonly [data-add],
.workspace-readonly [data-task-check],
.workspace-readonly [data-scan-freezer],
.workspace-readonly [data-sample-position],
.workspace-readonly [data-add-reagent-row],
.workspace-readonly [data-add-experiment-reagent] {
    opacity: .46;
    cursor: not-allowed;
}

.workspace-readonly .day-timeline {
    cursor: not-allowed;
}

.dark-theme .sync-control,
.dark-theme .sync-dialog,
.dark-theme .sync-login-form input {
    color: var(--ink);
    background: rgba(31, 39, 35, .98);
    border-color: rgba(255, 255, 255, .09);
}

.dark-theme .sync-dialog header,
.dark-theme .sync-dialog footer,
.dark-theme .sync-account > div {
    background: rgba(255, 255, 255, .035);
    border-color: rgba(255, 255, 255, .08);
}

@media (max-width: 700px) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }

    main {
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

    .sync-control {
        min-width: 34px;
        min-height: 34px;
        padding: 0 9px;
    }

    .sync-control span {
        display: none;
    }

    .sync-dialog {
        width: calc(100% - 20px);
        max-height: calc(100dvh - 20px);
    }

    .sync-login-form,
    .sync-account {
        grid-template-columns: 1fr;
    }

    .sync-login-form .button {
        width: 100%;
    }
}

/* Click-through animal and reagent records. */
.clickable-data-row {
    cursor: pointer;
}

.clickable-data-row td {
    transition: background-color .18s ease;
}

.clickable-data-row:hover td,
.clickable-data-row:focus-visible td {
    background: rgba(182, 219, 58, .09);
}

.clickable-data-row:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: -2px;
}

.clickable-data-row .row-arrow {
    transform: translateX(-3px);
    transition: transform .18s ease, color .18s ease, background-color .18s ease;
}

.clickable-data-row:hover .row-arrow,
.clickable-data-row:focus-visible .row-arrow {
    color: #273018;
    background: var(--acid);
    transform: translateX(0);
}

.record-detail-dialog {
    width: min(780px, calc(100% - 28px));
    max-height: calc(100vh - 28px);
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    background: rgba(248, 249, 244, .99);
    border: 0;
    border-radius: 24px 7px 24px 7px;
    box-shadow: 0 40px 110px rgba(34, 43, 38, .34);
}

.record-detail-dialog::backdrop {
    background: rgba(38, 45, 41, .52);
    backdrop-filter: blur(14px) saturate(.7);
}

.delete-confirm-dialog {
    width: min(430px, calc(100% - 28px));
    padding: 0;
    color: var(--ink);
    background: var(--surface);
    border: 0;
    border-radius: 20px 5px 20px 5px;
    box-shadow: 0 34px 90px rgba(45, 31, 28, .36);
}

.delete-confirm-dialog::backdrop {
    background: rgba(38, 32, 30, .55);
    backdrop-filter: blur(9px);
}

.delete-confirm-dialog > article {
    padding: 26px;
}

.delete-confirm-mark {
    display: grid;
    width: 42px;
    height: 42px;
    margin-bottom: 19px;
    color: #fff;
    background: #b9493b;
    border-radius: 50%;
    box-shadow: 0 0 0 8px rgba(185, 73, 59, .09);
    place-items: center;
    font-size: 20px;
    font-weight: 900;
}

.delete-confirm-dialog h2 {
    margin: 7px 0 10px;
    font-size: 23px;
}

.delete-confirm-dialog article > p:not(.micro-label) {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.75;
}

.delete-confirm-dialog article > p strong {
    color: var(--ink);
}

.delete-confirm-dialog footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 23px;
}

.dark-theme .delete-confirm-dialog {
    color: var(--ink);
    background: #202824;
}

.record-detail-dialog > article {
    display: flex;
    max-height: calc(100vh - 28px);
    flex-direction: column;
}

.record-detail-dialog header,
.record-detail-dialog footer {
    position: sticky;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 22px;
    background: rgba(248, 249, 244, .96);
    backdrop-filter: blur(16px);
}

.record-detail-dialog header {
    top: 0;
    border-bottom: 1px solid var(--line);
}

.record-detail-dialog footer {
    bottom: 0;
    border-top: 1px solid var(--line);
}

.record-detail-dialog footer > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 9px;
}

.record-detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-detail-actions .button {
    min-height: 36px;
    padding: 0 14px;
    font-size: 10px;
}

.record-detail-dialog h2 {
    margin: 4px 0 0;
    font-size: 21px;
}

.record-detail-body {
    padding: 20px;
    overflow-y: auto;
}

.record-detail-hero {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    min-height: 148px;
    overflow: hidden;
    padding: 24px;
    color: #eef3ec;
    background:
        linear-gradient(110deg, rgba(216, 255, 69, .13), transparent 45%),
        linear-gradient(135deg, #303a35, #202825);
    border-radius: 18px 5px 18px 5px;
}

.record-detail-hero::after {
    content: "";
    position: absolute;
    right: -34px;
    bottom: -64px;
    width: 210px;
    height: 210px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    box-shadow: 0 0 0 30px rgba(255, 255, 255, .025), 0 0 0 60px rgba(255, 255, 255, .018);
}

.reagent-detail-hero {
    background:
        linear-gradient(110deg, rgba(232, 155, 58, .16), transparent 45%),
        linear-gradient(135deg, #343a35, #222825);
}

.record-detail-hero > * {
    position: relative;
    z-index: 1;
}

.record-detail-code {
    color: var(--acid);
    font: 900 9px/1.2 var(--font-interface);
    letter-spacing: .16em;
}

.record-detail-hero h3 {
    margin: 18px 0 7px;
    font-size: clamp(22px, 4vw, 32px);
}

.record-detail-hero p {
    margin: 0;
    color: #aeb9b2;
    font-size: 10px;
}

.record-detail-section {
    margin-top: 14px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px 5px 16px 5px;
}

.record-detail-section-title h3 {
    margin: 5px 0 15px;
    font-size: 15px;
}

.record-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

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

.record-detail-field {
    min-width: 0;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px 3px 10px 3px;
}

.record-detail-field.wide {
    grid-column: span 2;
}

.record-detail-field small,
.record-detail-field strong {
    display: block;
}

.record-detail-field small {
    color: var(--muted);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .08em;
}

.record-detail-field strong {
    margin-top: 7px;
    overflow-wrap: anywhere;
    font-size: 12px;
}

.record-timeline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.record-timeline article {
    position: relative;
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 9px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px 3px 10px 3px;
}

.record-timeline article > i {
    width: 8px;
    height: 8px;
    margin-top: 3px;
    background: var(--muted-2);
    border-radius: 50%;
}

.record-timeline article.active > i {
    background: var(--acid-strong);
    box-shadow: 0 0 0 4px var(--acid-soft);
}

.record-timeline small,
.record-timeline strong {
    display: block;
}

.record-timeline small {
    color: var(--muted);
    font-size: 8px;
}

.record-timeline strong {
    margin-top: 5px;
    font-size: 11px;
}

.record-detail-alert {
    display: flex;
    gap: 13px;
    margin-top: 14px;
    padding: 15px 17px;
    color: #644219;
    background: rgba(232, 155, 58, .13);
    border: 1px solid rgba(232, 155, 58, .28);
    border-radius: 13px 4px 13px 4px;
}

.record-detail-alert > span {
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    color: #fff;
    background: var(--orange);
    border-radius: 50%;
    place-items: center;
    font-weight: 900;
}

.record-detail-alert p {
    margin: 4px 0 0;
    font-size: 10px;
    line-height: 1.65;
}

.detail-stock-meter {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    margin-top: 13px;
}

.detail-stock-meter > div {
    height: 7px;
    overflow: hidden;
    background: var(--line);
    border-radius: 999px;
}

.detail-stock-meter > div > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--acid-strong), var(--acid));
    border-radius: inherit;
}

.detail-stock-meter > span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
}

.record-detail-photo {
    margin: 14px 0 0;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px 5px 16px 5px;
}

.record-detail-photo img {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    background: var(--surface-2);
    border-radius: 10px 3px 10px 3px;
}

.record-detail-photo figcaption {
    padding: 10px 4px 2px;
    color: var(--muted);
    font-size: 9px;
}

.sample-detail-hero {
    background:
        linear-gradient(110deg, rgba(98, 214, 208, .18), transparent 45%),
        linear-gradient(135deg, #303b39, #202927);
}

.record-history-list {
    display: grid;
    gap: 9px;
}

.record-history-item {
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px 3px 10px 3px;
}

.record-history-item > i {
    width: 7px;
    height: 7px;
    margin-top: 4px;
    background: var(--acid-strong);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--acid-soft);
}

.record-history-item header {
    position: static;
    padding: 0;
    background: transparent;
    border: 0;
    backdrop-filter: none;
}

.record-history-item header strong {
    font-size: 10px;
}

.record-history-item time {
    color: var(--muted);
    font: 700 8px/1.3 var(--font-interface);
}

.record-history-item p,
.record-history-empty {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.7;
}

.record-history-item p {
    display: block;
}

.record-history-item p > span {
    display: block;
    margin-top: 4px;
}

.record-history-item p em {
    color: var(--ink);
    font-style: normal;
    font-weight: 800;
}

.record-history-item del,
.record-history-item ins {
    display: inline;
    padding: 2px 5px;
    border-radius: 4px;
    text-decoration: none;
}

.record-history-item del {
    color: #986157;
    background: rgba(204, 76, 58, .08);
}

.record-history-item ins {
    color: #4f7012;
    background: var(--acid-soft);
}

.record-history-item p b {
    color: var(--muted-2);
    font-size: 8px;
}

.record-history-empty {
    padding: 13px;
    background: var(--surface-2);
    border: 1px dashed var(--line-dark);
    border-radius: 9px 3px 9px 3px;
}

.dark-theme .record-detail-dialog,
.dark-theme .record-detail-dialog header,
.dark-theme .record-detail-dialog footer {
    color: var(--ink);
    background: rgba(31, 39, 35, .98);
    border-color: rgba(255, 255, 255, .08);
}

.dark-theme .record-detail-section,
.dark-theme .record-detail-field,
.dark-theme .record-timeline article,
.dark-theme .record-detail-photo {
    background: rgba(255, 255, 255, .035);
    border-color: rgba(255, 255, 255, .08);
}

@media (max-width: 700px) {
    .record-detail-dialog {
        width: calc(100% - 20px);
        max-height: calc(100dvh - 20px);
    }

    .record-detail-dialog > article {
        max-height: calc(100dvh - 20px);
    }

    .record-detail-body {
        padding: 12px;
    }

    .record-detail-hero,
    .record-detail-section {
        padding: 16px;
    }

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

    .record-detail-field.wide {
        grid-column: 1 / -1;
    }

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

    .record-detail-dialog footer > span {
        display: none;
    }

    .record-detail-dialog footer {
        padding: 11px 12px;
    }

    .record-detail-actions {
        width: 100%;
    }

    .record-detail-actions .button {
        flex: 1 1 0;
        padding: 0 8px;
    }
}

/* Live experiment workspace */
.run-start-button,
.run-step-complete {
    color: #243018;
    background: var(--acid-soft);
    border-color: rgba(137, 174, 35, .42);
}

.run-start-button:hover,
.run-step-complete:hover {
    background: var(--acid);
}

.experiment-run-dialog {
    width: min(1240px, calc(100% - 24px));
    max-height: calc(100dvh - 24px);
    padding: 0;
    overflow: hidden;
    color: var(--ink);
    background: #f4f6f1;
    border: 0;
    border-radius: 26px 7px 26px 7px;
    box-shadow: 0 45px 130px rgba(30, 40, 35, .42);
}

.experiment-run-dialog::backdrop {
    background: rgba(30, 38, 34, .68);
    backdrop-filter: blur(16px) saturate(.7);
}

.experiment-run-dialog > article {
    display: flex;
    max-height: calc(100dvh - 24px);
    flex-direction: column;
}

.experiment-run-dialog > article > header,
.experiment-run-dialog > article > footer {
    position: sticky;
    z-index: 7;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 24px;
    background: rgba(247, 249, 244, .96);
    backdrop-filter: blur(18px);
}

.experiment-run-dialog > article > header {
    top: 0;
    border-bottom: 1px solid var(--line);
}

.experiment-run-dialog > article > header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 26px;
    width: 92px;
    height: 5px;
    background: var(--acid-strong);
    border-radius: 0 0 5px 5px;
}

.experiment-run-dialog > article > header > div:first-child {
    min-width: 0;
    margin-right: auto;
}

.experiment-run-dialog h2 {
    margin: 6px 0 3px;
    overflow: hidden;
    font-size: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.experiment-run-dialog > article > header small {
    color: var(--muted);
    font-size: 11px;
}

.run-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    color: #526914;
    background: var(--acid-soft);
    border: 1px solid rgba(145, 187, 40, .28);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.run-live-badge i {
    width: 8px;
    height: 8px;
    background: var(--acid-strong);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(145, 187, 40, .13);
    animation: pulse 1.6s ease-in-out infinite;
}

.experiment-run-body {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.run-step-rail {
    min-width: 0;
    padding: 20px 16px;
    background:
        linear-gradient(180deg, rgba(216, 255, 69, .07), transparent 34%),
        #e9ede6;
    border-right: 1px solid var(--line);
}

.run-step-rail-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    padding: 0 5px 14px;
}

.run-step-rail-head > strong {
    color: var(--muted);
    font-size: 11px;
}

.run-step-list {
    display: grid;
    gap: 7px;
}

.run-step-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    color: var(--ink);
    background: rgba(255, 255, 255, .44);
    border: 1px solid transparent;
    border-radius: 12px 4px 12px 4px;
    cursor: pointer;
    text-align: left;
}

.run-step-item:hover,
.run-step-item.active {
    background: rgba(255, 255, 255, .9);
    border-color: rgba(145, 187, 40, .3);
    box-shadow: 0 9px 22px rgba(44, 57, 49, .07);
}

.run-step-item.done {
    background: rgba(216, 255, 69, .14);
}

.run-step-item > span {
    display: grid;
    width: 30px;
    height: 30px;
    color: #63706b;
    background: #fff;
    border-radius: 50%;
    place-items: center;
    font: 900 10px/1 var(--font-interface);
}

.run-step-item.active > span,
.run-step-item.done > span {
    color: #283216;
    background: var(--acid);
}

.run-step-item strong,
.run-step-item small {
    display: block;
}

.run-step-item strong {
    overflow: hidden;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.run-step-item small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.run-step-item > i {
    color: var(--muted-2);
    font-style: normal;
}

.run-step-item.done > i {
    color: #719b18;
}

.run-step-workspace {
    min-width: 0;
    padding: 22px;
}

.run-current-step {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    color: #eff4ed;
    background:
        linear-gradient(115deg, rgba(216, 255, 69, .12), transparent 45%),
        linear-gradient(135deg, #323c37, #202825);
    border-radius: 18px 5px 18px 5px;
}

.run-current-step span {
    color: var(--acid);
    font: 900 10px/1.2 var(--font-interface);
    letter-spacing: .13em;
}

.run-current-step h3 {
    margin: 12px 0 6px;
    font-size: 22px;
}

.run-current-step p {
    margin: 0;
    color: #b6c0ba;
    font-size: 11px;
    line-height: 1.6;
}

.run-current-step > b {
    padding: 8px 11px;
    color: var(--acid);
    border: 1px solid rgba(216, 255, 69, .28);
    border-radius: 999px;
    font-size: 10px;
    white-space: nowrap;
}

.run-current-step > b.done {
    color: #263118;
    background: var(--acid);
}

.run-step-notes {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.run-step-notes > span,
.run-tool-card label > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.run-step-notes textarea,
.run-tool-card input,
.apparatus-tool select {
    width: 100%;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-dark);
    outline: 0;
    border-radius: 11px 4px 11px 4px;
}

.run-step-notes textarea {
    min-height: 82px;
    padding: 12px 14px;
    resize: vertical;
}

.run-step-notes textarea:focus,
.run-tool-card input:focus,
.apparatus-tool select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(98, 214, 208, .12);
}

.run-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.run-tool-card {
    min-width: 0;
    padding: 17px;
    background: rgba(255, 255, 255, .7);
    border: 1px solid var(--line);
    border-radius: 16px 5px 16px 5px;
}

.run-tool-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.run-tool-card h4 {
    margin: 5px 0 0;
    font-size: 16px;
}

.run-tool-card > p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.6;
}

.tool-status-dot {
    width: 10px;
    height: 10px;
    background: var(--muted-2);
    border-radius: 50%;
}

.tool-status-dot.active {
    background: var(--acid-strong);
    box-shadow: 0 0 0 5px var(--acid-soft);
}

.run-timer-display {
    display: block;
    margin: 20px 0;
    color: #26302c;
    font: 700 clamp(28px, 4vw, 42px)/1 var(--font-interface);
    letter-spacing: .05em;
}

.run-tool-actions {
    display: flex;
    gap: 7px;
}

.run-tool-actions button,
.calculator-tool > button,
.apparatus-legend button {
    min-height: 33px;
    padding: 0 12px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.run-tool-actions button:first-child,
.calculator-tool > button {
    background: var(--acid-soft);
    border-color: rgba(145, 187, 40, .28);
}

.calculator-tool > header > span {
    color: #70811f;
    font: 800 13px/1 var(--font-interface);
}

.calculator-tool label {
    display: grid;
    gap: 7px;
    margin-top: 18px;
}

.calculator-tool input {
    min-height: 42px;
    padding: 9px 11px;
}

.calculator-tool > button {
    margin-top: 9px;
}

.calculator-tool output {
    display: block;
    min-height: 48px;
    margin-top: 10px;
    padding: 13px;
    color: #3e5614;
    background: var(--acid-soft);
    border-radius: 10px 3px 10px 3px;
    font-size: 16px;
    font-weight: 900;
}

.apparatus-tool {
    grid-column: 1 / -1;
}

.apparatus-tool select {
    width: auto;
    min-height: 37px;
    padding: 7px 10px;
    font-size: 11px;
}

.apparatus-legend {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 15px 0 11px;
    color: var(--muted);
    font-size: 10px;
}

.apparatus-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.apparatus-legend i {
    width: 10px;
    height: 10px;
    border: 1px solid var(--line-dark);
    border-radius: 50%;
}

.apparatus-legend i.sample { background: var(--cyan); }
.apparatus-legend i.control { background: var(--acid-strong); }
.apparatus-legend i.blank { background: var(--orange); }
.apparatus-legend button { margin-left: auto; }

.apparatus-grid {
    display: grid;
    gap: 5px;
    padding: 14px;
    overflow-x: auto;
    background:
        linear-gradient(rgba(52, 65, 57, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(52, 65, 57, .025) 1px, transparent 1px),
        #edf0ea;
    background-size: 18px 18px;
    border: 1px solid var(--line);
    border-radius: 14px 4px 14px 4px;
}

.apparatus-cell {
    display: grid;
    min-width: 24px;
    aspect-ratio: 1;
    padding: 0;
    color: var(--muted);
    background: rgba(255, 255, 255, .78);
    border: 1px solid var(--line-dark);
    cursor: pointer;
    place-items: center;
    font: 800 7px/1 var(--font-interface);
}

.apparatus-cell.round { border-radius: 50%; }
.apparatus-cell.slot { aspect-ratio: 1.45; border-radius: 3px; }
.apparatus-cell.square { border-radius: 3px; }
.apparatus-cell.sample { color: #173d3b; background: rgba(98, 214, 208, .74); border-color: #4cb8b3; }
.apparatus-cell.control { color: #31420e; background: rgba(185, 235, 34, .76); border-color: #8fb720; }
.apparatus-cell.blank { color: #694418; background: rgba(242, 179, 61, .68); border-color: #d19429; }

.experiment-run-dialog > article > footer {
    bottom: 0;
    justify-content: space-between;
    border-top: 1px solid var(--line);
}

.run-progress-summary {
    display: grid;
    gap: 7px;
    width: min(260px, 24vw);
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
}

.run-progress-summary > div {
    height: 6px;
    overflow: hidden;
    background: var(--line);
    border-radius: 999px;
}

.run-progress-summary i {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--acid-strong), var(--acid));
    border-radius: inherit;
    transition: width .25s ease;
}

.run-footer-actions {
    display: flex;
    gap: 8px;
}

.run-step-complete.completed {
    color: #8a521c;
    background: var(--orange-soft);
    border-color: rgba(232, 155, 58, .28);
}

.schedule-overlap-note {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 15px;
    color: #43551d;
    background: var(--acid-soft);
    border: 1px solid rgba(145, 187, 40, .25);
    border-radius: 12px 4px 12px 4px;
}

.schedule-overlap-note > span {
    font-size: 20px;
}

.schedule-overlap-note strong {
    font-size: 12px;
}

.schedule-overlap-note p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.dark-theme .experiment-run-dialog,
.dark-theme .experiment-run-dialog > article > header,
.dark-theme .experiment-run-dialog > article > footer {
    color: var(--ink);
    background: rgba(29, 37, 33, .98);
    border-color: rgba(255, 255, 255, .08);
}

.dark-theme .run-step-rail,
.dark-theme .run-tool-card,
.dark-theme .apparatus-grid {
    background-color: rgba(255, 255, 255, .035);
    border-color: rgba(255, 255, 255, .08);
}

.dark-theme .run-step-item {
    background: rgba(255, 255, 255, .035);
}

.dark-theme .run-step-item:hover,
.dark-theme .run-step-item.active {
    background: rgba(255, 255, 255, .075);
}

.dark-theme .run-timer-display {
    color: var(--ink);
}

/* Final typography scale: all operational and dialog text is deliberately readable. */
body {
    font-size: 15px;
}

html[lang="en"] body,
html[lang="en"] button,
html[lang="en"] input,
html[lang="en"] select,
html[lang="en"] textarea,
html[lang="en"] .schedule-block strong {
    font-family: var(--font-interface);
}

html[lang="en"] .nav-label,
html[lang="en"] .micro-label,
html[lang="en"] .eyebrow,
html[lang="en"] .nav-item b,
html[lang="en"] .nav-code,
html[lang="en"] .breadcrumb span,
html[lang="en"] .breadcrumb i,
html[lang="en"] .data-table th,
html[lang="en"] .calendar-time-label,
html[lang="en"] .run-step-item > span,
html[lang="en"] .run-current-step span,
html[lang="en"] .apparatus-cell,
html[lang="en"] .language-dock-label,
html[lang="en"] .record-detail-code {
    font-family: var(--font-interface);
}

.nav-item { font-size: 16px; }
.nav-item b { font-size: 9.5px; }
.nav-code { font-size: 11px; }
.breadcrumb { font-size: 12px; }
.breadcrumb span,
.breadcrumb i { font-size: 10px; }
.global-search input,
.inline-search input { font-size: 14px; }
.button { font-size: 14px; }
.nav-label,
.micro-label,
.eyebrow { font-size: 10.5px; }
.page-heading > div > p:last-child,
.hero-copy > p:last-child { font-size: 14px; }
.metric-value span,
.metric-delta,
.today-item small,
.project-row p,
.project-progress small { font-size: 10.5px; }
.data-table th { font-size: 10px; }
.data-table td { font-size: 13px; }
.data-table small { font-size: 10px; }
.mini-metric small { font-size: 11px; }
.schedule-block strong { font-size: 13px; }
.schedule-block small,
.calendar-time-label,
.drag-hint { font-size: 10px; }
.form-field label,
.experiment-detail-fields label > span { font-size: 11px; }
.form-field input,
.form-field select,
.form-field textarea,
.experiment-detail-fields select,
.experiment-detail-fields textarea,
.experiment-reagent-row select,
.experiment-reagent-row input { font-size: 14px; }
.field-note,
.entry-dialog footer p,
.experiment-usage-help,
.experiment-reagent-row > span,
.experiment-detail-dialog footer > span,
.freezer-scan-dialog header small { font-size: 10.5px; }
.usage-source-badge,
.photo-badge,
.table-photo-mark { font-size: 10px; }
.record-detail-dialog h2,
.experiment-detail-dialog h2,
.freezer-scan-dialog h2,
.entry-dialog h2,
.sync-dialog h2 { font-size: 24px; }
.record-detail-field small,
.detail-list dt,
.record-history-item time { font-size: 10px; }
.record-detail-field strong { font-size: 14px; }
.detail-list dd,
.record-timeline strong,
.record-history-item p,
.record-history-empty,
.record-detail-photo figcaption { font-size: 11px; }
.record-detail-dialog footer > span,
.record-detail-actions .button { font-size: 11px; }
.sync-intro p,
.sync-message,
.sync-account small,
.sync-login-form label span { font-size: 11px; }
.notice-button > span { font-size: 9px; }
.language-dock-label,
.protocol-flow-phase header small,
.freezer-box-tab strong em,
.photo-badge,
.table-photo-mark,
.scan-position,
.workspace-scope-stats small { font-size: 9px; }
.record-detail-code { font-size: 10px; }
.apparatus-cell { font-size: 8.5px; }

@media (max-width: 820px) {
    .experiment-run-body {
        grid-template-columns: 1fr;
    }

    .run-step-rail {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .run-step-list {
        display: flex;
        max-width: 100%;
        padding-bottom: 5px;
        overflow-x: auto;
    }

    .run-step-item {
        min-width: 230px;
    }

    .experiment-run-dialog > article > footer {
        align-items: stretch;
        flex-direction: column;
    }

    .run-progress-summary {
        width: 100%;
    }

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

@media (max-width: 560px) {
    body { font-size: 15px; }
    .button { font-size: 13px; }
    .experiment-run-dialog { width: calc(100% - 10px); max-height: calc(100dvh - 10px); }
    .experiment-run-dialog > article { max-height: calc(100dvh - 10px); }
    .experiment-run-dialog > article > header { padding: 15px 14px; }
    .experiment-run-dialog h2 { font-size: 19px; }
    .run-live-badge { display: none; }
    .run-step-rail { padding: 14px 10px; }
    .run-step-workspace { padding: 12px; }
    .run-current-step { padding: 16px; }
    .run-current-step h3 { font-size: 18px; }
    .run-tool-grid { grid-template-columns: 1fr; }
    .apparatus-tool { grid-column: auto; }
    .apparatus-grid { padding: 10px; gap: 4px; }
    .apparatus-cell { min-width: 22px; font-size: 7.5px; }
    .apparatus-legend { flex-wrap: wrap; }
    .apparatus-legend button { margin-left: 0; }
    .experiment-run-dialog > article > footer { padding: 11px 12px; }
    .run-footer-actions { grid-template-columns: 1fr 1fr; }
    .run-footer-actions .button { min-height: 38px; padding: 0 8px; font-size: 11px; }
}

/* Larger detail typography, scientific tools and cell-culture workspace. */
.protocol-detail-dialog {
    width: min(1040px, calc(100% - 32px));
}

.protocol-detail-dialog h2,
.record-detail-dialog h2,
.experiment-detail-dialog h2,
.entry-dialog h2,
.freezer-scan-dialog h2 {
    font-size: 30px;
    line-height: 1.2;
}

.protocol-detail-dialog .micro-label,
.record-detail-dialog .micro-label,
.experiment-detail-dialog .micro-label,
.entry-dialog .micro-label,
.freezer-scan-dialog .micro-label,
.experiment-run-dialog .micro-label {
    font-size: 14px;
    line-height: 1.4;
}

.protocol-detail-body {
    padding: 30px;
}

.protocol-detail-summary {
    padding: 22px 24px;
    font-size: 18px;
    line-height: 1.8;
}

.protocol-detail-body h3 {
    margin-top: 10px;
    font-size: 22px;
}

.protocol-flow-phase header strong {
    font-size: 17px;
}

.protocol-flow-phase header small {
    font-size: 13px;
}

.protocol-flow-node {
    min-height: 74px;
    padding: 18px 18px 18px 30px;
}

.protocol-flow-node p {
    font-size: 17px;
    line-height: 1.6;
}

.protocol-usage-table th {
    font-size: 15px;
}

.protocol-usage-table td {
    padding: 17px 18px;
    font-size: 18px;
}

.protocol-usage-table strong {
    font-size: 18px;
}

.protocol-usage-table small,
.protocol-detail-dialog footer > span,
.protocol-no-reagent {
    font-size: 15px;
}

.protocol-detail-dialog footer .button {
    min-height: 46px;
    font-size: 15px;
}

.record-detail-dialog {
    width: min(980px, calc(100% - 30px));
}

.record-detail-body {
    padding: 26px;
}

.record-detail-code {
    font-size: 15px;
}

.record-detail-hero h3 {
    font-size: clamp(28px, 4vw, 38px);
}

.record-detail-hero p {
    font-size: 17px;
    line-height: 1.55;
}

.record-detail-section {
    padding: 25px;
}

.record-detail-section-title h3 {
    font-size: 23px;
}

.record-detail-field {
    padding: 16px;
}

.record-detail-field small,
.detail-list dt,
.record-timeline small,
.record-history-item time {
    font-size: 15px;
    line-height: 1.4;
}

.record-detail-field strong,
.detail-list dd {
    margin-top: 9px;
    font-size: 19px;
    line-height: 1.5;
}

.record-timeline strong,
.record-history-item header strong {
    font-size: 18px;
}

.record-history-item p,
.record-history-empty,
.record-detail-alert p,
.record-detail-photo figcaption,
.detail-stock-meter > span,
.record-detail-dialog footer > span {
    font-size: 16px;
    line-height: 1.65;
}

.record-detail-dialog .status-chip {
    min-height: 27px;
    padding: 0 11px;
    font-size: 13px;
}

.record-detail-actions .button {
    min-height: 44px;
    padding-inline: 18px;
    font-size: 16px;
}

.experiment-detail-dialog {
    width: min(1020px, calc(100% - 30px));
}

.experiment-detail-fields label > span,
.form-field > label,
.run-step-notes > span,
.calculator-tool label > span {
    font-size: 16px;
}

.experiment-detail-fields select,
.experiment-detail-fields textarea,
.experiment-reagent-row select,
.experiment-reagent-row input,
.form-field input,
.form-field select,
.form-field textarea {
    font-size: 18px;
}

.experiment-usage-help,
.experiment-reagent-row > span,
.experiment-detail-dialog footer > span,
.field-note,
.entry-dialog footer p,
.photo-capture-status,
.photo-capture-button small {
    font-size: 15px;
    line-height: 1.55;
}

.experiment-section-head h3,
.experiment-photo-panel h3 {
    font-size: 21px;
}

.usage-source-badge,
.photo-badge,
.table-photo-mark {
    font-size: 12px;
}

.run-current-step h3 {
    font-size: 26px;
}

.run-current-step p,
.run-tool-card > p,
.run-step-photos > small,
.apparatus-tool > p {
    font-size: 16px;
    line-height: 1.65;
}

.run-step-notes textarea,
.calculator-tool input,
.calculator-tool select {
    font-size: 18px;
}

.run-tool-card h4,
.run-step-photos h4 {
    font-size: 22px;
}

.run-tool-actions button,
.calculator-tool button,
.apparatus-legend,
.apparatus-tool select {
    font-size: 13px;
}

.run-step-item strong {
    font-size: 15px;
}

.run-step-item small,
.run-step-rail-head strong,
.run-current-step > b {
    font-size: 12px;
}

.run-step-photos {
    margin-top: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px 5px 16px 5px;
}

.run-step-photos > header,
.run-step-photos > header > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.run-step-photos h4 {
    margin: 4px 0 0;
}

.run-photo-add {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 0 15px;
    color: #344314;
    background: var(--acid-soft);
    border: 1px dashed rgba(127, 166, 29, .45);
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
}

.run-photo-add input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.run-step-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0 10px;
}

.run-step-photo-grid > p {
    grid-column: 1 / -1;
    margin: 0;
    padding: 18px;
    color: var(--muted);
    background: var(--surface-2);
    border-radius: 10px 3px 10px 3px;
    font-size: 14px;
    text-align: center;
}

.run-step-photo-grid figure {
    position: relative;
    margin: 0;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px 4px 12px 4px;
}

.run-step-photo-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.run-step-photo-grid figcaption {
    padding: 9px 10px;
    color: var(--muted);
    font-size: 12px;
}

.run-step-photo-grid button {
    position: absolute;
    top: 7px;
    right: 7px;
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    color: #fff;
    background: rgba(32, 39, 36, .82);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    place-items: center;
    font-size: 18px;
}

.scientific-calculator {
    min-width: 0;
}

.scientific-calculator header select {
    min-height: 34px;
    padding: 0 9px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px 3px 8px 3px;
    font-weight: 900;
}

.scientific-keypad {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    margin-top: 11px;
}

.scientific-keypad button {
    min-height: 34px;
    padding: 0 5px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px 3px 8px 3px;
    cursor: pointer;
    font-weight: 850;
}

.scientific-keypad button:hover {
    background: var(--acid-soft);
    border-color: rgba(127, 166, 29, .35);
}

.scientific-keypad .key-action {
    background: rgba(232, 155, 58, .12);
}

.scientific-keypad .key-action.danger {
    color: var(--danger);
    background: rgba(224, 92, 78, .1);
}

.calculator-result-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
}

.calculator-result-row output {
    display: flex;
    min-height: 40px;
    align-items: center;
    padding: 8px 12px;
    overflow-wrap: anywhere;
    font-size: 16px;
}

.cell-maintenance-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.cell-maintenance-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(300px, .75fr);
    gap: 16px;
}

.cell-culture-panel,
.cell-action-board {
    min-width: 0;
}

.cell-culture-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    padding: 16px;
}

.cell-culture-card {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 16px;
    width: 100%;
    padding: 16px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px 5px 18px 5px;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.cell-culture-card:hover,
.cell-culture-card:focus-visible {
    border-color: rgba(143, 183, 32, .5);
    box-shadow: 0 18px 36px rgba(51, 66, 53, .1);
    transform: translateY(-2px);
}

.cell-culture-card.due {
    border-color: rgba(232, 155, 58, .38);
    background: linear-gradient(135deg, rgba(232, 155, 58, .07), var(--surface) 42%);
}

.cell-culture-thumb {
    display: grid;
    width: 94px;
    height: 112px;
    overflow: hidden;
    color: #4d6216;
    background: radial-gradient(circle at 30% 30%, rgba(216, 255, 69, .7), rgba(117, 150, 33, .16));
    border: 1px solid rgba(143, 183, 32, .24);
    border-radius: 16px 5px 16px 5px;
    place-items: center;
    font-size: 22px;
    font-weight: 900;
}

.cell-culture-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cell-culture-top,
.cell-container-line,
.cell-confluence > span,
.cell-culture-main footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cell-culture-main h3 {
    margin: 10px 0 4px;
    font-size: 21px;
}

.cell-culture-main > p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.cell-container-line {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.cell-container-line span,
.cell-confluence b,
.cell-culture-main footer span {
    color: var(--muted);
}

.cell-confluence {
    margin-top: 12px;
}

.cell-confluence > span {
    font-size: 13px;
}

.cell-confluence > div {
    height: 7px;
    margin-top: 7px;
    overflow: hidden;
    background: var(--line);
    border-radius: 999px;
}

.cell-confluence i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--acid-strong), var(--acid));
}

.cell-culture-main footer {
    margin-top: 13px;
    font-size: 12px;
}

.cell-culture-main footer > strong {
    color: #69851f;
}

.cell-action-board {
    padding: 22px;
}

.cell-action-board h2 {
    margin: 7px 0 18px;
    font-size: 22px;
}

#cellMaintenanceQueue {
    display: grid;
    gap: 8px;
}

.cell-queue-item {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 12px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 11px 4px 11px 4px;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.cell-queue-item time {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.cell-queue-item strong,
.cell-queue-item small {
    display: block;
}

.cell-queue-item strong {
    font-size: 14px;
}

.cell-queue-item small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.cell-queue-item.due > b {
    color: var(--orange);
}

.cell-workspace-note {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    background: var(--acid-soft);
    border-radius: 13px 4px 13px 4px;
}

.cell-workspace-note > span {
    font-size: 25px;
}

.cell-workspace-note strong {
    font-size: 14px;
}

.cell-workspace-note p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.cell-detail-hero {
    background: linear-gradient(110deg, rgba(98, 214, 208, .16), transparent 45%), linear-gradient(135deg, #2e3c37, #1f2825);
}

.passage-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.cell-passage-list {
    display: grid;
    gap: 12px;
}

.cell-passage-entry {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 13px 4px 13px 4px;
}

.cell-passage-date time,
.cell-passage-date span {
    display: block;
}

.cell-passage-date time {
    color: var(--muted);
    font-size: 13px;
}

.cell-passage-date span {
    margin-top: 9px;
    color: #516717;
    font-size: 17px;
    font-weight: 900;
}

.cell-passage-content header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cell-passage-content header strong {
    font-size: 21px;
}

.cell-passage-content header span {
    font-size: 14px;
    font-weight: 850;
}

.cell-passage-content dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 13px 0;
}

.cell-passage-content dl > div {
    padding: 11px;
    background: var(--surface);
    border-radius: 8px 3px 8px 3px;
}

.cell-passage-content dt {
    color: var(--muted);
    font-size: 12px;
}

.cell-passage-content dd {
    margin: 6px 0 0;
    font-size: 14px;
    font-weight: 850;
}

.cell-passage-content > p {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
}

.cell-passage-content > img {
    width: min(100%, 420px);
    max-height: 260px;
    margin-top: 13px;
    object-fit: cover;
    border-radius: 10px 3px 10px 3px;
}

.clear-workspace-button {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 12px 4px 12px 4px;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.clear-workspace-button > span:first-child {
    display: grid;
    width: 30px;
    height: 30px;
    color: var(--danger);
    background: rgba(224, 92, 78, .09);
    border-radius: 50%;
    place-items: center;
    font-size: 17px;
}

.clear-workspace-button strong,
.clear-workspace-button small {
    display: block;
}

.clear-workspace-button strong {
    font-size: 12px;
}

.clear-workspace-button small {
    margin-top: 3px;
    font-size: 10px;
}

.clear-workspace-dialog {
    width: min(520px, calc(100% - 28px));
    padding: 0;
    color: var(--ink);
    background: var(--surface);
    border: 0;
    border-radius: 22px 6px 22px 6px;
    box-shadow: 0 34px 90px rgba(45, 31, 28, .4);
}

.clear-workspace-dialog::backdrop {
    background: rgba(38, 45, 41, .62);
    backdrop-filter: blur(14px) saturate(.7);
}

.clear-workspace-dialog article {
    padding: 30px;
}

.clear-workspace-mark {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 18px;
    color: #fff;
    background: var(--danger);
    border-radius: 50%;
    place-items: center;
    font-size: 28px;
    font-weight: 900;
}

.clear-workspace-dialog h2 {
    margin: 8px 0 12px;
    font-size: 28px;
}

.clear-workspace-dialog article > p:not(.micro-label) {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.75;
}

.clear-workspace-dialog label span {
    display: block;
    margin: 20px 0 8px;
    font-size: 14px;
    font-weight: 850;
}

.clear-workspace-dialog input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line-dark);
    border-radius: 10px 3px 10px 3px;
    font: 800 16px/1 var(--font-interface);
    letter-spacing: .08em;
}

.clear-workspace-dialog footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 24px;
}

.workspace-readonly [data-add-passage],
.workspace-readonly [data-open-clear-workspace] {
    display: none !important;
}

.dark-theme .cell-culture-card,
.dark-theme .cell-passage-entry,
.dark-theme .run-step-photos,
.dark-theme .clear-workspace-dialog {
    background-color: rgba(29, 37, 33, .98);
    border-color: rgba(255, 255, 255, .09);
}

@media (max-width: 1120px) {
    .cell-maintenance-layout { grid-template-columns: 1fr; }
    .cell-action-board { order: -1; }
    #cellMaintenanceQueue { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .cell-maintenance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cell-culture-grid { grid-template-columns: 1fr; }
    .run-step-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .record-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cell-passage-entry { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .protocol-detail-dialog,
    .record-detail-dialog,
    .experiment-detail-dialog,
    .entry-dialog { width: calc(100% - 10px); }
    .protocol-detail-dialog h2,
    .record-detail-dialog h2,
    .experiment-detail-dialog h2,
    .entry-dialog h2 { font-size: 23px; }
    .protocol-detail-body,
    .record-detail-body { padding: 16px; }
    .protocol-detail-summary { font-size: 16px; }
    .protocol-flow-node p,
    .protocol-usage-table td { font-size: 16px; }
    .record-detail-grid { grid-template-columns: 1fr; }
    .record-detail-field.wide { grid-column: auto; }
    .record-detail-field small { font-size: 14px; }
    .record-detail-field strong { font-size: 18px; }
    .record-detail-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
    .record-detail-dialog footer { align-items: stretch; flex-direction: column; }
    .record-detail-dialog footer > span { display: none; }
    .record-detail-actions .button { padding-inline: 7px; font-size: 14px; }
    .run-step-photos > header { align-items: flex-start; flex-direction: column; }
    .run-step-photo-grid { grid-template-columns: 1fr; }
    .scientific-keypad { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .calculator-result-row { grid-template-columns: 1fr; }
    .cell-maintenance-metrics { gap: 8px; }
    .cell-culture-grid { padding: 10px; }
    .cell-culture-card { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 12px; }
    .cell-culture-thumb { width: 72px; height: 94px; }
    #cellMaintenanceQueue { grid-template-columns: 1fr; }
    .cell-passage-content dl { grid-template-columns: 1fr; }
    .passage-title { align-items: flex-start; flex-direction: column; }
    .clear-workspace-dialog article { padding: 23px; }
}

/* Schedule-owned experiment launch and complete dark-mode form contrast. */
.schedule-block-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.schedule-block-actions,
.today-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex: 0 0 auto;
}

.schedule-block .schedule-run-button,
.today-item .schedule-run-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: auto;
    min-width: 52px;
    height: 27px;
    padding: 0 9px;
    color: #1d2815;
    background: var(--acid);
    border: 1px solid var(--acid-strong);
    border-radius: 9px 3px 9px 3px;
    cursor: pointer;
    font-family: var(--font-interface);
}

.schedule-block .schedule-run-button span,
.today-item .schedule-run-button span {
    font-size: 9px;
}

.schedule-block .schedule-run-button b,
.today-item .schedule-run-button b {
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.schedule-block .schedule-check-button {
    width: 24px;
    min-width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
}

.today-item .schedule-run-button {
    min-width: 58px;
}

.schedule-block[data-overlap-count="3"] .schedule-run-button,
.schedule-block[data-overlap-count="4"] .schedule-run-button {
    min-width: 27px;
    width: 27px;
    padding: 0;
    border-radius: 50%;
}

.schedule-block[data-overlap-count="3"] .schedule-run-button b,
.schedule-block[data-overlap-count="4"] .schedule-run-button b {
    display: none;
}

.workspace-readonly [data-start-scheduled-experiment] {
    display: none !important;
}

.dark-theme .entry-dialog,
.dark-theme .experiment-detail-dialog,
.dark-theme .experiment-run-dialog,
.dark-theme .protocol-detail-dialog,
.dark-theme .record-detail-dialog,
.dark-theme .freezer-scan-dialog,
.dark-theme .clear-workspace-dialog {
    color: var(--ink);
}

.dark-theme .form-field label,
.dark-theme .experiment-detail-fields label > span,
.dark-theme .run-step-notes > span,
.dark-theme .calculator-tool label > span,
.dark-theme .photo-capture-status,
.dark-theme .field-note,
.dark-theme .entry-dialog footer p {
    color: #d7e0da;
}

.dark-theme input,
.dark-theme textarea,
.dark-theme select {
    color: var(--ink);
    caret-color: var(--acid);
}

.dark-theme input::placeholder,
.dark-theme textarea::placeholder {
    color: #8f9b94;
    opacity: 1;
}

.dark-theme select option,
.dark-theme select optgroup {
    color: #17201c;
    background: #f3f6f1;
}

.dark-theme input[type="date"]::-webkit-calendar-picker-indicator,
.dark-theme input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: .82;
}

.dark-theme .filter-tabs button,
.dark-theme .calendar-modes button,
.dark-theme .workspace-mode-toggle button,
.dark-theme .freezer-box-tab,
.dark-theme .language-dock button {
    color: var(--ink-2);
}

.dark-theme .filter-tabs button.active,
.dark-theme .calendar-modes button.active,
.dark-theme .workspace-mode-toggle button.active,
.dark-theme .freezer-box-tab.active,
.dark-theme .language-dock button .active {
    color: #182018;
}

.dark-theme .schedule-block .schedule-run-button,
.dark-theme .today-item .schedule-run-button {
    color: #182018;
    background: var(--acid);
    border-color: #91bd24;
}

@media (max-width: 560px) {
    .today-item .schedule-run-button {
        min-width: 30px;
        width: 30px;
        padding: 0;
        border-radius: 50%;
    }

    .today-item .schedule-run-button b {
        display: none;
    }
}

/* Story quotations, editable custom choices and end-of-day sign-off. */
.page-heading.technical-heading .story-quote {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    max-width: 760px;
    margin-top: 12px;
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.7;
}

.story-quote cite {
    color: var(--muted);
    font-size: .82em;
    font-style: normal;
    letter-spacing: .04em;
}

html:not([lang="en"]) select,
html:not([lang="en"]) select option,
html:not([lang="en"]) select optgroup,
html:not([lang="en"]) .custom-select-input {
    font-family: var(--font-interface);
}

.form-field select,
.experiment-detail-fields select,
.experiment-reagent-row select,
.protocol-reagent-row select,
.apparatus-tool select,
.calculator-tool select,
select option,
select optgroup {
    font-size: 16px;
}

.custom-select-input {
    width: 100%;
    min-height: 44px;
    margin-top: 8px;
    padding: 0 13px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line-dark);
    border-radius: 9px 3px 9px 3px;
    font-size: 16px;
}

.custom-select-input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(70, 166, 161, .12);
    outline: none;
}

.custom-select-input[hidden] {
    display: none;
}

.end-day-button {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 26px;
    padding: 14px;
    color: #eef7dd;
    background:
        linear-gradient(115deg, rgba(174, 224, 43, .13), transparent 54%),
        #303a35;
    border: 1px solid rgba(174, 224, 43, .28);
    border-radius: 16px 5px 16px 5px;
    cursor: pointer;
    text-align: left;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.end-day-button:hover {
    border-color: rgba(174, 224, 43, .68);
    box-shadow: 0 14px 30px rgba(42, 55, 47, .15);
    transform: translateY(-2px);
}

.end-day-button > span {
    display: grid;
    width: 38px;
    height: 38px;
    color: #233018;
    background: var(--acid);
    border-radius: 50%;
    place-items: center;
    font-size: 18px;
    font-weight: 900;
}

.end-day-button strong,
.end-day-button small {
    display: block;
}

.end-day-button strong {
    font-size: 15px;
}

.end-day-button small {
    margin-top: 4px;
    color: #b9c4be;
    font-size: 11px;
    line-height: 1.45;
}

.end-day-button > b {
    color: var(--acid);
    font-size: 18px;
}

.end-day-dialog {
    width: min(600px, calc(100% - 28px));
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    overflow: visible;
}

.end-day-dialog::backdrop {
    background: rgba(30, 39, 34, .68);
    backdrop-filter: blur(16px) saturate(.72);
}

.end-day-dialog article {
    position: relative;
    padding: 42px 34px 34px;
    overflow: hidden;
    text-align: center;
    background:
        radial-gradient(circle at 50% 10%, rgba(184, 227, 70, .22), transparent 35%),
        linear-gradient(145deg, var(--surface), var(--surface-2));
    border: 1px solid rgba(159, 203, 53, .34);
    border-radius: 30px 7px 30px 7px;
    box-shadow: 0 36px 110px rgba(25, 33, 29, .48);
}

.end-day-dialog.celebrate article {
    animation: end-day-rise .58s cubic-bezier(.16, 1, .3, 1) both;
}

.end-day-dialog .dialog-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
}

.end-day-dialog h2 {
    margin: 8px 0 10px;
    font-size: clamp(36px, 7vw, 54px);
    line-height: 1.08;
}

.end-day-dialog article > p:not(.micro-label) {
    max-width: 440px;
    margin: 0 auto 25px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.75;
}

.end-day-dialog .button {
    min-height: 46px;
    padding-inline: 24px;
    font-size: 15px;
}

.end-day-orbit {
    position: relative;
    width: 148px;
    height: 148px;
    margin: 0 auto 24px;
    border: 1px solid rgba(148, 190, 47, .38);
    border-radius: 50%;
}

.end-day-orbit::before,
.end-day-orbit::after {
    position: absolute;
    inset: 13px;
    content: "";
    border: 1px solid rgba(95, 174, 160, .34);
    border-radius: 50%;
    transform: rotate(28deg) scaleY(.52);
}

.end-day-orbit::after {
    inset: 2px 30px;
    border-color: rgba(240, 167, 52, .36);
    transform: rotate(-35deg) scaleX(.58);
}

.end-day-core {
    position: absolute;
    inset: 36px;
    display: grid;
    z-index: 1;
    color: #203014;
    background: linear-gradient(145deg, #c9f04f, #9fcd29);
    border-radius: 50%;
    box-shadow: 0 0 0 10px rgba(169, 216, 52, .11), 0 14px 34px rgba(91, 123, 18, .26);
    place-items: center;
    font-size: 32px;
    font-weight: 950;
}

.celebrate .end-day-core {
    animation: end-day-pulse 1.6s .25s ease-in-out infinite;
}

.end-day-orbit i {
    position: absolute;
    z-index: 2;
    width: 9px;
    height: 9px;
    background: var(--acid);
    border-radius: 50%;
    box-shadow: 0 0 14px rgba(174, 224, 43, .9);
}

.end-day-orbit i:nth-of-type(1) { top: 9px; left: 68px; }
.end-day-orbit i:nth-of-type(2) { top: 69px; right: 7px; background: var(--teal); }
.end-day-orbit i:nth-of-type(3) { bottom: 10px; left: 49px; background: var(--orange); }
.end-day-orbit i:nth-of-type(4) { top: 58px; left: 7px; }

.celebrate .end-day-orbit i:nth-of-type(odd) {
    animation: end-day-spark 1.45s .18s ease-in-out infinite;
}

.celebrate .end-day-orbit i:nth-of-type(even) {
    animation: end-day-spark 1.45s .46s ease-in-out infinite reverse;
}

.dark-theme .end-day-dialog article {
    background:
        radial-gradient(circle at 50% 10%, rgba(184, 227, 70, .18), transparent 35%),
        linear-gradient(145deg, #202925, #18211d);
}

@keyframes end-day-rise {
    from { opacity: 0; transform: translateY(28px) scale(.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes end-day-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 10px rgba(169, 216, 52, .11), 0 14px 34px rgba(91, 123, 18, .26); }
    50% { transform: scale(1.07); box-shadow: 0 0 0 17px rgba(169, 216, 52, 0), 0 16px 38px rgba(91, 123, 18, .34); }
}

@keyframes end-day-spark {
    0%, 100% { opacity: .45; transform: scale(.72); }
    50% { opacity: 1; transform: scale(1.35); }
}

@media (prefers-reduced-motion: reduce) {
    .end-day-dialog.celebrate article,
    .celebrate .end-day-core,
    .celebrate .end-day-orbit i {
        animation: none;
    }
}

@media (max-width: 560px) {
    .page-heading.technical-heading .story-quote { font-size: 14px; }
    .end-day-dialog article { padding: 36px 20px 26px; }
    .end-day-orbit { width: 126px; height: 126px; }
    .end-day-core { inset: 31px; }
}

/* Global type and contrast audit: Helvetica for Latin glyphs, SimHei for CJK glyphs. */
:root {
    --font-interface: "Helvetica Neue", Helvetica, Arial, SimHei, "Microsoft YaHei", sans-serif;
}

html body,
html body *,
html body *::before,
html body *::after {
    font-family: var(--font-interface);
}

.page-heading.technical-heading h1 {
    font-size: clamp(30px, 3.25vw, 46px);
}

.filter-tabs {
    gap: 7px;
}

.filter-tabs button {
    min-height: 36px;
    padding-inline: 15px;
    font-size: 14px;
    line-height: 1;
}

.mini-metric small {
    font-size: 13px;
}

.metric-link-card {
    width: 100%;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.metric-link-card:hover,
.metric-link-card:focus-visible {
    border-color: rgba(145, 184, 41, .52);
    box-shadow: 0 20px 46px rgba(50, 65, 56, .13);
    outline: none;
    transform: translateY(-4px);
}

.metric-link-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(98, 214, 208, .28), 0 20px 46px rgba(50, 65, 56, .13);
}

.metric-link-arrow {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 2;
    display: grid;
    width: 27px;
    height: 27px;
    color: #29331f;
    background: var(--acid-soft);
    border-radius: 50%;
    place-items: center;
    font-size: 14px;
    font-weight: 900;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .18s ease, transform .18s ease;
}

.metric-link-card:hover .metric-link-arrow,
.metric-link-card:focus-visible .metric-link-arrow {
    opacity: 1;
    transform: translateX(0);
}

.metric-trend {
    font-size: 11.5px;
}

.metric-value span {
    font-size: 12px;
}

.data-table th {
    font-size: 12px;
}

.data-table td {
    font-size: 14.5px;
}

.data-table small,
.amount-meter span {
    font-size: 11.5px;
}

.freezer-box-tab strong {
    font-size: 13px;
}

.freezer-box-tab strong em,
.freezer-box-tab small,
.freezer-box-tab b {
    font-size: 11px;
}

.matrix-hint,
.legend {
    font-size: 12px;
    line-height: 1.55;
}

.cryo-cell {
    font-size: 10.5px;
    font-weight: 750;
}

.sample-vial::after {
    font-size: 9.5px;
}

.sample-detail > p {
    font-size: 13px;
}

.sample-detail .detail-list dt {
    font-size: 13.5px;
    line-height: 1.45;
}

.sample-detail .detail-list dd {
    max-width: 66%;
    font-size: 15.5px;
    line-height: 1.5;
}

.sample-detail-open {
    min-height: 42px;
    font-size: 13px;
}

.today-item.done,
.schedule-block.done {
    opacity: 1;
}

.today-item.done > time,
.today-item.done > .task-marker,
.today-item.done > div:not(.today-item-actions),
.schedule-block.done .schedule-block-copy {
    opacity: .58;
}

.today-item.done .task-check,
.schedule-block.done .schedule-check-button {
    color: #202a18;
    background: var(--acid);
    border-color: var(--acid-strong);
    box-shadow: 0 0 0 3px rgba(166, 205, 54, .14);
    opacity: 1;
}

.workspace-readonly .end-day-button {
    display: none !important;
}

body.dark-theme {
    --muted: #c0cac4;
    --muted-2: #a6b2ab;
    --line-dark: #66736d;
}

.dark-theme .language-dock {
    color: #f4f8f3;
    background: rgba(14, 20, 17, .98);
}

.dark-theme .language-dock-label {
    color: #f4f8f3;
}

.dark-theme .language-dock button {
    color: #1a2317;
    background: var(--acid);
    border-color: #98bf2c;
}

.dark-theme .language-dock button span,
.dark-theme .language-dock button i {
    color: #344126;
    opacity: .78;
}

.dark-theme .language-dock button span.active {
    color: #10170d;
    opacity: 1;
}

.dark-theme .nav-item.active .nav-code,
.dark-theme .nav-item.active b {
    color: #344126;
}

.dark-theme .metric-icon,
.dark-theme .metric-value,
.dark-theme .mini-metric,
.dark-theme .data-table td,
.dark-theme .detail-list dd,
.dark-theme .sample-detail h2,
.dark-theme .freezer-box-tab strong,
.dark-theme .panel-head h2 {
    color: var(--ink);
}

.dark-theme .metric-trend,
.dark-theme .eyebrow span {
    color: #c4ea58;
}

.dark-theme .micro-label,
.dark-theme .eyebrow,
.dark-theme .metric-value span,
.dark-theme .mini-metric small,
.dark-theme .data-table th,
.dark-theme .data-table small,
.dark-theme .amount-meter span,
.dark-theme .freezer-box-tab small,
.dark-theme .freezer-box-tab b,
.dark-theme .matrix-hint,
.dark-theme .legend,
.dark-theme .sample-detail > p,
.dark-theme .detail-list dt,
.dark-theme .today-item small,
.dark-theme .project-row p,
.dark-theme .project-progress small,
.dark-theme .activity-item time,
.dark-theme .story-quote cite {
    color: var(--muted);
}

.dark-theme .freezer-box-tab strong em {
    color: #ddf99a;
    background: rgba(190, 226, 77, .12);
}

.dark-theme .metric-link-card:hover,
.dark-theme .metric-link-card:focus-visible {
    border-color: rgba(190, 226, 77, .42);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
}

.dark-theme .metric-link-arrow {
    color: #182017;
    background: var(--acid);
}

.dark-theme .filter-tabs button,
.dark-theme .calendar-modes button,
.dark-theme .workspace-mode-toggle button,
.dark-theme .freezer-box-tab {
    color: #c4cdc7;
}

.dark-theme .filter-tabs button.active,
.dark-theme .calendar-modes button.active,
.dark-theme .workspace-mode-toggle button.active,
.dark-theme .freezer-box-tab.active {
    color: #182018;
}

.dark-theme .today-item.done .task-check,
.dark-theme .schedule-block.done .schedule-check-button {
    color: #182018;
}

@media (max-width: 560px) {
    .filter-tabs button { font-size: 13px; }
    .data-table th { font-size: 11px; }
    .data-table td { font-size: 13px; }
    .cryo-cell { font-size: 8.5px; }
    .sample-detail .detail-list dd { max-width: 62%; font-size: 14px; }
}

/* Final bilingual readability pass: keep every functional label legible in both themes. */
body {
    font-size: 16px;
}

input::placeholder,
textarea::placeholder {
    color: #65716b;
    opacity: 1;
}

.dark-theme input::placeholder,
.dark-theme textarea::placeholder {
    color: #c0cac4;
    opacity: 1;
}

.form-field > span,
.form-field > label,
.field-label,
.entry-dialog label,
.dialog-section-label {
    font-size: 14px !important;
    line-height: 1.45;
}

.form-field input,
.form-field select,
.form-field textarea,
.entry-dialog input,
.entry-dialog select,
.entry-dialog textarea,
.detail-dialog input,
.detail-dialog select,
.detail-dialog textarea {
    min-height: 43px;
    font-size: 15.5px !important;
    line-height: 1.45;
}

select option,
select optgroup {
    color: #17201c;
    background: #f3f6f1;
    font-family: var(--font-interface);
    font-size: 15.5px !important;
}

.global-search input,
.inline-search input,
.dialog-search input,
.topbar input {
    min-height: 38px;
    font-size: 14px !important;
}

.filter-tabs button,
.calendar-modes button,
.workspace-mode-toggle button,
.detail-tabs button,
.protocol-tabs button {
    min-height: 36px;
    font-size: 13px !important;
    line-height: 1.25;
}

.nav-item { font-size: 15px; }
.nav-label { font-size: 11px; }
.nav-item b { font-size: 10px; }
.nav-code { font-size: 11px; }
.breadcrumb { font-size: 12px; }
.micro-label,
.eyebrow { font-size: 10.5px; }
.metric-trend { font-size: 11.5px; }
.metric-value span { font-size: 12px; }
.mini-metric small { font-size: 12.5px; }
.data-table th { font-size: 12px; }
.data-table td { font-size: 14px; line-height: 1.5; }
.data-table small,
.amount-meter span { font-size: 11.5px; line-height: 1.45; }
.status-chip { font-size: 11px; }
.today-item strong,
.schedule-block strong { font-size: 13px; line-height: 1.4; }
.today-item small,
.schedule-block small,
.calendar-time-label,
.drag-hint { font-size: 11px; line-height: 1.45; }
.project-row p,
.project-progress small,
.activity-item time { font-size: 11px; line-height: 1.45; }
.freezer-box-tab strong { font-size: 13px; }
.freezer-box-tab strong em,
.freezer-box-tab small,
.freezer-box-tab b { font-size: 11px; line-height: 1.45; }
.matrix-hint,
.legend { font-size: 11.5px; line-height: 1.6; }
.cryo-cell { font-size: 10px; }
.sample-vial::after { font-size: 9px; }
.sample-detail > p { font-size: 12.5px; }
.sample-detail .detail-list dt { font-size: 13px; }
.sample-detail .detail-list dd { font-size: 15px; }
.sample-detail-open { font-size: 13px; }
.field-note,
.photo-capture-status,
.photo-capture-button small,
.entry-dialog footer p,
.dialog-helper,
.form-help { font-size: 13px !important; line-height: 1.55; }

.language-dock button,
.dark-theme .language-dock button {
    display: inline-flex;
    gap: 2px;
    min-width: 108px;
    min-height: 40px;
    padding: 3px;
    color: #edf3ee;
    background: #18211d;
    border: 1px solid rgba(216, 255, 69, .42);
    border-radius: 10px 2px 10px 2px;
    box-shadow: none;
}

.language-dock button span,
.dark-theme .language-dock button span {
    display: grid;
    min-width: 41px;
    min-height: 32px;
    padding: 0 8px;
    color: #f2f6f3;
    background: transparent;
    border-radius: 7px 2px 7px 2px;
    font-size: 11px;
    opacity: 1;
    place-items: center;
}

.language-dock button span.active,
.dark-theme .language-dock button span.active {
    color: #151c12;
    background: var(--acid);
    opacity: 1;
}

.language-dock button i,
.dark-theme .language-dock button i {
    color: #b8c3bd;
    opacity: 1;
}

.language-dock button:hover,
.language-dock button:focus-visible,
.dark-theme .language-dock button:hover,
.dark-theme .language-dock button:focus-visible {
    color: #f5f8f5;
    background: #202b26;
    border-color: var(--acid);
}

.language-dock-label,
.dark-theme .language-dock-label {
    color: #f5f8f5;
    font-family: var(--font-interface);
    font-size: 8.5px;
}

html[lang="zh-CN"] .page-heading.technical-heading .story-quote,
html[lang="en"] .page-heading.technical-heading .story-quote {
    display: flex;
    min-height: 52px;
    align-items: flex-start;
    flex-wrap: wrap;
    font-size: 14px;
    line-height: 1.6;
}

html[lang="zh-CN"] .story-quote cite,
html[lang="en"] .story-quote cite {
    font-size: 12px;
    line-height: 1.6;
}

body.dark-theme {
    --muted: #c8d1cb;
    --muted-2: #b4beb8;
}

.dark-theme select option,
.dark-theme select optgroup {
    color: #17201c;
    background: #f3f6f1;
}

@media (max-width: 700px) {
    .language-dock button,
    .dark-theme .language-dock button {
        min-width: 100px;
        min-height: 38px;
        padding: 3px;
    }

    .language-dock button span,
    .dark-theme .language-dock button span {
        min-width: 38px;
        min-height: 30px;
        font-size: 11px;
    }
}

.photo-capture-button strong {
    font-size: 14px !important;
}

.photo-capture-preview > span {
    font-size: 13px !important;
}

/* Daily experiment archive and one-to-one result workspace. */
.experiment-day-list,
.experiment-results-board {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.experiment-day-group,
.result-day-group {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.experiment-day-head {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 34px;
    color: var(--ink);
}

.experiment-day-head > div {
    display: flex;
    align-items: baseline;
    gap: 12px;
    white-space: nowrap;
}

.experiment-day-head span {
    font-size: 14px;
    font-weight: 800;
}

.experiment-day-head small {
    color: var(--muted);
    font-size: 11px;
}

.experiment-day-head i {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--line-dark), transparent);
}

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

.result-card {
    display: flex;
    min-height: 286px;
    padding: 20px;
    flex-direction: column;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 14px 34px rgba(43, 57, 49, .045);
}

.result-card.pending {
    background: linear-gradient(135deg, var(--surface), var(--surface-2));
    border-style: dashed;
}

.result-card-top,
.result-card-footer,
.result-card-footer > div {
    display: flex;
    align-items: center;
}

.result-card-top,
.result-card-footer {
    justify-content: space-between;
    gap: 12px;
}

.result-card h2 {
    margin: 18px 0 8px;
    font-size: 18px;
    line-height: 1.35;
}

.result-card > p,
.result-summary {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.result-conclusion {
    margin-top: 14px;
    padding: 13px 14px;
    background: var(--surface-2);
    border-left: 3px solid var(--acid-strong);
}

.result-conclusion small,
.result-conclusion strong {
    display: block;
}

.result-conclusion small {
    margin-bottom: 6px;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
}

.result-conclusion strong {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
}

.result-attachment-strip {
    display: flex;
    gap: 7px;
    margin-top: 14px;
    overflow: hidden;
}

.result-attachment-strip a {
    display: grid;
    width: 72px;
    height: 58px;
    overflow: hidden;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    place-items: center;
    text-decoration: none;
}

.result-attachment-strip img {
    width: 100%;
    height: 37px;
    object-fit: cover;
}

.result-attachment-strip > a > span {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
}

.result-attachment-strip small {
    width: 100%;
    padding: 3px 5px;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-no-attachments {
    margin-top: 14px !important;
    font-size: 11px !important;
}

.result-card-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--line);
}

.result-card-footer > span {
    color: var(--muted);
    font-size: 11px;
}

.result-card-footer > div {
    gap: 7px;
}

.button.compact {
    min-height: 32px;
    padding: 0 13px;
    font-size: 12px;
}

.result-delete-button {
    min-height: 30px;
    padding: 0 8px;
    color: var(--danger);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.result-attachment-editor > input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.result-attachment-upload {
    display: flex;
    min-height: 72px;
    padding: 13px 16px;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px dashed var(--line-dark);
    cursor: pointer;
}

.result-attachment-upload > span {
    display: grid;
    width: 34px;
    height: 34px;
    background: var(--acid-soft);
    border-radius: 50%;
    font-size: 18px;
    place-items: center;
}

.result-attachment-upload strong,
.result-attachment-upload small {
    display: block;
}

.result-attachment-upload strong { font-size: 14px; }
.result-attachment-upload small { color: var(--muted); font-size: 11px; }

.pending-result-attachments {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.pending-result-attachments article {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 28px;
    min-height: 54px;
    align-items: center;
    gap: 9px;
    padding: 5px;
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.pending-result-attachments img,
.pending-file-icon {
    display: grid;
    width: 48px;
    height: 42px;
    object-fit: cover;
    background: var(--acid-soft);
    font-size: 8px;
    font-weight: 900;
    place-items: center;
}

.pending-result-attachments strong,
.pending-result-attachments small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-result-attachments strong { font-size: 12px; }
.pending-result-attachments small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.pending-result-attachments button { color: var(--danger); background: transparent; border: 0; cursor: pointer; font-size: 17px; }
.result-attachment-empty { grid-column: 1 / -1; margin: 0; padding: 12px; color: var(--muted); background: var(--surface-2); font-size: 12px; text-align: center; }

/* Keep the language switch inside the top utility bar and readable in both themes. */
.topbar .language-dock,
.dark-theme .topbar .language-dock {
    position: static;
    z-index: auto;
    inset: auto;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 0;
    padding: 2px;
    color: #f2f6f3;
    background: #18211d;
    border: 1px solid rgba(216, 255, 69, .48);
    border-radius: 999px;
    box-shadow: none;
    backdrop-filter: none;
}

.topbar .language-dock::before,
.topbar .language-dock-label {
    display: none;
}

.topbar .language-dock button,
.dark-theme .topbar .language-dock button {
    min-width: 76px;
    min-height: 32px;
    gap: 1px;
    padding: 2px;
    color: #f2f6f3;
    background: transparent;
    border: 0;
    border-radius: 999px;
}

.topbar .language-dock button span,
.dark-theme .topbar .language-dock button span {
    min-width: 30px;
    min-height: 26px;
    padding: 0 6px;
    color: #f2f6f3;
    background: transparent;
    border-radius: 999px;
    font-size: 10px;
}

.topbar .language-dock button span.active,
.dark-theme .topbar .language-dock button span.active {
    color: #151c12;
    background: var(--acid);
}

.topbar .language-dock button i,
.dark-theme .topbar .language-dock button i {
    color: #c9d2cd;
}

/* Explicitly defeat legacy font shorthands in information-heavy regions. */
html[lang="zh-CN"] .mini-metrics,
html[lang="zh-CN"] .mini-metrics *,
html[lang="zh-CN"] .module-toolbar,
html[lang="zh-CN"] .module-toolbar *,
html[lang="zh-CN"] .data-table,
html[lang="zh-CN"] .data-table *,
html[lang="zh-CN"] .experiment-day-list,
html[lang="zh-CN"] .experiment-day-list *,
html[lang="zh-CN"] .experiment-results-board,
html[lang="zh-CN"] .experiment-results-board *,
html[lang="en"] .mini-metrics,
html[lang="en"] .mini-metrics *,
html[lang="en"] .module-toolbar,
html[lang="en"] .module-toolbar *,
html[lang="en"] .data-table,
html[lang="en"] .data-table *,
html[lang="en"] .experiment-day-list,
html[lang="en"] .experiment-day-list *,
html[lang="en"] .experiment-results-board,
html[lang="en"] .experiment-results-board * {
    font-family: var(--font-interface);
}

@media (max-width: 900px) {
    .result-card-grid { grid-template-columns: 1fr; }
    .topbar .sync-control span { display: none; }
}

@media (max-width: 700px) {
    .topbar .language-dock button,
    .dark-theme .topbar .language-dock button { min-width: 70px; min-height: 30px; }
    .topbar .language-dock button span,
    .dark-theme .topbar .language-dock button span { min-width: 27px; min-height: 24px; padding-inline: 4px; }
    .pending-result-attachments { grid-template-columns: 1fr; }
    .experiment-day-head > div { align-items: flex-start; flex-direction: column; gap: 2px; }
}

/* Skip layout and paint work for dated groups until they approach the viewport. */
@supports (content-visibility: auto) {
    .experiment-day-group,
    .result-day-group {
        content-visibility: auto;
        contain-intrinsic-size: auto 320px;
    }
}

/* Capacitor internal test build: respect device cutouts and system bars. */
html.native-app {
    --native-safe-top: env(safe-area-inset-top, 0px);
    --native-safe-right: env(safe-area-inset-right, 0px);
    --native-safe-bottom: env(safe-area-inset-bottom, 0px);
    --native-safe-left: env(safe-area-inset-left, 0px);
}

html.native-app body {
    padding-right: var(--native-safe-right);
    padding-bottom: var(--native-safe-bottom);
    padding-left: var(--native-safe-left);
}

html.native-app .topbar {
    top: var(--native-safe-top);
}

html.native-app .sidebar {
    padding-top: var(--native-safe-top);
}

html.native-app main {
    padding-top: calc(var(--topbar-height) + var(--native-safe-top) + 34px);
}
/* 2026-08-10: consistent information typography and denser record rows. */
.page-heading.technical-heading .story-quote,
.page-heading.technical-heading .story-quote cite {
    font-family: var(--font-interface);
    font-size: 14px !important;
    font-weight: 500;
    line-height: 1.65;
}

.page-heading.technical-heading .story-quote cite {
    color: var(--muted);
    letter-spacing: 0;
}

.mini-metrics,
.mini-metrics *,
.module-toolbar,
.module-toolbar *,
.filter-tabs,
.filter-tabs *,
.global-search input,
.inline-search input,
.dialog-search input,
input::placeholder,
textarea::placeholder {
    font-family: var(--font-interface);
}

.mini-metric small,
.filter-tabs button,
.module-toolbar .section-title h2 {
    font-weight: 700;
}

input::placeholder,
textarea::placeholder {
    font-weight: 500;
}

.data-table td {
    font-size: 13px;
    line-height: 1.45;
}

.data-table small,
.amount-meter span {
    font-size: 10.5px;
}

@media (max-width: 560px) {
    .data-table td { font-size: 12.5px; }
    .data-table small,
    .amount-meter span { font-size: 10px; }
}
/* 2026-08-10: mobile account access, manager directory and explicit CJK quotation type. */
:root {
    --font-cjk: SimHei, "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans CN", "Microsoft YaHei", sans-serif;
}

html[lang="zh-CN"] .page-heading.technical-heading .story-quote,
html[lang="zh-CN"] .page-heading.technical-heading .story-quote cite {
    font-family: var(--font-interface);
    font-size: 14px !important;
    font-weight: 600;
    line-height: 1.65;
}

.lab-member-directory {
    margin: 0 22px 18px;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 15px 5px 15px 5px;
}

.lab-member-directory-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.lab-member-directory-head > div:first-child {
    display: grid;
    gap: 4px;
}

.lab-member-directory-head small,
.lab-member-directory-head span {
    color: var(--muted);
    font-size: 10px;
}

.lab-member-directory-head strong {
    font-size: 15px;
}

.lab-member-directory-head > div:last-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lab-member-directory-head b {
    display: grid;
    min-width: 30px;
    height: 30px;
    place-items: center;
    color: #243016;
    background: var(--acid);
    border-radius: 50%;
    font-size: 12px;
}

.button.compact {
    min-height: 32px;
    padding: 0 11px;
}

.lab-member-list {
    display: grid;
    max-height: 220px;
    overflow: auto;
}

.lab-member-list > p {
    margin: 0;
    padding: 18px 16px;
    color: var(--muted);
    font-size: 12px;
}

.lab-member-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}

.lab-member-item:last-child {
    border-bottom: 0;
}

.lab-member-item strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lab-member-item span,
.lab-member-item time {
    color: var(--muted);
    font-size: 10.5px;
}

.lab-member-item time {
    grid-column: 1 / -1;
}

.dark-theme .lab-member-directory {
    background: rgba(255, 255, 255, .035);
    border-color: rgba(255, 255, 255, .08);
}

.dark-theme .lab-member-directory-head,
.dark-theme .lab-member-item {
    border-color: rgba(255, 255, 255, .08);
}

@media (max-width: 700px) {
    .top-actions {
        display: flex !important;
        flex: 0 0 auto;
        gap: 5px;
        margin-left: auto;
    }

    .topbar .sync-control {
        min-width: 86px;
        min-height: 38px;
        justify-content: center;
        padding: 0 11px;
        border-color: rgba(115, 145, 35, .48);
        font-size: 11px;
    }

    .topbar .sync-control span {
        display: inline !important;
    }

    .topbar .sync-control[data-sync-state="local"] {
        color: #202b15;
        background: var(--acid);
        box-shadow: 0 7px 20px rgba(122, 155, 36, .22);
    }

    .topbar .sync-control[data-sync-state="local"] > i {
        background: #5d7c16;
        box-shadow: 0 0 0 4px rgba(55, 82, 8, .12);
    }

    .workspace-mode-toggle {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .lab-member-directory {
        margin-inline: 14px;
    }
}

@media (max-width: 560px) {
    .topbar {
        gap: 7px;
        padding-inline: 10px;
    }

    .topbar .breadcrumb,
    .topbar .global-search {
        display: none;
    }

    .topbar .language-dock button,
    .dark-theme .topbar .language-dock button {
        min-width: 64px;
    }

    .topbar .language-dock button span,
    .dark-theme .topbar .language-dock button span {
        min-width: 24px;
        padding-inline: 3px;
    }

    .lab-member-directory-head {
        align-items: flex-start;
    }

    .lab-member-item {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .topbar #notificationToggle {
        display: none;
    }
}

/* Native mobile performance profile: favor stable high-frame-rate scrolling. */
html.native-performance {
    scroll-behavior: auto;
}

html.native-performance body {
    background-attachment: scroll;
    transition: none;
}

html.native-performance *,
html.native-performance *::before,
html.native-performance *::after {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

html.native-performance button,
html.native-performance a,
html.native-performance input,
html.native-performance select,
html.native-performance textarea {
    touch-action: manipulation;
}

html.native-performance .table-scroll,
html.native-performance .freezer-box-tabs,
html.native-performance .lab-member-list,
html.native-performance dialog > article {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

html.native-performance .facility-chip i,
html.native-performance .sync-control[data-sync-state="connecting"] > i,
html.native-performance .sync-visual > i,
html.native-performance .run-live-badge i {
    animation: none !important;
}

html.native-performance.app-backgrounded *,
html.native-performance.app-backgrounded *::before,
html.native-performance.app-backgrounded *::after {
    animation-play-state: paused !important;
}

@media (max-width: 900px) {
    html.native-performance body {
        background:
            radial-gradient(ellipse at 54% 108%, rgba(171, 211, 54, .2), transparent 44%),
            var(--canvas);
    }

    html.native-performance body::before,
    html.native-performance body::after {
        display: none;
    }

    html.native-performance .topbar {
        background: rgba(245, 247, 242, .97);
        box-shadow: 0 2px 10px rgba(48, 60, 53, .07);
    }

    html.native-performance body.dark-theme .topbar {
        background: rgba(20, 28, 24, .98);
    }

    html.native-performance .sidebar {
        background: var(--surface);
        box-shadow: 8px 0 24px rgba(45, 58, 50, .1);
    }

    html.native-performance .view.active {
        animation-duration: .16s;
    }

    html.native-performance .panel,
    html.native-performance .metric-card,
    html.native-performance .mini-metric,
    html.native-performance .record-card,
    html.native-performance .protocol-card,
    html.native-performance .cell-culture-card {
        contain: paint;
        box-shadow: none;
    }
}

/* Keep the technical hero atmosphere while omitting the decorative section number. */
.dashboard-hero {
    padding-right: 42px;
}

.dashboard-hero .hero-index {
    display: none !important;
}

.app-boot-screen {
    display: none;
}

html.native-app .app-boot-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 12px;
    padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
    color: #1f2924;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .78), transparent 42%),
        #f2f4ed;
    opacity: 1;
    transition: opacity .22s ease, visibility .22s ease;
}

html.native-app .app-boot-screen.is-hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.app-boot-screen strong {
    margin-top: 4px;
    font: 800 11px/1.2 var(--font-interface);
    letter-spacing: .18em;
}

.app-boot-screen span {
    color: #6e7874;
    font-family: var(--font-interface);
    font-size: 12px;
    font-weight: 600;
}

.boot-loader {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    width: 54px;
    height: 26px;
}

.boot-loader i {
    width: 9px;
    height: 24px;
    background: #9bc927;
    border-radius: 2px;
    transform: scaleY(.28);
    transform-origin: center bottom;
    animation: boot-bar .9s ease-in-out infinite;
}

.boot-loader i:nth-child(2) { animation-delay: .1s; }
.boot-loader i:nth-child(3) { animation-delay: .2s; }
.boot-loader i:nth-child(4) { animation-delay: .3s; }

@keyframes boot-bar {
    0%, 100% { opacity: .45; transform: scaleY(.28); }
    48% { opacity: 1; transform: scaleY(1); }
}

body.dark-theme .app-boot-screen {
    color: #eef3ef;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 42%),
        #151c19;
}

body.dark-theme .app-boot-screen span { color: #aeb8b2; }

@media (prefers-color-scheme: dark) {
    html.native-app body:not(.dark-theme) .app-boot-screen {
        color: #eef3ef;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 42%),
            #151c19;
    }

    html.native-app body:not(.dark-theme) .app-boot-screen span {
        color: #aeb8b2;
    }
}

@media (max-width: 700px) {
    .top-actions #themeToggle {
        display: grid !important;
        flex: 0 0 34px;
    }

    .dashboard-hero {
        gap: 20px;
        padding: 24px !important;
    }
}

@media (max-width: 430px) {
    .dashboard-hero {
        padding: 22px 18px !important;
    }
}

.entry-optional-note {
    grid-column: 1 / -1;
    margin: -2px 0 2px;
    padding: 10px 12px;
    color: var(--muted);
    background: var(--acid-soft);
    border-left: 3px solid var(--acid-strong);
    border-radius: 3px 10px 10px 3px;
    font-size: 12px;
    line-height: 1.55;
}

.protocol-photo-recognition {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px 12px;
    padding: 12px;
    background: rgba(182, 219, 58, .09);
    border: 1px solid rgba(145, 187, 40, .28);
    border-radius: 11px 3px 11px 3px;
}

.protocol-photo-recognition button {
    min-height: 36px;
    padding: 0 14px;
    color: #1f2a22;
    background: var(--acid);
    border: 0;
    border-radius: 9px 3px 9px 3px;
    font-family: var(--font-interface);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.protocol-photo-recognition button:disabled {
    cursor: not-allowed;
    opacity: .46;
}

.protocol-photo-recognition small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.protocol-ocr-result {
    grid-column: 1 / -1;
    padding-top: 4px;
}

.protocol-ocr-result[hidden] {
    display: none;
}

.protocol-ocr-result summary {
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.protocol-ocr-result textarea {
    width: 100%;
    min-height: 110px;
    margin-top: 9px;
    padding: 11px 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-dark);
    border-radius: 9px 3px 9px 3px;
    font-family: var(--font-interface);
    font-size: 12px;
    line-height: 1.6;
    resize: vertical;
}

.dark-theme .entry-optional-note,
.dark-theme .protocol-photo-recognition {
    color: #d7e0da;
    background: rgba(182, 219, 58, .07);
    border-color: rgba(182, 219, 58, .2);
}

@media (max-width: 560px) {
    .protocol-photo-recognition {
        grid-template-columns: 1fr;
    }

    .protocol-photo-recognition button {
        width: 100%;
    }
}

/* Public showcase access and multi-species animal housing. */
.public-demo-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px 5px 10px;
    color: var(--ink);
    background: var(--acid-soft);
    border: 1px solid var(--acid-strong);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.public-demo-banner[hidden] { display: none !important; }

.public-demo-banner button {
    min-height: 28px;
    padding: 0 10px;
    color: #192018;
    background: var(--acid);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
}

.dark-theme .public-demo-banner {
    color: #f1f5ed;
    background: #26311b;
    border-color: #9acb27;
}

.dark-theme .public-demo-banner button { color: #17200d; }

.animal-heading-actions,
.animal-rack-actions,
.animal-rack-legend,
.animal-rack-board > header {
    display: flex;
    align-items: center;
}

.animal-heading-actions { gap: 8px; }

.animal-rack-manager {
    margin-bottom: 16px;
    overflow: hidden;
}

.animal-rack-toolbar { gap: 18px; }

.animal-rack-actions {
    gap: 11px;
    margin-left: auto;
}

.animal-rack-actions > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.animal-rack-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 18px;
    overflow-x: auto;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
}

.animal-rack-tab {
    display: grid;
    min-width: 188px;
    padding: 11px 13px;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px 4px 12px 4px;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.animal-rack-tab strong { font-size: 13px; }
.animal-rack-tab small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.animal-rack-tab.active { background: var(--acid-soft); border-color: var(--acid-strong); box-shadow: inset 4px 0 0 var(--acid-strong); }

.animal-rack-empty-tabs {
    color: var(--muted);
    font-size: 12px;
}

.animal-housing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr);
    min-height: 410px;
}

.animal-rack-board { padding: 18px; }

.animal-rack-board > header {
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 15px;
}

.animal-rack-board h3 { margin: 4px 0; font-size: 18px; }
.animal-rack-board header small { color: var(--muted); font-size: 11px; }

.animal-rack-legend { gap: 12px; color: var(--muted); font-size: 10px; font-weight: 700; }
.animal-rack-legend span { display: inline-flex; align-items: center; gap: 5px; }
.animal-rack-legend i { width: 10px; height: 10px; background: var(--surface-2); border: 1px dashed var(--line-dark); }
.animal-rack-legend i.occupied { background: #dce3dc; border-style: solid; }
.animal-rack-legend i.selected { background: var(--acid); border-color: var(--acid-strong); }

.animal-rack-grid {
    display: grid;
    gap: 7px;
}

.animal-rack-position {
    position: relative;
    display: flex;
    min-width: 56px;
    min-height: 76px;
    padding: 9px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px dashed var(--line-dark);
    border-radius: 9px 3px 9px 3px;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.animal-rack-position > span { font-size: 9px; font-weight: 800; }
.animal-rack-position > strong { color: var(--ink); font-size: 12px; line-height: 1.2; }
.animal-rack-position > small { color: var(--muted); font-size: 9px; }
.animal-rack-position.empty { justify-content: center; align-items: center; }
.animal-rack-position.empty strong { font-size: 19px; font-weight: 400; opacity: .35; }
.animal-rack-position.occupied { background: color-mix(in srgb, var(--surface-2) 76%, #c9d6cd); border-style: solid; }
.animal-rack-position.active { color: #18200c; background: var(--acid); border-color: var(--acid-strong); box-shadow: 0 8px 20px rgba(123, 166, 25, .22); }
.animal-rack-position.active > strong,
.animal-rack-position.active > small { color: #18200c; }

.animal-cage-inspector {
    padding: 19px;
    background: linear-gradient(145deg, var(--surface-2), var(--surface));
    border-left: 1px solid var(--line);
}

.animal-cage-empty {
    display: grid;
    min-height: 100%;
    align-content: center;
    justify-items: center;
    color: var(--muted);
    text-align: center;
}
.animal-cage-empty span { font-size: 36px; font-weight: 900; letter-spacing: .12em; opacity: .08; }
.animal-cage-empty strong { margin-top: -5px; color: var(--ink); font-size: 17px; }
.animal-cage-empty p { max-width: 240px; font-size: 11px; line-height: 1.7; }

.animal-cage-summary header,
.animal-cage-summary .animal-cage-meta,
.animal-cage-summary .animal-cage-list header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.animal-cage-summary > header small { color: var(--muted); font-size: 10px; }
.animal-cage-summary > header h3 { margin: 5px 0 0; font-size: 19px; }
.animal-cage-summary > header span { min-width: 44px; padding: 9px; color: #1b240e; background: var(--acid); font-size: 13px; font-weight: 900; text-align: center; }
.animal-cage-meta { margin: 16px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.animal-cage-meta div { display: grid; gap: 3px; }
.animal-cage-meta small { color: var(--muted); font-size: 9px; }
.animal-cage-meta strong { font-size: 12px; }
.animal-cage-notes { margin: 0 0 15px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.animal-cage-list header { margin-bottom: 8px; }
.animal-cage-list header h4 { margin: 0; font-size: 13px; }
.animal-cage-list header span { color: var(--muted); font-size: 10px; }
.animal-cage-animal {
    display: grid;
    grid-template-columns: 1fr auto;
    width: 100%;
    margin-top: 6px;
    padding: 10px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    cursor: pointer;
    font: inherit;
    text-align: left;
}
.animal-cage-animal strong { font-size: 12px; }
.animal-cage-animal small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.animal-cage-animal b { grid-row: 1 / 3; grid-column: 2; align-self: center; }
.animal-cage-summary .button { width: 100%; margin-top: 12px; }

.workspace-readonly [data-add-animal-to-cage],
.workspace-readonly [data-animal-position] {
    cursor: not-allowed;
}

.public-demo-locked .clear-workspace-button { display: none; }

.dark-theme .animal-rack-position.occupied,
.dark-theme .animal-cage-animal { background: rgba(255, 255, 255, .035); }

@media (max-width: 1050px) {
    .animal-housing-layout { grid-template-columns: 1fr; }
    .animal-cage-inspector { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 700px) {
    .public-demo-banner {
        position: fixed;
        z-index: 40;
        right: 10px;
        bottom: calc(74px + env(safe-area-inset-bottom));
        box-shadow: 0 12px 34px rgba(22, 30, 26, .22);
    }
    .animal-heading-actions { width: 100%; }
    .animal-heading-actions .button { flex: 1; }
    .animal-rack-toolbar { align-items: flex-start; }
    .animal-rack-actions { align-items: flex-end; flex-direction: column; }
    .animal-rack-actions > span { display: none; }
    .animal-rack-board { padding: 13px; overflow-x: auto; }
    .animal-rack-board > header { align-items: flex-start; flex-direction: column; }
    .animal-rack-legend { flex-wrap: wrap; }
    .animal-rack-grid { min-width: 540px; }
    .animal-cage-inspector { padding: 15px; }
}

@media (max-width: 430px) {
    .animal-heading-actions { flex-direction: column; }
    .animal-heading-actions .button { width: 100%; }
    .animal-rack-tabs { padding-inline: 12px; }
    .animal-rack-tab { min-width: 168px; }
}


/* Split local Latin and CJK faces by Unicode so mixed scientific labels use the intended glyphs. */
@font-face {
    font-family: "Rhine Helvetica";
    src: local("Helvetica"), local("Helvetica Neue"), local("Arial");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
    unicode-range: U+0000-024F, U+1E00-1EFF, U+2000-206F, U+2070-209F, U+20A0-20CF, U+2100-214F, U+2190-22FF, U+25A0-25FF;
}

@font-face {
    font-family: "Rhine SimHei";
    src: local("SimHei"), local("黑体"), local("Noto Sans CJK SC"), local("Noto Sans SC"), local("Source Han Sans CN"), local("Microsoft YaHei");
    font-display: swap;
    font-style: normal;
    font-weight: 400;
    unicode-range: U+2E80-2FFF, U+3000-303F, U+31C0-31EF, U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FE10-FE1F, U+FE30-FE4F, U+FF00-FFEF, U+20000-2A6DF, U+2A700-2CEAF, U+2CEB0-2EBEF, U+30000-3134F;
}
/* 2026-08-11 definitive type audit: Unicode-aware mixed-script stacks and a consistent information scale. */
:root {
    --font-latin: "Rhine Helvetica", Helvetica, "Helvetica Neue", Arial, sans-serif;
    --font-cjk: "Rhine SimHei", SimHei, "黑体", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans CN", "Microsoft YaHei", sans-serif;
    --font-interface: "Rhine Helvetica", "Rhine SimHei", SimHei, "黑体", sans-serif;
}

/* The Unicode-ranged family is the single source of truth. Latin glyphs resolve
   to Helvetica while CJK glyphs resolve to SimHei, including mixed strings. */
html,
body,
button,
input,
textarea,
select,
option,
optgroup,
table,
dialog {
    font-family: var(--font-interface);
    font-synthesis: weight style;
}

body,
button,
input,
textarea,
select,
option,
optgroup {
    font-weight: 500;
}

#dashboardDaySummary {
    font-family: var(--font-interface);
    font-weight: 700;
}

#dashboardDaySummary strong {
    font-family: inherit;
    font-weight: 800;
}
input,
textarea,
select,
option,
optgroup,
.global-search input,
.inline-search input,
.dialog-search input,
.topbar input {
    font-size: 13px !important;
    font-family: var(--font-interface);
    font-weight: 600;
    line-height: 1.45;
}

input::placeholder,
textarea::placeholder {
    color: #596660;
    font-family: var(--font-interface);
    font-size: 13px !important;
    font-weight: 600;
    opacity: 1;
}

.dark-theme input::placeholder,
.dark-theme textarea::placeholder {
    color: #c7d0ca;
}

.app-shell small,
dialog small,
.notification-panel small {
    font-size: max(11px, .72em) !important;
    line-height: 1.5;
}

.search-empty,
.empty-card,
.record-history-empty,
.experiment-usage-empty,
.month-empty,
.result-attachment-empty,
.animal-rack-empty-tabs,
.animal-cage-empty p,
.data-table td[colspan] {
    color: var(--muted);
    font-size: 14px !important;
    font-weight: 500;
    line-height: 1.65;
}

.global-search kbd {
    font-size: 10px;
}

.micro-label,
.eyebrow,
.nav-item b,
.nav-code,
.breadcrumb,
.heading-status,
.status-chip,
.legend,
.matrix-hint,
.drag-hint,
.calendar-time-label,
.record-detail-code {
    font-size: 11px !important;
    line-height: 1.45;
}

.metric-trend,
.metric-value span,
.mini-metric small,
.project-progress small,
.activity-item time,
.today-item small,
.schedule-block small,
.field-note,
.form-help,
.dialog-helper,
.entry-dialog footer p,
.photo-capture-status,
.photo-capture-button small,
.data-table small,
.amount-meter span {
    font-size: 11.5px !important;
    line-height: 1.5;
}

.filter-tabs button,
.calendar-modes button,
.workspace-mode-toggle button,
.detail-tabs button,
.protocol-tabs button,
.button,
.public-demo-banner,
.animal-rack-actions > span {
    font-size: 12.5px !important;
}

.data-table th {
    font-size: 11.5px !important;
    line-height: 1.45;
}

.data-table td {
    font-size: 13px !important;
    line-height: 1.5;
}

.notification-panel h2 {
    font-size: 18px;
}

.notification-item strong {
    font-size: 13px;
    line-height: 1.4;
}

.notification-item small {
    margin-top: 4px;
    font-size: 11.5px !important;
}

.notification-panel > footer > span,
.notification-panel > footer button {
    font-size: 11px;
    line-height: 1.4;
}

.page-heading.technical-heading .story-quote,
.page-heading.technical-heading .story-quote cite {
    font-family: var(--font-interface);
    font-size: 13px !important;
    font-weight: 500;
    line-height: 1.65;
}

html[lang="en"] .page-heading.technical-heading .story-quote,
html[lang="en"] .page-heading.technical-heading .story-quote cite {
    font-family: var(--font-interface);
}

.brand-lockup {
    min-height: 84px;
    gap: 9px;
    padding: 14px 17px;
}

.brand-logo {
    width: 86px;
    max-height: 55px;
    object-fit: contain;
    object-position: center;
}

/* Notification center starts empty; real alerts can be rendered from user-owned data. */
.notification-empty {
    display: grid;
    min-height: 170px;
    padding: 30px 22px;
    color: var(--muted);
    text-align: center;
    place-items: center;
}

.notification-empty > div {
    max-width: 280px;
}

.notification-empty i {
    display: grid;
    width: 38px;
    height: 38px;
    margin: 0 auto 12px;
    color: #6f861f;
    background: var(--acid-soft);
    border: 1px solid rgba(145, 184, 41, .3);
    border-radius: 50%;
    font-size: 20px;
    font-style: normal;
    place-items: center;
}

.notification-empty strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
}

.notification-empty p {
    margin: 7px 0 0;
    font-size: 12px;
    line-height: 1.6;
}

.notification-panel > footer button:disabled {
    cursor: not-allowed;
    opacity: .38;
}

.brand-terminal {
    font-size: 9.5px;
    line-height: 1.45;
}

@media (max-width: 700px) {
    .brand-logo { width: 80px; }
    .app-shell small,
    dialog small,
    .notification-panel small { font-size: 11px !important; }
    .data-table td { font-size: 12.5px !important; }
}

/* Experiment records own their result data; the result panel remains visually secondary. */
.experiment-record-entry {
    display: grid;
    min-width: 0;
}

.experiment-record-entry > .record-card {
    width: 100%;
    border-radius: 18px 18px 0 0;
}

.experiment-inline-result {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
    background: color-mix(in srgb, var(--surface) 94%, var(--acid-soft));
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 18px 18px;
}

.experiment-inline-result > header,
.experiment-inline-result > footer,
.protocol-literature-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.experiment-inline-result h3,
.protocol-literature-card h3 {
    margin: 2px 0 0;
    font-size: 16px;
}

.experiment-inline-result > p,
.experiment-inline-result footer,
.result-no-attachments {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.experiment-inline-result.pending {
    border-style: dashed;
}

.experiment-inline-result.pending .button {
    justify-self: start;
}

.result-conclusion {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.result-conclusion small,
.result-conclusion strong {
    font-family: var(--font-interface);
}

.result-attachment-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.experiment-inline-result footer > div {
    display: flex;
    gap: 8px;
}

.experiment-result-section {
    margin-top: 16px;
}

.protocol-reference-badge {
    display: inline-flex;
    margin-left: 8px;
    padding: 3px 7px;
    color: #526a12;
    background: var(--acid-soft);
    border: 1px solid rgba(145, 184, 41, .32);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.protocol-literature-card {
    display: grid;
    gap: 9px;
    margin: 18px 0 24px;
    padding: 18px;
    background: color-mix(in srgb, var(--surface) 93%, var(--acid-soft));
    border: 1px solid var(--line);
    border-left: 4px solid var(--acid);
    border-radius: 14px;
}

.protocol-literature-card > strong {
    font-size: 15px;
    line-height: 1.45;
}

.protocol-literature-card > p {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.protocol-literature-card code {
    justify-self: start;
    padding: 4px 7px;
    color: var(--ink);
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-family: var(--font-interface);
    font-size: 12px;
}

.protocol-literature-link {
    color: #5b7510;
    font-size: 12.5px;
    font-weight: 800;
    text-decoration: none;
}

.protocol-literature-link:hover {
    text-decoration: underline;
}

@media (max-width: 700px) {
    .experiment-inline-result { padding: 14px; }
    .experiment-inline-result > header,
    .experiment-inline-result > footer { align-items: flex-start; flex-direction: column; }
    .experiment-inline-result footer > div { width: 100%; }
    .experiment-inline-result footer .button { flex: 1; }
    .protocol-literature-card > header { align-items: flex-start; flex-direction: column; }
}
/* Rhine Lab 0.1.5 bilingual density and control-size pass. */
html[lang="en"] .nav-item b {
    display: none !important;
}

html[lang="en"] .nav-item {
    min-height: 54px;
}

.page-heading.technical-heading .story-quote,
.page-heading.technical-heading .story-quote cite,
html[lang="en"] .page-heading.technical-heading .story-quote,
html[lang="en"] .page-heading.technical-heading .story-quote cite {
    font-family: SimHei, "黑体", "Microsoft YaHei", sans-serif !important;
    font-weight: 500;
}

#themeToggle,
.top-actions #themeToggle {
    display: grid;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    flex: 0 0 38px;
    padding: 0;
    place-items: center;
    font-size: 18px !important;
    line-height: 1;
}

.metric-icon,
.project-code,
.hero-progress span,
.today-item time,
.activity-item p,
.cell-queue-item small,
.record-detail-dialog .micro-label {
    font-size: 11px !important;
    line-height: 1.45;
}

.status-chip,
.today-item small,
.schedule-block small,
.record-detail-alert p,
.detail-stock-meter > span,
.record-detail-dialog footer > span {
    font-size: 12px !important;
    line-height: 1.5;
}

.cell-culture-grid {
    gap: 10px;
    padding: 12px;
}

.cell-culture-card {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border-radius: 15px 4px 15px 4px;
}

.cell-culture-thumb {
    width: 78px;
    height: 94px;
    border-radius: 13px 4px 13px 4px;
    font-size: 19px;
}

.cell-culture-main h3 {
    margin: 6px 0 2px;
    font-size: 18px;
}

.cell-culture-main > p {
    font-size: 12.5px;
}

.cell-container-line {
    margin-top: 9px;
    padding-top: 8px;
    font-size: 12px;
}

.cell-confluence {
    margin-top: 8px;
}

.cell-confluence > span,
.cell-culture-main footer {
    font-size: 12px;
}

.cell-culture-main footer {
    margin-top: 8px;
}

.record-detail-dialog {
    width: min(900px, calc(100% - 28px));
}

.record-detail-dialog header,
.record-detail-dialog footer {
    padding: 14px 20px;
}

.record-detail-dialog h2 {
    font-size: 25px;
}

.record-detail-body {
    padding: 18px;
}

.record-detail-hero {
    min-height: 124px;
    padding: 20px;
}

.record-detail-hero h3 {
    margin: 13px 0 5px;
    font-size: clamp(25px, 3.4vw, 32px);
}

.record-detail-hero p {
    font-size: 14px;
}

.record-detail-section {
    margin-top: 10px;
    padding: 17px;
}

.record-detail-section-title h3 {
    margin: 3px 0 11px;
    font-size: 20px;
}

.record-detail-grid {
    gap: 8px;
}

.record-detail-field {
    padding: 9px 11px;
    border-radius: 9px 3px 9px 3px;
}

.record-detail-field small,
.detail-list dt,
.record-timeline small,
.record-history-item time {
    color: #4f5c56;
    font-size: 12.5px !important;
    font-weight: 900;
    letter-spacing: .02em;
    line-height: 1.35;
}

.dark-theme .record-detail-field small,
.dark-theme .detail-list dt,
.dark-theme .record-timeline small,
.dark-theme .record-history-item time {
    color: #c5cec8;
}

.record-detail-field strong,
.detail-list dd {
    margin-top: 5px;
    font-size: 16px;
    line-height: 1.4;
}

.record-detail-alert {
    margin-top: 10px;
    padding: 12px 14px;
}

.detail-stock-meter {
    margin-top: 9px;
}

.record-detail-actions .button {
    min-height: 40px;
    padding-inline: 15px;
    font-size: 14px;
}

.entry-dialog .form-field > label,
.entry-dialog .form-field > span {
    color: #4f5c56;
    font-size: 13px !important;
    font-weight: 900;
}

.dark-theme .entry-dialog .form-field > label,
.dark-theme .entry-dialog .form-field > span {
    color: #c5cec8;
}

.entry-dialog .form-field input,
.entry-dialog .form-field select,
.entry-dialog .form-field textarea {
    min-height: 40px;
    font-size: 14px !important;
}

.entry-dialog .form-field textarea {
    min-height: 82px;
}

@media (max-width: 700px) {
    #themeToggle,
    .top-actions #themeToggle {
        width: 38px;
        min-width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .cell-culture-grid {
        grid-template-columns: 1fr;
    }

    .cell-culture-card {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .cell-culture-thumb {
        width: 70px;
        height: 86px;
    }

    .record-detail-body {
        padding: 12px;
    }

    .record-detail-section {
        padding: 14px;
    }

    .record-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
/* Rhine Lab 0.1.5 language control floor. */
.topbar .language-dock button span,
.dark-theme .topbar .language-dock button span {
    font-size: 12px !important;
    line-height: 1 !important;
}

/* Rhine Lab 0.1.5 meaningful-text floor. */
.record-card > p,
.record-meta strong,
.record-usage-line span,
.record-usage-line strong {
    font-size: 11px !important;
    line-height: 1.45;
}

.protocol-number,
.protocol-card > p,
.protocol-path-preview span,
.protocol-path-preview b,
.protocol-foot span,
.protocol-foot strong {
    font-size: 11px !important;
    line-height: 1.45;
}

.calendar-navigation button,
.load-item header span {
    font-size: 11px !important;
}
/* Rhine Lab 0.1.5 thumbnail-free culture cards. */
.cell-culture-card {
    grid-template-columns: minmax(0, 1fr);
}

/* Rhine Lab 0.1.8 housing, schedule, typography and shared-workspace alignment. */
.animal-rack-tab-wrap {
    position: relative;
    flex: 0 0 auto;
}

.animal-rack-tab-wrap .animal-rack-tab {
    width: 100%;
    padding-right: 38px;
}

.animal-rack-delete,
.schedule-delete-button {
    display: inline-grid;
    place-items: center;
    color: #a83b2f;
    background: rgba(255, 244, 240, .94);
    border: 1px solid rgba(219, 103, 83, .34);
    border-radius: 999px;
    font-family: Helvetica, Arial, sans-serif !important;
    font-weight: 800;
    cursor: pointer;
}

.animal-rack-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
}

.animal-cage-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.animal-cage-buttons .button.primary {
    flex: 1 1 190px;
}

.schedule-delete-button {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    font-size: 15px !important;
}

.schedule-block-actions,
.today-item-actions {
    gap: 6px;
}

.protocol-note-card {
    margin-bottom: 18px;
    padding: 16px 18px;
    background: var(--acid-soft);
    border-left: 4px solid var(--acid-strong);
    border-radius: 3px 15px 3px 15px;
}

.protocol-note-card > p:last-child {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

html[lang="en"] .page-heading.technical-heading .story-quote,
html[lang="en"] .page-heading.technical-heading .story-quote *,
html[lang="en"] .page-heading.technical-heading .story-quote cite {
    font-family: SimHei, "黑体", "Microsoft YaHei", sans-serif !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

html[lang="en"] .nav-item {
    position: relative;
    grid-template-columns: minmax(0, 1fr) !important;
    padding-inline: 38px !important;
    text-align: left;
}

html[lang="en"] .nav-item .nav-code {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

html[lang="en"] .nav-item > span:not(.nav-code) {
    display: block;
    width: 100%;
    text-align: left;
}

.cell-culture-card {
    min-height: 0;
    padding: 11px 12px;
}

.cell-culture-main h3 {
    margin-top: 4px;
}

.cell-culture-main footer {
    align-items: center;
}

.dark-theme .animal-rack-delete,
.dark-theme .schedule-delete-button {
    color: #ff9b8b;
    background: #2b2421;
    border-color: rgba(255, 155, 139, .34);
}

@media (max-width: 700px) {
    html[lang="en"] .nav-item {
        padding-inline: 36px !important;
    }

    .animal-rack-tab-wrap {
        min-width: 168px;
    }
}

/* Editorial workspace directory: compact navigation instead of repeated dashboard cards. */
.workspace-directory {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 14px 0 22px;
    overflow: hidden;
    background: rgba(249, 251, 247, .46);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.workspace-directory-link {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "code arrow" "label arrow" "count arrow";
    align-items: center;
    min-width: 0;
    min-height: 78px;
    padding: 11px 18px 12px;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-right: 1px solid var(--line);
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.workspace-directory-link:last-child {
    border-right: 0;
}

.workspace-directory-link:hover,
.workspace-directory-link:focus-visible {
    background: rgba(183, 221, 59, .11);
    outline: none;
}

.workspace-directory-code {
    grid-area: code;
    color: var(--acid-strong);
    font: 800 8px/1.2 var(--font-interface);
    letter-spacing: .12em;
}

.workspace-directory-link > strong {
    grid-area: label;
    margin-top: 5px;
    font-size: 13px;
    font-weight: 700;
}

.workspace-directory-link > small {
    grid-area: count;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10.5px;
}

.workspace-directory-link > i {
    grid-area: arrow;
    color: var(--muted);
    font-size: 14px;
    font-style: normal;
}

.dashboard-grid > .panel {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: none;
    backdrop-filter: none;
}

.workspace-scope-stats {
    gap: 0;
    align-items: center;
}

.workspace-scope-stats > span {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 14px;
    border-left: 1px solid rgba(255, 255, 255, .12);
}

.workspace-scope-stats > span strong {
    color: #f0f5ed;
    font-size: 15px;
}

.workspace-scope-stats > span small {
    color: #aab4ae;
    font-size: 9px;
}

.dark-theme .workspace-directory-link {
    color: #edf2ec;
}

.dark-theme .workspace-directory-link > small,
.dark-theme .workspace-directory-link > i {
    color: #c0cac4;
}

.dark-theme .workspace-directory {
    background: rgba(255, 255, 255, .018);
}

.dark-theme .workspace-directory-link:hover,
.dark-theme .workspace-directory-link:focus-visible {
    background: rgba(183, 221, 59, .08);
}

@media (max-width: 700px) {
    .workspace-directory {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .workspace-directory::-webkit-scrollbar {
        display: none;
    }

    .workspace-directory-link {
        flex: 0 0 154px;
        min-height: 70px;
        padding-inline: 14px;
    }

    .workspace-scope-stats {
        flex-wrap: wrap;
    }

    .workspace-scope-stats > span {
        padding: 2px 10px;
    }
}


/* v0.1.8 explicit editing and history controls */
.schedule-edit-button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font: 700 15px/1 Helvetica, Arial, sans-serif;
}
.schedule-edit-button:hover { border-color: var(--lime-strong); color: var(--lime-deep); }
.entry-edit-history { grid-column: 1 / -1; }
.entry-edit-history .record-detail-section { margin: 8px 0 0; }
.experiment-history-section:empty { display: none; }
.protocol-detail-dialog footer > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) {
    .protocol-detail-dialog footer > div { width: 100%; }
    .protocol-detail-dialog footer > div .button { flex: 1; }
}
.dark-theme .schedule-edit-button { background: var(--surface); color: var(--ink); }


/* Rhine Lab technical title atmosphere and compact scientific detail flows. */
.page-heading.technical-heading {
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 33%, rgba(145, 187, 40, .16) 0 4px, transparent 5px),
        radial-gradient(circle at 84% 52%, rgba(68, 169, 164, .14) 0 5px, transparent 6px),
        radial-gradient(circle at 91% 27%, rgba(232, 155, 58, .14) 0 3px, transparent 4px),
        linear-gradient(114deg, rgba(255, 255, 255, .88), rgba(236, 239, 232, .84) 57%, rgba(230, 224, 210, .78)),
        var(--surface);
}

.page-heading.technical-heading::before {
    width: 52%;
    background:
        radial-gradient(circle at 72% 46%, transparent 0 56px, rgba(114, 143, 73, .11) 57px 58px, transparent 59px),
        radial-gradient(circle at 72% 46%, transparent 0 92px, rgba(114, 143, 73, .08) 93px 94px, transparent 95px),
        linear-gradient(126deg, transparent 0 47%, rgba(232, 155, 58, .11) 47.5% 59%, transparent 59.5%),
        linear-gradient(rgba(72, 84, 76, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(72, 84, 76, .025) 1px, transparent 1px);
    background-size: auto, auto, auto, 28px 28px, 28px 28px;
}

.page-heading.technical-heading .heading-code::before {
    content: "RHINE / LIFE SCIENCE";
    position: absolute;
    right: 2px;
    bottom: 100%;
    width: max-content;
    color: rgba(93, 119, 74, .28);
    font: 800 9px/1 var(--font-interface);
    letter-spacing: .16em;
}

.dark-theme .page-heading.technical-heading {
    background:
        radial-gradient(circle at 78% 33%, rgba(174, 224, 52, .2) 0 4px, transparent 5px),
        radial-gradient(circle at 84% 52%, rgba(96, 195, 188, .17) 0 5px, transparent 6px),
        radial-gradient(circle at 91% 27%, rgba(238, 167, 71, .17) 0 3px, transparent 4px),
        linear-gradient(114deg, rgba(31, 41, 36, .98), rgba(38, 53, 44, .95) 58%, rgba(46, 50, 40, .94)),
        var(--surface);
}

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

.protocol-step-path {
    position: relative;
    display: grid;
    gap: 0;
    margin: 8px 0 4px 10px;
    padding-left: 24px;
    border-left: 1px solid rgba(145, 187, 40, .52);
}

.protocol-step-item {
    position: relative;
    min-width: 0;
    padding: 11px 14px 12px;
    border-bottom: 1px dashed var(--line-dark);
}

.protocol-step-item:last-child { border-bottom: 0; }

.protocol-step-item i {
    position: absolute;
    top: 16px;
    left: -29px;
    width: 9px;
    height: 9px;
    background: var(--acid-strong);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--acid-strong);
    transform: rotate(45deg);
}

.protocol-step-item p {
    margin: 0;
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.55;
}

.dark-theme .protocol-step-item { border-bottom-color: rgba(255, 255, 255, .1); }

@media (max-width: 700px) {
    .reagent-profile-grid { grid-template-columns: 1fr; }
    .reagent-profile-grid .record-detail-field.wide { grid-column: auto; }
    .page-heading.technical-heading .heading-code::before { display: none; }
    .protocol-step-path { margin-left: 5px; padding-left: 19px; }
    .protocol-step-item { padding: 9px 10px 10px; }
    .protocol-step-item i { left: -24px; }
    .protocol-step-item p { font-size: 14px; }
}


/* Workspace-specific Rhine Lab research motifs. */
#view-experiments .technical-heading::before {
    background:
        radial-gradient(circle at 78% 47%, transparent 0 37px, rgba(68, 169, 164, .16) 38px 39px, transparent 40px),
        radial-gradient(circle at 78% 47%, rgba(68, 169, 164, .12) 0 3px, transparent 4px),
        linear-gradient(164deg, transparent 0 42%, rgba(232, 155, 58, .16) 42.5% 44%, transparent 44.5%),
        repeating-linear-gradient(90deg, transparent 0 21px, rgba(72, 84, 76, .04) 21px 22px),
        repeating-linear-gradient(0deg, transparent 0 21px, rgba(72, 84, 76, .04) 21px 22px);
}

#view-experiments .heading-code::before { content: "RHINE / IMAGING + DATA"; }

#view-mice .technical-heading::before {
    background:
        repeating-linear-gradient(90deg, transparent 0 44px, rgba(112, 137, 93, .10) 44px 45px),
        repeating-linear-gradient(0deg, transparent 0 32px, rgba(112, 137, 93, .10) 32px 33px),
        radial-gradient(circle at 76% 34%, rgba(145, 187, 40, .17) 0 4px, transparent 5px),
        radial-gradient(circle at 86% 66%, rgba(68, 169, 164, .15) 0 4px, transparent 5px),
        linear-gradient(32deg, transparent 0 48%, rgba(145, 187, 40, .12) 48.5% 49.5%, transparent 50%);
    background-size: 220px 130px, 220px 130px, auto, auto, auto;
    background-position: 76% 50%, 76% 50%, center, center, center;
}

#view-mice .heading-code::before { content: "RHINE / VIVARIUM NODE"; }

#view-reagents .technical-heading::before {
    background:
        radial-gradient(circle at 68% 38%, rgba(145, 187, 40, .19) 0 6px, transparent 7px),
        radial-gradient(circle at 82% 26%, rgba(68, 169, 164, .17) 0 5px, transparent 6px),
        radial-gradient(circle at 88% 61%, rgba(232, 155, 58, .18) 0 5px, transparent 6px),
        radial-gradient(circle at 73% 72%, rgba(145, 187, 40, .13) 0 4px, transparent 5px),
        linear-gradient(28deg, transparent 0 48%, rgba(98, 122, 84, .13) 48.5% 49.5%, transparent 50%),
        linear-gradient(148deg, transparent 0 48%, rgba(98, 122, 84, .10) 48.5% 49.5%, transparent 50%);
}

#view-reagents .heading-code::before { content: "RHINE / CHEMICAL STORAGE"; }

#view-cells .technical-heading::before {
    background:
        radial-gradient(circle at 70% 38%, rgba(145, 187, 40, .14) 0 19px, rgba(145, 187, 40, .07) 20px 27px, transparent 28px),
        radial-gradient(circle at 82% 58%, rgba(68, 169, 164, .14) 0 14px, rgba(68, 169, 164, .06) 15px 23px, transparent 24px),
        radial-gradient(circle at 91% 31%, rgba(232, 155, 58, .13) 0 11px, rgba(232, 155, 58, .05) 12px 18px, transparent 19px),
        radial-gradient(circle at 64% 73%, rgba(145, 187, 40, .11) 0 9px, transparent 10px),
        radial-gradient(circle at 70% 38%, rgba(93, 119, 74, .22) 0 3px, transparent 4px),
        radial-gradient(circle at 82% 58%, rgba(68, 169, 164, .20) 0 3px, transparent 4px);
}

#view-cells .heading-code::before { content: "RHINE / CULTURE DECK"; }

#view-samples .technical-heading::before {
    background:
        repeating-linear-gradient(90deg, transparent 0 19px, rgba(68, 169, 164, .09) 19px 20px),
        repeating-linear-gradient(0deg, transparent 0 19px, rgba(68, 169, 164, .09) 19px 20px),
        linear-gradient(45deg, transparent 0 47%, rgba(255, 255, 255, .52) 47.5% 48.5%, transparent 49%),
        linear-gradient(135deg, transparent 0 47%, rgba(255, 255, 255, .42) 47.5% 48.5%, transparent 49%);
    background-size: 180px 180px, 180px 180px, 92px 92px, 92px 92px;
    background-position: 78% 50%, 78% 50%, 91% 23%, 91% 23%;
}

#view-samples .heading-code::before { content: "RHINE / CRYO ARCHIVE"; }

#view-protocols .technical-heading::before {
    background:
        radial-gradient(circle at 62% 50%, rgba(145, 187, 40, .19) 0 6px, transparent 7px),
        radial-gradient(circle at 75% 50%, rgba(68, 169, 164, .18) 0 6px, transparent 7px),
        radial-gradient(circle at 88% 50%, rgba(232, 155, 58, .18) 0 6px, transparent 7px),
        linear-gradient(90deg, transparent 0 61%, rgba(99, 123, 84, .14) 61.5% 88%, transparent 88.5%),
        repeating-linear-gradient(0deg, transparent 0 27px, rgba(72, 84, 76, .035) 27px 28px);
}

#view-protocols .heading-code::before { content: "RHINE / PROCEDURE NETWORK"; }

#view-schedule .technical-heading::before {
    background:
        linear-gradient(90deg, transparent 0 65%, rgba(145, 187, 40, .18) 65% 72%, transparent 72%),
        linear-gradient(90deg, transparent 0 77%, rgba(68, 169, 164, .16) 77% 88%, transparent 88%),
        linear-gradient(90deg, transparent 0 70%, rgba(232, 155, 58, .16) 70% 82%, transparent 82%),
        repeating-linear-gradient(90deg, transparent 0 39px, rgba(72, 84, 76, .05) 39px 40px),
        repeating-linear-gradient(0deg, transparent 0 27px, rgba(72, 84, 76, .05) 27px 28px);
    background-size: auto 13px, auto 13px, auto 13px, auto, auto;
    background-position: 0 30%, 0 52%, 0 74%, 0 0, 0 0;
    background-repeat: no-repeat, no-repeat, no-repeat, repeat, repeat;
}

#view-schedule .heading-code::before { content: "RHINE / OPERATIONS TIMELINE"; }

.dark-theme #view-experiments .technical-heading::before,
.dark-theme #view-mice .technical-heading::before,
.dark-theme #view-reagents .technical-heading::before,
.dark-theme #view-cells .technical-heading::before,
.dark-theme #view-samples .technical-heading::before,
.dark-theme #view-protocols .technical-heading::before,
.dark-theme #view-schedule .technical-heading::before {
    filter: brightness(1.35) saturate(1.08);
    opacity: .9;
}

@media (max-width: 700px) {
    #view-experiments .technical-heading::before,
    #view-mice .technical-heading::before,
    #view-reagents .technical-heading::before,
    #view-cells .technical-heading::before,
    #view-samples .technical-heading::before,
    #view-protocols .technical-heading::before,
    #view-schedule .technical-heading::before {
        width: 64%;
        opacity: .68;
    }
}

/* Rhine Lab video-reference editorial headings. */
.page-heading.technical-heading {
    --heading-signal: #8fbd25;
    --heading-signal-soft: rgba(143, 189, 37, .16);
    min-height: 190px;
    padding: 31px clamp(320px, 38vw, 520px) 30px 38px;
    isolation: isolate;
    overflow: hidden;
    color: var(--ink);
    background:
        linear-gradient(110deg, rgba(255, 255, 255, .94) 0 54%, rgba(242, 244, 239, .92) 72%, rgba(229, 234, 224, .94) 100%),
        var(--surface);
    border: 1px solid rgba(255, 255, 255, .82);
    border-left: 0;
    border-radius: 25px 7px 25px 7px;
    box-shadow: var(--shadow);
}

.page-heading.technical-heading::before {
    content: "";
    position: absolute;
    inset: 0 0 0 auto;
    width: 48%;
    height: auto;
    opacity: .78;
    background:
        linear-gradient(rgba(61, 72, 66, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(61, 72, 66, .035) 1px, transparent 1px),
        linear-gradient(136deg, transparent 0 47%, rgba(232, 155, 58, .13) 47.2% 55%, transparent 55.2%);
    background-size: 26px 26px, 26px 26px, auto;
    mask-image: linear-gradient(90deg, transparent, #000 18%);
    pointer-events: none;
}

.page-heading.technical-heading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 38px;
    width: 82px;
    height: 4px;
    background: var(--orange);
    border-radius: 0 0 4px 4px;
}

.page-heading.technical-heading > div:first-child:not(.heading-visual) {
    position: relative;
    z-index: 3;
    width: min(100%, 680px);
}

.page-heading.technical-heading > .button,
.page-heading.technical-heading > .heading-actions {
    position: absolute;
    right: 34px;
    bottom: 27px;
    z-index: 4;
    margin: 0;
}

.page-heading.technical-heading h1 { position: relative; z-index: 2; }

.heading-visual {
    position: absolute !important;
    inset: 0 0 0 auto;
    z-index: 1 !important;
    width: 47%;
    overflow: hidden;
    pointer-events: none;
}

.heading-visual::before {
    content: "";
    position: absolute;
    pointer-events: none;
}

.heading-visual::before {
    inset: 0;
    opacity: .78;
    background:
        radial-gradient(circle at 73% 48%, transparent 0 58px, rgba(61, 76, 67, .13) 59px 60px, transparent 61px),
        radial-gradient(circle at 73% 48%, transparent 0 95px, rgba(61, 76, 67, .08) 96px 97px, transparent 98px);
}


.heading-monogram {
    position: absolute;
    top: 24px;
    right: 29px;
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    color: #f8faf6;
    background: #202724;
    box-shadow: 8px 8px 0 var(--heading-signal-soft);
    font: 800 17px/1 Helvetica, Arial, sans-serif;
    letter-spacing: .06em;
}

.heading-monogram::before,
.heading-monogram::after {
    content: "";
    position: absolute;
    background: var(--heading-signal);
}

.heading-monogram::before { left: -7px; bottom: 12px; width: 12px; height: 4px; }
.heading-monogram::after { right: 10px; bottom: -6px; width: 4px; height: 12px; }

.heading-visual-label {
    position: absolute;
    top: 37px;
    right: 126px;
    display: grid;
    gap: 7px;
    min-width: 156px;
    padding-top: 9px;
    color: #303a35;
    text-align: right;
    border-top: 2px solid #303a35;
}

.heading-visual-label b,
.heading-visual-label small {
    font-family: Helvetica, Arial, sans-serif !important;
    line-height: 1;
}

.heading-visual-label b { font-size: 11px; letter-spacing: .08em; }
.heading-visual-label small { color: #78847e; font-size: 8px; font-weight: 700; letter-spacing: .14em; }

.heading-axis {
    position: absolute;
    right: 26px;
    bottom: 25px;
    left: 18%;
    height: 26px;
    border-top: 1px solid rgba(46, 59, 52, .25);
}

.heading-axis::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 0;
    width: 7px;
    height: 7px;
    background: var(--heading-signal);
}

.heading-axis i {
    position: absolute;
    top: -3px;
    width: 5px;
    height: 5px;
    background: #4d5c54;
}

.heading-axis i:nth-child(1) { left: 32%; }
.heading-axis i:nth-child(2) { left: 61%; background: var(--orange); }
.heading-axis i:nth-child(3) { right: 0; }

#view-experiments .heading-visual { --heading-signal: #51aaa6; --heading-signal-soft: rgba(81, 170, 166, .16); }
#view-experiments .heading-visual::before {
    background:
        radial-gradient(circle at 65% 58%, transparent 0 29px, rgba(60, 146, 144, .24) 30px 31px, transparent 32px),
        radial-gradient(circle at 65% 58%, transparent 0 53px, rgba(60, 146, 144, .12) 54px 55px, transparent 56px),
        linear-gradient(rgba(68, 169, 164, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(68, 169, 164, .07) 1px, transparent 1px);
    background-size: auto, auto, 18px 18px, 18px 18px;
}

#view-mice .heading-visual { --heading-signal: #8fbd25; --heading-signal-soft: rgba(143, 189, 37, .17); }
#view-mice .heading-visual::before {
    background:
        repeating-linear-gradient(90deg, transparent 0 42px, rgba(72, 93, 80, .12) 42px 43px),
        repeating-linear-gradient(0deg, transparent 0 32px, rgba(72, 93, 80, .1) 32px 33px),
        linear-gradient(34deg, transparent 0 48%, rgba(143, 189, 37, .17) 48.3% 49%, transparent 49.3%);
    background-size: 224px 130px, 224px 130px, auto;
    background-position: 68% 54%, 68% 54%, center;
}

#view-reagents .heading-visual { --heading-signal: #e99a35; --heading-signal-soft: rgba(233, 154, 53, .16); }
#view-reagents .heading-visual::before {
    background:
        radial-gradient(circle at 46% 62%, #8fbd25 0 4px, transparent 5px),
        radial-gradient(circle at 60% 38%, #51aaa6 0 5px, transparent 6px),
        radial-gradient(circle at 77% 66%, #e99a35 0 5px, transparent 6px),
        linear-gradient(28deg, transparent 0 49%, rgba(61, 76, 67, .2) 49.2% 49.7%, transparent 50%),
        linear-gradient(148deg, transparent 0 49%, rgba(61, 76, 67, .16) 49.2% 49.7%, transparent 50%);
}

#view-cells .heading-visual { --heading-signal: #8fbd25; --heading-signal-soft: rgba(143, 189, 37, .18); }
#view-cells .heading-visual::before {
    background:
        radial-gradient(circle at 44% 63%, rgba(143, 189, 37, .16) 0 19px, rgba(143, 189, 37, .08) 20px 28px, transparent 29px),
        radial-gradient(circle at 65% 39%, rgba(81, 170, 166, .15) 0 14px, rgba(81, 170, 166, .07) 15px 23px, transparent 24px),
        radial-gradient(circle at 80% 70%, rgba(233, 154, 53, .12) 0 12px, rgba(233, 154, 53, .06) 13px 20px, transparent 21px),
        radial-gradient(circle at 44% 63%, rgba(64, 82, 71, .28) 0 3px, transparent 4px),
        radial-gradient(circle at 65% 39%, rgba(64, 82, 71, .22) 0 3px, transparent 4px);
}

#view-samples .heading-visual { --heading-signal: #51aaa6; --heading-signal-soft: rgba(81, 170, 166, .16); }
#view-samples .heading-visual::before {
    background:
        repeating-linear-gradient(90deg, transparent 0 19px, rgba(81, 170, 166, .12) 19px 20px),
        repeating-linear-gradient(0deg, transparent 0 19px, rgba(81, 170, 166, .12) 19px 20px),
        linear-gradient(45deg, transparent 0 48%, rgba(255, 255, 255, .7) 48.4% 49.2%, transparent 49.6%);
    background-size: 164px 164px, 164px 164px, 92px 92px;
    background-position: 61% 55%, 61% 55%, 86% 42%;
}

#view-protocols .heading-visual { --heading-signal: #8fbd25; --heading-signal-soft: rgba(143, 189, 37, .17); }
#view-protocols .heading-visual::before {
    background:
        radial-gradient(circle at 38% 58%, #8fbd25 0 5px, transparent 6px),
        radial-gradient(circle at 61% 58%, #51aaa6 0 5px, transparent 6px),
        radial-gradient(circle at 83% 58%, #e99a35 0 5px, transparent 6px),
        linear-gradient(90deg, transparent 0 38%, rgba(61, 76, 67, .23) 38.2% 83%, transparent 83.2%);
}

#view-schedule .heading-visual { --heading-signal: #e99a35; --heading-signal-soft: rgba(233, 154, 53, .16); }
#view-schedule .heading-visual::before {
    background:
        linear-gradient(90deg, transparent 0 31%, rgba(143, 189, 37, .24) 31% 69%, transparent 69%) 0 35% / 100% 9px no-repeat,
        linear-gradient(90deg, transparent 0 45%, rgba(81, 170, 166, .21) 45% 83%, transparent 83%) 0 55% / 100% 9px no-repeat,
        linear-gradient(90deg, transparent 0 37%, rgba(233, 154, 53, .21) 37% 72%, transparent 72%) 0 75% / 100% 9px no-repeat,
        repeating-linear-gradient(90deg, transparent 0 32px, rgba(61, 76, 67, .06) 32px 33px);
}

.view.active .heading-visual-label,
.view.active .heading-monogram { animation: rhineHeadingBlockIn .42s cubic-bezier(.2, .75, .2, 1) both; }
.view.active .heading-axis { animation: rhineHeadingLineIn .48s .08s ease-out both; }

@keyframes rhineHeadingBlockIn {
    from { opacity: 0; transform: translateX(14px); }
    to { opacity: 1; transform: none; }
}

@keyframes rhineHeadingLineIn {
    from { opacity: 0; transform: scaleX(.08); transform-origin: right; }
    to { opacity: 1; transform: scaleX(1); transform-origin: right; }
}

.dark-theme .page-heading.technical-heading {
    color: var(--ink);
    background:
        linear-gradient(110deg, rgba(27, 36, 32, .98) 0 54%, rgba(31, 43, 37, .98) 73%, rgba(37, 45, 39, .98) 100%),
        var(--surface);
    border-color: rgba(255, 255, 255, .08);
}

.dark-theme .heading-monogram {
    color: #202724;
    background: #f2f5ee;
}

.dark-theme .heading-visual-label { color: #e7ede8; border-color: #e7ede8; }
.dark-theme .heading-visual-label small { color: #aab6b0; }
.dark-theme .heading-axis { border-color: rgba(225, 234, 228, .34); }
.dark-theme .heading-axis i { background: #dfe7e1; }
.dark-theme .heading-visual::before { filter: brightness(1.4) saturate(1.05); }

@media (max-width: 1000px) {
    .page-heading.technical-heading { padding-right: 250px; }
    .heading-visual { width: 44%; }
    .heading-visual-label { display: none; }
}

@media (max-width: 700px) {
    .page-heading.technical-heading {
        min-height: 224px;
        padding: 26px 24px 24px;
        align-items: flex-start;
        flex-direction: column;
    }
    .page-heading.technical-heading > div:first-child:not(.heading-visual) { width: min(78%, 520px); }
    .page-heading.technical-heading > .button,
    .page-heading.technical-heading > .heading-actions {
        position: relative;
        right: auto;
        bottom: auto;
        align-self: flex-start;
        margin-top: auto;
    }
    .heading-visual { width: 58%; opacity: .48; }
    .heading-monogram { top: 20px; right: 18px; width: 58px; height: 58px; font-size: 13px; }
    .heading-axis { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .view.active .heading-visual-label,
    .view.active .heading-monogram,
    .view.active .heading-axis { animation: none !important; }
}
