/* ==========================================================================
   First 30 Days — Page-scoped, responsive & overflow-safe styles
   ========================================================================== */

/* -----------------------
   Tokens & Theming (scoped)
   ----------------------- */
   .f30 {
    /* Colors */
    --f30-bg: transparent;
    --f30-surface: #ffffff;
    --f30-surface-2: #f9fafb;             /* soft gray */
    --f30-border: #e5e7eb;
    --f30-muted: #6b7280;
    --f30-text: #0f172a;
    --f30-chip: #f3f4f6;
    --f30-accent: #2563eb;                 /* primary */
    --f30-accent-2: #22c55e;               /* secondary accent for future */
  
    /* Layout */
    --f30-radius-sm: 10px;
    --f30-radius: 14px;
    --f30-radius-lg: 18px;
    --f30-shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --f30-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
    --f30-ring: 0 0 0 3px rgba(37, 99, 235, .25);
  
    /* Typography */
    --f30-h1: clamp(1.85rem, 1.2rem + 2.6vw, 2.7rem);
    --f30-h2: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
    --f30-h3: clamp(1.05rem, .95rem + .7vw, 1.25rem);
    --f30-lead: clamp(1rem, .95rem + .45vw, 1.125rem);
  
    /* Spacing */
    --f30-gap: clamp(.6rem, .9vw, 1rem);
    --f30-pad: clamp(.85rem, .6rem + 1vw, 1.25rem);
    --f30-pad-lg: clamp(1rem, .8rem + 1.5vw, 1.75rem);
  
    /* Section bands */
    --f30-section-bg: var(--f30-surface-2);
  }
  
  /* Dark mode */
  :root[data-theme="dark"] .f30,
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .f30 {
      --f30-surface: #0f141b;
      --f30-surface-2: #0b1016;
      --f30-border: #1f2a37;
      --f30-muted: #9aa7b5;
      --f30-text: #e5e7eb;
      --f30-chip: #14202d;
      --f30-shadow-sm: 0 1px 3px rgba(0,0,0,.28);
      --f30-shadow: 0 2px 8px rgba(0,0,0,.35);
      --f30-ring: 0 0 0 3px rgba(59,130,246,.35);
      --f30-section-bg: #0d1219;
    }
  }
  
  /* -----------------------
     Container hygiene + paddings (used for band alignment)
     ----------------------- */
  .f30.container {
    /* expose inline padding so bands can align with container edges */
    --f30-pad-inline: max(16px, env(safe-area-inset-left));
    --f30-pad-inline-end: max(16px, env(safe-area-inset-right));
  
    max-width: min(1100px, 92vw);
    margin-inline: auto;
    margin-top: clamp(1rem, 1vw + .5rem, 2rem);
    padding-inline-start: var(--f30-pad-inline);
    padding-inline-end: var(--f30-pad-inline-end);
    color: var(--f30-text);
  }
  
  .f30 * { box-sizing: border-box; }
  .f30 img, .f30 video, .f30 svg { max-width: 100%; height: auto; display: block; }
  .f30 :where(p, li, .lead, .micro-note) { overflow-wrap: anywhere; }
  
  /* consistent, visible keyboard focus */
  .f30 :where(a, button, input, select, textarea, summary, .vlaunch-link):focus-visible {
    outline: none; box-shadow: var(--f30-ring); border-radius: 10px;
  }
  
  /* -----------------------
     Cards & small helpers
     ----------------------- */
  .f30 .card {
    border: 1px solid var(--f30-border);
    border-radius: var(--f30-radius);
    background: var(--f30-surface);
    padding: var(--f30-pad);
    box-shadow: var(--f30-shadow-sm);
    overflow: hidden;                 /* zero spill */
  }
  .f30 .micro-note { font-size: .92rem; color: var(--f30-muted); }
  .f30 .kicker { color: var(--f30-accent); font-weight: 600; letter-spacing: .01em; }
  
  /* -----------------------
     HERO
     ----------------------- */
  .f30-hero .f30-hero__wrap {
    display: grid;
    grid-template-columns: 1.3fr .9fr;
    gap: var(--f30-gap);
    align-items: start;
  }
  .f30-hero h1 { margin: .1rem 0 .35rem; font-size: var(--f30-h1); line-height: 1.15; }
  .f30-hero .lead { font-size: var(--f30-lead); color: var(--f30-muted); }
  .f30-actions { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: .85rem; }
  .f30 .btn { min-width: 0; }
  .f30 .btn > i { margin-right: .35rem; }
  
  /* Progress card */
  .f30-progress {
    border: 1px solid var(--f30-border);
    border-radius: var(--f30-radius);
    background: var(--f30-surface-2);
    padding: var(--f30-pad);
  }
  .f30-progress h3 { margin: 0 0 .5rem; font-size: 1rem; }
  .f30-bar {
    width: 100%; height: .75rem;
    background: var(--f30-chip);
    border-radius: 999px; overflow: hidden; position: relative;
  }
  .f30-bar__fill {
    display: block; height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--f30-accent), #4f46e5);
    transition: width .25s ease;
  }
  @media (prefers-reduced-motion: reduce) { .f30-bar__fill { transition: none; } }
  .f30-progress__meta { margin-top: .4rem; font-size: .95rem; }
  
  /* -----------------------
     SECTION HEADS
     ----------------------- */
  .f30 :where(.section__head) { margin-top: clamp(1.2rem, .8rem + 1vw, 1.75rem); }
  .f30 :where(.section__title) { font-size: var(--f30-h2); margin: 0 0 .25rem; }
  .f30 :where(.section__sub) { margin: 0; color: var(--f30-muted); }
  
  /* -----------------------
     QUICK TOOLS
     ----------------------- */
  .f30 .grid.two,
  .f30 .grid.three { gap: var(--f30-gap); }
  
  .f30-calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: .6rem;
  }
  .f30-calc-grid label {
    display: flex; flex-direction: column; gap: .35rem; min-width: 0;
  }
  .f30-calc-grid input[type="number"] {
    padding: .68rem .78rem;
    border: 1px solid var(--f30-border);
    border-radius: var(--f30-radius-sm);
    background: var(--f30-surface);
    color: var(--f30-text);
    min-width: 0;
  }
  .f30-calc-grid input[type="number"]:focus-visible { box-shadow: var(--f30-ring); outline: none; }
  
  /* Output boxes */
  .f30-calc-out {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .6rem;
    margin-top: .65rem;
  }
  .f30-calc-out div {
    display: flex; justify-content: space-between; align-items: center;
    border: 1px solid var(--f30-border); border-radius: var(--f30-radius-sm);
    padding: .68rem .78rem; background: var(--f30-surface);
  }
  
  /* Range input (cadence) */
  .f30 input[type="range"] { width: 100%; -webkit-appearance: none; background: transparent; }
  .f30 input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: var(--f30-chip); }
  .f30 input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px; margin-top: -5px;
    background: var(--f30-accent); border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15);
  }
  .f30 input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: var(--f30-chip); }
  .f30 input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; background: var(--f30-accent); border: 2px solid #fff; border-radius: 50%; }
  .f30-cadence { border: 1px dashed var(--f30-border); border-radius: var(--f30-radius-sm); padding: .8rem; margin-top: .6rem; }
  
  .f30-inline-links { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .55rem; }
  .vlaunch-link {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .42rem .65rem;
    border: 1px solid var(--f30-border); border-radius: 999px;
    background: var(--f30-surface);
    min-width: 0; max-width: 100%;
  }
  .vlaunch-link span { min-width: 0; }
  .vlaunch-link:hover { border-color: color-mix(in oklab, var(--f30-border) 60%, var(--f30-accent)); }
  
  /* -----------------------
     WEEK-BY-WEEK (with aligned gray band)
     ----------------------- */
  
  /* Create a subtle gray band that aligns perfectly with the container’s inner edges */
  .f30-weeks { position: relative; z-index: 0; }
  .f30-weeks::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: -0.5rem;                       /* slight bleed for comfort */
    bottom: -0.5rem;
    /* pull the background out to align with the container paddings */
    left: calc(-1 * var(--f30-pad-inline));
    right: calc(-1 * var(--f30-pad-inline-end));
    background: var(--f30-section-bg);
    border: 1px solid var(--f30-border);
    border-radius: var(--f30-radius-lg);
  }
  
  /* Controls */
  .f30-controls { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
  
  /* Individual steps (cards) */
  .f30-step {
    border: 1px solid var(--f30-border);
    border-radius: var(--f30-radius);
    margin: .85rem 0;
    background: var(--f30-surface);
    box-shadow: var(--f30-shadow-sm);
    overflow: clip;                      /* prevent inner overflow on mobile */
  }
  
  /* Summary row */
  .f30-step summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "num meta pill";
    gap: .85rem;
    align-items: center;
    list-style: none;
    padding: .95rem var(--f30-pad);
    cursor: pointer;
    min-height: 3.25rem;
  }
  .f30-step summary::-webkit-details-marker { display: none; }
  .f30-step[open] { box-shadow: var(--f30-shadow); }
  
  /* Subtle chevron indicator */
  .f30-step summary::after {
    content: "";
    width: 10px; height: 10px; margin-left: .35rem;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(-45deg); opacity: .55;
  }
  .f30-step[open] summary::after { transform: rotate(45deg); opacity: .8; }
  
  .f30-step__num {
    grid-area: num;
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.15rem; height: 2.15rem; border-radius: 999px;
  }
  .f30-step .meta { grid-area: meta; min-width: 0; }
  .f30-step .meta h3 { margin: 0; font-size: var(--f30-h3); }
  .f30-step .meta p { margin: .12rem 0 0; color: var(--f30-muted); }
  .f30-step .pill {
    grid-area: pill; padding: .3rem .65rem; border-radius: 999px;
    border: 1px solid var(--f30-border);
    background: var(--f30-chip); font-size: .85rem; white-space: nowrap;
  }
  
  /* Content area */
  .f30-step__content { padding: .35rem var(--f30-pad) var(--f30-pad); }
  @keyframes f30FadeSlide { from { opacity: 0; translate: 0 -2px; } to { opacity: 1; translate: 0 0; } }
  .f30-step[open] .f30-step__content { animation: f30FadeSlide .18s ease; }
  @media (prefers-reduced-motion: reduce) { .f30-step[open] .f30-step__content { animation: none; } }
  
  /* Task list — bigger touch target + space between toggle and text */
  .f30-tasks {
    list-style: none; padding: 0; margin: .3rem 0 .85rem;
    display: grid; gap: .35rem;
  }
  .f30-tasks label {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .7rem;                          /* more space between box & text */
    align-items: start;
    padding: .48rem .55rem;
    border-radius: 10px;
  }
  .f30-tasks label:hover { background: color-mix(in oklab, var(--f30-chip) 85%, transparent); }
  .f30-tasks input[type="checkbox"] {
    /* slightly larger, consistent box while keeping native semantics */
    inline-size: 1.15rem; block-size: 1.15rem;
    accent-color: var(--f30-accent);
    margin-top: .15rem;
    flex: 0 0 auto;
  }
  .f30-tasks input[type="checkbox"]:focus-visible { box-shadow: var(--f30-ring); border-radius: 4px; }
  .f30-tasks input[type="checkbox"]:checked ~ span {
    color: var(--f30-muted); text-decoration: line-through;
  }
  
  /* Links row under tasks */
  .f30-links { display: flex; flex-wrap: wrap; gap: .55rem; }
  
  /* -----------------------
     TRIAGE
     ----------------------- */
  .f30-triage .grid.three {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--f30-gap);
  }
  .f30-triage .card h3 { margin: 0; }
  .f30-triage .card ul { margin: .25rem 0 0; padding-left: 1.1rem; }
  .f30-triage .card li { margin: .2rem 0; }
  
  /* -----------------------
     CTA
     ----------------------- */
  .f30-cta__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--f30-gap);
    margin-top: 1rem;
  }
  .f30-cta__card {
    border: 1px solid var(--f30-border);
    border-radius: var(--f30-radius);
    background: var(--f30-surface);
    padding: var(--f30-pad);
    display: flex; flex-direction: column; gap: .48rem;
    transition: transform .12s ease, box-shadow .12s ease;
  }
  @media (hover: hover) {
    .f30-cta__card:hover { transform: translateY(-2px); box-shadow: var(--f30-shadow); }
  }
  .f30-cta__card i { opacity: .9; }
  
  /* -----------------------
     Generic grids
     ----------------------- */
  .f30 .grid.two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
  .f30 .grid.three {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  /* -----------------------
     Footer contact width alignment (optional polish)
     ----------------------- */
  .footer-contact-bar .container,
  .footer-contact-inner.container {
    max-width: min(1100px, 92vw);
  }
  
  /* -----------------------
     Small-screen refinements
     ----------------------- */
  @media (max-width: 1000px) {
    .f30-hero .f30-hero__wrap { grid-template-columns: 1fr; }
  }
  
  @media (max-width: 640px) {
    /* Stack summary pieces cleanly */
    .f30-step summary {
      grid-template-columns: 1fr auto;
      grid-template-areas:
        "meta pill"
        "num pill";
      row-gap: .42rem;
      align-items: center;
    }
    .f30-step__num { justify-self: start; }
  }
  
  @media (max-width: 480px) {
    .f30-actions { gap: .42rem; }
    .vlaunch-link { padding: .38rem .58rem; }
  }
  
  /* -----------------------
     Print
     ----------------------- */
  @media print {
    .nav, .footer-contact-bar, .footer, .f30-actions, .f30-controls, .f30-cta, .theme-toggle { display: none !important; }
    .f30-step { break-inside: avoid; box-shadow: none !important; border-color: #bbb; margin: .5rem 0; }
    details.f30-step[open] > summary { border-bottom: 1px solid #bbb; }
  }
  
  /* -----------------------
     Overflow & long content guards
     ----------------------- */
  .f30 a { word-break: break-word; }
  .f30 .f30-hero__wrap,
  .f30 .f30-tools,
  .f30 .f30-weeks,
  .f30 .f30-triage,
  .f30 .f30-cta { min-width: 0; }
  
  /* -----------------------
     Nice-to-haves (progress chip)
     ----------------------- */
  .f30 .pill[data-pill^="w"] { background: var(--f30-chip); }
  .f30 .pill[data-complete="true"] {
    background: color-mix(in oklab, var(--f30-accent) 100%, var(--f30-chip));
    border-color: color-mix(in oklab, var(--f30-accent) 100%, var(--f30-border));
  }
  
  /* Inputs inherit font color/size consistently */
  .f30 input, .f30 button, .f30 select, .f30 textarea { font: inherit; color: inherit; }
  
  /* --- Week label polish & alignment ------------------------------------- */
/* Make "Week N" a readable, autosizing chip instead of a fixed circle */
.f30-step__num {
  /* override earlier fixed size */
  width: auto;
  height: auto;
  padding: .28rem .62rem;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;

  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .02em;
  /* align digits for 9 vs 10, etc. */
  font-variant-numeric: tabular-nums;

  /* subtle, theme-aware styling */
  border: 1px solid color-mix(in oklab, var(--f30-accent) 55%, var(--f30-border));
  background: color-mix(in oklab, var(--f30-accent) 10%, var(--f30-surface));
  color: color-mix(in oklab, var(--f30-accent) 85%, var(--f30-text));
}

/* Slightly punchier when the section is open */
.f30-step[open] .f30-step__num {
  border-color: color-mix(in oklab, var(--f30-accent) 70%, var(--f30-border));
  background: color-mix(in oklab, var(--f30-accent) 16%, var(--f30-surface));
  color: color-mix(in oklab, var(--f30-accent) 92%, var(--f30-text));
}

/* Let column 1 size to the chip neatly (prevents awkward wrapping/offsets) */
.f30-step summary {
  grid-template-columns: max-content 1fr auto;
  align-items: center;
}

/* Tiny nudge so the chevron never crowds the pill on the right */
.f30-step summary::after { margin-left: .15rem; }
