/* ============================================================
   BLACKCHIN ALERT — Pastel Green Liquid Glass Theme
   ============================================================ */
:root {
  /* Light Glass tokens */
  --g-bg:       rgba(255, 255, 255, 0.45);
  --g-bg-hi:    rgba(255, 255, 255, 0.75);
  --g-border:   rgba(255, 255, 255, 0.8);
  --g-spec-top: inset 0 1px 0 rgba(255, 255, 255, 1);
  --g-spec-bot: inset 0 -1px 0 rgba(255, 255, 255, 0.4);
  --g-shadow:   0 12px 32px rgba(52, 211, 153, 0.15);

  /* Pastel Green palette */
  --green-100:  #d1fae5;
  --green-200:  #a7f3d0;
  --green-300:  #6ee7b7;
  --green-400:  #34d399; /* Primary soft green */
  --green-500:  #10b981;
  --green-600:  #059669; /* For contrast text */
  --green-glow: rgba(110, 231, 183, 0.6);

  /* Background */
  --bg:         #ecfdf5; /* Very soft pastel green background */

  /* Text */
  --text:       #064e3b; /* Very dark green */
  --text-2:     #065f46;
  --text-3:     #047857;

  /* State */
  --alert:      #ef4444;
  --alert-bg:   #fee2e2;
  --warn:       #f59e0b;
  --warn-bg:    #fef3c7;
  --safe:       #10b981;
  --safe-bg:    #d1fae5;

  /* Layout */
  --radius:     24px;
  --tabbar:     82px;
}

/* ─── Reset ────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { margin:0; padding:0; }
body {
  font-family:"IBM Plex Sans Thai",sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.6;
  overscroll-behavior-y:contain;
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
  padding-bottom:calc(var(--tabbar) + env(safe-area-inset-bottom));
}
h1,h2,h3 { font-family:"Kanit",sans-serif; font-weight:600; margin:0; }

/* ─── Background ambient orbs (Pastel) ──────────────────────── */
.bg-orbs {
  position:fixed; inset:0;
  pointer-events:none; z-index:0; overflow:hidden;
}
.bg-orbs::before,.bg-orbs::after {
  content:''; position:absolute; border-radius:50%;
}
.bg-orbs::before {
  width:min(600px,90vw); height:min(600px,90vw);
  background:radial-gradient(circle,rgba(167, 243, 208, 0.8) 0%,transparent 70%);
  top:-15vw; right:-10vw; filter:blur(60px);
  animation:orb-a 16s ease-in-out infinite alternate;
}
.bg-orbs::after {
  width:min(500px,80vw); height:min(500px,80vw);
  background:radial-gradient(circle,rgba(209, 250, 229, 0.9) 0%,transparent 70%);
  bottom:2vh; left:-15vw; filter:blur(70px);
  animation:orb-b 20s ease-in-out infinite alternate;
}
.bg-orb3 {
  position:fixed;
  width:min(400px,60vw); height:min(400px,60vw);
  top:35vh; right:10vw;
  pointer-events:none; z-index:0;
  background:radial-gradient(circle,rgba(110, 231, 183, 0.4) 0%,transparent 70%);
  border-radius:50%; filter:blur(50px);
  animation:orb-c 24s ease-in-out infinite alternate;
}
@keyframes orb-a { to { transform:translate(-10vw,10vh) scale(1.1); } }
@keyframes orb-b { to { transform:translate(12vw,-10vh) scale(1.15); } }
@keyframes orb-c { to { transform:translate(-8vw,15vh) scale(1.25); } }

/* ─── App shell ─────────────────────────────────────────────── */
.app { position:relative; z-index:1; max-width:520px; margin:0 auto; min-height:100vh; }

/* ─── Glass helper ──────────────────────────────────────────── */
.card {
  background:linear-gradient(135deg,var(--g-bg-hi) 0%,var(--g-bg) 100%);
  backdrop-filter:blur(24px) saturate(1.5);
  -webkit-backdrop-filter:blur(24px) saturate(1.5);
  border:1px solid var(--g-border);
  border-radius:var(--radius);
  box-shadow:var(--g-shadow),var(--g-spec-top);
}
.pad { padding:20px; }

/* ─── Header ────────────────────────────────────────────────── */
header.bar {
  position:sticky; top:0; z-index:30;
  padding:calc(12px + env(safe-area-inset-top)) 18px 12px;
  background:linear-gradient(135deg,rgba(255,255,255,0.7) 0%,rgba(255,255,255,0.4) 100%);
  backdrop-filter:blur(30px) saturate(2);
  -webkit-backdrop-filter:blur(30px) saturate(2);
  border-bottom:1px solid rgba(255,255,255,0.6);
  box-shadow:0 8px 32px rgba(16, 185, 129, 0.08),inset 0 1px 0 rgba(255,255,255,0.8);
}
.brand { display:flex; align-items:center; gap:12px; }
.brand .logo {
  width:44px; height:44px; border-radius:14px; flex:0 0 auto;
  background:linear-gradient(135deg,var(--green-200),var(--green-400));
  display:grid; place-items:center; font-size:23px; color:var(--text);
  box-shadow:0 4px 16px var(--green-glow),inset 0 2px 0 rgba(255,255,255,0.6);
  border:1px solid rgba(255,255,255,0.8);
}
.brand .name {
  font-family:"Kanit"; font-weight:700; font-size:19px; line-height:1.1;
  color:var(--text);
}
.brand .tag { font-size:12px; color:var(--text-3); }

/* ─── Main / Views ──────────────────────────────────────────── */
main { padding:18px 16px 8px; }
.view { display:none; animation:fade-view .35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.view.active { display:block; }
@keyframes fade-view {
  from { opacity:0; transform:translateY(12px) scale(0.99); }
  to   { opacity:1; transform:none; }
}

/* ─── Text helpers ──────────────────────────────────────────── */
.eyebrow {
  font-size:12px; font-weight:600;
  letter-spacing:1.8px; text-transform:uppercase;
  color:var(--green-600);
}
.lead { color:var(--text-2); font-size:14.5px; margin:6px 0 0; line-height:1.65; }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  appearance:none; border:0; cursor:pointer;
  font-family:"Kanit"; font-weight:600; font-size:16px;
  padding:15px; width:100%;
  display:flex; align-items:center; justify-content:center; gap:10px;
  border-radius:18px;
  transition:transform .12s ease, filter .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform:scale(.96); }
.btn .ico { display:flex; align-items:center; }
.btn .ico svg { width:20px; height:20px; stroke-width:2.5; }
.btn:focus-visible { outline:2px solid var(--green-500); outline-offset:3px; }
.btn[disabled] { opacity:.5; cursor:default; pointer-events:none; filter:grayscale(0.6); }
.btn-row { display:grid; gap:10px; margin-top:16px; }

.btn-primary {
  background:linear-gradient(135deg,var(--green-300),var(--green-400));
  color:var(--text);
  box-shadow:0 8px 24px rgba(52, 211, 153, 0.4),inset 0 2px 0 rgba(255,255,255,0.6);
  border:1px solid rgba(255,255,255,0.8);
}
.btn-primary:hover { filter:brightness(1.05); box-shadow:0 12px 28px rgba(52, 211, 153, 0.5); }

.btn-ghost {
  background:rgba(255,255,255,0.6); color:var(--text-2);
  border:1px solid rgba(255,255,255,0.8);
  backdrop-filter:blur(14px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.9), 0 4px 12px rgba(0,0,0,0.03);
}
.btn-ghost:hover { background:rgba(255,255,255,0.85); color:var(--text); }

/* ─── Model pill ────────────────────────────────────────────── */
.model-pill {
  display:inline-flex; align-items:center; gap:7px; margin-top:14px;
  font-size:12px; color:var(--text-3); font-weight:500;
  background:rgba(255,255,255,0.5);
  border:1px solid rgba(255,255,255,0.8);
  padding:5px 14px; border-radius:999px;
  backdrop-filter:blur(10px);
}
.model-pill .dot {
  width:8px; height:8px; border-radius:50%;
  background:var(--green-400); flex:0 0 auto;
  box-shadow:0 0 8px var(--green-glow);
}
.model-pill.custom .dot { background:var(--warn); box-shadow:0 0 8px rgba(245, 158, 11, 0.5); }

/* ─── Image stage ───────────────────────────────────────────── */
.stage {
  position:relative; margin-top:16px;
  border-radius:20px; overflow:hidden;
  background:rgba(255,255,255,0.3);
  aspect-ratio:4/3; display:grid; place-items:center;
  border:1px solid rgba(255,255,255,0.8);
  box-shadow:inset 0 2px 10px rgba(0,0,0,0.04), 0 12px 32px rgba(52,211,153,0.1);
}
.stage::before {
  content:''; position:absolute; inset:0; pointer-events:none;
  background-image:
    linear-gradient(rgba(52,211,153,0.1) 1px,transparent 1px),
    linear-gradient(90deg,rgba(52,211,153,0.1) 1px,transparent 1px);
  background-size:38px 38px;
}
/* Corner brackets */
.stage::after {
  content:''; position:absolute; inset:14px;
  border:2px solid rgba(52,211,153,0.5);
  border-radius:14px; pointer-events:none;
  mask:
    linear-gradient(#000 0 0) top/24px 2px no-repeat,
    linear-gradient(#000 0 0) left/2px 24px no-repeat,
    linear-gradient(#000 0 0) bottom/24px 2px no-repeat,
    linear-gradient(#000 0 0) right/2px 24px no-repeat,
    linear-gradient(#000 0 0) top right/24px 2px no-repeat,
    linear-gradient(#000 0 0) top right/2px 24px no-repeat,
    linear-gradient(#000 0 0) bottom right/24px 2px no-repeat,
    linear-gradient(#000 0 0) bottom right/2px 24px no-repeat;
}
.stage .placeholder {
  text-align:center; color:var(--text-3);
  padding:24px; position:relative; z-index:1;
}
.stage .placeholder .fish {
  opacity:1; color: var(--green-400);
  filter:drop-shadow(0 4px 12px rgba(52,211,153,0.4));
}
.stage .placeholder .fish svg { width:60px; height:60px; stroke-width:1.5; }
.stage .placeholder .ph-text { margin-top:12px; font-size:14px; font-weight:500; }
.stage img,.stage video {
  width:100%; height:100%; object-fit:cover; display:block;
}
#webcam-container canvas {
  width:100%; height:100%; object-fit:cover; display:block;
}

/* ─── Scan overlay ──────────────────────────────────────────── */
.scan {
  position:absolute; inset:0; display:none; flex-direction:column;
  align-items:center; justify-content:center; gap:0;
  background:rgba(255,255,255,0.7);
  backdrop-filter:blur(8px);
  transition: background 0.3s, backdrop-filter 0.3s;
}
.scan.live-mode {
  background:rgba(255,255,255,0);
  backdrop-filter:blur(0px);
  -webkit-backdrop-filter:blur(0px);
  pointer-events:none;
}
.scan.live-mode .label {
  background:rgba(255,255,255,0.6);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}
.scan.on { display:flex; }

.scan-fx {
  position:relative; width:80px; height:80px;
  display:grid; place-items:center;
}
.ripple {
  position:absolute; inset:0; border-radius:50%;
  border:2.5px solid var(--green-400);
  box-shadow:0 0 16px rgba(52,211,153,0.4);
  animation:ripple 2s ease-out infinite;
}
.ripple:nth-child(2) { animation-delay:.6s; }
.ripple:nth-child(3) { animation-delay:1.2s; }
@keyframes ripple {
  0%   { transform:scale(.3); opacity:1; }
  100% { transform:scale(4.5); opacity:0; }
}
.scan-dot {
  position:relative; z-index:2;
  width:48px; height:48px; border-radius:50%;
  background:var(--green-100); color:var(--green-600);
  border:2px solid var(--green-400);
  display:grid; place-items:center;
  box-shadow:0 4px 16px rgba(52,211,153,0.5);
  animation:pulse-dot 1.2s ease-in-out infinite alternate;
}
@keyframes pulse-dot {
  from { transform:scale(0.95); box-shadow:0 4px 12px rgba(52,211,153,0.4); }
  to   { transform:scale(1.05); box-shadow:0 8px 24px rgba(52,211,153,0.7); }
}
.scan .label {
  margin-top:20px; color:var(--text);
  font-family:"Kanit"; font-weight:600; font-size:15px;
  background:rgba(255,255,255,0.85);
  border:1px solid rgba(255,255,255,0.9);
  box-shadow:0 4px 12px rgba(0,0,0,0.05);
  padding:8px 20px; border-radius:999px;
}

#fileInput { display:none; }

/* ─── Result card ───────────────────────────────────────────── */
.result { margin-top:16px; display:none; }
.result.show { display:block; animation:pop .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop {
  from { opacity:0; transform:scale(.95) translateY(16px); }
  to   { opacity:1; transform:none; }
}
.result .head {
  padding:20px; border-radius:var(--radius) var(--radius) 0 0;
  display:flex; align-items:center; gap:16px;
}
.result .head .badge {
  width:56px; height:56px; border-radius:18px;
  background:rgba(255,255,255,0.4);
  display:grid; place-items:center;
  flex:0 0 auto;
  box-shadow:inset 0 2px 0 rgba(255,255,255,0.6), 0 4px 12px rgba(0,0,0,0.05);
  border:1px solid rgba(255,255,255,0.5);
}
.result .head .badge svg { width:30px; height:30px; stroke-width:2.5; }
.result .head .verdict {
  font-family:"Kanit"; font-weight:700; font-size:21px;
  line-height:1.2;
}
.result .head .sub { font-size:13px; margin-top:2px; font-weight:500; }

.result.is-alert .head {
  background:linear-gradient(135deg,var(--alert-bg),#fecaca);
  border:1px solid #fca5a5; border-bottom:0;
}
.result.is-alert .head .verdict { color:#991b1b; }
.result.is-alert .head .sub { color:#b91c1c; }
.result.is-alert .head .badge svg { color:#ef4444; }

.result.is-warn .head {
  background:linear-gradient(135deg,var(--warn-bg),#fde68a);
  border:1px solid #fcd34d; border-bottom:0;
}
.result.is-warn .head .verdict { color:#92400e; }
.result.is-warn .head .sub { color:#b45309; }
.result.is-warn .head .badge svg { color:#f59e0b; }

.result.is-safe .head {
  background:linear-gradient(135deg,var(--safe-bg),#a7f3d0);
  border:1px solid #6ee7b7; border-bottom:0;
}
.result.is-safe .head .verdict { color:#065f46; }
.result.is-safe .head .sub { color:#047857; }
.result.is-safe .head .badge svg { color:#10b981; }

.result-body {
  background:linear-gradient(135deg,rgba(255,255,255,0.8) 0%,rgba(255,255,255,0.6) 100%);
  backdrop-filter:blur(24px) saturate(1.8);
  -webkit-backdrop-filter:blur(24px) saturate(1.8);
  border:1px solid rgba(255,255,255,0.9); border-top:none;
  border-radius:0 0 var(--radius) var(--radius);
  padding:20px;
  box-shadow:0 16px 40px rgba(52,211,153,0.12);
}
.conf-row {
  display:flex; justify-content:space-between; align-items:baseline;
  font-size:13px; color:var(--text-3); font-weight:500;
}
.conf-row b { font-family:"Kanit"; font-size:22px; color:var(--text); }
.meter {
  height:12px; border-radius:999px;
  background:rgba(0,0,0,0.04); overflow:hidden; margin:8px 0 6px;
  box-shadow:inset 0 1px 3px rgba(0,0,0,0.05);
}
.meter > i {
  display:block; height:100%; border-radius:999px;
  transition:width .8s cubic-bezier(.2,.8,.2,1);
}
.is-alert .meter > i { background:linear-gradient(90deg,#f87171,#ef4444); }
.is-warn  .meter > i { background:linear-gradient(90deg,#fbbf24,#f59e0b); }
.is-safe  .meter > i { background:linear-gradient(90deg,#34d399,#10b981); }

.advice {
  margin-top:16px; font-size:14px;
  border-radius:16px; padding:14px 16px; line-height:1.7;
}
.is-alert .advice {
  background:#fef2f2; color:#991b1b;
  border:1px solid #fecaca;
}
.is-warn .advice {
  background:#fffbeb; color:#92400e;
  border:1px solid #fde68a;
}
.is-safe .advice {
  background:#f0fdf4; color:#065f46;
  border:1px solid #bbf7d0;
}
.next-step { margin-top:16px; }

.all-classes {
  margin-top:18px;
  border-top:1px dashed rgba(0,0,0,0.08);
  padding-top:14px;
}
.cls-title { font-size:13px; color:var(--text-3); margin-bottom:8px; font-weight:500; }
.cls { display:flex; align-items:center; gap:10px; font-size:13.5px; margin:8px 0; }
.cls .nm { flex:1; color:var(--text-2); }
.cls .bar {
  flex:0 0 90px; height:8px; border-radius:999px;
  background:rgba(0,0,0,0.04); overflow:hidden;
}
.cls .bar > i { display:block; height:100%; background:var(--green-400); }
.cls .pct {
  flex:0 0 44px; text-align:right;
  font-weight:600; font-size:12.5px; color:var(--text);
}

/* ─── Steps ─────────────────────────────────────────────────── */
.steps { display:grid; gap:12px; margin-top:18px; }
.step {
  display:flex; gap:14px; align-items:flex-start;
  background:rgba(255,255,255,0.6);
  border:1px solid rgba(255,255,255,0.9);
  border-radius:18px; padding:16px;
  backdrop-filter:blur(12px);
  box-shadow:0 4px 12px rgba(0,0,0,0.02), inset 0 1px 0 rgba(255,255,255,1);
  transition:background .2s, transform .2s;
}
.step:hover { background:rgba(255,255,255,0.85); transform:translateY(-2px); }
.step .n {
  width:32px; height:32px; border-radius:10px;
  background:var(--green-200); color:var(--green-600);
  font-family:"Kanit"; font-weight:700;
  display:grid; place-items:center; flex:0 0 auto;
  font-size:15px; box-shadow:0 4px 10px rgba(52,211,153,0.3);
}
.step .t { font-size:14.5px; color:var(--text-2); padding-top:4px; }
.step .t b { font-family:"Kanit"; font-weight:600; color:var(--text); }

/* ─── Recipes ───────────────────────────────────────────────── */
.filterbar {
  display:flex; gap:10px; overflow-x:auto;
  padding:4px 0 16px; scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.filterbar::-webkit-scrollbar { display:none; }
.chip {
  flex:0 0 auto; cursor:pointer;
  background:rgba(255,255,255,0.6); color:var(--text-2);
  border:1px solid rgba(255,255,255,0.9);
  border-radius:999px; padding:10px 20px;
  font-size:14px; font-weight:500;
  font-family:"IBM Plex Sans Thai";
  transition:all .2s ease;
  backdrop-filter:blur(8px);
  box-shadow:0 4px 10px rgba(0,0,0,0.02);
}
.chip.active {
  background:var(--green-400); color:var(--text);
  border-color:var(--green-300);
  box-shadow:0 6px 16px rgba(52,211,153,0.4);
}
.chip:not(.active):hover { background:rgba(255,255,255,0.9); }

.recipes { display:grid; gap:14px; }
.recipe {
  display:flex; gap:16px; align-items:stretch;
  padding:18px;
  transition:transform .2s ease, box-shadow .2s ease;
}
.recipe:hover {
  transform:translateY(-3px);
  box-shadow:0 16px 32px rgba(52,211,153,0.15),inset 0 1px 0 rgba(255,255,255,1);
}
.recipe .thumb {
  width:64px; height:64px; border-radius:18px; flex:0 0 auto;
  display:grid; place-items:center; font-size:32px;
  background:linear-gradient(135deg,var(--green-100),#fff);
  border:1px solid rgba(255,255,255,0.9);
  box-shadow:0 4px 12px rgba(52,211,153,0.15);
}
.recipe .info { flex:1; min-width:0; }
.recipe h3 { font-size:17px; color:var(--text); }
.recipe p { margin:4px 0 10px; font-size:14px; color:var(--text-2); line-height:1.55; }
.tags { display:flex; flex-wrap:wrap; gap:8px; }
.t-tag {
  font-size:11.5px; padding:4px 12px; border-radius:999px;
  background:rgba(52,211,153,0.15); color:var(--green-600);
  border:1px solid rgba(52,211,153,0.3); font-weight:600;
}
.t-tag.value {
  background:rgba(245,158,11,0.15); color:#b45309;
  border-color:rgba(245,158,11,0.3);
}

/* ─── Model page ────────────────────────────────────────────── */
.field-label {
  display:block; font-family:"Kanit"; font-weight:600;
  font-size:14.5px; margin-bottom:8px; color:var(--text);
}
.field {
  width:100%; border:1.5px solid rgba(255,255,255,0.8);
  border-radius:16px; padding:15px 16px; font-size:14.5px;
  font-family:"IBM Plex Sans Thai"; color:var(--text);
  background:rgba(255,255,255,0.5);
  backdrop-filter:blur(10px);
  transition:border-color .2s, box-shadow .2s, background .2s;
  box-shadow:inset 0 2px 4px rgba(0,0,0,0.02);
}
.field::placeholder { color:var(--text-3); opacity:0.7; }
.field:focus {
  outline:none; border-color:var(--green-400); background:rgba(255,255,255,0.8);
  box-shadow:0 0 0 4px rgba(52,211,153,0.25);
}
.hint { font-size:12.5px; color:var(--text-3); margin-top:8px; }
.hint code,.model-note code {
  background:rgba(52,211,153,0.15); color:var(--green-600);
  padding:2px 8px; border-radius:6px; font-size:12px; font-weight:500;
}
.model-status {
  margin-top:16px; font-size:14px; font-weight:500;
  border-radius:14px; padding:0; transition:all .25s;
}
.model-status.show { padding:14px 16px; }
.model-status.loading {
  background:rgba(255,255,255,0.6); color:var(--text-2);
  border:1px solid rgba(255,255,255,0.9);
}
.model-status.ok {
  background:var(--safe-bg); color:var(--green-600);
  border:1px solid #6ee7b7;
}
.model-status.err {
  background:var(--alert-bg); color:#991b1b;
  border:1px solid #fca5a5;
}
.model-classes { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.m-cls {
  font-size:13px; padding:6px 14px; border-radius:999px;
  background:rgba(255,255,255,0.7); color:var(--text-2);
  border:1px solid rgba(255,255,255,0.9); font-weight:500;
  box-shadow:0 2px 6px rgba(0,0,0,0.02);
}
.m-cls.target {
  background:#fee2e2; color:#b91c1c;
  border-color:#fca5a5; font-weight:600;
}

/* ─── About / stats ─────────────────────────────────────────── */
.stat {
  display:flex; gap:16px; align-items:center;
  padding:16px 0;
  border-bottom:1px solid rgba(0,0,0,0.06);
}
.stat:last-child { border-bottom:0; }
.stat .big {
  color:var(--green-500); flex:0 0 56px; line-height:1;
  display:grid; place-items:center;
  background:var(--green-100); width:56px; height:56px; border-radius:16px;
  box-shadow:0 4px 12px rgba(52,211,153,0.2);
}
.stat .d { font-size:14px; color:var(--text-2); line-height:1.6; }
.model-note { font-size:13px; color:var(--text-3); margin-top:16px; line-height:1.7; }

.section-title { margin:26px 0 12px; display:flex; align-items:baseline; gap:8px; }
.section-title h2 { font-size:19px; color:var(--text); }

/* ─── Bottom tab bar ────────────────────────────────────────── */
nav.tabs {
  position:fixed; left:0; right:0; bottom:0; z-index:40;
  display:flex; max-width:520px; margin:0 auto;
  padding-bottom:env(safe-area-inset-bottom);
  background:rgba(255,255,255,0.85);
  backdrop-filter:blur(30px) saturate(2);
  -webkit-backdrop-filter:blur(30px) saturate(2);
  border-top:1px solid rgba(255,255,255,0.9);
  box-shadow:0 -8px 30px rgba(52,211,153,0.08),inset 0 1px 0 rgba(255,255,255,1);
}
.tab {
  flex:1; background:none; border:0; cursor:pointer;
  padding:14px 4px 12px; color:var(--text-3);
  display:flex; flex-direction:column; align-items:center; gap:4px;
  font-family:"IBM Plex Sans Thai";
  transition:color .2s ease;
}
.tab .ti {
  display:flex; align-items:center; justify-content:center;
  transition:transform .25s cubic-bezier(.34,1.56,.64,1), filter .2s;
}
.tab .ti svg { width:24px; height:24px; stroke-width:2.2; }
.tab .tl { font-size:11.5px; font-weight:600; }
.tab.active { color:var(--green-600); }
.tab.active .ti {
  transform:translateY(-3px) scale(1.15);
  filter:drop-shadow(0 4px 8px rgba(52,211,153,0.4));
}
.tab:focus-visible { outline:2px solid var(--green-400); outline-offset:2px; border-radius:12px; }

/* ─── Toast ─────────────────────────────────────────────────── */
.toast {
  position:fixed; left:50%;
  bottom:calc(82px + env(safe-area-inset-bottom) + 16px);
  transform:translateX(-50%) translateY(20px);
  background:rgba(6, 78, 59, 0.9); color:#fff;
  backdrop-filter:blur(20px) saturate(1.8);
  -webkit-backdrop-filter:blur(20px) saturate(1.8);
  border:1px solid rgba(255,255,255,0.2);
  padding:12px 24px; border-radius:999px; font-size:14px; font-weight:500;
  opacity:0; pointer-events:none;
  transition:.3s cubic-bezier(.34,1.56,.64,1);
  z-index:50; max-width:90%;
  box-shadow:0 8px 30px rgba(6, 78, 59, 0.3),inset 0 1px 0 rgba(255,255,255,0.2);
  white-space:nowrap;
}
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* ─── Responsive: wider screens ─────────────────────────────── */
@media (min-width:540px) {
  nav.tabs {
    border-radius:24px 24px 0 0;
    border-left:1px solid rgba(255,255,255,0.9);
    border-right:1px solid rgba(255,255,255,0.9);
  }
  .app { padding: 0 4px; }
}

/* ─── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation-duration:.001ms !important;
    transition-duration:.001ms !important;
  }
}
