/* KOSPI Market Recession Analysis - Styles */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: #1a1a1a; background: #fff; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1200px; margin: 0 auto; padding: 1rem 1.5rem; }
.site-header { background: linear-gradient(135deg, #1e40af, #3b82f6); color: white; padding: 1.5rem 0; }
.site-header h1 { margin: 0.25rem 0 0.25rem; font-size: 1.75rem; }
.site-header .tagline { margin: 0 0 1rem; font-size: 1rem; opacity: 0.9; }
.site-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.site-nav a { color: white; font-weight: 500; }
.site-nav a:hover { opacity: 0.8; }
.hero-section { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.input-card, .results-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.input-form { display: flex; flex-direction: column; gap: 1rem; }
.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.input-group label { font-weight: 600; font-size: 0.9rem; }
.input-group input { padding: 0.75rem; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 1rem; }
.input-group input:focus { outline: 2px solid #3b82f6; border-color: #3b82f6; }
.input-hint { font-size: 0.8rem; color: #64748b; }
.preset-buttons { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.preset-btn { background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; border-radius: 6px; padding: 0.5rem 1rem; cursor: pointer; font-size: 0.85rem; }
.preset-btn:hover { background: #7dd3fc; }
.calculate-btn { background: #2563eb; color: white; border: none; border-radius: 6px; padding: 0.875rem; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.calculate-btn:hover { background: #1d4ed8; }
.risk-score { text-align: center; margin-bottom: 1.5rem; }
.score-value { font-size: 3rem; font-weight: 700; color: #2563eb; }
.score-label { font-size: 0.9rem; color: #64748b; margin-top: 0.25rem; }
.comparison-chart { margin: 1.5rem 0; }
.bar-group { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.bar-label { font-size: 0.85rem; color: #475569; }
.bar-value { background: linear-gradient(90deg, #3b82f6, #60a5fa); height: 24px; border-radius: 4px; display: flex; align-items: center; justify-content: flex-end; padding-right: 0.5rem; }
.bar-value span { color: white; font-weight: 600; font-size: 0.8rem; }
.bar-group.current .bar-value { background: linear-gradient(90deg, #dc2626, #ef4444); }
.sector-breakdown .sectors { display: flex; flex-direction: column; gap: 0.75rem; }
.sector-item { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #e2e8f0; }
.action-buttons { display: flex; gap: 0.75rem; margin-top: 1rem; }
.action-btn { flex: 1; background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; border-radius: 6px; padding: 0.75rem; cursor: pointer; font-size: 0.9rem; }
.action-btn:hover { background: #e2e8f0; }
timeline-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 1rem; }
timeline-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1.25rem; }
timeline-card h3 { margin-top: 0; color: #1e40af; font-size: 1.1rem; }
timeline-card p { margin: 0.5rem 0; font-size: 0.9rem; }
h2 { font-size: 1.5rem; margin: 1.5rem 0 1rem; color: #1a1a1a; }
h3 { font-size: 1.25rem; margin: 1rem 0 0.75rem; }
.usage-notes { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 1.25rem; margin: 2rem 0; }
usage-notes p { font-size: 0.95rem; }
.site-footer { background: #1e293b; color: #cbd5e1; padding: 1.5rem 0; margin-top: 2.5rem; }
.site-footer a { color: #60a5fa; }
.ad-section { text-align: center; padding: 1.5rem 0; background: #f8fafc; }
.ad-section .ad-label { font-size: 0.85rem; color: #64748b; }
@media (max-width: 768px) { 
  .hero-section { grid-template-columns: 1fr; 
  }
  .site-nav { gap: 1rem; font-size: 0.9rem; }
  .input-card, .results-card { padding: 1rem; }
  .timeline-cards { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { 
  .container { padding: 0.75rem 1rem; 
  }
  .site-header h1 { font-size: 1.5rem; }
  .score-value { font-size: 2.5rem; }
}


/* 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;
}
