/* ═══════════════════════════════════════════════════════════════════════════
   GrowNinja PWA — Stylesheet
   Aesthetic: Stealth ninja meets verdant grow tent.
   Deep matte blacks, electric chlorophyll greens, surgical typography.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Foundation */
  --bg-base:        #0a0e0a;
  --bg-deep:        #060806;
  --bg-card:        #11181a;
  --bg-card-2:      #161e1f;
  --bg-elev:        #1a2425;

  /* Borders and dividers */
  --border:         #1f2c2c;
  --border-soft:    #1a2424;
  --border-active:  #2d6a4f;

  /* Greens — primary brand */
  --g-deep:         #1b4332;
  --g-mid:          #2d6a4f;
  --g-bright:       #52b788;
  --g-glow:         #74c69d;
  --g-pale:         #d8f3dc;

  /* Functional */
  --warn:           #f4a261;
  --warn-glow:      #fab061;
  --danger:         #e63946;
  --info:           #4cc9f0;

  /* Typography */
  --text:           #e8f0e8;
  --text-dim:       #98a89a;
  --text-mute:      #5e7060;
  --text-inverse:   #0a0e0a;

  /* Effects */
  --shadow-card:    0 1px 0 rgba(255,255,255,0.03) inset, 0 4px 12px rgba(0,0,0,0.5);
  --shadow-glow:    0 0 24px rgba(82,183,136,0.25);
  --radius:         18px;
  --radius-sm:      12px;
  --radius-pill:    100px;

  /* Motion */
  --ease:           cubic-bezier(.4, 0, .2, 1);
  --ease-out:       cubic-bezier(.16, 1, .3, 1);

  /* Layout */
  --safe-top:       env(safe-area-inset-top, 0);
  --safe-bottom:    env(safe-area-inset-bottom, 0);
}

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

html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
  font-feature-settings: 'ss01', 'ss02';
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

body {
  /* Atmospheric backdrop */
  background:
    radial-gradient(ellipse 60% 30% at 50% 0%, rgba(45,106,79,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(27,67,50,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 70% 40% at 0% 80%, rgba(82,183,136,0.06) 0%, transparent 60%),
    var(--bg-base);
  min-height: 100vh;
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  opacity: 0.04;
  pointer-events: none;
  z-index: 1000;
  mix-blend-mode: overlay;
}

input, button, textarea, select {
  font-family: inherit;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   ONBOARDING
   ═══════════════════════════════════════════════════════════════════════════ */

.onboarding {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.onboarding-card {
  max-width: 380px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: fadeUp 0.5s var(--ease-out);
}

.onb-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onb-logo-img { width: 100%; height: 100%; object-fit: contain; }

.onb-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.onb-title span { color: var(--g-bright); }

.onb-sub {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.onb-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  margin-bottom: 14px;
  transition: border-color 0.2s var(--ease);
}
.onb-input-wrap:focus-within {
  border-color: var(--g-bright);
  box-shadow: 0 0 0 3px rgba(82,183,136,0.15);
}
.onb-prefix {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--text-mute);
  margin-right: 4px;
}
.onb-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  padding: 14px 0;
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 15px;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--g-mid), var(--g-bright));
  color: var(--text-inverse);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  box-shadow: 0 4px 14px rgba(82,183,136,0.25);
}
.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(82,183,136,0.2);
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  margin-top: 10px;
  transition: background 0.2s var(--ease);
}
.btn-secondary:active { background: var(--bg-card-2); }

.onb-hint {
  margin-top: 16px;
  color: var(--text-mute);
  font-size: 12px;
}
.onb-hint code {
  font-family: 'DM Mono', monospace;
  background: var(--bg-deep);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--g-glow);
}

.onb-error {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.3);
  border-radius: var(--radius-sm);
  color: #ff6975;
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP STRUCTURE
   ═══════════════════════════════════════════════════════════════════════════ */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: calc(12px + var(--safe-top)) 18px 0;
  background: linear-gradient(180deg, var(--bg-base) 60%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px;
}

.header-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.header-brand {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.4px;
}
.header-brand span { color: var(--g-bright); }

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-mute);
  transition: all 0.3s var(--ease);
}
.status-dot.online {
  background: var(--g-bright);
  box-shadow: 0 0 8px var(--g-bright);
  animation: pulse 2s infinite;
}
.status-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
}

.status-text {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
}

.lang-btn {
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  font-size: 12px;
  padding: 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-pill);
  letter-spacing: 0.5px;
}

/* ── Master toggle bar ── */
.master-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.master-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--g-bright), transparent);
  opacity: 0.4;
}

.master-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.master-icon {
  width: 38px;
  height: 38px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.master-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.master-sub {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
  margin-top: 1px;
}
.master-bar.active .master-icon {
  background: linear-gradient(135deg, var(--g-mid), var(--g-bright));
  border-color: var(--g-bright);
  box-shadow: 0 0 12px rgba(82,183,136,0.4);
}
.master-bar.active .master-sub { color: var(--g-glow); }

/* ── Toggle ── */
.toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}
.toggle.small { width: 42px; height: 24px; }

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.25s var(--ease);
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: all 0.25s var(--ease);
}
.toggle.small .toggle-thumb { width: 18px; height: 18px; top: 2px; left: 2px; }

.toggle input:checked ~ .toggle-track {
  background: linear-gradient(135deg, var(--g-mid), var(--g-bright));
  border-color: var(--g-bright);
}
.toggle input:checked ~ .toggle-thumb {
  transform: translateX(22px);
  background: white;
  box-shadow: 0 0 8px rgba(82,183,136,0.4);
}
.toggle.small input:checked ~ .toggle-thumb { transform: translateX(18px); }

/* ═══════════════════════════════════════════════════════════════════════════
   MAIN CONTENT + TABS
   ═══════════════════════════════════════════════════════════════════════════ */

.main {
  flex: 1;
  padding: 0 18px calc(95px + var(--safe-bottom));
  overflow-y: auto;
}

.tab-content {
  display: none;
  animation: fadeUp 0.35s var(--ease-out);
}
.tab-content.active { display: block; }

/* ── Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--g-glow);
}

.card-sub {
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-mute);
  font-family: 'DM Mono', monospace;
}

.card-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--g-bright);
  box-shadow: 0 0 8px var(--g-bright);
  animation: pulse 2s infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD TILES
   ═══════════════════════════════════════════════════════════════════════════ */

.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tile {
  background: var(--bg-card-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s var(--ease);
}

.tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--g-mid), var(--g-bright));
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.tile.has-value::before { opacity: 0.7; }
.tile.has-value { border-color: var(--border); }

.tile-icon {
  font-size: 18px;
  margin-bottom: 4px;
  filter: grayscale(0.2);
}

.tile-value {
  font-family: 'DM Mono', monospace;
  font-size: 26px;
  font-weight: 500;
  color: var(--g-glow);
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.tile-value.na {
  font-size: 18px;
  color: var(--text-mute);
}

.tile-unit {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
  font-family: 'DM Mono', monospace;
}

.tile-label {
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--text-mute);
  margin-top: 8px;
  font-weight: 700;
}

/* VPD hero tile */
.tile-vpd-hero {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--bg-card-2) 0%, var(--bg-elev) 100%);
}
.tile-vpd-hero .tile-value { font-size: 36px; }
.tile-vpd-hero .tile-target {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.5px;
}

/* Update flash */
@keyframes flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.updating { animation: flash 0.4s var(--ease); }

/* ═══════════════════════════════════════════════════════════════════════════
   PLUG OVERVIEW
   ═══════════════════════════════════════════════════════════════════════════ */

.plug-list { display: flex; flex-direction: column; }

.plug-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.plug-row:last-child { border-bottom: none; padding-bottom: 0; }
.plug-row:first-child { padding-top: 0; }

.plug-info { display: flex; align-items: center; gap: 12px; }

.plug-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-card-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.plug-name {
  font-size: 14px;
  font-weight: 600;
}
.plug-state {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'DM Mono', monospace;
  margin-top: 2px;
}
.plug-state.on { color: var(--g-bright); }
.plug-state.off { color: var(--text-mute); }

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.phase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.phase-btn {
  background: var(--bg-card-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  transition: all 0.2s var(--ease);
}
.phase-btn:active { transform: scale(0.97); }
.phase-btn.active {
  background: linear-gradient(135deg, rgba(45,106,79,0.2) 0%, rgba(82,183,136,0.1) 100%);
  border-color: var(--g-bright);
  box-shadow: inset 0 0 0 1px rgba(82,183,136,0.3);
}

.phase-emoji { font-size: 22px; margin-bottom: 2px; }
.phase-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}
.phase-vpd {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}
.phase-btn.active .phase-vpd { color: var(--g-bright); }

/* ═══════════════════════════════════════════════════════════════════════════
   SETTING SLIDER
   ═══════════════════════════════════════════════════════════════════════════ */

.setting {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}
.setting:last-child { border-bottom: none; padding-bottom: 0; }
.setting:first-child { padding-top: 0; }
.setting.compact { padding: 8px 0; border: none; }

.setting-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.setting-head > span:first-child {
  font-size: 13px;
  font-weight: 600;
}
.setting-val {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--g-bright);
  letter-spacing: -0.3px;
}
.setting-hint {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 6px;
  font-style: italic;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-deep);
  border-radius: 100px;
  outline: none;
  border: 1px solid var(--border-soft);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--g-mid), var(--g-bright));
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-deep);
  box-shadow: 0 0 10px rgba(82,183,136,0.4);
  transition: transform 0.15s var(--ease);
}
input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--g-mid), var(--g-bright));
  border-radius: 50%;
  border: 2px solid var(--bg-deep);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT TAB
   ═══════════════════════════════════════════════════════════════════════════ */

.time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.time-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.time-display {
  font-family: 'DM Mono', monospace;
  font-size: 32px;
  font-weight: 500;
  color: var(--g-bright);
  letter-spacing: -1px;
  text-shadow: 0 0 16px rgba(82,183,136,0.3);
}

.time-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dli-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(82,183,136,0.05) 0%, rgba(82,183,136,0.02) 100%);
  border: 1px solid rgba(82,183,136,0.15);
  border-radius: var(--radius-sm);
}

.dli-result-tile { text-align: center; }
.dli-result-val {
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--g-bright);
  letter-spacing: -0.5px;
}
.dli-result-label {
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--text-mute);
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CO2 TAB
   ═══════════════════════════════════════════════════════════════════════════ */

.co2-live {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.co2-current {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.co2-current-val {
  font-family: 'DM Mono', monospace;
  font-size: 42px;
  font-weight: 500;
  color: var(--g-glow);
  letter-spacing: -2px;
  line-height: 1;
}
.co2-current-val.na { font-size: 28px; color: var(--text-mute); }
.co2-current-unit {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  color: var(--text-dim);
}

.co2-state-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card-2);
  border: 1px solid var(--border-soft);
  border-radius: 100px;
}
.co2-state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-mute);
}
.co2-state-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.co2-state-badge.idle { border-color: var(--border-soft); }
.co2-state-badge.idle .co2-state-dot { background: var(--text-mute); }
.co2-state-badge.pulsing {
  border-color: var(--g-bright);
  background: rgba(82,183,136,0.1);
}
.co2-state-badge.pulsing .co2-state-dot {
  background: var(--g-bright);
  box-shadow: 0 0 6px var(--g-bright);
  animation: pulse 1s infinite;
}
.co2-state-badge.pulsing .co2-state-label { color: var(--g-bright); }
.co2-state-badge.waiting {
  border-color: var(--warn);
  background: rgba(244,162,97,0.1);
}
.co2-state-badge.waiting .co2-state-dot { background: var(--warn); }
.co2-state-badge.waiting .co2-state-label { color: var(--warn); }

/* CO2 horizontal bar */
.co2-bar-track {
  position: relative;
  height: 8px;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 4px;
}
.co2-bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--info) 0%, var(--g-bright) 50%, var(--warn) 100%);
  border-radius: 100px;
  transition: width 0.5s var(--ease);
}
.co2-bar-target {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--g-pale);
  box-shadow: 0 0 8px var(--g-pale);
  border-radius: 1px;
  transition: left 0.4s var(--ease);
}
.co2-bar-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  color: var(--text-mute);
  letter-spacing: 0.5px;
  margin-top: 6px;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, rgba(76,201,240,0.06) 0%, rgba(76,201,240,0.02) 100%);
  border-color: rgba(76,201,240,0.2);
}
.info-icon { font-size: 16px; flex-shrink: 0; }
.info-text {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONFIG TAB
   ═══════════════════════════════════════════════════════════════════════════ */

.config-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.config-row:last-child { border-bottom: none; padding-bottom: 0; }
.config-row:first-child { padding-top: 0; }
.config-label {
  font-size: 13px;
  color: var(--text-dim);
}
.config-val {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: var(--g-bright);
}

.ip-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.ip-input:last-child { border-bottom: none; padding-bottom: 0; }
.ip-input:first-child { padding-top: 0; }

.ip-input label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.ip-input input {
  flex: 1;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--g-bright);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  max-width: 160px;
  text-align: right;
  transition: border-color 0.2s var(--ease);
}
.ip-input input:focus { border-color: var(--g-bright); }

.lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.lang-tile {
  background: var(--bg-card-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.2s var(--ease);
}
.lang-tile.active {
  background: linear-gradient(135deg, rgba(45,106,79,0.2) 0%, rgba(82,183,136,0.1) 100%);
  border-color: var(--g-bright);
  color: var(--text);
}
.lang-flag { font-size: 18px; }

.about-card {
  text-align: center;
  padding: 24px;
}
.about-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  display: block;
  object-fit: contain;
}
.about-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.about-version {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 3px;
}
.about-tagline {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTTOM NAV
   ═══════════════════════════════════════════════════════════════════════════ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  background: rgba(6,8,6,0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 8px 0 calc(8px + var(--safe-bottom));
  z-index: 60;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-mute);
  padding: 8px 4px;
  position: relative;
  transition: color 0.2s var(--ease);
}
.nav-item span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.nav-item.active { color: var(--g-bright); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--g-bright);
  border-radius: 100px;
  box-shadow: 0 0 10px var(--g-bright);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: var(--bg-card);
  border: 1px solid var(--g-mid);
  color: var(--g-glow);
  padding: 10px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
  transition: all 0.3s var(--ease-out);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 24px rgba(82,183,136,0.2);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Larger screens (small tablets) */
@media (min-width: 540px) {
  .header { padding-top: 24px; }
  .tile-value { font-size: 30px; }
  .tile-vpd-hero .tile-value { font-size: 42px; }
}
