/* Dashboard Base: Layout, nav, typography, shared components - Auto-extracted from dashboard.html */

/* ── Tab Nav (scrollable) ─────────────────────────────── */
/* ── Bottom Tab Nav (PWA-style) ───────────────────────── */
.tab-nav {
  /* No position:fixed — flex child of body, always at bottom */
  flex-shrink: 0;
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0;
  min-height: 60px;
  background: rgba(10, 14, 26, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 212, 170, 0.25);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  /* iOS home bar safe area and horizontal padding for rounded corners */
  padding-top: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
  z-index: 200;
}

body.modal-open .tab-nav { display: none !important; }
body.modal-open .app-scroll { pointer-events: none !important; }
body.modal-open .chat-fab { display: none !important; }
/* Re-enable pointer events on modal overlays rendered inside app-scroll */
body.modal-open .threshold-modal-overlay { pointer-events: auto !important; }
body.modal-open #custom-substance-modal { pointer-events: auto !important; }
body.modal-open #custom-substance-modal * { pointer-events: auto !important; }

.tab-nav::-webkit-scrollbar { display: none; }

.btn-install {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #fff; border: none; border-radius: 8px;
  padding: 6px 12px; font-size: 0.72rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(0,212,170,0.3); }
  50% { box-shadow: 0 0 16px rgba(0,212,170,0.6); }
}

.tab-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 2px 12px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.62rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-radius: 0;
  /* Separate emoji and text */
}

.tab-btn .tab-icon { font-size: 1.15rem; line-height: 1; }

.tab-btn .tab-label { font-size: 0.58rem; line-height: 1; }

.tab-btn.active {
  background: transparent;
  color: var(--teal);
  box-shadow: none;
}

.tab-btn.active .tab-icon { filter: drop-shadow(0 0 4px rgba(0,212,170,0.6)); }

.tab-panel { display: none; }

.tab-panel.active { display: block; animation: fadeUp 0.2s ease; }

/* Ensure content at bottom of each tab is not hidden behind bottom nav on iOS */
.tab-panel { padding-bottom: 16px; }

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

.health-status-title { font-size: 1.1rem; font-weight: 800; color: var(--text-bright); margin-bottom: 10px; }

.health-progress-track { height: 10px; background: rgba(255,255,255,0.08); border-radius: 6px; overflow: hidden; margin-bottom: 10px; }

.health-progress-fill { height: 100%; border-radius: 6px; width: 0%; transition: width 1.5s cubic-bezier(0.4,0,0.2,1); }

.health-progress-fill.excellent { background: var(--green); }

.health-progress-fill.good      { background: var(--teal); }

.health-progress-fill.fair      { background: var(--yellow); }

.health-progress-fill.attention { background: var(--red); }

.health-issues { font-size: 0.8rem; color: var(--text-dim); line-height: 1.6; }

.health-issues strong { color: var(--text); }

.skimmer-meta { font-size: 0.75rem; color: var(--text-dim); line-height: 1.4; }

/* ── Tank Intelligence Section ───────────────────────── */
#tank-intelligence-section { margin-bottom: 14px; }

.ti-card { background: rgba(255,255,255,0.04); border-radius: 14px; padding: 14px 16px; border: 1px solid rgba(255,255,255,0.08); }

.ti-health-row { display: flex; align-items: center; gap: 14px; }

.ti-score-circle { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem; font-weight: 800; font-family: var(--font-mono, monospace); border: 2px solid transparent; }

.ti-score-circle.critical { background: rgba(239,68,68,0.2);  color: #f87171; border-color: rgba(239,68,68,0.4); }

.ti-score-circle.high     { background: rgba(255,107,53,0.2); color: #fb923c; border-color: rgba(255,107,53,0.4); }

.ti-score-circle.moderate { background: rgba(251,191,36,0.2); color: #fbbf24; border-color: rgba(251,191,36,0.4); }

.ti-score-circle.low      { background: rgba(74,222,128,0.2); color: #4ade80; border-color: rgba(74,222,128,0.4); }

.ti-risk-label { font-weight: 700; font-size: 0.92rem; color: var(--text-bright); }

.ti-risk-sub   { font-size: 0.72rem; color: var(--text-dim); margin-top: 3px; }

.ti-sub-hdr    { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); margin: 12px 0 7px; }

.ti-cond-item  { background: rgba(255,255,255,0.04); border-radius: 8px; padding: 9px 12px; margin-bottom: 6px; border-left: 3px solid rgba(255,255,255,0.1); }

.ti-cond-item.critical { border-left-color: var(--red,#ef4444);    background: rgba(239,68,68,0.07); }

.ti-cond-item.warn     { border-left-color: var(--yellow,#fbbf24); background: rgba(251,191,36,0.07); }

.ti-cond-name  { font-size: 0.82rem; font-weight: 700; color: var(--text-bright); }

.ti-cond-badge { font-size: 0.58rem; font-weight: 700; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; margin-left: 6px; vertical-align: middle; letter-spacing: 0.04em; }

.ti-cond-badge.critical { background: rgba(239,68,68,0.25); color: #f87171; }

.ti-cond-badge.warn     { background: rgba(251,191,36,0.25); color: #fbbf24; }

.ti-cond-desc  { font-size: 0.74rem; color: var(--text-dim); margin-top: 4px; line-height: 1.45; }

.ti-rec-item   { display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start; }

.ti-rec-priority { font-size: 0.85rem; flex-shrink: 0; margin-top: 1px; }

.ti-rec-text   { font-size: 0.78rem; color: var(--text); line-height: 1.5; }

/* ✕ Ignore button on issue pills */
.issue-ignore-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.62rem;
  line-height: 1;
  cursor: pointer;
  padding: 1px 2px;
  border-radius: 3px;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
}

.issue-ignore-btn:hover { opacity: 1; color: var(--red); }

#detectedTrendsContent .insight:last-child { margin-bottom: 0; }

/* ── Section Headers ─────────────────────────────────── */
.sec-hdr {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-dim);
  margin: 20px 0 10px; display: flex; align-items: center; gap: 6px;
}

.sec-hdr:first-child { margin-top: 0; }

.sec-hdr .sec-action {
  margin-left: auto; font-size: 0.72rem; font-weight: 700;
  color: var(--teal); background: none; border: none; cursor: pointer;
  padding: 4px 8px; border-radius: 6px; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
  50%       { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

.cam-fields-hidden { display: none; }

.growth-leaderboard { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

/* ── Settings Tab ────────────────────────────────────── */
.settings-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}

.settings-section-title { font-size: 0.78rem; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px; }

.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }

.settings-row:last-child { border-bottom: none; padding-bottom: 0; }

.settings-row-label { font-size: 0.85rem; color: var(--text-bright); font-weight: 600; }

.settings-row-sub { font-size: 0.72rem; color: var(--text-dim); margin-top: 2px; }

.settings-row-val { font-size: 0.82rem; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }

/* ── Floating Chat ───────────────────────────────────── */
.chat-fab {
  position: fixed; bottom: calc(90px + env(safe-area-inset-bottom)); right: 20px;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  border: none; cursor: pointer; font-size: 1.4rem;
  box-shadow: 0 4px 16px rgba(0,212,170,0.4);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s;
}

.chat-fab:active { transform: scale(0.93); }

.chat-fab.open { font-size: 1rem; }

.chat-panel {
  position: fixed; bottom: 0; right: 0; left: 0;
  max-width: 480px; margin: 0 auto;
  height: 75vh; max-height: 600px;
  background: var(--bg-base); border-radius: 20px 20px 0 0;
  border: 1px solid var(--border); border-bottom: none;
  z-index: 950; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
}

.chat-panel.open { transform: translateY(0); }

.chat-panel-header {
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

.chat-panel-title { font-size: 0.9rem; font-weight: 700; color: var(--text-bright); flex: 1; }

.chat-panel-close { background: none; border: none; color: var(--text-dim); font-size: 1.3rem; cursor: pointer; padding: 4px; }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }

.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 0.83rem; line-height: 1.5; }

.chat-msg.user { background: linear-gradient(135deg, var(--teal), var(--blue)); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }

.chat-msg.ai { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }

.chat-msg.typing { color: var(--text-dim); font-style: italic; }

.chat-chips { padding: 8px 16px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }

.chat-chips::-webkit-scrollbar { display: none; }

.chat-chip {
  flex-shrink: 0; padding: 6px 12px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; font-size: 0.75rem; color: var(--text); cursor: pointer;
  white-space: nowrap; font-family: inherit; -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}

.chat-chip:active { background: var(--teal-dim); border-color: rgba(0,212,170,0.3); }

.chat-input-row { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-shrink: 0; }

.chat-input {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 10px 16px; color: var(--text-bright);
  font-size: 0.85rem; font-family: inherit; outline: none;
  resize: none; max-height: 80px; overflow-y: auto;
}

.chat-input::placeholder { color: var(--text-dim); }

.chat-send {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: var(--teal); color: #000; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Modals ──────────────────────────────────────────── */
/* ── Alert Config Panel (removed — thresholds now in tank settings only) ── */
.alert-section { padding: 16px 20px 0; }

.alert-section-title {
  font-size: 0.68rem; font-weight: 700; color: var(--teal);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── Skeleton ────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px;
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Utilities ───────────────────────────────────────── */
.btn { padding: 10px 16px; border-radius: 10px; border: none; cursor: pointer; font-size: 0.82rem; font-weight: 600; font-family: inherit; transition: all 0.2s; -webkit-tap-highlight-color: transparent; }

.btn-primary { background: linear-gradient(135deg, var(--teal), var(--blue)); color: #fff; }

.btn-secondary { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); }

.btn-ghost { background: none; color: var(--teal); padding: 6px 10px; }

.btn-sm { padding: 6px 12px; font-size: 0.75rem; }

.btn-danger { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.flex-row { display: flex; gap: 8px; }

.flex-row .btn { flex: 1; }

.empty-state { text-align: center; padding: 32px 20px; background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius); }

.empty-icon { font-size: 2.5rem; margin-bottom: 10px; }

.empty-title { font-size: 0.95rem; font-weight: 700; color: var(--text-bright); margin-bottom: 6px; }

.empty-sub { font-size: 0.8rem; color: var(--text-dim); line-height: 1.6; margin-bottom: 16px; }

.ptr-indicator { position: fixed; top: 0; left: 50%; transform: translateX(-50%) translateY(-100%); background: var(--teal); color: #000; font-size: 0.75rem; font-weight: 700; padding: 6px 20px; border-radius: 0 0 14px 14px; transition: transform 0.3s; z-index: 100; pointer-events: none; }

.ptr-indicator.visible { transform: translateX(-50%) translateY(0); }

.status-chip { display: inline-block; padding: 3px 8px; border-radius: 8px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; }

.status-chip.green { background: var(--green-dim); color: var(--green); }

.status-chip.yellow { background: var(--yellow-dim); color: var(--yellow); }

.status-chip.red { background: rgba(239,68,68,0.15); color: var(--red); }

.status-chip.gray { background: rgba(255,255,255,0.06); color: var(--text-dim); }

/* form */
.form-group { margin-bottom: 14px; }

.form-label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }

.form-input, .form-select, .form-textarea { width: 100%; padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; color: var(--text-bright); font-size: 0.85rem; font-family: inherit; outline: none; box-sizing: border-box; }

.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: rgba(0,212,170,0.4); }

.form-select { appearance: none; }

.form-textarea { min-height: 80px; resize: vertical; }

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

.form-error { color: var(--red); font-size: 0.78rem; margin-top: 8px; display: none; }

.form-error.visible { display: block; }

/* photo upload zone */
.photo-upload-zone {
  border: 2px dashed var(--border); border-radius: 12px; padding: 32px 20px;
  text-align: center; color: var(--text-dim); font-size: 0.85rem;
  cursor: pointer; transition: all 0.2s;
}

.photo-upload-zone:hover, .photo-upload-zone.dragover { border-color: var(--teal); color: var(--teal); background: rgba(0,212,170,0.04); }

.photo-upload-zone .upload-icon { font-size: 2rem; margin-bottom: 8px; }

/* Data accumulation info banner */
#data-info-banner {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(0,212,170,0.07);
  border-left: 4px solid var(--teal);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  margin: 10px 16px 0;
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.5;
}

#data-info-banner .banner-icon { flex-shrink: 0; font-size: 1.1rem; margin-top: 1px; }

#data-info-banner .banner-text { flex: 1; }

#data-info-banner .banner-dismiss {
  flex-shrink: 0; background: none; border: none;
  color: var(--text-dim); cursor: pointer; font-size: 1.1rem;
  padding: 0 0 0 8px; line-height: 1; opacity: 0.7;
}

#data-info-banner .banner-dismiss:hover { opacity: 1; }

/* ── Tank Switcher Dropdown ─────────────────────────── */
/* ── Tank Switcher Combobox ─────────────────────────── */
header.header { overflow: visible !important; }

.header-inner { overflow: visible !important; }

.header-actions { overflow: visible !important; position: relative; }

.tank-switcher-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tank-switcher-wrap.hidden { display: none; }

/* The trigger button (replaces <select>) */
.tank-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 28px 7px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  background: rgba(0,212,170,0.12);
  color: var(--text-bright, #fff);
  border: 1.5px solid rgba(0,212,170,0.45);
  border-radius: 8px;
  cursor: pointer;
  max-width: 180px;
  min-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.15s, background 0.15s;
}

.tank-switcher-btn:hover,
.tank-switcher-btn:focus {
  background: rgba(0,212,170,0.2);
  border-color: rgba(0,212,170,0.7);
  outline: none;
}

.tank-switcher-btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.tank-switcher-chevron {
  position: absolute;
  right: 8px;
  pointer-events: none;
  font-size: 0.7rem;
  color: var(--teal, #00d4aa);
  line-height: 1;
  flex-shrink: 0;
}

/* Dropdown panel */
.tank-switcher-dropdown {
  height: 0; opacity: 0; overflow: hidden; transition: height 0.2s ease-out, opacity 0.2s ease-out;

  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-width: 300px;
  background: var(--bg-card, #111827);
  border: 1px solid rgba(0,212,170,0.3);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
  z-index: 500;
  overflow: hidden;
}

.tank-switcher-dropdown.open { height: auto; opacity: 1; overflow: visible; }

/* Search input inside dropdown */
.tank-switcher-search {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: var(--text, #fff);
  font-size: 0.82rem;
  font-family: inherit;
  box-sizing: border-box;
}

.tank-switcher-search:focus { outline: none; background: rgba(255,255,255,0.07); }

.tank-switcher-search::placeholder { color: rgba(255,255,255,0.35); }

/* Options list */
.tank-switcher-options {
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tank-switcher-option {
  display: flex;
  flex-direction: column;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.1s;
}

.tank-switcher-option:last-child { border-bottom: none; }

.tank-switcher-option:hover,
.tank-switcher-option.active { background: rgba(0,212,170,0.1); }

.tank-switcher-option-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-bright, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tank-switcher-option-meta {
  font-size: 0.7rem;
  color: var(--text-dim, #888);
  margin-top: 1px;
}

.tank-switcher-no-results {
  padding: 14px 12px;
  font-size: 0.82rem;
  color: var(--text-dim, #888);
  text-align: center;
}

.btn-text { background:none; border:none; color:var(--teal); font-size:0.82rem; cursor:pointer; text-decoration:underline; padding:4px; font-family:inherit; }

@keyframes spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

.param-summary-left { flex-basis:200px; flex-shrink:0; font-size:0.9rem; color:var(--text-dim); }

.param-summary-left span { color:var(--text-bright); font-weight:700; margin-left:8px; }

.param-summary-right { flex:1; }

/* ── Settings v2 Redesign ───────────────────────────── */
.s2-section { margin-bottom: 32px; }

.s2-label { font-size: 11px; font-weight: 700; color: var(--teal, #00d4aa); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px; }

.s2-card { background: #111d35; border-radius: 12px; padding: 16px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }

.s2-card-title { font-size: 1rem; font-weight: 600; color: var(--text-bright, #f8fafc); margin-bottom: 2px; }

.s2-card-meta { font-size: 0.875rem; color: #8899aa; margin-top: 2px; }

.s2-card-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

.s2-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; flex-shrink: 0; }

.s2-status-dot.connected { background: var(--teal, #00d4aa); box-shadow: 0 0 6px rgba(0,212,170,0.5); }

.s2-status-dot.disconnected { background: #445566; }

.tank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.tank-v2-card { background: #111d35; border-radius: 12px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.4); overflow: hidden; position: relative; }

.tank-v2-card.tank-active { border-left: 3px solid var(--teal, #00d4aa); }

.tank-v2-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }

.tank-v2-info { flex: 1; min-width: 0; }

.tank-v2-name { font-size: 1rem; font-weight: 600; color: var(--text-bright, #f8fafc); }

.tank-v2-meta { font-size: 0.875rem; color: #8899aa; margin-top: 3px; }

.tank-v2-status { display: flex; align-items: center; font-size: 0.8125rem; margin-top: 8px; }

.tank-v2-overflow-wrap { position: relative; flex-shrink: 0; }

.tank-v2-overflow-btn { background: none; border: none; font-size: 1.25rem; cursor: pointer; padding: 4px 8px; border-radius: 8px; color: #8899aa; line-height: 1; transition: background 0.15s, color 0.15s; }

.tank-v2-overflow-btn:hover, .tank-v2-overflow-btn:active { background: rgba(255,255,255,0.08); color: var(--text-bright, #fff); }

.tank-v2-overflow-menu { display: none; position: absolute; top: 100%; right: 0; z-index: 50; min-width: 160px; background: #1a2744; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); padding: 4px 0; }

.tank-v2-overflow-menu.open { display: block; }

.tank-v2-menu-item { display: block; width: 100%; background: none; border: none; text-align: left; padding: 10px 14px; font-size: 0.875rem; color: var(--text-bright, #f8fafc); cursor: pointer; font-family: inherit; transition: background 0.12s; }

.tank-v2-menu-item:hover { background: rgba(255,255,255,0.06); }

.tank-v2-menu-item.danger { color: #ff4d6a; }

.tank-v2-menu-item.danger:hover { background: rgba(255,77,106,0.1); }

.tank-add-card { background: none; border: 2px dashed rgba(255,255,255,0.12); border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 100px; cursor: pointer; color: var(--teal, #00d4aa); font-size: 0.9375rem; font-weight: 600; font-family: inherit; transition: border-color 0.2s, background 0.2s; }

.tank-add-card:hover { border-color: var(--teal, #00d4aa); background: rgba(0,212,170,0.04); }

.tank-v2-confirm { padding: 12px 0 4px; }

.tank-v2-confirm-text { font-size: 0.875rem; color: var(--text-bright, #f8fafc); margin-bottom: 12px; }

.tank-v2-confirm-btns { display: flex; gap: 8px; }

.s2-add-tank-btn { background: none; border: none; color: var(--teal, #00d4aa); font-size: 0.9375rem; font-weight: 600; cursor: pointer; padding: 10px 0; display: flex; align-items: center; gap: 6px; font-family: inherit; width: 100%; }

.s2-add-tank-btn:active { opacity: 0.75; }

.s2-add-tank-panel { background: #111d35; border-radius: 12px; padding: 16px; margin-top: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }

.s2-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }

.s2-row:last-child { border-bottom: none; }

.s2-row-label { font-size: 0.9375rem; color: var(--text-bright, #f8fafc); }

.s2-row-sub { font-size: 0.8125rem; color: #8899aa; margin-top: 2px; }

.s2-row-action-btn { font-size: 0.875rem; color: var(--teal, #00d4aa); background: none; border: none; cursor: pointer; font-family: inherit; font-weight: 600; padding: 4px 0; }

.s2-sign-out-btn { color: #ff4d6a !important; font-size: 0.9375rem; font-weight: 600; background: none; border: none; cursor: pointer; font-family: inherit; text-align: left; padding: 12px 0 4px; }

.s2-signout-confirm { padding: 8px 0; }

.s2-signout-confirm-text { font-size: 0.875rem; color: var(--text-bright, #f8fafc); margin-bottom: 10px; }

.s2-confirm-btn-row { display: flex; gap: 8px; }

.s2-btn-cancel { background: none; border: 1px solid rgba(255,255,255,0.18); border-radius: 8px; color: #8899aa; font-size: 0.8125rem; padding: 7px 16px; cursor: pointer; font-family: inherit; }

.s2-btn-danger { background: #ff4d6a; border: none; border-radius: 8px; color: #fff; font-size: 0.8125rem; padding: 7px 16px; cursor: pointer; font-family: inherit; font-weight: 600; }

.s2-tag { display: inline-block; font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 10px; vertical-align: middle; margin-left: 6px; }

.s2-tag-pro { background: rgba(0,212,170,0.15); color: var(--teal, #00d4aa); }

.s2-tag-free { background: rgba(255,255,255,0.1); color: #8899aa; }

.s2-sync-mode { display: flex; gap: 10px; }

.s2-sync-option { flex: 1; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: all 0.2s; display: flex; align-items: flex-start; gap: 8px; }

.s2-sync-option.active { border-color: rgba(0,212,170,0.4); background: rgba(0,212,170,0.07); }

.s2-sync-option input[type=radio] { margin-top: 2px; accent-color: var(--teal, #00d4aa); flex-shrink: 0; }

.s2-sync-option-label { font-size: 0.875rem; font-weight: 600; color: var(--text-bright, #f8fafc); }

.s2-sync-option-sub { font-size: 0.75rem; color: #8899aa; margin-top: 2px; }

.s2-collector-btns { display: flex; gap: 8px; margin-top: 12px; }

.s2-collector-btns button { flex: 1; }

/* ── Settings Sub-Tab Bar (Pixel spec 2026-03) ─────── */
.dash-settings-tab-bar {
  display: flex; gap: 4px; margin-bottom: 20px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto;
}

.dash-settings-tab-btn {
  display: flex; align-items: center; gap: 5px; padding: 9px 18px;
  background: transparent; border: none; border-radius: 8px;
  color: #8899aa; font-family: inherit; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}

.dash-settings-tab-btn:hover  { color: var(--text-bright, #f8fafc); background: rgba(255,255,255,0.04); }

.dash-settings-tab-btn.active { background: rgba(0,212,170,0.12); color: #00d4aa; border: 1px solid rgba(0,212,170,0.2); }

.dash-settings-panel { display: none; }

.dash-settings-panel.active { display: block; }

/* Advanced troubleshooting toggle */
.adv-toggle-wrap { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.07); }

.adv-toggle-link {
  display: flex; align-items: center; gap: 6px; background: none; border: none;
  color: #64748b; font-family: inherit; font-size: 0.78rem; font-weight: 500;
  cursor: pointer; padding: 2px 0; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: transparent; transition: color 0.2s;
}

.adv-toggle-link:hover { color: #8899aa; text-decoration-color: #64748b; }

.adv-toggle-link[aria-expanded="true"] .adv-toggle-icon { transform: rotate(90deg); }

.adv-toggle-icon { display: inline-block; font-size: 0.7rem; transition: transform 0.2s; }

.adv-override-panel { overflow: hidden; }

@keyframes advSlideDown { from { opacity:0; transform: translateY(-6px); } to { opacity:1; transform: translateY(0); } }

.adv-override-panel.adv-animating { animation: advSlideDown 0.22s ease forwards; }

.adv-override-inner {
  margin-top: 14px; padding: 16px;
  background: rgba(255,107,53,0.05); border: 1px solid rgba(255,107,53,0.18);
  border-radius: 10px;
}

.adv-warn {
  font-size: 0.78rem; color: #fb923c; line-height: 1.5; margin-bottom: 14px;
  padding: 8px 10px; background: rgba(255,107,53,0.08); border-radius: 6px;
}

.act-modal-box {
  position: relative; background: #111d35; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px; padding: 32px 28px 28px; width: 100%; max-width: 420px; text-align: center;
  animation: advSlideDown 0.3s ease;
}

.act-modal-icon { font-size: 2.2rem; margin-bottom: 10px; display: block; }

.act-modal-sub { font-size: 0.8125rem; color: #8899aa; margin-bottom: 24px; line-height: 1.5; }

.act-code-row { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; }

.act-code-digit {
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 58px; background: rgba(0,212,170,0.06);
  border: 1px solid rgba(0,212,170,0.25); border-radius: 9px;
  font-family: 'JetBrains Mono', monospace; font-size: 1.8rem; font-weight: 700;
  color: #00d4aa; box-shadow: 0 0 10px rgba(0,212,170,0.08);
}

.act-code-loading { color: #8899aa; font-size: 0.82rem; padding: 20px 0; }

.act-expiry { font-size: 0.75rem; color: #8899aa; margin-bottom: 24px; }

.act-expiry strong { color: #f59e0b; }

.act-dl-label { font-size: 0.72rem; font-weight: 700; color: #8899aa; text-transform: uppercase; letter-spacing: 0.06em; text-align: left; margin-bottom: 8px; }

.act-dl-links { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.act-dl-btn {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; text-decoration: none; color: var(--text-bright, #f8fafc); transition: all 0.2s;
}

.act-dl-btn:hover { border-color: rgba(0,212,170,0.3); background: rgba(0,212,170,0.07); }

.act-dl-icon  { font-size: 1.3rem; flex-shrink: 0; }

.act-dl-info  { flex: 1; text-align: left; }

.act-dl-info strong { font-size: 0.82rem; font-weight: 700; display: block; }

.act-dl-info small  { font-size: 0.72rem; color: #8899aa; }

.act-dl-arrow { font-size: 0.9rem; color: #00d4aa; font-weight: 700; }

.act-help { font-size: 0.75rem; color: #8899aa; line-height: 1.5; }

.act-help strong { color: var(--green, #22c55e); }

/* ── My Collectors section ────────────────────────────── */
.mc-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }

.mc-card:last-child { margin-bottom: 0; }

.mc-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }

/* Collection Status rows */
.csr-row { display:flex; align-items:center; gap:8px; padding:5px 0; border-bottom:1px solid rgba(255,255,255,0.05); font-size:0.82rem; }

.csr-row:last-child { border-bottom:none; }

.csr-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }

.csr-dot.green { background:#4caf50; }

.csr-dot.yellow { background:#ff9800; }

.csr-dot.red { background:#f44336; }

.csr-dot.gray { background:#64748b; }

.csr-label { flex:1; color:var(--text); }

.csr-count { color:var(--text-dim); font-size:0.75rem; min-width:55px; text-align:right; }

.csr-text { font-size:0.72rem; min-width:100px; text-align:right; }

.mc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

.mc-dot-online  { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.5); }

.mc-dot-stale   { background: #f59e0b; }

.mc-dot-offline { background: #445566; }

.mc-name { font-size: 0.9rem; font-weight: 600; color: var(--text-bright, #f8fafc); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mc-name-input  { flex: 1; min-width: 0; font-size: 0.9rem; padding: 4px 8px; }

.mc-edit-btn { background: none; border: none; color: var(--teal, #00d4aa); font-size: 0.75rem; font-weight: 600; cursor: pointer; font-family: inherit; padding: 2px 6px; flex-shrink: 0; }

.mc-edit-btn:hover { opacity: 0.8; }

.mc-edit-btn:disabled { opacity: 0.4; cursor: default; }

.mc-meta  { font-size: 0.75rem; color: #8899aa; margin-bottom: 6px; font-family: 'JetBrains Mono', monospace; }

.mc-tanks { display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.78rem; }

.mc-tank  { background: rgba(255,255,255,0.05); border-radius: 5px; padding: 2px 8px; color: #c8d8e8; }

.mc-tank-none { color: #445566; font-size: 0.75rem; padding: 2px 0; }

.mc-empty, .mc-error { font-size: 0.84rem; color: #8899aa; padding: 8px 0; }

.mc-error   { color: #ff4d6a; }

.mc-loading { font-size: 0.84rem; color: #8899aa; text-align: center; padding: 16px 0; }

.mc-add-btn { background: none; border: 1px solid rgba(0,212,170,0.3); border-radius: 8px; color: var(--teal, #00d4aa); font-size: 0.82rem; font-weight: 600; cursor: pointer; font-family: inherit; padding: 8px 16px; transition: all 0.2s; }

.mc-add-btn:hover { background: rgba(0,212,170,0.08); border-color: rgba(0,212,170,0.5); }

/* ── Help Tooltips ────────────────────────────────────── */
.help-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  cursor: help;
}

.help-tooltip .help-icon {
  font-size: 0.75rem;
  opacity: 0.6;
}

.help-tooltip .help-text {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,23,42,0.95);
  color: #f8fafc;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  width: 200px;
  text-align: center;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  pointer-events: none;
  white-space: normal;
  line-height: 1.4;
}

.help-tooltip:hover .help-text,
.help-tooltip:focus .help-text,
.help-tooltip.active .help-text {
  display: block;
}

/* ── Tab Help Bars (dismissible info bars per tab) ───── */
.tab-help-bar {
  position: relative;
  background: rgba(0,212,170,0.08);
  border-left: 3px solid rgba(0,212,170,0.4);
  border-radius: 0 8px 8px 0;
  padding: 10px 36px 10px 14px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  font-style: italic;
  color: rgba(248,250,252,0.7);
  line-height: 1.5;
}

.tab-help-bar-dismiss {
  position: absolute;
  top: 6px; right: 8px;
  background: none; border: none;
  color: rgba(248,250,252,0.35);
  font-size: 0.9rem; cursor: pointer;
  padding: 2px 6px; line-height: 1;
}

.tab-help-bar-dismiss:hover { color: rgba(248,250,252,0.6); }

/* ── Pro Upgrade Nudge Overlays ─────────────────────── */
.pro-upgrade-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,15,25,0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: inherit;
  gap: 8px;
  padding: 20px 16px;
  text-align: center;
}

.pro-upgrade-overlay-icon { font-size: 1.6rem; opacity: 0.9; }

.pro-upgrade-overlay-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.pro-upgrade-overlay-sub {
  font-size: 0.75rem;
  color: rgba(248,250,252,0.55);
  max-width: 260px;
  line-height: 1.45;
}

.pro-upgrade-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
  color: #0a0f19;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.pro-upgrade-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,212,170,0.35);
}

.pro-upgrade-price {
  font-size: 0.68rem;
  color: rgba(248,250,252,0.45);
  margin-top: 2px;
}

.pro-gated-section { position: relative; }

.pro-gated-section.gated > *:not(.pro-upgrade-overlay) {
  filter: grayscale(0.7) brightness(0.5);
  pointer-events: none;
  user-select: none;
}

.pd-zone-opt  { background: rgba(0,212,170,0.35); }

.pd-zone-warn { background: rgba(251,191,36,0.25); }

.pd-zone-crit { background: rgba(239,68,68,0.2); }

/* ── Toast notifications ── */
.toast-notification {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #059669; color: white; padding: 12px 24px; border-radius: 10px;
  font-size: 0.85rem; font-weight: 600; z-index: 10000;
  opacity: 0; transition: opacity 0.3s, transform 0.3s;
  pointer-events: none; max-width: 90vw; text-align: center;
}
.toast-notification.toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error { background: #dc2626; }
.toast-info { background: #2563eb; }