:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --primary: #0f2942;
  --primary-hover: #1a3b5c;
  --accent: #0d9488;
  --accent-soft: #ccfbf1;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: #0f766e;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--surface-muted);
}

.hidden {
  display: none !important;
}

/* Hero */
.hero {
  background: linear-gradient(180deg, #0f2942 0%, #153859 100%);
  color: #fff;
  padding: 48px 0 56px;
}

.hero-badge {
  display: inline-block;
  background: rgba(20, 184, 166, 0.18);
  color: #5eead4;
  border: 1px solid rgba(94, 234, 212, 0.3);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3.5vw, 2.45rem);
  line-height: 1.2;
}

.hero p {
  margin: 0 0 24px;
  max-width: 680px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-actions .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.hero-actions .btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Sections */
.section {
  padding: 40px 0;
}

.section-title {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.section-subtitle {
  margin: 0 0 24px;
  color: var(--text-muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.phase-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.phase-accum {
  background: var(--accent-soft);
  color: #115e59;
}

.phase-decum {
  background: #e0f2fe;
  color: #075985;
}

/* Planner Layout */
.planner-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 920px) {
  .planner-layout {
    grid-template-columns: 1fr;
  }
}

.form-group-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.form-group-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.field label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.field input,
.field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.92rem;
  background: #fff;
  color: var(--text);
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(13, 148, 136, 0.25);
  border-color: var(--accent);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* Results */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

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

.stat-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.chart-wrap {
  margin-bottom: 20px;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
}

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tab-group {
  display: inline-flex;
  background: var(--surface-muted);
  padding: 3px;
  border-radius: 8px;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.tab-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow);
}

.table-scroll {
  overflow-x: auto;
  max-height: 440px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: right;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 600;
  z-index: 1;
}

.notice {
  background: var(--warn-soft);
  border: 1px solid #fde68a;
  color: #78350f;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.86rem;
  margin-top: 16px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--text-muted);
  font-size: 0.86rem;
}
