/* The "Lab" tab: molecule, vibe monitor, reflex test, bedtime planner, converter, habits */

/* ---------- lab ---------- */
.inside { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: center; }
#mol { width: 100%; max-width: 300px; height: 270px; display: block; margin: 0 auto; cursor: grab; touch-action: none; }
#mol:active { cursor: grabbing; }
.molcap { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.55; text-align: center; }
.molcap b { color: var(--text2); font-size: 14px; letter-spacing: .02em; }
#molMood { color: var(--text2); }
.systems { display: grid; gap: 12px; min-width: 0; }
.sys { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 13px 15px; min-width: 0; }
.sysh { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--text2); font-weight: 600; }
.sysh b { font-size: 18px; color: var(--text); white-space: nowrap; }
.sysbar { height: 8px; border-radius: 4px; background: #1b1e25; overflow: hidden; margin: 9px 0 7px; }
.sysbar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #4fa8ff, #a77bff); transition: width .6s; }
.sysd { font-size: 12px; color: var(--muted); line-height: 1.45; }
#ecg { width: 100%; height: 58px; display: block; margin: 6px 0 4px; }
#heartIco { display: inline-block; }
#heartIco.beat { animation: beat .25s ease; }
@keyframes beat { 40% { transform: scale(1.35); } }
.glasses { display: flex; flex-wrap: wrap; gap: 3px; margin: 8px 0 10px; font-size: 18px; min-height: 24px; }
.glasses .no { filter: grayscale(1); opacity: .18; }
.waterbtn { border: 1px solid rgba(79,168,255,.45); background: rgba(79,168,255,.1); color: #9fd0ff; border-radius: 10px; padding: 8px 12px; cursor: pointer; font-weight: 600; font-size: 13px; }
@media (hover: hover) { .waterbtn:hover { background: rgba(79,168,255,.2); } }
.fact2 { font-size: 15px; line-height: 1.55; color: var(--text2); min-height: 48px; }
.note { font-size: 13px; color: var(--muted); line-height: 1.65; margin: 0; }
.note b { color: var(--text2); }

.grid2.even { grid-template-columns: 1fr 1fr; }
.molbox { position: relative; }
.moltip { position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); background: #1d2028; border: 1px solid var(--line2); border-radius: 9px;
  padding: 5px 9px; font-size: 12px; color: var(--text2); white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.moltip b { color: var(--text); }
.atoms { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 8px 0 4px; font-size: 12px; color: var(--text2); }
.atoms i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.atoms .aC { background: #808794; } .atoms .aN { background: #4f7cff; } .atoms .aO { background: #ff4f5e; } .atoms .aH { background: #e8ebf0; }
.waterrow { display: flex; gap: 8px; }
.waterbtn.minus { padding: 8px 14px; font-size: 16px; line-height: 1; }
.entry.water .mg { font-size: 18px; }
/* reflex lab */
.rxpad { width: 100%; height: 150px; margin: 12px 0; border-radius: 16px; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transition: background .08s, border-color .08s; touch-action: manipulation;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.rxpad b { font-size: 28px; letter-spacing: -.01em; }
.rxpad span { font-size: 12.5px; color: var(--muted); }
@media (hover: hover) { .rxpad:hover { border-color: var(--text2); } }
.rxpad[data-state="wait"] { background: #3a1419; border-color: #ff4f5e; }
.rxpad[data-state="go"] { background: #1f7a2c; border-color: var(--accent); }
.rxpad[data-state="go"] b { font-size: 40px; color: #eaffdf; }
.rxpad[data-state="early"] { background: #3a2c0c; border-color: var(--warn); }
.rxpad[data-state="result"] b { color: var(--accent); font-size: 36px; }
#rxChart { width: 100%; height: 160px; display: block; }
#rxSummary { margin: 8px 0 0; line-height: 1.5; }
/* bedtime planner */
.bedrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; color: var(--text2); }
.bedline { margin: 2px 0 16px; font-size: 14px; line-height: 1.5; color: var(--text2); }
.bedline b { color: var(--text); }
.bedcall { font-size: 15px; font-weight: 600; margin: 4px 0 14px; line-height: 1.45; }
.bedcall b { font-size: 22px; color: var(--accent); }
.bedbar { position: relative; height: 10px; border-radius: 5px; background: #1b1e25; margin: 6px 0 24px; }
.bedbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 5px; background: linear-gradient(90deg, rgba(124,255,79,.6), rgba(124,255,79,.2)); transition: width .5s; }
.bedbar b { position: absolute; top: -5px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px var(--card); }
.bedbar span { position: absolute; top: 15px; font-size: 11px; color: var(--muted); }
.bedbar .bl { left: 0; } .bedbar .br { right: 0; }
/* converter */
.convgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.conv { display: flex; gap: 10px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-size: 13.5px; color: var(--text2); min-width: 0; }
.conv b { font-size: 19px; color: var(--text); }
.conv .ci { font-size: 24px; flex: none; }
.conv .hint { font-size: 11.5px; }
/* habit */
.hbars { position: relative; height: 128px; display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; padding-bottom: 18px; }
.hb { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; }
.hb i { display: block; border-radius: 4px 4px 1px 1px; min-height: 2px; background: #2a2e38; transition: height .5s; }
.hb span { position: absolute; bottom: -17px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); }
.hb.today span { color: var(--accent); font-weight: 700; }
.hlim { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255,79,94,.65); pointer-events: none; }
.hstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.hstats .k { font-size: 12px; color: var(--muted); }
.hstats b { font-size: 18px; }
