/* Template example pages scoped to .template-main so shared header/footer chrome stays uniform */
:root[data-theme] .template-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 36px 24px 48px;
  box-sizing: border-box;
  font-size: 1rem;
  line-height: 1.5;
}

:root[data-theme] .template-main h1 {
  font-family: 'Spline Sans', Inter, sans-serif;
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
  line-height: 1.12;
  max-width: 22ch;
  margin: 0.35rem 0 0.85rem;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: var(--ink, #0f172a);
}

:root[data-theme] .template-main h2 {
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.25;
  text-wrap: balance;
  margin-top: 0;
  color: var(--ink, #0f172a);
}

:root[data-theme] .template-main .eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: #0284c7;
  margin: 0;
}

:root[data-theme="dark"] .template-main .eyebrow {
  color: #38bdf8;
}

:root[data-theme] .template-main .intro {
  font-size: 1.15rem;
  max-width: 60ch;
  line-height: 1.6;
  color: var(--muted, #475569);
}

:root[data-theme] .template-main section {
  background: var(--paper, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 20px;
  padding: clamp(1.25rem, 4vw, 2rem);
  margin-top: 1.5rem;
  box-shadow: 0 12px 28px -12px rgba(15, 23, 42, 0.08);
}

:root[data-theme="dark"] .template-main section {
  background: #111c2d;
  border-color: #233248;
  box-shadow: 0 18px 40px -16px rgba(2, 6, 23, 0.55);
}

:root[data-theme] .template-main label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--ink, #0f172a);
}

:root[data-theme] .template-main textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  line-height: 1.6;
  padding: 0.85rem;
  border: 1px solid var(--field-line, #cbd5e1);
  border-radius: 12px;
  resize: vertical;
  background: var(--paper, #ffffff);
  color: var(--ink, #0f172a);
}

:root[data-theme="dark"] .template-main textarea {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

:root[data-theme] .template-main button,
:root[data-theme] .template-main .cta {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #0284c7;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  background: #0284c7;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
  margin-top: 0.5rem;
}

:root[data-theme] .template-main button:hover,
:root[data-theme] .template-main .cta:hover {
  background: #0369a1;
  border-color: #0369a1;
}

:root[data-theme] .template-main .growth-row-btn,
:root[data-theme] .template-main #growthEdit,
:root[data-theme] .template-main #growthNextTurn {
  font-size: 0.9rem;
  background: var(--paper, #ffffff);
  color: var(--ink, #0f172a);
  border-color: var(--line, #cbd5e1);
  padding: 0.45rem 0.85rem;
}

:root[data-theme="dark"] .template-main .growth-row-btn,
:root[data-theme="dark"] .template-main #growthEdit,
:root[data-theme="dark"] .template-main #growthNextTurn {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

:root[data-theme] .template-main .note {
  color: var(--muted, #475569);
  font-size: 0.94rem;
}

:root[data-theme] .template-main progress {
  width: 100%;
  accent-color: #0284c7;
}

:root[data-theme] .template-main .items {
  list-style: none;
  padding: 0;
}

:root[data-theme] .template-main .items li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

:root[data-theme="dark"] .template-main .items li {
  border-bottom-color: #233248;
}

:root[data-theme] .template-main .items label {
  display: flex;
  gap: 0.6rem;
  overflow-wrap: anywhere;
  align-items: center;
  margin-bottom: 0;
}

:root[data-theme] .template-main .growth-item-main {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

:root[data-theme] .template-main .growth-item-actions,
:root[data-theme] .template-main .controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

:root[data-theme] .template-main .is-done label span {
  text-decoration: line-through;
  color: var(--muted, #64748b);
}

:root[data-theme] .template-main details {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

:root[data-theme="dark"] .template-main details {
  border-bottom-color: #233248;
}

:root[data-theme] .template-main summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink, #0f172a);
}

:root[data-theme] .template-main a:not(.cta) {
  color: #0284c7;
  font-weight: 600;
}

:root[data-theme="dark"] .template-main a:not(.cta) {
  color: #7dd3fc;
}

@media (max-width: 640px) {
  :root[data-theme] .template-main {
    padding: 24px 16px 36px;
  }
}

[hidden] {
  display: none !important;
}
