@font-face { font-family: "Prompt"; src: url("../fonts/Prompt-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Prompt"; src: url("../fonts/Prompt-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Prompt"; src: url("../fonts/Prompt-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Prompt"; src: url("../fonts/Prompt-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --scale: 1;
  --bg: #020a24;
  --bg-2: #061a4d;
  --surface: rgba(110, 170, 255, 0.07);
  --surface-2: rgba(120, 180, 255, 0.12);
  --border: rgba(130, 200, 255, 0.17);
  --text: #f2f8ff;
  --muted: #a3b8de;
  --amber: #ffb347;
  --orange: #ff7a2f;
  --rose: #ec4f86;
  --teal: #19d3c0;
  --sky: #2fb3e0;
  /* Okabe–Ito สำหรับสถานะ (ปลอดภัยต่อผู้ตาบอดสี) */
  --ok: #56b4e9;
  --low: #f0e442;
  --mid: #e69f00;
  --high: #d55e00;
  --err: #cc79a7;
  --grad: linear-gradient(120deg, #ffb21f 0%, #ffd84a 20%, #7be35a 42%, #22c3ff 70%, #6d7bff 100%);
  --cyan: #38c8ff; --blue: #3b7bff; --lime: #7be35a;
  --radius: 22px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}
html { font-size: calc(16px * var(--scale)); -webkit-text-size-adjust: 100%; }
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100dvh; color: var(--text); background: var(--bg);
  font-family: "Prompt", "Sukhumvit Set", "Noto Sans Thai", system-ui, sans-serif; font-weight: 400;
  line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* แสงออโรร่าพื้นหลัง (โทนเดียวกับไอคอน) */
body::before {
  content: ""; position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vmax 32vmax at 12% 8%, rgba(56, 170, 255, 0.28), transparent 60%),
    radial-gradient(44vmax 34vmax at 92% 96%, rgba(19, 201, 182, 0.24), transparent 60%),
    radial-gradient(30vmax 24vmax at 88% 10%, rgba(107, 77, 255, 0.2), transparent 60%),
    radial-gradient(80vmax 60vmax at 50% 40%, #121a42, var(--bg) 70%);
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(-3vmax, 2vmax, 0) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { body::before, .glow-ring, .pulse { animation: none !important; } * { transition: none !important; } }

a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- โครงหน้า ---------- */
.app { max-width: 1180px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 18px calc(96px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; gap: 12px; padding: 6px 0 18px; }
.topbar .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.topbar .brand img { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 6px 22px -6px rgba(56, 170, 255, .8); }
.brand-name { font-weight: 700; font-size: 1.2rem; letter-spacing: .01em; }
.brand-sub { font-size: .78rem; color: var(--muted); margin-top: -4px; }
.topbar .spacer { flex: 1; }
.back { min-width: 48px; min-height: 48px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; font-size: 1.3rem; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.card + .card, .stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split { display: grid; gap: 18px; }
@media (min-width: 900px) { .split { grid-template-columns: 1.15fr 1fr; align-items: start; } }
@media (min-width: 600px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }

/* ---------- ปุ่ม ---------- */
.btn {
  min-height: 52px; padding: 12px 20px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-weight: 500; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { background: rgba(255,255,255,.14); }
.btn:active { transform: scale(.98); }
.btn:focus-visible, .back:focus-visible, .tile:focus-visible, input:focus-visible, select:focus-visible, .roi:focus-visible { outline: 3px solid #7cf3ff; outline-offset: 3px; }
.btn.primary {
  border: 0; color: #021433; font-weight: 600;
  background: linear-gradient(120deg, #8ef4ff, #3cc2ff 45%, #4d86ff);
  box-shadow: 0 12px 30px -10px rgba(56, 170, 255, .75), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.teal { border: 0; color: #032114; font-weight: 600; background: linear-gradient(120deg, #c4ff8a, #4fe08a 50%, #1cc9b4); box-shadow: 0 12px 30px -12px rgba(25, 211, 192, .7); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(204, 121, 167, .5); color: #ffb8de; }
.btn.block { width: 100%; }
.btn.xl { min-height: 72px; font-size: 1.25rem; border-radius: 22px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row > .btn { flex: 1 1 140px; }

/* ---------- หน้าแรก ---------- */
.hero { position: relative; overflow: hidden; padding: 26px 22px; }
.hero-inner { display: flex; align-items: center; gap: 20px; }
.hero-icon { width: 112px; height: 112px; border-radius: 28px; flex: none; box-shadow: 0 20px 50px -14px rgba(56, 170, 255, .7), 0 0 0 1px rgba(255,255,255,.14); }
.hero h1 { font-size: 1.6rem; }
.hero .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tile {
  display: flex; flex-direction: column; gap: 8px; padding: 18px; min-height: 118px; border-radius: 20px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); transition: transform .2s ease, background .2s ease;
}
.tile:hover { transform: translateY(-2px); background: var(--surface-2); }
.tile .ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; background: rgba(255,255,255,.08); }
.tile b { font-weight: 600; }
.tile span { font-size: .85rem; color: var(--muted); }

/* ---------- ขั้นตอน ---------- */
.steps { display: flex; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.steps li { flex: 1; height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); position: relative; }
.steps li.done, .steps li.now { background: var(--grad); background-size: 500% 100%; }
.steps li.now { box-shadow: 0 0 14px rgba(56, 190, 255, .7); }
.step-label { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }

.check { display: flex; gap: 14px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check input { width: 26px; height: 26px; margin-top: 2px; accent-color: #38c8ff; flex: none; }

label.field { display: block; margin: 0 0 14px; }
label.field > span { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=number], select, textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border);
  background: rgba(1, 8, 30, .6); font-size: 1rem;
}
select option { background: #061a4d; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { min-height: 48px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.seg button[aria-pressed=true] { background: rgba(56, 190, 255, .18); border-color: var(--amber); color: #ffe2b8; font-weight: 600; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.toggle:last-child { border-bottom: 0; }
.switch { position: relative; width: 60px; height: 34px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 34px; background: rgba(255,255,255,.18); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: linear-gradient(120deg, #38c8ff, #19d3c0); }
.switch input:checked + i::after { transform: translateX(26px); }
.switch input:focus-visible + i { outline: 3px solid #7cf3ff; outline-offset: 3px; }

/* ---------- ตัวจับเวลา ---------- */
.timer-wrap { display: grid; place-items: center; padding: 8px 0 14px; }
.timer-ring { position: relative; width: min(78vw, 300px); aspect-ratio: 1; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.timer-ring .t-num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.timer-ring .t-num b { font-size: 3.4rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; display: block; line-height: 1; }
.glow-ring { animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }
.timer-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.timer-chip + .timer-chip { margin-top: 8px; }
.timer-chip .tt { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.15rem; }
.timer-chip.ready { border-color: var(--teal); box-shadow: 0 0 0 1px rgba(25,211,192,.35), 0 10px 30px -14px rgba(25,211,192,.8); }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }

/* ---------- กล้อง ---------- */
.cam { position: relative; border-radius: 20px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.cam video { width: 100%; height: 100%; object-fit: contain; display: block; }
.cam .guide { position: absolute; inset: 0; pointer-events: none; }
.cam .hint { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(0,0,0,.62); font-weight: 500; text-align: center; }
.cam .hint.good { color: #9ffcf0; } .cam .hint.bad { color: #ffd27a; }
.drop {
  border: 2px dashed rgba(255,255,255,.25); border-radius: 20px; padding: 26px; text-align: center; transition: border-color .2s, background .2s;
}
.drop.over { border-color: var(--amber); background: rgba(255, 179, 71, .08); }

/* ---------- ROI ---------- */
.roi-stage { position: relative; border-radius: 18px; overflow: hidden; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; }
.roi-stage canvas { display: block; width: 100%; height: auto; }
.roi { position: absolute; border-radius: 12px; cursor: move; touch-action: none; }
.roi.blank { border: 3px dashed #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 22px rgba(255,255,255,.35); }
.roi.sample { border: 3px solid var(--amber); box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 26px rgba(255, 179, 71, .7); }
.roi .tag { position: absolute; top: -34px; left: -3px; padding: 3px 10px; border-radius: 10px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: rgba(0,0,0,.75); }
.roi.sample .tag { color: #ffd27a; }
.roi .grip { position: absolute; right: -14px; bottom: -14px; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 3px solid #0b1236; cursor: nwse-resize; }
.roi.sample .grip { background: var(--amber); }
.roi .inner { position: absolute; inset: 15%; border: 1px dotted rgba(255,255,255,.55); border-radius: 6px; }
.readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.readout div { padding: 12px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid var(--border); }
.readout b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.readout span { font-size: .8rem; color: var(--muted); }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 6px; vertical-align: -3px; margin-right: 6px; border: 1px solid rgba(255,255,255,.4); }

/* ---------- ผลตรวจ ---------- */
.result { text-align: center; position: relative; overflow: hidden; padding: 30px 20px 24px; }
.result::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 120%; z-index: -1;
  background: radial-gradient(closest-side, var(--halo, rgba(56,190,255,.35)), transparent);
}
.result .sample-name { font-size: 1.15rem; color: var(--muted); }
.big-num { font-size: clamp(4rem, 18vw, 7.5rem); font-weight: 600; line-height: 1; letter-spacing: -.03em; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.big-num small { font-size: .42em; font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.status-pill { max-width: 100%; text-align: left; display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 1.1rem; margin-top: 12px; background: rgba(0,0,0,.35); border: 2px solid currentColor; }
.status-pill svg { width: 26px; height: 26px; flex: none; }
.lv-0 { color: var(--ok); } .lv-1 { color: var(--low); } .lv-2 { color: var(--mid); } .lv-3 { color: var(--high); } .lv-4, .lv--1 { color: var(--err); }
.result .detail { margin-top: 10px; font-size: 1.05rem; }
.dilution-note { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 10px; background: rgba(47, 179, 224, .15); color: #bfeaff; font-size: .9rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.calc-out { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.calc-out div { padding: 14px; border-radius: 16px; background: rgba(0,0,0,.25); border: 1px solid var(--border); text-align: center; }
.calc-out b { display: block; font-size: 1.7rem; font-weight: 600; }
.warn { padding: 14px 16px; border-radius: 16px; background: rgba(230, 159, 0, .12); border: 1px solid rgba(230, 159, 0, .45); color: #ffe2a8; }
.info { padding: 14px 16px; border-radius: 16px; background: rgba(47, 179, 224, .1); border: 1px solid rgba(47, 179, 224, .35); color: #cdeeff; }
.danger-box { padding: 14px 16px; border-radius: 16px; background: rgba(213, 94, 0, .12); border: 1px solid rgba(213, 94, 0, .5); color: #ffd0b8; }
.warn ul, .info ul, .danger-box ul { margin: 6px 0 0; padding-left: 20px; }

details { border-radius: 16px; border: 1px solid var(--border); background: var(--surface); padding: 4px 16px; }
details + details { margin-top: 10px; }
summary { cursor: pointer; padding: 12px 0; font-weight: 500; min-height: 48px; display: flex; align-items: center; }

/* ---------- ประวัติ ---------- */
.hist { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; }
.hist + .hist { margin-top: 10px; }
.hist img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex: none; background: #000; }
.hist .val { margin-left: auto; text-align: right; font-weight: 600; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.hist .val small { display: block; font-size: .78rem; font-weight: 500; }
.empty { text-align: center; padding: 34px 10px; color: var(--muted); }

table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: 9px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.tbl th { color: var(--muted); font-weight: 500; }
.tbl td.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl input { min-height: 44px; padding: 8px 10px; }
.chart { width: 100%; height: auto; display: block; }

/* ---------- แถบนำทางล่าง ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 20;
  display: flex; gap: 4px; padding: 6px; border-radius: 22px; width: min(560px, calc(100% - 24px));
  background: rgba(4, 16, 48, .78); border: 1px solid var(--border); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px -16px rgba(0,0,0,.8);
}
.tabbar a { flex: 1; min-height: 56px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; font-size: .72rem; color: var(--muted); }
.tabbar a .i { font-size: 1.25rem; line-height: 1; }
.tabbar a[aria-current=page] { color: var(--text); background: rgba(255,255,255,.09); }
.tabbar a.go { color: #021433; background: linear-gradient(120deg, #8ef4ff, #3cc2ff 45%, #4d86ff); font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 50; padding: 12px 18px; border-radius: 14px; background: #fff; color: #0b1236; font-weight: 500; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

/* ---------- ความคมชัดสูง ---------- */
html.hc { --bg: #000; --surface: #000; --surface-2: #111; --border: #fff; --text: #fff; --muted: #fff; --grad: linear-gradient(90deg, #ffd400, #ffd400); }
html.hc body::before { display: none; }
html.hc .card, html.hc .tile, html.hc .hist, html.hc details { background: #000; border: 2px solid #fff; box-shadow: none; backdrop-filter: none; }
html.hc .btn { border: 2px solid #fff; background: #000; }
html.hc .btn.primary, html.hc .btn.teal, html.hc .tabbar a.go { background: #ffd400; color: #000; border-color: #ffd400; box-shadow: none; }
html.hc .lv-0, html.hc .lv-1, html.hc .lv-2, html.hc .lv-3, html.hc .lv-4, html.hc .lv--1 { color: #fff; }
html.hc .hero .grad-text { color: #ffd400; background: none; }
html.hc .tabbar { background: #000; border: 2px solid #fff; }
html.hc .warn, html.hc .info, html.hc .danger-box { background: #000; border: 2px solid #ffd400; color: #fff; }

@media print {
  body::before, .tabbar, .no-print, .topbar .back { display: none !important; }
  body { background: #fff; color: #000; }
  .card { background: #fff; border: 1px solid #999; box-shadow: none; color: #000; backdrop-filter: none; }
  .muted, .kv dt { color: #444; }
  .lv-0, .lv-1, .lv-2, .lv-3, .lv-4 { color: #000; }
}
.tabbar[hidden] { display: none; }
.nw { white-space: nowrap; }
@media (max-width: 480px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-icon { width: 96px; height: 96px; border-radius: 24px; }
  .hero h1 { font-size: 1.45rem; }
}
.timer-chip > div { flex: 1 1 0; min-width: 0; }
.timer-chip .chip-actions { flex: 1 1 100%; display: flex; gap: 8px; }
.timer-chip .chip-actions .btn { flex: 1; min-height: 48px; padding: 8px 12px; }
.timer-chip .chip-actions .ghost { flex: 0 0 auto; }
.timer-chip b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.hc .seg button[aria-pressed=true] { background: #ffd400; color: #000; border-color: #ffd400; }
html.hc .seg button { border: 2px solid #fff; background: #000; }
/* ตัวอักษรใหญ่ (≥150%) → คอลัมน์เดียว */
html.big .grid-2, html.big .calc-out { grid-template-columns: 1fr; }
html.big .readout { grid-template-columns: 1fr 1fr; }
html.big .hero-inner { flex-direction: column; text-align: center; }
html.big .topbar .brand-sub { display: none; }
.tabbar a { font-size: min(.72rem, 15px); }
.tabbar a .i { font-size: min(1.25rem, 26px); }
.card, details { overflow-x: auto; }
html.big .kv { grid-template-columns: 1fr; }
html.big .kv dd { text-align: left; margin-bottom: 6px; }
html.big .tbl { font-size: .8rem; }

/* =====================================================================
   v2 — ไอคอน SVG, ปุ่มมีเอฟเฟกต์, ลวดลาย, ภาพเคลื่อนไหว
   ===================================================================== */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ลวดลายโมเลกุล (หกเหลี่ยม) จาง ๆ ทั่วพื้นหลัง */
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='97' viewBox='0 0 84 97'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='1.2'%3E%3Cpath d='M42 2 80 24v44L42 90 4 68V24z'/%3E%3Cpath d='M42 2v22M80 68 61 57M4 68l19-11'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.10'%3E%3Ccircle cx='42' cy='2' r='2.2'/%3E%3Ccircle cx='80' cy='24' r='2.2'/%3E%3Ccircle cx='4' cy='68' r='2.2'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 84px 97px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 20%, transparent 75%);
}
html.hc body::after { display: none; }

.ico { width: 1.35em; height: 1.35em; flex: none; vertical-align: -0.28em; }
.ico.grad { stroke: url(#ig); }
.ico.grad2 { stroke: url(#ig2); }

/* เข้าหน้าแบบไล่ลำดับ */
#view > * { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }
#view > *:nth-child(2) { animation-delay: .06s; } #view > *:nth-child(3) { animation-delay: .12s; }
#view > *:nth-child(4) { animation-delay: .18s; } #view > *:nth-child(5) { animation-delay: .24s; }
#view > *:nth-child(n+6) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* ปุ่มหลัก: แสงวิ่งผ่าน (shimmer) */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn .ico { width: 1.3em; height: 1.3em; }
.btn.primary::after, .btn.teal::after {
  content: ""; position: absolute; inset: -40% auto -40% -60%; width: 45%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg); animation: shine 4.2s ease-in-out infinite;
}
.btn.teal::after { animation-delay: 1.6s; }
@keyframes shine { 0%, 62% { left: -60%; } 100% { left: 130%; } }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 16px 34px -10px rgba(56, 170, 255, .85), inset 0 1px 0 rgba(255,255,255,.5); }
.btn.teal:hover { transform: translateY(-1px); }
.btn:not(.primary):not(.teal):not(.danger) .ico { color: #8fdcff; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.45); animation: ripple .6s ease-out forwards; pointer-events: none; z-index: 0; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* กรอบไล่สีหมุน (ใช้กับการ์ดสำคัญ) */
.glow-border { position: relative; }
.glow-border::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0 52%, #3b7bff 64%, #38c8ff 74%, #8ef4ff 80%, #7be35a 88%, #ffb21f 95%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin-ang 6s linear infinite;
}
@keyframes spin-ang { to { --ang: 360deg; } }
html.hc .glow-border::before { display: none; }

/* หน้าแรก: ไอคอนลอย + วงแสงหมุน + ฟองอากาศ */
.hero { isolation: isolate; }
.icon-wrap { position: relative; flex: none; width: 112px; height: 112px; }
.icon-wrap .hero-icon { position: relative; z-index: 1; animation: float 5s ease-in-out infinite; }
.icon-wrap::before {
  content: ""; position: absolute; inset: -14px; border-radius: 40px; z-index: 0;
  background: conic-gradient(from var(--ang), #3b7bff, #38c8ff, #7be35a, #ffb21f, #38c8ff, #3b7bff);
  filter: blur(18px); opacity: .55; animation: spin-ang 7s linear infinite;
}
@keyframes float { 50% { transform: translateY(-6px) rotate(-1.5deg); } }
@media (max-width: 480px) { .icon-wrap { width: 96px; height: 96px; } .icon-wrap::before { border-radius: 34px; } }
.bubbles { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bubbles i { position: absolute; bottom: -20px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), rgba(255,255,255,.02) 60%); animation: bubble linear infinite; }
@keyframes bubble { to { transform: translateY(-420px) translateX(var(--dx, 10px)); opacity: 0; } }

/* ไทล์: ชิปไอคอนไล่สี */
.tile { position: relative; overflow: hidden; isolation: isolate; }
.tile .ic {
  width: 48px; height: 48px; border-radius: 15px; font-size: 1.5rem;
  background: linear-gradient(160deg, rgba(190,235,255,.22), rgba(60,140,255,.12) 55%, rgba(40,90,220,.22));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 8px 20px -10px rgba(56, 170, 255, .7);
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.tile .ic .ico { width: 26px; height: 26px; stroke: url(#ig); }
.tile:hover .ic { transform: rotate(-8deg) scale(1.08); }
.tile::after {
  content: ""; position: absolute; width: 140px; height: 140px; right: -50px; top: -60px; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(56,190,255,.18), transparent); transition: transform .4s;
}
.tile:nth-child(even)::after { background: radial-gradient(closest-side, rgba(25,211,192,.18), transparent); }
.tile:hover::after { transform: scale(1.4); }

/* แถบนำทาง: ไอคอน SVG + จุดเรืองแสงเมื่อเลือก */
.tabbar a { position: relative; transition: color .2s, background .2s; }
.tabbar a .i { display: grid; place-items: center; }
.tabbar a .i .ico { width: 24px; height: 24px; }
.tabbar a[aria-current=page] .ico { stroke: url(#ig); }
.tabbar a[aria-current=page]::after { content: ""; position: absolute; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: #8ef4ff; box-shadow: 0 0 10px #38c8ff; }
.tabbar a.go { box-shadow: 0 8px 22px -8px rgba(56,170,255,.9); }
.tabbar a.go .ico { width: 26px; height: 26px; }
.back .ico { width: 24px; height: 24px; }

/* ปุ่มเลือก (seg) แบบเม็ดยา + ไอคอน */
.seg button { display: inline-flex; align-items: center; gap: 8px; transition: background .2s, border-color .2s, transform .15s; }
.seg button .ico { width: 20px; height: 20px; }
.seg button[aria-pressed=true] .ico { stroke: url(#ig); }
.seg button:active { transform: scale(.96); }

/* สวิตช์โหมดภาพ (1 ภาพ / 2 ภาพ) */
.mode-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border-radius: 18px; background: rgba(0,0,0,.3); border: 1px solid var(--border); }
.mode-switch button { position: relative; z-index: 1; min-height: 56px; border: 0; background: none; cursor: pointer; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 500; color: var(--muted); transition: color .25s; }
.mode-switch button[aria-pressed=true] { color: #021433; font-weight: 600; }
.mode-switch .knob { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 14px; background: linear-gradient(120deg, #8ef4ff, #3cc2ff 45%, #4d86ff); box-shadow: 0 8px 20px -8px rgba(56,170,255,.9); transition: transform .35s cubic-bezier(.3, 1.3, .5, 1); }
.mode-switch[data-mode=pair] .knob { transform: translateX(100%); }
html.hc .mode-switch .knob { background: #ffd400; }

/* ช่องแนบภาพ 2 ภาพ */
.slots { display: grid; gap: 14px; }
@media (min-width: 640px) { .slots { grid-template-columns: 1fr 1fr; } }
.slot { position: relative; padding: 16px; border-radius: 20px; border: 1.5px dashed rgba(255,255,255,.22); background: rgba(0,0,0,.18); transition: border-color .2s, background .2s; }
.slot.filled { border-style: solid; border-color: rgba(25,211,192,.6); background: rgba(25,211,192,.06); }
.slot.over { border-color: var(--amber); background: rgba(255,179,71,.08); }
.slot .num { position: absolute; top: -14px; left: 14px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #021433; background: linear-gradient(135deg, #8ef4ff, #3b8bff); box-shadow: 0 6px 16px -6px rgba(56,170,255,.9); }
.slot.s2 .num { background: linear-gradient(135deg, #c4ff8a, #2fd59a); color: #032114; }
.slot h3 { margin: 6px 0 4px 34px; }
.slot .preview { margin: 12px 0; border-radius: 14px; overflow: hidden; aspect-ratio: 4/3; background: rgba(0,0,0,.35); display: grid; place-items: center; color: var(--muted); }
.slot .preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot .preview .ico { width: 44px; height: 44px; opacity: .5; }

/* เครื่องมือกล้อง */
.cam-tools { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.cam-tools button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); }
.cam-tools button[aria-pressed=true] { background: linear-gradient(135deg, #8ef4ff, #3b8bff); color: #021433; border-color: transparent; }
.cam-tools button .ico { width: 22px; height: 22px; }
.meter { margin-top: 12px; }
.meter .bar { position: relative; height: 12px; border-radius: 12px; background: linear-gradient(90deg, #2a2f55 0%, #2a2f55 100%); overflow: hidden; }
.meter .zone { position: absolute; top: 0; bottom: 0; left: 59%; width: 38%; background: rgba(25,211,192,.28); border-left: 1px solid #19d3c0; border-right: 1px solid #19d3c0; }
.meter .needle { position: absolute; top: -3px; bottom: -3px; width: 4px; border-radius: 4px; background: #fff; box-shadow: 0 0 10px #fff; transition: left .5s ease; }
.meter .lbl { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.cam-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.cam-row input[type=range] { flex: 1; accent-color: #38c8ff; min-height: 40px; }

/* ROI: กรอบพื้นขาว */
.roi.white { border: 3px dotted #9ffcf0; box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 18px rgba(127,245,224,.5); }
.roi.white .tag { color: #9ffcf0; top: auto; bottom: -32px; }
.roi.white .grip { background: #7ff5e0; }
.roi-pair { display: grid; gap: 14px; }
@media (min-width: 700px) { .roi-pair { grid-template-columns: 1fr 1fr; } }
.roi-pair .cap { font-size: .9rem; color: var(--muted); margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.roi-pair .cap b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #021433; background: linear-gradient(135deg, #8ef4ff, #3b8bff); font-size: .85rem; }
.roi-pair .cap.s2 b { background: linear-gradient(135deg, #c4ff8a, #2fd59a); color: #032114; }

/* ผลตรวจ: วงแหวนรอบสถานะ + ตัวเลขนับขึ้น */
.status-pill { position: relative; }
.status-pill::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 2px solid currentColor; opacity: 0; animation: ping 2.4s ease-out 0.6s 3; }
@keyframes ping { 0% { opacity: .6; transform: scale(.96); } 100% { opacity: 0; transform: scale(1.12); } }
.result.glow-border { border-radius: var(--radius); }
.big-num { color: #fff; text-shadow: 0 6px 28px rgba(56,190,255,.45); }
html.hc .big-num { color: #fff; text-shadow: none; }
.advice li { margin: 6px 0; }
.advice h3 { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.norm-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 5px 12px; border-radius: 999px; font-size: .85rem; background: rgba(25,211,192,.12); border: 1px solid rgba(25,211,192,.4); color: #b8fff2; }

/* ตัวจับเวลา: ประกายวิ่งตามวง */
#ringDot { filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 16px #38c8ff); transition: cx 1s linear, cy 1s linear; }
.skip-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 20px; margin-top: 14px; background: linear-gradient(120deg, rgba(25,211,192,.12), rgba(47,179,224,.08)); border: 1px solid rgba(25,211,192,.35); }
.skip-card { flex-wrap: wrap; }
.skip-card > .ico { width: 34px; height: 34px; stroke: url(#ig2); flex: none; }
.skip-card > div { min-width: 150px; }
.skip-card > .btn { flex: 1 1 auto; }
@media (max-width: 480px) { .skip-card > .btn { flex-basis: 100%; } }

@media (prefers-reduced-motion: reduce) {
  #view > *, .icon-wrap .hero-icon, .icon-wrap::before, .bubbles i, .btn::after, .glow-border::before, .status-pill::after { animation: none !important; }
}

/* ---------- รายงาน (modal) ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: rgba(1,6,24,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fadeIn .25s ease; }
.modal-box { width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: linear-gradient(160deg, rgba(12,40,100,.96), rgba(3,14,44,.98)); border: 1px solid rgba(255,255,255,.12);
  border-radius: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(56,190,255,.15), 0 0 60px rgba(236,79,134,.18);
  animation: popIn .35s cubic-bezier(.2,.9,.3,1.2); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.modal-head b { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.modal-body { padding: 14px 16px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 12px 16px 16px; border-top: 1px solid rgba(255,255,255,.08); margin: 0; }
.report-img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.spinner { width: 54px; height: 54px; margin: 40px auto 12px; border-radius: 50%;
  background: conic-gradient(from 0deg, #3b7bff, #38c8ff, #7be35a, #ffb21f, transparent 85%);
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 57%); mask: radial-gradient(circle, transparent 55%, #000 57%);
  animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(20px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .modal, .modal-box, .spinner { animation: none; } }
@media print { .modal { display: none; } }

/* =====================================================================
   v3 — ธีมห้องปฏิบัติการวิทยาศาสตร์สมัยใหม่ (โทนเดียวกับไอคอนใหม่)
   น้ำเงินเข้ม + แก้วใส + แสงไซแอน + สเปกตรัมสีน้ำยา (ส้ม→เขียว→ฟ้า)
   ===================================================================== */
body::before {
  background:
    radial-gradient(46vmax 34vmax at 8% 4%, rgba(40, 140, 255, 0.34), transparent 62%),
    radial-gradient(40vmax 30vmax at 96% 18%, rgba(56, 200, 255, 0.18), transparent 60%),
    radial-gradient(44vmax 34vmax at 90% 98%, rgba(123, 227, 90, 0.12), transparent 60%),
    radial-gradient(30vmax 22vmax at 6% 92%, rgba(255, 178, 31, 0.10), transparent 60%),
    radial-gradient(90vmax 70vmax at 50% 30%, #07205c, var(--bg) 72%);
}
/* กระดาษกราฟ (blueprint) แทนลายหกเหลี่ยมเดิม */
body::after {
  opacity: 1;
  background-image:
    linear-gradient(rgba(120, 200, 255, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 200, 255, .075) 1px, transparent 1px),
    linear-gradient(rgba(120, 200, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 200, 255, .035) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  -webkit-mask-image: radial-gradient(130% 90% at 50% 0%, #000 25%, transparent 80%);
  mask-image: radial-gradient(130% 90% at 50% 0%, #000 25%, transparent 80%);
}

/* เลเยอร์ห้องแล็บ: ลำแสงสแกน + โมเลกุลลอย + อนุภาคเรืองแสง */
.lab-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.lab-bg .beam {
  position: absolute; left: -10%; right: -10%; height: 34vh; top: -34vh;
  background: linear-gradient(180deg, transparent, rgba(56, 200, 255, .07) 70%, rgba(142, 244, 255, .22) 98%, transparent);
  border-bottom: 1px solid rgba(142, 244, 255, .28);
  animation: beam 11s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes beam { 0% { transform: translateY(0); opacity: 0; } 8% { opacity: 1; } 70% { opacity: 1; } 100% { transform: translateY(140vh); opacity: 0; } }
.lab-bg .mol { position: absolute; color: rgba(130, 210, 255, .22); animation: molfloat var(--d, 30s) ease-in-out infinite alternate; }
.lab-bg .mol svg { width: 100%; height: 100%; display: block; animation: molspin calc(var(--d, 30s) * 2) linear infinite; }
@keyframes molfloat { to { transform: translate3d(var(--x, 30px), var(--y, -40px), 0); } }
@keyframes molspin { to { transform: rotate(360deg); } }
.lab-bg .dot { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #8ef4ff; box-shadow: 0 0 10px 2px rgba(56, 200, 255, .6); opacity: 0; animation: spark var(--d, 9s) ease-in-out infinite; }
.lab-bg .dot.g { background: #b6ff7a; box-shadow: 0 0 10px 2px rgba(123, 227, 90, .55); }
.lab-bg .dot.o { background: #ffd27a; box-shadow: 0 0 10px 2px rgba(255, 178, 31, .5); }
@keyframes spark { 0%, 100% { opacity: 0; transform: translateY(0) scale(.6); } 40% { opacity: .9; } 70% { opacity: .5; transform: translateY(-60px) scale(1); } }
html.hc .lab-bg { display: none; }

/* การ์ดแก้วห้องแล็บ: ขอบบนเรืองแสง */
.card {
  background: linear-gradient(180deg, rgba(120, 180, 255, .10), rgba(60, 120, 255, .035) 60%, rgba(20, 60, 160, .05));
  border-color: rgba(130, 200, 255, .17);
  box-shadow: 0 20px 50px -22px rgba(0, 10, 40, .9), inset 0 1px 0 rgba(200, 240, 255, .12);
}
.tile { background: linear-gradient(180deg, rgba(120, 180, 255, .09), rgba(60, 120, 255, .03)); }
.tile:hover { background: linear-gradient(180deg, rgba(120, 190, 255, .15), rgba(60, 130, 255, .05)); border-color: rgba(142, 244, 255, .35); }

/* ไอคอนในไทล์ = ขวดแก้วมีน้ำยาเรืองแสงด้านล่าง (คลื่นเคลื่อนไหว) */
.tile .ic { position: relative; overflow: hidden; isolation: isolate; border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(200, 240, 255, .25), inset 0 8px 14px -8px rgba(255, 255, 255, .35), 0 10px 22px -10px rgba(56, 170, 255, .8); }
.tile .ic .ico { stroke: #eaf8ff; filter: drop-shadow(0 0 6px rgba(142, 244, 255, .7)); }
.tile .ic::before {
  content: ""; position: absolute; left: -50%; right: -50%; bottom: -8px; height: 62%; z-index: -1; border-radius: 42%;
  background: var(--liq, linear-gradient(180deg, rgba(56, 200, 255, .75), rgba(59, 123, 255, .85)));
  animation: slosh 6s linear infinite;
}
.tile:nth-child(6n+2) .ic { --liq: linear-gradient(180deg, rgba(123, 227, 90, .75), rgba(28, 201, 180, .85)); }
.tile:nth-child(6n+3) .ic { --liq: linear-gradient(180deg, rgba(255, 178, 31, .8), rgba(255, 122, 47, .85)); }
.tile:nth-child(6n+4) .ic { --liq: linear-gradient(180deg, rgba(142, 244, 255, .7), rgba(56, 170, 255, .85)); }
.tile:nth-child(6n+5) .ic { --liq: linear-gradient(180deg, rgba(180, 140, 255, .7), rgba(109, 123, 255, .85)); }
.tile:nth-child(6n) .ic { --liq: linear-gradient(180deg, rgba(123, 227, 90, .7), rgba(56, 200, 255, .8)); }
@keyframes slosh { to { transform: rotate(360deg); } }
.tile::after { background: radial-gradient(closest-side, rgba(56, 170, 255, .2), transparent); }
.tile:nth-child(even)::after { background: radial-gradient(closest-side, rgba(123, 227, 90, .14), transparent); }

/* ไอคอนแอปหน้าแรก: ลอย + วงแสงหมุน + ประกายแก้ว + เส้นสแกนกล้อง */
.icon-wrap { width: 124px; height: 124px; }
.hero-icon { width: 124px; height: 124px; border-radius: 30%; box-shadow: 0 22px 50px -16px rgba(30, 120, 255, .9); background: none; }
.icon-wrap::before { inset: -10px; border-radius: 34%; opacity: .7; filter: blur(20px); }
.icon-wrap .fx { position: absolute; inset: 0; z-index: 2; border-radius: 30%; overflow: hidden; pointer-events: none; animation: float 5s ease-in-out infinite; }
.icon-wrap .fx::before { /* ประกายแก้ววิ่งผ่าน */
  content: ""; position: absolute; top: -30%; bottom: -30%; width: 38%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-18deg);
  animation: glint 5.5s ease-in-out infinite;
}
.icon-wrap .fx::after { /* เส้นสแกนในกรอบกล้อง */
  content: ""; position: absolute; left: 24%; right: 30%; height: 2px; top: 24%;
  background: linear-gradient(90deg, transparent, #8ef4ff, transparent); box-shadow: 0 0 12px 2px rgba(56, 200, 255, .8);
  animation: iconscan 3.2s ease-in-out infinite;
}
@keyframes glint { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes iconscan { 0%, 100% { top: 24%; opacity: 0; } 10%, 90% { opacity: 1; } 50% { top: 66%; } }
.icon-wrap .orbit { position: absolute; inset: -16px; border-radius: 50%; border: 1px dashed rgba(142, 244, 255, .28); animation: molspin 24s linear infinite; z-index: 0; }
.icon-wrap .orbit::before, .icon-wrap .orbit::after { content: ""; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #8ef4ff; box-shadow: 0 0 12px 3px rgba(56, 200, 255, .8); top: -4px; left: calc(50% - 4px); }
.icon-wrap .orbit::after { top: auto; bottom: -4px; background: #b6ff7a; box-shadow: 0 0 12px 3px rgba(123, 227, 90, .7); }
@media (max-width: 480px) { .icon-wrap, .hero-icon { width: 108px; height: 108px; } }
.topbar .brand img { border-radius: 30%; }
.brand-name { background: none; }

/* ฟองอากาศ = ฟองในหลอดทดลอง สีฟ้า */
.bubbles i { border-color: rgba(142, 244, 255, .4); background: radial-gradient(circle at 30% 30%, rgba(200, 245, 255, .45), rgba(56, 200, 255, .04) 60%); }

/* แถบนำทางแบบแก้ว + ปุ่มตรวจเรืองแสง */
.tabbar { border-color: rgba(130, 200, 255, .2); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(200, 240, 255, .1); }
.tabbar a[aria-current=page] { background: rgba(56, 200, 255, .12); }
.tabbar a.go { box-shadow: 0 8px 24px -6px rgba(56, 170, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .55); }
.tabbar a.go .ico { stroke: #021433; }
.tabbar a.go[aria-current=page] .ico { stroke: #021433; }
.steps li.now { box-shadow: 0 0 14px rgba(56, 200, 255, .8); }

/* ปุ่มหลักน้ำเงินแก้ว + เงาสะท้อนบน */
.btn.primary { box-shadow: 0 12px 30px -10px rgba(56, 170, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn.primary .ico, .btn.teal .ico { filter: none; }
.btn:not(.primary):not(.teal) { background: linear-gradient(180deg, rgba(130, 190, 255, .14), rgba(80, 140, 255, .06)); border-color: rgba(130, 200, 255, .2); }
.btn:not(.primary):not(.teal):hover { background: linear-gradient(180deg, rgba(130, 200, 255, .22), rgba(80, 150, 255, .1)); }
.btn.ghost { background: transparent !important; }
.big-num { text-shadow: 0 0 30px rgba(56, 200, 255, .55), 0 6px 28px rgba(30, 120, 255, .45); }
.result::before { background: radial-gradient(closest-side, var(--halo, rgba(56, 170, 255, .35)), transparent); }
.info { background: rgba(56, 170, 255, .1); border-color: rgba(56, 200, 255, .35); }
.skip-card { background: linear-gradient(120deg, rgba(123, 227, 90, .12), rgba(56, 200, 255, .08)); border-color: rgba(123, 227, 90, .38); }
.slot.filled { border-color: rgba(123, 227, 90, .6); background: rgba(123, 227, 90, .06); }
.timer-chip.ready { border-color: #7be35a; box-shadow: 0 0 0 1px rgba(123, 227, 90, .35), 0 10px 30px -14px rgba(123, 227, 90, .8); }
.meter .zone { background: rgba(123, 227, 90, .26); border-color: #7be35a; }
.cam-row input[type=range], #scale { accent-color: #38c8ff !important; }
#ringDot { filter: drop-shadow(0 0 8px #fff) drop-shadow(0 0 16px #38c8ff); }

@media (prefers-reduced-motion: reduce) {
  .lab-bg .beam, .lab-bg .mol, .lab-bg .mol svg, .lab-bg .dot, .tile .ic::before, .icon-wrap .fx, .icon-wrap .fx::before, .icon-wrap .fx::after, .icon-wrap .orbit { animation: none !important; }
  .lab-bg .beam { display: none; }
}
@media print { .lab-bg { display: none !important; } }
html.hc .btn:not(.primary):not(.teal) { background: #000; border: 2px solid #fff; }
html.hc .tile .ic::before, html.hc .icon-wrap .fx, html.hc .icon-wrap .orbit { display: none; }
.cam-tools button[hidden], .cam-row[hidden] { display: none; }
.steps li.done, .steps li.now { background: linear-gradient(90deg, #38c8ff, #4d86ff); }
.steps li.now { background: linear-gradient(90deg, #7be35a, #38c8ff); }
