/* 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; } }
.main-model { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; padding: 4px 0; }
.main-model select { height: 26px; font-size: 12px; }
