/* ============================================================
   Teacher Toolkit — "classroom" theme
   Warm paper background, forest-green primary, chalk-yellow accent.
   (Deliberately distinct from the gold ai-prompt-maker theme and
   the navy/teal ardu-builder theme.)
   ============================================================ */

:root {
  --tt-green:       #2f6d5e;
  --tt-green-dark:  #245448;
  --tt-green-soft:  #e3efeb;
  --tt-yellow:      #f6c445;
  --tt-paper:       #faf7f0;
  --tt-ink:         #23312d;
  --tt-muted:       #6b7a75;
  --tt-line:        #e4ded2;
  --tt-card:        #ffffff;
  --tt-danger:      #c0392b;
  --tt-radius:      14px;
  --tt-shadow:      0 4px 18px rgba(35, 49, 45, 0.08);
}

* { box-sizing: border-box; }

body {
  background: var(--tt-paper);
  color: var(--tt-ink);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > .tool-wrap, body > .page-wrap { flex: 1; }

h1, h2, h3, h4 { font-weight: 800; color: var(--tt-ink); }
a { color: var(--tt-green); }

/* ── Buttons ─────────────────────────────────────────────── */
.tt-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--tt-green);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
  font-size: 0.95rem;
  line-height: 1.3;
}
.tt-btn:hover { transform: translateY(-1px); box-shadow: var(--tt-shadow); }
.tt-btn-solid { background: var(--tt-green); color: #fff !important; }
.tt-btn-solid:hover { background: var(--tt-green-dark); color: #fff; }
.tt-btn-outline { background: transparent; color: var(--tt-green); }
.tt-btn-outline:hover { background: var(--tt-green-soft); color: var(--tt-green-dark); }
.tt-btn-lg { padding: 14px 30px; font-size: 1.1rem; }
.tt-btn:disabled { opacity: .6; cursor: wait; transform: none; }

/* ── Navbar ──────────────────────────────────────────────── */
.tt-nav {
  background: var(--tt-card);
  border-bottom: 3px solid var(--tt-green);
  position: sticky; top: 0; z-index: 50;
}
.tt-nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.tt-brand {
  font-size: 1.35rem; font-weight: 800; text-decoration: none; color: var(--tt-ink);
}
.tt-brand span { color: var(--tt-green); }
.tt-nav-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-left: auto; }
.tt-nav-links > a:not(.tt-btn) {
  text-decoration: none; color: var(--tt-ink); font-weight: 600; font-size: .95rem;
}
.tt-nav-links > a:not(.tt-btn):hover { color: var(--tt-green); }
.tt-nav-user { color: var(--tt-muted); font-weight: 600; font-size: .9rem; }

.tt-pro-badge {
  background: var(--tt-yellow); color: #5c4708;
  font-size: .78rem; font-weight: 800;
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}

/* ── Hero ────────────────────────────────────────────────── */
.tt-hero {
  background:
    radial-gradient(1000px 400px at 80% -50%, var(--tt-green-soft), transparent),
    var(--tt-paper);
  padding: 84px 24px 64px;
  text-align: center;
}
.tt-hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.12; }
.tt-hero h1 span {
  color: var(--tt-green);
  background: linear-gradient(transparent 62%, var(--tt-yellow) 62%, var(--tt-yellow) 92%, transparent 92%);
}
.tt-hero-sub {
  max-width: 640px; margin: 18px auto 26px; color: var(--tt-muted); font-size: 1.15rem;
}
.tt-hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.tt-hero-note { margin-top: 16px; color: var(--tt-muted); font-size: .9rem; }

/* ── Sections / cards ────────────────────────────────────── */
.tt-section { max-width: 1180px; margin: 0 auto; padding: 56px 24px; }
.tt-section-alt { max-width: none; background: var(--tt-green-soft); }
.tt-section-alt > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.tt-section-title { text-align: center; margin-bottom: 34px; font-size: 1.9rem; }

.tt-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px;
}
.tt-card {
  background: var(--tt-card); border: 1px solid var(--tt-line);
  border-radius: var(--tt-radius); padding: 26px 22px;
  box-shadow: var(--tt-shadow); text-decoration: none; color: var(--tt-ink);
  transition: transform .12s ease, box-shadow .15s ease;
}
.tt-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(35,49,45,.13); }
.tt-card-icon { font-size: 2.2rem; margin-bottom: 10px; }
.tt-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.tt-card p { color: var(--tt-muted); font-size: .93rem; margin-bottom: 10px; }
.tt-card-link { font-weight: 700; text-decoration: none; }
.tt-card-action { display: block; }
.tt-card-action:hover h3 { color: var(--tt-green); }

.tt-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; padding: 12px 24px; }
.tt-step { text-align: center; }
.tt-step span {
  display: inline-flex; width: 46px; height: 46px; border-radius: 50%;
  background: var(--tt-green); color: #fff; font-weight: 800; font-size: 1.25rem;
  align-items: center; justify-content: center; margin-bottom: 12px;
}
.tt-step p { color: var(--tt-muted); font-size: .93rem; }

/* ── Pricing tiers ───────────────────────────────────────── */
.tt-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; max-width: 760px; margin: 0 auto; }
.tt-tier {
  background: var(--tt-card); border: 1px solid var(--tt-line);
  border-radius: var(--tt-radius); padding: 30px 26px; box-shadow: var(--tt-shadow);
  position: relative;
}
.tt-tier-pro { border: 2px solid var(--tt-yellow); }
.tt-tier-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--tt-yellow); color: #5c4708; font-weight: 800; font-size: .8rem;
  padding: 4px 14px; border-radius: 20px;
}
.tt-tier-price { font-size: 2rem; font-weight: 800; color: var(--tt-green); margin: 8px 0 14px; }
.tt-tier-price small { font-size: .95rem; color: var(--tt-muted); font-weight: 600; }
.tt-tier ul { list-style: none; padding: 0; margin: 0 0 20px; }
.tt-tier li { padding: 5px 0; color: var(--tt-ink); font-size: .95rem; }

/* ── Footer ──────────────────────────────────────────────── */
.tt-footer { background: var(--tt-ink); color: #cfd8d4; margin-top: auto; }
.tt-footer-inner {
  max-width: 1180px; margin: 0 auto; padding: 26px 24px;
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: space-between;
}
.tt-footer a { color: var(--tt-yellow); text-decoration: none; margin-right: 14px; }
.tt-footer-copy { color: #8fa39c; font-size: .85rem; }

/* ── Login pages (standalone header, centered card) ─────── */
body.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(800px 400px at 15% -10%, var(--tt-green-soft), transparent),
    var(--tt-paper);
}
.login-wrapper { width: 100%; display: flex; justify-content: center; padding: 30px 16px; }
.login-card {
  background: var(--tt-card); border: 1px solid var(--tt-line);
  border-radius: var(--tt-radius); box-shadow: var(--tt-shadow);
  width: 100%; max-width: 440px; padding: 36px 34px;
}
.login-header { text-align: center; margin-bottom: 22px; }
.brand-link { font-size: 1.3rem; font-weight: 800; color: var(--tt-ink); text-decoration: none; }
.brand-link span { color: var(--tt-green); }
.login-header h1 { font-size: 1.35rem; margin-top: 14px; }
.login-sub { color: var(--tt-muted); font-size: .92rem; }
.login-form { margin-top: 6px; }
.form-group-fancy { margin-bottom: 14px; }
.form-group-fancy label { font-weight: 700; font-size: .88rem; margin-bottom: 5px; display: block; }
.form-group-fancy label small { color: var(--tt-muted); font-weight: 500; }
.login-back { text-align: center; margin-top: 16px; font-size: .92rem; }

.form-control, .form-select { border-color: var(--tt-line); }
.form-control:focus, .form-select:focus {
  border-color: var(--tt-green); box-shadow: 0 0 0 .2rem rgba(47, 109, 94, .15);
}

/* ── Page wrapper (dashboard / library / admin) ──────────── */
.page-wrap { max-width: 1180px; margin: 0 auto; padding: 36px 24px; width: 100%; }
.page-title { font-size: 1.7rem; }
.page-sub { color: var(--tt-muted); }
.dash-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.dash-plan { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dash-recent { margin-top: 42px; }
.dash-recent-head { display: flex; justify-content: space-between; align-items: baseline; }
.dash-empty { color: var(--tt-muted); background: var(--tt-card); border: 1px dashed var(--tt-line); padding: 22px; border-radius: var(--tt-radius); }

.quota-chip {
  background: var(--tt-green-soft); color: var(--tt-green-dark);
  font-weight: 700; font-size: .82rem; padding: 5px 12px; border-radius: 20px;
  display: inline-block; white-space: nowrap;
}
.quota-chip.quota-low { background: #fdeaea; color: var(--tt-danger); }

/* ── Library list ────────────────────────────────────────── */
.lib-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.lib-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--tt-card); border: 1px solid var(--tt-line);
  padding: 12px 16px; border-radius: 10px; text-decoration: none; color: var(--tt-ink);
}
a.lib-item:hover { border-color: var(--tt-green); }
.lib-icon { font-size: 1.3rem; }
.lib-title { font-weight: 700; flex: 1; text-decoration: none; color: var(--tt-ink); }
a.lib-title:hover { color: var(--tt-green); }
.lib-kind { color: var(--tt-muted); font-size: .85rem; }
.lib-date { color: var(--tt-muted); font-size: .85rem; white-space: nowrap; }
.lib-del { background: none; border: none; cursor: pointer; font-size: 1.05rem; opacity: .55; }
.lib-del:hover { opacity: 1; }

/* ── Tool pages (form left, result right) ────────────────── */
.tool-wrap {
  display: grid; grid-template-columns: 360px 1fr; gap: 26px;
  max-width: 1380px; margin: 0 auto; padding: 30px 24px; width: 100%;
  align-items: start;
}
@media (max-width: 900px) { .tool-wrap { grid-template-columns: 1fr; } }

.tool-form-panel {
  background: var(--tt-card); border: 1px solid var(--tt-line);
  border-radius: var(--tt-radius); box-shadow: var(--tt-shadow);
  padding: 24px 22px; position: sticky; top: 84px;
}
@media (max-width: 900px) { .tool-form-panel { position: static; } }
.tool-head h1 { font-size: 1.35rem; }
.tool-tagline { color: var(--tt-muted); font-size: .9rem; }
.tool-fields { margin-top: 14px; }
.tool-checks { margin: 6px 0; }

.tool-result-panel {
  background: var(--tt-card); border: 1px solid var(--tt-line);
  border-radius: var(--tt-radius); box-shadow: var(--tt-shadow);
  padding: 28px 32px; min-height: 480px;
}
.result-actions {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  border-bottom: 2px dashed var(--tt-line); padding-bottom: 16px; margin-bottom: 22px;
}
.key-toggle { font-weight: 600; font-size: .9rem; margin-right: auto; }
.key-toggle input { margin-right: 6px; }
.result-empty { text-align: center; color: var(--tt-muted); padding: 90px 20px; }
.result-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.has-result .result-empty { display: none; }

/* ── Generated document styles (screen + print) ──────────── */
#print-area { font-family: Georgia, 'Times New Roman', serif; color: #111; }
.doc-head { margin-bottom: 20px; }
.doc-nameline {
  display: flex; justify-content: space-between; gap: 20px;
  font-size: .95rem; margin-bottom: 16px; color: #333;
}
.doc-title { font-size: 1.5rem; text-align: center; margin: 0 0 6px; font-family: inherit; }
.doc-instructions { text-align: center; font-style: italic; color: #444; margin: 0 0 8px; }

.ws-section { margin: 22px 0; }
.ws-heading {
  font-size: 1.05rem; font-family: inherit;
  border-bottom: 2px solid #111; padding-bottom: 4px; margin-bottom: 12px;
}
.ws-items li { margin-bottom: 14px; line-height: 1.7; }
.tf-opts { font-weight: 700; white-space: nowrap; margin-left: 10px; }
.answer-lines div {
  border-bottom: 1px solid #999; height: 26px; margin-top: 6px;
}
.match-table { width: 100%; border-collapse: collapse; }
.match-table td { padding: 7px 10px; vertical-align: top; width: 50%; }
.match-blank { font-weight: 700; }

.quiz-list > li { margin-bottom: 20px; }
.quiz-qtext { font-weight: 600; margin-bottom: 6px; }
.quiz-opts { padding-left: 10px; }
.quiz-opt { padding: 3px 0; }

.answer-key { border-top: 3px double #111; margin-top: 34px; padding-top: 18px; }
.answer-key h2 { font-size: 1.2rem; font-family: inherit; }
.key-list li, .key-grid div { margin-bottom: 6px; font-size: .95rem; }
.key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 18px; }

/* Flashcards */
.fc-table { width: 100%; border-collapse: collapse; }
.fc-row td {
  width: 50%; border: 2px dashed #888; padding: 26px 18px;
  text-align: center; vertical-align: middle; height: 110px;
}
.fc-front { font-weight: 800; font-size: 1.15rem; }
.fc-back { font-size: 1rem; border-left-style: dotted !important; }

/* Word search */
.wsg-wrap { display: flex; justify-content: center; margin: 14px 0; }
.wsg { border-collapse: collapse; }
.wsg td {
  width: 30px; height: 30px; text-align: center; vertical-align: middle;
  border: 1px solid #bbb; font-weight: 700; font-size: 1rem;
  font-family: 'Courier New', monospace;
}
.wsg-hit { background: #ffe9a8; outline: 2px solid #d99f00; }
.wsg-words h2 { font-size: 1.05rem; font-family: inherit; border-bottom: 2px solid #111; padding-bottom: 4px; }
.wsg-wordlist { columns: 3; font-size: 1rem; }
@media (max-width: 700px) { .wsg-wordlist { columns: 2; } }
.wsg-wordlist li { margin-bottom: 5px; }
.clue-len { color: #666; font-size: .85rem; }
.wsg-failed { color: var(--tt-danger); font-size: .88rem; }

/* ── Nav Tools dropdown ──────────────────────────────────── */
.tt-dd { position: relative; }
.tt-dd-toggle { font-weight: 600; font-size: .95rem; color: var(--tt-ink); cursor: pointer; }
.tt-dd:hover .tt-dd-toggle { color: var(--tt-green); }
.tt-dd-menu {
  display: none; position: absolute; top: 100%; left: -10px; z-index: 200;
  background: var(--tt-card); border: 1px solid var(--tt-line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(35,49,45,.18); padding: 8px;
  min-width: 680px;
  grid-template-columns: 1fr 1fr 1fr;
}
.tt-dd:hover .tt-dd-menu { display: grid; }
.tt-dd-menu a {
  display: block; padding: 7px 12px; border-radius: 8px;
  text-decoration: none; color: var(--tt-ink); font-weight: 600; font-size: .88rem;
  white-space: nowrap;
}
.tt-dd-menu a:hover { background: var(--tt-green-soft); color: var(--tt-green-dark); }
.tt-dd-menu a small { color: var(--tt-muted); font-weight: 700; font-size: .7rem; text-transform: uppercase; }
@media (max-width: 700px) { .tt-dd-menu { min-width: 260px; grid-template-columns: 1fr; } }

.tt-cards-compact .tt-card { padding: 18px 16px; }
.tt-cards-compact .tt-card-icon { font-size: 1.7rem; margin-bottom: 6px; }
.tt-cards-compact h3 { font-size: 1.02rem; }
.tt-cards-compact p { font-size: .85rem; margin-bottom: 4px; }
.tt-free-tag {
  background: var(--tt-green-soft); color: var(--tt-green-dark);
  font-size: .65rem; font-weight: 800; padding: 2px 7px; border-radius: 10px;
  vertical-align: middle; text-transform: uppercase;
}
.dash-group-title { font-size: 1.15rem; margin: 26px 0 12px; }
.dash-group-title small { color: var(--tt-muted); font-weight: 500; font-size: .82rem; }
.quota-chip.quota-free { background: #e6f4e6; color: #2e6b2e; }

/* ── Lesson plan ─────────────────────────────────────────── */
.lp-meta { text-align: center; color: #444; display: flex; gap: 22px; justify-content: center; }
.lp-block { margin: 18px 0; }
.lp-block h2 { font-size: 1.05rem; font-family: inherit; border-bottom: 2px solid #111; padding-bottom: 4px; margin-bottom: 10px; }
.lp-block ul { margin: 0; padding-left: 22px; }
.lp-block li { margin-bottom: 5px; }
.lp-materials { columns: 2; }
.lp-table { width: 100%; border-collapse: collapse; }
.lp-table td { border: 1px solid #999; padding: 8px 12px; vertical-align: top; }
.lp-min { width: 70px; font-weight: 700; white-space: nowrap; text-align: center; }

/* ── Report comments ─────────────────────────────────────── */
.rc-comment {
  border: 1px solid #bbb; border-radius: 8px; padding: 14px 18px; margin-bottom: 16px;
  page-break-inside: avoid;
}
.rc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rc-num { font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; color: #555; }
.rc-copy {
  background: var(--tt-green-soft); border: 1px solid var(--tt-green); color: var(--tt-green-dark);
  border-radius: 8px; padding: 3px 12px; font-weight: 700; font-size: .82rem; cursor: pointer;
  font-family: 'Segoe UI', sans-serif;
}
.rc-copy:hover { background: var(--tt-green); color: #fff; }
.rc-comment p { margin: 0; line-height: 1.75; }

/* ── Cloze ───────────────────────────────────────────────── */
.cloze-bank {
  border: 2px solid #111; border-radius: 8px; padding: 10px 16px; margin-bottom: 18px;
  line-height: 2; text-align: center;
}
.cloze-text p { line-height: 2.2; font-size: 1.05rem; }
.cloze-blank { font-weight: 700; white-space: nowrap; }
.cloze-blank sub { font-size: .72rem; }

/* ── Comprehension ───────────────────────────────────────── */
.comp-passage {
  border: 1px solid #999; border-radius: 8px; padding: 16px 20px; margin-bottom: 20px;
  line-height: 1.9;
}

/* ── Exit tickets ────────────────────────────────────────── */
.ticket-grid { display: grid; grid-template-columns: 1fr 1fr; }
.ticket {
  border: 2px dashed #888; padding: 14px 16px; min-height: 220px;
  page-break-inside: avoid; display: flex; flex-direction: column;
}
.ticket-top { display: flex; justify-content: space-between; font-size: .8rem; color: #555; margin-bottom: 8px; gap: 8px; }
.ticket-title { font-weight: 700; }
.ticket-prompt { font-weight: 600; margin-bottom: 8px; }
.ticket .answer-lines { margin-top: auto; }

/* ── Crossword ───────────────────────────────────────────── */
.cwg { border-collapse: collapse; }
.cwg td { width: 32px; height: 32px; padding: 0; position: relative; vertical-align: middle; text-align: center; }
.cw-cell { border: 1.5px solid #111; background: #fff; }
.cw-void { border: none; background: transparent; }
.cw-num { position: absolute; top: 1px; left: 2px; font-size: .55rem; font-weight: 700; line-height: 1; }
.cw-letter { font-weight: 700; font-family: 'Courier New', monospace; font-size: 1rem; }
.cw-clue-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; margin-top: 14px; }
@media (max-width: 700px) { .cw-clue-cols { grid-template-columns: 1fr; } }
.cw-clues h2 { font-size: 1.02rem; font-family: inherit; border-bottom: 2px solid #111; padding-bottom: 4px; }
.cw-cluelist li { margin-bottom: 6px; }

/* ── Bingo ───────────────────────────────────────────────── */
.bingo-card { margin: 0 auto 26px; max-width: 560px; page-break-inside: avoid; }
.bingo-head {
  text-align: center; font-weight: 800; font-size: 1.15rem; margin-bottom: 8px;
}
.bingo-cardno { font-weight: 600; font-size: .85rem; color: #555; margin-left: 10px; }
.bingo-table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.bingo-table td {
  border: 2px solid #111; text-align: center; vertical-align: middle;
  height: 78px; padding: 4px; font-weight: 600; font-size: .95rem; word-wrap: break-word;
}
.bingo-free { background: #eee; font-weight: 800; letter-spacing: 1px; }
.bingo-calls li { margin-bottom: 4px; }

/* ── Word scramble ───────────────────────────────────────── */
.scr-list li { margin-bottom: 16px; }
.scr-letters { font-family: 'Courier New', monospace; font-weight: 800; font-size: 1.15rem; letter-spacing: 2px; }
.scr-hint { color: #555; font-style: italic; }
.scr-answer { border-bottom: 1px solid #999; height: 24px; max-width: 320px; margin-top: 6px; }

/* ── Math drills ─────────────────────────────────────────── */
.md-list { columns: 3; column-gap: 40px; padding-left: 26px; }
@media (max-width: 700px) { .md-list { columns: 2; } }
.md-list li { margin-bottom: 18px; font-size: 1.1rem; break-inside: avoid; }
.md-blank { display: inline-block; border-bottom: 1.5px solid #333; min-width: 60px; height: 1.1em; vertical-align: bottom; }
.md-key li { margin-bottom: 8px; }

/* ── Certificates ────────────────────────────────────────── */
.cert {
  width: 100%; max-width: 940px; margin: 0 auto 30px; aspect-ratio: 297/210;
  display: flex; align-items: stretch; page-break-inside: avoid;
  padding: 18px; background: #fff;
}
.cert-inner {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px 40px; gap: 10px;
  position: relative; /* anchors the .cert-corner ornaments */
}
/* Style preview strip (certificate form) — tiles reuse the .cert-<style>
   border/background rules with a thin border override */
.cert-style-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.cert-tile {
  border-width: 3px !important;      /* thin version of each style's border */
  border-radius: 6px;
  padding: 8px 4px 6px;
  text-align: center; cursor: pointer; user-select: none;
  transition: transform .08s ease, box-shadow .12s ease;
  background-clip: padding-box;
}
.cert-tile:hover { transform: translateY(-2px); box-shadow: var(--tt-shadow); }
.cert-tile.sel { outline: 3px solid var(--tt-green); outline-offset: 2px; }
.cert-tile-emblem { display: block; font-size: 1.3rem; line-height: 1.2; }
.cert-tile small { font-weight: 700; font-size: .68rem; color: var(--tt-ink); }

.cert-emblem { font-size: 2.6rem; line-height: 1; }
.cert-corner { position: absolute; font-size: 1.7rem; line-height: 1; }
.c-tl { top: 10px; left: 14px; }
.c-tr { top: 10px; right: 14px; }
.c-bl { bottom: 10px; left: 14px; }
.c-br { bottom: 10px; right: 14px; }

/* 🎓 Classic Green — formal double frame */
.cert-classic { border: 10px double #2f6d5e; }
.cert-classic .cert-title { color: #2f6d5e; }

/* 🏆 Gold Award — double frame + inner hairline + flourish corners */
.cert-gold { border: 10px double #b8860b; background: #fffdf4; }
.cert-gold .cert-inner { border: 1px solid #d4af37; margin: 8px; }
.cert-gold .cert-title { color: #b8860b; }
.cert-gold .cert-corner::before { content: '✦'; color: #b8860b; }

/* 🎖 Royal Blue — bold frame with inner rule */
.cert-royal { border: 12px solid #1e3a6e; background: #f7faff; }
.cert-royal .cert-inner { border: 2px solid #1e3a6e; margin: 10px; }
.cert-royal .cert-title { color: #1e3a6e; }
.cert-royal .cert-corner::before { content: '❖'; color: #1e3a6e; }

/* ✒ Elegant Black — minimal, thin double rule, serif italics */
.cert-elegant { border: 4px double #222; }
.cert-elegant .cert-inner { border: 1px solid #aaa; margin: 10px; }
.cert-elegant .cert-title { color: #222; letter-spacing: 2px; }
.cert-elegant .cert-awarded { font-family: Georgia, serif; }
.cert-elegant .cert-name { font-style: italic; }

/* 🎉 Fun Confetti — playful dashed pink with balloons */
.cert-fun { border: 10px dashed #e26aa5; background: #fffafc; }
.cert-fun .cert-title { color: #e26aa5; }
.cert-fun .c-tl::before, .cert-fun .c-br::before { content: '🎈'; }
.cert-fun .c-tr::before, .cert-fun .c-bl::before { content: '🎊'; }

/* ⭐ Superstar — purple with star corners */
.cert-stars { border: 10px solid #6b4fa0; background: #faf7ff; }
.cert-stars .cert-title { color: #6b4fa0; }
.cert-stars .cert-corner::before { content: '⭐'; }

/* 🌿 Nature — leafy green */
.cert-nature { border: 10px solid #4c8c4a; background: #f7fbf5; }
.cert-nature .cert-title { color: #2e6b2e; }
.cert-nature .c-tl::before, .cert-nature .c-br::before { content: '🌿'; }
.cert-nature .c-tr::before, .cert-nature .c-bl::before { content: '🍃'; }

/* 🏅 Sports Medal — bold red ridge */
.cert-medal { border: 10px ridge #b22222; background: #fff8f6; }
.cert-medal .cert-title { color: #b22222; }
.cert-medal .cert-corner::before { content: '🏅'; }

/* 🌈 Rainbow — gradient frame */
.cert-rainbow {
  border: 12px solid transparent;
  border-image: linear-gradient(45deg, #e74c3c, #f39c12, #f1c40f, #2ecc71, #3498db, #9b59b6) 1;
  background: #fffdfa;
}
.cert-rainbow .cert-title {
  background: linear-gradient(90deg, #e74c3c, #f39c12, #2ecc71, #3498db, #9b59b6);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #9b59b6;
}
.cert-rainbow .c-tl::before, .cert-rainbow .c-br::before { content: '🌈'; }
.cert-rainbow .c-tr::before, .cert-rainbow .c-bl::before { content: '☀️'; }
.cert-school { font-size: 1rem; letter-spacing: 3px; text-transform: uppercase; color: #666; }
.cert-title { font-size: 2.4rem; font-weight: 800; font-family: Georgia, serif; }
.cert-awarded { font-style: italic; color: #555; }
.cert-name {
  font-size: 2rem; font-weight: 700; font-family: Georgia, serif;
  border-bottom: 2px solid #999; padding: 0 40px 6px; min-width: 50%;
}
.cert-reason { font-size: 1.05rem; color: #444; max-width: 70%; }
.cert-footer { display: flex; gap: 90px; margin-top: 26px; }
.cert-sig { display: flex; flex-direction: column; font-weight: 600; border-top: 1.5px solid #333; padding-top: 4px; min-width: 180px; }
.cert-sig small { color: #777; font-weight: 500; }

/* ── Handwriting ─────────────────────────────────────────── */
.hw-line {
  position: relative; height: 64px; margin: 0 0 22px;
  border-top: 2px solid #7aa7d9;
  border-bottom: 2px solid #7aa7d9;
}
.hw-line::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1.5px dashed #c6d8ec;
}
.hw-trace {
  position: absolute; left: 8px; bottom: 1px;
  font-family: 'Comic Sans MS', 'Segoe Print', cursive;
  font-size: 44px; line-height: 1; color: #c9c9c9; letter-spacing: 4px;
  white-space: nowrap;
}

/* ── Word problems ───────────────────────────────────────── */
.wp-list > li { margin-bottom: 22px; }
.wp-q { font-weight: 600; margin-bottom: 6px; }
.wp-ansline { font-weight: 700; margin-top: 8px; }

/* ── Spelling test ───────────────────────────────────────── */
.sp-lines { counter-reset: sp; padding-left: 30px; }
.sp-lines li { margin-bottom: 26px; }
.sp-line { border-bottom: 1.5px solid #333; height: 28px; max-width: 420px; }

/* ── Rubric ──────────────────────────────────────────────── */
.rubric-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.rubric-table th, .rubric-table td { border: 1.5px solid #333; padding: 8px 10px; vertical-align: top; }
.rubric-table thead th { background: #eee; text-align: center; }
.rubric-crit { font-weight: 700; width: 15%; }
.rubric-score { width: 52px; text-align: center; }

/* ── Discussion cards ────────────────────────────────────── */
.disc-grid { display: grid; grid-template-columns: 1fr 1fr; }
.disc-card {
  border: 2px dashed #888; min-height: 170px; padding: 12px 16px;
  display: flex; flex-direction: column; page-break-inside: avoid; position: relative;
}
.disc-no { font-weight: 800; color: #999; font-size: .85rem; }
.disc-prompt {
  flex: 1; display: flex; align-items: center; justify-content: center;
  text-align: center; font-weight: 600; font-size: 1.08rem; padding: 8px 4px;
}
.disc-brand { font-size: .7rem; color: #999; text-align: right; }

/* ── Analogies ───────────────────────────────────────────── */
.odd-row { font-size: 1.05rem; letter-spacing: .5px; }

/* ── Telling time ────────────────────────────────────────── */
.clock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 16px; }
.clock-cell { text-align: center; page-break-inside: avoid; }
.clock-no { display: block; text-align: left; font-weight: 700; }
.clock-svg { width: 130px; height: 130px; }
.clock-grid-key .clock-svg { width: 95px; height: 95px; }
.clock-answer { font-weight: 700; margin-top: 6px; }
.clock-time { font-weight: 800; font-size: 1.25rem; margin-top: 6px; }

/* ── Graphic organizers ──────────────────────────────────── */
.org-svg { width: 100%; max-height: 640px; }
.org-table { width: 100%; border-collapse: collapse; }
.org-table th, .org-table td { border: 2px solid #111; padding: 10px; text-align: center; }
.org-tall { height: 560px; }
.org-boxes { display: flex; flex-wrap: wrap; gap: 12px; }
.org-box { border: 2px solid #111; border-radius: 8px; padding: 10px 14px; min-height: 130px; width: 100%; }
.org-box h3 { font-size: .95rem; font-family: inherit; margin: 0 0 6px; }
.org-half { width: calc(50% - 6px); }
.org-third { width: calc(33.33% - 8px); }
.org-timeline { border-left: none; }
.org-tl-row { display: flex; align-items: stretch; gap: 0; min-height: 92px; }
.org-tl-date { width: 130px; border: 1.5px solid #111; border-radius: 6px; margin: 6px 0; }
.org-tl-dot { width: 40px; position: relative; }
.org-tl-dot::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 3px solid #111; }
.org-tl-dot::after {
  content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 14px; height: 14px; border-radius: 50%; background: #111;
}
.org-tl-event { flex: 1; border: 1.5px solid #111; border-radius: 6px; margin: 6px 0; }

/* ── Name tags ───────────────────────────────────────────── */
.tag-grid { display: grid; }
.tag {
  border: 2px dashed #888; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  page-break-inside: avoid; gap: 4px;
}
.tag-name { font-weight: 800; }
.tag-desk-grid { grid-template-columns: 1fr; }
.tag-desk { height: 300px; }
.tag-desk .tag-name { font-size: 3.2rem; }
.tag-desk .tag-emoji { font-size: 2.4rem; }
.tag-med-grid { grid-template-columns: 1fr 1fr; }
.tag-med { height: 150px; }
.tag-med .tag-name { font-size: 1.7rem; }
.tag-med .tag-emoji { font-size: 1.4rem; }
.tag-small-grid { grid-template-columns: 1fr 1fr 1fr; }
.tag-small { height: 82px; }
.tag-small .tag-name { font-size: 1.05rem; }
.tag-small .tag-emoji { font-size: .95rem; }

/* ── Reward charts ───────────────────────────────────────── */
.rw-table { width: 100%; border-collapse: collapse; }
.rw-table th, .rw-table td { border: 1.5px solid #333; padding: 6px; text-align: center; height: 34px; }
.rw-table thead th { background: #eee; font-size: .8rem; }
.rw-name { text-align: left !important; font-weight: 600; min-width: 130px; }
.punch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.punch-card {
  border: 2px dashed #888; border-radius: 10px; padding: 12px 16px; text-align: center;
  page-break-inside: avoid;
}
.punch-title { font-weight: 800; }
.punch-name { font-size: 1.15rem; margin: 4px 0 8px; }
.punch-dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.punch-dot {
  width: 30px; height: 30px; border: 2px solid #333; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: #777;
}
.punch-reward { margin-top: 8px; font-weight: 600; color: #444; }
.coupon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.coupon {
  border: 3px dashed #b8860b; border-radius: 10px; padding: 14px; text-align: center;
  background: #fffdf4; page-break-inside: avoid;
}
.coupon-star { font-size: 1.6rem; }
.coupon-title { font-weight: 800; font-size: 1.1rem; }
.coupon-reward { color: #444; margin: 4px 0; }
.coupon-name { font-size: .85rem; margin-top: 8px; }

/* ── Group maker ─────────────────────────────────────────── */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.group-card {
  border: 2px solid #333; border-radius: 10px; padding: 12px 18px; page-break-inside: avoid;
}
.group-card h3 { font-size: 1.05rem; font-family: inherit; border-bottom: 2px solid #333; padding-bottom: 4px; }
.group-card ol { margin: 8px 0 0; padding-left: 22px; }
.group-card li { margin-bottom: 4px; }

/* ── Printable paper ─────────────────────────────────────── */
.paper-page {
  height: 1050px; width: 100%;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.paper-wide    { background: repeating-linear-gradient(#fff 0, #fff 40px, #9db8d9 40px, #9db8d9 41.5px); }
.paper-college { background: repeating-linear-gradient(#fff 0, #fff 30px, #9db8d9 30px, #9db8d9 31.5px); }
.paper-narrow  { background: repeating-linear-gradient(#fff 0, #fff 22px, #9db8d9 22px, #9db8d9 23.5px); }
.paper-grid10  {
  background-image: linear-gradient(#b9c9dd 1px, transparent 1px), linear-gradient(90deg, #b9c9dd 1px, transparent 1px);
  background-size: 37.8px 37.8px; /* 10mm at 96dpi */
}
.paper-grid5   {
  background-image: linear-gradient(#c9d6e6 1px, transparent 1px), linear-gradient(90deg, #c9d6e6 1px, transparent 1px);
  background-size: 18.9px 18.9px; /* 5mm */
}
.paper-dot {
  background-image: radial-gradient(circle, #8fa3bb 1.4px, transparent 1.6px);
  background-size: 18.9px 18.9px;
}
.staff-block { margin: 0 0 62px; }
.staff-block div { border-top: 1.8px solid #333; height: 12px; }

/* ── Admin ───────────────────────────────────────────────── */
.admin-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.stat-box {
  background: var(--tt-card); border: 1px solid var(--tt-line); border-radius: 12px;
  padding: 16px 26px; text-align: center; box-shadow: var(--tt-shadow);
}
.stat-num { font-size: 1.7rem; font-weight: 800; color: var(--tt-green); }
.admin-table { background: var(--tt-card); }
.admin-actions form { margin: 2px; }
.admin-smtp { background: var(--tt-card); border: 1px solid var(--tt-line); border-radius: var(--tt-radius); padding: 24px; }

/* ── Tutorials ───────────────────────────────────────────── */
.tool-tut-link { font-size: .82rem; font-weight: 700; margin-left: 8px; text-decoration: none; }
.tut-breadcrumb { font-size: .88rem; }
.tut-breadcrumb a { text-decoration: none; font-weight: 600; }
.tut-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.tut-icon { font-size: 3rem; line-height: 1; }
.tut-body {
  background: var(--tt-card); border: 1px solid var(--tt-line);
  border-radius: var(--tt-radius); box-shadow: var(--tt-shadow);
  padding: 28px 32px; max-width: 860px;
}
.tut-body h2 { font-size: 1.15rem; margin: 22px 0 12px; }
.tut-body h2:first-child { margin-top: 0; }
.tut-steps li { margin-bottom: 10px; line-height: 1.65; }
.tut-tips { list-style: none; padding-left: 0; }
.tut-tips li { margin-bottom: 8px; line-height: 1.6; }
.tut-example {
  background: var(--tt-green-soft); border-left: 4px solid var(--tt-green);
  padding: 14px 18px; border-radius: 0 10px 10px 0; font-style: italic;
}
.tut-cta { margin-top: 26px; text-align: center; }
.tut-intro { color: var(--tt-muted); font-size: 1.02rem; margin-bottom: 10px; }
.tut-modal .modal-header { background: var(--tt-green); color: #fff; }
.tut-modal .modal-header .btn-close { filter: invert(1); }
.tut-modal .modal-title { font-weight: 800; }
.tut-body-popup h2 { font-size: 1.1rem; margin: 20px 0 10px; }
.tut-body-popup .tut-steps li { margin-bottom: 9px; line-height: 1.6; }
.tut-body-popup .tut-tips { list-style: none; padding-left: 0; }
.tut-body-popup .tut-tips li { margin-bottom: 7px; line-height: 1.55; }

/* ── Toasts ──────────────────────────────────────────────── */
#tt-toasts { position: fixed; bottom: 22px; right: 22px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.tt-toast {
  background: var(--tt-ink); color: #fff; padding: 12px 18px; border-radius: 10px;
  box-shadow: 0 6px 22px rgba(0,0,0,.25); font-weight: 600; font-size: .92rem;
  opacity: 0; transform: translateY(10px); transition: all .3s ease; max-width: 380px;
}
.tt-toast.show { opacity: 1; transform: translateY(0); }
.tt-toast-success { background: var(--tt-green); }
.tt-toast-error { background: var(--tt-danger); }

/* ── PRINT ───────────────────────────────────────────────── */
@media print {
  body { background: #fff !important; display: block; }
  .no-print, .tt-nav, .tt-footer, .tool-form-panel, .result-actions, #tt-toasts { display: none !important; }
  .tool-wrap { display: block; padding: 0; margin: 0; max-width: none; }
  .tool-result-panel { border: none; box-shadow: none; padding: 0; min-height: 0; }
  #print-area { width: 100%; }
  .page-break { page-break-before: always; border-top: none; margin-top: 0; padding-top: 0; }
  .wsg td { width: 26px; height: 26px; }
  .wsg-hit { background: #ffe9a8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fc-row { page-break-inside: avoid; }
  .quiz-list > li, .ws-items li { page-break-inside: avoid; }
  .ticket { border-color: #555; }
  /* Certificates: one per page. On screen .cert uses aspect-ratio, but in print
     that computes ~6mm TALLER than a landscape page, so every subsequent cert
     was pushed down and its top clipped. Pin the height to the page instead. */
  .cert {
    aspect-ratio: auto;
    height: 98.5vh;              /* page content box height in print */
    max-width: none;
    margin: 0 !important;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .bingo-free { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hw-line, .hw-line::before, .hw-trace { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rc-copy { display: none; }
}
