@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
  --teal: #2a9b8f;
  --teal-deep: #1a6b63;
  --ink: #14201e;
  --paper: #f4f7f6;
  --card: #ffffff;
  --muted: #5a6e6a;
  --line: rgba(20, 32, 30, 0.12);
  --warn: #b45309;
  --good: #047857;
  --shadow: 0 18px 50px rgba(20, 32, 30, 0.08);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(42, 155, 143, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(26, 107, 99, 0.12), transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--teal-deep);
}

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand img {
  width: 28px;
  height: 28px;
}

.brand span b {
  color: var(--teal-deep);
}

.modes {
  display: flex;
  gap: 0.35rem;
  background: #e8efed;
  padding: 0.25rem;
  border-radius: 999px;
}

.modes a,
.modes button,
.scenario-bar button,
.nav-btn {
  font: inherit;
  border: 0;
  cursor: pointer;
}

.modes a,
.modes button {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.modes a.active,
.modes button.active {
  background: var(--ink);
  color: #fff;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
}

main {
  flex: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 1.25rem auto 2.5rem;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Deck */
.deck-shell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.slide {
  display: none;
  padding: 2.5rem 2.75rem 1.5rem;
  flex: 1;
}

.slide.active {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--teal-deep);
}

.slide h1,
.plan h1,
.plan h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.15;
}

.slide h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 18ch;
}

.slide .subtitle {
  font-size: 1.25rem;
  color: var(--muted);
  margin: 0;
}

.slide .body,
.slide .note {
  color: var(--ink);
  max-width: 62ch;
  line-height: 1.55;
}

.slide ul {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.55rem;
  max-width: 68ch;
}

.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.col-card {
  background: linear-gradient(160deg, #f7fbfa, #eef6f4);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
}

.col-card h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
}

.col-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.deck-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.4rem;
  border-top: 1px solid var(--line);
  background: #fbfcfc;
}

.progress {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-btn {
  background: var(--teal);
  color: #fff;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.chart-box {
  background: #0f1c1a;
  color: #e8f5f2;
  border-radius: 14px;
  padding: 1rem 1.1rem 0.75rem;
  min-height: 220px;
}

.chart-box h4 {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(232, 245, 242, 0.75);
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  height: 150px;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #5ed4c4, var(--teal));
  min-height: 4px;
  transition: height 0.4s ease;
}

.bar.sub {
  background: linear-gradient(180deg, #9ae6db, #3aa89c);
  opacity: 0.85;
}

.bar-label {
  font-size: 0.7rem;
  color: rgba(232, 245, 242, 0.7);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #fff;
}

.metric b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

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

/* Plan */
.plan-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
}

.toc {
  position: sticky;
  top: 4.5rem;
  align-self: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

.toc a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  padding: 0.35rem 0.2rem;
  font-size: 0.92rem;
}

.toc a:hover {
  color: var(--teal-deep);
}

.plan {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem 3rem;
}

.plan section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.plan section:last-child {
  border-bottom: 0;
}

.plan h2 {
  font-size: 1.65rem;
  margin-bottom: 0.75rem;
}

.plan p,
.plan li {
  line-height: 1.6;
  color: #243532;
}

.scenario-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
}

.scenario-bar button {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: #e8efed;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
}

.scenario-bar button.active {
  background: var(--ink);
  color: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.75rem 0 1rem;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tam-grid {
  display: grid;
  gap: 0.65rem;
}

.tam-row {
  display: grid;
  grid-template-columns: 1.4fr 100px 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fbfcfc;
}

.tam-row label {
  font-weight: 600;
  font-size: 0.92rem;
}

.tam-row input {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
}

.tam-row .src {
  font-size: 0.78rem;
  color: var(--muted);
}

.tam-row .src a.tam-source-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tam-row .src a.tam-source-link:hover {
  color: var(--ink);
}

.callout {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
}

.callout.ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

@media (max-width: 860px) {
  .plan-layout {
    grid-template-columns: 1fr;
  }
  .toc {
    position: static;
  }
  .columns,
  .metric-row {
    grid-template-columns: 1fr;
  }
  .tam-row {
    grid-template-columns: 1fr;
  }
  .slide {
    padding: 1.5rem;
  }
  .hint {
    display: none;
  }
}
