<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>{{title}}</title>
  <style>
    :root {
      color-scheme: dark;
      --color-background-primary: rgb(44 44 42);
      --color-background-secondary: rgb(36 36 34);
      --color-background-tertiary: rgb(27 27 25);
      --color-text-primary: rgb(241 239 232);
      --color-text-secondary: rgb(211 209 199);
      --color-border-primary: rgba(241, 239, 232, 0.3);
      --color-border-secondary: rgba(241, 239, 232, 0.14);
      --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;
      --border-radius-md: 8px;
      --border-radius-lg: 12px;
      --border-width-hairline: 0.5px;
      --ramp-teal-200: #5DCAA5;
      --ramp-teal-600: #0F6E56;
      --ramp-gray-50: #F1EFE8;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      background: var(--color-background-tertiary);
      color: var(--color-text-primary);
      font-family: var(--font-sans);
      font-size: 15px;
      line-height: 1.6;
      font-variant-numeric: tabular-nums;
    }
    main {
      width: min(1180px, calc(100% - 48px));
      margin: 0 auto;
      padding: 48px 0 64px;
      display: grid;
      gap: 20px;
      container-type: inline-size;
      container-name: dashboard-shell;
    }
    .card,
    .ifx-panel {
      border: var(--border-width-hairline) solid var(--color-border-primary);
      border-radius: var(--border-radius-lg);
      background: var(--color-background-primary);
      padding: 22px;
    }
    .hero {
      display: grid;
      gap: 16px;
    }
    .hero h1 {
      margin: 0;
      font-family: var(--font-serif);
      font-size: clamp(36px, 5vw, 58px);
      font-weight: 500;
      line-height: 0.96;
    }
    .hero p,
    .hero li,
    .hero span {
      margin: 0;
      color: var(--color-text-secondary);
      font-weight: 400;
    }
    .hero-metric {
      display: grid;
      gap: 8px;
      max-width: 420px;
    }
    .hero-metric span {
      font-size: 13px;
    }
    .hero-metric strong {
      font-size: clamp(40px, 8vw, 76px);
      font-weight: 500;
      line-height: 0.95;
    }
    .dashboard-grid {
      display: grid;
      grid-template-columns: minmax(0, 2fr) minmax(260px, 0.95fr);
      gap: 20px;
      align-items: start;
    }
    .main-stack,
    .side-stack,
    .bottom-stack {
      display: grid;
      gap: 20px;
    }
    .metric-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 14px;
    }
    .metric-card {
      border: var(--border-width-hairline) solid var(--color-border-secondary);
      border-radius: var(--border-radius-md);
      padding: 16px;
      display: grid;
      gap: 6px;
    }
    .metric-card strong {
      font-size: 24px;
      font-weight: 500;
      line-height: 1.05;
    }
    .metric-card span {
      font-size: 13px;
      color: var(--color-text-secondary);
    }
    .chart-card {
      display: grid;
      gap: 18px;
    }
    .chart-header h2,
    .ifx-panel h2 {
      margin: 0 0 8px;
      font-size: 20px;
      font-weight: 500;
      line-height: 1.1;
    }
    .chart-header p,
    .ifx-panel p,
    .ifx-panel li,
    .ifx-panel label,
    .ifx-panel span {
      margin: 0;
      color: var(--color-text-secondary);
      font-weight: 400;
    }
    .bar-chart,
    .bar-group {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
      gap: 12px;
      align-items: end;
      min-height: 220px;
    }
    .bar-column {
      display: grid;
      gap: 8px;
      justify-items: center;
    }
    .bar-visual {
      width: 100%;
      border-radius: 999px 999px 0 0;
      background: var(--ramp-teal-200);
      border: var(--border-width-hairline) solid var(--color-border-secondary);
      min-height: 18px;
    }
    .bar-column strong {
      font-size: 14px;
      font-weight: 500;
      line-height: 1.1;
      text-align: center;
    }
    .bar-column span {
      color: var(--color-text-secondary);
      font-size: 12px;
      text-align: center;
    }
    .point-list {
      margin: 0;
      padding-left: 20px;
      display: grid;
      gap: 10px;
    }
    .ifx-list {
      display: grid;
      gap: 12px;
      margin: 0;
      padding: 0;
      list-style: none;
    }
    .ifx-bar {
      height: 8px;
      border-radius: 999px;
      background: rgba(241, 239, 232, 0.08);
      overflow: hidden;
      margin-top: 6px;
    }
    .ifx-bar-fill {
      height: 100%;
      border-radius: 999px;
      background: var(--ramp-teal-600);
    }
    .ifx-range {
      width: 100%;
      accent-color: var(--ramp-teal-200);
    }
    .option-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .option-chip {
      border: var(--border-width-hairline) solid var(--color-border-secondary);
      border-radius: 999px;
      padding: 5px 10px;
      color: var(--color-text-secondary);
      font-size: 12px;
    }
    .footer {
      color: var(--color-text-secondary);
      font-size: 13px;
    }
    @container dashboard-shell (max-width: 900px) {
      .dashboard-grid {
        grid-template-columns: 1fr;
      }
      .card,
      .ifx-panel {
        padding: 18px;
      }
    }
  </style>
</head>
<body>
  <main>
    <section class="card hero">
      <p>{{subtitle}}</p>
      <h1>{{title}}</h1>
      <div class="hero-metric">
        <span>{{headline_label}}</span>
        <strong>{{headline_value}}</strong>
        <p>{{headline_delta}}</p>
      </div>
    </section>

    <section class="dashboard-grid">
      <div class="main-stack">
        <article class="card">
          <div class="metric-grid">
            {{#each kpi_cards}}
            <div class="metric-card">
              <span>{{label}}</span>
              <strong>{{value_display}}</strong>
              <span>{{trend}}</span>
            </div>
            {{/each}}
          </div>
        </article>

        <article class="card chart-card">
          <div class="chart-header">
            <h2>Revenue pacing</h2>
            <p>Use a compact bar series to explain the headline metric without overwhelming the reader.</p>
          </div>
          <div class="bar-chart bar-group">
            {{#each chart_bars}}
            <div class="bar-column">
              <div class="bar-visual" style="height: {{bar_height}}%;"></div>
              <strong>{{value_display}}</strong>
              <span>{{label}}</span>
            </div>
            {{/each}}
          </div>
        </article>

        <article class="card">
          <div class="chart-header">
            <h2>Best fit, input, and preview</h2>
          </div>
          <ul class="point-list">
            {{#each narrative_points}}
            <li>{{text}}</li>
            {{/each}}
          </ul>
        </article>
      </div>

      <aside class="side-stack">
        {{ inject:sidebar }}
      </aside>
    </section>

    <section class="bottom-stack">
      {{ inject:bottom }}
    </section>

    <footer class="footer">{{footer_text}}</footer>
  </main>
</body>
</html>
