@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --theme-bg: #0a0a0b;
  --theme-header-bg: #111114;
  --theme-surface: #1a1a1f;
  --theme-surface-soft: #131317;
  --theme-text: #f2ecff;
  --theme-muted: #b6b6c2;
  --theme-border: rgba(222, 222, 232, 0.24);
  --theme-border-soft: rgba(222, 222, 232, 0.14);
  --theme-accent: #a78bfa;
  --theme-accent-hover: #8b5cf6;
  --theme-accent-contrast: #13091f;
  --theme-link: #c4b5fd;
  --theme-avatar-bg: #2a2a33;
  --spectrum-violet: #a855f7;
  --spectrum-blue: #7c3aed;
  --spectrum-teal: #6d28d9;
}

html[data-theme="light"] {
  --color-bg: #fafaf8;
  --color-surface: #ffffff;
  --color-border: #e5e5e1;
  --color-ink: #17181c;
  --color-ink-secondary: #444954;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-on-accent: #ffffff;
  --spectrum-violet: #7c3aed;
  --spectrum-blue: #2563eb;
  --spectrum-teal: #0d9488;

  --theme-bg: var(--color-bg);
  --theme-header-bg: var(--color-surface);
  --theme-surface: var(--color-surface);
  --theme-surface-soft: var(--color-surface);
  --theme-text: var(--color-ink);
  --theme-muted: var(--color-ink-secondary);
  --theme-border: var(--color-border);
  --theme-border-soft: var(--color-border);
  --theme-accent: var(--color-accent);
  --theme-accent-hover: var(--color-accent-hover);
  --theme-accent-contrast: #ffffff;
  --theme-link: var(--color-accent);
  --theme-avatar-bg: color-mix(in srgb, var(--color-accent) 14%, white);
}

html,
body {
  background: var(--theme-bg) !important;
  color: var(--theme-text) !important;
  font-family: "IBM Plex Sans", system-ui, sans-serif !important;
  font-weight: 400;
}

h1,
h2,
h3,
h4,
h5,
h6,
strong,
.logo,
nav a,
.btn,
.profile-save,
#loginBtn,
#registerBtn,
button[type="submit"] {
  font-family: "IBM Plex Sans", system-ui, sans-serif !important;
  font-weight: 500 !important;
}

.calculator-output,
.numeric-result,
.data-value,
.timer-display,
.result-item strong,
#dilutionResult {
  font-family: "IBM Plex Mono", monospace !important;
  font-weight: 400;
}

header,
.top {
  background: var(--theme-header-bg) !important;
  border-bottom-color: var(--theme-border-soft) !important;
}

.card,
.main-panel,
.side-card,
.protocol-card,
.side-item,
.activity-item,
.empty-state,
.calc-box,
.profile-static,
.reference-card,
.item,
.step {
  background: var(--theme-surface) !important;
  border-color: var(--theme-border-soft) !important;
  color: var(--theme-text) !important;
}

input,
textarea,
select,
.search,
.profile-input,
.profile-select,
.avatar-picker,
.auth-menu-panel {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}

.logo,
h1,
h2,
h3,
h4,
strong {
  color: var(--theme-text);
}

.muted,
.answer,
.note,
.footer-copy,
.footer-tagline,
.profile-label,
.avatar-picker-help {
  color: var(--theme-muted);
}

nav a {
  color: var(--theme-text);
}

header nav > a {
  font-weight: 700 !important;
}

header nav #authNavSlot > a {
  font-weight: 700 !important;
}

header nav > a.nav-current {
  color: #4f2f82 !important;
  background: rgba(79, 47, 130, 0.12);
  border: 1px solid rgba(79, 47, 130, 0.24);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
}

.auth-menu-trigger.is-current .auth-menu-avatar {
  outline: 2px solid #4f2f82;
  outline-offset: 2px;
}

.auth-menu-panel {
  background: var(--theme-surface) !important;
  border: 1px solid var(--theme-border) !important;
  color: var(--theme-text) !important;
  overflow: hidden !important;
}

html[data-theme="light"] .auth-menu-panel {
  background: #f2ecff !important;
  border: 1px solid #d8c8f7 !important;
  box-shadow: 0 16px 36px rgba(79, 47, 130, 0.12) !important;
  overflow: hidden !important;
}

html[data-theme="light"] .auth-menu-header {
  border-bottom: 1px solid #d8c8f7 !important;
}

html[data-theme="light"] .auth-menu-name,
html[data-theme="light"] .auth-menu-link {
  color: #17181c !important;
}

html[data-theme="light"] .auth-menu-email {
  color: #4f5561 !important;
}

html[data-theme="light"] .auth-menu-link:hover,
html[data-theme="light"] .auth-menu-logout:hover {
  background: #e8defb !important;
}

html[data-theme="light"] .auth-menu-divider {
  background: #d8c8f7 !important;
}

html[data-theme="light"] .auth-menu-logout {
  color: #d46a7b !important;
}

nav a:hover {
  color: var(--theme-link);
}

.logo-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.logo-link:hover {
  color: inherit;
}

.logo-q {
  color: #5b2ea6 !important;
}

html:not([data-theme="light"]) .icon-action-btn {
  background: #202028 !important;
  border-color: rgba(226, 226, 234, 0.28) !important;
  color: #f2ecff !important;
}

html:not([data-theme="light"]) .icon-action-btn:hover {
  background: #2b2b35 !important;
  border-color: rgba(226, 226, 234, 0.42) !important;
}

html:not([data-theme="light"]) .version-link {
  background: rgba(232, 232, 238, 0.08) !important;
  border-color: rgba(232, 232, 238, 0.18) !important;
}

html:not([data-theme="light"]) .version-link:hover {
  background: rgba(232, 232, 238, 0.16) !important;
  border-color: rgba(232, 232, 238, 0.3) !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--theme-muted);
  opacity: 1;
}

a,
.answer a,
.footer-feedback a {
  color: var(--theme-link);
}
.footer-feedback,
.footer-feedback a,
.footer-legal-links a,
.legal-links a,
.feedback-text {
  font-weight: 400 !important;
}

.site-footer h3,
.site-footer h3 span,
.footer-tagline,
.footer-copy {
  font-weight: 400 !important;
}

.btn,
.profile-save,
#loginBtn,
#registerBtn,
button[type="submit"] {
  background: var(--theme-accent) !important;
  color: var(--theme-accent-contrast) !important;
}

.btn.new-protocol-btn,
#simplifyBtn {
  background: #4f2f82 !important;
  color: #ffffff !important;
}

#simplifyBtn {
  margin-top: 18px;
}

#saveProfileBtn {
  background: #4f2f82 !important;
  color: #ffffff !important;
}

.btn:hover,
.profile-save:hover,
#loginBtn:hover,
#registerBtn:hover,
button[type="submit"]:hover {
  background: var(--theme-accent-hover) !important;
}

.btn.new-protocol-btn:hover,
#simplifyBtn:hover {
  background: #40256a !important;
}

#saveProfileBtn:hover {
  background: #40256a !important;
}

.spectrum-band {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    var(--spectrum-violet) 0%,
    var(--spectrum-blue) 50%,
    var(--spectrum-teal) 100%
  );
}

.hero-spectrum {
  width: min(960px, calc(100% - 24px));
  margin: 8px auto 18px;
}

@media (min-width: 1360px) {
  .hero-spectrum {
    width: min(1320px, calc(100% - 8px));
  }
}

#howItWorks .mini-card {
  border-radius: 16px;
  padding: 18px;
}

#howItWorks h2,
#howItWorks .mini-card h3 {
  font-weight: 700 !important;
}

html[data-theme="light"] header,
html[data-theme="light"] .top {
  background: #dccbff !important;
  border-bottom: 1px solid #c6aef5 !important;
}

html[data-theme="light"] .hero {
  background: var(--color-bg) !important;
}

html[data-theme="light"] .hero p {
  color: var(--color-ink-secondary) !important;
}

html[data-theme="light"] #howItWorks .mini-card {
  background: #f2ecff !important;
  border: 1px solid var(--color-border) !important;
}

html[data-theme="light"] #protocol {
  background: linear-gradient(135deg, #f3ecff 0%, #e8f2ff 100%) !important;
  border: 1px solid #d6dff6 !important;
}

html[data-theme="light"] .main-panel,
html[data-theme="light"] .side-card,
html[data-theme="light"] .protocol-card,
html[data-theme="light"] .side-item,
html[data-theme="light"] .activity-item,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .work-plan-item {
  background: #f2ecff !important;
}

/* Dashboard card contrast: keep list items visually distinct from panel boxes */
html:not([data-theme="light"]) .protocol-card,
html:not([data-theme="light"]) .work-plan-item,
html:not([data-theme="light"]) .activity-item,
html:not([data-theme="light"]) #versionsList .version-link {
  background: color-mix(in srgb, var(--theme-surface-soft) 88%, #06080f 12%) !important;
  border-color: rgba(198, 204, 222, 0.22) !important;
}

html[data-theme="light"] .protocol-card,
html[data-theme="light"] .work-plan-item,
html[data-theme="light"] .activity-item,
html[data-theme="light"] #versionsList .version-link {
  background: #e9e1f9 !important;
  border-color: #ccb8ea !important;
}

html[data-theme="light"] .protocol-card:hover,
html[data-theme="light"] .work-plan-item:hover,
html[data-theme="light"] .activity-item:hover,
html[data-theme="light"] #versionsList .version-link:hover {
  background: #e3d8f7 !important;
  border-color: #bfa6e5 !important;
}

html[data-theme="light"] .profile-card {
  background: #f2ecff !important;
}

html[data-theme="light"] .profile-card .profile-checkbox {
  color: #17181c !important;
}

html[data-theme="light"] .auth-menu-avatar {
  background: linear-gradient(135deg, #4f2f82 0%, #2563eb 100%) !important;
  color: var(--color-on-accent) !important;
}

html[data-theme="light"] .site-footer h3,
html[data-theme="light"] .site-footer h3 span {
  color: #17181c !important;
}

html[data-theme="light"] .site-footer h3 span {
  color: #6f8cff !important;
}

html[data-theme="light"] .footer-feedback {
  border-top: 1px solid var(--color-border) !important;
  padding-top: 12px !important;
}

html[data-theme="light"] .feedback-text {
  color: #17181c !important;
}

/* Protocol Page Theme Sync */
#protocol {
  background: var(--theme-surface) !important;
  border-color: var(--theme-border-soft) !important;
  color: var(--theme-text) !important;
}

#protocol .result-box,
#protocol .progress-panel,
#protocol .step-card,
#protocol .check-row,
#protocol .note-box,
.share-box,
.share-choice {
  background: color-mix(in srgb, var(--theme-surface-soft) 92%, transparent) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}

#protocol .progress-panel {
  background: color-mix(in srgb, var(--theme-surface) 78%, var(--theme-surface-soft) 22%) !important;
  border-color: var(--theme-border-soft) !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18) !important;
}

#protocol .progress-top {
  color: var(--theme-muted) !important;
}

#protocol .progress-bar {
  background: color-mix(in srgb, var(--theme-surface-soft) 86%, transparent) !important;
}

#protocol .progress-fill {
  box-shadow: none !important;
}

#protocol .timer-box {
  justify-content: center !important;
  align-items: center !important;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

#protocol .protocol-jump-target {
  scroll-margin-top: 140px;
}

#protocol .protocol-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
}

#protocol .protocol-title-row h2 {
  margin: 0;
  text-align: center;
}

#protocol .protocol-title-input {
  width: min(460px, 62vw);
  max-width: 100%;
  text-align: center;
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid var(--theme-border);
  background: color-mix(in srgb, var(--theme-surface-soft) 90%, transparent);
  color: var(--theme-text);
}

#protocol .protocol-title-input:focus {
  outline: none;
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-accent) 24%, transparent);
}

#protocol .protocol-title-edit-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--theme-border);
  background: color-mix(in srgb, var(--theme-surface-soft) 88%, transparent);
  color: var(--theme-text);
  border-radius: 10px;
  padding: 0;
  font-size: 0;
  cursor: pointer;
}

#protocol .protocol-title-edit-btn svg {
  width: 18px;
  height: 18px;
}

#protocol .protocol-title-edit-btn:hover {
  background: color-mix(in srgb, var(--theme-surface-soft) 74%, transparent);
}

.protocol-jump-nav {
  position: fixed;
  left: max(24px, calc((100vw - 1200px) / 2 - 220px));
  top: 140px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 180px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--theme-border-soft);
  background: color-mix(in srgb, var(--theme-surface-soft) 92%, transparent);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
  z-index: 40;
}

html:not([data-theme="light"]) .protocol-jump-nav {
  background: rgba(9, 11, 20, 0.92);
  border-color: rgba(160, 174, 206, 0.2);
}

.protocol-jump-nav[hidden],
#timerToastStack[hidden] {
  display: none !important;
}

.protocol-jump-nav a {
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  color: var(--theme-muted);
  border: 1px solid color-mix(in srgb, var(--theme-border) 45%, transparent);
  background: color-mix(in srgb, var(--theme-surface-soft) 30%, transparent);
}

.protocol-jump-nav a.active {
  background: color-mix(in srgb, var(--theme-surface-soft) 92%, transparent) !important;
  color: var(--theme-text) !important;
  font-weight: 600;
  border-color: color-mix(in srgb, var(--theme-accent) 35%, var(--theme-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--theme-accent) 28%, transparent);
}

.protocol-jump-nav a:hover {
  color: var(--theme-text);
  border-color: var(--theme-border);
}

.protocol-jump-nav a:focus-visible {
  outline: none;
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-accent) 24%, transparent);
}

#timerToastStack {
  position: fixed;
  right: max(24px, calc((100vw - 1200px) / 2 - 260px));
  top: 140px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 50;
  width: 260px;
  pointer-events: none;
}

#timerToastStack .timer-toast {
  pointer-events: auto;
  background: color-mix(in srgb, var(--theme-surface) 96%, transparent) !important;
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

#timerToastStack .timer-toast-title {
  margin: 0 0 4px;
  font-weight: 500;
  font-size: 14px;
}

#timerToastStack .timer-toast-body {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--theme-muted);
}

#timerToastStack .timer-toast-dismiss {
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--theme-border);
  background: color-mix(in srgb, var(--theme-surface-soft) 92%, transparent);
  color: var(--theme-text);
  padding: 6px 10px;
  cursor: pointer;
}

#timerToastStack .timer-toast-dismiss:hover {
  background: color-mix(in srgb, var(--theme-surface-soft) 76%, transparent);
}

.protocol-jump-toggle {
  position: fixed;
  left: 0;
  top: 185px;
  width: 34px;
  height: 54px;
  border-radius: 0 12px 12px 0;
  border: 1px solid var(--theme-border-soft);
  border-left: none;
  background: color-mix(in srgb, var(--theme-surface-soft) 92%, transparent);
  color: var(--theme-text);
  font-size: 22px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 45;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.protocol-jump-toggle[hidden] {
  display: none !important;
}

html:not([data-theme="light"]) .protocol-jump-toggle {
  background: rgba(9, 11, 20, 0.94);
  border-color: rgba(160, 174, 206, 0.24);
}

html[data-theme="light"] .protocol-jump-toggle {
  background: #f2ecff;
  border-color: #d8c8f7;
  color: #1f3360;
}

@media (max-width: 1350px) {
  .protocol-jump-nav {
    display: flex;
    left: 8px;
    top: 136px;
    width: 172px;
    gap: 6px;
    transform: translateX(-122%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  .protocol-jump-toggle {
    display: inline-flex;
  }

  .protocol-jump-nav.is-open,
  body.protocol-nav-open .protocol-jump-nav {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  #timerToastStack {
    right: 12px;
    left: auto;
    top: 96px;
    bottom: auto;
    width: min(300px, calc(100vw - 24px));
  }
}

#protocol .timer-controls {
  gap: 8px !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
}

#protocol {
  font-size: 13px;
}

#protocol h3 {
  font-size: 1.05rem;
}

#protocol .step-check {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: flex-start;
  gap: 8px;
}

#protocol .step-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  margin-top: 3px;
  flex: 0 0 auto;
  justify-self: start;
}

#protocol .step-check strong {
  font-size: 13px;
}

#protocol .step-card p,
#protocol .step-text {
  font-size: 12px;
}

#protocol .step-text,
#protocol .step-card p,
#protocol .inline-note,
#protocol .completion-message,
#protocol .protocol-disclaimer p,
#protocol .toggle-protocol-btn,
#protocol .collapse-btn,
#protocol .edit-step-btn,
#protocol .note-toggle,
#protocol .share-btn,
#protocol .icon-btn,
#protocol .protocol-action-btn,
#protocol .print-btn,
#protocol .timer-btn,
.share-choice span,
#protocol .upload-note {
  color: var(--theme-text) !important;
}

#protocol .note-edit,
#protocol .step-edit,
#protocol .edit-list-input,
#protocol .timer-controls input,
#protocol textarea,
#protocol input,
.share-box input,
.share-box textarea,
.share-box select {
  background: var(--theme-surface-soft) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}

#protocol .timer-btn,
#protocol .toggle-protocol-btn,
#protocol .collapse-btn,
#protocol .edit-step-btn,
#protocol .note-toggle,
#protocol .icon-btn,
#protocol .share-btn,
#protocol .protocol-action-btn,
#protocol .print-btn {
  background: color-mix(in srgb, var(--theme-surface-soft) 88%, transparent) !important;
  border-color: var(--theme-border) !important;
}

#protocol .protocol-disclaimer {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--theme-surface-soft) 92%, transparent) !important;
  border: 1px solid var(--theme-border) !important;
}

#protocol .protocol-disclaimer strong {
  display: block;
  margin-bottom: 6px;
  color: var(--theme-text) !important;
  font-size: 0.95rem;
}

#protocol .protocol-disclaimer p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.share-box {
  position: relative;
}

.share-box .close-share {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #c9b7ef;
  background: #b8a3f5;
  color: #2f2152;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.share-box .close-share:hover {
  background: #a58aea;
}

.share-box > .btn {
  background: #4f2f82 !important;
  color: #ffffff !important;
}

.share-box > .btn:hover {
  background: #40256a !important;
}

#protocol .check-row.done span {
  color: #97a1b8 !important;
}

#protocol .material-check,
#protocol .prep-check {
  accent-color: #52d487 !important;
}

html:not([data-theme="light"]) #protocol .completed-step {
  background: color-mix(in srgb, var(--theme-surface) 88%, #091224 12%) !important;
  border-color: rgba(82, 212, 135, 0.42) !important;
  box-shadow: inset 0 0 0 1px rgba(82, 212, 135, 0.14) !important;
}

html:not([data-theme="light"]) #protocol .completed-step strong,
html:not([data-theme="light"]) #protocol .completed-step p,
html:not([data-theme="light"]) #protocol .completed-step .tip,
html:not([data-theme="light"]) #protocol .completed-step .timer-display,
html:not([data-theme="light"]) #protocol .completed-step .step-text {
  color: #9faecc !important;
}

html:not([data-theme="light"]) #protocol .completed-step .step-check strong {
  color: #b3c0db !important;
}

#protocol .step-badge.optional-badge {
  color: #7a4a00 !important;
  background: #fff4de !important;
  border-color: #e6c08f !important;
}

#protocol .step-badge.critical-badge {
  color: #8f2743 !important;
  background: #ffeef1 !important;
  border-color: #efbfca !important;
}

#protocol .tip {
  margin-left: 0 !important;
  font-size: 12px !important;
  background: color-mix(in srgb, var(--theme-surface-soft) 84%, #1f6b46 16%) !important;
  border-color: color-mix(in srgb, var(--theme-border) 70%, #2b7f58 30%) !important;
  color: #c7e3d6 !important;
}

#protocol .step-badge {
  font-size: 11px;
}

#protocol .tip strong {
  color: #d9efe4 !important;
}

html[data-theme="light"] #protocol .tip {
  background: #bfd4ca !important;
  border: 1px solid #a7c2b6 !important;
  color: #173626 !important;
}

html[data-theme="light"] #protocol .tip strong {
  color: #0f2f1f !important;
}

#protocol .completed-step .tip,
#protocol .completed-step .tip strong {
  color: #c7e3d6 !important;
}

html[data-theme="light"] #protocol .result-box,
html[data-theme="light"] #protocol .progress-panel,
html[data-theme="light"] #protocol .step-card,
html[data-theme="light"] #protocol .check-row,
html[data-theme="light"] #protocol .note-box,
html[data-theme="light"] .share-box,
html[data-theme="light"] .share-choice {
  background: #f2ecff !important;
  border-color: #d8c8f7 !important;
  color: #17181c !important;
}

html[data-theme="light"] #protocol .progress-panel {
  background: #efe8fb !important;
  border-color: #ddd1f3 !important;
  box-shadow: 0 4px 12px rgba(79, 47, 130, 0.08) !important;
}

html[data-theme="light"] .share-box .close-share {
  border-color: #c9b7ef;
  background: #b8a3f5;
  color: #2f2152;
}

html[data-theme="light"] .share-box .close-share:hover {
  background: #a58aea;
}

html[data-theme="light"] #protocol .step-text,
html[data-theme="light"] #protocol .step-card p,
html[data-theme="light"] #protocol .inline-note,
html[data-theme="light"] #protocol .timer-display,
html[data-theme="light"] #protocol .completion-message,
html[data-theme="light"] #protocol .protocol-disclaimer p,
html[data-theme="light"] #protocol .upload-note,
html[data-theme="light"] #protocol .share-choice span {
  color: #1f2533 !important;
}

html[data-theme="light"] #protocol .inline-note {
  color: #8a5a00 !important;
}

html[data-theme="light"] #protocol .inline-note strong {
  color: #b06b00 !important;
}

html[data-theme="light"] #protocol .protocol-disclaimer {
  background: #f2ecff !important;
  border-color: #d8c8f7 !important;
}

html[data-theme="light"] #protocol .progress-bar {
  background: #e6ddf7 !important;
}

html[data-theme="light"] #protocol .step-edit,
html[data-theme="light"] #protocol .note-edit,
html[data-theme="light"] #protocol .edit-list-input,
html[data-theme="light"] #protocol .timer-controls input,
html[data-theme="light"] .share-box input,
html[data-theme="light"] .share-box textarea,
html[data-theme="light"] .share-box select {
  background: #ffffff !important;
  border-color: #d6dff6 !important;
  color: #17181c !important;
}

html[data-theme="light"] #protocol .timer-btn,
html[data-theme="light"] #protocol .toggle-protocol-btn,
html[data-theme="light"] #protocol .collapse-btn,
html[data-theme="light"] #protocol .edit-step-btn,
html[data-theme="light"] #protocol .note-toggle,
html[data-theme="light"] #protocol .icon-btn,
html[data-theme="light"] #protocol .share-btn,
html[data-theme="light"] #protocol .protocol-action-btn,
html[data-theme="light"] #protocol .print-btn,
html[data-theme="light"] #protocol .protocol-title-edit-btn {
  background: #f3f6ff !important;
  border-color: #ccd6ee !important;
  color: #1f3360 !important;
}

html[data-theme="light"] #timerToastStack .timer-toast {
  background: #f2ecff !important;
  border-color: #d8c8f7 !important;
  box-shadow: 0 8px 22px rgba(79, 47, 130, 0.14);
}

html[data-theme="light"] #timerToastStack .timer-toast-title {
  color: #1b2438 !important;
}

html[data-theme="light"] #timerToastStack .timer-toast-body {
  color: #3c4b67 !important;
}

html[data-theme="light"] #timerToastStack .timer-toast-dismiss {
  background: #f8f5ff !important;
  border-color: #cdbde9 !important;
  color: #1f3360 !important;
}

html[data-theme="light"] #protocol .check-row.done span {
  color: #666f83 !important;
}

html[data-theme="light"] #protocol .material-check,
html[data-theme="light"] #protocol .prep-check {
  accent-color: #52d487 !important;
}

html[data-theme="light"] #protocol .completed-step {
  background: #ddd4f3 !important;
  border-color: #beb0e3 !important;
}

html[data-theme="light"] #protocol .completed-step strong,
html[data-theme="light"] #protocol .completed-step p,
html[data-theme="light"] #protocol .completed-step .tip,
html[data-theme="light"] #protocol .completed-step .timer-display {
  color: #3b4356 !important;
}

html[data-theme="light"] .share-modal {
  background: rgba(21, 24, 33, 0.32) !important;
}

/* Calculator Theme Sync */
.calc-box {
  background: var(--theme-surface) !important;
  border: 1px solid var(--theme-border-soft) !important;
  color: var(--theme-text) !important;
}

.calc-box .calc-title,
.calc-box .calc-subtitle,
.calc-box .equation-title,
.calc-box .equation-subtitle,
.calc-box h3,
.calc-box h4,
.calc-box p,
.calc-box label,
.calc-box th,
.calc-box td,
.calc-box span {
  color: var(--theme-text) !important;
}

.calc-box input,
.calc-box select,
.calc-box textarea,
.calc-box .pcr-recipe-table input,
.calc-box .dna-inputs input,
.calc-box .dna-inputs select,
.calc-box .equation-item input,
.calc-box .equation-item select {
  background: var(--theme-surface-soft) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}

.calc-tabs button,
.calc-box .timer-btn,
.calc-box .reference-btn,
.calc-box .reset-btn,
.calc-box .pcr-reset-btn,
.calc-box .cell-action-btn,
.calc-box .cell-method-card,
.calc-box .calc-tab {
  background: color-mix(in srgb, var(--theme-surface-soft) 88%, transparent) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}
.calc-box .calc-save-btn {
  background: color-mix(in srgb, var(--theme-surface-soft) 88%, transparent) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
}
.calc-box .calc-save-btn:hover {
  background: color-mix(in srgb, var(--theme-surface-soft) 72%, transparent) !important;
}

.calc-tab.active,
.calc-box .cell-method-card.active,
.calc-box .cell-action-btn.active,
.calc-box .serial-choice.active {
  background: #b8a3f5 !important;
  border-color: #9a83e8 !important;
  color: #17181c !important;
  box-shadow: 0 0 0 2px rgba(154, 131, 232, 0.24) !important;
}

.calc-box .btn,
.calc-box .primary-action,
.calc-box .pcr-calc-btn,
.calc-box .calculate-btn {
  background: #4f2f82 !important;
  color: #ffffff !important;
}

.calc-box .close-btn {
  color: var(--theme-text) !important;
}

.calc-box .close-btn:hover {
  color: #eef4ff !important;
}

html[data-theme="light"] .calc-box .close-btn {
  color: #2f2152 !important;
}

html[data-theme="light"] .calc-box .close-btn:hover {
  color: #1f1538 !important;
}

.calc-box .pcr-calc-btn,
.calc-box .calculate-btn {
  display: block !important;
  margin: 18px auto !important;
}

.calc-box .pcr-button-row .pcr-calc-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
}

.calc-box .dilution-equation {
  text-align: center !important;
}

.calc-box .dilution-equation .equation-grid {
  justify-content: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.calc-box .dilution-equation .equation-item {
  align-items: center !important;
}

.calc-box .dilution-equation .equation-item label {
  text-align: center !important;
}

.calc-box #dilutionResult {
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
}

.calc-box #dilutionResult .dilution-result-compact,
.calc-box #dilutionResult .result-card,
.calc-box #dilutionResult .result-title,
.calc-box #dilutionResult .result-item {
  text-align: center !important;
}

.calc-box .btn:hover,
.calc-box .primary-action:hover,
.calc-box .pcr-calc-btn:hover,
.calc-box .calculate-btn:hover {
  background: #40256a !important;
}

.calc-box .pcr-button-row .pcr-reset-btn {
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  border: 1px solid rgba(184, 163, 245, 0.38) !important;
  border-radius: 12px !important;
  background: rgba(184, 163, 245, 0.14) !important;
  color: var(--theme-text) !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 0 !important;
}

.calc-box .pcr-button-row .pcr-reset-btn:hover {
  background: rgba(184, 163, 245, 0.24) !important;
  border-color: rgba(184, 163, 245, 0.52) !important;
  color: var(--theme-text) !important;
}

.calc-box .equation-symbol {
  color: var(--theme-text) !important;
}

.calc-box .reference-card,
.calc-box .result-card,
.calc-box .dna-card,
.calc-box .pcr-recipe,
.calc-box .workflow-result-card,
.calc-box .cell-result-card,
.calc-box .copy-number-result,
.calc-box .combined-result-card,
.calc-box .quant-result-card,
.calc-box .purity-overall:not(.good):not(.warn):not(.bad),
.calc-box .purity-metric:not(.good):not(.warn):not(.bad) {
  background: color-mix(in srgb, var(--theme-surface-soft) 92%, transparent) !important;
  border-color: var(--theme-border-soft) !important;
  color: var(--theme-text) !important;
}

.calc-box .dilution-result-compact {
  background: color-mix(in srgb, var(--theme-surface-soft) 92%, transparent) !important;
  border: 1px solid var(--theme-border-soft) !important;
  color: var(--theme-text) !important;
}

.calc-box #result,
.calc-box .result-card,
.calc-box .workflow-result-card,
.calc-box .cell-result-card,
.calc-box .workflow-line,
.calc-box .workflow-stat,
.calc-box .workflow-stat strong,
.calc-box .protocol-step,
.calc-box .protocol-step strong,
.calc-box .protocol-step p,
.calc-box .result-item,
.calc-box .result-item span,
.calc-box .result-item strong {
  font-family: "IBM Plex Sans", system-ui, sans-serif !important;
}

.calc-box .purity-row span,
.calc-box .purity-row p {
  display: inline !important;
}

.calc-box .purity-row p {
  margin: 0 0 0 8px !important;
}

.calc-box .copy-main span,
.calc-box .copy-extra-grid span {
  font-weight: 700 !important;
}

.calc-box .dna-card h4,
.calc-box .dna-section-label,
.calc-box .dna-card .optional {
  text-align: center !important;
}

.calc-box .dna-section-label {
  width: 100%;
  margin: 10px 0 0 !important;
  font-weight: 700 !important;
}

.calc-box .dna-actions {
  justify-content: center !important;
}

.calc-box .quant-result-card .quant-header {
  position: relative;
  justify-content: center !important;
  text-align: center;
}

.calc-box .quant-result-card .quant-header {
  justify-content: center !important;
  position: relative;
}

.calc-box .quant-result-card .quant-header span {
  margin: 0 !important;
  text-align: center;
}

.calc-box .quant-result-card .quant-header .result-actions {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  margin-left: 0 !important;
}

.calc-box .quant-result-card .quant-yield-line {
  justify-content: center !important;
  text-align: center;
  flex-direction: column !important;
  align-items: center !important;
}

.calc-box .copy-number-result .copy-based-on,
.calc-box .copy-number-result .copy-main,
.calc-box .copy-number-result .copy-extra-grid {
  text-align: center !important;
}

.calc-box .result-item {
  border-bottom-color: var(--theme-border-soft) !important;
}

.calc-box .result-item strong,
.calc-box .timer-display,
.calc-box .pcr-summary strong,
.calc-box .pcr-summary span {
  color: var(--theme-link) !important;
}

.calc-box .result-print-btn {
  background: color-mix(in srgb, var(--theme-surface-soft) 85%, transparent) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
  display: flex !important;
  visibility: visible !important;
}

.calc-box .result-save-btn {
  background: color-mix(in srgb, var(--theme-surface-soft) 85%, transparent) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
  display: flex !important;
  visibility: visible !important;
}

.calc-box .quant-header .result-print-btn,
.calc-box .quant-header .result-save-btn {
  background: color-mix(in srgb, var(--theme-surface-soft) 85%, transparent) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text) !important;
  display: flex !important;
  visibility: visible !important;
}

.calc-fab {
  background: #4f2f82 !important;
  border-color: rgba(79, 47, 130, 0.45) !important;
  color: #ffffff !important;
}

.calc-fab .calc-fab-icon {
  width: 26px;
  height: 26px;
  display: block;
}

html[data-theme="light"] .calc-box {
  background: linear-gradient(135deg, #f3ecff 0%, #e8f2ff 100%) !important;
  border-color: #d6dff6 !important;
}

html[data-theme="light"] .calc-box input,
html[data-theme="light"] .calc-box select,
html[data-theme="light"] .calc-box textarea {
  background: #ffffff !important;
  border-color: #d6dff6 !important;
}

html[data-theme="light"] .calc-box .quality-card.good,
html[data-theme="light"] .calc-box .purity-overall.good,
html[data-theme="light"] .calc-box .purity-metric.good {
  background: #e8f7ef !important;
  border: 1px solid #8fd0ac !important;
  color: #1f6b46 !important;
}

html[data-theme="light"] .calc-box .quality-card.warn,
html[data-theme="light"] .calc-box .purity-overall.warn,
html[data-theme="light"] .calc-box .purity-metric.warn {
  background: #fff5e6 !important;
  border: 1px solid #f0be73 !important;
  color: #915f13 !important;
}

html[data-theme="light"] .calc-box .purity-badge.warn {
  background: #fff3de !important;
  border: 1px solid #e2c089 !important;
  color: #9a6a16 !important;
}

html[data-theme="light"] .calc-box .purity-badge.good {
  background: #e7f3ea !important;
  border: 1px solid #a8cdb3 !important;
  color: #2f7d4f !important;
}

html[data-theme="light"] .calc-box .purity-row.warn b,
html[data-theme="light"] .calc-box .purity-row.warn p {
  color: #9a6a16 !important;
}

html[data-theme="light"] .calc-box .purity-row.good b,
html[data-theme="light"] .calc-box .purity-row.good p {
  color: #2f7d4f !important;
}

html[data-theme="light"] .calc-box .purity-badge.bad {
  background: #f8e9ec !important;
  border: 1px solid #d9a9b3 !important;
  color: #9b3e52 !important;
}

html[data-theme="light"] .calc-box .purity-row.bad b,
html[data-theme="light"] .calc-box .purity-row.bad p {
  color: #9b3e52 !important;
}

html[data-theme="light"] .calc-box .quality-card.bad,
html[data-theme="light"] .calc-box .purity-overall.bad,
html[data-theme="light"] .calc-box .purity-metric.bad,
html[data-theme="light"] .calc-box .error-card {
  background: #f8e9ec !important;
  border: 1px solid #d9a9b3 !important;
  color: #9b3e52 !important;
}

html[data-theme="light"] .calc-box .quality-card.bad,
html[data-theme="light"] .calc-box .purity-overall.bad,
html[data-theme="light"] .calc-box .purity-metric.bad,
html[data-theme="light"] .calc-box .error-card {
  background: #fdecef !important;
  border: 1px solid #e6a0ab !important;
  color: #9e2e44 !important;
}

html[data-theme="light"] .calc-box .workflow-result-card,
html[data-theme="light"] .calc-box .workflow-protocol,
html[data-theme="light"] .calc-box .workflow-stat,
html[data-theme="light"] .calc-box .cell-mini-summary,
html[data-theme="light"] .calc-box .dilution-result-compact,
html[data-theme="light"] .calc-box .result-card,
html[data-theme="light"] .calc-box .combined-result-card,
html[data-theme="light"] .calc-box .copy-number-result,
html[data-theme="light"] .calc-box .quant-result-card,
html[data-theme="light"] .calc-box .stock-result-card {
  background: #f2ecff !important;
  border-color: #d8c8f7 !important;
}

html[data-theme="light"] .calc-box .workflow-header,
html[data-theme="light"] .calc-box .workflow-protocol h4,
html[data-theme="light"] .calc-box .workflow-line,
html[data-theme="light"] .calc-box .workflow-line b,
html[data-theme="light"] .calc-box .protocol-title,
html[data-theme="light"] .calc-box .protocol-step strong,
html[data-theme="light"] .calc-box .result-item span,
html[data-theme="light"] .calc-box .result-item strong,
html[data-theme="light"] .calc-box .dilution-result-compact,
html[data-theme="light"] .calc-box .equation-symbol,
html[data-theme="light"] .calc-box .quant-yield-line strong,
html[data-theme="light"] .calc-box .copy-main strong,
html[data-theme="light"] .calc-box .copy-extra-grid strong,
html[data-theme="light"] .calc-box .yield-strip strong,
html[data-theme="light"] .calc-box .combined-yield-card strong,
html[data-theme="light"] .calc-box .combined-yield-card span,
html[data-theme="light"] .calc-box .cell-result-card strong,
html[data-theme="light"] .calc-box .cell-result-card span,
html[data-theme="light"] .calc-box .pcr-summary strong,
html[data-theme="light"] .calc-box .pcr-summary span,
html[data-theme="light"] .calc-box .timer-display,
html[data-theme="light"] .calc-box .workflow-stat strong,
html[data-theme="light"] .calc-box .workflow-stat span {
  color: #4f2f82 !important;
}

html[data-theme="light"] .calc-box .quant-yield-secondary {
  color: #6b5b95 !important;
}
html[data-theme="light"] .calc-box .calc-save-btn {
  background: #f3f6ff !important;
  border-color: #c9d4ee !important;
  color: #2f2152 !important;
}
html[data-theme="light"] .calc-box .calc-save-btn:hover {
  background: #e9efff !important;
}

html[data-theme="light"] .calc-box .result-actions .result-print-btn,
html[data-theme="light"] .calc-box .result-actions .result-save-btn,
html[data-theme="light"] .calc-box .quant-header .result-print-btn,
html[data-theme="light"] .calc-box .quant-header .result-save-btn {
  background: #f3f6ff !important;
  border-color: #c9d4ee !important;
  color: #2f2152 !important;
  display: flex !important;
  visibility: visible !important;
}

html[data-theme="light"] .calc-box .result-actions .result-print-btn:hover,
html[data-theme="light"] .calc-box .result-actions .result-save-btn:hover,
html[data-theme="light"] .calc-box .quant-header .result-print-btn:hover,
html[data-theme="light"] .calc-box .quant-header .result-save-btn:hover {
  background: #e9efff !important;
  border-color: #b6c6e7 !important;
}

html[data-theme="light"] .calc-box .workflow-line b,
html[data-theme="light"] .calc-box .step-number {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: inline !important;
  padding: 0 !important;
  color: #1d4ed8 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .calc-box .calc-row select,
html[data-theme="light"] .calc-box .equation-item select,
html[data-theme="light"] .calc-box .dna-inputs select,
html[data-theme="light"] .calc-box .dna-inputs small,
html[data-theme="light"] .calc-box .cell-inputs select,
html[data-theme="light"] .calc-box .cell-inline select,
html[data-theme="light"] .calc-box .counter-inputs select,
html[data-theme="light"] .calc-box .unit-input small,
html[data-theme="light"] .calc-box .counter-unit,
html[data-theme="light"] .calc-box .pcr-recipe-table td:last-child {
  color: #17181c !important;
  font-weight: 400 !important;
}

html[data-theme="light"] .calc-box #stockResult {
  margin-top: 20px !important;
}

.calc-box #stockResult {
  text-align: center !important;
}

html[data-theme="light"] .calc-box #stockPrintArea {
  background: #f2ecff !important;
  border: 1px solid #d8c8f7 !important;
  border-radius: 16px !important;
  padding: 16px !important;
}

.calc-box #stockPrintArea {
  margin-left: auto !important;
  margin-right: auto !important;
}

.calc-box .stock-summary,
.calc-box .stock-primary-line,
.calc-box .stock-secondary-line,
.calc-box .stock-note-line {
  text-align: center !important;
}

.calc-box .stock-summary {
  margin: 0 auto !important;
}

.calc-box .stock-note-line {
  max-width: 460px;
  margin-left: auto !important;
  margin-right: auto !important;
}

html[data-theme="light"] .calc-box #stockPrintArea .stock-primary-line {
  color: #4f2f82 !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .calc-box #stockPrintArea .stock-secondary-line,
html[data-theme="light"] .calc-box #stockPrintArea .stock-note-line,
html[data-theme="light"] .calc-box #stockPrintArea .stock-note-line strong {
  color: #17181c !important;
  font-weight: 400 !important;
}

