:root {
  color-scheme: light;
  --ink: #1b302a;
  --muted: #788780;
  --green: #397c5d;
  --green-dark: #286247;
  --line: #e6ebe6;
  --paper: #f5f7f3;
  --white: #fff;
  font-family: "Segoe UI", "Segoe UI Variable", Arial, sans-serif;
  --font-display: Cambria, "Cambria Math", Georgia, serif;
  --font-mono: Consolas, "Cascadia Mono", "Courier New", monospace;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 12% 15%, rgba(227, 237, 223, .55), transparent 34rem),
    var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

button, input, select { font: inherit; }

.topbar {
  height: 78px;
  padding: 0 max(5vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(27, 48, 42, .07);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 19px var(--font-display); letter-spacing: -.35px; transition: transform .2s ease; }
.brand:hover { transform: scale(1.02); }
.brand-logo { height: 44px; width: auto; display: block; object-fit: contain; }
.auth-dialog-logo { display: block; margin: 0 auto 12px; height: 52px; width: auto; }
.admin-dialog-logo { height: 42px; width: auto; display: block; }
.footer-logo { height: 28px; width: auto; display: block; opacity: .85; }
.brand-mark { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px 10px 10px 3px; background: var(--green); color: white; font-size: 16px; }
.brand-accent { color: var(--green); }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.topbar-note { color: #718078; font-size: 10px; font-weight: 700; letter-spacing: 1.15px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #64a880; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(100, 168, 128, .13); }
.lang-switch-group { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border: 1px solid #dce7de; border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(27,48,42,0.04); }
.lang-btn { border: 0; background: transparent; color: #788a80; cursor: pointer; font-size: 11px; font-weight: 700; padding: 3px 6px; border-radius: 5px; transition: all .15s ease; }
.lang-btn:hover { color: var(--green-dark); background: #f0f6f2; }
.lang-btn.active { background: var(--green); color: #fff; box-shadow: 0 1px 3px rgba(40,98,71,0.25); }
.lang-sep { font-size: 10px; color: #cbd5ce; user-select: none; }

.auth-lang-selector-box { margin: 10px 0 14px; padding: 10px 12px; background: #f0f6f2; border: 1px solid #d4e4d9; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.auth-lang-selector-box label { font-size: 11px; color: #32473b; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.auth-lang-selector-box select { height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid #b8d2c1; background: #fff; font-size: 11px; font-weight: 700; color: var(--green-dark); cursor: pointer; }

.auth-trigger { min-height: 36px; padding: 0 13px; border: 1px solid #dce7de; border-radius: 7px; background: #fff; color: var(--green-dark); cursor: pointer; font-size: 11px; font-weight: 700; }
.auth-trigger:hover { border-color: #9fbea8; background: #f8fbf8; }
.auth-trigger:disabled { cursor: wait; opacity: .65; }

.auth-dialog { position: relative; width: min(100% - 32px, 420px); max-height: min(90dvh, 720px); padding: 31px 32px 28px; overflow-y: auto; border: 1px solid rgba(28, 54, 43, .09); border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 24px 80px rgba(27, 48, 42, .2); }
.auth-dialog::backdrop { background: rgba(22, 38, 31, .42); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 12px; right: 14px; display: grid; width: 31px; height: 31px; place-items: center; border: 0; border-radius: 50%; background: #f2f6f2; color: #708077; cursor: pointer; font-size: 21px; line-height: 1; }
.auth-dialog-heading { text-align: center; }
.auth-dialog-heading .eyebrow { margin-bottom: 6px; font-size: 9px; }
.auth-dialog-heading h2 { margin: 0; font: 700 22px var(--font-display); letter-spacing: -.35px; }
.auth-subtitle { margin: 8px 0 19px; color: #829087; font-size: 11px; line-height: 1.5; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 18px; padding: 4px; border-radius: 8px; background: #f3f6f3; }
.auth-tab { min-height: 34px; border: 0; border-radius: 6px; background: transparent; color: #77857b; cursor: pointer; font-size: 11px; font-weight: 600; }
.auth-tab.active { background: #fff; color: var(--green-dark); box-shadow: 0 1px 4px rgba(27, 48, 42, .09); }
.auth-field { margin-top: 14px; }
.auth-field[hidden] { display: none; }
.auth-field label { display: block; margin-bottom: 6px; color: #596a5f; font-size: 11px; font-weight: 600; }
.auth-field input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid #e2e9e3; border-radius: 7px; background: #fcfdfc; color: var(--ink); font-size: 12px; outline: none; }
.auth-field input:focus { border-color: #8bb69b; box-shadow: 0 0 0 3px rgba(77, 139, 101, .1); }
.auth-field input::placeholder { color: #aab5ad; }
.field-hint { display: block; margin-top: 5px; color: #89958d; font-size: 9px; line-height: 1.5; }
.auth-submit { width: 100%; min-height: 43px; margin-top: 19px; border: 0; border-radius: 7px; background: var(--green); color: white; cursor: pointer; font-size: 12px; font-weight: 700; }
.auth-submit:hover:not(:disabled) { background: var(--green-dark); }
.auth-submit:disabled { cursor: not-allowed; opacity: .6; }
.auth-message, .auth-config-notice { margin: 13px 0 0; padding: 10px 11px; border-radius: 7px; background: #f1f5f1; color: #607267; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }
.auth-message.error { background: #fff2ed; color: #a44a34; }
.auth-message.success { background: #edf7ef; color: #356948; }
.auth-config-notice { background: #fff7e9; color: #805b26; }
.auth-message[hidden], .auth-config-notice[hidden] { display: none; }

main { max-width: 1050px; margin: 0 auto; padding: 32px 24px 34px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1.6px; }

.lab-card { padding: 31px 34px 28px; border: 1px solid rgba(28, 54, 43, .06); border-radius: 18px; background: var(--white); box-shadow: 0 16px 48px rgba(35, 62, 46, .065); }
.lab-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.lab-heading .eyebrow { margin-bottom: 5px; }
.lesson-number { margin-left: 7px; padding: 3px 6px; border-radius: 5px; background: #f0f5ef; color: #839188; font-size: 9px; letter-spacing: .5px; }
.lab-heading h2 { margin: 0; font: 700 20px var(--font-display); letter-spacing: -.2px; }
.text-button { padding: 8px 0 8px 8px; border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 12px; font-weight: 700; }
.text-button span { margin-left: 4px; }

/* Hazard Presets Bar */
.hazard-presets-bar { margin-bottom: 20px; padding: 14px 16px; border-radius: 12px; background: linear-gradient(135deg, #fffbf5 0%, #fff7ed 100%); border: 1.5px solid #fed7aa; box-shadow: 0 4px 16px rgba(194, 65, 12, 0.06); }
.hazard-presets-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hazard-shield-icon { font-size: 22px; flex: none; }
.hazard-presets-header strong { display: block; font-size: 12px; color: #9a3412; letter-spacing: -.1px; }
.hazard-presets-header small { display: block; font-size: 10px; color: #7c2d12; opacity: .85; margin-top: 1px; }
.hazard-presets-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.hazard-btn { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 8px; border: 1px solid #fed7aa; background: #fff; color: #431407; font-size: 10px; font-weight: 700; cursor: pointer; transition: all .2s ease; text-align: left; }
.hazard-btn:hover { border-color: #f97316; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(234, 88, 12, 0.15); background: #fff7ed; }
.hazard-btn .hazard-icon { font-size: 14px; flex: none; }

.flasks { display: grid; grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr) 34px minmax(0, 1fr); align-items: center; gap: 14px; }
.flask-card { min-width: 0; padding: 14px 15px 11px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .2s, background .2s; }
.flask-topline { display: flex; align-items: center; gap: 7px; color: #89958e; font-size: 9px; font-weight: 700; letter-spacing: .75px; }
.step-index { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 6px; background: #f0f5ef; color: var(--green); font-size: 10px; letter-spacing: 0; }
.vessel-wrap { height: 105px; display: grid; place-items: center; position: relative; }
.vessel { position: relative; width: 52px; height: 67px; margin-top: 16px; border: 2px solid #b9cbc0; border-top: 0; border-radius: 4px 4px 13px 13px; background: rgba(244, 249, 245, .35); transform: perspective(60px) rotateX(-2deg); overflow: hidden; box-shadow: inset 0 2px 6px rgba(0,0,0,.03); }
.vessel::before { position: absolute; z-index: 2; top: -6px; left: 11px; width: 26px; height: 8px; border: 2px solid #b9cbc0; border-radius: 4px 4px 2px 2px; background: #fff; content: ""; }
.vessel::after { position: absolute; right: -4px; bottom: 9px; left: -4px; height: 1px; background: rgba(101, 139, 116, .16); box-shadow: 0 -8px 0 rgba(101, 139, 116, .1), 0 -16px 0 rgba(101, 139, 116, .08); content: ""; }

/* Dynamic realistic liquid & solid appearance */
.vessel-liquid { position: absolute; right: 0; bottom: 0; left: 0; height: 58%; background: rgba(139, 197, 166, .39); border-radius: 0 0 10px 10px; transition: height .4s ease, background-color .4s ease, opacity .4s ease; }
.vessel-sediment { position: absolute; bottom: 0; left: 0; right: 0; height: 0; border-radius: 0 0 10px 10px; transition: height .5s ease, background .4s ease; z-index: 2; }
.vessel-sediment.active-white { height: 32%; background: linear-gradient(to top, rgba(255,255,255,0.98), rgba(241,245,249,0.85)); box-shadow: 0 -2px 5px rgba(255,255,255,0.5); }
.vessel-sediment.active-blue { height: 35%; background: linear-gradient(to top, rgba(2,132,199,0.95), rgba(56,189,248,0.75)); box-shadow: 0 -2px 6px rgba(2,132,199,0.4); }
.vessel-sediment.active-copper { height: 28%; background: linear-gradient(to top, rgba(180,83,9,0.95), rgba(217,119,6,0.8)); box-shadow: 0 -2px 5px rgba(180,83,9,0.4); }
.vessel-sediment.active-iron { height: 45%; background: linear-gradient(to top, rgba(71,85,105,0.95), rgba(100,116,139,0.9)); }
.vessel-sediment.active-brown { height: 35%; background: linear-gradient(to top, rgba(154,52,18,0.95), rgba(194,65,12,0.8)); box-shadow: 0 -2px 6px rgba(154,52,18,0.4); }
.vessel-sediment.active-silver { height: 30%; background: linear-gradient(to top, rgba(226,232,240,0.98), rgba(148,163,184,0.85)); box-shadow: 0 -2px 6px rgba(226,232,240,0.5); }

/* Hazardous Reaction Sediments */
.vessel-sediment.active-sodium-spark { height: 35%; background: radial-gradient(circle at 50% 30%, #ffedd5, #f59e0b, #b45309); box-shadow: 0 0 12px rgba(245, 158, 11, 0.85); animation: sparkPulse .8s infinite alternate; }
@keyframes sparkPulse {
  0% { filter: brightness(1) drop-shadow(0 0 4px #f59e0b); transform: scaleY(0.95); }
  100% { filter: brightness(1.3) drop-shadow(0 0 10px #f97316); transform: scaleY(1.05); }
}
.vessel-sediment.active-carbon-snake { height: 85%; background: linear-gradient(to top, #020617, #0f172a, #334155); border-radius: 8px 8px 10px 10px; box-shadow: 0 -4px 10px rgba(0,0,0,0.6); animation: growSnake 1.5s ease-out; }
@keyframes growSnake {
  0% { height: 10%; }
  100% { height: 85%; }
}
.vessel-sediment.active-copper-dissolving { height: 30%; background: linear-gradient(to top, rgba(2, 132, 199, 0.9), rgba(16, 185, 129, 0.7)); box-shadow: 0 -2px 8px rgba(2, 132, 199, 0.5); }

/* Gas Bubbles Animation */
.vessel-bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; display: none; }
.vessel-bubbles.active { display: block; }
.vessel-bubbles span { position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,0.8); box-shadow: 0 0 3px rgba(255,255,255,0.9); animation: riseBubbles 1.2s infinite linear; }
.vessel-bubbles span:nth-child(1) { left: 25%; animation-delay: 0s; }
.vessel-bubbles span:nth-child(2) { left: 50%; animation-delay: 0.35s; width: 5px; height: 5px; }
.vessel-bubbles span:nth-child(3) { left: 70%; animation-delay: 0.7s; }
.vessel-bubbles span:nth-child(4) { left: 38%; animation-delay: 0.9s; width: 3px; height: 3px; }
@keyframes riseBubbles {
  0% { transform: translateY(0) scale(0.6); opacity: 0.2; }
  50% { opacity: 0.9; }
  100% { transform: translateY(-50px) scale(1.2); opacity: 0; }
}

.vessel-mark { position: absolute; z-index: 4; inset: 26px 0 auto; text-align: center; color: #688175; font: 700 12px var(--font-display); }
.mix-symbol, .arrow-symbol { display: grid; place-items: center; color: #9aaa9f; }
.mix-symbol span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #f1f5f1; font-size: 17px; }
.arrow-symbol { font-size: 23px; }
.flask-card label { display: block; margin: 10px 0 6px; color: #77847c; font-size: 10px; font-weight: 600; }
.flask-card label span { color: #9ba69f; font-weight: 400; }
.flask-card > input, .amount-field { width: 100%; height: 37px; border: 1px solid #e7ece8; border-radius: 7px; background: #fcfdfc; }
.flask-card > input { padding: 0 9px; color: var(--ink); font-size: 11px; outline: none; }
.flask-card > input:focus, .amount-field:focus-within, select:focus { border-color: #8bb69b; box-shadow: 0 0 0 3px rgba(77, 139, 101, .1); outline: none; }
.flask-card input::placeholder { color: #abb4ae; }
.amount-field { display: flex; align-items: center; }
.amount-field input { width: 100%; min-width: 0; padding: 0 9px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.amount-field span { padding: 0 9px; color: #91a097; font-size: 10px; }
.flask-appearance { display: inline-block; margin-top: 5px; padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: 600; background: #f0f5f1; color: #58695f; }
.flask-status { min-height: 15px; margin: 6px 0 0; color: #96a29b; font-size: 9px; }

.result-card { min-height: 304px; background: #fbfcfb; }
.result-card h3 { margin: 5px 0 6px; text-align: center; font: 700 14px var(--font-display); }
.result-hint { margin: 0 auto; max-width: 175px; color: #8a968f; text-align: center; font-size: 10px; line-height: 1.55; }
.result-card .vessel-wrap { height: 105px; }

/* Phenomenon Box in Result Card */
.phenomenon-box { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #f0f7f3; border: 1px solid #cce2d3; text-align: left; }
.phenomenon-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.phenomenon-header strong { font-size: 10px; color: var(--green-dark); letter-spacing: .3px; }
.phenomenon-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.phenomenon-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 10px; font-size: 9px; font-weight: 700; }
.pbadge-precipitate { background: #f1f5f9; color: #1e293b; border: 1px solid #cbd5e1; }
.pbadge-precipitate-blue { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.pbadge-precipitate-brown { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.pbadge-gas { background: #e0f2fe; color: #0284c7; border: 1px solid #bae6fd; }
.pbadge-metal { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.pbadge-metal-silver { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.pbadge-heat { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.pbadge-neutral { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.pbadge-hazard { background: #fee2e2; color: #991b1b; border: 1px solid #f87171; box-shadow: 0 0 6px rgba(239, 68, 68, 0.2); }
.pbadge-flash { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; box-shadow: 0 0 8px rgba(250, 204, 21, 0.5); }
.pbadge-gas-no2 { background: #ffedd5; color: #9a3412; border: 1px solid #fb923c; }
.pbadge-gas-cl2 { background: #fef08a; color: #713f12; border: 1px solid #eab308; }
.pbadge-carbon { background: #1e293b; color: #f8fafc; border: 1px solid #0f172a; }
.phenomenon-desc { margin: 0; font-size: 10px; color: #3d5045; line-height: 1.55; }

/* GHS Safety & Hazard Warning Card */
.ghs-safety-card { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #fff5f5; border: 1.5px solid #fca5a5; box-shadow: 0 4px 14px rgba(220, 38, 38, 0.08); text-align: left; }
.ghs-safety-card[hidden] { display: none; }
.ghs-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ghs-alert-icon { font-size: 20px; animation: alertPulse 1.2s infinite ease-in-out; }
@keyframes alertPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.ghs-header-text h4 { margin: 0; font-size: 11px; font-weight: 800; color: #991b1b; letter-spacing: .3px; }
.ghs-danger-badge { display: inline-block; font-size: 9px; font-weight: 700; color: #b91c1c; margin-top: 2px; }
.ghs-pictograms { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.ghs-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; font-size: 9px; font-weight: 700; background: #fee2e2; color: #7f1d1d; border: 1px solid #f87171; }
.ghs-section { margin-top: 8px; }
.ghs-sec-title { display: block; font-size: 10px; color: #7f1d1d; margin-bottom: 2px; }
.ghs-section p { margin: 0; font-size: 10px; color: #450a0a; line-height: 1.55; }
.ghs-safety-benefit { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #fca5a5; }
.ghs-safety-benefit .ghs-sec-title { color: #065f46; }
.ghs-safety-benefit p { color: #064e3b; }

.result-contents { margin-top: 11px; }
.result-item { display: flex; justify-content: space-between; gap: 7px; margin-top: 7px; padding: 7px 8px; border-radius: 6px; background: #f2f6f2; color: #53645a; font-size: 9px; }
.result-item strong { color: #345c45; font-weight: 700; white-space: nowrap; }
.result-card.reacted { border-color: #b8d4c1; background: #fbfefb; }
.result-card.no-reaction { border-color: #eadbc3; background: #fffdfa; }
.result-card.unsupported { border-color: #eadbc3; }

.condition-row { display: grid; grid-template-columns: 180px 1fr; align-items: center; gap: 14px; margin-top: 23px; padding-top: 20px; border-top: 1px solid #edf0ed; }
.condition-row label { color: #64736a; font-size: 11px; font-weight: 700; }
.condition-row select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid #e5eae6; border-radius: 7px; background: white; color: #43564a; font-size: 11px; }
.confirmation { display: inline-flex; align-items: center; gap: 9px; margin-top: 17px; color: #718078; cursor: pointer; font-size: 10px; }
.confirmation input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.custom-check { display: grid; width: 15px; height: 15px; flex: none; place-items: center; border: 1px solid #cad5cc; border-radius: 4px; background: white; }
.confirmation input:checked + .custom-check { border-color: var(--green); background: var(--green); }
.confirmation input:checked + .custom-check::after { width: 7px; height: 4px; border: solid white; border-width: 0 0 1.5px 1.5px; content: ""; transform: rotate(-45deg) translateY(-1px); }
.confirmation input:focus-visible + .custom-check { outline: 3px solid rgba(77, 139, 101, .2); }
.simulate-button { display: flex; width: 100%; height: 46px; align-items: center; justify-content: center; gap: 9px; margin-top: 17px; border: 0; border-radius: 8px; background: var(--green); color: white; cursor: pointer; font-size: 12px; font-weight: 700; transition: background .2s, transform .2s; }
.simulate-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.simulate-button span { font-size: 15px; }
.form-error { margin-top: 13px; padding: 10px 12px; border-radius: 7px; background: #fff2ed; color: #a44a34; font-size: 11px; }
.equation { margin: 15px 0 0; padding: 11px 13px; border-radius: 7px; background: #f3f7f3; color: #365d45; text-align: center; font-size: 12px; font-weight: 600; line-height: 1.6; }
.equation[hidden], .form-error[hidden] { display: none; }
.molecular-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid #edf0ed; }
.molecular-section[hidden] { display: none; }
.molecular-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.molecular-heading .eyebrow { margin-bottom: 5px; font-size: 9px; }
.molecular-heading h3 { margin: 0; font: 700 18px var(--font-display); letter-spacing: -.15px; }
.model-reset { padding: 7px 10px; border: 1px solid #e4eae5; border-radius: 6px; background: #fff; color: #65766b; cursor: pointer; font-size: 10px; }
.model-reset:hover { border-color: #b7cbbd; color: var(--green-dark); }
.model-tabs { display: flex; width: fit-content; gap: 4px; margin-top: 15px; padding: 4px; border-radius: 8px; background: #f1f5f1; }
.model-tab { min-height: 31px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: #758279; cursor: pointer; font-size: 10px; font-weight: 600; }
.model-tab.active { background: #fff; color: var(--green-dark); box-shadow: 0 1px 4px rgba(27, 48, 42, .08); }
.model-stage { position: relative; height: 300px; margin-top: 10px; overflow: hidden; border: 1px solid #e8eee9; border-radius: 10px; background: radial-gradient(ellipse at 50% 38%, #fbfdfb, #f1f6f1); }
#molecule-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#molecule-canvas:active { cursor: grabbing; }
#molecule-canvas[hidden] { display: none; }
.model-loading { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: #8a6b36; text-align: center; font-size: 11px; line-height: 1.6; }
.model-loading[hidden] { display: none; }
.model-caption { position: absolute; right: 13px; bottom: 11px; left: 13px; display: flex; justify-content: space-between; gap: 10px; color: #849188; font-size: 9px; pointer-events: none; }
.model-caption strong { color: #586c5e; font-weight: 600; }
.model-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 8px; margin-top: 11px; }
.model-particle { display: grid; gap: 4px; padding: 10px 11px; border: 1px solid #e9eeea; border-radius: 8px; background: #fcfdfc; }
.model-particle strong { color: #345d45; font: 700 12px var(--font-display); }
.model-particle span { color: #5e7064; font-size: 10px; }
.model-particle small { color: #89958d; font-size: 9px; line-height: 1.5; }
.atom-key { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-top: 11px; }
.atom-key-item { display: inline-flex; align-items: center; gap: 5px; color: #6f7d74; font-size: 9px; }
.atom-key-item i { width: 10px; height: 10px; border: 1px solid rgba(54, 73, 61, .2); border-radius: 50%; box-shadow: inset -1px -1px 2px rgba(20, 30, 23, .2); }
.science-note { margin-top: 12px; padding: 10px 12px; border-left: 2px solid #b6cbb9; background: #f7f9f7; color: #77847b; font-size: 9px; line-height: 1.65; }
.science-note strong { color: #566b5c; }
.science-details { margin-top: 13px; border: 1px solid #e9eeea; border-radius: 8px; background: #fff; }
.science-details summary { padding: 11px 13px; color: #53665a; cursor: pointer; font-size: 10px; font-weight: 700; }
.science-details dl { display: grid; gap: 11px; margin: 0; padding: 0 13px 13px; }
.science-details dl > div { display: grid; grid-template-columns: minmax(135px, .65fr) minmax(0, 1.6fr); gap: 12px; }
.science-details dt { color: #829087; font-size: 9px; font-weight: 600; }
.science-details dd { margin: 0; color: #45594b; font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.science-lab { margin-top: 23px; padding: 29px 32px 27px; border: 1px solid rgba(28, 54, 43, .08); border-radius: 16px; background: rgba(255, 255, 255, .95); box-shadow: 0 12px 38px rgba(35, 62, 46, .045); }
.science-lab-heading { margin-bottom: 20px; }
.science-lab-heading .eyebrow { margin-bottom: 6px; font-size: 9px; }
.science-lab-heading h2 { margin: 0; font: 700 23px var(--font-display); letter-spacing: -.25px; }
.science-lab-heading > p:last-child { max-width: 760px; margin: 9px 0 0; color: #77847c; font-size: 11px; line-height: 1.65; }
.science-tabs { display: flex; flex-wrap: wrap; gap: 5px; padding-bottom: 13px; border-bottom: 1px solid #edf0ed; }
.science-tab { min-height: 36px; padding: 0 13px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #78857d; cursor: pointer; font-size: 10px; font-weight: 600; }
.science-tab:hover { background: #f6f8f6; color: #506b58; }
.science-tab.active { border-color: #e1eae2; background: #f2f7f2; color: var(--green-dark); }
.research-equation { margin-top: 18px; }
.research-equation label, .parameter-grid label { display: grid; gap: 6px; color: #596b60; font-size: 10px; font-weight: 700; }
.research-equation label span, .parameter-grid label span { color: #849188; font-size: 9px; font-weight: 400; }
.research-equation input, .parameter-grid input { width: 100%; min-width: 0; height: 39px; padding: 0 10px; border: 1px solid #e2e9e3; border-radius: 7px; background: #fcfdfc; color: var(--ink); font-size: 11px; outline: none; }
.research-equation input { margin-top: 8px; font-family: var(--font-mono); }
.research-equation input:focus, .parameter-grid input:focus, .species-concentration:focus { border-color: #8bb69b; box-shadow: 0 0 0 3px rgba(77, 139, 101, .1); outline: none; }
.research-equation > small { display: block; margin-top: 6px; color: #89958d; font-size: 9px; line-height: 1.5; }
.science-panel { padding-top: 17px; }
.science-panel[hidden] { display: none; }
.science-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.science-panel-heading > div { display: flex; align-items: center; gap: 9px; }
.science-panel-heading h3 { margin: 0; color: #2b4435; font: 700 15px/1.45 var(--font-display); }
.science-step { display: grid; width: 23px; height: 23px; flex: none; place-items: center; border-radius: 7px; background: #f0f5ef; color: var(--green); font-size: 10px; font-weight: 700; }
.science-action { min-height: 36px; padding: 0 13px; border: 0; border-radius: 7px; background: var(--green); color: #fff; cursor: pointer; font-size: 10px; font-weight: 700; }
.science-action:hover { background: var(--green-dark); }
.science-description { margin: 10px 0 13px; color: #7d8981; font-size: 10px; line-height: 1.7; }
.science-error { margin: 11px 0; padding: 10px 11px; border: 1px solid #f2d7ce; border-radius: 7px; background: #fff5f1; color: #994835; font-size: 10px; line-height: 1.6; }
.science-error[hidden] { display: none; }
.balance-result, .equilibrium-result, .kinetics-result { margin-top: 14px; }
.balance-result[hidden], .equilibrium-result[hidden], .kinetics-result[hidden] { display: none; }
.balanced-equation { margin: 0 0 12px; padding: 13px; border: 1px solid #e1ebe2; border-radius: 8px; background: #f6faf6; color: #28583b; text-align: center; font: 700 clamp(13px, 2vw, 17px) var(--font-mono); overflow-wrap: anywhere; }
.table-scroll { width: 100%; overflow-x: auto; }
.science-table { width: 100%; border-collapse: collapse; color: #4e6154; font-size: 10px; text-align: left; }
.science-table th { padding: 9px 10px; border-bottom: 1px solid #e6ece7; background: #f7f9f7; color: #68786d; font-size: 9px; font-weight: 700; white-space: nowrap; }
.science-table td { padding: 9px 10px; border-bottom: 1px solid #edf1ed; line-height: 1.5; }
.science-table tr:last-child td { border-bottom: 0; }
.balance-mass { margin: 11px 0 0; color: #718077; font-size: 9px; line-height: 1.6; }
.parameter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; margin: 14px 0; }
.parameter-grid label { min-width: 0; }
.parameter-grid input { margin-top: 2px; font-size: 10px; }
.equilibrium-template-note { margin: 7px 0 14px; padding: 9px 11px; border-left: 2px solid #c9b77d; background: #fbf8f0; color: #817348; font-size: 9px; line-height: 1.6; }
.species-inputs { margin-top: 13px; }
.species-inputs h4 { margin: 0; color: #53665a; font: 700 13px var(--font-display); }
.species-inputs > p { margin: 6px 0 9px; color: #839087; font-size: 9px; line-height: 1.5; }
.species-concentration { width: 125px; max-width: 100%; height: 32px; padding: 0 8px; border: 1px solid #e2e9e3; border-radius: 6px; background: #fff; color: var(--ink); font-size: 10px; }
.species-input-unit { display: inline-block; margin-left: 6px; color: #849188; font-size: 9px; white-space: nowrap; }
.thermo-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; margin-bottom: 13px; }
.thermo-metric { display: grid; min-width: 0; gap: 7px; padding: 11px; border: 1px solid #e8eee9; border-radius: 8px; background: #fbfcfb; }
.thermo-metric span { color: #829087; font-size: 9px; line-height: 1.45; }
.thermo-metric strong { color: #345d45; font: 700 14px var(--font-display); overflow-wrap: anywhere; }
.experimental-fit { margin-top: 23px; padding-top: 20px; border-top: 1px solid #e9eee9; }
.fit-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fit-heading > div { display: flex; align-items: center; gap: 9px; }
.fit-heading h4 { margin: 0; color: #2b4435; font: 700 14px/1.5 var(--font-display); }
.dataset-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 15px; }
.file-import, .dataset-sample { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; padding: 0 11px; border: 1px solid #dce7de; border-radius: 6px; background: #f7faf7; color: var(--green-dark); cursor: pointer; font-size: 10px; font-weight: 700; }
.file-import:hover, .dataset-sample:hover { border-color: #b7cbbd; background: #eef5ef; }
#kinetics-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
#kinetics-file:focus-visible + .dataset-sample { outline: 3px solid rgba(77, 139, 101, .2); }
.dataset-source { color: #748178; font-size: 9px; line-height: 1.5; }
.dataset-label { display: grid; gap: 6px; margin-top: 13px; color: #596b60; font-size: 10px; font-weight: 700; }
.dataset-label span { color: #849188; font-size: 9px; font-weight: 400; }
#kinetics-dataset { display: block; width: 100%; margin-top: 8px; padding: 10px 11px; border: 1px solid #e2e9e3; border-radius: 7px; background: #fcfdfc; color: var(--ink); font: 11px/1.6 var(--font-mono); resize: vertical; outline: none; }
#kinetics-dataset:focus { border-color: #8bb69b; box-shadow: 0 0 0 3px rgba(77, 139, 101, .1); }
#kinetics-dataset::placeholder { color: #9eaaa1; }
.fit-result { margin-top: 14px; }
.fit-result[hidden] { display: none; }
.report-export { min-height: 36px; margin-top: 12px; padding: 0 12px; border: 1px solid #dce7de; border-radius: 7px; background: #f7faf7; color: var(--green-dark); cursor: pointer; font-size: 10px; font-weight: 700; }
.report-export:hover { border-color: #b7cbbd; background: #eef5ef; }
.fit-observations { max-height: 260px; margin-top: 13px; border: 1px solid #edf1ed; border-radius: 7px; }
.fit-observations .science-table th { position: sticky; top: 0; }
.thermo-interpretation { margin: 0 0 12px; padding: 10px 11px; border-left: 2px solid #b6cbb9; background: #f7f9f7; color: #6f7e74; font-size: 9px; line-height: 1.6; }
.kinetics-chart-wrap { margin-top: 12px; padding: 9px 9px 0; border: 1px solid #e8eee9; border-radius: 9px; background: #fcfdfc; }
#kinetics-chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-caption { margin: 8px 0 11px; color: #849087; font-size: 9px; line-height: 1.55; }
.research-limitations { margin-top: 13px; padding: 11px 12px; border: 1px solid #ece9dc; border-radius: 7px; background: #fbfaf6; color: #7b765f; font-size: 9px; line-height: 1.65; }
.research-limitations strong { color: #625b3e; }
.learning-note { display: flex; align-items: flex-start; gap: 11px; margin: 17px 5px 0; color: #819087; }
.note-icon { display: grid; width: 17px; height: 17px; flex: none; place-items: center; border: 1px solid #b7c7bb; border-radius: 50%; color: var(--green); font: 700 10px Georgia, serif; }
.learning-note p { margin: 0; font-size: 10px; line-height: 1.7; }
.learning-note strong { color: #607267; }
footer { display: flex; max-width: 1050px; justify-content: space-between; margin: 0 auto; padding: 12px 24px 28px; color: #9aa59e; font-size: 10px; }
footer span:first-child { color: #76847a; font-weight: 700; }

/* User Session & Badges in Topbar */
.user-session { display: flex; align-items: center; gap: 8px; }
.user-session[hidden] { display: none; }
.role-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 12px; font-size: 10px; font-weight: 700; background: #ede9fe; color: #6d28d9; letter-spacing: .2px; }
.role-badge.role-superadmin { background: #ede9fe; color: #6d28d9; border: 1px solid #ddd6fe; }
.role-badge.role-admin { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.role-badge.role-user { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.user-name { font-size: 11px; font-weight: 700; color: var(--ink); }
.admin-trigger { padding: 4px 10px; border: 1px solid #c7d8cb; border-radius: 6px; background: #f0f7f2; color: var(--green-dark); cursor: pointer; font-size: 11px; font-weight: 700; }
.admin-trigger:hover { background: #e3efe6; border-color: #9fbea8; }
.auth-logout-btn { padding: 4px 9px; border: 1px solid #fed7aa; border-radius: 6px; background: #fff7ed; color: #c2410c; cursor: pointer; font-size: 10px; font-weight: 700; }
.auth-logout-btn:hover { background: #ffedd5; }

/* Quick Test Accounts Grid */
.quick-accounts-section { margin: 12px 0 16px; padding: 12px 14px; border-radius: 12px; background: #f8faf8; border: 1px dashed #cfe0d4; }
.quick-accounts-title { margin: 0 0 10px; font-size: 11px; font-weight: 700; color: #3d5a49; }
.quick-accounts-grid { display: flex; flex-direction: column; gap: 8px; }
.quick-acc-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 11px; border: 1px solid #e2e8e3; border-radius: 8px; background: #fff; cursor: pointer; text-align: left; transition: all .15s ease-in-out; }
.quick-acc-btn:hover { border-color: var(--green); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(40, 98, 71, .1); }
.acc-icon { font-size: 18px; flex: none; }
.acc-info { flex: 1; min-width: 0; }
.acc-info strong { display: block; font-size: 11px; color: var(--ink); line-height: 1.3; }
.acc-info small { display: block; font-size: 9px; color: #788780; font-family: var(--font-mono); }
.acc-badge { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.superadmin-btn .acc-badge { background: #ede9fe; color: #6d28d9; }
.admin-btn .acc-badge { background: #dbeafe; color: #1d4ed8; }
.user-btn .acc-badge { background: #d1fae5; color: #047857; }
.quick-divider { position: relative; text-align: center; margin: 16px 0 6px; }
.quick-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: #e2e8e3; }
.quick-divider span { position: relative; padding: 0 10px; background: #f8faf8; font-size: 9px; font-weight: 700; color: #94a399; letter-spacing: 1px; }

/* Admin Modal Dialog */
.admin-dialog { position: relative; width: min(100% - 32px, 860px); max-height: min(90dvh, 780px); padding: 28px 30px; border: 1px solid rgba(28, 54, 43, .12); border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 28px 90px rgba(27, 48, 42, .24); overflow-y: auto; }
.admin-dialog::backdrop { background: rgba(18, 32, 26, .55); backdrop-filter: blur(4px); }
.admin-dialog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.admin-dialog-title-wrap { display: flex; align-items: center; gap: 12px; }
.admin-dialog-title-wrap h2 { margin: 0; font: 700 20px var(--font-display); }
.admin-dialog-sub { margin: 3px 0 0; color: #76847a; font-size: 11px; }
.admin-user-summary { text-align: right; }
.admin-tabs { display: flex; gap: 6px; margin-bottom: 20px; border-bottom: 2px solid #edf2ed; padding-bottom: 2px; }
.admin-tab { padding: 8px 14px; border: 0; border-radius: 6px 6px 0 0; background: transparent; color: #69786f; font-size: 11px; font-weight: 700; cursor: pointer; transition: all .15s; }
.admin-tab:hover { color: var(--green-dark); background: #f3f7f4; }
.admin-tab.active { color: var(--green-dark); border-bottom: 3px solid var(--green); background: #eef5f0; }
.admin-tab-panel { display: block; }
.admin-tab-panel[hidden] { display: none; }
.panel-intro { margin-bottom: 16px; }
.panel-intro h3 { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--ink); }
.panel-intro p { margin: 0; font-size: 11px; color: #75837a; }

/* Admin Table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.admin-table th, .admin-table td { padding: 9px 11px; text-align: left; border-bottom: 1px solid #edf2ed; vertical-align: middle; }
.admin-table th { background: #f7faf7; font-weight: 700; color: #516257; font-size: 10px; letter-spacing: .3px; }
.admin-table tr:hover td { background: #f9fbf9; }
.btn-switch-user { padding: 4px 8px; border: 1px solid #cbe0d2; border-radius: 5px; background: #fff; color: var(--green-dark); cursor: pointer; font-size: 10px; font-weight: 700; }
.btn-switch-user:hover { background: #edf6ef; border-color: var(--green); }

/* System Cards Grid */
.system-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.sys-card { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid #e3eae4; border-radius: 10px; background: #fcfdfc; }
.sys-card-icon { font-size: 22px; }
.sys-card-body label { display: block; font-size: 9px; font-weight: 700; color: #85948b; margin-bottom: 2px; }
.sys-card-body strong { display: block; font-size: 12px; color: var(--ink); margin-bottom: 4px; }
.tag { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: 700; }
.tag-success { background: #d1fae5; color: #065f46; }
.tag-info { background: #dbeafe; color: #1e40af; }
.tag-neutral { background: #f1f5f9; color: #475569; }
/* ========================================================
   PHD RESEARCH SUITES: STYLES
   ======================================================== */

/* Hướng 1: AI & Hóa tin học */
.ai-quick-samples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 16px; }
.ai-sample-label { font-size: 10px; font-weight: 700; color: #6b7c72; }
.ai-sample-btn { padding: 4px 9px; border: 1px solid #d4e2d8; border-radius: 6px; background: #f4f8f5; color: var(--green-dark); font-size: 10px; cursor: pointer; transition: all .15s; }
.ai-sample-btn:hover { background: #e3efe7; border-color: var(--green); }
.ai-mechanism-box { margin: 14px 0; padding: 14px 16px; border: 1px solid #d1e3d7; border-radius: 10px; background: #fbfdfb; }
.ai-mech-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ai-badge-chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; background: #ede9fe; color: #6d28d9; font-size: 10px; font-weight: 700; }
.ai-mech-text { margin: 0 0 12px; font-size: 11px; line-height: 1.6; color: #2e4337; }
.ai-pathway-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.ai-step-card { padding: 10px 12px; border: 1px solid #e1ebe3; border-radius: 8px; background: #fff; }
.ai-step-card strong { display: block; font-size: 11px; color: var(--green-dark); margin-bottom: 3px; }
.ai-step-card p { margin: 0; font-size: 10px; color: #53645a; line-height: 1.45; }
.geometry-params-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.geom-param-card { padding: 8px 10px; border: 1px solid #e5ede7; border-radius: 6px; background: #f7faf8; }
.geom-param-card label { display: block; font-size: 9px; color: #738479; margin-bottom: 2px; }
.geom-param-card strong { font-size: 12px; color: var(--ink); font-family: var(--font-mono); }

/* Hướng 2: Động lực học Phân tử (MD) */
.md-actions { display: flex; gap: 8px; }
.md-controls-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 14px; }
.md-controls-grid input[type="range"] { width: 100%; margin-top: 4px; accent-color: var(--green); cursor: pointer; }
.md-simulation-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.md-canvas-wrap { display: flex; flex-direction: column; border: 1px solid #dbe6df; border-radius: 10px; background: #121c17; overflow: hidden; }
.md-canvas-header { display: flex; justify-content: space-between; padding: 7px 12px; background: #1a2822; color: #a4cbb7; font-size: 10px; font-weight: 700; border-bottom: 1px solid #23352d; }
#md-canvas { display: block; width: 100%; height: 260px; background: #0d1612; }
.md-legend-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 7px 12px; background: #16221c; font-size: 9px; color: #b0d0c0; border-top: 1px solid #23352d; }
.md-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; margin-right: 3px; }
.dot-a { background: #38bdf8; box-shadow: 0 0 4px #38bdf8; }
.dot-b { background: #f59e0b; box-shadow: 0 0 4px #f59e0b; }
.dot-p { background: #10b981; box-shadow: 0 0 5px #10b981; }
.dot-ts { background: #ec4899; box-shadow: 0 0 6px #ec4899; }
.md-analytics-wrap { display: flex; flex-direction: column; gap: 10px; }
.md-stats-cards { grid-template-columns: repeat(2, 1fr); }
.md-chart-box { padding: 10px 12px; border: 1px solid #dce7e0; border-radius: 8px; background: #fff; }
#md-boltzmann-chart { width: 100%; height: 110px; }
.chart-note { display: block; margin-top: 4px; font-size: 9px; color: #728479; line-height: 1.4; }

/* Hướng 3: Nghiên cứu Sư phạm & Thống kê */
.pedagogy-charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 12px 0; }
.ped-chart-card { padding: 12px 14px; border: 1px solid #dce7e0; border-radius: 10px; background: #fff; }
.ped-chart-card h4 { margin: 0 0 8px; font-size: 11px; color: #2d4537; font-weight: 700; }
.ped-chart-card svg { width: 100%; height: 160px; }
.pedagogy-exports { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* PHÒNG THÍ NGHIỆM ẢO THỰC HÀNH TƯƠNG TÁC */
.lab-protocol-selector { margin-bottom: 16px; padding: 12px 14px; background: #f0f5f1; border-radius: 8px; border: 1px solid #d8e5dc; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lab-protocol-selector select { flex: 1; min-width: 260px; height: 38px; padding: 0 10px; border-radius: 6px; border: 1px solid #c2d6c9; background: #fff; font-weight: 600; color: var(--green-dark); }
.virtual-lab-stage-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.35fr); gap: 14px; margin-bottom: 16px; }
.lab-apparatus-card { padding: 14px; border: 1px solid #cfded4; border-radius: 12px; background: #fff; display: flex; flex-direction: column; }
.apparatus-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 11px; font-weight: 700; color: #2d4537; }
.apparatus-status { color: var(--green); font-size: 10px; }
.apparatus-visual-stage { height: 260px; background: radial-gradient(circle at 50% 30%, #f9fcfa 0%, #edf4ef 100%); border-radius: 10px; border: 1px solid #e0eae2; position: relative; overflow: hidden; display: flex; justify-content: center; align-items: flex-end; padding-bottom: 15px; }

/* Buret Graphic */
.buret-assembly { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 34px; height: 160px; z-index: 5; }
.buret-stand { position: absolute; top: 0; left: -22px; width: 4px; height: 230px; background: #94a3b8; border-radius: 2px; }
.buret-clamp { position: absolute; top: 30px; left: -22px; width: 30px; height: 8px; background: #64748b; border-radius: 3px; }
.buret-tube { position: absolute; top: 0; left: 6px; width: 20px; height: 130px; border: 2px solid #64748b; border-top: none; border-radius: 0 0 2px 2px; background: rgba(255,255,255,0.7); overflow: hidden; }
.buret-liquid { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(180deg, rgba(224,242,254,0.75), rgba(186,230,253,0.85)); transition: height 0.4s ease; }
.buret-graduations { position: absolute; top: 2px; right: 2px; font-size: 7px; color: #475569; display: flex; flex-direction: column; justify-content: space-between; height: 120px; text-align: right; user-select: none; }
.buret-stopcock { position: absolute; top: 130px; left: 4px; width: 24px; height: 8px; background: #0284c7; border-radius: 4px; cursor: pointer; transition: transform .2s; }
.buret-stopcock.open { transform: rotate(90deg); background: #10b981; }
.buret-tip { position: absolute; top: 138px; left: 13px; width: 6px; height: 16px; border: 1.5px solid #64748b; border-top: none; background: rgba(255,255,255,0.8); }
.liquid-drop { position: absolute; top: 16px; left: 1px; width: 4px; height: 7px; background: #38bdf8; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; opacity: 0; transform: translateY(0); }
.liquid-drop.dropping { animation: dropFall 0.45s ease-in; }
@keyframes dropFall {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  70% { opacity: 1; transform: translateY(50px) scale(0.9); }
  100% { opacity: 0; transform: translateY(68px) scale(1.3); }
}

/* Flask Graphic */
.flask-assembly { position: relative; width: 100px; display: flex; flex-direction: column; align-items: center; z-index: 2; margin-top: 60px; }
.ph-probe { position: absolute; top: -55px; right: 8px; width: 8px; height: 95px; z-index: 8; }
.probe-wire { width: 2px; height: 35px; background: #334155; margin: 0 auto; }
.probe-body { width: 8px; height: 48px; background: #1e293b; border-radius: 2px; }
.probe-bulb { width: 6px; height: 10px; background: #60a5fa; border-radius: 0 0 3px 3px; margin: 0 auto; box-shadow: 0 0 4px #60a5fa; }
.lab-erlenmeyer { width: 78px; height: 82px; border: 2.5px solid #64748b; border-top: 0; border-radius: 4px 4px 18px 18px; position: relative; overflow: hidden; background: rgba(255,255,255,0.65); clip-path: polygon(32% 0%, 68% 0%, 100% 100%, 0% 100%); }
.erlenmeyer-liquid { position: absolute; bottom: 0; left: 0; right: 0; height: 50%; background: rgba(240,249,255,0.4); transition: background-color 0.5s ease, height 0.4s ease; }
.magnetic-stirrer-pill { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 14px; height: 4px; background: #fff; border: 1px solid #94a3b8; border-radius: 3px; }
.magnetic-stirrer-pill.spinning { animation: spinPill 0.25s linear infinite; }
@keyframes spinPill { 0% { transform: translateX(-50%) rotate(0deg); } 100% { transform: translateX(-50%) rotate(360deg); } }
.cross-sign-base { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); font-size: 22px; font-weight: 900; color: #1e293b; opacity: 1; transition: opacity 0.6s ease; user-select: none; }
.stirrer-plate { width: 98px; height: 14px; background: #334155; border-radius: 4px; margin-top: 2px; display: grid; place-items: center; color: #94a3b8; font-size: 6px; letter-spacing: .5px; font-weight: 700; }

/* Control Pad */
.lab-control-pad { margin-top: 12px; padding: 10px; background: #f8faf9; border-radius: 8px; border: 1px solid #dce7e0; }
.control-pad-label { font-size: 10px; font-weight: 700; color: #405549; margin-bottom: 6px; }
.control-btn-group { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-btn { padding: 6px 10px; font-size: 11px; font-weight: 600; border-radius: 6px; border: 1px solid #c8d8cd; background: #fff; color: var(--green-dark); cursor: pointer; transition: all .15s; }
.lab-btn:hover { background: #eaf4ed; border-color: #9cbda7; }
.lab-btn.highlight { background: var(--green); color: #fff; border-color: var(--green-dark); }
.lab-btn.highlight:hover { background: var(--green-dark); }
.lab-btn.secondary { background: #f1f5f2; color: #475a4f; }

/* Telemetry & Sensors */
.lab-telemetry-card { padding: 14px; border: 1px solid #cfded4; border-radius: 12px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.sensor-display-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.digital-sensor-box { padding: 8px 10px; background: #182820; border-radius: 8px; border: 1px solid #283c31; color: #e1ede5; }
.digital-sensor-box small { display: block; font-size: 8.5px; font-weight: 700; letter-spacing: .6px; color: #82a893; }
.sensor-lcd { font-family: var(--font-mono); font-size: 19px; font-weight: 700; line-height: 1.2; margin: 2px 0; }
.lcd-ph { color: #38bdf8; text-shadow: 0 0 6px rgba(56,189,248,0.4); }
.lcd-vol { color: #4ade80; text-shadow: 0 0 6px rgba(74,222,128,0.4); }
.lcd-temp { color: #facc15; }
.lcd-cond { color: #f472b6; }
.sensor-sub { font-size: 9px; color: #9bb3a6; }
.lab-live-chart-wrap { padding: 10px 12px; border: 1px solid #dce7e0; border-radius: 8px; background: #fbfdfc; }
.chart-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 11px; color: #1e3025; }
.chart-point-count { font-size: 9.5px; color: var(--green); font-weight: 600; }
#virtual-lab-chart { width: 100%; height: 125px; }
.lab-phenomenon-banner { padding: 8px 12px; border-radius: 6px; background: #eef7f0; border-left: 3px solid var(--green); font-size: 10.5px; color: #1e3a29; line-height: 1.45; }

/* Lab Report Form */
.lab-report-section { margin-top: 14px; padding: 14px; border: 1px solid #d8e5dc; border-radius: 10px; background: #fbfdfc; }
.lab-report-form { margin-top: 10px; padding: 12px; background: #fff; border: 1px solid #e1ebe4; border-radius: 8px; }
.report-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.report-form-grid label, .lab-report-form label { font-size: 10.5px; font-weight: 600; color: #405549; }
.report-form-grid input, .lab-report-form textarea { width: 100%; padding: 6px 9px; border: 1px solid #d0e0d5; border-radius: 5px; font-size: 11px; margin-top: 4px; box-sizing: border-box; }

/* ADVANCED RESEARCH WORKBENCH (ARRHENIUS & ENZYME) */
.research-subtabs { display: flex; gap: 6px; margin: 12px 0 14px; border-bottom: 2px solid #e2ece5; padding-bottom: 6px; flex-wrap: wrap; }
.research-subtab { padding: 7px 13px; font-size: 11.5px; font-weight: 700; border-radius: 6px; border: none; background: transparent; color: #586f62; cursor: pointer; transition: all .15s; }
.research-subtab:hover { background: #eaf3ed; color: var(--green-dark); }
.research-subtab.active { background: var(--green); color: #fff; box-shadow: 0 2px 6px rgba(40,98,71,0.25); }
.research-grid-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 14px; }
.research-input-box, .research-chart-box { padding: 14px; border: 1px solid #cfded4; border-radius: 10px; background: #fff; }
.research-box-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 11.5px; color: #1e3327; }
.research-sample-btns { display: flex; gap: 5px; }
.btn-micro-sample { padding: 2px 7px; font-size: 9.5px; font-weight: 600; border-radius: 4px; border: 1px solid #c2d6c9; background: #f0f6f2; color: var(--green-dark); cursor: pointer; }
.btn-micro-sample:hover { background: #dcece1; }
.badge-r2 { padding: 2px 8px; font-size: 10px; font-weight: 700; border-radius: 12px; background: #e8f5ed; color: var(--green-dark); border: 1px solid #c0dfcb; }
.arrhenius-cards { margin-top: 10px; grid-template-columns: repeat(2, 1fr); }
#arrhenius-chart-svg, #enzyme-chart-svg { width: 100%; height: 140px; }

/* ELN STYLES */
.eln-card { padding: 18px; border: 1px solid #cfded4; border-radius: 12px; background: #fff; }
.eln-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 13px; color: #1e3327; }
.eln-security-tag { font-size: 10px; font-weight: 700; color: #0284c7; background: #e0f2fe; padding: 3px 8px; border-radius: 12px; border: 1px solid #bae6fd; }
.eln-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.eln-form-grid label { font-size: 10.5px; font-weight: 600; color: #405549; }
.eln-form-grid input, #eln-notes { width: 100%; padding: 7px 10px; border: 1px solid #d0e0d5; border-radius: 6px; font-size: 11px; margin-top: 4px; box-sizing: border-box; }
.eln-provenance-box { margin-top: 12px; padding: 10px 12px; background: #17261e; border-radius: 8px; border: 1px solid #2a4033; color: #a4c9b3; font-size: 10px; }
.hash-row { display: flex; flex-direction: column; gap: 4px; }
.hash-row span { font-weight: 700; font-size: 9px; color: #6ee7b7; }
.hash-row code { font-family: var(--font-mono); font-size: 10.5px; color: #38bdf8; word-break: break-all; }
.eln-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .virtual-lab-stage-layout, .research-grid-2col { grid-template-columns: 1fr; }
  .apparatus-visual-stage { height: 230px; }
}

/* Hướng 4: Bản thảo Luận án & ISI Paper */
.manuscript-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.manuscript-preview-wrap { margin-top: 14px; border: 1px solid #cfded4; border-radius: 12px; background: #4b5851; padding: 24px; box-shadow: inset 0 2px 8px rgba(0,0,0,.15); overflow-x: auto; }
.manuscript-paper { max-width: 780px; margin: 0 auto; padding: 36px 42px; background: #fff; border-radius: 4px; box-shadow: 0 10px 35px rgba(0,0,0,.25); color: #1e2922; font-family: 'Times New Roman', Times, serif; }
.paper-journal-tag { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 1px; color: #7b8f83; margin-bottom: 12px; font-family: var(--font-body); }
.paper-title { font-size: 18px; font-weight: 700; line-height: 1.35; margin: 0 0 10px; color: #111; text-align: center; }
.paper-authors { text-align: center; font-size: 11px; color: #555; margin-bottom: 16px; font-style: italic; }
.paper-abstract { padding: 12px 16px; background: #f7f9f7; border-left: 3px solid var(--green); font-size: 10.5px; line-height: 1.6; margin-bottom: 20px; text-align: justify; font-family: var(--font-body); }
.paper-abstract strong { color: var(--green-dark); }
.paper-section { margin-top: 18px; }
.paper-section h3 { font-size: 13px; font-weight: 700; margin: 0 0 6px; color: #111; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid #eee; padding-bottom: 3px; }
.paper-section p { font-size: 11px; line-height: 1.65; margin: 0 0 8px; text-align: justify; }
.paper-section code { font-family: var(--font-mono); font-size: 10px; background: #f0f4f1; padding: 1px 4px; border-radius: 3px; }
.paper-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 10px; font-family: var(--font-body); }
.paper-table th, .paper-table td { padding: 5px 8px; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; text-align: left; }
.paper-table th { background: #f9fbf9; font-weight: 700; }
.paper-refs { font-size: 9.5px; line-height: 1.5; color: #444; padding-left: 16px; margin: 8px 0; }
.paper-refs li { margin-bottom: 4px; }

@media (max-width: 760px) {
  .md-simulation-layout { grid-template-columns: 1fr; }
  .manuscript-preview-wrap { padding: 10px; }
  .manuscript-paper { padding: 18px 16px; }
}

@media (max-width: 760px) {
  .topbar { height: auto; min-height: 66px; padding: 8px 20px; flex-wrap: wrap; gap: 8px; }
  .topbar-actions { gap: 9px; flex-wrap: wrap; }
  .topbar-note { max-width: 140px; text-align: right; line-height: 1.5; font-size: 8px; }
  .auth-trigger { max-width: 155px; min-height: 33px; padding: 0 9px; font-size: 10px; }
  .auth-dialog { padding: 28px 22px 23px; }
  .admin-dialog { padding: 20px 16px; }
  .admin-dialog-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .admin-tabs { overflow-x: auto; }
  main { padding: 39px 16px 25px; }
  .intro { margin: 0 0 26px 2px; }
  .intro h1 { letter-spacing: -1.6px; }
  .intro-copy { max-width: 390px; font-size: 12px; line-height: 1.6; }
  .lab-card { padding: 23px 17px 20px; }
  .flasks { grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); gap: 8px; }
  .arrow-symbol { grid-column: 1 / -1; grid-row: 2; height: 18px; transform: rotate(90deg); }
  .result-card { grid-column: 1 / -1; grid-row: 3; min-height: unset; padding: 13px 15px; }
  .result-card .vessel-wrap { height: 95px; }
  .result-card .result-hint { max-width: 260px; }
  .result-contents { max-width: 370px; margin: 11px auto 2px; }
  .flask-card { padding-right: 10px; padding-left: 10px; }
  .flask-topline { gap: 5px; font-size: 8px; letter-spacing: .45px; }
  .condition-row { grid-template-columns: 1fr; gap: 8px; margin-top: 18px; padding-top: 17px; }
  .science-lab { padding: 22px 16px 18px; }
  .science-tabs { display: grid; grid-template-columns: 1fr; }
  .science-tab { text-align: left; }
  .science-panel-heading { align-items: flex-start; flex-direction: column; }
  .science-panel-heading h3 { font-size: 12px; }
  .science-action { width: 100%; }
  .fit-heading { align-items: flex-start; flex-direction: column; }
  .fit-heading .science-action { width: 100%; }
  .dataset-source { flex-basis: 100%; }
  .parameter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .model-stage { height: 250px; }
  .science-details dl > div { grid-template-columns: 1fr; gap: 4px; }
  .model-caption { flex-direction: column; gap: 3px; }
  footer { padding-right: 17px; padding-left: 17px; }
}

@media (max-width: 390px) {
  .flasks { grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); gap: 5px; }
  .mix-symbol span { width: 19px; height: 19px; }
  .flask-card { padding-right: 8px; padding-left: 8px; }
  .flask-topline { font-size: 7px; }
  .step-index { width: 18px; height: 18px; }
  .text-button { font-size: 10px; }
  .parameter-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

