:root {
  --ink: #17212e; --muted: #5a6778; --line: #d8dee6; --bg: #f3f5f8; --panel: #fff; --side: #14233a; --side-ink: #d7e0ec; --side-muted: #8fa1b8;
  --accent: #1c5fa8; --accent-soft: #e3ecf7; --bad: #b3261e; --ok: #1e7b4c; --warn: #9a6200;
  font-family: "Pretendard Variable", Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; font-size: 14px; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.app { display: grid; grid-template-columns: 224px minmax(0, 1fr) 6px var(--panel-w, 340px); height: 100vh; }
.app.panel-closed { grid-template-columns: 224px minmax(0, 1fr); }
.app.panel-closed .resizer, .app.panel-closed .panel { display: none; }
.app.dragging iframe { pointer-events: none; }

/* 사이드바 */
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 16px 16px 12px; display: grid; gap: 2px; }
.side-head strong { font-size: 16px; color: #fff; }
.side-head span { font-size: 12px; color: var(--side-muted); }
.seg { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 2px; margin: 0 12px 10px; background: #0d1929; border-radius: 8px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--side-muted); padding: 6px 0; border-radius: 6px; cursor: pointer; font-size: 13px; }
.seg button[aria-selected="true"] { background: var(--accent); color: #fff; font-weight: 600; }
.search { margin: 0 12px 8px; padding: 7px 10px; border-radius: 6px; border: 1px solid #2b3f5c; background: #0d1929; color: #fff; }
.search::placeholder { color: var(--side-muted); }
.tree { flex: 1; overflow-y: auto; padding: 0 8px 12px; min-height: 0; scrollbar-color: #33496a transparent; }
.tree h3 { margin: 14px 8px 4px; font-size: 13px; color: #fff; font-weight: 700; }
.tree h4 { margin: 8px 8px 2px; font-size: 12px; color: var(--side-muted); font-weight: 500; }
.tree button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 0; background: none; color: var(--side-ink); text-align: left; padding: 6px 8px 6px 14px; border-radius: 6px; cursor: pointer; }
.tree button:hover { background: #1e3350; }
.tree button[aria-current="page"] { background: var(--accent); color: #fff; font-weight: 600; }
.badge { background: #f2a93b; color: #1b1405; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.side-foot { padding: 10px 16px; border-top: 1px solid #24374f; display: grid; gap: 4px; font-size: 12px; color: var(--side-muted); }
.side-foot a { color: var(--side-ink); }

/* 가운데 */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.stage-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 46px; flex-wrap: wrap; }
.stage-bar h1 { font-size: 15px; margin: 0; font-weight: 700; white-space: nowrap; }
.demo-note { font-size: 12px; color: var(--warn); background: #fdf3e0; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.spacer { flex: 1; }
.line, .check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.line select { padding: 3px 6px; }
.ghost { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 13px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.ghost:hover { background: var(--bg); }
.frame-wrap { flex: 1; min-height: 0; background: #fff; position: relative; overflow: hidden; }
iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: 0; display: block; transform-origin: 0 0; }
.zoom-note { font-size: 12px; color: var(--muted); white-space: nowrap; }
.all-view { flex: 1; overflow: auto; padding: 16px; }
.all-view h2 { font-size: 14px; margin: 18px 0 8px; }
.all-view h2 button { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; font-weight: 700; padding: 0; }
.empty { color: var(--muted); padding: 24px 8px; text-align: center; }

/* 요청란 */
.resizer { cursor: col-resize; background: var(--line); }
.resizer:hover { background: var(--accent); }
.panel { background: var(--panel); display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.form { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.panel h2 { font-size: 14px; margin: 0; }
.list-head { padding: 12px 14px 4px; }
#count { color: var(--accent); }
textarea { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 6px; resize: vertical; line-height: 1.5; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.drop { border: 1px dashed #aab5c3; border-radius: 6px; padding: 10px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.drop.over { background: var(--accent-soft); border-color: var(--accent); }
.pending { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pending li { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 4px; padding: 3px 8px; font-size: 13px; }
.pending span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending button, .att button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; font-size: 13px; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
.form-row input, .form-row select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-width: 0; }
.primary { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 6px 16px; font-weight: 600; cursor: pointer; }
.primary:disabled { opacity: .6; cursor: default; }
.error { color: var(--bad); margin: 0; font-size: 13px; }
.list { padding: 6px 14px 16px; display: grid; gap: 10px; align-content: start; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 6px; background: #fff; }
.card-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.card-head b { color: var(--ink); }
.card-body { white-space: pre-wrap; word-break: break-word; line-height: 1.5; margin: 0; }
.pri-높음 { color: var(--bad); font-weight: 700; }
.status { border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; font-size: 12px; background: #fff; margin-left: auto; }
.status.s-완료 { color: var(--ok); } .status.s-진행중 { color: var(--accent); } .status.s-보류 { color: var(--warn); }
.atts { display: flex; flex-wrap: wrap; gap: 6px; }
.att { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border-radius: 4px; padding: 3px 6px; font-size: 12px; max-width: 100%; }
.att a { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att img { height: 48px; max-width: 120px; object-fit: cover; border-radius: 3px; display: block; }
.card-actions { display: flex; gap: 10px; font-size: 12px; }
.card-actions button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; font-size: 12px; text-decoration: underline; }
.reply { background: var(--accent-soft); border-radius: 6px; padding: 6px 8px; font-size: 13px; white-space: pre-wrap; margin: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 8px; z-index: 10; }
@media (max-width: 1600px) {
  .demo-note { display: none; }
  .app { grid-template-columns: 190px minmax(0, 1fr) 6px var(--panel-w, 290px); }
  .app.panel-closed { grid-template-columns: 190px minmax(0, 1fr); }
}

.trash-head { margin-top: 32px !important; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); }
.trash { display: grid; gap: 6px; }
.trash-row { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr) auto auto; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.trash-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
