:root {
  --bg-dark: #0d0b1a;
  --bg-card: #16122b;
  --bg-surface: #1e1838;
  --bg-input: #251f45;
  --accent: #f5c542;
  --accent-dim: #c9a030;
  --accent-glow: rgba(245, 197, 66, 0.15);
  --text-primary: #f0ecf8;
  --text-secondary: #b8b0cc;
  --text-muted: #7a7099;
  --border: #2e2650;
  --success: #4caf7d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { color: var(--accent-dim); text-decoration: underline; }

img, svg { max-width: 100%; height: auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 11, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  flex-shrink: 0;
}
.logo:hover, .logo:focus { text-decoration: none; color: var(--accent); }
.logo-icon { flex-shrink: 0; }

.site-nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover, .site-nav a:focus {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  gap: 4px;
  flex-direction: column;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
}

/* Hero */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
}

.hero-stats div {
  display: flex;
  flex-direction: column;
}

.hero-stats strong {
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 700;
}

.hero-stats span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* App Shell */
.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
  align-items: start;
}

.panel-controls, .panel-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.panel-controls h2, .panel-preview h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

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

input, select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.add-row {
  display: flex;
  gap: 0.5rem;
}

.add-row input, .add-row select {
  flex: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--accent);
  color: var(--bg-dark);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn:hover, .btn:focus {
  background: var(--accent-dim);
  transform: translateY(-1px);
}

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

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-print {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-print:hover, .btn-print:focus {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* Preset bar */
.preset-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
}

.preset-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Preview panel */
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.preview-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.schedule-output {
  min-height: 200px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  text-align: center;
  gap: 0.75rem;
}

.empty-state p { font-size: 0.95rem; }

/* Schedule list */
.schedule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.schedule-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.schedule-item:hover { border-color: var(--accent-dim); }

.schedule-time {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
  white-space: nowrap;
  min-width: 55px;
}

.schedule-details h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.schedule-details p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.schedule-crowd {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-weight: 600;
  margin-top: 0.25rem;
}

.crowd-low { background: rgba(76, 175, 125, 0.15); color: var(--success); }
.crowd-med { background: rgba(245, 197, 66, 0.15); color: var(--accent); }
.crowd-high { background: rgba(239, 83, 80, 0.15); color: #ef5350; }

.schedule-drag {
  cursor: grab;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 0.25rem;
  user-select: none;
}

.schedule-drag:active { cursor: grabbing; }

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

.schedule-remove:hover, .schedule-remove:focus { color: #ef5350; }

.schedule-walk {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.25rem 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.schedule-walk::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 2px;
  background: var(--text-muted);
  opacity: 0.4;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Section styling */
.section-header {
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
}

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Tips */
.tips-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 0;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  padding: 0 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.tip-card:hover { border-color: var(--accent-dim); }

.tip-icon {
  margin-bottom: 0.75rem;
}

.tip-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.tip-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Example itineraries */
.example-itineraries {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 0;
}

.itinerary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  padding: 0 1.5rem;
}

.itinerary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.itinerary-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

.itinerary-card ol {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.itinerary-card li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.itinerary-card li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.itinerary-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* FAQ */
.faq-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-q::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
}

.faq-q[aria-expanded="true"]::after { content: '−'; }

.faq-a {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.faq-a.open {
  padding: 0 1.25rem 1rem;
  max-height: 200px;
}

/* How it works */
.how-it-works {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-dark);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.step h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.step p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.assumptions-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.assumptions-box h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.assumptions-box ul {
  padding-left: 1.25rem;
}

.assumptions-box li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 2rem 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}

.footer-nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-nav a:hover, .footer-nav a:focus { color: var(--accent); }

.footer-note {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Print styles */
@media print {
  .site-header, .panel-controls, .preview-actions, .preset-bar, .tips-section, .example-itineraries, .faq-section, .how-it-works, .site-footer, .nav-toggle, .schedule-drag, .schedule-remove, .toast, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .app-shell { display: block; padding: 0; }
  .panel-preview { border: none; padding: 0; }
  .schedule-item { border: 1px solid #ccc; break-inside: avoid; }
  .schedule-time { color: #333; }
  .preview-header { display: block; }
  .preview-header h2 { font-size: 1.4rem; margin-bottom: 1rem; }
}

/* Responsive */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; }
}

@media (max-width: 640px) {
  .header-inner { padding: 0.6rem 1rem; }
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: 0.75rem;
  }
  .nav-toggle { display: flex; margin-left: auto; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero-stats { flex-direction: column; gap: 0.75rem; }
  .control-grid { grid-template-columns: 1fr; }
  .preview-header { flex-direction: column; align-items: flex-start; }
  .itinerary-cards { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
  .footer-nav { margin-left: 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .add-row { flex-direction: column; }
  .schedule-item { grid-template-columns: 1fr; gap: 0.4rem; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
