/*
 * card.css — 정답지 카드(.ac-card)·부서 창구 카드(.ac-dept) 스타일. 챗 화면·관리자 화면 공용.
 * 이 파일만 불러도 카드가 제 모양이 나도록 색 값은 카드 안에서 정의한다(바깥 :root 에 기대지 않음).
 * 라임 #ACC90E 는 바탕(배지·번호·강조선)으로만 쓰고 그 위 글자는 먹빛 #12200A. 흰 바탕 위 라임 글자 금지(대비 1.9).
 */
.ac-card,
.ac-dept {
  --ac-ink: #161b12;
  --ac-text: #2a2f26;
  --ac-muted: #586152;
  --ac-line: #dfe2d9;
  --ac-line-2: #c3c9bb;
  --ac-soft: #f6f7f3;
  --ac-hover: #f3f6e9;
  --ac-lime: #acc90e;
  --ac-lime-ink: #12200a;
  --ac-lime-tint: #f1f7d5;
  --ac-link: #3e4a05;
  --ac-focus: #3e4a05;
  box-sizing: border-box;
  position: relative;
  background: #fff;
  border: 1px solid var(--ac-line);
  border-radius: 10px;
  color: var(--ac-text);
  font-family: Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  text-align: left;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.ac-card *,
.ac-dept * { box-sizing: border-box; }

.ac-card { overflow: hidden; }
/* 정답지 원문임을 알리는 왼쪽 강조선 */
.ac-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--ac-lime);
}

.ac-ico { width: 16px; height: 16px; flex: none; }
.ac-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* 초안 띠 */
.ac-band {
  margin: 0;
  padding: 6px 16px 6px 18px;
  background: #fff3cf;
  border-bottom: 1px solid #ecd9a0;
  color: #5a4300;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ac-body { padding: 14px 16px 14px 19px; }

.ac-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-bottom: 8px;
}
.ac-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--ac-lime);
  color: var(--ac-lime-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
.ac-org { color: var(--ac-muted); font-size: 12.5px; }

.ac-title {
  margin: 0;
  color: var(--ac-ink);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.ac-title.ac-empty { color: var(--ac-muted); font-weight: 600; }

.ac-summary {
  margin: 6px 0 0;
  color: var(--ac-text);
  white-space: pre-line;
}

.ac-sec { margin-top: 14px; }
.ac-sec-title {
  margin: 0 0 6px;
  color: var(--ac-muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ac-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: ac-step;
}
.ac-step {
  position: relative;
  counter-increment: ac-step;
  padding: 0 0 0 30px;
  white-space: pre-line;
}
.ac-step + .ac-step { margin-top: 8px; }
.ac-step::before {
  content: counter(ac-step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--ac-lime);
  color: var(--ac-lime-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ac-notes {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--ac-soft);
}
.ac-note-list { margin: 0; padding: 0; list-style: none; }
.ac-note {
  position: relative;
  padding-left: 13px;
  font-size: 14px;
  white-space: pre-line;
}
.ac-note + .ac-note { margin-top: 4px; }
.ac-note::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.68em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ac-muted);
}

.ac-strong { color: var(--ac-ink); font-weight: 700; }
.ac-autolink {
  color: var(--ac-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.ac-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.ac-link,
.ac-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid var(--ac-line-2);
  border-radius: 8px;
  background: #fff;
  color: var(--ac-ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.ac-link-i { width: 14px; height: 14px; color: var(--ac-muted); }
.ac-link:hover,
a.ac-btn:hover { background: var(--ac-hover); border-color: #9fa78f; }
.ac-btn-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.ac-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 9px 16px 9px 19px;
  border-top: 1px solid var(--ac-line);
  background: var(--ac-soft);
  font-size: 13px;
}
.ac-contact { margin: 0; color: var(--ac-text); }
.ac-contact-k { margin-right: 6px; color: var(--ac-muted); font-weight: 700; }
.ac-contact-who { color: var(--ac-ink); font-weight: 600; }
.ac-sep { margin: 0 6px; color: var(--ac-line-2); }
.ac-contact-link {
  color: var(--ac-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ac-date {
  margin: 0;
  color: var(--ac-muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- 부서 창구 카드 ---------- */
.ac-dept { padding: 12px 14px 14px; }
.ac-dept-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}
.ac-dept-head::before {
  content: "";
  align-self: center;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--ac-lime);
}
.ac-dept-name {
  margin: 0;
  color: var(--ac-ink);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
}
.ac-dept-label { margin: 8px 0 0; color: var(--ac-text); font-size: 14px; }
.ac-dept-label + .ac-dept-scope { margin-top: 2px; }
.ac-dept-scope { margin: 8px 0 0; font-size: 14px; }
.ac-dept-k {
  display: inline-block;
  margin-right: 6px;
  color: var(--ac-muted);
  font-size: 12.5px;
  font-weight: 700;
}
.ac-dept-info {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ac-text);
  font-size: 13.5px;
}
.ac-dept-info li { display: flex; align-items: flex-start; gap: 6px; }
.ac-dept-info li + li { margin-top: 2px; }
.ac-dept-info .ac-ico { margin-top: 3px; color: var(--ac-muted); }
.ac-dept .ac-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.ac-dept .ac-btn .ac-ico { color: var(--ac-muted); }
span.ac-btn { color: var(--ac-text); }
.ac-dept-none { margin: 8px 0 0; color: var(--ac-muted); font-size: 13px; }
.ac-dept--compact { padding: 10px 12px 12px; }
.ac-dept--compact .ac-dept-scope { margin-top: 4px; font-size: 13.5px; }
.ac-dept--compact .ac-actions { margin-top: 8px; }

.ac-card a:focus-visible,
.ac-dept a:focus-visible {
  outline: 2px solid var(--ac-focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.ac-link:focus-visible,
.ac-btn:focus-visible { border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  .ac-link, .ac-btn { transition: none; }
}

/* ---------- 챗 화면 말투(render opts.chat) — 문서 카드가 아니라 챗봇이 건네는 말 ----------
 * 강조선·배지·라임 번호를 빼고, 요약을 첫 문장으로. 말풍선과 같은 모서리(왼쪽 위만 각진).
 */
.ac-card--chat { border-radius: 4px 16px 16px 16px; }
.ac-card--chat::before { content: none; }
.ac-card--chat .ac-body { padding: 14px 16px 14px; }
.ac-card--chat .ac-title {
  margin-bottom: 4px;
  color: var(--ac-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
}
.ac-card--chat .ac-summary {
  margin: 0;
  color: var(--ac-ink);
  font-size: 15px;
  line-height: 1.6;
}
.ac-card--chat .ac-sec { margin-top: 14px; padding-top: 12px; border-top: 1px solid #eceee8; }
.ac-card--chat .ac-sec-title { color: var(--ac-ink); font-size: 13.5px; letter-spacing: 0; }
.ac-card--chat .ac-step { padding-left: 28px; }
.ac-card--chat .ac-step::before {
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eef0ea;
  color: var(--ac-ink);
  font-size: 11.5px;
  line-height: 20px;
}
.ac-card--chat .ac-notes { padding: 12px 0 0; border-radius: 0; background: none; }
.ac-card--chat .ac-note { color: var(--ac-text); }
.ac-card--chat .ac-foot { padding: 9px 16px; background: #fafaf8; }
