/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue: #2563EB;
  --blue-light: #93B4F8;
  --blue-bg: #EFF4FF;
  --coral: #EF6B4A;
  --coral-light: #F5A58E;
  --coral-bg: #FEF0EC;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --white: #FFFFFF;
  --text: var(--gray-900);
  --text-secondary: var(--gray-500);
  --text-tertiary: var(--gray-400);
  --bg: var(--white);
  --card-bg: var(--white);
  --border: var(--gray-200);
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 999px;
  --font: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Prevent iOS zoom on focus — must be >= 16px */
input, select, textarea {
  font-size: 16px;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* === Onboarding === */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-overlay[hidden] { display: none; }

.onboarding-container {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
  text-align: center;
}

.onboarding-step[hidden] { display: none; }

.onboarding-icon {
  margin-bottom: 24px;
}

.onboarding-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.onboarding-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.5;
}

.onboarding-field {
  text-align: left;
  margin-bottom: 24px;
}

.onboarding-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.onboarding-field input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s;
}

.onboarding-field input:focus { border-color: #3D5A3E; }

.onboarding-btn {
  width: 100%;
  padding: 16px;
  background: #3D5A3E;
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
}

.onboarding-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.onboarding-btn:active:not(:disabled) { transform: scale(0.98); }

.onboarding-skip {
  display: block;
  width: 100%;
  padding: 14px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
  transition: color 0.15s;
}

.onboarding-skip:hover { color: var(--text-secondary); }

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-200);
  transition: background 0.2s;
}

.dot.active {
  background: #3D5A3E;
  width: 24px;
  border-radius: 4px;
}

/* === Dashboard === */
.dash-header {
  padding: 20px 20px 8px;
}

.dash-greeting {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.dash-year-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-year-nav button {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-tertiary);
  padding: 4px 8px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.dash-year-nav button:hover { color: var(--text); }

#dash-year-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.dashboard-cards {
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-card {
  border-radius: 16px;
  padding: 22px 20px 18px;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.dash-card-total {
  background: var(--gray-800);
}

.dash-card-home {
  background: #3D5A3E;
}

.dash-card-away {
  background: #C67B5C;
}

.dash-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dash-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 4px;
}

.dash-card-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.dash-card-sublabel {
  font-size: 13px;
  opacity: 0.7;
}

.dash-card-big-num {
  text-align: right;
  flex-shrink: 0;
}

.dash-card-number {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.dash-card-unit {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 2px;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: rgba(255,255,255,0.85);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.progress-bar-labels {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.55;
  font-weight: 600;
}

.dash-card-count {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  opacity: 0.9;
}

/* Reminder Banner */
.reminder-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px 4px;
  padding: 12px 16px;
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: var(--radius);
}

.reminder-banner[hidden] { display: none; }

.reminder-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #F57F17;
}

.reminder-btn {
  background: #F57F17;
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.reminder-btn:active { transform: scale(0.96); }

.dash-empty-hint {
  text-align: center;
  color: var(--text-tertiary);
  padding: 20px;
  font-size: 14px;
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.stat-dot.nyc { background: var(--blue-light); }
.stat-dot.away { background: var(--coral-light); }

/* === Screens === */
.screen {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* === Calendar === */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
}

.calendar-nav h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.calendar-nav button {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-400);
  padding: 4px 10px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.calendar-nav button:hover { color: var(--blue); }

.select-btn {
  font-size: 13px !important;
  padding: 6px 14px !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-full) !important;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.15s;
}

.select-btn:hover {
  border-color: var(--blue) !important;
  color: var(--blue);
}

.select-btn.active {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: var(--white);
}

.multi-select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--blue-bg);
  border-bottom: 1px solid var(--blue-light);
  font-size: 13px;
  color: var(--blue);
  font-weight: 500;
}

.multi-select-bar[hidden] { display: none; }

.day-cell.selected {
  box-shadow: inset 0 0 0 2px var(--blue);
  background: var(--blue-bg);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 0 12px;
}

.day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 8px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#calendar-days {
  display: contents;
}

.day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  position: relative;
  transition: transform 0.1s, background 0.15s;
  min-height: 44px;
  font-weight: 400;
}

.day-cell:active { transform: scale(0.92); }

.day-cell.empty { cursor: default; }
.day-cell.empty:active { transform: none; }

.day-cell.today {
  font-weight: 700;
  box-shadow: inset 0 0 0 2px #3D5A3E;
}

.day-cell.nyc {
  background: var(--blue-bg);
  color: var(--blue);
  font-weight: 600;
}

.day-cell.away {
  background: var(--coral-bg);
  color: var(--coral);
  font-weight: 600;
}

.day-cell .day-location {
  font-size: 7px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
  line-height: 1;
  margin-top: 1px;
}

.day-cell.future {
  opacity: 0.3;
}

/* FAB */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
  right: max(20px, calc(50% - 220px));
  background: #3D5A3E;
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  padding: 12px 22px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.16);
  cursor: pointer;
  z-index: 10;
  transition: transform 0.15s, box-shadow 0.15s;
}

.fab:hover { box-shadow: 0 6px 24px rgba(61,90,62,0.3); }
.fab:active { transform: scale(0.95); }

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  animation: overlayIn 0.15s ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--white);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  padding-bottom: var(--safe-bottom);
  animation: modalSlide 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 8px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close {
  background: var(--gray-100);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
}

.modal-close:hover { background: var(--gray-200); }

.modal-body {
  padding: 8px 24px 24px;
}

.location-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius);
  background: var(--white);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.15s;
}

.location-option:hover { background: var(--gray-50); border-color: var(--gray-200); }
.location-option.selected { border-color: var(--blue); background: var(--blue-bg); color: var(--blue); }

.detect-location-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border: 1.5px dashed var(--blue);
  border-radius: var(--radius);
  background: var(--blue-bg);
  color: var(--blue);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 4px;
  transition: all 0.15s;
}

.detect-location-btn:hover { background: #dce8ff; }
.detect-location-btn:active { transform: scale(0.98); }

.detect-location-btn.detecting {
  opacity: 0.6;
  cursor: wait;
}

.detect-status {
  text-align: center;
  padding: 10px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.detect-status[hidden] { display: none; }

.detect-status.success {
  background: #E8F5E9;
  color: #2E7D32;
}

.detect-status.error {
  background: var(--coral-bg);
  color: var(--coral);
}

.home-option .stat-dot { background: var(--blue); }

.location-divider {
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 14px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.modal-locations {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-new-location {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.modal-new-location input {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

.modal-new-location input:focus { border-color: var(--blue); }

.modal-edit-trip {
  margin-top: 16px;
  text-align: center;
}

.btn-secondary-small {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
}

.modal-clear {
  margin-top: 12px;
  text-align: center;
}

/* === Buttons === */
.btn-primary {
  background: #3D5A3E;
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  margin-top: 12px;
  transition: transform 0.1s, opacity 0.15s;
}

.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover { border-color: var(--gray-300); background: var(--gray-50); }
.btn-secondary:active { transform: scale(0.98); }

.btn-small {
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s;
}

.btn-small:active { transform: scale(0.96); }

.btn-text {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s;
}

.btn-text:hover { color: var(--coral); }

/* === Trip Modal === */
.form-group {
  margin-bottom: 18px;
}

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

.form-group input[type="date"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px;
  line-height: 1.2;
}

.form-group input[type="date"]:focus { border-color: var(--blue); }

/* iOS date input fix */
.form-group input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

.trip-location-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* === Reports === */
.report-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 8px;
}

.report-controls h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.report-year-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-year-select label {
  font-size: 13px;
  color: var(--text-tertiary);
}

.report-year-select select {
  padding: 6px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  background: var(--white);
}

.report-tabs {
  display: flex;
  gap: 6px;
  padding: 4px 20px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.report-tab {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: 7px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s;
  color: var(--text-secondary);
}

.report-tab:hover { border-color: var(--gray-300); }

.report-tab.active {
  background: #3D5A3E;
  color: var(--white);
  border-color: #3D5A3E;
}

.report-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.report-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
}

.report-actions .btn-secondary { flex: 1; text-align: center; }

/* Report Tables */
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.report-table th {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  color: var(--text-tertiary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.report-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--gray-100);
}

.report-table tr:last-child td { border-bottom: none; }

.report-table .location-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.report-bar-chart {
  margin-top: 20px;
}

.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
}

.bar-label {
  width: 100px;
  font-size: 13px;
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.bar-track {
  flex: 1;
  height: 28px;
  background: var(--gray-100);
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  min-width: fit-content;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-fill.nyc { background: var(--blue); }
.bar-fill.away { background: var(--coral); }

.report-empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: 48px 24px;
  font-size: 15px;
}

/* Location filter */
.location-filter {
  margin-bottom: 16px;
}

.location-filter select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  background: var(--white);
}

/* === Settings === */
#screen-settings {
  padding: 20px;
}

#screen-settings h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.settings-section {
  margin-bottom: 32px;
}

.settings-section h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.locations-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.location-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
}

.location-item span { font-size: 14px; font-weight: 500; flex: 1; }

.location-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.1);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: transform 0.15s;
}

.location-color-swatch:hover { transform: scale(1.15); }

.location-item button:last-child {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  transition: color 0.15s;
  flex-shrink: 0;
}

.location-item button:last-child:hover { color: var(--coral); }

.color-picker-popup {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 6px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  z-index: 100;
  width: 100%;
  max-width: 320px;
}

.color-picker-option {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s;
}

.color-picker-option:hover { transform: scale(1.2); }

.color-picker-option.active {
  border-color: #1F2937;
  box-shadow: 0 0 0 2px white, 0 0 0 4px #1F2937;
}

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

.add-location-row input {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.add-location-row input:focus { border-color: var(--blue); }

.data-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-toggle-label {
  font-size: 15px;
  font-weight: 500;
}

.settings-toggle-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--white);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle input:checked + .toggle-slider {
  background: #3D5A3E;
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.settings-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
}

.settings-time-row[hidden] { display: none; }

.settings-time-row label {
  font-size: 14px;
  color: var(--text-secondary);
}

.settings-time-row input[type="time"] {
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
}

.settings-note {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
}

.settings-note[hidden] { display: none; }

.settings-name-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.settings-name-row input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

.settings-name-row input:focus { border-color: var(--blue); }

.settings-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}

.settings-select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s;
}

.settings-select:focus { border-color: var(--blue); }

.threshold-info {
  font-size: 13px;
  color: var(--blue);
  margin-top: 8px;
  line-height: 1.5;
}

.threshold-info[hidden] { display: none; }

.locations-empty {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 12px 0;
  line-height: 1.5;
}

.about-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.version { font-style: italic; }

/* === Bottom Nav === */
#bottom-nav {
  display: flex;
  justify-content: space-around;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  padding: 8px 0 calc(8px + var(--safe-bottom));
  flex-shrink: 0;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 20px;
  min-width: 64px;
  transition: color 0.15s;
}

.nav-btn.active {
  color: #3D5A3E;
}

.nav-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.5;
}

/* === Print Header (hidden on screen) === */
.print-header {
  display: none;
}

/* === Print Styles === */
@media print {
  #bottom-nav, .fab, .report-actions,
  .report-tabs, .report-controls, .report-year-select,
  .multi-select-bar, .modal-overlay, .onboarding-overlay,
  #screen-dashboard, #screen-calendar, #screen-settings { display: none !important; }

  .screen { display: none !important; overflow: visible !important; padding: 0 !important; }
  #screen-reports { display: block !important; }

  .print-header {
    display: block !important;
    text-align: center;
    padding: 0 0 16px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--gray-900);
  }

  .print-header h1 { font-size: 20px; margin-bottom: 4px; }
  .print-header .print-subtitle { font-size: 13px; color: var(--text-secondary); }

  #app { max-width: none; border: none !important; }
  .report-content { padding: 0 !important; overflow: visible !important; }
  .report-table { font-size: 12px; }
  .report-table th { border-bottom: 2px solid var(--gray-900); }
  .report-table td { border-bottom: 1px solid #ddd; }

  .bar-fill, .location-dot {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .bar-fill.nyc { background: #2563EB !important; }
  .bar-fill.away { background: #EF6B4A !important; }
  .bar-track { background: #f3f4f6 !important; }

  .location-filter select {
    border: none; font-weight: 600; font-size: 14px; padding: 0;
    -webkit-appearance: none; appearance: none;
  }

  @page { margin: 0.75in; }
}

/* === Desktop === */
@media (min-width: 481px) {
  #app {
    border-left: 1px solid var(--gray-100);
    border-right: 1px solid var(--gray-100);
  }
}