:root {
  --primary: #f59e0b;
  --primary-dark: #cc7d04;
  --bg-color: #f1f5f9;
  --card-bg: #ffffff;
  --text-color: #1e293b;
  --muted-text: #64748b;
  --accent: #1e1b4b;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --radius: 12px;
}

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

body {
  font-family: 'Manrope', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overscroll-behavior: none;
}

/* App Container */
.app-container {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--bg-color);
  box-shadow: 0 0 40px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Header */
.app-header {
  padding: 1.5rem;
  background-color: var(--card-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.brand-text h1 {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}

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

/* Screens */
.screen {
  display: none;
  padding: 1.5rem;
  animation: slideIn 0.3s ease-out;
}

.screen.active {
  display: block;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Cards */
.card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.intro-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.chip {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  padding: 0.25rem 0.625rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.muted {
  color: var(--muted-text);
  font-size: 0.875rem;
}

/* Forms */
.field-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

input {
  width: 100%;
  padding: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  background-color: #f8fafc;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #fff;
}

.hint {
  display: block;
  font-size: 0.75rem;
  color: var(--muted-text);
  margin-top: 0.25rem;
}

/* Buttons */
.primary-btn {
  width: 100%;
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

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

.primary-btn:active {
  transform: scale(0.98);
}

.secondary-btn {
  width: 100%;
  background-color: #fff;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 1rem;
}

/* Report Screen */
.report-header {
  margin-bottom: 1.5rem;
}

.back-link {
  background: none;
  border: none;
  color: var(--primary-dark);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.name-display {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
}

.main-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.num-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem 0.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.num-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.num-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted-text);
}

.num-short {
  font-size: 0.625rem;
  font-weight: 500;
  margin-top: 0.25rem;
  color: var(--accent);
}

.analysis-section {
  padding: 1.25rem;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 4px solid var(--primary);
  font-family: 'Brawler', serif;
  font-size: 0.95rem;
  color: var(--text-color);
  line-height: 1.6;
}

.analysis-section strong {
  color: var(--accent);
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 0.875rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  letter-spacing: 0.025em;
}

/* Timeline */
.timeline-stack {
  margin-top: 1rem;
  position: relative;
  padding-left: 1.5rem;
}

.timeline-stack::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.month-item {
  position: relative;
  margin-bottom: 1.25rem;
}

.month-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  z-index: 1;
}

.month-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.month-name {
  font-weight: 700;
  font-size: 0.875rem;
}

.month-tag {
  font-size: 0.625rem;
  font-weight: 700;
  background: #f1f5f9;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.month-text {
  font-size: 0.8125rem;
  color: var(--muted-text);
  line-height: 1.4;
}

/* Footer */
.report-footer {
  text-align: center;
  padding: 1rem 0 2rem;
}

.family-link {
  display: block;
  font-size: 0.875rem;
  color: var(--muted-text);
  text-decoration: none;
  font-weight: 600;
}

.family-link:hover {
  color: var(--primary);
}

/* Drawer */
.menu-trigger {
  width: 32px;
  height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-trigger span {
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  border-radius: 2px;
}

.drawer {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: #fff;
  z-index: 1001;
  transition: right 0.3s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}

.drawer.open {
  right: 0;
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-nav {
  padding: 1rem;
}

.drawer-nav a {
  display: block;
  padding: 0.75rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  border-radius: 6px;
}

.drawer-nav a:hover {
  background: #f1f5f9;
}

.drawer-info {
  padding: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted-text);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 1000;
}

.overlay.active {
  display: block;
}

/* Laptop Mode Tweaks */
@media (min-width: 768px) {
  .app-container {
    max-width: 800px;
    margin: 2rem auto;
    border-radius: 24px;
    min-height: auto;
    height: 90vh; /* Fixed height container on laptop for "App feel" */
  }
  
  .app-content {
    overflow-y: auto;
    flex-grow: 1;
  }
}
