/* Story → Story workshop (workshop.js) */
#wkpage .wkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#wkpage .wkbar h1 { margin: 0; }
#wkpage #wktitle { width: 260px; max-width: 100%; }
.wkcols { display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; gap: 14px; margin-top: 12px; align-items: start; }
.wklines, .wkside { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.wklines { display: flex; flex-direction: column; max-height: calc(100vh - 210px); position: sticky; top: 10px; }
.wkhead { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.wklist { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.wkline { display: flex; flex-direction: column; align-items: stretch; gap: 3px; text-align: left; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line); }
.wkline.on { border-color: var(--gold); }
.wkrow { display: flex; align-items: center; gap: 7px; }
.wkrow em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 12px; }
.wkdot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c); }
.wkmeta { font-size: 12px; color: var(--muted); }
.wkmeta:empty { display: none; }
.wktxt { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wktxt i { color: var(--muted); }

.wkmid { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.wkstage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #000; border: 1px solid var(--line); --k: .3; }
.wkstage .wkbg, .wkstage .wkcg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.wkstage .wkcg { background-size: contain; background-repeat: no-repeat; background-color: #000; z-index: 2; }
.wkstage .wkchars { position: absolute; inset: 0; z-index: 1; }
.wkstage .stchar { position: absolute; bottom: 0; width: 0; height: 0; }
.wkstage .stin { position: absolute; left: 0; bottom: 0; width: 0; height: 0; transform-origin: 0 0; }
.wkstage .stchar img { display: block; max-width: none; pointer-events: none; }
.wkstage .stchar .rlay { position: absolute; }
.wkstage .stchar.rdim img { filter: brightness(.45); }
.wkstage .wkbox { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; min-height: 26%; box-sizing: border-box; padding: 2% 4%; background: rgba(8, 7, 8, .86); border-top: 2px solid var(--gold); }
.wkstage .wkbox b { display: inline-block; margin-bottom: 4px; padding: 1px 10px; border-left: 4px solid var(--c); font-size: clamp(13px, 1.6vw, 18px); }
.wkstage .wkbox p { margin: 0; font-size: clamp(13px, 1.4vw, 17px); line-height: 1.45; white-space: pre-wrap; }
.wkstage .wkbox p.narr { font-style: italic; color: #d9cfc2; }
.wkstage .wkfxtag { position: absolute; left: 10px; top: 8px; z-index: 5; display: flex; gap: 6px; }
.wkstage .wkfxtag span { padding: 2px 8px; border-radius: 3px; background: var(--gold); color: #121012; font-size: 12px; font-weight: 600; }
.wknav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wknav button[data-a=prev], .wknav button[data-a=next] { min-width: 44px; min-height: 40px; font-size: 18px; }
.wkmeter { font-size: 13px; color: var(--muted); }
.wkmeter i { display: block; height: 6px; margin-top: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.wkmeter b { display: block; height: 100%; width: 0; background: var(--add); }
.wkmeter b.over { background: var(--rem); }

.wkside { padding: 12px; display: flex; flex-direction: column; gap: 14px; }
.wkhd { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wkhd b { font-size: 16px; }
.wkf { display: flex; flex-direction: column; gap: 6px; }
.wkl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.wkf textarea { width: 100%; box-sizing: border-box; resize: vertical; line-height: 1.45; }
.wkf select, .wkf input { width: 100%; box-sizing: border-box; }
.wkwho { display: flex; gap: 6px; }
.wkwho .wkwhobtn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; }
.wkwho .wkwhobtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#wkpage button.on, #wkpick button.on { border-color: var(--gold); color: #f1d98a; background: #3a3020; }
.wkpor { width: 34px; height: 34px; flex: none; object-fit: cover; object-position: top; border-radius: 4px; background: var(--panel2); display: inline-flex; align-items: center; justify-content: center; font-style: normal; color: var(--muted); }
.wkfaces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.wkfaces button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; min-height: 44px; }
.wkfaces img { width: 100%; height: 44px; object-fit: contain; }
.wkfaces span { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wkplaces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.wkplaces button, .wkfx button { min-height: 40px; padding: 4px 6px; font-size: 13px; }
.wkset { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.wkset .wkl { grid-column: 1 / -1; }
.wknow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.wkbtns { display: flex; gap: 4px; }
.wkbtns button { padding: 4px 8px; font-size: 12px; }
.wkfx { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.wkshare { display: flex; gap: 8px; }
.wkshare input { flex: 1; min-width: 0; font-family: Consolas, monospace; font-size: 12px; }

#wkpick { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.wkpbox { width: min(1200px, 100%); height: min(860px, 100%); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.wkphead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.wkphead h2 { margin: 0; flex: 1 1 auto; }
.wkphead input { width: 240px; max-width: 100%; }
.wkphead button[data-a=x] { min-width: 44px; min-height: 40px; font-size: 20px; }
.wkpbody { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px; }
.wkpgrid { display: grid; gap: 8px; }
.wkpgrid.people { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.wkpgrid.pics { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.wkpgrid button { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 6px; text-align: left; min-width: 0; }
.wkpgrid.people .wkpor { width: 100%; height: 110px; font-size: 32px; }
.wkpgrid.pics img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
.wkpgrid b, .wkpgrid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wkpgrid span { font-size: 12px; color: var(--muted); }
.wkplist { display: flex; flex-direction: column; gap: 4px; }
.wkprow { display: flex; align-items: center; gap: 10px; padding: 4px 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; }
.wkprow b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.wkprow .sndplay { width: 40px; height: 40px; }
.wkpmore { text-align: center; padding: 12px; }

.wkcover { max-width: 900px; margin: 0 auto; }
.wkctext { margin-top: 14px; text-align: center; }
.wkctext h1 { margin: 6px 0; }
.wkcbtns { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.wkcbtns .primary { min-height: 48px; padding: 0 28px; font-size: 17px; }

@media (max-width: 1200px) { .wkcols { grid-template-columns: 260px minmax(0, 1fr); } .wkside { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  .wkcols { grid-template-columns: minmax(0, 1fr); }
  .wkmid { order: -1; }
  .wklines { position: static; max-height: 46vh; }
  .wkplaces { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wkpgrid.pics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wkpgrid.people { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #wkpick { padding: 0; }
  .wkpbox { height: 100%; border-radius: 0; }
}
.wkfaces > .muted { grid-column: 1 / -1; font-size: 13px; }
