@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --primary: #0F0C29;
  --primary-dark: #302B63;
  --secondary: #24243E;
  --accent: #8E44AD;
  --light: #F5F5F5;
  --bg: #E0F7FA;
  --bg-card: #ffffff;
  --bg-surface: #f0fafa;
  --text: #1a2e35;
  --text-secondary: #4a6670;
  --text-muted: #7a9aa5;
  --border: #b2dfdb;
  --border-light: #e0f2f1;
  --safe: #2e7d32;
  --safe-bg: #e8f5e9;
  --safe-border: #a5d6a7;
  --warning: #e65100;
  --warning-bg: #fff3e0;
  --warning-border: #ffcc80;
  --danger: #c62828;
  --danger-bg: #ffebee;
  --danger-border: #ef9a9a;
  --shadow-sm: 0 1px 3px rgba(0, 96, 100, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 96, 100, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 96, 100, 0.12);
  --radius: 10px;
  --radius-lg: 14px;
}

::selection {
  background: var(--light);
  color: var(--primary-dark);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  padding: 28px 24px 20px;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
  border-radius: 50%;
}

.header-content {
  position: relative;
  z-index: 1;
}

.app-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.app-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 2px;
  font-weight: 400;
}

/* Tab Bar */
.tab-bar {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s ease;
  border-bottom: 2.5px solid transparent;
  position: relative;
}

.tab-btn:hover {
  color: var(--accent);
  background: var(--bg-surface);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--bg-surface);
}

.tab-icon {
  font-size: 1.2rem;
}

.tab-label {
  white-space: nowrap;
}

/* Main Content */
.app-main {
  flex: 1;
  padding: 16px;
}

/* Dashboard */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.overall-status-banner {
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid;
  animation: fadeInUp 0.4s ease both;
}

.overall-status-banner.status-safe {
  background: var(--safe-bg);
  border-color: var(--safe-border);
}

.overall-status-banner.status-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.overall-status-banner.status-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.overall-status-banner.status-unknown {
  background: var(--bg-surface);
  border-color: var(--border);
}

.status-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-banner-icon {
  font-size: 2rem;
}

.status-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-banner-text strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.status-banner-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Parameter Grid */
.param-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.param-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--border);
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.4s ease both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.param-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.param-card.status-border-safe {
  border-left-color: var(--safe);
}

.param-card.status-border-warning {
  border-left-color: var(--warning);
}

.param-card.status-border-danger {
  border-left-color: var(--danger);
}

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

.param-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.status-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}

.badge-safe {
  background: var(--safe-bg);
  color: var(--safe);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-unknown {
  background: var(--bg-surface);
  color: var(--text-muted);
}

.param-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.param-unit {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 2px;
}

/* Activity Row */
.activity-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.activity-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.5s ease both;
}

.activity-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 10px;
  flex-shrink: 0;
}

.activity-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.activity-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.activity-value {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Recent Section */
.recent-section {
  animation: fadeInUp 0.6s ease both;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.recent-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  animation: fadeInUp 0.4s ease both;
}

.recent-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-bottom: 6px;
}

.recent-params {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recent-param {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Section Container */
.section-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-full {
  width: 100%;
  padding: 12px;
  font-size: 0.9rem;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-delete:hover {
  background: var(--danger-bg);
}

/* Forms */
.log-form {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.3s ease both;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field > span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-field input,
.form-field select,
.form-field textarea {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 44px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.15);
}

.form-field textarea {
  resize: vertical;
}

.percent-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.percent-input-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  height: 6px;
  min-height: auto;
  padding: 0;
  border: none;
  background: transparent;
}

.percent-display {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 48px;
  text-align: right;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.check-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Log Cards */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.4s ease both;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.log-card:hover {
  box-shadow: var(--shadow-md);
}

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

.log-date {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

.log-notes {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
  line-height: 1.5;
}

/* Test Param Chips */
.test-params-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.test-param-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  min-width: 60px;
}

.test-param-chip.chip-safe {
  background: var(--safe-bg);
  color: var(--safe);
}

.test-param-chip.chip-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.test-param-chip.chip-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.test-param-chip.chip-unknown {
  background: var(--bg-surface);
  color: var(--text-muted);
}

.chip-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.chip-value {
  font-size: 0.85rem;
  font-weight: 700;
}

/* Water Change Details */
.change-details {
  display: flex;
  align-items: center;
  gap: 12px;
}

.change-percent-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius);
  min-width: 60px;
  text-align: center;
}

.change-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.tag-blue {
  background: #e3f2fd;
  color: #1565c0;
}

.tag-teal {
  background: var(--bg);
  color: var(--primary);
}

/* Equipment Details */
.equip-details {
  display: flex;
  align-items: center;
  gap: 12px;
}

.equip-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 12px;
  flex-shrink: 0;
}

.equip-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.equip-info strong {
  font-size: 0.95rem;
  color: var(--text);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  animation: fadeInUp 0.4s ease both;
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.empty-hint {
  font-size: 0.82rem !important;
  color: var(--text-muted) !important;
  font-weight: 400 !important;
  margin-top: 4px;
}

/* Skeleton Loading */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.skeleton-card {
  height: 80px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--border-light) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Responsive */
@media (max-width: 640px) {
  .app-header {
    padding: 20px 16px 16px;
  }

  .app-title {
    font-size: 1.4rem;
  }

  .app-main {
    padding: 12px;
  }

  .param-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .activity-row {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  .tab-label {
    font-size: 0.62rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .section-header .btn-primary {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .param-grid {
    grid-template-columns: 1fr;
  }

  .test-params-row {
    gap: 4px;
  }

  .test-param-chip {
    min-width: 50px;
    padding: 4px 8px;
  }
}


<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to AquaTrack! Your aquarium maintenance tracker. The dashboard shows your current water parameters at a glance with color-coded status indicators.", "view": "user", "highlight_selector": ".overall-status-banner", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "The parameter cards show your latest test results — green for safe, orange for warning, and red for danger. Each card shows the measured value and its status.", "view": "user", "highlight_selector": ".param-grid", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Below the parameters, you'll see your latest water change, equipment cleaning, and total record counts at a glance.", "view": "user", "highlight_selector": ".activity-row", "wait_for": "tap_to_continue"},
  {"step": 4, "narration": "Switch to the Water Tests tab to log a new test. Tap 'Log Test' to enter your pH, ammonia, nitrite, nitrate, and temperature readings.", "view": "user", "highlight_selector": ".tab-btn:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Fill in your water test parameters. Each field accepts decimal values. You can also add notes about anything you observed during testing.", "view": "user", "highlight_selector": ".log-form", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "The Water Changes tab lets you log water changes with the percentage changed, whether you used conditioner, and if you vacuumed the gravel.", "view": "user", "highlight_selector": ".tab-btn:nth-child(3)", "wait_for": "user_interaction"},
  {"step": 7, "narration": "The Equipment tab tracks all your maintenance activities — filter cleanings, heater inspections, media replacements, and more.", "view": "user", "highlight_selector": ".tab-btn:nth-child(4)", "wait_for": "user_interaction"},
  {"step": 8, "narration": "All your data syncs across devices automatically. Log a test on your phone and see it on your desktop instantly. Happy fishkeeping! 🐠", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"}
]
-->

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}

.auth-card h2 {
  font-size: 1.05rem;
  color: var(--text);
}

.auth-card p {
  color: var(--text-secondary);
  line-height: 1.5;
}

.auth-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: var(--text-secondary);
}

.tank-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tank-pill {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.tank-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.header-user {
  margin-top: 10px;
}

.tank-panel {
  padding: 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
}

.tank-add-field {
  align-self: end;
}

.empty-state-compact {
  padding: 22px 16px;
}

.tank-gallery-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tank-gallery-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeInUp 0.4s ease both;
}

.tank-gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.tank-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--primary);
}

.tank-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.tank-photo-capture {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.photo-error {
  font-size: 0.82rem;
  color: var(--danger);
}

.tank-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.tank-photo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
}

.tank-photo-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: var(--bg);
}

.tank-photo-meta {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tank-photo-date,
.tank-photo-caption {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.trend-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trend-header {
  align-items: flex-end;
}

.trend-title {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}

.trend-tank-selector {
  min-width: 180px;
}

.trend-tank-selector select {
  min-height: 40px;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.trend-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trend-card-header strong {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trend-chart {
  width: 100%;
  height: 170px;
}

.trend-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 24px;
  text-align: center;
}

.trend-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trend-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.trend-summary-item strong {
  color: var(--text);
  font-size: 0.9rem;
}

.trend-summary-total {
  padding-top: 6px;
  border-top: 1px dashed var(--border-light);
  margin-top: 2px;
}

.trend-window-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--border-light);
  color: var(--text);
}

.tank-inventory-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inventory-form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.inventory-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.inventory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inventory-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
}

.inventory-card-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inventory-card-main strong {
  color: var(--text);
  font-size: 0.92rem;
}

.inventory-card-main span {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.inventory-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tank-maintenance-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.maintenance-header {
  gap: 12px;
}

.maintenance-window-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.maintenance-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.maintenance-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.maintenance-summary-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.maintenance-summary-card strong {
  font-size: 1.4rem;
  color: var(--text);
}

.maintenance-summary-meta,
.maintenance-summary-recency {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.trend-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.trend-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.trend-unit {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.trend-chart-wrap {
  flex: 1;
  min-height: 170px;
}

.trend-canvas {
  width: 100% !important;
  height: 170px !important;
}

@media (max-width: 640px) {
  .inventory-form-grid {
    grid-template-columns: 1fr;
  }

  .inventory-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .inventory-actions .btn-primary,
  .inventory-actions .btn-secondary {
    width: 100%;
  }

  .inventory-card {
    align-items: flex-start;
  }

  .maintenance-summary-grid {
    grid-template-columns: 1fr;
  }

  .trend-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.ai-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-header {
  align-items: flex-end;
  gap: 12px;
}

.ai-subtitle {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ai-summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
}

.ai-summary-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  font-weight: 600;
}

.ai-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.ai-summary-param {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-summary-param span {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-summary-param strong {
  font-size: 0.9rem;
  color: var(--text);
}

.ai-result {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: normal;
}

.ai-error {
  color: var(--danger);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .ai-header {
    align-items: flex-start;
  }

  .ai-header .btn-primary {
    width: 100%;
  }
}

.water-tests-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.vet-report-container {
  position: absolute;
  left: 0;
  top: 0;
  width: 800px;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.vet-report-content {
  background: #fff;
  color: #111;
  padding: 24px;
  font-family: 'DM Sans', sans-serif;
}

.vet-report-header {
  margin-bottom: 18px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
}

.vet-report-header h1 {
  font-size: 20px;
  margin-bottom: 4px;
}

.vet-report-header p {
  font-size: 12px;
  color: #555;
}

.vet-report-section {
  margin-top: 16px;
}

.vet-report-section h2 {
  font-size: 14px;
  margin-bottom: 8px;
}

.vet-report-section p {
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 4px;
}

.vet-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.vet-report-table th,
.vet-report-table td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.vet-report-table th {
  background: #f6f6f6;
  font-weight: 600;
}

@media (max-width: 640px) {
  .water-tests-actions {
    width: 100%;
  }

  .water-tests-actions .btn-primary,
  .water-tests-actions .btn-secondary {
    flex: 1;
  }
}
