/* わくわくデジタルペイント 受講画面 */
/* Layout: one-screen app. Left 2/3 = Scratch-style paint editor (kept faithful to Scratch so the course videos still match);
   right 1/3 = video on top, scene navigation, then the textbook (one scene at a time). Single light look on purpose: it mirrors Scratch's editor. */
:root {
  --scratch-blue: #4c97ff;
  --scratch-blue-dark: #3373cc;
  --scratch-pane: #e9f1fc;
  --scratch-line: #d5e0f0;
  --ink: #575e75;
  --ink-strong: #2f3447;
  --paper: #ffffff;
  --learn-bg: #f4f6f9;
  --course-orange: #ff8a1f;
  --course-orange-soft: #fff0e2;
  --course-teal: #3fbf9f;
  --video-bg: #1e2333;
  --video-ink: #c9d0e3;
  --warn: #c2410c;
  --font-ui: "Helvetica Neue", Helvetica, Arial, "BIZ UDPGothic", sans-serif;
  --font-body: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --font-display: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", sans-serif;
  color-scheme: light;
}
@font-face { font-family: "Sans Serif"; src: url("../fonts/NotoSans-Medium.ttf"); }
@font-face { font-family: "Serif"; src: url("../fonts/SourceSerifPro-Regular.otf"); }
@font-face { font-family: "Handwriting"; src: url("../fonts/handlee-regular.ttf"); }
@font-face { font-family: "Marker"; src: url("../fonts/Knewave.ttf"); }
@font-face { font-family: "Curly"; src: url("../fonts/Griffy-Regular.ttf"); }
@font-face { font-family: "Pixel"; src: url("../fonts/Grand9K-Pixel.ttf"); }
@font-face { font-family: "Scratch"; src: url("../fonts/Scratch.ttf"); }

html, body { height: 100%; margin: 0; }
[hidden] { display: none !important; }
img { max-width: 100%; }
body { background: var(--scratch-pane); color: var(--ink); font-family: var(--font-ui); overflow: hidden; }
#wdp-root { height: 100%; }
* { box-sizing: border-box; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--scratch-blue-dark); outline-offset: 2px; }
.wdp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wdp-app { height: 100%; display: grid; grid-template-rows: 48px minmax(0, 1fr); }

/* ---------- menu bar (Scratch-like) ---------- */
.wdp-bar { display: flex; align-items: center; gap: 4px; background: var(--scratch-blue); color: #fff; padding-inline: 12px; }
.wdp-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: .02em; padding-right: 12px; margin-right: 4px; border-right: 1px solid rgba(255,255,255,.25); white-space: nowrap; }
.wdp-menu { position: relative; }
.wdp-menubar-btn { background: none; border: 0; color: #fff; font-weight: 700; font-size: 13px; padding: 0 14px; height: 48px; cursor: pointer; }
.wdp-menubar-btn:hover, .wdp-menubar-btn.is-open { background: var(--scratch-blue-dark); }
.wdp-menu-pop { position: absolute; top: 48px; left: 0; min-width: 230px; background: var(--scratch-blue); border-radius: 0 0 8px 8px; box-shadow: 0 8px 18px rgba(0,0,0,.18); padding: 4px 0; z-index: 50; }
.wdp-menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; color: #fff; font-size: 13px; font-weight: 700; padding: 9px 16px; cursor: pointer; }
.wdp-menu-item:hover { background: var(--scratch-blue-dark); }
.wdp-menu-item:disabled { opacity: .45; cursor: default; background: none; }
.wdp-menu-sep { height: 1px; background: rgba(255,255,255,.3); margin: 4px 0; }
.wdp-title-field input { width: 220px; height: 32px; border-radius: 4px; border: 1px dashed rgba(255,255,255,.5); background: rgba(255,255,255,.25); color: #fff; font: 700 13px var(--font-ui); padding: 0 10px; margin-left: 6px; }
.wdp-title-field input:hover { background: rgba(255,255,255,.35); }
.wdp-title-field input:focus { background: #fff; color: var(--ink-strong); border-style: solid; outline: none; }
.wdp-bar-spacer { flex: 1; }
.wdp-bar-icon { width: 40px; height: 40px; border: 0; border-radius: 6px; background: none; color: #fff; display: grid; place-items: center; cursor: pointer; }
.wdp-bar-icon:hover { background: var(--scratch-blue-dark); }

/* ---------- main split ---------- */
.wdp-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(330px, 1fr); min-height: 0; }

.wdp-work-area { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 8px 0 8px 8px; }
.wdp-tabs { display: flex; gap: 2px; padding-left: 8px; }
.wdp-tab { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 18px; border: 1px solid var(--scratch-line); border-bottom: 0; border-radius: 10px 10px 0 0; background: #d9e3f2; color: var(--ink); font-size: 13px; cursor: pointer; position: relative; top: 1px; }
.wdp-tab.is-active { background: var(--paper); color: var(--scratch-blue); font-weight: 700; z-index: 1; }
.wdp-editor-row { flex: 1; min-height: 0; display: flex; background: var(--paper); border: 1px solid var(--scratch-line); border-radius: 8px; overflow: hidden; }

/* costume list */
.wdp-costumes { position: relative; width: 100px; flex: none; background: var(--scratch-pane); border-right: 1px solid var(--scratch-line); display: flex; flex-direction: column; }
.wdp-costume-list { flex: 1; overflow-y: auto; padding: 12px 10px 84px; display: flex; flex-direction: column; gap: 10px; }
.wdp-costume { position: relative; background: var(--paper); border: 2px solid var(--scratch-line); border-radius: 8px; padding: 6px 4px 5px; text-align: center; cursor: pointer; user-select: none; }
.wdp-costume:hover { border-color: var(--scratch-blue); }
.wdp-costume.is-selected { border-color: var(--scratch-blue); background: #eaf2ff; box-shadow: 0 0 0 4px rgba(76,151,255,.25); }
.wdp-costume-no { position: absolute; top: 3px; left: 6px; font-size: 11px; color: var(--ink); }
.wdp-costume-thumb { height: 46px; display: grid; place-items: center; margin-top: 8px; }
.wdp-costume-thumb img { max-width: 60px; max-height: 44px; }
.wdp-costume-name { font-size: 11px; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.wdp-costume.is-selected .wdp-costume-name { color: #fff; background: var(--scratch-blue); border-radius: 4px; margin-inline: -1px; padding: 1px 2px; }
.wdp-costume-size { font-size: 10px; color: var(--ink); font-variant-numeric: tabular-nums; }
.wdp-costume-del { position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--scratch-blue); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 0 2px #fff; }
.wdp-costume-del:hover { background: var(--scratch-blue-dark); }

.wdp-add { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.wdp-add-main { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--scratch-blue); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 0 4px rgba(76,151,255,.3); }
.wdp-add-main:hover { background: var(--scratch-blue-dark); }
.wdp-add-menu { display: flex; flex-direction: column; gap: 4px; background: var(--scratch-blue); border-radius: 24px 24px 0 0; padding: 8px 6px 18px; margin-bottom: -12px; }
.wdp-add-sub { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: #fff; display: grid; place-items: center; cursor: pointer; }
.wdp-add-sub:hover { background: var(--course-teal); }
.wdp-add-sub:hover::after { content: attr(data-tip); position: absolute; left: 50px; top: 50%; transform: translateY(-50%); background: var(--course-teal); color: #fff; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 6px; white-space: nowrap; z-index: 5; }

.wdp-editor { flex: 1; min-width: 0; min-height: 0; overflow: auto; display: flex; }
.wdp-editor > * { flex: 1; min-width: 0; }

/* ---------- learning pane (right 1/3): head, video, scene nav, text ---------- */
.wdp-bar-link { border: 0; background: none; color: rgba(255,255,255,.9); font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 6px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.wdp-bar-link:hover { background: var(--scratch-blue-dark); color: #fff; }
.wdp-bar-home { display: inline-flex; align-items: center; gap: 5px; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.wdp-bar-home:hover { background: var(--scratch-blue-dark); }

.wdp-learn { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; padding: 8px 12px 10px; background: var(--learn-bg); border-left: 1px solid var(--scratch-line); font-family: var(--font-body); color: var(--ink-strong); }
.wdp-lesson-head { display: flex; align-items: center; gap: 8px; flex: none; }
.wdp-lesson-title { margin: 0; flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; font: 800 16px/1.45 var(--font-display); color: var(--ink-strong); text-wrap: balance; }
.wdp-lesson-no { flex: none; background: var(--course-orange); color: #fff; font-size: 12px; padding: 1px 9px; border-radius: 999px; }

.wdp-menu-anchor { position: relative; flex: none; }
.wdp-round-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--scratch-line); background: var(--paper); color: var(--ink-strong); display: grid; place-items: center; cursor: pointer; }
.wdp-round-btn:hover, .wdp-round-btn.is-on { border-color: var(--scratch-blue); color: var(--scratch-blue-dark); }
.wdp-settings { position: absolute; top: 42px; right: 0; z-index: 45; width: min(360px, calc(33vw - 16px)); min-width: 300px; max-height: calc(100vh - 110px); overflow: auto; background: var(--paper); border: 2px solid var(--scratch-blue); border-radius: 12px; box-shadow: 0 10px 28px rgba(30,35,51,.25); padding: 10px 12px 12px; font-size: 13px; line-height: 1.6; }
.wdp-set-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.wdp-set-row b { min-width: 6.5em; font-size: 13px; }
.wdp-opt { border: 2px solid var(--scratch-blue); background: var(--paper); color: var(--scratch-blue-dark); border-radius: 8px; padding: 3px 10px; font-size: 13px; font-weight: 700; cursor: pointer; }
.wdp-opt.is-on { background: var(--scratch-blue); color: #fff; }
.wdp-opt:disabled { opacity: .4; cursor: not-allowed; }
.wdp-opt.is-wide { text-align: left; }
.wdp-teach { margin-top: 10px; border-top: 1px dashed var(--scratch-line); padding-top: 8px; }
.wdp-teach summary { cursor: pointer; font-weight: 700; color: var(--ink-strong); display: flex; align-items: center; gap: 6px; }
.wdp-set-note { margin: 4px 0; font-size: 11px; color: var(--ink); }
.wdp-jump { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; }
.wdp-jump-btn { display: flex; gap: 8px; width: 100%; text-align: left; border: 1px solid var(--scratch-line); background: var(--paper); border-radius: 6px; padding: 4px 8px; font-size: 12px; color: var(--ink-strong); cursor: pointer; }
.wdp-jump-btn:hover { border-color: var(--course-orange); }
.wdp-jump-btn.is-on { background: var(--course-orange-soft); border-color: var(--course-orange); color: #b85500; font-weight: 700; }
.wdp-jump-t { flex: none; width: 3.2em; font-variant-numeric: tabular-nums; }

.wdp-video { flex: none; display: flex; justify-content: center; }
.wdp-video-screen { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: var(--video-bg); border-radius: 8px; overflow: hidden; color: var(--video-ink); display: flex; flex-direction: column; transition: width .2s; }
.wdp-player-box { position: absolute; inset: 0; isolation: isolate; z-index: 0; }
.wdp-player-box video, .wdp-player-iframe { display: block; width: 100%; height: 100%; border: 0; }
.wdp-video-ph, .wdp-video-bar { position: relative; }
.wdp-video-ph { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; }
.wdp-video-play { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.12); display: grid; place-items: center; color: #fff; padding-left: 4px; }
.wdp-video-title { font: 800 15px var(--font-display); color: #fff; text-wrap: balance; }
.wdp-video-note { font-size: 11px; opacity: .7; }
.wdp-video-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px 10px; background: rgba(0,0,0,.25); }
.wdp-video-time { font-size: 11px; font-variant-numeric: tabular-nums; color: #fff; }
.wdp-video-time.is-dim { color: var(--video-ink); opacity: .7; }
.wdp-timeline { position: relative; flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); }
.wdp-tick { position: absolute; top: -5px; width: 4px; height: 16px; margin-left: -2px; border: 0; padding: 0; border-radius: 2px; background: rgba(255,255,255,.55); cursor: pointer; z-index: 1; }
.wdp-tick:hover, .wdp-tick.is-on { background: var(--course-orange); }
/* 10びょう もどる / もういちど: over the video, shown on hover or while paused (the player's own bar stays usable) */
.wdp-vctl { position: absolute; top: 6px; right: 6px; z-index: 6; display: flex; gap: 4px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.wdp-video-screen:hover .wdp-vctl, .wdp-video-screen.is-paused .wdp-vctl, .wdp-vctl:focus-within { opacity: 1; pointer-events: auto; }
.wdp-vctl button { display: inline-flex; align-items: center; gap: 4px; border: 1px solid rgba(255,255,255,.6); background: rgba(20,24,36,.6); color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.wdp-vctl button:hover { background: rgba(20,24,36,.85); }

.wdp-scene-nav { flex: none; display: flex; align-items: center; gap: 6px; background: var(--paper); border: 2px solid var(--course-orange); border-radius: 10px; padding: 4px; }
.wdp-scene-nav.is-flash { animation: wdp-flash 1.4s; }
@keyframes wdp-flash { 0% { box-shadow: 0 0 0 0 rgba(255,138,31,.9); } 100% { box-shadow: 0 0 0 12px rgba(255,138,31,0); } }
.wdp-nav-btn { flex: none; display: inline-flex; align-items: center; gap: 2px; border: 0; background: var(--course-orange-soft); color: #b85500; border-radius: 7px; padding: 6px 10px; font-size: 13px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.wdp-nav-btn:hover:not(:disabled) { background: #ffe0c2; }
.wdp-nav-btn:disabled { opacity: .35; cursor: not-allowed; }
.wdp-nav-btn.is-hot { background: var(--course-orange); color: #fff; }
.wdp-scene-mid { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 8px; font-weight: 800; color: var(--ink-strong); }
.wdp-scene-count { flex: none; font-size: 12px; color: #b85500; font-variant-numeric: tabular-nums; }
.wdp-scene-label { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wdp-peek { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; background: #fff3cd; border: 2px solid var(--course-orange); border-radius: 10px; padding: 4px 6px 4px 10px; font-size: 12px; }
.wdp-peek span { display: inline-flex; align-items: center; gap: 4px; }
.wdp-peek-btn { border: 0; background: var(--course-orange); color: #fff; border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }

.wdp-text-tools { flex: none; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.wdp-chip { border: 0; border-radius: 999px; background: var(--course-teal); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 12px; cursor: pointer; }
.wdp-chip:hover { filter: brightness(.95); }

.wdp-text { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wdp-linkish { border: 0; background: none; padding: 2px 0; font-size: 11px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.wdp-linkish:hover { color: var(--scratch-blue-dark); }
.wdp-about { padding: 14px 18px 18px; line-height: 1.75; font-size: 14px; }
.wdp-about p { margin: 0 0 10px; }
.wdp-about-links { margin: 0 0 12px; padding-left: 1.2em; }
.wdp-about-links a { color: var(--scratch-blue-dark); font-weight: 700; }
.wdp-about-note { font-size: 12px; color: var(--ink); }
/* HTML textbook (text/lessonNN.php). Its own styles live in text/css/textbook.css, scoped under .wdp-textbook.
   The pane touches the inside of the text in only three ways (TEXT_SPEC 4章):
   blocks of other scenes get the hidden attribute, ふりがな「なし」 hides <rt>, and pictures show a zoom cursor. */
.wdp-textbook { container: textbook / inline-size; overflow-x: hidden; background: var(--paper); border-radius: 6px; box-shadow: 0 1px 3px rgba(30,35,51,.15); padding: 0; display: block; }
.wdp-text.is-noruby .wdp-textbook rt { display: none; }
.wdp-textbook img.tb-img, .wdp-page img { cursor: zoom-in; }
.wdp-pages { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px 2px 12px; }
.wdp-page { margin: 0; background: var(--paper); border-radius: 4px; box-shadow: 0 1px 3px rgba(30,35,51,.15); }
.wdp-page img { display: block; width: 100%; height: auto; border-radius: 4px; }

.wdp-zoom { position: fixed; inset: 0; z-index: 90; background: rgba(20,24,36,.88); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.wdp-zoom img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.wdp-zoom-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; display: grid; place-items: center; cursor: pointer; }

/* ---------- 選ぶ (material library) — full screen like Scratch's library ---------- */
.wdp-lib { position: fixed; inset: 0; z-index: 75; display: flex; flex-direction: column; background: var(--scratch-pane); font-family: var(--font-body); color: var(--ink-strong); }
.wdp-lib-head { position: relative; flex: none; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--scratch-blue); color: #fff; }
.wdp-lib-head h2 { margin: 0; font: 800 17px var(--font-display); }
.wdp-lib-back { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: #fff; font-size: 14px; font-weight: 700; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.wdp-lib-back:hover { background: var(--scratch-blue-dark); }
.wdp-lib-body { flex: 1; overflow-y: auto; padding: 16px 20px 32px; }
.wdp-lib-sec { margin: 6px 0 10px; font-size: 14px; font-weight: 800; }
.wdp-lib-sec small { font-weight: 400; color: var(--ink); margin-left: 6px; }
.wdp-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.wdp-lib-card { display: flex; flex-direction: column; align-items: stretch; gap: 6px; border: 2px solid var(--scratch-line); background: var(--paper); border-radius: 10px; padding: 8px; cursor: pointer; font: inherit; color: inherit; }
.wdp-lib-card:hover { border-color: var(--scratch-blue); box-shadow: 0 0 0 4px rgba(76,151,255,.25); }
.wdp-lib-card.is-project { border-color: #f5c38f; }
.wdp-lib-thumb { height: 96px; display: grid; place-items: center; border-radius: 6px; color: var(--ink); background: #fff repeating-conic-gradient(#eef3fa 0% 25%, #fff 0% 50%) 0 0 / 16px 16px; }
.wdp-lib-thumb img { max-width: 100%; max-height: 92px; }
.wdp-lib-name { font-size: 13px; font-weight: 700; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wdp-lib-empty { color: var(--ink); }

/* カメラ */
.wdp-cam { padding: 16px 18px 0; }
.wdp-cam-view { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #1e2333; border-radius: 8px; overflow: hidden; }
.wdp-cam-view video, .wdp-cam-view img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wdp-cam-view video { transform: scaleX(-1); }
.wdp-cam-view video.is-hidden { display: none; }
.wdp-cam-msg { margin: 0; line-height: 1.7; }
.wdp-cam-msg.is-over { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }

/* ---------- popups ---------- */
.wdp-ctx { position: fixed; z-index: 60; min-width: 140px; background: var(--paper); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.2); padding: 4px 0; border: 1px solid var(--scratch-line); }
.wdp-ctx .wdp-menu-item { color: var(--ink-strong); font-weight: 400; }
.wdp-ctx .wdp-menu-item:hover { background: var(--scratch-blue); color: #fff; }
.wdp-ctx .wdp-menu-item:disabled:hover { background: none; color: var(--ink-strong); }

.wdp-modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(76,151,255,.55); display: grid; place-items: center; padding: 16px; }
.wdp-modal { width: min(420px, 100%); max-height: 86vh; overflow: auto; background: var(--paper); border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.25); font-family: var(--font-body); color: var(--ink-strong); }
.wdp-modal.is-wide { width: min(720px, 100%); }
.wdp-modal-head { display: flex; align-items: center; justify-content: space-between; background: var(--scratch-blue); color: #fff; padding: 10px 12px 10px 18px; position: sticky; top: 0; }
.wdp-modal-head h2 { margin: 0; font: 800 16px var(--font-display); }
.wdp-icon-btn { border: 0; background: rgba(255,255,255,.2); color: #fff; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.wdp-works { list-style: none; margin: 0; padding: 16px 18px; display: grid; gap: 10px; }
.wdp-work { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px solid #e3e6ec; border-radius: 8px; }
.wdp-work-thumb { width: 96px; height: 72px; flex: none; display: grid; place-items: center; background: var(--scratch-pane); border-radius: 6px; }
.wdp-work-thumb img { max-width: 84px; max-height: 62px; }
.wdp-work-info { min-width: 0; display: grid; gap: 4px; }
.wdp-work-title { font-weight: 700; color: var(--scratch-blue-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wdp-work-date { font-size: 12px; color: var(--ink); }
.wdp-work-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.wdp-btn { border: 0; border-radius: 6px; background: var(--scratch-blue); color: #fff; font-weight: 700; font-size: 13px; padding: 7px 14px; cursor: pointer; }
.wdp-btn:hover { background: var(--scratch-blue-dark); }
.wdp-btn.is-ghost { background: none; color: var(--ink); border: 1px solid #d3d8e2; }
.wdp-btn.is-ghost:hover { background: var(--learn-bg); }
.wdp-btn.is-danger { background: var(--warn); }
.wdp-empty, .wdp-confirm-msg { padding: 20px 18px 6px; margin: 0; line-height: 1.7; }
.wdp-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 18px 18px; }
.wdp-modal-foot { margin: 0; padding: 0 18px 16px; font-size: 12px; color: var(--ink); }

.wdp-toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); max-width: min(560px, calc(100% - 32px)); background: var(--ink-strong); color: #fff; font: 700 13px/1.6 var(--font-body); padding: 10px 18px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; }
.wdp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.wdp-toast.is-warn { background: var(--warn); }

/* the course is vector-only; keep the bitmap button but tone it down */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- narrow screens: stack, editor scrolls inside itself ---------- */
@media (max-width: 960px) {
  body { overflow: auto; }
  .wdp-app { height: auto; min-height: 100%; grid-template-rows: auto auto; }
  .wdp-bar { flex-wrap: wrap; padding-block: 4px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .wdp-brand { border-right: 0; }
  .wdp-title-field input { width: 160px; }
  .wdp-main { grid-template-columns: minmax(0, 1fr); }
  .wdp-work-area { height: 640px; padding: 8px; }
  .wdp-learn { border-left: 0; border-top: 1px solid var(--scratch-line); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .wdp-pages { max-height: 80vh; }
  .wdp-editor > * { min-width: 680px; }
}
