/* 動く画面（トップの最上部）。Store の写真 1 の台紙（scripts/store/compose-shots.mjs の 1-hero）と同じ座標で、
   文書のウィンドウ（1320×900）とポップアウト（620×420）を HTML と CSS で描画する。
   .pdl-canvas は hero.webp と同じ 1804×1122 の範囲（台紙の左上から 368,52 の位置）で、live.js が表示する幅に合わせて縮小する。
   色と寸法は製品の CSS（src/styles/globals.css と各コンポーネントの *.module.css）の昼の値。文書は倍率 125% の値で記述する */
.pdl {
  position: relative;
  aspect-ratio: 1804 / 1122;
  --pdl-s: 1;
  --pdl-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pdl-code: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
.pdl *, .pdl *::before, .pdl *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* JavaScript が無効のときと図のデータが無いときに表示する写真 1 の画像（live.js が起動すると置き換える） */
.stage .pdl > img { display: block; width: 100%; height: auto; margin: 0; }
.pdl-canvas {
  position: absolute; left: 0; top: 0; width: 1804px; height: 1122px;
  transform-origin: 0 0; transform: scale(var(--pdl-s));
  font-family: var(--pdl-ui); font-size: 13px; line-height: 1.5; color: #37352f;
  text-align: left; letter-spacing: normal; user-select: none; pointer-events: none;
}
/* ウィンドウの影・角・縁（compose-shots.mjs の .shot と同じ値。縁は写真の外側に付く） */
.pdl-win {
  position: absolute; box-sizing: content-box !important; overflow: hidden; background: #fff;
  border: 1px solid #c9ced6; border-radius: 12px;
  box-shadow: 0 30px 70px rgba(15,30,60,.22), 0 4px 12px rgba(15,30,60,.12);
}
.pdl-main { left: 412px; top: 44px; width: 1320px; height: 900px; display: flex; flex-direction: column; }
.pdl-pop { left: 72px; top: 598px; width: 620px; height: 420px; display: flex; flex-direction: column; transition: opacity .16s ease, transform .16s ease; }
.pdl-pop[hidden] { display: flex; opacity: 0; transform: scale(.985); visibility: hidden; transition: opacity .16s ease, transform .16s ease, visibility 0s .16s; }

/* タイトルの行（タブ）。右端の 138px は Windows のボタン（最小化・最大化・閉じる） */
.pdl-title { position: relative; display: flex; flex: none; height: 40px; background: #fcfcfc; box-shadow: inset 0 -1px 0 #e0e0e0; padding-right: 138px; }
.pdl-ib { display: flex; align-items: center; justify-content: center; align-self: center; flex: none; width: 26px; height: 26px; margin: 0 2px; color: #5c5c5c; opacity: .85; }
.pdl-toggle { display: flex; align-items: center; align-self: stretch; flex: none; margin-left: -2px; padding: 0 2px; }
.pdl-toggle .pdl-ib { margin-top: 5px; color: #586069; opacity: 1; }
.pdl-gap { flex: 0 0 220px; }
.pdl-tabs { display: flex; align-items: flex-end; flex: 0 1 auto; min-width: 0; height: 40px; padding: 6px 6px 1px; gap: 2px; }
.pdl-tab { position: relative; display: flex; align-items: center; gap: 4px; flex: none; height: 33px; min-width: 100px; max-width: 200px; padding: 0 8px 0 14px; font-size: 13px; color: #5c5c5c; white-space: nowrap; border-radius: 8px 8px 0 0; }
.pdl-tab::before { content: ""; position: absolute; left: -1px; top: 50%; width: 1px; height: 16px; transform: translate(-50%, -50%); background: #d4d4d4; }
.pdl-tab.is-active::before, .pdl-tab.is-active + .pdl-tab::before { opacity: 0; }
.pdl-tab:has(+ .pdl-add)::after { content: ""; position: absolute; right: -2px; top: 50%; width: 1px; height: 16px; transform: translate(50%, -50%); background: #d4d4d4; }
.pdl-tab.is-active { color: #222; background: #fff; box-shadow: inset 0 1px 0 #e0e0e0, inset 1px 0 0 #e0e0e0, inset -1px 0 0 #e0e0e0, 0 1px 0 #fff; }
/* 未保存の表示（製品は U+26AB の文字。OS によって絵文字で表示されるため、同じ大きさの円で描画する） */
.pdl-dirty { display: inline-block; flex: none; width: 7.6px; height: 7.6px; border-radius: 50%; background: #ababab; }
.pdl-dirty[hidden] { display: none; }
.pdl-x { display: flex; align-items: center; justify-content: center; margin-left: auto; padding: 2px; font-size: 15px; line-height: 1; color: #5c5c5c; opacity: 0; }
.pdl-tab.is-active .pdl-x { opacity: .85; }
.pdl-add { margin-left: 2px; font-size: 17px; }
.pdl-grab { flex: 1 0 48px; }
.pdl-os { position: absolute; top: 0; right: 0; display: flex; }
.pdl-os span { display: flex; align-items: center; justify-content: center; width: 46px; color: #1a1a1a; }
.pdl-title .pdl-os span { height: 40px; }

/* メニューバー */
.pdl-menu { display: flex; align-items: stretch; flex: none; height: 30px; padding: 0 4px; background: #fff; border-bottom: 1px solid #eaeaea; font-size: 13px; }
.pdl-menu span { display: flex; align-items: center; padding: 0 9px; }

/* サイドバー（Explorer と Outline） */
.pdl-body { display: flex; flex: 1; min-height: 0; }
.pdl-side { display: flex; flex-direction: column; flex: none; width: 250px; background: #fafafa; border-right: 1px solid #eaeaea; overflow: hidden; }
.pdl-upper { flex: none; height: 484px; overflow: hidden; }
.pdl-switcher { display: flex; align-items: center; gap: 2px; padding: 6px 8px 4px; }
.pdl-switch { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 24px; border-radius: 4px; color: #586069; }
.pdl-switch.is-on { background: rgba(0,0,0,.08); }
.pdl-switch.is-trailing { margin-left: auto; width: 20px; opacity: .4; }
.pdl-node { display: flex; align-items: center; height: 26px; margin: 0 4px; padding-right: 8px; font-size: 13px; white-space: nowrap; border-radius: 4px; }
.pdl-node.is-selected { background: rgba(0,0,0,.08); }
.pdl-chev { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; color: #9b9a97; transform: rotate(90deg); }
.pdl-fi { display: inline-flex; align-items: center; flex: none; margin: 0 6px 0 18px; color: #586069; }
.pdl-children { position: relative; }
.pdl-children::before { content: ""; position: absolute; top: 0; bottom: 0; left: 21px; width: 1px; background: #eaeaea; }
.pdl-split { flex: none; height: 3px; border-top: 1px solid #eaeaea; }
.pdl-ohead { padding: 10px 14px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: #9b9a97; }
.pdl-oitem { position: relative; display: flex; align-items: center; height: 24px; margin: 0 4px; padding: 0 8px 0 26px; font-size: 12px; white-space: nowrap; }
.pdl-oitem.is-l1 { padding-left: 14px; }
.pdl-oitem.is-active::before { content: ""; position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 3px; height: 15px; border-radius: 2px; background: rgba(0,0,0,.2); }
.pdl-oitem[hidden] { display: none; }
.pdl-handle { flex: none; width: 3px; }
.pdl-node { padding-left: 8px; }
.pdl-children .pdl-node { padding-left: 24px; }

/* 文書（倍率 125%。本文 16px → 20px）。列の幅は 768px × 1.25。上端は Goals のリストの位置までスクロールした状態 */
.pdl-editor { position: relative; flex: 1; min-width: 0; overflow: hidden; background: #fff; }
.pdl-doc {
  position: absolute; left: 46px; top: 0; width: 960px; padding: 18px 37.5px 0;
  font-size: 20px; line-height: 1.5; color: #24292e; overflow-wrap: break-word; transition: opacity .2s ease;
}
.pdl .pdl-doc h2 { font-family: inherit; letter-spacing: normal; text-wrap: wrap; font-size: 30px; font-weight: 600; line-height: 1.25; border-bottom: 1px solid #e1e4e8; padding-bottom: 9px; margin: 30px 0 20px; }
.pdl .pdl-doc p { margin: 0 0 20px; }
.pdl-doc strong { font-weight: 600; }
.pdl .pdl-doc ul { padding-left: 40px; margin: 0 0 20px; list-style: disc; }
.pdl-doc li + li { margin-top: 5px; }
.pdl-doc sup { font-size: .75em; line-height: 0; color: #0366d6; }
.pdl-fig { margin: 0 0 20px; padding: 20px; min-height: 75px; }
.pdl .pdl-fig svg { display: block; max-width: none; margin: 0; }
.pdl-doc table { border-collapse: collapse; margin: 0 0 20px; }
.pdl-doc th, .pdl-doc td { border: 1px solid #dfe2e5; padding: 7.5px 16.25px; text-align: left; font-weight: 400; background: #fff; }
.pdl-doc th { background: #eaecef; font-weight: 600; }
.pdl-doc tr:nth-child(odd) td { background: #f6f8fa; }
.pdl-alert { border-left: 5px solid #8250df; margin: 0 0 20px; padding: 10px 20px; }
.pdl-alert-title { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-weight: 500; line-height: 1; color: #8250df; }
.pdl-alert-title svg { display: block; fill: #8250df; }
.pdl .pdl-alert p { margin: 0; }
.pdl-caret { display: inline-block; width: 0; height: 1.15em; margin: 0 -1px; border-left: 2px solid #24292e; vertical-align: text-bottom; animation: pdl-blink 1.06s steps(1) infinite; }
@keyframes pdl-blink { 50% { opacity: 0; } }
.pdl-scroll { position: absolute; top: 0; right: 0; bottom: 0; width: 15px; background: #fcfcfc; }
.pdl-scroll::before, .pdl-scroll::after { content: ""; position: absolute; left: 4px; border: 4px solid transparent; }
.pdl-scroll::before { top: 2px; border-bottom: 6px solid #8b8b8b; }
.pdl-scroll::after { bottom: 2px; border-top: 6px solid #8b8b8b; }
.pdl-thumb { position: absolute; left: 4px; top: 108px; width: 8px; height: 210px; border-radius: 4px; background: #8b8b8b; }

/* ステータスバー */
.pdl-status { display: flex; align-items: center; justify-content: flex-end; gap: 2px; flex: none; height: 24px; padding: 0 12px; background: #fafafa; border-top: 1px solid #eaeaea; color: #9b9a97; font-size: 11px; }
.pdl-status span { padding: 0 8px; white-space: nowrap; }
.pdl-status .pdl-lamp { display: flex; padding: 8px; }

/* ポップアウト（タイトルの行 28px・ソースの表示は 14px・行の高さ 1.4。色は GitHub Light） */
.pdl-band { position: relative; display: flex; align-items: center; justify-content: center; flex: none; height: 28px; background: #fff; font-size: 13px; font-weight: 600; }
.pdl-band .pdl-os span { height: 28px; }
.pdl-cm { flex: 1; min-height: 0; padding: 8px 0; background: #fff; color: #24292e; font-family: var(--pdl-code); font-size: 14px; line-height: 1.4; white-space: pre; overflow: hidden; }
.pdl-line { display: flex; }
.pdl-no { flex: none; min-width: 24px; padding: 0 3px 0 5px; text-align: right; color: rgba(27,31,35,.3); }
.pdl-code { flex: 1; padding: 0 2px 0 6px; }
.pdl-line.is-active .pdl-code { background: rgba(75,115,155,.05); }
.pdl-code .k { color: #d73a49; }
.pdl-code .p { color: #6f42c1; }
.pdl-code .n { color: #005cc5; }
.pdl-code .s { color: #032f62; }
.pdl-cm .pdl-caret { height: 1.25em; margin: 0 -.6px; border-left: 1.2px solid #000; vertical-align: top; animation-duration: 1.2s; }

/* 最初に戻る直前に、文書の内容とポップアウトを透明にする */
.pdl.is-resetting .pdl-doc, .pdl.is-resetting .pdl-pop { opacity: 0; }
/* 停止している間は、キャレットを点滅させない */
.pdl.is-paused .pdl-caret { animation: none; }

/* 停止と再開のボタン（文書のウィンドウの下、ポップアウトの右）。製品の画面には含まれない */
.pdl-ctl {
  position: absolute; left: calc(716px * var(--pdl-s)); top: calc(962px * var(--pdl-s)); z-index: 2;
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid #c9ced6; border-radius: 50%; background: #fff; color: #56606e; cursor: pointer;
}
.pdl-ctl:hover { color: #14171c; border-color: #56606e; }
.pdl-ctl:focus-visible { outline: 2px solid #2468d9; outline-offset: 2px; }
.pdl-ctl .pdl-play, .pdl-ctl[aria-pressed="true"] .pdl-pause { display: none; }
.pdl-ctl[aria-pressed="true"] .pdl-play { display: block; }
@media (prefers-reduced-motion: reduce) {
  .pdl-pop, .pdl-pop[hidden], .pdl-doc { transition: none; }
}
