/* Practice after a lesson (static/board/practice.js; only on the page when TUTOR_PRACTICE=1). The card follows the
   board's quiz card (white, blue border, green/amber feedback). */
#practiceTab { font: 600 14px var(--ui); padding: 9px 14px; border-radius: 10px; border: 1px solid #374151; background: #1f2937; color: #9ca3af; cursor: pointer; white-space: nowrap; }
#practiceTab:hover { border-color: var(--brand); }
#practiceTab[aria-pressed="true"] { color: #fff; border-color: #16a34a; box-shadow: inset 0 0 0 1px #16a34a; }
@media (min-width: 641px) and (max-width: 860px) { body.tp-able .top .lbl { display: none; } }
@media (min-width: 1920px) and (max-width: 2299px) { body.tp-able .top .lbl { display: none; } }
/* one more icon in the bar: the icons get a little narrower, and the question box keeps at least ~200 px (the form takes
   its own row when the bar is too full, as it does on main below 1280 px) */
@media (min-width: 861px) and (max-width: 1919px) {
  body.tp-able .top { gap: 8px; padding-left: 12px; padding-right: 12px; }
  body.tp-able #shortsTab, body.tp-able #libraryTab, body.tp-able #iconsTab, body.tp-able #styleTab, body.tp-able #askTab, body.tp-able #vizTab,
  body.tp-able #sketchTab, body.tp-able #animateTab, body.tp-able #storyTab, body.tp-able #practiceTab { padding-left: 10px; padding-right: 10px; }
  body.tp-able #ask { min-width: min(100%, 780px); }
}
@media (min-width: 861px) and (max-width: 1365px) { body.tp-able .brand { font-size: 16px; } body.tp-able .brand .dot { display: none; } }
@media (max-width: 640px) {
  #practiceTab { font-size: 16px; height: 38px; min-width: 42px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 420px) {
  #practiceTab { min-width: 34px; padding: 0 6px; }
  body.tp-able .top { gap: 5px; }
  body.tp-able .brand { font-size: 13px; letter-spacing: -0.3px; gap: 0; overflow: hidden; }
  body.tp-able .brand .dot { display: none; }
}
#practiceBtn { white-space: nowrap; border-color: #86efac; background: #f0fdf4; color: #166534; }

/* the chip on the board at the lesson's end */
.tp-end { position: absolute; right: 16px; bottom: 16px; z-index: 30; font: 700 16px var(--ui); padding: 11px 18px; border-radius: 999px; border: 0;
  background: #16a34a; color: #fff; cursor: pointer; box-shadow: 0 8px 22px rgba(22,163,74,.35); animation: tp-pop .45s cubic-bezier(.2,.9,.3,1.2) both; }
.tp-end:hover { background: #15803d; }
.tp-end[hidden] { display: none; }
@keyframes tp-pop { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }

/* the card */
.tp-back { position: fixed; inset: 0; z-index: 1000; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tp-back[hidden] { display: none; }
.tp-card { width: min(620px, 100%); max-height: min(88vh, 900px); overflow-y: auto; background: #fff; border: 2px solid #c7d2fe; border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15,23,42,.28); font-family: var(--ui); color: var(--ink); padding: 0 0 16px; }
.tp-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; background: #fff; padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
.tp-title { font-weight: 700; font-size: 17px; color: #166534; white-space: nowrap; }
.tp-title::before { content: "✍️ "; }
.tp-tabs { display: flex; gap: 6px; flex: 1; min-width: 0; }
.tp-tabb { font: 600 14px var(--ui); padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: #f9fafb; color: var(--ink); cursor: pointer; white-space: nowrap; }
.tp-tabb[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.tp-tabb[hidden] { display: none; }
.tp-x { font: 600 18px var(--ui); width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--muted); flex: none; }
.tp-body { padding: 12px 16px 0; }
.tp-msg { font-size: 16px; color: var(--muted); padding: 18px 2px; line-height: 1.45; }
.tp-spin { display: inline-block; width: 14px; height: 14px; margin-left: 8px; border: 2px solid #c7d2fe; border-top-color: var(--brand); border-radius: 50%; vertical-align: -2px; animation: tp-spin .8s linear infinite; }
@keyframes tp-spin { to { transform: rotate(360deg); } }
.tp-qhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tp-count { font-size: 13px; color: var(--brand); font-weight: 700; }
.tp-dots { display: flex; gap: 6px; }
.tp-dot { width: 10px; height: 10px; border-radius: 50%; background: #e5e7eb; }
.tp-dot.cur { box-shadow: 0 0 0 2px #93c5fd; }
.tp-dot.ok { background: #16a34a; }
.tp-dot.no { background: #f59e0b; }
.tp-q { font-weight: 600; font-size: 18px; line-height: 1.4; margin-bottom: 6px; }
.tp-qtex { font-size: 20px; margin: 6px 0 10px; overflow-x: auto; }
.tp-answer { margin: 8px 0 4px; }
.tp-form { display: flex; gap: 8px; align-items: center; }
.tp-in { flex: 1; min-width: 0; font: 600 20px var(--ui); padding: 10px 12px; border-radius: 10px; border: 2px solid #c7d2fe; background: #f8fafc; color: var(--ink); }
.tp-in:focus { outline: none; border-color: var(--brand); background: #fff; }
.tp-unit { font: 600 17px var(--ui); color: var(--muted); }
.tp-go, .tp-btn { font: 700 16px var(--ui); padding: 11px 18px; border-radius: 10px; border: 0; background: var(--brand); color: #fff; cursor: pointer; white-space: nowrap; }
.tp-btn.alt { background: #16a34a; }
.tp-go:disabled, .tp-btn:disabled { opacity: .45; cursor: default; }
.tp-keys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tp-key { font: 600 17px var(--ui); min-width: 44px; height: 40px; border-radius: 9px; border: 1px solid var(--line); background: #f9fafb; color: var(--ink); cursor: pointer; }
.tp-key:disabled { opacity: .4; }
.tp-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: 500 16px var(--ui); margin: 6px 0; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: #f9fafb; cursor: pointer; color: var(--ink); }
.tp-opt b { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #e0e7ff; color: #3730a3; font-size: 14px; flex: none; }
.tp-opt:hover:not(:disabled) { border-color: var(--brand); }
.tp-opt.right { background: #dcfce7; border-color: #16a34a; }
.tp-opt.wrong { background: #fee2e2; border-color: #dc2626; }
.tp-fb { margin-top: 10px; border-radius: 12px; }
.tp-fb.ok, .tp-fb.no { padding: 10px 12px; }
.tp-fb.ok { background: #f0fdf4; border: 1px solid #86efac; }
.tp-fb.no { background: #fffbeb; border: 1px solid #fcd34d; }
.tp-fbh { font: 700 26px var(--hand); line-height: 1.1; }
.tp-fb.ok .tp-fbh { color: #15803d; }
.tp-fb.no .tp-fbh { color: #b45309; }
.tp-fbm { margin-top: 4px; font-size: 15px; line-height: 1.45; color: #374151; }
.tp-sol:not(:empty) { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #f8fafc; border: 1px dashed #cbd5e1; }
.tp-solh { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.tp-lines { margin: 0; padding-left: 22px; }
.tp-lines li { margin: 6px 0; }
.tp-ltex { font-size: 18px; overflow-x: auto; padding: 2px 0; }
.tp-lsay { font-size: 15px; color: #4b5563; line-height: 1.4; }
.tp-lnote { font: 600 20px var(--hand); color: #7c3aed; }
.tp-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.tp-link { font: 600 15px var(--ui); border: 0; background: none; color: var(--brand); cursor: pointer; padding: 8px 2px; text-decoration: underline; text-underline-offset: 3px; }
.tp-score { font-weight: 700; font-size: 16px; color: #166534; flex-basis: 100%; }
.tp-intro { font-size: 15px; color: var(--muted); margin-bottom: 10px; line-height: 1.4; }
.tp-mq { font-size: 18px; line-height: 2; font-weight: 600; }
.tp-params { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 6px 0; }
.tp-param { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: #374151; }
.tp-num { font: 700 18px var(--ui); padding: 6px 8px; border-radius: 9px; border: 2px solid #93c5fd; background: #eff6ff; color: #1e3a8a; text-align: center; }
.tp-num:focus { outline: none; border-color: var(--brand); background: #fff; }
.tp-num.bad { border-color: #dc2626; background: #fef2f2; }
.tp-echo { font-weight: 700; color: #1e3a8a; }
.tp-mmsg { min-height: 22px; margin: 8px 0 4px; font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tp-mmsg.ok { color: #15803d; font-weight: 700; }
.tp-mmsg.no { color: #b45309; }
.tp-sug { font: 600 14px var(--ui); padding: 6px 10px; border-radius: 999px; border: 1px solid #fcd34d; background: #fffbeb; color: #92400e; cursor: pointer; }
.tp-ans:not(:empty) { font-size: 19px; margin: 6px 0 8px; padding: 8px 12px; border-radius: 10px; background: #f0fdf4; border: 1px solid #86efac; overflow-x: auto; }
.tp-anslab { font: 700 15px var(--ui); color: #166534; }
.tp-steps:not(:empty) { margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: #f8fafc; border: 1px dashed #cbd5e1; max-height: 42vh; overflow-y: auto; }
.tp-notesrow { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.tp-notesbtn { cursor: pointer; border: 0; font: inherit; }
body.tp-open { overflow: hidden; }

@media (max-width: 640px) {
  .tp-back { align-items: flex-end; padding: 0; }
  .tp-card { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; border-width: 2px 0 0; }
  .tp-head { flex-wrap: wrap; padding: 10px 12px 8px; }
  .tp-tabs { order: 3; flex-basis: 100%; }
  .tp-title { flex: 1; }
  .tp-body { padding: 10px 14px 0; }
  .tp-q { font-size: 17px; }
  .tp-in { font-size: 18px; }
  .tp-go { padding: 11px 14px; }
  .tp-end { right: 10px; bottom: 10px; font-size: 15px; padding: 10px 14px; }
}
