:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --ink: #142033;
  --ink-soft: #3a4763;
  --muted: #6b7790;
  --line: #d8deea;
  --brand: #1f4f8b;
  --brand-2: #2f7dd1;
  --accent: #e8862f;
  --good: #1f7a55;
  --warn: #b46200;
  --bad: #b23a3a;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 32, 51, 0.06), 0 8px 24px rgba(20, 32, 51, 0.06);
  --max: 1180px;
  --pad: clamp(16px, 3vw, 32px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--muted); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--pad);
  max-width: var(--max);
  margin: 0 auto;
}
.site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}

main { max-width: var(--max); margin: 0 auto; padding: var(--pad); }

.planner-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 28px);
  box-shadow: var(--shadow);
}
.planner-intro h1 {
  font-size: clamp(24px, 3.2vw, 34px);
  margin: 0 0 8px;
  color: var(--ink);
}
.lede { color: var(--ink-soft); max-width: 720px; margin: 0 0 16px; }
.quick-facts {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.quick-facts li {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

.planner-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: clamp(16px, 3vw, 28px);
}
@media (max-width: 900px) {
  .planner-grid { grid-template-columns: 1fr; }
}

.controls {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.control-group {
  border: none;
  margin: 0;
  padding: 0;
}
.control-group legend {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.field-label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}
.input:focus {
  outline: 2px solid var(--brand-2);
  outline-offset: 1px;
  border-color: var(--brand-2);
}
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

.seg {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
  margin-bottom: 10px;
}
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
}
.seg-btn:hover { background: var(--surface-2); }
.seg-btn.is-active {
  background: var(--brand);
  color: #fff;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.chip:hover { border-color: var(--brand-2); color: var(--brand); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { border-color: var(--brand-2); }
.btn.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.ghost { background: transparent; }
.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
  min-height: 16px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.results-header h2 {
  font-size: 20px;
  margin: 0;
}
.results-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.activity-feed {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.activity {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.activity-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.activity-body h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--ink);
}
.activity-body p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 14px;
}
.activity-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.activity-meta li { position: relative; }
.activity-meta li + li::before { content: "•"; margin-right: 12px; color: var(--line); }

.timeline-card {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-2);
}
.timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.timeline-head h3 { margin: 0; font-size: 16px; }
.timeline-sub { margin: 0; color: var(--muted); font-size: 13px; }
.timeline-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.timeline-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.t-time {
  font-size: 12px;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.t-label {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}
.timeline-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.content-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 28px);
  margin-top: 24px;
  box-shadow: var(--shadow);
}
.content-block h2 {
  font-size: clamp(20px, 2.4vw, 26px);
  margin: 0 0 12px;
}
.prose { max-width: 780px; color: var(--ink-soft); }
.prose p { margin: 0 0 12px; }

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.scenario {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-2);
}
.scenario h3 { margin: 0 0 4px; font-size: 16px; }
.scenario-meta { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.scenario p { margin: 0 0 8px; color: var(--ink-soft); font-size: 14px; }
.scenario-tip {
  font-size: 13px;
  color: var(--good);
  font-weight: 500;
}

.mistake-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.mistake-list li {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 14px;
}
.mistake-list strong { color: var(--ink); display: block; margin-bottom: 4px; }

.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.ref-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-2);
}
.ref-card h3 { margin: 0 0 6px; font-size: 15px; }
.ref-card p { margin: 0; color: var(--ink-soft); font-size: 14px; }

.site-footer {
  margin-top: 40px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: var(--pad);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr; }
}
.footer-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; max-width: 520px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: flex-start;
  justify-content: flex-end;
}
.footer-links a { font-size: 13px; color: var(--ink-soft); }
.footer-bottom {
  border-top: 1px solid var(--line);
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px var(--pad);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .controls, .actions, .timeline-foot, .site-nav { display: none; }
  .planner-shell, .content-block { box-shadow: none; border: none; padding: 0; }
  .timeline-card { border: 1px solid #999; }
}



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