/* ==========================================================================
   biotic.work — Mobile-First Personal Bio-Tech & Smart Farm App Portal
   Designed for fast thumb ergonomics, field legibility & PWA mobile experience
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-root: #050c09;
  --bg-shell: #08120e;
  --bg-card: rgba(14, 29, 23, 0.82);
  --bg-card-hover: rgba(20, 41, 32, 0.95);
  --bg-elevated: #0f231b;
  --bg-input: #07110d;
  --border-subtle: rgba(52, 211, 153, 0.14);
  --border-strong: rgba(52, 211, 153, 0.34);

  --text-main: #ecfdf5;
  --text-secondary: #94b8a8;
  --text-muted: #5e8474;

  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.22);
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  --shadow-card: 0 8px 24px -6px rgba(0, 0, 0, 0.55);
  --shadow-modal: 0 -12px 44px rgba(0, 0, 0, 0.75);
  --nav-bg: rgba(8, 18, 14, 0.9);
}

/* High-Contrast Outdoor Sunlight Mode for Field Operations */
[data-theme="light"] {
  --bg-root: #e6f0ec;
  --bg-shell: #f4f9f6;
  --bg-card: #ffffff;
  --bg-card-hover: #edf7f2;
  --bg-elevated: #e8f3ee;
  --bg-input: #ffffff;
  --border-subtle: rgba(5, 104, 71, 0.18);
  --border-strong: rgba(5, 104, 71, 0.42);

  --text-main: #062419;
  --text-secondary: #2b5444;
  --text-muted: #527a6a;

  --accent-emerald: #059669;
  --accent-emerald-glow: rgba(5, 150, 105, 0.15);
  --accent-cyan: #0284c7;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-purple: #7e22ce;

  --shadow-card: 0 4px 16px -2px rgba(6, 36, 25, 0.08);
  --shadow-modal: 0 -10px 36px rgba(6, 36, 25, 0.18);
  --nav-bg: rgba(244, 249, 246, 0.94);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  font-family: 'Inter', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-root);
  color: var(--text-main);
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Orbs */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
  top: -80px;
  left: 50%;
  transform: translateX(-60%);
}

.orb-2 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  bottom: 40px;
  right: 50%;
  transform: translateX(65%);
}

/* Mobile-First Shell */
.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg-shell);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.45);
}

body.expanded-view .app-shell {
  max-width: 960px;
}

/* Sticky Top Header */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-logo {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand-logo svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 10px;
  box-shadow: 0 0 16px var(--accent-emerald-glow);
}

.live-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--bg-shell);
  box-shadow: 0 0 8px #10b981;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-text h1 {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-text h1 span {
  color: var(--accent-emerald);
  font-weight: 600;
}

.version-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--accent-emerald-glow);
  color: var(--accent-emerald);
  border: 1px solid var(--border-subtle);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-btn:hover,
.icon-btn:active {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: scale(0.95);
}

/* Main Content Area */
.main-content {
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Search Box */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 11px 36px 11px 38px;
  border-radius: 13px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px var(--accent-emerald-glow);
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.live-clock,
.app-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

/* ==========================================================================
   BENTO DASHBOARD GRID
   ========================================================================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

body.expanded-view .bento-grid {
  grid-template-columns: repeat(4, 1fr);
}

.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 13px;
  box-shadow: var(--shadow-card);
  text-align: left;
  color: var(--text-main);
  font-family: inherit;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease;
}

.bento-wide {
  grid-column: span 2;
}

body.expanded-view .bento-wide {
  grid-column: span 4;
}

.bento-interactive {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-interactive:hover,
.bento-interactive:active {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translateY(-1px) scale(0.99);
}

/* Advisor Wide Card */
.bento-advisor {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, var(--bg-card) 85%);
  border-color: var(--border-strong);
}

.bento-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.25); }
}

.bento-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.bento-headline {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.bento-subtext {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 11px;
}

.timeline-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.time-slot {
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

[data-theme="light"] .time-slot {
  background: rgba(5, 150, 105, 0.06);
}

.time-slot.slot-now {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-glow);
}

.slot-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.slot-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Mini Bento Cards */
.bento-icon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bento-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--bg-elevated);
}

.bento-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.bento-metric {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 2px;
}

.metric-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--text-main);
}

.metric-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

.bento-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
}

.bento-footer-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   CATEGORY FILTER PILLS
   ========================================================================== */
.category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
}

.cat-pill.active {
  background: var(--accent-emerald);
  color: #031c13;
  border-color: var(--accent-emerald);
  font-weight: 700;
  box-shadow: 0 3px 12px var(--accent-emerald-glow);
}

/* ==========================================================================
   APP LAUNCHER PORTAL GRID
   ========================================================================== */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 11px;
}

body.expanded-view .app-grid {
  grid-template-columns: repeat(4, 1fr);
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease;
}

.app-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.app-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.app-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.grad-emerald { background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.08)); }
.grad-cyan    { background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(8, 145, 178, 0.08)); }
.grad-amber   { background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.08)); }
.grad-purple  { background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(126, 34, 206, 0.08)); }
.grad-blue    { background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.08)); }
.grad-lime    { background: linear-gradient(135deg, rgba(132, 204, 22, 0.25), rgba(101, 163, 13, 0.08)); }
.grad-rose    { background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(225, 29, 72, 0.08)); }
.grad-slate   { background: linear-gradient(135deg, rgba(148, 163, 184, 0.25), rgba(71, 85, 105, 0.08)); }

.app-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.badge-live   { color: #34d399; border-color: rgba(52, 211, 153, 0.3); }
.badge-cyan   { color: #22d3ee; border-color: rgba(34, 211, 238, 0.3); }
.badge-amber  { color: #fbbf24; border-color: rgba(251, 191, 36, 0.3); }
.badge-purple { color: #c084fc; border-color: rgba(192, 132, 252, 0.3); }
.badge-blue   { color: #60a5fa; border-color: rgba(96, 165, 250, 0.3); }
.badge-rose   { color: #fb7185; border-color: rgba(251, 113, 133, 0.3); }

.app-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.app-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.38;
  margin-bottom: 12px;
}

.btn-launch {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--accent-emerald);
  font-size: 0.74rem;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-launch:hover,
.btn-launch:active {
  background: var(--accent-emerald);
  color: #031c13;
  border-color: var(--accent-emerald);
}

/* Quick Rule of Thumb Strip */
.quick-strip-card {
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
}

.quick-strip-info h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-emerald);
  margin-bottom: 4px;
}

.quick-strip-info p {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  transition: max-width 0.3s ease;
}

body.expanded-view .bottom-nav {
  max-width: 960px;
}

.nav-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.66rem;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.nav-item.active,
.nav-item:hover {
  color: var(--accent-emerald);
}

.nav-item:active {
  transform: scale(0.92);
}

.nav-fab {
  width: 42px;
  height: 42px;
  margin-top: -16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
  border: 2px solid var(--bg-shell);
}

/* ==========================================================================
   SLIDE-UP BOTTOM SHEET MODALS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
  z-index: 40;
}

.app-modal {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  max-height: 88dvh;
  background: var(--bg-shell);
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-modal);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpSheet 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

body.expanded-view .app-modal {
  max-width: 640px;
}

@keyframes slideUpSheet {
  from { transform: translate(-50%, 100%); }
  to   { transform: translate(-50%, 0); }
}

.modal-handle-bar {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.modal-pill {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: var(--border-strong);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-emoji {
  font-size: 1.45rem;
}

.modal-title-group h2 {
  font-size: 1rem;
  font-weight: 800;
}

.modal-title-group p {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* Sub-Tabs inside Modals */
.sub-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.sub-tab {
  padding: 7px 6px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.sub-tab.active {
  background: var(--bg-elevated);
  color: var(--accent-emerald);
  border: 1px solid var(--border-strong);
}

/* Forms & Inputs inside Modals */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent-emerald);
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.preset-chips {
  display: flex;
  gap: 6px;
  margin-top: 7px;
  flex-wrap: wrap;
}

.chip-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
}

.chip-btn.active,
.chip-btn:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  background: var(--accent-emerald-glow);
}

/* Growth Stage Selector */
.stage-selector {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stage-btn {
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
  cursor: pointer;
}

.stage-btn strong {
  font-size: 0.82rem;
}

.stage-btn span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.stage-btn.active {
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-glow);
}

/* Result Boxes */
.result-box {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  margin-top: 8px;
}

.result-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.res-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.res-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.res-big {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.res-huge {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin: 4px 0;
}

.res-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 10px 0;
}

.res-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.res-note {
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.helper-banner {
  font-size: 0.76rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

/* Recipe & Chemical Cards */
.recipe-card {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}

.recipe-card h4 {
  font-size: 0.86rem;
  margin-bottom: 2px;
}

.recipe-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.chem-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.chem-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border-subtle);
}

.chem-list li strong {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-emerald);
}

.recipe-steps {
  font-size: 0.73rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.drone-telemetry-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  font-size: 0.75rem;
}

/* Buttons */
.btn-row {
  display: flex;
  gap: 8px;
}

.btn-primary {
  flex: 1;
  padding: 11px 14px;
  border-radius: 11px;
  border: none;
  background: var(--accent-emerald);
  color: #042117;
  font-weight: 700;
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
}

.btn-secondary {
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
}

.text-btn {
  border: none;
  background: none;
  color: var(--accent-emerald);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

/* Log & DB Lists */
.log-history-section {
  margin-top: 16px;
}

.log-list,
.db-list,
.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-entry,
.db-item,
.task-item {
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
}

.log-entry-top,
.db-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.badge-tank-a {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
}

.badge-tank-b {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.task-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.task-input-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.86rem;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-item label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  flex: 1;
}

.task-item.done span {
  text-decoration: line-through;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 99px;
  background: var(--accent-emerald);
  color: #031c13;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 80;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.hidden {
  display: none !important;
}
