/* 라미공방(개발). 화면은 work.js. 폰은 탭 둘(대화 · 미리 보기), 넓은 화면(900px부터)은 세 칸(작업 카드와 파일 · 대화 · 미리 보기). */
#wk{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;background:var(--wk-bg,#FAFBFD);padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}
.wk-top{display:flex;align-items:center;gap:.8rem;padding:.8rem 1.2rem;background:var(--paper);box-shadow:0 1px 0 var(--line);flex:none}
.wk-top b{font-size:1.6rem;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.wk-room{font-size:1.1rem;font-weight:600;color:var(--cobalt);background:var(--sky);padding:.2rem .8rem;border-radius:99px;flex:none}
.wk-sp{flex:1}
.wk-pane{flex:1;min-height:0;overflow-y:auto;padding:1.6rem 1.4rem 3rem;display:flex;flex-direction:column;gap:1rem;width:100%;max-width:72rem;margin:0 auto}
.wk-lead{font-size:1.35rem;color:var(--muted);line-height:1.55}
.wk-lead a{color:var(--cobalt)}
.wk-h{font-size:1.2rem;font-weight:700;color:var(--muted);margin-top:1.2rem}
.wk-new{display:flex;align-items:center;justify-content:center;gap:.8rem;min-height:5.6rem;border-radius:1.8rem;background:var(--navy);color:#fff;font-size:1.6rem}
.wk-new .i{filter:brightness(0) invert(1);width:2.2rem;height:2.2rem}
.wk-hint{font-size:1.25rem;color:var(--muted);line-height:1.5;margin-bottom:1rem}
.wk-hint a,.wk-url{color:var(--cobalt);word-break:break-all}
.wk-url{display:block;font-size:1.5rem;font-weight:600;margin-bottom:1.2rem}

/* 프로젝트 */
#wkProj{flex:1;min-height:0;display:flex;flex-direction:column}
.wk-tabs{display:flex;gap:.4rem;padding:.6rem 1.2rem;background:var(--paper);flex:none}
.wk-tabs button{flex:1;min-height:3.6rem;border-radius:1rem;font-size:1.35rem;font-weight:600;color:var(--muted)}
.wk-tabs button.on{background:var(--sky);color:var(--navy)}
#wkSide{display:none}
#wkChat,#wkView{flex:1;min-height:0;display:none;flex-direction:column}
#wkProj[data-wt=chat] #wkChat,#wkProj[data-wt=view] #wkView{display:flex}
#wkBar{display:flex;align-items:center;gap:.8rem;margin:.8rem 1.2rem 0;padding:.8rem 1.2rem;border-radius:1.2rem;background:var(--sky);font-size:1.25rem;text-align:left;flex:none}
#wkBar span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
#wkBar small{color:var(--muted);flex:none}
.wk-spin{width:1.4rem;height:1.4rem;border-radius:50%;border:.2rem solid var(--rb);border-top-color:var(--cobalt);animation:wkSpin .8s linear infinite;flex:none}
@keyframes wkSpin{to{transform:rotate(360deg)}}
#wkFeed{flex:1;min-height:0;overflow-y:auto;padding:1.2rem 1.2rem 1.6rem;display:flex;flex-direction:column;gap:.8rem}
.wk-me,.wk-pm{max-width:min(86%,54rem);padding:.9rem 1.3rem;border-radius:1.8rem;font-size:1.45rem;line-height:1.5}
.wk-me{align-self:flex-end;background:var(--cobalt);color:#fff;border-bottom-right-radius:.5rem}
.wk-pm{align-self:flex-start;background:var(--paper);box-shadow:inset 0 0 0 1px var(--line);border-bottom-left-radius:.5rem}
.wk-ev{align-self:center;max-width:92%;font-size:1.15rem;color:var(--muted);text-align:center;padding:.2rem .8rem}
.wk-ev small{display:block;font-size:1.1rem;opacity:.85;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.wk-verb{text-decoration:underline;text-underline-offset:.3rem}
.wk-dots::after{content:"…";animation:wkBlink 1.2s steps(3) infinite}
@keyframes wkBlink{50%{opacity:.2}}
.wk-hello{margin:auto;text-align:center;color:var(--muted);font-size:1.4rem;line-height:1.6}
.wk-hello .rami{display:block;width:9rem;height:9rem;margin:0 auto 1rem}
.wk-hello img{width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply}
.wk-card{align-self:stretch;max-width:60rem;padding:1.4rem;border-radius:1.8rem;background:var(--paper);box-shadow:inset 0 0 0 1px var(--rb);font-size:1.35rem;line-height:1.5;display:flex;flex-direction:column;gap:.6rem}
.wk-card>small{font-size:1.1rem;font-weight:700;color:var(--cobalt)}
.wk-card>b{font-size:1.6rem}
.wk-card h4{font-size:1.15rem;color:var(--muted);margin-top:.6rem}
.wk-card ul,.wk-card ol{padding-left:1.8rem;display:flex;flex-direction:column;gap:.3rem}
.wk-card li b{font-weight:600}
.wk-tags{display:flex;flex-wrap:wrap;gap:.4rem}
.wk-tags span{font-size:1.1rem;padding:.2rem .8rem;border-radius:99px;background:var(--sky)}
.wk-acts{display:flex;flex-wrap:wrap;gap:.6rem;margin-top:.8rem}
.wk-opts{display:flex;flex-direction:column;gap:.6rem;margin-top:.4rem}
.wk-opts>div{display:flex;gap:.6rem;align-items:center}
.wk-opts .chip:first-child{white-space:normal;text-align:left}
.wk-in{display:flex;padding:.8rem 1.2rem 1.2rem;flex:none}
.wk-in{gap:.6rem;align-items:flex-end}
.wk-photo::before,.wk-photo::after{display:none}
.wk-photo{background:rgba(118,128,140,.16) url(ic/cam.webp) center/1.9rem no-repeat}
.wk-in textarea{flex:1;min-width:0;border:0;outline:0;resize:none;background:none;font:inherit;font-size:1.5rem;line-height:1.4;padding:.9rem 0;max-height:16rem;color:inherit}
.wk-vbar{display:flex;align-items:center;gap:.6rem;padding:.8rem 1.2rem;flex:none;font-size:1.2rem;color:var(--muted)}
.wk-vbar select{font:inherit;font-size:1.2rem;padding:.5rem .8rem;border-radius:99px;border:0;background:var(--paper);box-shadow:inset 0 0 0 1px var(--line);max-width:14rem;color:var(--navy)}
.wk-stage{flex:1;min-height:0;position:relative;display:flex;justify-content:center;background:var(--wk-stage,#E9EEF4)}
#wkFrame,#wkLive{width:100%;height:100%;border:0;background:#fff}
#wkEmpty{margin:auto;text-align:center;color:var(--muted);font-size:1.35rem;line-height:1.6}
.wk-code{font:1.15rem/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;word-break:break-all;background:var(--sky);padding:1.2rem;border-radius:1.2rem;max-height:60vh;overflow:auto;user-select:text}
.wk-issues{padding:1rem 1.2rem;border-radius:1.2rem;background:#FDF1EE;color:var(--bad);font-size:1.25rem;line-height:1.5;margin-bottom:1rem;display:flex;flex-direction:column;gap:.4rem}
.wk-slug{display:flex;align-items:center;gap:.2rem;padding:0 1.4rem;min-height:4.8rem;border-radius:1.4rem;background:var(--sky);font-size:1.4rem;margin-bottom:1.2rem}
.wk-slug span{color:var(--muted);flex:none}
.wk-slug input{flex:1;min-width:0;font-weight:600;outline:0}

/* 스킬 선반 */
.wk-chips{display:flex;gap:.6rem;overflow-x:auto;padding-bottom:.4rem;scrollbar-width:none;flex:none}
.wk-shelf{display:grid;grid-template-columns:repeat(auto-fill,minmax(24rem,1fr));gap:1rem}
.wk-skill{padding:1.4rem;border-radius:1.8rem;background:var(--paper);box-shadow:inset 0 0 0 1px var(--line);display:flex;flex-direction:column;gap:.4rem;font-size:1.3rem;line-height:1.5}
.wk-skill>small{font-size:1.1rem;font-weight:700;color:var(--cobalt)}
.wk-skill>b{font-size:1.5rem}
.wk-skill.off{background:none;box-shadow:inset 0 0 0 1px var(--line);opacity:.75}
.wk-skill.off>small{color:var(--muted)}
.wk-saying{color:var(--muted)}
.wk-src{font-size:1.1rem;color:var(--muted);word-break:break-all}
.wk-src a{color:inherit}

/* 넓은 화면: 세 칸 */
@media (min-width:900px){
  .wk-tabs{display:none}
  #wkProj{display:grid;grid-template-columns:24rem minmax(30rem,1fr) minmax(0,1.25fr);grid-template-rows:minmax(0,1fr)}
  #wkProj[hidden]{display:none}
  #wkSide{display:flex;flex-direction:column;gap:.6rem;overflow-y:auto;padding:1.2rem;background:var(--paper);box-shadow:1px 0 0 var(--line)}
  #wkProj #wkChat,#wkProj #wkView{display:flex}
  #wkView{box-shadow:-1px 0 0 var(--line)}
  .wk-task{padding:.8rem 1rem;border-radius:1rem;background:var(--sky);font-size:1.1rem;line-height:1.45}
  .wk-task b{display:block;font-size:1.2rem}
  .wk-task small{color:var(--muted)}
  .wk-task p{margin-top:.3rem;color:var(--muted);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .wk-task.doing{box-shadow:inset 0 0 0 .15rem var(--cobalt)}
  .wk-task.fail{opacity:.6}
  .wk-dim{font-size:1.1rem;color:var(--muted)}
  .wk-files{display:flex;flex-direction:column}
  .wk-files button{text-align:left;font-size:1.15rem;padding:.45rem .6rem;border-radius:.6rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .wk-files button:hover{background:var(--sky)}
  #wkFrame,#wkLive{width:390px;max-width:100%;box-shadow:0 0 0 1px var(--line)}
  #wkFrame.wide,#wkLive.wide{width:100%}
  #wkBar{display:none}
}

/* 자료함의 한 건 */
.wk-row>span{display:flex;flex-direction:column;gap:.2rem}
.wk-row small b{display:inline;font-weight:600;color:var(--navy)}
.wk-row.off{opacity:.55}

.wk-meet summary{cursor:pointer;font-weight:700}

/* 공방 홈: 시작 카드, 만드는 차례, 빈 프로젝트 */
.wk-big,.wk-ask{display:none}
/* 폰: 왼쪽 칸과 아래 칸을 풀어서(contents) 차례를 다시 놓는다: 안내 → 새로 만들기 → 시작 카드 → 내 프로젝트·스킬 → 만드는 차례 */
.wk-hm{display:flex;flex-direction:column;gap:1rem}
.wk-hl,.wk-hs{display:contents}
.wk-hl>*{order:3}
.wk-hl>.wk-new{order:1}
.wk-hs>*{order:4}
.wk-hs>:nth-child(-n+3){order:2}
.wk-dimline{font-size:1.2rem;color:var(--muted);line-height:1.5}
.wk-starts{display:grid;grid-template-columns:repeat(auto-fill,minmax(15rem,1fr));gap:.8rem}
.wk-start{display:flex;flex-direction:column;align-items:flex-start;gap:.3rem;text-align:left;padding:1.2rem;border-radius:1.6rem;background:var(--paper);box-shadow:inset 0 0 0 1px var(--line)}
.wk-start:hover{box-shadow:inset 0 0 0 .15rem var(--cobalt)}
.wk-start small{font-size:1.05rem;font-weight:700;color:var(--cobalt)}
.wk-start b{font-size:1.45rem}
.wk-start span{font-size:1.2rem;color:var(--muted)}
.wk-start em{font-style:normal;font-size:1.1rem;color:var(--muted);margin-top:.3rem}
.wk-steps{list-style:none;display:flex;flex-wrap:wrap;gap:.6rem;padding:0}
.wk-steps li{display:flex;flex-direction:column;gap:.1rem;padding:.7rem 1.2rem;border-radius:1.2rem;background:var(--paper);box-shadow:inset 0 0 0 1px var(--line);opacity:.6}
.wk-steps li.ok{opacity:1;box-shadow:inset 0 0 0 .15rem var(--cobalt)}
.wk-steps b{font-size:1.3rem}
.wk-steps small{font-size:1.05rem;color:var(--muted)}
.wk-blank{opacity:.6;cursor:pointer}
.wk-next{margin-top:0}
.wk-stat,.wk-rtabs,#wkPaneR{display:none}

/* 넓은 화면: 홈은 작업대(왼쪽 프로젝트 · 가운데 글 쓰는 칸), 프로젝트는 위쪽 상태 줄과 오른쪽 칸의 탭 */
@media (min-width:900px){
  #wkHome{max-width:none;display:grid;grid-template-columns:30rem minmax(0,1fr);grid-template-rows:auto 1fr;gap:0;padding:0;overflow:hidden}
  #wkHome[hidden]{display:none}
  .wk-hl,.wk-hs{display:flex;flex-direction:column;gap:1rem}
  .wk-starts{grid-template-columns:repeat(3,minmax(0,1fr))}
  .wk-hl{grid-column:1;grid-row:1/3;overflow-y:auto;padding:1.6rem 1.4rem;background:var(--paper);box-shadow:1px 0 0 var(--line)}
  .wk-hm{grid-column:2;grid-row:1;padding:4rem 4rem 1rem;max-width:92rem;width:100%;margin:0 auto}
  .wk-hs{grid-column:2;grid-row:2;overflow-y:auto;padding:1rem 4rem 4rem;max-width:92rem;width:100%;margin:0 auto}
  .wk-big{display:block;font-size:3rem;font-weight:800;letter-spacing:-.02em}
  .wk-ask{display:block}
  .wk-ask textarea{flex:1;min-width:0;min-height:8rem;border:0;outline:0;resize:none;background:none;font:inherit;font-size:1.5rem;line-height:1.4;padding:.9rem 0;color:inherit}
  .wk-hl .wk-new{min-height:4.6rem;font-size:1.4rem}
  .wk-stat{display:flex;align-items:center;gap:1rem;font-size:1.2rem;color:var(--muted);min-width:0;margin-left:.6rem;flex:1}
  .wk-stat[hidden]{display:none}
  .wk-stat:not([hidden])+.wk-sp{display:none}
  .wk-stat .wk-now{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--navy)}
  .wk-stat>button:not(.chip){font-size:1.2rem;color:var(--muted);padding:.3rem .6rem;border-radius:.6rem;white-space:nowrap}
  .wk-stat>button:not(.chip):hover{background:var(--sky)}
  .wk-stat>span{white-space:nowrap}
  .wk-dot{width:.9rem;height:.9rem;border-radius:50%;background:var(--line);flex:none}
  .wk-dot.run{background:var(--cobalt);animation:wkblink 1s infinite}
  .wk-dot.ask{background:#E0A100}
  @keyframes wkblink{50%{opacity:.3}}
  .wk-rtabs{display:flex;gap:.2rem;padding:.6rem 1.2rem 0;flex:none}
  .wk-rtabs button{padding:.6rem 1.2rem;border-radius:.8rem .8rem 0 0;font-size:1.25rem;font-weight:600;color:var(--muted)}
  .wk-rtabs button.on{background:var(--sky);color:var(--navy)}
  #wkView:not([data-wr=view]) .wk-vbar,#wkView:not([data-wr=view]) .wk-stage{display:none}
  #wkView:not([data-wr=view]) #wkPaneR{display:flex;flex-direction:column;gap:.8rem;flex:1;min-height:0;overflow:auto;padding:1.2rem;background:var(--paper)}
  #wkView .wk-vbar .chip.on[data-wk=pub]{display:none}
  .wk-phead{display:flex;align-items:center;gap:1rem;flex:none;font-size:1.2rem;color:var(--muted)}
  .wk-phead select{font:inherit;padding:.5rem .8rem;border-radius:.8rem;border:0;box-shadow:inset 0 0 0 1px var(--line);background:var(--paper);color:var(--navy);max-width:28rem}
  .wk-phead b{font-size:1.4rem;color:var(--navy)}
  .wk-lines{font:1.15rem/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre;overflow:auto;flex:1;min-height:0;background:var(--wk-code,#F4F6FA);border-radius:1rem;padding:1rem 0;counter-reset:ln;user-select:text}
  .wk-lines span{display:block;padding:0 1.2rem 0 0;counter-increment:ln}
  .wk-lines span::before{content:counter(ln);display:inline-block;width:4.2rem;margin-right:1.2rem;text-align:right;color:var(--wk-ln,#A3ADBD);user-select:none}
  .wk-doc{font-size:1.35rem;line-height:1.6;max-width:72rem;user-select:text}
  .wk-doc h3{font-size:2rem;margin-bottom:.8rem}
  .wk-doc h4{font-size:1.5rem;margin:1.6rem 0 .5rem}
  .wk-doc h5{font-size:1.3rem;margin:1rem 0 .3rem;color:var(--cobalt)}
  .wk-doc p{margin:.3rem 0}
  .wk-doc p.li{padding-left:1.2rem}
}

/* 개발 건: 왼쪽 칸과 대화의 건 목록 */
.wk-items{display:flex;flex-direction:column;gap:.4rem}
.wk-item{display:flex;gap:.7rem;align-items:flex-start;padding:.7rem .9rem;border-radius:1rem;font-size:1.2rem;line-height:1.4}
.wk-item i{font-style:normal;flex:none;width:1.6rem;text-align:center;color:var(--muted)}
.wk-item b{display:block;font-weight:600}
.wk-item small{display:block;color:var(--muted);font-size:1.1rem}
.wk-item.todo,.wk-item.later{opacity:.6}
.wk-item.doing,.wk-item.show{background:var(--sky);box-shadow:inset 0 0 0 .15rem var(--cobalt)}
.wk-item.doing i,.wk-item.show i,.wk-item.done i{color:var(--cobalt)}
.wk-h small{font-weight:600;color:var(--cobalt);margin-left:.4rem}
.wk-itemline{align-self:stretch;text-align:center;border-top:1px solid var(--line);padding-top:.8rem;margin-top:.4rem}

/* 어두운 화면(PC에서만, html.dark): 대화 칸(#talk)과 같은 방식으로 색 변수를 어두운 값으로 다시 정한다(값은 desk.css와 같다).
   #wk는 #app 아래의 div라서 desk.css의 어느 규칙에도 걸리지 않았다(세 칸의 변수 범위 밖이고, 통째로 뒤집는 section도 아니다). 그래서 어두운 화면에서도 밝게 열렸다.
   미리 보기 틀(#wkFrame, #wkLive)은 손님이 만든 사이트라 본래 빛깔 그대로 둔다. 창(시트)은 desk.css가 다룬다. */
@media (min-width:900px){
  html.dark #wk{--paper:#0F1217;--sky:#171B22;--line:#272D38;--navy:#E8EDF4;--muted:#8F9BAB;--soft:#566273;--rb:#394355;--cobalt:#7DA2FF;--bad:#FF8273;--ink:#0B0D11;--lit:#DCE5F0;
    --wk-bg:#171B22;--wk-stage:#0B0D11;--wk-code:#0F1217;--wk-ln:#566273;color:var(--navy);color-scheme:dark}
  /* 손그림 아이콘이 든 둥근 버튼과 라미 그림: 밝은 바탕 */
  html.dark #wk .rb{background:var(--lit);box-shadow:none}
  html.dark #wk .rami{background:#fff;border-radius:50%}
  /* 칸 위에 얹히는 것들: 한 단 밝은 회색 */
  html.dark #wk :is(.rowi,.wk-task,.wk-start,.wk-steps li,.wk-card,.wk-pm,.cmp,.wk-item.doing,.wk-item.show){background:#1C212A}
  html.dark #wk :is(.wk-rtabs button.on,.wk-tabs button.on,.wk-room,.wk-files button:hover,.wk-stat>button:not(.chip):hover){background:#242B37;color:var(--navy)}
  html.dark #wk .wk-room{color:var(--cobalt)}
  /* 칩: 고르지 않은 것은 어둡게, 고른 것과 큰 단추는 밝은 바탕에 어두운 글 */
  html.dark #wk .chip{background:#1C212A;color:var(--navy);box-shadow:inset 0 0 0 1px var(--line)}
  html.dark #wk :is(.chip.on,.wk-new){background:var(--lit);color:#10141A;box-shadow:none}
  html.dark #wk .wk-new .i{filter:none}
  /* 내 말과 보내기 단추는 라미의 파랑 */
  html.dark #wk :is(.wk-me,.cmp-go){background:#2F6BFF;color:#fff}
}
