/* 직원실 v2
 *
 * 설계 근거: docs/superpowers/specs/2026-09-05-employee-room-agent-sdk-impl-spec.md 5.2
 * 금지: 그라디언트, 네온, 글래스모피즘, 짙은 그림자, 이모지, 큰 컨테이너 pill
 * 검증: 1440x900 / 배율 100%에서 10개 카드가 두 줄에 들어온다.
 *
 * 색은 전부 앱 전역 토큰에서 받는다. 직원실 전용 hex 를 박으면 테마 토글을
 * 따라가지 못한다 — 처음엔 라이트 고정이라 다크 앱에서 흰 섬처럼 떠 보였고,
 * 그걸 다크 고정으로 바꾸니 라이트 모드에서 반대 문제가 생겼다.
 * 여기서는 --color-* 만 참조하고, 상태색도 success/warning/info/danger 를 쓴다.
 */

#employeeRoomV2View {
    --er-canvas: transparent;
    --er-surface: var(--color-panel);
    --er-surface-2: var(--color-panel-raised);
    --er-border: var(--color-border);
    --er-border-soft: var(--color-border);
    --er-text: var(--color-text-primary);
    --er-muted: var(--color-text-secondary);
    --er-faint: var(--color-text-muted);
    --er-hover: var(--color-panel-hover);

    --er-wait-bg: var(--color-warning-bg);
    --er-wait-fg: var(--color-warning-text);
    --er-run-bg: var(--color-info-bg);
    --er-run-fg: var(--color-info-text);
    --er-done-bg: var(--color-success-bg);
    --er-done-fg: var(--color-success-text);
    --er-error-bg: var(--color-danger-bg);
    --er-error-fg: var(--color-danger-text);
    --er-idle-bg: transparent;
    --er-idle-fg: var(--color-text-muted);

    --er-accent: var(--color-accent);
    --er-accent-hover: var(--color-accent-hover);

    background: var(--er-canvas);
    color: var(--er-text);
    padding: 4px 0 10px;
    min-height: 100%;
    line-height: 1.6;
}

/* 앱 전역(다크) 스타일이 내부 텍스트를 덮지 않도록 고정한다.
   이 탭은 문서형 라이트 화면으로 유지한다. */
#employeeRoomV2View,
#employeeRoomV2View h2,
#employeeRoomV2View h3,
#employeeRoomV2View p,
#employeeRoomV2View div,
#employeeRoomV2View span,
#employeeRoomV2View article,
#employeeRoomV2View label,
#employeeRoomV2View textarea {
    color: var(--er-text);
}

#employeeRoomV2View .er-sub,
#employeeRoomV2View .er-section-title,
#employeeRoomV2View .er-card-title,
#employeeRoomV2View .er-card-customer,
#employeeRoomV2View .er-approval-meta,
#employeeRoomV2View .er-field-label,
#employeeRoomV2View .er-field-hint,
#employeeRoomV2View .er-save-state,
#employeeRoomV2View .er-empty,
#employeeRoomV2View .er-readonly {
    color: var(--er-muted);
}

#employeeRoomV2View .er-title {
    color: var(--er-text);
    font-size: 20px;
}

#employeeRoomV2View .er-btn-primary,
#employeeRoomV2View .er-btn-primary span {
    color: var(--er-text);
}

#employeeRoomV2View .er-badge[data-status="waiting"]  { color: var(--er-wait-fg); }
#employeeRoomV2View .er-badge[data-status="running"]  { color: var(--er-run-fg); }
#employeeRoomV2View .er-badge[data-status="done"]     { color: var(--er-done-fg); }
#employeeRoomV2View .er-badge[data-status="error"]    { color: var(--er-error-fg); }
#employeeRoomV2View .er-badge[data-status="idle"],
#employeeRoomV2View .er-badge[data-status="disabled"] { color: var(--er-idle-fg); }

#employeeRoomV2View .er-warning,
#employeeRoomV2View .er-warning span { color: var(--er-error-fg); }

/* ---------------------------------------------------------- 헤더 */

.er-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--er-border);
}

.er-title {
    margin: 0;
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.er-sub {
    margin: 0;
    font-size: 13px;
    color: var(--er-muted);
}

.er-refresh {
    border: 1px solid var(--er-border);
    background: var(--er-surface);
    color: var(--er-text);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12.5px;
    cursor: pointer;
    transition: background 120ms ease;
}

.er-refresh:hover { background: var(--er-hover); }
.er-refresh:active { transform: scale(0.98); }

/* ---------------------------------------------------------- 경고 */

.er-warning {
    margin-top: 16px;
    padding: 12px 16px;
    border: 1px solid var(--er-border);
    border-left: 3px solid var(--er-error-fg);
    border-radius: 6px;
    background: var(--er-error-bg);
    color: var(--er-error-fg);
    font-size: 13px;
}

.er-warning[hidden] { display: none; }

/* ---------------------------------------------------------- 섹션 */

.er-section { margin-top: 22px; }

.er-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.er-section-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--er-muted);
}

.er-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--er-text);
    background: var(--er-idle-bg);
    border-radius: 9999px;
    padding: 1px 8px;
}

/* ---------------------------------------------------------- 승인 큐 */

.er-approvals {
    border: 1px solid var(--er-border);
    border-radius: 8px;
    background: var(--er-surface);
    overflow: hidden;
}

.er-approval {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--er-border);
}

.er-approval:last-child { border-bottom: none; }

.er-approval-who {
    font-size: 13px;
    font-weight: 600;
}

.er-approval-body { min-width: 0; }

.er-approval-summary {
    font-size: 13.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.er-approval-meta {
    margin-top: 2px;
    font-size: 12px;
    color: var(--er-muted);
}

.er-approval-actions { display: flex; gap: 6px; }

.er-btn {
    border: 1px solid var(--er-border);
    background: var(--er-surface);
    color: var(--er-text);
    border-radius: 5px;
    padding: 5px 12px;
    font-size: 12.5px;
    cursor: pointer;
    transition: background 120ms ease;
}

.er-btn:hover { background: var(--er-hover); }
.er-btn:active { transform: scale(0.98); }

.er-btn-primary {
    background: var(--er-accent);
    border-color: var(--er-accent);
    color: var(--er-text);
}

.er-btn-primary:hover { background: var(--er-accent-hover); }

.er-empty {
    padding: 22px 20px;
    font-size: 13px;
    color: var(--er-muted);
    text-align: center;
}

/* ---------------------------------------------------------- 직원 카드 */

.er-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 1200px) {
    .er-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .er-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.er-card {
    border: 1px solid var(--er-border);
    border-radius: 8px;
    background: var(--er-surface);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 104px;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease;
}

.er-card:hover {
    border-color: var(--er-border);
    background: var(--er-surface-2);
}

.er-card.is-disabled {
    cursor: default;
    background: var(--er-surface-2);
}

.er-card.is-disabled:hover { border-color: var(--er-border); }

.er-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.er-card-name {
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.er-card-title {
    font-size: 12px;
    color: var(--er-muted);
}

.er-card-task {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 20px;
}

.er-card-customer {
    font-size: 12px;
    color: var(--er-muted);
}

.er-card-actions {
    margin-top: auto;
    display: flex;
    gap: 6px;
    padding-top: 4px;
}

.er-card-actions .er-btn {
    padding: 4px 10px;
    font-size: 12px;
}

/* ---------------------------------------------------------- 배지 */

.er-badge {
    flex-shrink: 0;
    border-radius: 9999px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.er-badge[data-status="waiting"]  { background: var(--er-wait-bg);  color: var(--er-wait-fg); }
.er-badge[data-status="running"]  { background: var(--er-run-bg);   color: var(--er-run-fg); }
.er-badge[data-status="done"]     { background: var(--er-done-bg);  color: var(--er-done-fg); }
.er-badge[data-status="error"]    { background: var(--er-error-bg); color: var(--er-error-fg); }
.er-badge[data-status="idle"]     { background: var(--er-idle-bg);  color: var(--er-idle-fg); }
.er-badge[data-status="disabled"] { background: var(--er-idle-bg);  color: var(--er-idle-fg); }

/* ---------------------------------------------------------- 지침 편집 */

.er-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.28);
    z-index: 9998;
}

.er-overlay[hidden] { display: none; }

.er-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(560px, 100vw);
    background: var(--er-surface);
    border-left: 1px solid var(--er-border);
    box-shadow: -1px 0 3px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    /* 앱의 플로팅 검색 버튼이 닫기 버튼을 가리므로 그 위로 올린다 */
    z-index: 9999;
}

.er-drawer[hidden] { display: none; }

.er-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--er-border);
    flex-shrink: 0;
}

.er-drawer-close {
    border: 1px solid var(--er-border);
    background: var(--er-surface);
    color: var(--er-text);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
}

.er-drawer-close:hover { background: var(--er-hover); }

.er-drawer-title {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
}

.er-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
}

.er-field { margin-bottom: 18px; }

.er-field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--er-muted);
}

.er-field-hint {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--er-muted);
}

.er-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--er-border);
    border-radius: 6px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;
    color: var(--er-text);
    background: var(--er-surface);
    resize: vertical;
    min-height: 68px;
}

.er-field textarea:focus {
    outline: none;
    border-color: var(--color-border-strong);
}

.er-readonly {
    border: 1px solid var(--er-border);
    border-radius: 6px;
    background: var(--er-hover);
    padding: 10px 12px;
    font-size: 12.5px;
    color: var(--er-muted);
    white-space: pre-wrap;
}

.er-drawer-foot {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 22px;
    border-top: 1px solid var(--er-border);
}

.er-save-state {
    font-size: 12px;
    color: var(--er-muted);
}

/* ---------------------------------------------------------- 대화창
 * F-30~F-35. Claude Code 대화창 수준의 가독성이 목표.
 * 표는 자체 스크롤 컨테이너 안에서 처리해 페이지가 가로로 밀리지 않게 한다.
 */

.er-chat { display: flex; flex-direction: column; height: calc(100vh - 120px); }
.er-chat[hidden] { display: none; }

.er-chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--er-border);
    flex-shrink: 0;
}

.er-chat-who { display: flex; flex-direction: column; gap: 1px; }
.er-chat-name { font-size: 15px; font-weight: 650; }
.er-chat-meta { font-size: 12px; color: var(--er-muted); }
.er-chat-spacer { flex: 1; }

.er-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 2px 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.er-msg { display: flex; flex-direction: column; gap: 5px; max-width: 860px; }
.er-msg.is-user { align-self: flex-end; align-items: flex-end; }

.er-msg-role {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--er-muted);
}

.er-msg-body {
    border: 1px solid var(--er-border);
    border-radius: 8px;
    background: var(--er-surface);
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.65;
}

.er-msg.is-user .er-msg-body { background: var(--er-hover); }

/* 마크다운 본문 */
.er-md > *:first-child { margin-top: 0; }
.er-md > *:last-child { margin-bottom: 0; }
.er-md p { margin: 0 0 10px; }
.er-md h1, .er-md h2, .er-md h3 {
    margin: 18px 0 8px;
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: -0.01em;
}
.er-md ul, .er-md ol { margin: 0 0 10px; padding-left: 20px; }
.er-md li { margin: 2px 0; }
.er-md li > ul, .er-md li > ol { margin: 2px 0; }
.er-md blockquote {
    margin: 0 0 10px;
    padding: 2px 0 2px 12px;
    border-left: 2px solid var(--er-border);
    color: var(--er-muted);
}
.er-md code {
    font-family: "SF Mono", "JetBrains Mono", ui-monospace, monospace;
    font-size: 12.5px;
    background: var(--er-hover);
    border-radius: 3px;
    padding: 1px 5px;
}
.er-md pre {
    margin: 0 0 10px;
    padding: 12px 14px;
    background: var(--er-hover);
    border: 1px solid var(--er-border);
    border-radius: 6px;
    overflow-x: auto;
}
.er-md pre code { background: none; padding: 0; font-size: 12.5px; }

/* 표 — 페이지가 아니라 이 컨테이너만 가로 스크롤 (F-33) */
.er-md-table {
    margin: 0 0 10px;
    overflow-x: auto;
    border: 1px solid var(--er-border);
    border-radius: 6px;
}
.er-md-table table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.er-md-table th, .er-md-table td {
    border-bottom: 1px solid var(--er-border);
    padding: 7px 12px;
    text-align: left;
    white-space: nowrap;      /* 전역 tbody td nowrap 상속 대응 */
    vertical-align: top;
}
.er-md-table th {
    background: var(--er-hover);
    font-weight: 600;
    color: var(--er-text);
}
.er-md-table tr:last-child td { border-bottom: none; }

/* 도구 호출 (F-34) */
.er-tool {
    border: 1px solid var(--er-border);
    border-radius: 6px;
    background: var(--er-surface-2);
    font-size: 12.5px;
}
.er-tool summary {
    padding: 7px 12px;
    cursor: pointer;
    color: var(--er-muted);
    list-style: none;
}
.er-tool summary::-webkit-details-marker { display: none; }
.er-tool summary::before { content: "+ "; font-family: monospace; }
.er-tool[open] summary::before { content: "− "; }
.er-tool-body {
    border-top: 1px solid var(--er-border);
    padding: 10px 12px;
    font-family: "SF Mono", ui-monospace, monospace;
    font-size: 11.5px;
    color: var(--er-muted);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 220px;
    overflow-y: auto;
}

/* 입력 */
.er-chat-input {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--er-border);
}
.er-chat-input textarea {
    flex: 1;
    box-sizing: border-box;
    border: 1px solid var(--er-border);
    border-radius: 6px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--er-text);
    background: var(--er-surface);
    resize: vertical;
    min-height: 44px;
    max-height: 160px;
}
.er-chat-input textarea:focus { outline: none; border-color: var(--er-accent); }

.er-chat-empty {
    margin: auto;
    font-size: 13px;
    color: var(--er-muted);
    text-align: center;
}

/* 전역 테이블 스타일(30-shared-components.css의 tbody 다크 배경·nowrap)이
   대화창 표에 상속되는 것을 막는다. 구체성을 올려 명시적으로 되돌린다. */
#employeeRoomV2View .er-md-table table,
#employeeRoomV2View .er-md-table thead,
#employeeRoomV2View .er-md-table tbody,
#employeeRoomV2View .er-md-table tr {
    background: var(--er-surface);
    color: var(--er-text);
}

#employeeRoomV2View .er-md-table thead tr,
#employeeRoomV2View .er-md-table th {
    background: var(--er-hover);
    color: var(--er-text);
}

#employeeRoomV2View .er-md-table tbody tr:nth-child(even) {
    background: var(--er-surface-2);
}

#employeeRoomV2View .er-md-table td,
#employeeRoomV2View .er-md-table th {
    background: transparent;
    color: var(--er-text);
    border-color: var(--er-border);
}

/* ---------------------------------------------- 사용법 툴팁
   카드마다 무엇을 맡고 어떻게 시키는지가 화면에 없어서, 지침 드로어를
   열어봐야만 알 수 있었다. 이름 옆 물음표에 붙여 둔다. */

#employeeRoomV2View .er-card-flags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

#employeeRoomV2View .er-trigger {
    font-size: 11px;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 4px;
    color: var(--er-muted);
    background: var(--er-surface-2);
    white-space: nowrap;
}

#employeeRoomV2View .er-trigger.is-auto {
    color: var(--er-done-fg);
    background: rgba(90, 168, 120, .1);
}

#employeeRoomV2View .er-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 5px;
    border-radius: 50%;
    border: 1px solid var(--er-border);
    color: var(--er-faint);
    background: var(--er-surface);
    font-size: 10px;
    font-weight: 500;
    cursor: help;
    vertical-align: 1px;
}

#employeeRoomV2View .er-help:hover,
#employeeRoomV2View .er-help:focus-visible {
    color: var(--er-text);
    border-color: var(--color-border-strong);
    outline: none;
}

#employeeRoomV2View .er-tip {
    position: absolute;
    top: calc(100% + 8px);
    left: -10px;
    z-index: 400;
    display: none;
    width: 310px;
    padding: 12px 13px;
    border: 1px solid var(--er-border);
    border-radius: 7px;
    background: var(--er-surface);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
    cursor: default;
    text-align: left;
}

#employeeRoomV2View .er-help:hover .er-tip,
#employeeRoomV2View .er-help:focus-visible .er-tip {
    display: block;
}

#employeeRoomV2View .er-tip-row {
    display: flex;
    gap: 9px;
}

#employeeRoomV2View .er-tip-row + .er-tip-row {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid var(--er-border-soft);
}

#employeeRoomV2View .er-tip-label {
    flex-shrink: 0;
    width: 54px;
    font-size: 11px;
    font-weight: 500;
    color: var(--er-faint);
    line-height: 1.6;
}

#employeeRoomV2View .er-tip-text {
    font-size: 12px;
    line-height: 1.65;
    color: var(--er-text);
    white-space: normal;
    word-break: keep-all;
}

/* 오른쪽 끝 카드는 툴팁이 화면 밖으로 나간다 */
#employeeRoomV2View .er-card:nth-child(3n) .er-tip,
#employeeRoomV2View .er-card:last-child .er-tip {
    left: auto;
    right: -10px;
}

/* ---------------------------------------------- 카드 밀도와 위계
   처음 만든 카드는 세로가 넓어서, 「대기 중」만 든 카드가 텅 빈 상자로
   보였다. 10명 중 여덟이 대기 상태인 게 보통이라 화면 대부분이 빈칸이었다.
   밀도를 올려 10명이 두 줄에 들어오게 하고, 상태는 배지 대신 이름 옆
   점으로 옮겼다. 「수동」은 기본값이라 표시하지 않는다(JS에서 뺐다). */

#employeeRoomV2View .er-grid {
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 11px;
}

#employeeRoomV2View .er-card {
    position: relative;
    min-height: 0;
    padding: 13px 14px 12px;
    border-radius: 11px;
    background: var(--er-surface);
    border: 1px solid var(--er-border);
    display: flex;
    flex-direction: column;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

#employeeRoomV2View .er-card:hover {
    background: var(--er-surface-2);
    border-color: var(--color-border-strong);
    transform: translateY(-1px);
    /* hover 의 transform 이 새 쌓임 맥락을 만든다. 그대로 두면 툴팁의
       z-index 가 카드 안에 갇혀 옆·아래 카드에 가린다. */
    z-index: 5;
}

/* 툴팁을 띄운 카드는 가장 위로 */
#employeeRoomV2View .er-card:has(.er-help:hover),
#employeeRoomV2View .er-card:has(.er-help:focus-visible) {
    z-index: 60;
}

#employeeRoomV2View .er-card.is-disabled:hover {
    transform: none;
    background: var(--er-surface);
    border-color: var(--er-border);
}

/* 이름 옆 상태 점. 배지만으로는 훑을 때 눈에 안 들어온다 */
#employeeRoomV2View .er-card-top {
    margin-bottom: 9px;
    align-items: center;
}

#employeeRoomV2View .er-card-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}

#employeeRoomV2View .er-card-name::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-muted);
    flex-shrink: 0;
    opacity: .55;
}

#employeeRoomV2View .er-card:has(.er-badge[data-status="running"]) .er-card-name::before {
    background: var(--er-run-fg);
    box-shadow: 0 0 0 3px var(--er-run-bg);
    opacity: 1;
}

#employeeRoomV2View .er-card:has(.er-badge[data-status="waiting_approval"]) .er-card-name::before {
    background: var(--er-wait-fg);
    box-shadow: 0 0 0 3px var(--er-wait-bg);
    opacity: 1;
}

#employeeRoomV2View .er-card:has(.er-badge[data-status="done"]) .er-card-name::before {
    background: var(--er-done-fg);
    opacity: 1;
}

#employeeRoomV2View .er-card:has(.er-badge[data-status="error"]) .er-card-name::before {
    background: var(--er-error-fg);
    opacity: 1;
}

#employeeRoomV2View .er-card-title {
    font-size: 11px;
    margin-top: 2px;
    color: var(--er-muted);
}

/* 배지는 테두리로 형태만. 면을 채우면 카드 열 개가 알록달록해진다 */
#employeeRoomV2View .er-card-flags {
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

#employeeRoomV2View .er-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid transparent;
    white-space: nowrap;
}

#employeeRoomV2View .er-badge[data-status="idle"] {
    color: var(--er-idle-fg);
    border-color: var(--color-border-strong);
}

#employeeRoomV2View .er-badge[data-status="running"] { border-color: var(--er-run-bg); background: var(--er-run-bg); color: var(--er-run-fg); }
#employeeRoomV2View .er-badge[data-status="waiting_approval"] { border-color: var(--er-wait-bg); background: var(--er-wait-bg); color: var(--er-wait-fg); }
#employeeRoomV2View .er-badge[data-status="done"] { border-color: var(--er-done-bg); background: var(--er-done-bg); color: var(--er-done-fg); }
#employeeRoomV2View .er-badge[data-status="error"] { border-color: var(--er-error-bg); background: var(--er-error-bg); color: var(--er-error-fg); }

#employeeRoomV2View .er-trigger,
#employeeRoomV2View .er-trigger.is-auto {
    font-size: 9.5px;
    padding: 2px 6px;
    background: var(--er-done-bg);
    color: var(--er-done-fg);
    border: 1px solid var(--er-done-bg);
    border-radius: 5px;
}

/* 본문 */
#employeeRoomV2View .er-card-task {
    flex: 0 0 auto;
    font-size: 12px;
    line-height: 1.55;
    color: var(--er-text);
    /* 두 줄 자리만 잡는다. flex 로 늘리면 「—」만 든 카드가 텅 빈 상자가 된다 */
    min-height: 37px;
    -webkit-line-clamp: 2;
}

/* 액션을 아래로 붙인다. flex 로 늘리면 카드가 되레 커진다 */
#employeeRoomV2View .er-card-actions { margin-top: auto; }

#employeeRoomV2View .er-card-task:empty::after {
    content: "—";
    color: var(--er-faint);
}

#employeeRoomV2View .er-card-customer {
    font-size: 10.5px;
    color: var(--er-muted);
    margin-top: 3px;
}

/* 마지막 활동 시각. 지금 상태가 방금인지 어제인지 구분되게 */
#employeeRoomV2View .er-card-meta {
    font-size: 10px;
    color: var(--er-faint);
    margin: 4px 0 9px;
    min-height: 12px;
}

/* 액션 — 주 버튼만 채우고 보조는 텍스트로 둔다 */
#employeeRoomV2View .er-card-actions {
    display: flex;
    gap: 4px;
    margin-top: auto;
    padding-top: 9px;
    border-top: 1px solid var(--er-border-soft);
}

#employeeRoomV2View .er-btn {
    font-size: 11.5px;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: 6px;
    background: var(--er-accent);
    color: #FFFFFF;
    border: 1px solid var(--er-accent);
    transition: background .14s ease, border-color .14s ease;
}

#employeeRoomV2View .er-btn:hover { background: var(--er-accent-hover); border-color: var(--er-accent-hover); }

#employeeRoomV2View .er-btn:not(:first-child) {
    background: transparent;
    border-color: transparent;
    color: var(--er-muted);
    padding-left: 8px;
    padding-right: 8px;
}

#employeeRoomV2View .er-btn:not(:first-child):hover {
    background: var(--er-hover);
    color: var(--er-text);
}

#employeeRoomV2View .er-btn:disabled { opacity: .38; }

/* 승인 대기가 비었을 때 큰 빈 상자가 남지 않게 */
#employeeRoomV2View .er-empty {
    padding: 11px 14px;
    font-size: 11.5px;
    color: var(--er-faint);
    background: transparent;
    border: 1px solid var(--er-border-soft);
    border-radius: 9px;
    text-align: left;
}

#employeeRoomV2View .er-count {
    background: var(--er-surface-2);
    color: var(--er-muted);
    border: 1px solid var(--er-border);
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 5px;
    min-width: 20px;
}

/* 지난 대화 선택 */
#employeeRoomV2View .er-chat-history {
    max-width: 250px;
    padding: 5px 9px;
    font-size: 11.5px;
    color: var(--er-muted);
    background: var(--er-surface-2);
    border: 1px solid var(--er-border);
    border-radius: 6px;
    cursor: pointer;
}

#employeeRoomV2View .er-chat-history:hover {
    color: var(--er-text);
    border-color: var(--color-border-strong);
}
