  :root{--navy:#1A1F2E;--blue:#4F6BED;--amber:#F59E0B;--ink:#0f172a;--muted:#64748b;--line:#e2e8f0;--bg:#f8fafc}
  *{box-sizing:border-box;margin:0;padding:0}
  body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:var(--ink);background:#fff;line-height:1.6}
  a{color:var(--blue);text-decoration:none}
  .wrap{max-width:860px;margin:0 auto;padding:0 24px}
  header{position:sticky;top:0;background:rgba(255,255,255,.92);backdrop-filter:blur(8px);border-bottom:1px solid var(--line);z-index:10}
  .nav{display:flex;align-items:center;justify-content:space-between;height:64px}
  .brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:20px;color:var(--navy)}
  .btn{display:inline-flex;align-items:center;padding:10px 20px;border-radius:10px;font-weight:700;font-size:15px;border:0;cursor:pointer}
  .btn-primary{background:var(--amber);color:#1a1a1a}
  .btn-ghost{background:rgba(255,255,255,.1);color:#fff;border:1px solid rgba(255,255,255,.25)}
  .hero{background:linear-gradient(135deg,var(--navy),var(--blue));color:#fff;padding:56px 0 48px}
  .hero h1{font-size:clamp(26px,4vw,42px);font-weight:800;line-height:1.15}
  .hero p{margin-top:14px;font-size:clamp(15px,2vw,18px);color:#cbd5e1;max-width:600px}
  .eyebrow{color:var(--blue);font-weight:700;letter-spacing:1px;text-transform:uppercase;font-size:12px;margin-bottom:8px}
  section{padding:40px 0}
  h2{font-size:clamp(20px,3vw,28px);font-weight:800;margin-bottom:14px}
  p{color:var(--muted);line-height:1.7;margin-bottom:14px}
  p:last-child{margin-bottom:0}

  /* Generator controls */
  .panel{border:1px solid var(--line);border-radius:16px;padding:24px;background:var(--bg)}
  .field{margin-bottom:16px}
  .field label{display:block;font-weight:700;font-size:13px;color:var(--ink);margin-bottom:6px}
  .field select,.field input{width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:10px;font-size:15px;background:#fff;color:var(--ink);font-family:inherit}
  .field-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}
  @media (max-width:560px){.field-row{grid-template-columns:1fr}}
  #generate-btn{width:100%;padding:14px;font-size:16px;margin-top:4px}
  .pattern-desc{font-size:13px;color:var(--muted);margin-top:-8px;margin-bottom:16px}
  .time-note{font-size:12px;color:var(--muted);margin-top:-8px;margin-bottom:16px}

  /* Results */
  #results{margin-top:32px;display:none}
  .month-block{margin-bottom:20px;padding:16px;border:1px solid var(--line);border-radius:16px;background:#fff}
  .month-title{font-weight:800;font-size:16px;color:var(--ink);margin-bottom:10px}
  .cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
  .cal-dow{font-size:11px;font-weight:700;color:var(--muted);text-align:center;padding:4px 0;text-transform:uppercase}
  .cal-cell{aspect-ratio:1;border-radius:8px;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding:18px 3px 5px;font-size:12px;background:var(--bg);border:1px solid var(--line);color:var(--muted);overflow:hidden}
  .cal-cell.blank{background:transparent;border:none}
  .cal-cell .dnum{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-weight:800;font-size:15px;line-height:1;color:var(--ink);z-index:1}
  .cal-cell .stype{width:100%;font-size:11px;font-weight:700;line-height:1.1;margin-top:2px;text-align:center;text-transform:uppercase;letter-spacing:0;white-space:nowrap}
  .legend{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0 24px}
  .legend-item{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
  .legend-dot{width:10px;height:10px;border-radius:3px}
  .legend-symbol{font-size:16px;line-height:1}
  .vocab-note{font-size:12px;color:var(--muted);margin:0 0 18px;padding:10px 12px;background:#f8fafc;border:1px solid var(--line);border-radius:10px}
  .stype-symbol{position:absolute;top:2px;left:4px;font-size:24px;line-height:1}
  .rest-cell{background:#f8fafc !important;border-color:#cbd5e1 !important;color:#94a3b8}
  .rest-symbol{position:absolute;top:2px;left:4px;font-size:23px;line-height:1}

  /* Below ~480px, a 7-column grid inside the now-bordered month card leaves each cell too
     narrow (~40-45px) for a 23-24px icon plus a centred day-number plus a bottom text label —
     verified directly (not just estimated): rendering a real cell at 44px wide showed the icon
     sitting on top of the day number and the label clipping. Fix: shrink+reposition the icon
     into the corner and drop the redundant text label (colour + icon + the legend below still
     identify the type) rather than let three elements fight for ~44px. */
  @media (max-width:480px){
    .month-block{padding:10px}
    .stype-symbol,.rest-symbol{font-size:13px;top:1px;left:1px}
    .cal-cell .dnum{font-size:13px}
    .cal-cell .stype{display:none}
  }

  .actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px}
  .note-box{background:#eff4ff;border:1px solid #c7d6fb;border-radius:12px;padding:16px 18px;margin-top:20px;font-size:13px;color:#334155}
  .email-panel{margin-top:20px;padding:18px;border:1px solid var(--line);border-radius:12px;background:#fff}
  .email-panel h3{font-size:16px;margin-bottom:6px;color:var(--ink)}
  .email-panel p{font-size:13px;margin-bottom:12px}
  .email-row{display:flex;gap:10px;flex-wrap:wrap}
  .email-row input{flex:1 1 220px;min-width:0;padding:11px 12px;border:1px solid var(--line);border-radius:10px;font:inherit}
  .email-status{font-size:13px;margin-top:10px;color:var(--muted)}
  .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

  .print-context{display:none}
  @media print{
    @page{size:A4 portrait;margin:12mm}
    header,.hero,.actions,.no-print,footer,.panel,.faq,.cta-strip{display:none !important}
    body{background:#fff}
    #results{display:block !important}
    .print-context{display:block !important;margin-bottom:20px;padding-bottom:14px;border-bottom:2px solid #0f172a}
    .print-context h3{font-size:16px;margin-bottom:6px}
    .print-context p{font-size:12px;color:#334155;margin:0}
    .month-block{break-after:page;page-break-after:always;break-inside:avoid;page-break-inside:avoid}
    .month-block:last-child{break-after:auto;page-break-after:auto}
    /* Most browsers strip background colours when printing by default (ink-saving) — without
       this, the colour-coded calendar cells and legend dots print as plain white/bordered boxes.
       Emoji + text labels still work without it, but the colour-coding is part of the design. */
    .cal-cell,.legend-dot{-webkit-print-color-adjust:exact;print-color-adjust:exact;color-adjust:exact}
  }
