:root {
  /* Friendly, always-light theme */
  --bg: #fffaf3; --surface: #ffffff; --text: #2b2d42; --muted: #6b6f82; --line: #f1e6d6;
  --accent: #ff6b35; --accent-ink: #fff; --accent-soft: #fff0e8; --preview: #f6efe4; --radius: 18px;
  --kids: #ff6b35; --planners: #7c5cff; --games: #12b886; --everyday: #228be6; --organize: #f59f00;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16.5px/1.65 Nunito, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3, .logo, .btn { font-family: Nunito, system-ui, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; margin: .3em 0 .2em; font-weight: 900; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; margin: 1.8em 0 .5em; font-weight: 800; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 760px; margin-top: 0; }

.site-header { background: var(--surface); border-bottom: 3px solid transparent; border-image: linear-gradient(90deg, var(--kids), var(--organize), var(--games), var(--everyday), var(--planners)) 1; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 12px; }
.logo { font-weight: 900; font-size: 1.3rem; color: var(--accent); text-decoration: none; }
.bar nav a { color: var(--text); text-decoration: none; font-size: .95rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.bar nav a:hover { background: var(--accent-soft); color: var(--accent); }
.crumbs { font-size: .85rem; color: var(--muted); margin-top: 18px; }
.crumbs a { color: var(--muted); }

/* Tool layout */
.tool { display: grid; grid-template-columns: 330px 1fr; gap: 20px; align-items: start; margin: 18px 0 8px; }
.controls { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(255, 140, 80, .08);
  padding: 16px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: .85rem; font-weight: 800; margin-bottom: 4px; color: #4a4d63; }
.field small { display: block; color: var(--muted); font-size: .76rem; margin-top: 3px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type=text], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: .92rem; padding: 7px 9px; border-radius: 8px;
  border: 2px solid var(--line); background: #fffdf9; color: var(--text); }
input[type=text]:focus, input[type=number]:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.4; }
input[type=color] { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 2px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; margin: 6px 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn { font: inherit; font-weight: 800; font-size: .95rem; padding: 11px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); flex: 1; box-shadow: 0 4px 0 #d9531f; transition: transform .1s; }
.btn.primary:hover { transform: translateY(-1px); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #d9531f; }
.hint { color: var(--muted); font-size: .82rem; min-height: 1em; margin: 10px 0 0; }
.hint.warn, .field small.warn { color: #c92a2a; font-weight: 700; }

.preview { background: var(--preview) radial-gradient(#eadfcd 1px, transparent 1.5px) 0 0 / 18px 18px; border-radius: var(--radius); padding: 28px; min-width: 0; }
.print-area { display: flex; flex-direction: column; gap: 40px; max-width: 760px; margin: 0 auto; }
.print-area.landscape { max-width: 980px; }

/* The printable sheet — always paper-white; sized in cqw so preview == print */
.sheet { background: #fff; color: #1a1a1a; width: 100%; aspect-ratio: var(--ratio, 7.7/10.2);
  box-shadow: 0 0 0 14px #fff, 0 6px 30px 14px rgba(0,0,0,.12); container-type: inline-size;
  display: flex; flex-direction: column; overflow: hidden; position: relative;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; }
.sheet .s-title { font-size: 6cqw; font-weight: 800; text-align: center; margin: 0 0 1.2cqw; line-height: 1.1; }
.sheet .s-sub { font-size: 2.4cqw; text-align: center; margin: 0 0 1.6cqw; color: #555; }
.sheet .fill { flex: 1; min-height: 0; display: flex; }
.sheet table { border-collapse: collapse; width: 100%; height: 100%; table-layout: fixed; }
.sheet th, .sheet td { border: .25cqw solid #333; }

/* Content */
.content { max-width: 800px; margin: 30px 0 50px; }
.content p, .prose p { margin: .6em 0; }
.content ol, .content ul { padding-left: 1.3em; }
details { background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 10px 0; }
details[open] { border-color: #ffd2bd; }
summary { cursor: pointer; font-weight: 600; }
.prose { max-width: 800px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 12px 0 30px; }
.card { --c: var(--accent); display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--surface);
  border: 2px solid var(--line); border-top: 6px solid var(--c); border-radius: var(--radius); color: var(--text); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.07); }
.card strong { font-size: 1.05rem; font-weight: 800; }
.card .ico { font-size: 1.7rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: color-mix(in srgb, var(--c) 14%, white); }
.card span:last-child { color: var(--muted); font-size: .88rem; line-height: 1.4; }
.cards.big .card { padding: 22px; }
.hero { padding: 40px 28px 30px; margin-top: 22px; border-radius: 28px; background: linear-gradient(135deg, #fff1e6 0%, #fff8d6 45%, #e6f7ff 100%); position: relative; overflow: hidden; }
.hero::after { content: "✏️ 🧩 ⭐ 📅 🎨"; position: absolute; right: 24px; bottom: 14px; font-size: 1.8rem; letter-spacing: 6px; opacity: .9; }
.hero h1, .hero p { max-width: 640px; }
.hero p { font-size: 1.15rem; color: var(--muted); }

.site-footer { background: #2b2d42; color: #e9e9f0; padding: 34px 0 22px; font-size: .9rem; margin-top: 20px; }
.site-footer strong { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.site-footer ul { list-style: none; padding: 0; margin: 6px 0; }
.site-footer li { margin: 3px 0; }
.site-footer a { color: #c9cbe0; }
.site-footer p { color: #b9bbd0; }
.copy { margin-top: 18px; font-size: .8rem; }

@media (max-width: 860px) {
  .tool { grid-template-columns: 1fr; }
  .controls { position: static; max-height: none; }
  .preview { padding: 16px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
}


/* Planner engine */
.plan { gap: 1.5cqw; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.plan .ph { display: flex; align-items: baseline; justify-content: space-between; gap: 2cqw; border-bottom: .5cqw solid var(--a); padding-bottom: .8cqw; flex: none; }
.plan .ph h2 { margin: 0; font-size: 4cqw; color: var(--a); font-weight: 800; line-height: 1.1; }
.plan .ph p { margin: 0; font-size: 1.7cqw; color: #444; text-align: right; }
.plan .pr { display: flex; gap: 1.5cqw; min-height: 0; }
.plan .ps { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  border: .2cqw solid #d6d6d6; border-radius: 1cqw; padding: 1cqw 1.2cqw; }
.plan .ps h3 { margin: 0 0 .5cqw; font-size: 1.55cqw; text-transform: uppercase; letter-spacing: .12cqw; color: var(--a); flex: none; }
.plan .ln { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.plan .ln i { flex: 1; border-bottom: .15cqw solid #cfcfcf; font-style: normal; font-size: 1.45cqw; display: flex;
  align-items: flex-end; gap: .8cqw; padding-bottom: .25cqw; min-height: 0; overflow: hidden; white-space: nowrap; }
.plan .ck i b { width: 1.5cqw; height: 1.5cqw; border: .2cqw solid #888; border-radius: .3cqw; flex: none; }
.plan .kv i b { font-weight: 700; }
.plan .bx { flex: 1; }
.plan .bx.dots { background-image: radial-gradient(#bbb .16cqw, transparent .2cqw); background-size: 2.4cqw 2.4cqw; }
.plan .tb { flex: 1; min-height: 0; }
.plan th { background: var(--a); color: #fff; font-size: 1.3cqw; padding: .45cqw .6cqw; border: .15cqw solid var(--a); height: 1px; text-align: left; white-space: nowrap; overflow: hidden; }
.plan td { border: .12cqw solid #ccc; font-size: 1.35cqw; padding: 0 .6cqw; overflow: hidden; white-space: nowrap; height: 2.3cqw; }
.plan tbody tr:nth-child(even) td { background: #f8f8f8; }
.plan tfoot td { font-weight: 700; border-top: .3cqw solid #888; height: 1px; padding: .5cqw .6cqw; }
.print-area.landscape .plan .ln i, .print-area.landscape .plan td { font-size: 1.15cqw; }
.print-area.landscape .plan td { height: 1.8cqw; }
.print-area.landscape .plan .ps h3 { font-size: 1.25cqw; }
.print-area.landscape .plan th { font-size: 1.05cqw; }


/* Tracing worksheets */
.trace { font-family: Andika, "Trebuchet MS", sans-serif; }
.trace .t-name { font-size: 2.2cqw; display: flex; gap: 1.5cqw; flex: none; }
.trace .t-name span { flex: 1; border-bottom: .2cqw solid #333; }
.trace .t-name span.d { flex: .45; }
.trace .t-title { text-align: center; font-size: 4.4cqw; margin: 1.2cqw 0 .8cqw; color: var(--a); line-height: 1.15; flex: none; }
.trace .t-title small { display: block; font-size: 2cqw; color: #666; font-weight: 600; }
.trace .t-rows { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: space-between; gap: .25cqw; }
.trace svg.tr { width: 100%; height: auto; display: block; }

/* Categories + feedback */
.cat-sec h2 a { color: var(--text); text-decoration: none; }
.cat-sec h2 a:hover { color: var(--accent); }
.cat-desc { color: var(--muted); margin: -.3em 0 0; }
.feedback { background: linear-gradient(135deg, #fff4ec, #fffbe6); border: 2px dashed #ffc9ad; border-radius: 24px; padding: 24px; margin: 10px 0 40px; max-width: 800px; }
.feedback h2 { margin-top: 0; }
.feedback textarea, .feedback input { width: 100%; font: inherit; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--text); }
.fb-row { display: flex; gap: 10px; margin-top: 10px; }
.fb-row input { flex: 1; }
.fb-row .btn { flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.bar nav { display: flex; gap: 2px; overflow-x: auto; }
.bar nav a { margin-left: 14px; white-space: nowrap; }
@media (max-width: 600px) { .fb-row { flex-direction: column; } .bar nav a { margin-left: 10px; font-size: .88rem; } .logo { font-size: 1rem; } }

@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
  .no-print, .site-header, .site-footer, .adsbygoogle, .google-auto-placed, ins { display: none !important; }
  main.wrap { max-width: none; padding: 0; margin: 0; }
  .tool { display: block; margin: 0; }
  .preview { background: none; padding: 0; border-radius: 0; }
  .print-area, .print-area.landscape { display: block; max-width: none; margin: 0; }
  .sheet { width: var(--pw); height: var(--ph); aspect-ratio: auto; box-shadow: none; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
}

/* Category colors + SEO helper blocks */
.cat-kids { --c: var(--kids); } .cat-planners { --c: var(--planners); } .cat-games { --c: var(--games); }
.cat-everyday { --c: var(--everyday); } .cat-organize { --c: var(--organize); }
.cat-sec h2 a { display: inline-flex; align-items: center; gap: 8px; }
.cat-sec h2 { border-left: 6px solid var(--c, var(--accent)); padding-left: 12px; }
.answer { background: var(--accent-soft); border-left: 5px solid var(--accent); border-radius: 0 14px 14px 0; padding: 14px 18px; margin: 0 0 10px; }
.answer p { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; padding: 0; list-style: none; }
.tags li { background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: .85rem; color: #555; }

/* Word picker (tracing tool) */
.wp { margin-top: 8px; background: #fff8f1; border: 2px dashed #ffd8c2; border-radius: 14px; padding: 10px; }
.wp-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: .8rem; }
.wp-bar b { flex: 1; color: #8a5a3c; }
.wp-btn { font: inherit; font-size: .78rem; font-weight: 800; border: 2px solid #ffd2bd; background: #fff; color: var(--accent); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.wp-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.wp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wp-chip { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; font: inherit; background: #fff;
  border: 2px solid var(--line); border-radius: 12px; padding: 4px 9px; cursor: pointer; transition: transform .1s, border-color .1s; }
.wp-chip span { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.wp-chip small { font-size: .68rem; color: var(--muted); }
.wp-chip:hover { border-color: var(--accent); transform: translateY(-1px); }

/* Range slider with live value */
.rng { display: flex; align-items: center; gap: 8px; height: 38px; }
.rng input[type=range] { flex: 1; accent-color: var(--accent); min-width: 0; }
.rng output { font-weight: 800; font-size: .85rem; min-width: 3ch; text-align: right; color: var(--accent); }
