/* Science experiment notebook (Nov 16 2026, task merlin_task_science_egg.md).
   Screen: fun, colorful, science-themed, large readable type, big writing spaces (Grade 3, ages
   7-11). TEMPORARY look: plain CSS + emoji icons until Picasso art exists. Brand colors used:
   red #B8362A and forest green #276844 (approved), plus the app palette variables.
   Print: the @media print block at the bottom turns the page into a paper worksheet — app chrome
   hidden, ticks as empty boxes, writing spaces as ruled blank space, page breaks between sections.
   Scoped to .se-* so no existing game style is touched. */

.se-screen { max-width: 980px; margin: 0 auto; }
.se-screen h1 { font-size: clamp(1.9rem, 4.5vw, 2.7rem); line-height: 1.15; margin: 6px 0 10px; color: var(--green-dark); }

/* hero */
.se-hero { text-align: center; padding: 18px 10px 6px; }
.se-hero-icons { font-size: clamp(2.4rem, 6vw, 3.4rem); letter-spacing: 8px; }
.se-intro { font-size: clamp(1.15rem, 2.4vw, 1.35rem); font-weight: 700; color: var(--ink); max-width: 760px; margin: 0; text-align: left; line-height: 1.55; } /* Nov 19 2026 (Brandie): the intro paragraph is LEFT justified, not centered; the title stays centered */

/* sections: colorful cards, big type */
.se-section { border-radius: 18px; padding: 18px 20px; margin: 18px 0; background: var(--paper); border: 3px solid var(--border); box-shadow: var(--shadow); }
.se-section h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin: 2px 0 12px; display: flex; align-items: center; gap: 10px; }
.se-section h2 span { font-size: 1.5em; }
.se-section h3 { font-size: 1.2rem; margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; color: var(--green-dark); }
.se-objectives { border-color: #b9d9c5; background: linear-gradient(180deg, #f2fbf5, var(--paper) 120px); }
.se-objectives h2 { color: var(--green-dark); }
.se-criteria { border-color: #f0d48b; background: linear-gradient(180deg, #fff9e3, var(--paper) 120px); }
.se-criteria h2 { color: #8a6d1a; }
.se-materials { border-color: #f3c1bb; background: linear-gradient(180deg, #fdf1ef, var(--paper) 120px); }
.se-materials h2 { color: #B8362A; }
.se-instructions { border-color: #bcd0f2; background: linear-gradient(180deg, #eef4fe, var(--paper) 120px); }
.se-instructions h2 { color: var(--blue-action); }
.se-journal { border-color: #d9c8ef; background: linear-gradient(180deg, #f6f0fd, var(--paper) 120px); }
.se-journal h2 { color: #6b4a9e; }
.se-questions { border-color: #bfe6e2; background: linear-gradient(180deg, #ecfaf8, var(--paper) 120px); }
.se-questions h2 { color: #1f7a70; }
.se-reflection { border-color: #f5cfe0; background: linear-gradient(180deg, #fdf0f6, var(--paper) 120px); }
.se-reflection h2 { color: #a3376b; }

/* lists and chips */
.se-list { margin: 0; padding-left: 26px; font-size: 1.12rem; line-height: 1.6; }
.se-list li { margin: 4px 0; }
.se-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.se-chip { font-size: 1.02rem; font-weight: 800; padding: 7px 14px; border-radius: 999px; }
.se-chip-skill { background: var(--lime); color: #33440f; }
.se-chip-concept { background: var(--sky); color: #22375f; }

/* tick boxes (success criteria + materials): big tap targets */
.se-checks { display: grid; gap: 10px; }
.se-check { display: flex; align-items: center; gap: 12px; font-size: 1.15rem; font-weight: 700; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .75); border: 2px solid var(--border); cursor: pointer; min-height: 52px; }
.se-check:hover { border-color: var(--green); }
.se-check input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; } /* the visual box below carries the state */
.se-check-box { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 3px solid var(--green-dark); background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900; color: var(--green-dark); }
.se-check input[type="checkbox"]:checked + .se-check-box::after { content: "✔"; }
.se-check input[type="checkbox"]:focus-visible + .se-check-box { outline: 3px solid var(--blue-action); outline-offset: 2px; }
.se-check-label { line-height: 1.35; }
.se-materials-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.se-mat-icon { font-size: 1.5rem; margin-right: 4px; }

/* steps + safety */
.se-steps { margin: 0; padding-left: 30px; font-size: 1.18rem; line-height: 1.65; }
.se-steps li { margin: 8px 0; padding-left: 4px; }
.se-steps li::marker { color: var(--blue-action); font-weight: 900; }
.se-safety { margin-bottom: 16px; padding: 14px 16px; border-radius: 14px; background: #fdecea; border: 3px solid #B8362A; color: #7c241c; font-size: 1.18rem; font-weight: 700; line-height: 1.5; }
.se-safety strong { color: #B8362A; font-size: 1.25rem; display: inline-block; margin-bottom: 2px; }

/* observation journal table: large writing cells */
.se-journal-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 1.08rem; }
.se-journal-table th { background: #6b4a9e; color: #fff; font-size: 1.12rem; padding: 10px 12px; text-align: left; }
.se-journal-table th:first-child { border-radius: 12px 0 0 0; }
.se-journal-table th:last-child { border-radius: 0 12px 0 0; }
.se-journal-table td { border: 2px solid #d9c8ef; border-top: 0; padding: 8px; vertical-align: top; background: #fff; }
.se-journal-table tr:last-child td:first-child { border-bottom-left-radius: 12px; }
.se-journal-table tr:last-child td:last-child { border-bottom-right-radius: 12px; }
.se-journal-table td:first-child { width: 22%; }
.se-journal-table th.se-ev-th, .se-journal-table td.se-ev-cell { width: 96px; } /* Evidence: narrow, so the notes columns keep their room */


/* Day/Time picker (Nov 19 2026): the native date + time picker (calendar, month, day, time with AM/PM —
   the phone's or tablet's own picker). The label above it asks the child to enter it. */
.se-when-label { display: block; font-size: .95rem; font-weight: 800; color: #6b4a9e; margin: 8px 0 4px; }
.se-when-wrap { display: block; }
.se-when { width: 100%; box-sizing: border-box; min-height: 48px; font: inherit; font-size: 1rem; font-weight: 700; color: var(--ink); background: #fffdf4; border: 2px solid #b9a8d6; border-radius: 10px; padding: 6px 8px; }
.se-when:focus-visible { outline: 3px solid var(--blue-action); outline-offset: 2px; }

/* Hint buttons (Nov 19 2026): small yellow button in the What I See / What I Think columns. The
   header copy shows on laptops; phones hide the header row, so each cell carries its own copy. */
.se-hint-btn { min-height: 36px; min-width: 56px; margin-left: 8px; padding: 2px 14px; border: 0; border-radius: 12px; color: var(--ink); background: #ffe9a3; font: inherit; font-size: 1rem; font-weight: 900; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); cursor: pointer; vertical-align: middle; }
.se-hint-btn:focus-visible { outline: 3px solid var(--blue-action); outline-offset: 2px; }
.se-hint-in-cell { display: none; margin: 0 0 8px; }
.se-hint-overlay { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(15, 23, 42, 0.45); }
.se-hint-card { display: flex; flex-direction: column; width: 100%; max-width: 560px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); box-sizing: border-box; background: #fff; border: 3px solid #f0d48b; border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow); }
.se-hint-card h2 { margin: 0 0 10px; font-size: 1.45rem; color: #8a6d1a; }
.se-hint-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 0 14px; padding-left: 26px; font-size: 1.15rem; font-weight: 700; line-height: 1.5; }
.se-hint-list li { margin: 8px 0; }
.se-safety-lines { margin: 8px 0 0; padding-left: 24px; font-size: 1.12rem; font-weight: 700; line-height: 1.5; }
.se-safety-lines li { margin: 4px 0; }
.se-step-note { display: block; margin-top: 4px; font-size: 1.08rem; font-weight: 800; color: #7c241c; }
/* Round 3 step 5 note: blue + italic (#0f3fa8 on the pale blue Instructions card is about 8:1 contrast) */
.se-step-note-blue { color: #0f3fa8; font-style: italic; }

/* Round 3 gates (Nov 19 2026): a locked section hides its gated part; the "Read" / "I understand" ticks stay. */
.se-safe-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.se-safe-row .se-safe-text { margin: 0; flex: 1 1 260px; }
.se-safety-lines { list-style: none; padding-left: 0; }
.se-safety-lines li.se-safe-row { padding: 6px 0; border-top: 1px dashed #e4b1ab; }
.se-read, .se-understand { min-height: 48px; flex: none; background: #fff; color: var(--ink); }
.se-gate-hint { margin: 0 0 8px; font-size: 1.08rem; font-weight: 800; color: #33507e; }
.se-instructions:not(.se-gate-locked) .se-gate-hint { display: none; }
.se-gate-locked .se-gate-body { display: none; }
.se-gate-card { margin: 0 0 12px; }
.se-gate-card .se-photo-note { margin-bottom: 10px; }
.se-gate-reveal { animation: se-gate-fade .45s ease-out; }
@keyframes se-gate-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .se-gate-reveal { animation: none; } }
.se-photo-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: #fff7dc; border: 2px solid #f0d48b; color: #6a4f00; font-size: 1.12rem; font-weight: 800; line-height: 1.4; }
.se-photo-warn-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(15, 23, 42, 0.55); }
.se-photo-warn-card { width: 100%; max-width: 420px; max-height: calc(100dvh - 24px); overflow-y: auto; box-sizing: border-box; text-align: center; background: #fff; border: 3px solid #f0d48b; border-radius: 18px; padding: 20px 22px; box-shadow: var(--shadow); }
.se-photo-warn-card p { margin: 0 0 16px; font-size: 1.3rem; font-weight: 900; line-height: 1.4; color: #7c241c; }
.se-photo-warn-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.se-photo-warn-btns .btn { min-height: 48px; min-width: 140px; font-size: 1.15rem; font-weight: 900; }
.se-hint-close { flex: none; align-self: center; min-height: 48px; min-width: 140px; font-size: 1.2rem; font-weight: 900; }

/* Evidence column (Nov 19 2026): a small thumbnail; a larger popup on hover (mouse) or tap (touch). */
.se-ev-cell { text-align: center; }
.se-ev-add { min-height: 44px; min-width: 44px; padding: 4px 8px; font-weight: 900; white-space: nowrap; }
.se-ev-thumb { display: inline-block; width: 64px; height: 64px; padding: 0; border: 2px solid #b9a8d6; border-radius: 10px; overflow: hidden; background: #fff; cursor: zoom-in; vertical-align: middle; }
.se-ev-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.se-ev-thumb:focus-visible, .se-ev-remove:focus-visible { outline: 3px solid var(--blue-action); outline-offset: 2px; }
.se-ev-remove { width: 44px; height: 44px; margin-left: 2px; border: 0; border-radius: 999px; background: transparent; color: #B8362A; font-size: 1.1rem; font-weight: 900; cursor: pointer; }
.se-ev-msg { display: block; font-size: .85rem; font-weight: 800; color: #B8362A; }
.se-ev-pop { position: fixed; z-index: 65; pointer-events: none; padding: 6px; background: #fff; border: 3px solid #b9a8d6; border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .35); }
.se-ev-pop img { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 8px; }

/* writing spaces */
.se-cell, .se-text { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 1.12rem; line-height: 1.7; color: var(--ink); background: #fffdf4; border: 2px dashed #b9a8d6; border-radius: 10px; padding: 10px 12px; resize: vertical; }
.se-cell-small { font-weight: 800; }
.se-text { border-color: #9cc7c1; min-height: 96px; }
.se-text-label { display: block; font-size: 1.18rem; font-weight: 900; color: var(--ink); margin: 14px 0 6px; }
.se-lead { font-size: 1.12rem; font-weight: 700; margin: 4px 0 8px; }
.se-prompts { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; font-size: 1.1rem; font-weight: 700; color: #1f7a70; }
.se-reflect { margin: 10px 0 16px; }
.se-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* help page (rule 15: Piko top-right) */
.se-help { position: relative; }
.se-help-piko { position: absolute; top: 12px; right: 16px; width: 92px; height: auto; }
.se-help h1 { margin-top: 2px; }
.se-help-text { font-size: 1.3rem; font-weight: 700; line-height: 1.55; max-width: 660px; }

/* print button */
.se-print-btn { font-weight: 900; }

/* Save buttons (Nov 17 2026, task merlin_task_science_save_buttons.md): one row at the bottom of
   Sections 3, 4 and 5. Big enough for a child (48 px >= the 44 px rule), same look as the other
   blue buttons; the status message sits beside the button and never prints. */
.se-save-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.se-save-btn { min-height: 48px; min-width: 140px; font-size: 1.2rem; font-weight: 900; }
.se-save-status { font-size: 1.1rem; font-weight: 800; }
.se-save-ok { color: var(--green-dark); }
.se-save-err { color: #B8362A; }

/* Status banner, Skip row and Do Again confirm step (Nov 18 2026, task
   merlin_task_inprogress_section.md piece B): "Finished!" / "This was skipped." with the Do Again
   button in one clear box under the top bar; Skip alone at the bottom of the page; the
   Are-you-sure step as a simple centered card over the page. Kid-readable, big type, phone-safe
   (everything wraps; nothing forces sideways scroll). All of it never prints (block below). */
.se-status-box { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px; margin: 14px 0 4px; padding: 14px 18px; border-radius: 16px; border: 3px solid #f0d48b; background: #fff9e3; }
.se-status-box .se-status-msg { margin: 0; font-size: 1.35rem; font-weight: 900; color: #8a6d1a; }
.se-status-skipped { border-color: #c9d4e8; background: #eef3fb; }
.se-status-skipped .se-status-msg { color: #33507e; }
.se-bottom-row { display: flex; justify-content: center; margin: 18px 0 6px; }
.se-bottom-row .btn { min-height: 48px; min-width: 140px; font-size: 1.2rem; font-weight: 900; }
.se-confirm { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, 0.45); }
.se-confirm-card { max-width: 440px; width: 100%; text-align: center; background: #fff; border: 3px solid var(--border); border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow); }
.se-confirm-card p { margin: 0 0 18px; font-size: 1.25rem; font-weight: 800; }
.se-confirm-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.se-confirm-btns .btn { min-height: 48px; min-width: 120px; font-size: 1.15rem; font-weight: 900; }

/* phone: stack the journal into blocks with column labels */
@media (max-width: 700px) {
  .se-journal-table, .se-journal-table thead, .se-journal-table tbody, .se-journal-table tr, .se-journal-table td { display: block; width: auto; }
  .se-journal-table thead { display: none; }
  .se-journal-table tr { margin: 12px 0; border: 2px solid #d9c8ef; border-radius: 12px; overflow: hidden; }
  .se-journal-table td { border: 0; border-top: 2px solid #efe6fa; padding: 8px 10px; }
  .se-journal-table td:first-child { width: auto; } /* stacked: the Day/Time block is full width, not the 22% table column */
  .se-journal-table tr td:first-child { border-top: 0; }
  .se-journal-table td::before { content: attr(data-col); display: block; font-weight: 900; color: #6b4a9e; font-size: .95rem; margin-bottom: 4px; }
  .se-cell-small { min-height: 60px; } /* the Day/Time label must not clip when stacked */
  .se-hint-in-head { display: none; }
  .se-hint-in-cell { display: inline-block; }
  .se-journal-table td.se-ev-cell { width: auto; text-align: left; }
  .se-ev-thumb { width: 88px; height: 88px; }
}

/* ---------------- PRINT: the paper worksheet ----------------
   Hide the app chrome; ticks print as EMPTY boxes (pen-friendly); textareas and journal cells
   print as ruled blank space; page breaks between sections. */
@media print {
  .site-header, #account-actions, .game-topbar, #toast, .se-print-btn { display: none !important; }
  .se-save-row, .se-hint-btn, .se-hint-overlay, .se-ev-pop, .se-photo-warn-overlay { display: none !important; } /* the Save buttons and their message never print */
  /* Nov 18 2026 (In Progress task): Skip, Do Again, the status message and the Are-you-sure step
     never print either — the paper worksheet is the child's handwriting space only. */
  .se-status-box, .se-bottom-row, .se-confirm { display: none !important; }
  body { background: #fff !important; min-width: 0; }
  body::before, body::after { display: none !important; }
  main#app { padding: 0 !important; }
  .se-screen { max-width: none; box-shadow: none; }
  .se-screen.card.panel { border: 0; padding: 0; background: #fff; }
  .se-section { box-shadow: none; background: #fff !important; border: 2px solid #444; break-inside: avoid; page-break-inside: avoid; break-after: page; page-break-after: always; }
  .se-section:last-of-type { break-after: auto; page-break-after: auto; }
  .se-hero { break-after: avoid; }
  .se-hero-icons { display: none; }
  .se-intro, .se-list, .se-steps, .se-check, .se-text-label, .se-lead, .se-prompts, .se-section h2, .se-section h3 { color: #000 !important; }
  /* ticks as empty boxes for pen ticks */
  .se-check { border: 1px solid #666; background: #fff; break-inside: avoid; }
  .se-check-box { border: 2px solid #000; background: #fff !important; }
  .se-check input[type="checkbox"]:checked + .se-check-box::after { content: ""; } /* never print a stored tick */
  /* writing spaces: ruled blank space (lines print via exact color adjust) */
  .se-cell, .se-text {
    border: 1px solid #555; border-radius: 0; background: #fff;
    background-image: repeating-linear-gradient(transparent, transparent 27px, #9a9a9a 27px, #9a9a9a 28px);
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
    color: transparent !important; /* the child writes with a pen, not the stored text */
    caret-color: transparent;
  }
  .se-cell { min-height: 84px; }
  /* the pre-populated Day/Time labels (Start of Experiment, Day 1 ...) stay readable in print so
     each worksheet row keeps its name; the two writing columns stay blank ruled space */
  .se-cell-small { min-height: 34px; color: #000 !important; background: #fff !important; font-weight: 900; }
  .se-text { min-height: 112px; }
  /* Evidence (Nov 19 2026): the worksheet shows an EMPTY framed box per row to draw in or tape a
     picture into; the child's stored pictures and the Add/remove buttons never print. */
  .se-ev-cell > * { display: none !important; }
  .se-ev-cell { height: 96px; min-height: 96px; }
  /* Day/Time (Nov 19 2026): print a blank "Enter the date and time:" line to write on (the stored picks stay off the paper). */
  .se-when-wrap { display: block; border-bottom: 1px solid #555; min-height: 30px; }
  .se-when { visibility: hidden; }
  .se-when-label { color: #000 !important; }
  .se-journal-table td { border: 1px solid #555; }
  .se-journal-table th { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border: 1px solid #555; }
  .se-safety-lines, .se-step-note { color: #000 !important; }
  .se-step-note-blue { color: #0f3fa8 !important; font-style: italic; } /* print keeps the blue italic (dark enough for grey printing) */
  /* Round 3: the gates never hide anything on paper - safety box, all steps, journal and Evidence column always print */
  .se-gate-locked .se-gate-body { display: block !important; }
  .se-gate-hint { display: none !important; }
  .se-gate-reveal { animation: none; }
  .se-read { background: #fff; }
  .se-photo-note { background: #fff !important; border: 1px solid #555; color: #000 !important; }
  .se-safety { background: #fff !important; border: 3px solid #000; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .se-chip { border: 1px solid #666; background: #fff !important; color: #000 !important; }
  .se-help { display: none !important; }
}
