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

:root {
  --primary: #F8BBD0;
  --primary-light: #F48FB1;
  --primary-dark: #EC407A;
  --accent: #880E4F;
  --accent-light: #FCE4EC;
  --surface: #FFFFFF;
  --surface-alt: #F4F5FB;
  --bg: #ECEEF8;
  --bg-dark: #1A1B3A;
  --text: #1E2043;
  --text-secondary: #6B6E94;
  --text-muted: #9B9EC0;
  --border: #DDDFF0;
  --border-light: #ECEEF8;
  --success: #34C77B;
  --warning: #F59E0B;
  --danger: #EF4444;
  --seeing-1: #EF4444;
  --seeing-2: #F59E0B;
  --seeing-3: #3B82F6;
  --seeing-4: #34C77B;
  --seeing-5: #8B5CF6;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 3px rgba(30, 32, 67, 0.06);
  --shadow-md: 0 4px 12px rgba(30, 32, 67, 0.08);
  --shadow-lg: 0 8px 30px rgba(30, 32, 67, 0.12);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== APP SHELL ===== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #252866 100%);
  padding: 1.25rem 1.5rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-icon {
  font-size: 1.5rem;
  color: var(--accent);
  animation: twinkle 3s ease-in-out infinite;
}

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

.app-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: #FFFFFF;
  letter-spacing: 0.01em;
}

.add-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: var(--bg-dark);
  border: none;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.add-btn:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232, 168, 56, 0.3);
}

.add-btn span {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ===== TAB NAV ===== */
.tab-nav {
  display: flex;
  gap: 0.25rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.tab-btn.active {
  color: #FFFFFF;
  border-bottom-color: var(--accent);
}

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

/* ===== MAIN ===== */
.app-main {
  flex: 1;
  padding: 1.25rem 1.5rem 2rem;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  position: relative;
  margin-bottom: 1.25rem;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.search-input {
  width: 100%;
  padding: 0.7rem 2.5rem 0.7rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 76, 202, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}

/* ===== TIMELINE ===== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.timeline-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.timeline-date {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-left: 0.25rem;
}

.date-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.date-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.timeline-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border-light);
  margin-left: 3px;
}

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

.observation-card {
  display: flex;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: fadeInUp 0.4s ease both;
}

.observation-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.card-body {
  flex: 1;
  min-width: 0;
}

.card-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.card-type {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.card-location {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.card-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.seeing-badge, .transparency-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-weight: 500;
}

.seeing-badge {
  background: rgba(59, 76, 202, 0.08);
  color: var(--primary);
}

.transparency-badge {
  background: rgba(139, 92, 246, 0.08);
  color: var(--seeing-5);
}

.card-notes {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 0.15rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto;
}

/* ===== LOADING SKELETON ===== */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 27, 58, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

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

.modal-content {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

/* ===== FORM ===== */
.observation-form {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 76, 202, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

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

/* ===== TYPE CHIPS ===== */
.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.type-chip {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.type-chip:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.type-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== RANGE ===== */
.range-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.range-group input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  height: 6px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.range-value {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.85rem;
}

/* ===== FORM ACTIONS ===== */
.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

.btn-primary {
  padding: 0.6rem 1.25rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  padding: 0.6rem 1.25rem;
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* ===== DETAIL VIEW ===== */
.detail-view {
  animation: fadeInUp 0.3s ease;
}

.detail-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.back-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
  cursor: pointer;
  padding: 0.3rem 0;
}

.back-btn:hover {
  color: var(--primary-dark);
}

.detail-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.action-btn {
  padding: 0.4rem 0.7rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  border-color: var(--primary-light);
}

.edit-action:hover {
  color: var(--primary);
}

.delete-action:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.delete-confirm {
  color: var(--danger);
  border-color: var(--danger);
}

.confirm-delete {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-hero {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #252866 100%);
  padding: 1.5rem 1.25rem;
  color: white;
}

.detail-type-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  background: rgba(232, 168, 56, 0.2);
  color: var(--accent-light);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.detail-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.detail-date {
  font-size: 0.85rem;
  opacity: 0.8;
}

.detail-time-badge {
  padding: 0.15rem 0.55rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  font-size: 0.78rem;
}

.detail-section {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-light);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.detail-location {
  font-size: 0.95rem;
  color: var(--text);
}

.conditions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.condition-bar-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.condition-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.condition-bar-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.condition-bar-value {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.condition-bar-track {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 3px;
  overflow: hidden;
}

.condition-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.info-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.detail-notes {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.65;
  white-space: pre-wrap;
}

/* ===== STATS ===== */
.stats-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  animation: fadeInUp 0.4s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

.stat-number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.2rem;
}

.stats-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  animation: fadeInUp 0.4s ease both;
}

.stats-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.85rem;
}

/* ===== BAR CHART ===== */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: fadeInUp 0.35s ease both;
}

.bar-label {
  width: 100px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: right;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 20px;
  background: var(--surface-alt);
  border-radius: 10px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 10px;
  min-width: 20px;
  transition: width 0.6s ease;
}

.bar-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  min-width: 24px;
}

/* ===== MONTH CHART ===== */
.month-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 140px;
  padding-top: 0.5rem;
}

.month-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  height: 100%;
  animation: fadeInUp 0.4s ease both;
}

.month-bar-wrapper {
  flex: 1;
  width: 100%;
  max-width: 40px;
  display: flex;
  align-items: flex-end;
}

.month-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-light) 100%);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.6s ease;
}

.month-bar-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
}

.month-bar-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== LOCATION LIST ===== */
.location-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.location-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-light);
  animation: fadeInUp 0.35s ease both;
}

.location-item:last-child {
  border-bottom: none;
}

.location-name {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
}

.location-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .app-header {
    padding: 1rem 1rem 0;
  }

  .app-main {
    padding: 1rem;
  }

  .app-header h1 {
    font-size: 1.15rem;
  }

  .add-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }

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

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

  .detail-title {
    font-size: 1.3rem;
  }

  .detail-info-grid {
    grid-template-columns: 1fr;
  }

  .bar-label {
    width: 70px;
    font-size: 0.75rem;
  }

  .modal-content {
    max-height: 95vh;
  }
}

@media (min-width: 641px) {
  .modal-overlay {
    align-items: center;
  }

  .modal-content {
    border-radius: var(--radius);
    max-height: 85vh;
  }
}

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to your Stargazer Journal! This is your personal timeline of celestial observations.", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Tap 'Log Observation' to record what you see in the night sky — stars, planets, constellations, meteor showers, and more.", "view": "user", "highlight_selector": ".add-btn", "wait_for": "tap_to_continue"},
  {"step": 3, "narration": "Fill in the details: the object you observed, type, location, seeing and transparency conditions, equipment used, and your notes.", "view": "user", "highlight_selector": ".observation-form", "wait_for": "tap_to_continue"},
  {"step": 4, "narration": "Your observations appear in a timeline grouped by date. Tap any card to see full details, edit, or delete.", "view": "user", "highlight_selector": ".timeline", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "Use the search bar to quickly find observations by object name, location, or notes.", "view": "user", "highlight_selector": ".search-bar", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Switch to the Stats tab to see your observation totals, object type breakdown, activity over time, and favorite locations.", "view": "user", "highlight_selector": ".tab-nav", "wait_for": "tap_to_continue"}
]
-->

.auth-shell {
  min-height: 100vh;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  max-width: 480px;
  width: 100%;
  padding: 2rem;
  border-radius: 16px;
  background: rgba(10, 14, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.auth-card h2 {
  margin: 0 0 0.75rem;
}

.auth-card p {
  margin: 0 0 1.5rem;
  opacity: 0.85;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.user-greeting {
  font-size: 0.95rem;
  opacity: 0.9;
}

.logout-btn {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.location-capture-fields { display: flex; flex-direction: column; gap: 0.75rem; }
.location-capture-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.location-coordinates { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.location-btn { padding: 0.5rem 0.85rem; border-radius: 0.5rem; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.08); color: inherit; cursor: pointer; }
.location-btn:disabled { opacity: 0.6; cursor: wait; }
.field-error { margin: 0; color: #ff9b9b; font-size: 0.9rem; }
@media (max-width: 640px) { .location-coordinates { grid-template-columns: 1fr; } }

.observation-location-map,
.observation-log-item-map {
  width: 100%;
}

.google-map-canvas {
  width: 100%;
  height: 320px;
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
}

.google-map-canvas-sm {
  height: 180px;
}

.map-placeholder {
  width: 100%;
  min-height: 220px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.35);
  text-align: center;
  padding: 1rem;
}

.map-placeholder-sm {
  min-height: 180px;
}

.map-placeholder-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.observation-location-section {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.observation-coordinates-text {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.map-popup {
  max-width: 240px;
}

.map-popup strong {
  display: block;
  margin-bottom: 0.25rem;
}

.map-popup p {
  margin: 0;
  font-size: 0.9rem;
}

.image-upload-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }
.visually-hidden-input { display: none; }
.image-preview-grid, .observation-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.image-preview-thumb, .observation-image-thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 0.5rem; border: 1px solid rgba(255,255,255,0.12); }
.observation-images-section { margin-top: 1rem; }
.observation-image-full-wrap { margin-top: 0.75rem; }
.observation-image-full { width: 100%; max-height: 480px; object-fit: contain; border-radius: 0.75rem; border: 1px solid rgba(255,255,255,0.12); background: rgba(0,0,0,0.2); }
.form-error { color: #ff8a8a; margin-top: 0.5rem; }

.tonight-objects-card, .ai-observation-assist {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

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

.tonight-objects-list {
  display: grid;
  gap: 10px;
}

.tonight-object-item {
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.tonight-object-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.tonight-object-type {
  font-size: 0.85rem;
  opacity: 0.8;
}

.tonight-object-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
  opacity: 0.85;
}

.field-label {
  display: block;
  margin: 12px 0;
}

.ai-textarea {
  width: 100%;
  min-height: 92px;
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  resize: vertical;
}

.ai-analyze-btn, .refresh-btn {
  border-radius: 999px;
  padding: 10px 14px;
}

.ai-result {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.ai-object-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.tonight-objects-status, .tonight-objects-empty {
  opacity: 0.85;
  margin-top: 8px;
}

.detail-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.share-btn, .copy-share-btn { border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.08); color: inherit; }
.share-btn:hover, .copy-share-btn:hover { background: rgba(255,255,255,0.14); }
.shared-observation-panel { margin-top: 1rem; }
.shared-loading, .shared-missing { padding: 1rem; text-align: center; opacity: 0.8; }
.share-copy-fallback { position: absolute; left: -9999px; top: -9999px; }

.stats-chart-canvas { width: 100%; height: 220px; display: block; margin-bottom: 0.85rem; }
