/* EspressoBase — Premium Calm Minimalist Theme */

* { -webkit-tap-highlight-color: transparent; }

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  box-shadow:
    0 0 0 1px rgba(196, 164, 132, 0.08),
    0 25px 80px -12px rgba(0, 0, 0, 0.6);
}

.screen { display: none; animation: fadeIn 0.35s ease; }
.screen.active { display: block; }

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

.section-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8B7B6E;
}

.pro-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2C2118;
  background: linear-gradient(135deg, #C4A484, #D4B896);
  border-radius: 9999px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.5rem;
  background: #F8F4ED;
  border-radius: 1.25rem;
  box-shadow: 0 2px 24px -4px rgba(26, 20, 16, 0.08);
  min-height: 5.5rem;
}

.stat-value {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.5rem;
  color: #1A1410;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.65rem;
  color: #8B7B6E;
  text-align: center;
  line-height: 1.35;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.125rem 1.25rem;
  background: #F8F4ED;
  border: none;
  border-radius: 1.25rem;
  cursor: pointer;
  box-shadow: 0 2px 24px -4px rgba(26, 20, 16, 0.08);
  text-align: left;
}

.quick-action.primary {
  background: linear-gradient(135deg, #F8F4ED 0%, #F0EBE3 100%);
  border: 1px solid rgba(196, 164, 132, 0.25);
}

.quick-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.875rem;
  background: rgba(196, 164, 132, 0.15);
  color: #A68B6B;
  flex-shrink: 0;
}

.quick-title { display: block; font-size: 0.9375rem; font-weight: 500; color: #1A1410; }
.quick-sub { display: block; font-size: 0.75rem; color: #8B7B6E; margin-top: 0.125rem; font-weight: 300; }
.quick-arrow { margin-left: auto; color: #C4A484; }

.shot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.125rem;
  background: rgba(248, 244, 237, 0.06);
  border: 1px solid rgba(248, 244, 237, 0.08);
  border-radius: 1rem;
}

.shot-name { font-size: 0.875rem; font-weight: 500; color: #F8F4ED; }
.shot-meta { font-size: 0.75rem; color: #8B7B6E; margin-top: 0.2rem; font-weight: 300; }

.shot-badge {
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
}

.shot-badge.good { background: rgba(196, 164, 132, 0.2); color: #C4A484; }
.shot-badge.fast { background: rgba(212, 165, 116, 0.15); color: #D4A574; }
.shot-badge.slow { background: rgba(139, 123, 110, 0.2); color: #A89888; }

.maintenance-nudge {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  background: rgba(61, 50, 40, 0.6);
  border: 1px solid rgba(196, 164, 132, 0.15);
  border-radius: 1.25rem;
  cursor: pointer;
  width: 100%;
}

.nudge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: rgba(196, 164, 132, 0.12);
  color: #C4A484;
}

.field-group { display: flex; flex-direction: column; }

.field-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8B7B6E;
  margin-bottom: 0.625rem;
}

.field-hint {
  font-size: 0.6875rem;
  font-weight: 300;
  color: #8B7B6E;
  min-height: 1rem;
  margin-bottom: 0.625rem;
}

.field-hint-spacer {
  display: block;
  min-height: 1rem;
  margin-bottom: 0.625rem;
  opacity: 0;
}

.field-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #1A1410;
  background: #F8F4ED;
  border: 1px solid transparent;
  border-radius: 1rem;
  outline: none;
}

.field-input:focus {
  border-color: rgba(196, 164, 132, 0.5);
  box-shadow: 0 0 0 3px rgba(196, 164, 132, 0.12);
}

.field-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B7B6E' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* Aligned numeric fields with inline units */
.dose-out-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.numeric-field { display: flex; flex-direction: column; }

.numeric-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0 0.875rem;
  height: 3.25rem;
  background: #F8F4ED;
  border-radius: 1rem;
}

.numeric-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: #1A1410;
  outline: none;
  font-family: inherit;
}

.numeric-unit {
  font-size: 1rem;
  font-weight: 500;
  color: #8B7B6E;
  flex-shrink: 0;
}

.extraction-target-box {
  padding: 1.125rem;
  background: rgba(248, 244, 237, 0.06);
  border: 1px solid rgba(248, 244, 237, 0.08);
  border-radius: 1.25rem;
  margin-bottom: 1rem;
}

/* Stopwatch */
.stopwatch-card {
  padding: 1.25rem;
  background: #F8F4ED;
  border-radius: 1.25rem;
}

.stopwatch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stopwatch-header .field-label { margin-bottom: 0; }

.text-link-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: #C4A484;
  cursor: pointer;
  font-family: inherit;
}

.stopwatch-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0 1.25rem;
}

.stopwatch-display #sw-display {
  font-size: 2.75rem;
  font-weight: 300;
  color: #1A1410;
  font-variant-numeric: tabular-nums;
}

.sw-unit {
  font-size: 1.375rem;
  font-weight: 300;
  color: #8B7B6E;
}

.stopwatch-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-stopwatch {
  flex: 1;
  padding: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  color: #2C2118;
  background: linear-gradient(135deg, #C4A484, #D4B896);
  border: none;
  border-radius: 1rem;
  cursor: pointer;
}

.btn-stopwatch.stop {
  background: #B47850;
  color: #F8F4ED;
}

.btn-stopwatch-icon {
  width: 3rem;
  padding: 0.875rem;
  background: #F0EBE3;
  border: none;
  border-radius: 1rem;
  color: #8B7B6E;
  cursor: pointer;
}

.sw-recorded {
  text-align: center;
  font-size: 0.75rem;
  color: #8B7B6E;
  margin-top: 0.75rem;
}

.segmented-control {
  display: flex;
  background: rgba(248, 244, 237, 0.08);
  border-radius: 1rem;
  padding: 0.3rem;
  gap: 0.2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.segmented-control::-webkit-scrollbar { display: none; }

.segment {
  flex: 1;
  min-width: fit-content;
  padding: 0.625rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #8B7B6E;
  background: transparent;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.segment.active {
  color: #1A1410;
  background: #F8F4ED;
  box-shadow: 0 1px 8px -2px rgba(26, 20, 16, 0.12);
}

.chip-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chip {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  color: #8B7B6E;
  background: rgba(248, 244, 237, 0.06);
  border: 1px solid rgba(248, 244, 237, 0.1);
  border-radius: 9999px;
  cursor: pointer;
}

.chip.active {
  color: #1A1410;
  background: #F8F4ED;
  border-color: rgba(196, 164, 132, 0.35);
}

.btn-primary {
  padding: 1rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  color: #2C2118;
  background: linear-gradient(135deg, #C4A484, #D4B896);
  border: none;
  border-radius: 1.125rem;
  cursor: pointer;
  box-shadow: 0 4px 24px -4px rgba(196, 164, 132, 0.45);
  width: 100%;
}

.btn-primary.analyzing { opacity: 0.7; pointer-events: none; }

.btn-secondary {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  color: #1A1410;
  background: #F0EBE3;
  border: 1px solid rgba(196, 164, 132, 0.2);
  border-radius: 0.875rem;
  cursor: pointer;
  flex: 1;
}

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  color: #8B7B6E;
  background: transparent;
  border: 1px solid rgba(248, 244, 237, 0.1);
  border-radius: 0.875rem;
  cursor: pointer;
}

.btn-upgrade {
  padding: 0.625rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  color: #2C2118;
  background: linear-gradient(135deg, #C4A484, #D4B896);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
}

.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: #8B7B6E;
  background: transparent;
  border: 1px solid #3D3228;
  border-radius: 9999px;
  cursor: pointer;
}

.recommendation-card {
  padding: 1.5rem;
  background: #F8F4ED;
  border-radius: 1.5rem;
  animation: slideUp 0.4s ease;
}

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

.rec-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.rec-icon.adjust { background: rgba(212, 165, 116, 0.2); }
.rec-icon.good { background: rgba(196, 164, 132, 0.25); }
.rec-icon.warning { background: rgba(180, 120, 80, 0.2); }

.rec-action-box {
  padding: 1rem 1.125rem;
  background: #F0EBE3;
  border-radius: 1rem;
  border-left: 3px solid #C4A484;
}

.pro-upsell {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(196, 164, 132, 0.12);
}

.pro-upsell-blur {
  padding: 1.5rem;
  filter: blur(3px);
  opacity: 0.5;
  pointer-events: none;
}

.pro-upsell-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(44, 33, 24, 0.75);
}

.pro-user .pro-upsell,
.pro-user #bases-upsell { display: none; }

.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.75rem 0.5rem 1.75rem;
  background: rgba(44, 33, 24, 0.95);
  border-top: 1px solid rgba(248, 244, 237, 0.06);
}

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

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.5rem;
  min-width: 3.25rem;
  font-size: 0.5625rem;
  font-weight: 500;
  color: #8B7B6E;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-item.active { color: #C4A484; }

.nav-item .pro-dot {
  position: absolute;
  top: 0;
  right: -2px;
  width: 5px;
  height: 5px;
  background: #C4A484;
  border-radius: 50%;
}

.nav-icon-wrap { position: relative; display: inline-flex; }

.journal-card, .base-card, .maint-item, .gear-card {
  padding: 1.125rem 1.25rem;
  background: #F8F4ED;
  border-radius: 1.25rem;
  cursor: pointer;
}

.base-card.locked { filter: blur(4px); opacity: 0.45; pointer-events: none; }

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(26, 20, 16, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.detail-overlay.hidden { display: none; }

.detail-panel {
  width: 100%;
  max-width: 390px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  background: #2C2118;
  border-radius: 1.5rem 1.5rem 0 0;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(26, 20, 16, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.settings-overlay.hidden { display: none; }

.settings-panel {
  width: 100%;
  max-width: 390px;
  padding: 1.5rem;
  background: #2C2118;
  border-radius: 1.5rem 1.5rem 0 0;
}

.gear-detail-row {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
}

.gear-detail-row span:first-child {
  color: #8B7B6E;
  width: 6.5rem;
  flex-shrink: 0;
}

.gear-detail-row span:last-child { color: #1A1410; }

.toast {
  position: absolute;
  bottom: 6.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.25rem;
  font-size: 0.8125rem;
  color: #F8F4ED;
  background: rgba(61, 50, 40, 0.95);
  border: 1px solid rgba(196, 164, 132, 0.2);
  border-radius: 9999px;
  white-space: nowrap;
  z-index: 100;
}

.toast.hidden { display: none; }

.hidden { display: none !important; }

#screen-container::-webkit-scrollbar { width: 0; }

.add-equipment-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(26, 20, 16, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.add-equipment-modal.hidden { display: none; }

.add-equipment-box {
  width: 100%;
  max-width: 340px;
  padding: 1.5rem;
  background: #2C2118;
  border-radius: 1.25rem;
}