/* Thinking Lab, Classes 1–12 (thinking.php). Uses the app.css tokens; light and dark themes. */
.think { --tc: #8e44ad; }
.think-hero { color: #fff; padding: 30px 0 64px; background:
  radial-gradient(circle at 12% 20%, rgba(255,255,255,.14) 0 3px, transparent 4px) 0 0 / 46px 46px,
  radial-gradient(900px 300px at 90% 0%, color-mix(in srgb, var(--tc) 70%, #fff) 0%, transparent 60%),
  linear-gradient(135deg, #0b1530, color-mix(in srgb, var(--tc) 60%, #0b1530)); }
.think-hero h1 { font-family: var(--display); font-size: clamp(1.7rem, 4vw, 2.5rem); margin: .2em 0 .3em; color: #fff; }
.think-hero .lead { max-width: 760px; color: rgba(255,255,255,.9); }
.think-hero .crumbs, .think-hero .crumbs a { color: rgba(255,255,255,.8); }
.think-grades { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.think-grades a { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); color: #fff; text-decoration: none; font-weight: 700; font-size: .88rem; }
.think-grades a.on { background: #fff; color: #0b1530; }
.think > .section { margin-top: -44px; position: relative; }

.think-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 18px; }
.think-cat { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--tc);
  box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform .15s; }
.think-cat:hover { transform: translateY(-4px); }
.think-cat strong { font-family: var(--display); font-size: 1.15rem; }
.think-cat-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; font-size: 1.8rem; background: color-mix(in srgb, var(--tc) 16%, transparent); }
.think-diag { background: linear-gradient(135deg, color-mix(in srgb, var(--tc) 12%, var(--surface)), var(--surface)); }
.think-map, .think-how { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.think-map > div, .think-how > div { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); }
.think-map b, .think-how b { color: var(--blue); font-family: var(--display); }
.think-map p, .think-how p { margin: .3em 0 0; font-size: .93rem; }

.think-card { padding: 18px; }
.think-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.think-pill { padding: 6px 12px; border-radius: 999px; background: var(--tc); color: #fff; font-weight: 800; font-size: .85rem; }
.think-bar select { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.think-stat { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .9rem; }
.think-qcard { padding: 18px; border-radius: 16px; background: color-mix(in srgb, var(--tc) 6%, var(--surface)); border: 1px solid var(--line); }
.think-topic { margin: 0 0 4px; color: var(--tc); font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.think-q { font-family: var(--display); font-size: clamp(1.15rem, 2.6vw, 1.55rem); line-height: 1.35; margin: 0 0 14px; }
.think-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.think-opts.is-visual { grid-template-columns: repeat(4, minmax(0, 120px)); }
.think-opt { padding: 14px 16px; min-height: 56px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font-size: 1.05rem; font-weight: 700; cursor: pointer; text-align: center; transition: transform .1s, border-color .15s; }
.think-opt:hover:not(:disabled) { border-color: var(--tc); transform: translateY(-2px); }
.think-opt:focus-visible { outline: 3px solid var(--tc); outline-offset: 2px; }
.think-opt.right { border-color: #27ae60; background: color-mix(in srgb, #27ae60 16%, var(--surface)); }
.think-opt.wrong { border-color: #e74c3c; background: color-mix(in srgb, #e74c3c 14%, var(--surface)); }
.think-opt:disabled { cursor: default; }
.think-hints { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.think-hintbox { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, #FFC842 22%, var(--surface)); }
.think-hintbox p { margin: .2em 0; }
.think-feedback { margin-top: 12px; padding: 12px 16px; border-radius: 12px; }
.think-feedback.ok { background: color-mix(in srgb, #27ae60 14%, var(--surface)); border-inline-start: 5px solid #27ae60; }
.think-feedback.no { background: color-mix(in srgb, #e74c3c 12%, var(--surface)); border-inline-start: 5px solid #e74c3c; }
.think-feedback ol { margin: .4em 0 0; padding-inline-start: 1.3em; }
.think-next { margin-top: 12px; }

.think-vis { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; }
.think-tile { width: 96px; height: 96px; }
.think-opt .think-tile { width: 80px; height: 80px; }
.think-tile-bg { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.think-ink { fill: var(--tc); }
.think-q-tile { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 12px; border: 3px dashed var(--tc); font-size: 2.4rem; font-weight: 800; color: var(--tc); }
.think-mirror { width: 6px; height: 96px; border-radius: 3px; background: linear-gradient(#bcd4f7, #6d93c9); box-shadow: 0 0 10px rgba(63,111,216,.5); }
.think-tile.think-big { width: 220px; height: 220px; max-width: 100%; }
.think-matrix { display: grid; grid-template-columns: repeat(3, 84px); gap: 8px; margin: 0 0 14px; }
.think-matrix .think-tile, .think-matrix .think-q-tile { width: 84px; height: 84px; }
.think-lines line { stroke: var(--tc); stroke-width: 1.6; stroke-linecap: round; }
.think-paper { fill: #fffbea; stroke: #b9a36a; stroke-width: 1.2; }
.think-hole { fill: #33302a; }
.think-fold { stroke: #d63a5a; stroke-width: 1.4; stroke-dasharray: 3 2; }
.think-arrow { font-size: 1.6rem; color: var(--tc); }
.think-stick { stroke: #c9963b; stroke-width: 2.6; stroke-linecap: round; }
.think-head { fill: #d63a2a; }
.think-dotA { fill: #27ae60; } .think-dotB { fill: #d63a5a; }
.think-ink text { fill: var(--text, #1b2440); }
.think-ink text.think-netl { fill: #1b2440; }
.think-opts.is-emoji .think-opt { font-size: 2rem; }
.think-memory { display: grid; grid-template-columns: repeat(var(--n), 72px); gap: 8px; margin: 0 0 10px; }
.think-mem-cell { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 2.2rem; }
.think-memory.covered .think-mem-cell { background: var(--tc); }
.think-memory.covered .think-mem-cell span { visibility: hidden; }
.think-countdown { font-weight: 700; color: var(--tc); margin: 0 0 12px; }

.think-progress { height: 8px; margin-top: 16px; border-radius: 99px; background: var(--line); overflow: hidden; }
.think-progress span { display: block; height: 100%; width: 0; background: var(--tc); transition: width .3s; }
.think-report h2 { font-family: var(--display); }
.think-skill { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr auto; gap: 10px; align-items: center; margin: 10px 0; }
.think-meter { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; }
.think-meter span { display: block; height: 100%; background: linear-gradient(90deg, #27ae60, #7CF29A); }
.think-3d-view { position: relative; height: 380px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 14px; }
@media (max-width: 560px) { .think-opts.is-visual { grid-template-columns: repeat(2, minmax(0, 1fr)); } .think-skill { grid-template-columns: 1fr; } }

/* the hidden attribute must win over .btn display rules */
.think [hidden] { display: none !important; }

.think-q { white-space: pre-line; }

/* ---------- Practical common-sense lab ---------- */
.life-menu, .life-stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 16px; }
.life-act { display: grid; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: inherit; cursor: pointer; font: inherit; }
.life-act.on, .life-act:hover { border-color: #0f8a6a; }
.life-act-icon { font-size: 1.6rem; }
.life-stage h2 { font-family: var(--display); }
.life-items { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 14px; }
.life-item { display: grid; place-items: center; gap: 2px; min-width: 110px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.life-item span:first-child { font-size: 2rem; }
.life-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.life-num { width: 120px; padding: 8px 10px; font-size: 1.1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: inherit; }
.life-tray, .life-paid { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; min-height: 44px; align-items: center; }
.life-money { display: inline-grid; place-items: center; cursor: pointer; font-weight: 800; user-select: none; }
.life-money.note { min-width: 64px; height: 36px; padding: 0 8px; border-radius: 6px; background: linear-gradient(135deg, #b8e0c2, #6fb98a); color: #12391f; border: 1px solid #3f8a5a; }
.life-money.coin { width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b0, #d4a72c); color: #4a3505; border: 1px solid #a07d16; }
.life-clock-wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.life-clock { width: 240px; height: 240px; touch-action: none; cursor: grab; }
.life-face { fill: #fffdf5; stroke: #0f8a6a; stroke-width: 5; }
.life-tick { stroke: #555; stroke-width: 1.5; }
.life-num-t { font: 700 15px system-ui; text-anchor: middle; dominant-baseline: central; fill: #1b2440; }
.life-hour { stroke: #1b2440; stroke-width: 7; stroke-linecap: round; }
.life-min { stroke: #d63a5a; stroke-width: 4; stroke-linecap: round; }
.life-pin { fill: #1b2440; }
.life-clock-btns { display: grid; grid-template-columns: repeat(2, auto); gap: 8px; }
.life-rules { margin: 6px 0 10px; }
.life-plan { display: grid; gap: 6px; padding-left: 0; list-style: none; }
.life-plan li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.life-plan .life-fixed { background: rgba(230, 126, 34, .15); }
.life-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 150px; }
.life-arrows { margin-left: auto; display: flex; gap: 4px; }
.life-say { font-size: 1.1rem; }
.life-inbox { display: grid; gap: 10px; }
.life-mail { padding: 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); }
.life-mail.right { border-color: #27ae60; } .life-mail.wrong { border-color: #d63a5a; }
@media (max-width: 560px) { .life-time { min-width: 0; } .life-clock { width: 200px; height: 200px; } }

.think-cal { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.think-cal span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); font-size: .85rem; }
.think-cal span.on { background: #27ae60; color: #fff; border-color: #27ae60; }
.think-today { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }

/* ---------- Logic grid puzzles ---------- */
.grid-wrap { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 18px; align-items: start; }
.grid-clues ol { padding-left: 2.2em; } .grid-clues li { margin: 6px 0; cursor: pointer; }
.grid-clues li.used { text-decoration: line-through; opacity: .5; }
.grid-tables { display: flex; flex-wrap: wrap; gap: 16px; }
.grid-t { border-collapse: collapse; } .grid-t caption { font-weight: 800; padding-bottom: 4px; }
.grid-t th { padding: 4px 8px; font-size: .9rem; text-transform: capitalize; } .grid-t td { padding: 0; border: 1px solid var(--line); }
.grid-c { width: 48px; height: 44px; font-size: 1.3rem; font-weight: 800; border: 0; background: var(--surface); color: inherit; cursor: pointer; }
.grid-c:hover { background: rgba(63, 111, 216, .15); }
@media (max-width: 720px) { .grid-wrap { grid-template-columns: 1fr; } }

/* ---------- Question bank ---------- */
.bank-list { padding-left: 1.8em; } .bank-list > li { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.bank-q { margin: 0 0 4px; font-weight: 600; white-space: pre-line; } .bank-badge { font-size: .85rem; }
.bank-ans summary { cursor: pointer; color: var(--tc, #0A4BAF); } .print-only { display: none; }
@media print { .no-print, .site-header, header, footer, .think-hero, .crumbs { display: none !important; } .print-only { display: block; } .bank-ans summary { display: none; } .bank-list > li { break-inside: avoid; } }

/* ---------- Progress, parent report, teacher dashboard ---------- */
.prog-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.prog-top div { display: grid; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.prog-top b { font-size: 1.8rem; font-family: var(--display); }
.think-table-wrap { overflow-x: auto; }
.think-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.think-table th, .think-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.think-st { padding: 2px 8px; border-radius: 99px; font-size: .8rem; font-weight: 700; }
.think-st.strong { background: rgba(39, 174, 96, .2); color: #27ae60; } .think-st.growing { background: rgba(243, 156, 18, .2); color: #d68910; }
.think-st.weak { background: rgba(214, 58, 90, .18); color: #d63a5a; } .think-st.none { background: rgba(127, 140, 141, .18); color: #7f8c8d; }
.prog-bars { width: 100%; max-width: 560px; height: 120px; } .prog-bars rect { fill: #16a085; } .prog-bars line { stroke: var(--line); }
.prog-group { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; }
.prog-link { width: min(100%, 520px); font-size: .85rem; }
.think-form { display: grid; gap: 10px; max-width: 640px; } .think-form label { display: grid; gap: 4px; }
.think-form input, .think-form select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: inherit; }
.think-form fieldset { border: 1px solid var(--line); border-radius: 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.think-form fieldset label { display: inline-flex; gap: 4px; align-items: center; }
.think-code { font-family: ui-monospace, monospace; font-size: 1.3rem; letter-spacing: 3px; padding: 2px 10px; border-radius: 8px; background: var(--surface); border: 1px dashed var(--line); }
.prog-skill { grid-template-columns: minmax(120px, 1fr) 2fr auto auto; }
@media (max-width: 560px) { .prog-skill { grid-template-columns: 1fr auto; } .prog-skill .think-meter { grid-column: 1 / -1; } }
