/* ctf.kspark.kr — 포털 term.css 위에 얹는 화면 전용 규칙 */
.login-win { width: 100%; max-width: 420px; }
.login-win .auth form { padding: 24px; }

.cols { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 120px; padding: 20px 16px; border: 1px dashed var(--line); border-radius: 8px; background: var(--well); text-align: center; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--green); }
.drop:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
textarea { width: 100%; min-height: 80px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; background: var(--well); padding: 10px 14px; font: inherit; color: var(--bright); caret-color: var(--green); }
#form-new .btn { align-self: flex-start; }
#picked li { padding: 6px 0; font-size: 13px; }
#picked .rm { width: 32px; height: 32px; border: 0; background: transparent; color: var(--dim); cursor: pointer; }
#picked .rm:hover { color: var(--red); }

.chal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.chal-list button { width: 100%; display: grid; grid-template-columns: 72px minmax(0, 1fr); column-gap: 10px; row-gap: 2px; padding: 10px 8px; border: 0; border-top: 1px solid var(--line-soft); background: transparent; text-align: left; cursor: pointer; border-radius: 4px; }
.chal-list li:first-child button { border-top-color: transparent; }
.chal-list button:hover, .chal-list button[aria-current="true"] { background: #1e2a40; }
.chal-list .name { color: var(--bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chal-list .meta { grid-column: 2; color: var(--dim); font-size: 12px; }

.cat { display: inline-block; min-width: 64px; text-align: center; font-size: 12px; font-weight: 700; line-height: 22px; height: 22px; padding: 0 6px; border-radius: 3px; color: #0b1222; background: var(--dim); }
.cat.web { background: var(--blue); } .cat.crypto { background: var(--amber); } .cat.rev { background: var(--cyan); }
.cat.pwn { background: var(--red); } .cat.forensic { background: var(--green); }
.cat.none { background: transparent; color: var(--dim); border: 1px dashed var(--line); line-height: 20px; }

.kv { display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: 12px; row-gap: 6px; }
.kv dt { color: var(--dim); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.kv .ev { display: block; color: var(--dim); font-size: 12px; }
.sub { margin: 6px 0 0; font-size: 12px; font-weight: 600; color: var(--bright); }
.sub span { color: var(--dim); font-weight: 400; }
table.log td.num { text-align: right; white-space: nowrap; }
select { height: 30px; border: 1px solid var(--line); border-radius: 4px; background: var(--well); color: var(--bright); font: inherit; font-size: 13px; padding: 0 6px; }

@media (max-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .wrap { padding: 16px 16px 32px; }
}

/* ---------- 탭·활동·스킬 ---------- */
.tabs .badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--amber); color: #0b1222; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.tabs .hd.on { animation: ks-blink 1.6s steps(1) infinite; }
.askbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 16px; background: var(--warn-bg); border-bottom: 1px solid var(--amber); color: var(--bright); }
.askbar button { height: 30px; padding: 0 12px; border: 1px solid var(--amber); border-radius: 4px; background: transparent; color: var(--amber); cursor: pointer; }
.ask { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--amber); border-radius: 8px; background: var(--warn-bg); }
.ask .q { color: var(--bright); white-space: pre-wrap; overflow-wrap: anywhere; }
.ask .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ask .opts button { min-height: 40px; padding: 0 16px; border: 1px solid var(--amber); border-radius: 4px; background: transparent; color: var(--amber); font-weight: 700; cursor: pointer; }
.ask .opts button:hover { background: var(--amber); color: #0b1222; }
.ask form { display: flex; gap: 8px; }
.ask form input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 4px; background: var(--well); padding: 0 12px; font: inherit; color: var(--bright); }
.ask form button { height: 40px; padding: 0 14px; border: 0; border-radius: 4px; background: var(--amber); color: #0b1222; font-weight: 700; cursor: pointer; }
.dir-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dir-row .btn { margin-left: auto; height: 40px; font-size: 14px; }
#dirs li { align-items: flex-start; font-size: 13px; }
.st { flex: none; min-width: 56px; text-align: center; font-size: 12px; line-height: 20px; border-radius: 3px; border: 1px solid var(--line); color: var(--dim); }
.st.working { color: var(--amber); border-color: var(--amber); } .st.done { color: var(--green); border-color: var(--green); } .st.seen { color: var(--blue); border-color: var(--blue); }
.agents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.agents button { width: 100%; display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 8px; row-gap: 2px; padding: 10px 8px; border: 0; border-top: 1px solid var(--line-soft); background: transparent; text-align: left; cursor: pointer; border-radius: 4px; }
.agents li:first-child button { border-top-color: transparent; }
.agents button:hover, .agents button[aria-pressed="true"] { background: #1e2a40; }
.agents .led { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--line); }
.agents .led.run { background: var(--green); animation: ks-blink 1.6s steps(1) infinite; }
.agents .nm { color: var(--bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agents .sub { grid-column: 2; margin: 0; color: var(--dim); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 70vh; overflow-y: auto; font-size: 13px; }
.feed li { display: grid; grid-template-columns: 62px 96px minmax(0, 1fr); column-gap: 10px; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.feed li:first-child { border-top: 0; }
.feed .t { color: var(--faint); } .feed .who { color: var(--cyan); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .who.main { color: var(--green); } .feed .who.user { color: var(--amber); } .feed .who.system { color: var(--red); }
.feed .tx { overflow-wrap: anywhere; } .feed .tool { color: var(--blue); }
.feed li.k-directive .tx, .feed li.k-answer .tx { color: var(--bright); }
.feed li.k-ask, .feed li.k-handoff { background: var(--warn-bg); margin: 0 -8px; padding: 5px 8px; border-radius: 4px; }
.notice { padding: 10px 14px; border: 1px solid var(--amber); border-radius: 8px; background: var(--warn-bg); color: var(--bright); }
.notice .d { display: block; color: var(--dim); font-size: 13px; }
#skills td { vertical-align: top; } #skills .desc { color: var(--dim); min-width: 260px; }
@media (max-width: 900px) { .feed li { grid-template-columns: 64px minmax(0, 1fr); } .feed .who { grid-column: 2; } .feed .tx { grid-column: 2; } .feed { max-height: none; } }
/* 좁은 화면: 탭이 줄어들며 옆으로 밀리고, 오른쪽 묶음이 탭을 덮지 않게 한다 */
.topbar { flex-wrap: nowrap; }
.topbar .tabs { flex: 1 1 0; min-width: 0; }
.topbar .right { flex: none; }
@media (max-width: 600px) { #count { display: none; } }
.agent-opts { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.agent-opts select { height: 26px; font-size: 12px; min-width: 0; width: 100%; }
.agent-opts .opts-end { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.card-actions .btn-sm { display: inline-flex; align-items: center; min-height: 36px; }
pre.doc { margin: 0; padding: 12px 14px; max-height: 420px; overflow: auto; background: var(--well); border: 1px solid var(--line-soft); border-radius: 8px; font: inherit; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.new-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-actions .btn { height: 36px; font-size: 14px; }
pre.more { margin: 4px 0 0; padding: 6px 10px; background: var(--well); border-left: 2px solid var(--line); border-radius: 4px; font: inherit; font-size: 12px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 4.9em; overflow: hidden; cursor: pointer; }
pre.more.open { max-height: none; }
pre.more.out { color: var(--dim); border-left-color: var(--line-soft); }
.feed li.k-error pre.more { color: var(--red); }
.feed-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; padding: 4px 0; }
.feed-tools select { height: 26px; font-size: 12px; max-width: 180px; }
.kv dd .btn-sm { height: 24px; font-size: 12px; margin-left: 6px; }
.feed { max-height: none; overflow: visible; }
pre.more.out { max-height: 1.7em; }                 /* 결과는 한 줄만, 누르면 펼친다 */
pre.more.out.open { max-height: none; }
pre.more.out.bad { color: var(--red); max-height: 3.3em; }
#feed-more { align-self: center; height: 36px; padding: 0 16px; }
#dirs .rep { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--dim); cursor: pointer; }
#dirs .rep.open { display: block; }
.topbar .right .chip { height: 36px; padding: 0 12px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--dim); cursor: pointer; white-space: nowrap; }
.ubars { grid-template-columns: minmax(56px, max-content) minmax(0, 1fr) max-content; }
.ubars > span:nth-child(3n) { text-align: right; color: var(--bright); }
.ubars .utitle { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
#usage-dlg, #pc-dlg { position: fixed; left: auto; margin: 0; z-index: 60; width: min(380px, calc(100vw - 16px)); padding: 0; border: 0; background: transparent; color: inherit; overflow: visible; }
#usage-dlg .pane, #pc-dlg .pane { max-height: calc(100dvh - 60px); box-shadow: 0 12px 32px rgba(0, 0, 0, .55); border-color: #475569; } #usage-dlg .pane-body, #pc-dlg .pane-body { overflow-y: auto; }
.flagbox { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 8px 6px 12px; border: 1px solid var(--green); border-radius: 6px; background: var(--well); }
.flagbox code { font: inherit; color: var(--green); font-weight: 700; overflow-wrap: anywhere; user-select: all; }
.flagbox .btn-sm { margin: 0; height: 28px; flex: none; }
.wu-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wu-actions .btn-sm { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; }
.md { font-family: var(--sans); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.md h3, .md h4, .md h5, .md h6 { margin: 18px 0 6px; font-family: var(--mono); color: var(--bright); }
.md h3 { font-size: 17px; } .md h4 { font-size: 15px; color: var(--cyan); } .md h5, .md h6 { font-size: 14px; }
.md p { margin: 6px 0; } .md ul, .md ol { margin: 6px 0; padding-left: 22px; }
.md code { font-family: var(--mono); font-size: 13px; background: var(--well); border: 1px solid var(--line-soft); border-radius: 3px; padding: 0 4px; }
.md pre.code { font-family: var(--mono); margin: 8px 0; max-height: 520px; }
.md .fm { font-family: var(--mono); font-size: 13px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 6px; }
.agents button.done { opacity: .6; }
.agents button.toggle { display: block; padding: 10px 8px; color: var(--dim); font-size: 12px; }
.agents button.toggle:hover { color: var(--bright); }
.notice .retry-note { display: block; width: 100%; height: 36px; margin: 8px 0; border: 1px solid var(--line); border-radius: 4px; background: var(--well); padding: 0 10px; font: inherit; font-size: 13px; color: var(--bright); }
.notice .retry-row { display: flex; flex-wrap: wrap; gap: 8px; }
.notice .retry-row .btn-sm { min-height: 32px; border-color: var(--amber); color: var(--amber); }
.chal-list .also { margin-right: 6px; font-size: 11px; color: var(--amber); }
.cat.misc { background: var(--dim); }
.ask-go { height: 28px; padding: 0 10px; border: 1px solid var(--amber); border-radius: 4px; background: transparent; color: var(--amber); cursor: pointer; font-size: 12px; }
.ask-others { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.chal-list .wait { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 3px; background: var(--amber); color: #0b1222; font-size: 11px; font-weight: 700; line-height: 18px; vertical-align: 1px; }
#card .ask { margin-bottom: 4px; }
.feed li.k-model { background: var(--warn-bg); margin: 0 -8px; padding: 5px 8px; border-radius: 4px; }

/* ---------- 현황판 (문제 화면) ---------- */
.dash { display: flex; flex-direction: column; gap: 14px; }
.dash-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: var(--pane); border: 1px solid var(--line); border-radius: 10px; }
.stat b { font-size: 26px; line-height: 1.1; } .stat span { font-size: 12px; color: var(--dim); }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dash-none { margin: 0; }
.dcard { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; text-align: left; cursor: pointer; background: var(--pane); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; min-width: 0; }
.dcard:hover { border-color: #475569; }
.dcard.s-run { border-left-color: var(--green); } .dcard.s-wait { border-left-color: var(--amber); background: var(--warn-bg); } .dcard.s-stuck { border-left-color: var(--red); }
.dc-top { display: flex; align-items: center; gap: 6px; } .dc-state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); }
.s-run .dc-state { color: var(--green); } .s-wait .dc-state { color: var(--amber); font-weight: 700; } .s-stuck .dc-state { color: var(--red); }
.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); } .led.run { background: var(--green); animation: ks-blink 1.6s steps(1) infinite; }
.dc-title { font-size: 17px; font-weight: 700; color: var(--bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-meta { font-size: 12px; color: var(--dim); }
.dc-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--dim); } .dc-nums b { font-size: 15px; color: var(--bright); }
.dc-last { font-size: 12px; color: var(--text); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 2.6em; }
/* 해결한 문제: 초록 표식, 목록 아래쪽에 따로 */
.cat.done { background: var(--green); color: #0b1222; }
.chal-list button.st-solved { border-left: 3px solid var(--green); padding-left: 5px; }
.chal-list button.st-solved .name { color: var(--green); }
.chal-list .list-sep { margin: 12px 0 2px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--green); font-weight: 700; }
/* ---------- 에이전트 카드 (활동 화면) ---------- */
.agent-board { display: flex; flex-direction: column; gap: 10px; }
.board-head h2 { margin: 0; font-size: 12px; font-weight: 600; color: var(--bright); } .board-head h2 span { color: var(--dim); font-weight: 400; }
#agents.agents { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
#agents .agents-toggle { grid-column: 1 / -1; }
#agents .acard { display: flex; flex-direction: column; gap: 6px; width: 100%; height: 100%; padding: 14px 16px; text-align: left; cursor: pointer; background: var(--pane); border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: 10px; grid-template-columns: none; }
#agents .acard:hover, #agents .acard[aria-pressed="true"] { background: #111a2c; border-color: #475569; }
#agents .acard.s-run { border-top-color: var(--green); } #agents .acard.is-sub.s-run { border-top-color: var(--cyan); } #agents .acard.done { opacity: .55; }
.ac-top { display: flex; align-items: center; } .ac-role { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #0b1222; background: var(--green); padding: 0 6px; border-radius: 3px; }
.is-sub .ac-role { background: var(--cyan); } .ac-state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); } .s-run .ac-state { color: var(--green); }
.ac-name { font-size: 15px; font-weight: 700; color: var(--bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-job { font-size: 12px; color: var(--cyan); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-nums { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--dim); } .ac-nums b { color: var(--bright); }
.ac-last { font-size: 12px; color: var(--text); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 2.6em; }
@media (max-width: 900px) { .dash-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* ---------- 활동 화면: 넓은 창에서는 한 화면에 맞춘다 (왼쪽 지시·기록, 오른쪽 에이전트·사용량) ---------- */
@media (min-width: 1100px) and (min-height: 640px) {
  body:has(#view-activity:not([hidden])) #view-app:not([hidden]) { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  #view-activity:not([hidden]) { flex: 1; min-height: 0; width: 100%; max-width: 1680px; padding: 16px 24px; display: grid; gap: 0 16px;
    grid-template-columns: 340px minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "agents ask" "agents dir" "agents feed"; }
  #view-activity > #pane-ask { grid-area: ask; margin-bottom: 14px; max-height: 34vh; overflow-y: auto; }
  #view-activity > section[aria-labelledby="h-dir"] { grid-area: dir; margin-bottom: 14px; }
  #view-activity > section[aria-labelledby="h-feed"] { grid-area: feed; min-height: 0; }
  #view-activity > section[aria-labelledby="h-feed"] .pane-body { min-height: 0; overflow-y: auto; }
  #view-activity > .agent-board { grid-area: agents; min-height: 0; overflow-y: auto; padding-right: 4px; }
  #view-activity #agents.agents { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #view-activity #agents .acard { height: auto; padding: 12px 14px; }
  #view-activity #dirs { max-height: 18vh; overflow-y: auto; }
}
.chal-list button.toggle { display: block; padding: 10px 8px; color: var(--dim); font-size: 12px; text-align: left; } .chal-list button.toggle:hover { color: var(--bright); }
code.flag { font: inherit; font-weight: 700; color: var(--green); background: var(--well); border: 1px solid var(--green); border-radius: 5px; padding: 1px 7px; margin: 0 2px; cursor: copy; user-select: all; overflow-wrap: anywhere; } code.flag:hover, code.flag:focus-visible { background: #12331f; outline: none; }
/* 에이전트 카드: 도는 기계에 따라 색을 가른다 (ARM 서버 = 파랑, PC = 보라) */
.ac-mach { margin-left: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 0 6px; border-radius: 3px; border: 1px solid currentColor; line-height: 18px; }
.m-arm .ac-mach { color: var(--blue); } .m-pc .ac-mach { color: #C4A7F5; }
#agents .acard.m-arm.s-run, #agents .acard.m-arm.is-sub.s-run { border-top-color: var(--blue); }
#agents .acard.m-pc.s-run, #agents .acard.m-pc.is-sub.s-run { border-top-color: #C4A7F5; }
#agents .acard.m-pc { background: linear-gradient(180deg, rgba(196, 167, 245, .07), transparent 46px), var(--pane); }
#agents .acard.m-arm { background: linear-gradient(180deg, rgba(125, 179, 223, .07), transparent 46px), var(--pane); }
/* 서브에이전트: 맡긴 메인 아래에 들여 쓰고 선으로 잇는다 */
#agents li.sub-of { position: relative; margin-left: 20px; }
#agents li.sub-of::before { content: ""; position: absolute; left: -12px; top: -10px; bottom: 50%; width: 10px; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); border-bottom-left-radius: 6px; }
.ac-parent { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#agents .is-sub .ac-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; }
#dir-picked li { padding: 4px 0; font-size: 13px; } #dir-picked .rm { width: 28px; height: 28px; border: 0; background: transparent; color: var(--dim); cursor: pointer; } #dir-picked .rm:hover { color: var(--red); }
#form-dir.over { outline: 2px dashed var(--accent); outline-offset: -6px; }
.dir-row label.btn-sm { display: inline-flex; align-items: center; height: 36px; cursor: pointer; }
pre.more.clip { cursor: pointer; } pre.more.clip:not(.open) { -webkit-mask-image: linear-gradient(180deg, #000 50%, transparent); mask-image: linear-gradient(180deg, #000 50%, transparent); }
pre.more.out.bad.open { max-height: none; }
#new-model, #new-plat { width: 100%; height: 48px; padding: 0 12px; border-radius: 8px; }

/* 대회 메모 창 */
#plat-dlg { width: min(900px, calc(100vw - 24px)); padding: 0; border: 0; background: transparent; color: inherit; }
#plat-dlg::backdrop { background: rgba(0, 0, 0, .6); }
#plat-dlg .pane { max-height: calc(100dvh - 48px); box-shadow: 0 12px 32px rgba(0, 0, 0, .55); border-color: #475569; }
#plat-dlg .pane-body { overflow-y: auto; }
#plat-dlg textarea { min-height: 50dvh; font-size: 13px; line-height: 1.6; }
#plat-filter { max-width: 150px; }
#h-list { white-space: nowrap; }

/* PC 노드 상태 창 */
.pcinfo { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 6px 12px; font-size: 13px; overflow-wrap: anywhere; }
.pc-name { font-size: 13px; margin: 0 0 6px; font-weight: 600; }
.pcinfo + .pc-name { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line, #333); }
#new-where { width: 100%; height: 48px; padding: 0 12px; border-radius: 8px; }
.c-pc { color: #C4A7F5; }
.stat { position: relative; } .stat .split { position: absolute; top: 10px; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.stat .split span { font-size: 11px; } .stat .split .c-blue { color: var(--blue); } .stat .split .c-pc { color: #C4A7F5; }
.chal-list .lflag { grid-column: 2; min-width: 0; margin-top: 4px; } .chal-list .lflag code.flag { display: inline-block; max-width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; font-size: 12px; }

/* 파일 목록·스킬 표: 좁은 화면에서는 표 대신 한 줄씩 쌓는다 (첫 칸 → 나머지 짧은 칸들 → 설명·메모) */
@media (max-width: 640px) {
  table.log.files thead, #skills-table thead { display: none; }
  table.log.files, table.log.files tbody, #skills-table, #skills-table tbody { display: block; }
  table.log.files tr, #skills-table tr { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
  table.log.files td, #skills-table td { display: block; padding: 0; border: 0; }
  table.log.files td:first-child, #skills-table td:first-child { flex: 1 0 100%; white-space: normal; overflow-wrap: anywhere; }
  table.log.files td.num { text-align: left; }
  table.log.files td.msg, #skills .desc { flex: 1 0 100%; min-width: 0; }
  table.log.files td.msg:empty { display: none; }
}
/* 상단 노드 표시: 좁은 화면에서는 줄인 것만 */
.pc-chip .pc-brief, #pc-chip .pc-brief { display: none; }
@media (max-width: 640px) { #pc-chip .pc-full { display: none; } #pc-chip .pc-brief { display: inline; } }
@media (max-width: 640px) { #usage-dlg, #pc-dlg { left: 8px !important; right: 8px !important; width: auto; } }
/* 플래그 검증 대기: 메인 카드를 금색으로 강조하고 아래에 플래그와 [검증 완료] [검증 실패] */
#agents li.flag-pending .acard { border-color: var(--amber); border-top-color: var(--amber); box-shadow: 0 0 0 1px rgba(232, 184, 106, .35), 0 0 18px rgba(232, 184, 106, .18); opacity: 1; }
#agents li.flag-pending .ac-state { color: var(--amber); }
.ac-verify { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 10px; background: var(--warn-bg); border: 1px solid rgba(232, 184, 106, .35); border-radius: 8px; }
.ac-verify code.flag { flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; margin: 0; }
.vbtns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.vbtns .v-ok { color: #0b1222; background: var(--green); border-color: var(--green); font-weight: 700; }
.vbtns .v-no { color: var(--red); border-color: var(--red); }
.cat.pend { background: var(--amber); color: #0b1222; }
/* 검증 대기 칸: 카드와 검증 상자를 위아래로 쌓는다(카드가 칸 높이를 다 차지하지 않게). 목록 안 버튼에 걸리는 카드 모양 규칙을 검증 버튼에서는 푼다 */
#agents li.flag-pending { display: flex; flex-direction: column; }
#agents li.flag-pending .acard { height: auto; }
#agents .ac-verify button { width: auto; display: inline-block; padding: 4px 12px; border: 1px solid; border-radius: 4px; }
#agents .ac-verify .v-ok { background: var(--green); border-color: var(--green); color: #0b1222; }
#agents .ac-verify .v-no { background: transparent; border-color: var(--red); color: var(--red); }
/* Dreamhack 문제 페이지 링크 */
a.dh-link { color: var(--cyan); font-weight: 700; text-decoration: none; border: 1px solid var(--cyan); border-radius: 4px; padding: 3px 10px; white-space: nowrap; }
a.dh-link:hover { background: rgba(125, 211, 252, .12); }
#agents .ac-verify a.dh-link { margin-left: auto; }
#agents .ac-link { display: flex; justify-content: flex-end; margin-top: 6px; }
/* 확인 요청이 있는 메인 카드: 답을 기다린다 — 산호색 강조 */
#agents li.ask-pending .acard { border-color: #F08A6C; border-top-color: #F08A6C; box-shadow: 0 0 0 1px rgba(240, 138, 108, .4), 0 0 18px rgba(240, 138, 108, .2); opacity: 1; }
#agents .ac-ask { margin-left: 6px; padding: 0 6px; border-radius: 3px; background: #F08A6C; color: #0b1222; font-size: 11px; font-weight: 700; line-height: 18px; }
#agents li.flag-pending.ask-pending .acard { border-color: var(--amber); border-top-color: #F08A6C; }
/* 카드 아래에 검증 상자·링크가 붙는 칸: 위아래로 쌓고 카드가 칸 높이를 다 차지하지 않게 */
#agents li.stack { display: flex; flex-direction: column; }
#agents li.stack .acard { height: auto; }
/* 검증 완료(writeup 마무리 중): 초록 강조 */
#agents li.flag-ok .acard { border-color: var(--green); border-top-color: var(--green); box-shadow: 0 0 0 1px rgba(127, 211, 160, .35), 0 0 18px rgba(127, 211, 160, .16); opacity: 1; }
#agents .ac-ok { margin-left: 6px; padding: 0 6px; border-radius: 3px; background: var(--green); color: #0b1222; font-size: 11px; font-weight: 700; line-height: 18px; }
#agents li.flag-ok .acard.done { opacity: .55; box-shadow: none; }
.ask .ask-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ask .ask-head a.dh-link { font-size: 12px; padding: 2px 8px; }
/* ---------- 문제 화면: 올리기(낮게) → 내 차례 → 풀이 중 표 ---------- */
#view-challenges .drop { min-height: 64px; padding: 12px 16px; }
#view-challenges { max-width: 1680px; }
/* 내 차례: 사용자가 해야 할 일만. 종류별 색 */
.turn-list { list-style: none; margin: 0; padding: 0; }
.trow { display: grid; grid-template-columns: 84px minmax(0, 220px) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.trow:first-child { border-top: 0; }
.trow .t-kind { justify-self: start; padding: 0 8px; border-radius: 3px; font-size: 12px; font-weight: 700; line-height: 22px; color: #0b1222; white-space: nowrap; }
.trow .t-title { color: var(--bright); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .t-body { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.trow .t-act { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.trow .t-act a.dh-link { font-size: 12px; padding: 2px 8px; }
.t-ask .t-kind { background: #F08A6C; } .t-flag .t-kind { background: var(--amber); } .t-block .t-kind { background: var(--amber); } .t-stuck .t-kind { background: var(--red); }
.pane.turn { border-color: rgba(232, 184, 106, .45); }
/* 풀이 중 표: 문제당 한 줄 */
.dash-sum { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.dash-rows { list-style: none; margin: 0; padding: 0; }
.dash-rows .dhead, .dash-rows .drow { display: grid; grid-template-columns: 78px minmax(0, 1.3fr) 84px 128px 60px 92px 84px minmax(0, 2fr); align-items: center; gap: 10px; padding: 8px 16px; }
.dash-rows .dhead { color: var(--faint); font-size: 11px; padding-top: 6px; padding-bottom: 6px; }
.dash-rows .drow { width: 100%; text-align: left; cursor: pointer; background: transparent; border: 0; border-top: 1px solid var(--line-soft); border-left: 3px solid transparent; color: inherit; font: inherit; }
.dash-rows .drow:hover { background: #111a2c; }
.dash-rows .drow.s-run { border-left-color: var(--green); } .dash-rows .drow.s-wait { border-left-color: var(--amber); } .dash-rows .drow.s-stuck { border-left-color: var(--red); }
.drow .dr-title { color: var(--bright); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow .dr-mach { justify-self: start; }
.drow .dr-time, .drow .dr-nums { color: var(--dim); font-size: 12px; white-space: nowrap; }
.drow .dr-model { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drow .dr-state { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.drow.s-wait .dr-state { color: var(--amber); } .drow.s-stuck .dr-state { color: var(--red); } .drow.s-run .dr-state { color: var(--green); } .drow.s-idle .dr-state { color: var(--dim); }
.drow .dr-last { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 좁은 화면: 두 줄로(위: 유형·제목·상태, 아래: 자리·경과·확보/필요·최근 활동) */
@media (max-width: 900px) {
  .trow { grid-template-columns: auto minmax(0, 1fr); row-gap: 6px; }
  .trow .t-body { grid-column: 1 / -1; }
  .trow .t-act { grid-column: 1 / -1; justify-content: flex-start; }
  .dash-rows .dhead { display: none; }
  .dash-rows .drow { grid-template-columns: 96px minmax(0, 1fr) auto; row-gap: 4px; }      /* 첫 칸을 고정해 줄마다 제목 시작 위치를 맞춘다 */
  .drow .dr-cat { grid-row: 1; } .drow .dr-title { grid-row: 1; } .drow .dr-state { grid-row: 1; grid-column: 3; }
  .drow .dr-mach, .drow .dr-time, .drow .dr-nums { grid-row: 2; }
  .drow .dr-mach { grid-column: 1; } .drow .dr-time { grid-column: 2; } .drow .dr-nums { grid-column: 3; }
  .drow .dr-model { grid-row: 3; grid-column: 1 / -1; }
  .drow .dr-last { grid-row: 4; grid-column: 1 / -1; }
}
/* 내 차례가 보이면 위쪽 '확인을 기다리는 요청' 띠는 겹치므로 문제 화면에서는 숨긴다 */
body:has(#view-challenges:not([hidden]) #myturn:not([hidden])) #askbar { display: none; }
/* 좁은 화면: 올리기 칸을 압축(고르기 칸 두 개씩 나란히) — 내 차례가 너무 아래로 밀리지 않게 */
@media (max-width: 900px) {
  #form-new .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  #view-challenges .drop { min-height: 52px; padding: 10px 12px; }
}
/* 활동 기록의 긴 글(에이전트 말·확인 요청·답 등): 줄바꿈을 살리고 몇 줄만 보이게 접는다. 누르면 펼친다 */
.feed .more.msg { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 7.2em; overflow: hidden; cursor: pointer; }
.feed .more.msg.open { max-height: none; }
.feed .more.msg.clip:not(.open) { -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
/* 문제 목록 검색 칸(목록 머리) */
.list-q { width: 150px; height: 26px; padding: 0 8px; font: inherit; font-size: 12px; color: var(--text); background: var(--well); border: 1px solid var(--line); border-radius: 4px; }
.list-q:focus { outline: none; border-color: var(--green); }
@media (max-width: 900px) { .list-q { width: 110px; } }
