@charset "UTF-8";
/* KADA 요구사항 접수 — 공통 스타일
 *
 * 색은 공식 CI(01_심볼마크_기본형_컬러.jpg)에서 추출한 값을 그대로 씁니다.
 *   #004894 네이비 · #0085C8 블루 · #62AFE3 라이트블루
 *   #D6063A 레드 · #A80021 다크레드 · #EE8484 라이트레드
 *
 * 프로젝트별 강조색(--accent)은 View::head 에서 인라인으로 주입해
 * 「지금 어느 부서 화면인지」를 색으로 구분합니다.
 *
 * 아이콘은 Lucide(ISC) 를 인라인 SVG 로 심습니다 — 이모지·웹폰트 미사용.
 */

*, *::before, *::after { box-sizing: border-box; }

:root {
  /* KADA 브랜드 */
  --navy: #004894;
  --navy-rgb: 0, 72, 148;
  --blue: #0085C8;
  --sky: #62AFE3;
  --red: #D6063A;
  --red-dark: #A80021;
  --red-light: #EE8484;

  /* 앰플트리 — 유지보수 제공사 */
  --amp: #ED1846;
  --amp-rgb: 237, 24, 70;

  /* 타이포 — Pretendard 가변 폰트 하나로 굵기를 다 낸다 */
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo,
               "Pretendard Variable", monospace;

  /* 크기 — 본문 15px 기준 단계 */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-base: 15px;
  --fs-lg: 17px;
  --fs-xl: 21px;
  --fs-2xl: 24px;

  /* 굵기 */
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* 자간 — 한글은 큰 글자일수록 좁혀야 안정적으로 보인다 */
  --ls-tight: -.025em;
  --ls-snug: -.015em;
  --ls-normal: -.005em;

  /* 중립 */
  --bg: #f4f6f9;
  --panel: #fff;
  --line: #e2e7ee;
  --line-soft: #eef1f6;
  --text: #16202e;
  --text-mid: #48566a;
  --dim: #6b7a90;

  /* 의미 */
  --danger: var(--red);
  --ok: #0f8a4d;
  --warn: #b3690a;

  --radius: 10px;
  --radius-lg: 14px;
  --tap: 44px;               /* 최소 터치 타겟 */
  --shadow-sm: 0 1px 2px rgba(16, 32, 46, .06);
  --shadow-md: 0 4px 16px rgba(16, 32, 46, .10);
  --shadow-lg: 0 12px 32px rgba(16, 32, 46, .16);
  --accent: var(--navy);     /* 기본값 — 프로젝트 화면에서 덮어씀 */
  --accent-rgb: 0, 72, 148;
}

html { -webkit-text-size-adjust: 100%; }

/* 가로 스크롤 금지 — 좁은 화면에서 가로 스크롤이 생기면 아무도 쓰지 않는다.
   넓은 콘텐츠(표·코드블록)는 각자 overflow-x:auto 컨테이너 안에서만 스크롤한다. */
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  line-height: 1.65;
  letter-spacing: var(--ls-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;      /* 한글 단어 중간 줄바꿈 방지 */
  font-variant-numeric: tabular-nums;  /* 숫자 폭 고정 — 표·카운터가 흔들리지 않게 */
}

/* 폼 요소는 폰트를 물려받지 않으므로 명시 */
input, textarea, select, button { font-family: var(--font); }
code, pre, .diag-pre { font-family: var(--font-mono); }

a { color: inherit; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.dim { color: var(--dim); }
.hint { color: var(--dim); font-size: 13px; }

/* 인라인 SVG 아이콘 공통 */
.ico {
  display: inline-block; vertical-align: -0.18em;
  flex: none; stroke-width: 2;
}
.ico-mute { color: var(--dim); }

/* ── 상단바 ─────────────────────────────────── */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 30;
}
/* 프로젝트 색 띠 — 어느 부서 화면인지 즉시 구분 */
.topbar::before {
  content: ""; display: block; height: 3px; background: var(--accent);
}
.topbar-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 18px; min-height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-div { width: 1px; height: 20px; background: var(--line); }
.brand-name {
  font-weight: var(--fw-semibold); font-size: var(--fs-base);
  white-space: nowrap; letter-spacing: var(--ls-snug);
}
.single-project {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--accent);
  padding: 5px 12px; background: rgba(var(--accent-rgb), 0.08);
  border-radius: 999px;
}

/* 프로젝트 탭 */
.ptabs {
  display: flex; gap: 4px; overflow-x: auto; flex: 1;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.ptabs::-webkit-scrollbar { display: none; }
.ptab {
  display: inline-flex; align-items: center; min-height: 36px;
  padding: 0 15px; border-radius: 999px; text-decoration: none;
  font-size: 14px; font-weight: 600; color: var(--dim);
  white-space: nowrap; border: 1px solid transparent; transition: .15s;
}
.ptab:hover { background: var(--line-soft); color: var(--text); }
.ptab.is-on { color: #fff; background: var(--c); border-color: var(--c); }

.topbar-user { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* 비밀번호 변경 화면 — 폼 하나뿐이라 좁게 */
.pw-page { max-width: 520px; margin: 0 auto; }
.pw-page .page-sub { margin-bottom: 18px; }
.pw-div {
  border: 0; border-top: 1px dashed var(--line);
  margin: 4px 0 20px;
}

/* 이용 안내 — 상단 상시 노출 */
.top-help {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 12px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--text-mid); text-decoration: none;
  border: 1px solid var(--line); background: var(--panel); transition: .15s;
}
.top-help:hover {
  color: var(--accent); border-color: var(--accent);
  background: rgba(var(--accent-rgb), .06);
}
.top-help.is-on {
  color: #fff; background: var(--accent); border-color: var(--accent);
}
/* 이름을 누르면 비밀번호 변경으로 — 계정 설정이 따로 없어 여기에 붙였다 */
.who {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-sm); white-space: nowrap; text-decoration: none;
  padding: 6px 10px; border-radius: 999px; min-height: 34px; transition: .15s;
}
.who:hover { background: var(--line-soft); }
.who.is-on { background: rgba(var(--accent-rgb), .09); color: var(--accent); }
.role {
  font-style: normal; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; background: var(--line-soft); color: var(--dim);
}
.role-super   { background: #fdf1d6; color: #8a5a06; }
.role-manager { background: #e2effb; color: var(--navy); }

/* ── 레이아웃 ───────────────────────────────── */
.wrap { max-width: 1140px; margin: 0 auto; padding: 24px 20px 100px; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-title {
  margin: 0; font-size: var(--fs-2xl); font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
}
.page-sub {
  margin: 5px 0 0; color: var(--dim); font-size: 13px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.scope-badge {
  font-style: normal; padding: 3px 9px; font-weight: 600;
  background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px;
}
.crumb { margin: 0 0 14px; font-size: 14px; }
.crumb a {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--dim); text-decoration: none; font-weight: 500;
  min-height: 32px;
}
.crumb a:hover { color: var(--accent); }

/* ── 버튼 ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--tap); padding: 0 18px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text);
  font-size: 14px; font-weight: 600; font-family: inherit;
  text-decoration: none; cursor: pointer; transition: .15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--line-soft); border-color: #d3dae4; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn-danger { color: var(--danger); border-color: #f2ccd4; background: #fff; }
.btn-danger:hover { background: #fdf2f4; border-color: #e8aab8; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-toggle.is-on {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-plain {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; padding: 6px 8px; cursor: pointer;
  color: var(--dim); font-size: 13px; font-family: inherit; text-decoration: none;
  border-radius: 6px;
}
.btn-plain:hover { color: var(--text); background: var(--line-soft); }
.btn-tiny { font-size: 12px; padding: 4px 6px; }
.inline { display: inline; }

/* ── 알림 띠 ────────────────────────────────── */
.banner {
  display: flex; align-items: flex-start; gap: 11px; flex-wrap: wrap;
  padding: 13px 16px; border-radius: var(--radius);
  margin-bottom: 18px; font-size: 14px; border: 1px solid; line-height: 1.55;
}
.banner .ico { margin-top: 1px; }
.banner > span { flex: 1; min-width: 200px; }
.banner-error { background: #fdf2f4; border-color: #f2ccd4; color: #8f0a26; }
.banner-warn  { background: #fffaef; border-color: #f5e0b4; color: #7d4a06; }
.banner-ok    { background: #eefaf3; border-color: #bfe8d2; color: #0b6b3c; }
.btn-retry {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: auto; padding: 7px 13px; border-radius: 7px; min-height: 34px;
  background: #fff; border: 1px solid currentColor;
  text-decoration: none; font-weight: 600; font-size: 13px;
}

.setup-help {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.setup-help h3 {
  margin: 0 0 10px; font-size: 15px;
  display: flex; align-items: center; gap: 8px;
}
.setup-help ul { margin: 0; padding-left: 20px; color: var(--text-mid); font-size: 14px; }
.setup-help li { margin: 6px 0; }
code {
  background: var(--line-soft); padding: 2px 6px; border-radius: 4px;
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--navy);
}

/* ── 요약 위젯 ──────────────────────────────── */
.summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.summary-item {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 12px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.summary-n {
  display: block; font-size: var(--fs-2xl); font-weight: var(--fw-bold);
  line-height: 1.15; letter-spacing: var(--ls-tight);
}
.summary-l { display: block; font-size: 12px; color: var(--dim); margin-top: 3px; }
.sum-all .summary-n  { color: var(--accent); }
.sum-open .summary-n { color: var(--blue); }
.sum-done .summary-n { color: var(--ok); }
.sum-hold .summary-n { color: var(--warn); }

/* ── 상태 탭 ────────────────────────────────── */
.stabs {
  display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px;
  margin-bottom: 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.stabs::-webkit-scrollbar { display: none; }
.stab {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0 15px; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; text-decoration: none; font-size: 14px;
  color: var(--text-mid); font-weight: 500; transition: .15s;
}
.stab:hover { border-color: var(--accent); color: var(--accent); }
.stab em {
  font-style: normal; font-size: 12px; font-weight: 700;
  background: var(--line-soft); padding: 2px 7px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.stab.is-on {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.stab.is-on em { background: rgba(255,255,255,.22); color: #fff; }

/* ── 툴바 ───────────────────────────────────── */
.toolbar { display: flex; gap: 9px; margin-bottom: 18px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-wrap .ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--dim); pointer-events: none;
}
.search {
  width: 100%; min-height: var(--tap); padding: 0 14px 0 42px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); font-size: 15px; font-family: inherit; color: var(--text);
  box-shadow: var(--shadow-sm);
}
.search::placeholder { color: var(--dim); }

/* ── 표 ─────────────────────────────────────── */
.table-wrap {
  overflow-x: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.tickets { width: 100%; border-collapse: collapse; font-size: 14px; }
.tickets th, .tickets td {
  padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line-soft);
}
.tickets th {
  background: #fafbfd; font-size: 12px; color: var(--dim);
  font-weight: 700; white-space: nowrap; letter-spacing: .02em;
}
.tickets tbody tr:last-child td { border-bottom: 0; }
.tickets tbody tr { transition: background .12s; }
.tickets tbody tr:hover { background: #fafbfd; }
.tickets .c-title a {
  font-weight: 600; text-decoration: none; color: var(--text);
}
.tickets .c-title a:hover { color: var(--accent); text-decoration: underline; }
.c-status, .c-meta, .c-date { white-space: nowrap; }
.c-date { color: var(--dim); font-variant-numeric: tabular-nums; }
.tickets tr.is-mine { background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.04), transparent 40%); }
.mine-tag {
  font-style: normal; font-size: 11px; margin-left: 7px; font-weight: 600;
  padding: 2px 7px; border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.10); color: var(--accent);
}

/* ── 칩 ─────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; font-weight: 600;
}
.chip-status { background: var(--line-soft); color: var(--text-mid); }
.s-received    { background: #e7effc; color: var(--navy); }
.s-in_progress { background: #e0f2fb; color: #036a9e; }
.s-hold        { background: #fdf1d6; color: #8a5a06; }
.s-done        { background: #e4f6ec; color: #0b6b3c; }
.s-canceled, .s-cancelled { background: #eef1f6; color: var(--dim); }
.chip-pri { margin-left: 6px; background: var(--line-soft); color: var(--text-mid); }
.p-high, .p-urgent { background: #fdeaee; color: var(--red-dark); }
.p-low { background: #eef1f6; color: var(--dim); }
.chip-n {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--line-soft); color: var(--dim);
  margin-right: 5px; font-weight: 600; padding: 3px 8px;
}

/* ── 카드 (모바일) ──────────────────────────── */
.cards { display: none; list-style: none; margin: 0; padding: 0; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); margin-bottom: 11px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card.is-mine { border-left: 3px solid var(--accent); }
.card-link { display: block; padding: 15px; text-decoration: none; }
.card-link:active { background: var(--line-soft); }
.card-top {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 9px;
}
.card-title {
  margin: 0 0 5px; font-size: var(--fs-lg); line-height: 1.45;
  font-weight: var(--fw-semibold); letter-spacing: var(--ls-snug);
}
.card-sum { margin: 0 0 10px; color: var(--dim); font-size: 13px; line-height: 1.6; }
.card-foot {
  display: flex; gap: 13px; flex-wrap: wrap; font-size: 12px; color: var(--dim);
  align-items: center;
}
.card-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ── 빈 화면 ────────────────────────────────── */
.empty {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 56px 28px; text-align: center;
  box-shadow: var(--shadow-sm);
}
.empty-icon {
  width: 64px; height: 64px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--line-soft); color: var(--dim);
}
.empty-icon .ico { stroke-width: 1.6; }
.empty h2 {
  margin: 0 0 9px; font-size: var(--fs-lg); font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
}
.empty p { margin: 0 0 8px; color: var(--dim); font-size: 14px; line-height: 1.7; }
.empty-sub { font-size: 13px; }
.empty .btn { margin-top: 14px; }

/* ── 페이징 ─────────────────────────────────── */
.pager { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin: 24px 0 6px; }
.pg {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--tap); min-height: var(--tap); padding: 0 11px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); text-decoration: none; font-size: 14px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.pg:hover { background: var(--line-soft); border-color: var(--accent); color: var(--accent); }
.pg.is-on {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700;
}
.pg-gap { display: inline-flex; align-items: center; padding: 0 5px; color: var(--dim); }
.pager-total { text-align: center; color: var(--dim); font-size: 13px; margin: 0; }

/* ── 상세 ───────────────────────────────────── */
.detail {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}
.detail-head { padding: 22px; border-bottom: 1px solid var(--line-soft); }
.detail-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.detail-title {
  margin: 0 0 18px; font-size: var(--fs-xl); line-height: 1.45;
  font-weight: var(--fw-bold); letter-spacing: var(--ls-tight);
}
.detail-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin: 0;
}
.detail-meta dt {
  font-size: 12px; color: var(--dim); margin-bottom: 3px;
  display: flex; align-items: center; gap: 5px;
}
.detail-meta dd { margin: 0; font-size: 14px; font-weight: 600; }
.readonly-note {
  margin: 18px 0 0; padding: 10px 13px; background: var(--line-soft);
  border-radius: 7px; font-size: 12px; color: var(--text-mid);
  display: flex; align-items: center; gap: 7px;
}
.detail-body {
  padding: 22px; font-size: 15px; line-height: 1.8; word-break: break-word;
}
.detail-actions {
  display: flex; gap: 9px; justify-content: flex-end;
  padding: 16px 22px; background: #fafbfd; border-top: 1px solid var(--line-soft);
}

.sec-title {
  font-size: 15px; margin: 0 0 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.sec-title em {
  font-style: normal; color: var(--dim); font-weight: 600; font-size: 13px;
  background: var(--line-soft); padding: 2px 8px; border-radius: 999px;
}

/* ── 첨부 ───────────────────────────────────── */
.attach { padding: 0 22px 22px; }
.attach-list {
  list-style: none; margin: 0 0 10px; padding: 0;
  display: flex; gap: 11px; flex-wrap: wrap;
}
.attach-thumb { display: block; text-decoration: none; width: 132px; }
.attach-thumb img {
  width: 132px; height: 99px; object-fit: cover;
  border: 1px solid var(--line); border-radius: 9px; display: block; background: var(--bg);
}
.attach-thumb:hover img { border-color: var(--accent); }
.attach-name {
  display: block; font-size: 12px; color: var(--dim); margin-top: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-file {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: var(--tap); padding: 0 15px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); text-decoration: none; font-size: 14px; font-weight: 500;
}
.attach-file:hover { background: var(--line-soft); border-color: var(--accent); }
.attach-file em { font-style: normal; color: var(--dim); font-size: 12px; }

/* ── 진행 대화 ──────────────────────────────── */
.thread {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm);
}
.thread-empty {
  color: var(--dim); font-size: 14px; text-align: center;
  padding: 28px; background: var(--bg); border-radius: 9px; margin: 0 0 18px;
}
.msgs {
  list-style: none; margin: 0 0 22px; padding: 0;
  display: flex; flex-direction: column; gap: 16px;
}
.msg {
  max-width: 76%; padding: 13px 15px; border-radius: 13px; position: relative;
}
.msg-requester {
  align-self: flex-end;
  background: rgba(var(--accent-rgb), 0.07);
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-bottom-right-radius: 4px;
}
.msg-staff {
  align-self: flex-start; background: var(--bg); border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.msg-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap;
}
.msg-who { font-size: 13px; font-weight: 700; }
.msg-badge {
  font-style: normal; font-size: 11px; padding: 2px 7px; font-weight: 600;
  border-radius: 4px; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; gap: 4px;
}
.msg-when {
  font-size: 11px; color: var(--dim); margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.msg-body { font-size: 14px; line-height: 1.75; word-break: break-word; }
.msg-files {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: flex; gap: 9px; flex-wrap: wrap;
}
.msg-files img {
  width: 92px; height: 69px; object-fit: cover;
  border-radius: 7px; border: 1px solid var(--line); display: block;
}
.msg-files a {
  font-size: 13px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px; color: var(--accent);
}
.msg-del { position: absolute; top: 9px; right: 9px; }

/* ── 폼 ─────────────────────────────────────── */
.form {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
}
.reply { background: none; border: 0; padding: 0; }
.field { display: block; margin-bottom: 20px; }
.field-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; margin-bottom: 7px;
}
.req { color: var(--danger); font-style: normal; }
.field input[type="text"], .field input[type="tel"], .field input[type="password"],
.field input[type="search"], .field select, .field textarea,
.reply textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; font-size: 15px; font-family: inherit; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:hover, .field textarea:hover, .field select:hover { border-color: #cbd4e0; }
.field input:focus, .field textarea:focus, .field select:focus,
.reply textarea:focus, .search:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.field input[type="text"], .field input[type="tel"],
.field input[type="password"], .field select { min-height: var(--tap); }
.field textarea, .reply textarea { resize: vertical; line-height: 1.75; }
.field-hint {
  display: block; font-size: 12px; color: var(--dim); margin-top: 6px; line-height: 1.6;
}
.field-error {
  display: flex; align-items: flex-start; gap: 5px;
  font-size: 13px; color: var(--danger); margin-top: 6px; font-weight: 600;
}
.field.has-error input, .field.has-error textarea, .field.has-error select {
  border-color: var(--danger); background: #fffbfc;
}
/* minmax(0,1fr) — 1fr 만 쓰면 자식이 넓을 때 칸이 늘어나 가로 스크롤이 생긴다 */
.field-row {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
}
.form-actions {
  display: flex; gap: 9px; justify-content: flex-end;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-soft);
}

/* 글자수 카운터 */
.counter {
  font-size: 12px; color: var(--dim); text-align: right; margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.counter.is-over { color: var(--danger); font-weight: 700; }

/* ── 작성 예시 (템플릿) ─────────────────────── */
.tpl {
  background: rgba(var(--accent-rgb), 0.04);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: var(--radius); padding: 15px 17px; margin-bottom: 20px;
}
.tpl-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
  font-size: 13px; font-weight: 700; color: var(--accent);
}
.tpl-sub { margin: 0 0 12px; font-size: 12px; color: var(--text-mid); }
.tpl-list { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 13px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  font: 600 13px/1 inherit; font-family: inherit; color: var(--text-mid);
  transition: .15s;
}
.tpl-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(var(--accent-rgb), 0.06);
}

/* ── 파일 첨부 (드래그앤드롭) ───────────────── */
.dropzone {
  position: relative; border: 2px dashed var(--line);
  border-radius: var(--radius); background: #fcfdfe;
  padding: 26px 20px; text-align: center; transition: .18s; cursor: pointer;
}
.dropzone:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.04); }
.dropzone.is-over {
  border-color: var(--accent); background: rgba(var(--accent-rgb), 0.10);
  transform: scale(1.005);
}
.dropzone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.dz-icon { color: var(--accent); margin-bottom: 9px; }
.dz-main { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.dz-main b { color: var(--accent); text-decoration: underline; }
.dz-sub { font-size: 12px; color: var(--dim); line-height: 1.6; }

.upload-list { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.up-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 9px; font-size: 13px;
}
.up-thumb {
  width: 38px; height: 38px; border-radius: 6px; object-fit: cover;
  flex: none; background: var(--line-soft); border: 1px solid var(--line);
}
.up-ico {
  width: 38px; height: 38px; border-radius: 6px; flex: none;
  background: var(--line-soft); color: var(--dim);
  display: flex; align-items: center; justify-content: center;
}
.up-meta { flex: 1; min-width: 0; }
.up-name {
  display: block; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-weight: 600;
}
.up-state { font-size: 12px; color: var(--dim); }
.up-bar {
  height: 4px; background: var(--line-soft); border-radius: 999px;
  overflow: hidden; margin-top: 5px;
}
.up-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.up-item.is-err { background: #fdf2f4; border-color: #f2ccd4; }
.up-item.is-err .up-state { color: var(--danger); font-weight: 600; }
.up-item.is-ok .up-state { color: var(--ok); font-weight: 600; }
.up-act { display: flex; gap: 2px; flex: none; }
.up-del {
  background: none; border: 0; cursor: pointer; color: var(--dim);
  padding: 7px; border-radius: 6px; display: inline-flex;
  align-items: center; min-width: 34px; min-height: 34px; justify-content: center;
}
.up-del:hover { color: var(--danger); background: #fdf2f4; }

.reply-row { display: flex; gap: 10px; align-items: flex-start; }
.reply-row textarea { flex: 1; }
.reply-attach { margin-top: 11px; }
.reply-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 13px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  font: 600 13px inherit; font-family: inherit; color: var(--text-mid); position: relative;
}
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

/* ── 로그인 ─────────────────────────────────── */
/* 로그인은 .wrap 안에 있어 폭이 제한된다 — 배경을 화면 전체로 빼낸다 */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 124px);
  padding: 24px 0;
}
body:has(.login-page) {
  background:
    radial-gradient(1100px 520px at 50% 0, rgba(var(--navy-rgb), .09), transparent 70%),
    var(--bg);
}
/* :has() 미지원 브라우저는 단색 배경으로 — 깨지지 않는다 */
.login-card {
  width: 100%; max-width: 400px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; padding: 38px 32px;
  box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand img { height: 42px; width: auto; }
.login-title {
  margin: 18px 0 5px; font-size: var(--fs-xl); text-align: center;
  font-weight: var(--fw-bold); letter-spacing: var(--ls-tight);
}
.login-sub {
  margin: 0 0 26px; text-align: center; color: var(--dim); font-size: 13px;
  line-height: 1.6;
}
.login-card .field { margin-bottom: 15px; }
.login-card input {
  width: 100%; min-height: var(--tap); padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 15px; font-family: inherit;
}
.login-error { margin-bottom: 16px; justify-content: center; }
.login-note {
  margin: 22px 0 0; font-size: 12px; color: var(--dim);
  text-align: center; line-height: 1.7;
  padding-top: 18px; border-top: 1px solid var(--line-soft);
}
.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; color: var(--dim);
  padding: 8px; border-radius: 6px; display: flex;
  min-width: 36px; min-height: 36px; align-items: center; justify-content: center;
}
.pw-toggle:hover { color: var(--text); background: var(--line-soft); }

/* ── 이용 안내 ──────────────────────────────── */
.guide {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.guide > p { margin: 0 0 10px; font-size: var(--fs-md); line-height: 1.75; }

.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.flow-step { display: flex; gap: 14px; align-items: flex-start; }
.flow-n {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: var(--fw-bold);
}
.flow-step strong { display: block; font-size: var(--fs-md); margin-bottom: 3px; }
.flow-step p { margin: 0; font-size: var(--fs-sm); color: var(--dim); line-height: 1.7; }

.tips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tip {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; background: #fcfdfe;
}
.tip h3 {
  margin: 0 0 9px; font-size: var(--fs-sm); font-weight: var(--fw-bold);
  display: flex; align-items: center; gap: 6px;
}
.tip:first-child h3 { color: var(--ok); }
.tip:last-child h3 { color: var(--danger); }
.tip-good, .tip-bad {
  margin: 0 0 9px; font-size: var(--fs-md); line-height: 1.75;
  padding: 11px 13px; border-radius: 8px;
}
.tip-good { background: #eefaf3; border: 1px solid #bfe8d2; }
.tip-bad { background: #fdf2f4; border: 1px solid #f2ccd4; color: var(--text-mid); }
.tip-why { margin: 0; font-size: var(--fs-xs); color: var(--dim); line-height: 1.7; }

.plain-list { margin: 0; padding-left: 20px; font-size: var(--fs-md); line-height: 1.9; }
.plain-list li { margin: 2px 0; }

.faq { margin: 0; }
.faq dt {
  font-size: var(--fs-md); font-weight: var(--fw-semibold);
  margin-top: 16px; padding-left: 20px; position: relative;
}
.faq dt:first-child { margin-top: 0; }
.faq dt::before {
  content: "Q"; position: absolute; left: 0;
  color: var(--accent); font-weight: var(--fw-bold);
}
.faq dd {
  margin: 5px 0 0 20px; font-size: var(--fs-sm);
  color: var(--dim); line-height: 1.8;
}

.guide-amp { border-color: rgba(var(--amp-rgb), .3); }
.amp-box {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  padding: 17px 19px; border-radius: var(--radius);
  background: rgba(var(--amp-rgb), .05);
  border: 1px solid rgba(var(--amp-rgb), .18);
  margin-bottom: 12px;
}
.amp-box img { height: 26px; width: auto; flex: none; }
.amp-box p {
  margin: 0; flex: 1; min-width: 220px;
  font-size: var(--fs-md); line-height: 1.75;
}
.guide a { color: var(--accent); font-weight: var(--fw-medium); }

/* ── 제공사 표기 ─────────────────────────────
 * PC  — 상단바 아래 얇은 띠(.topbar-by). 스크롤 없이 항상 보인다.
 * 모바일 — 상단은 좁아 터지므로 숨기고 하단 푸터(.foot)가 맡는다.
 */
.topbar-by {
  border-top: 1px solid var(--line-soft);
  background: #fbfcfe;
}
.topbar-by-inner {
  max-width: 1140px; margin: 0 auto; padding: 6px 20px;
  display: flex; align-items: center; justify-content: flex-end; gap: 9px;
}
.by-lbl {
  font-size: 11px; color: var(--dim); letter-spacing: var(--ls-normal);
}
.by-diag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--dim); text-decoration: none;
  padding: 3px 7px; border-radius: 5px; margin-right: auto;
}
.by-diag:hover { color: var(--accent); background: rgba(var(--accent-rgb), .07); }
.by-sep { width: 1px; height: 11px; background: var(--line); }
.amp-link {
  display: inline-flex; align-items: center; text-decoration: none;
  border-radius: 6px; padding: 2px 4px; transition: .15s;
}
.amp-link img { display: block; width: auto; }
.amp-link:hover { background: rgba(var(--amp-rgb), .09); }
.amp-link:focus-visible { outline: 2px solid var(--amp); outline-offset: 1px; }
.by-logo { height: 17px; }

/* 푸터 — 모바일 전용 (PC 는 위 .topbar-by 가 대신) */
.foot { display: none; }
.foot-inner {
  max-width: 1140px; margin: 0 auto;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.foot-by {
  display: flex; align-items: center; gap: 9px;
  font-size: var(--fs-xs); color: var(--dim);
}
.foot-by img { height: 17px; width: auto; display: block; }
.foot-by .lbl { white-space: nowrap; }
.foot-links {
  margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.foot-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-xs); color: var(--dim); text-decoration: none;
  padding: 7px 10px; border-radius: 7px; min-height: 34px;
}
.foot-link:hover { color: var(--amp); background: rgba(var(--amp-rgb), .07); }
.foot-note {
  width: 100%; font-size: var(--fs-xs); color: var(--dim);
  line-height: 1.7; margin: 0; padding-top: 12px;
  border-top: 1px dashed var(--line-soft);
}

/* 로그인 화면의 제공사 표기 */
.login-by {
  margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line-soft);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.login-by img { height: 18px; width: auto; }
.login-by span { font-size: var(--fs-xs); color: var(--dim); }

/* ── FAB ────────────────────────────────────── */
.fab { display: none; }

/* ── 시스템 상태 (고객용) ───────────────────── */
.st-page { max-width: 640px; margin: 0 auto; }
.st-page .page-sub { margin-bottom: 20px; }

/* 한 줄 요약 — 여기만 봐도 판단되게 */
.st-hero {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 22px; border-radius: var(--radius-lg);
  border: 1px solid; margin-bottom: 20px;
}
.st-hero-ico { flex: none; margin-top: 1px; }
.st-hero-txt { display: flex; flex-direction: column; gap: 4px; }
.st-hero-txt strong {
  font-size: var(--fs-lg); font-weight: var(--fw-bold);
  letter-spacing: var(--ls-snug);
}
.st-hero-txt span { font-size: var(--fs-md); line-height: 1.65; }
.st-hero.is-ok {
  background: #eefaf3; border-color: #bfe8d2; color: #0b6b3c;
}
.st-hero.is-partial {
  background: #fffaef; border-color: #f5e0b4; color: #7d4a06;
}
.st-hero.is-down {
  background: #fdf2f4; border-color: #f2ccd4; color: #8f0a26;
}

.st-list {
  list-style: none; margin: 0 0 14px; padding: 0;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.st-item {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 15px 18px; border-bottom: 1px solid var(--line-soft);
}
.st-item:last-child { border-bottom: 0; }
.st-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--c); flex: none;
}
.st-name { font-weight: var(--fw-semibold); font-size: var(--fs-md); }
.st-badge {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: auto; padding: 4px 11px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
}
.st-badge.is-ok   { background: #e4f6ec; color: #0b6b3c; }
.st-badge.is-down { background: #fdeaee; color: var(--red-dark); }
.st-note {
  width: 100%; font-size: var(--fs-xs); color: var(--dim);
  padding-left: 20px;
}

.st-time {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); color: var(--dim); margin: 0 0 20px;
}
.st-refresh {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: auto; padding: 6px 11px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--panel);
  text-decoration: none; font-weight: var(--fw-semibold); min-height: 32px;
}
.st-refresh:hover { border-color: var(--accent); color: var(--accent); }

.st-help {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.st-help h3 {
  margin: 0 0 10px; font-size: var(--fs-md);
  display: flex; align-items: center; gap: 7px;
}
.st-help ul { margin: 0; padding-left: 20px; font-size: var(--fs-sm); line-height: 1.9; }
.st-help li { color: var(--text-mid); }

.st-by {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 26px 0 0; font-size: var(--fs-xs); color: var(--dim);
}

/* ── 진단 화면 ──────────────────────────────── */
.diag {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.diag-row {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 15px 20px; border-bottom: 1px solid var(--line-soft); font-size: 14px;
}
.diag-row:last-child { border-bottom: 0; }
.diag-name { width: 155px; flex-shrink: 0; font-weight: 700; }
.diag-val { flex: 1; word-break: break-all; min-width: 0; }
.diag-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.d-ok   { background: #e4f6ec; color: #0b6b3c; }
.d-fail { background: #fdeaee; color: var(--red-dark); }
.d-skip { background: #eef1f6; color: var(--dim); }
pre.diag-pre {
  margin: 10px 0 0; padding: 14px; background: #10202f; color: #d9e6f2;
  border-radius: 9px; font: 12px/1.65 ui-monospace, Menlo, monospace;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

/* ── 토스트 ─────────────────────────────────────
 * 「했어요」류 안내는 눈에 띄되 시선을 빼앗지 않아야 한다.
 * 그래서 꽉 찬 색 배경이 아니라 흰 카드 + 얇은 테두리로 두고,
 * 색은 왼쪽 아이콘에만 쓴다. 위치도 화면 중앙이 아닌 우하단.
 */
.toasts {
  position: fixed; right: 20px; z-index: 60;
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none; max-width: min(340px, calc(100vw - 40px));
}
.toast {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); color: var(--text-mid);
  border: 1px solid var(--line);
  padding: 10px 15px; border-radius: 10px;
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  line-height: 1.5; box-shadow: var(--shadow-md);
  animation: toastIn .2s ease-out;
}
/* 색은 왼쪽 점으로만 — 배경을 물들이지 않는다 */
.toast::before {
  content: ""; flex: none;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dim);
}
.toast.is-ok::before  { background: var(--ok); }
.toast.is-err::before { background: var(--danger); }
/* 오류는 조금 더 눈에 띄어야 하니 테두리만 물들인다 */
.toast.is-err { border-color: #f2ccd4; color: #8f0a26; }

@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }

/* 사라질 때도 부드럽게 — JS 가 opacity 를 0 으로 만든다 */
.toast { transition: opacity .25s, transform .25s; }

/* ── 모바일 ─────────────────────────────────── */
@media (max-width: 767px) {
  .wrap { padding: 16px 14px 92px; }

  /* 표를 카드로 — 가로 스크롤 금지 */
  .table-wrap { display: none; }
  .cards { display: block; }

  .page-title { font-size: 20px; }
  .page-head { margin-bottom: 16px; }
  .btn-new { display: none; }          /* FAB 로 대체 */

  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .summary-item { padding: 12px 8px; }
  .summary-n { font-size: 20px; }
  .summary-l { font-size: 11px; }

  .field-row { grid-template-columns: 1fr; gap: 0; }
  .form { padding: 18px; border-radius: var(--radius); }
  .thread { padding: 18px; border-radius: var(--radius); }
  .detail { border-radius: var(--radius); }
  .detail-head, .detail-body { padding: 18px; }
  .attach { padding: 0 18px 18px; }
  .detail-actions { padding: 15px 18px; }
  .detail-title { font-size: 18px; }
  .form-actions { flex-direction: column-reverse; gap: 8px; }
  .form-actions .btn { width: 100%; }

  /* 대화는 좌우 분할보다 위아래로 쌓기 */
  .msg { max-width: 100%; align-self: stretch; }
  .msg-requester { border-left: 3px solid var(--accent); border-bottom-right-radius: 13px; }
  .msg-staff { border-left: 3px solid var(--sky); border-bottom-left-radius: 13px; }

  /* 댓글 입력 하단 고정 */
  .reply {
    position: sticky; bottom: 0; z-index: 20;
    background: var(--panel); margin: 0 -18px -18px;
    padding: 13px 18px calc(13px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(16,32,46,.06);
  }
  .reply-row { flex-direction: column; }
  .reply-row .btn { width: 100%; }

  /* 등록 버튼 우하단 고정 — 엄지가 닿는 자리 */
  .fab {
    display: flex; align-items: center; justify-content: center;
    position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--accent); color: #fff;
    text-decoration: none; z-index: 25;
    box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.45);
  }
  .fab:active { transform: scale(.93); }
  .fab .ico { stroke-width: 2.5; }

  .topbar-inner {
    flex-wrap: wrap; padding: 9px 14px; gap: 9px; min-height: 0;
  }
  .brand-logo { height: 26px; }
  .brand-name { display: none; }        /* 좁은 화면에서는 로고만 */
  .ptabs { order: 3; width: 100%; flex: none; }
  .who .role { display: none; }
  .brand-div { display: none; }

  /* 상단은 아이콘만 남겨 로고·탭 자리를 확보한다 */
  .top-help { padding: 0 9px; min-width: 36px; justify-content: center; }
  .top-help-t, .logout-t { display: none; }
  .who { font-size: var(--fs-xs); }

  .dropzone { padding: 20px 16px; }
  .tpl { padding: 13px 15px; }
  .empty { padding: 40px 20px; }
  .empty-icon { width: 56px; height: 56px; }

  .diag-row { flex-direction: column; gap: 6px; }
  .diag-name { width: auto; }

  /* 이용 안내 — 좁은 화면에서는 세로로 */
  .guide { padding: 18px; border-radius: var(--radius); }
  .tips { grid-template-columns: 1fr; }
  .amp-box { gap: 12px; padding: 15px; }

  /* 푸터 */
  .foot { margin-top: 28px; }
  .foot-inner { padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); gap: 10px; }
  .foot-links { margin-left: 0; width: 100%; }
  .foot-by { width: 100%; }

  .foot-note { padding-top: 10px; }

  /* 토스트는 상단으로 — 하단은 FAB·댓글 입력창이 차지한다 */
  .toasts {
    right: 12px; left: 12px; bottom: auto;
    top: calc(12px + env(safe-area-inset-top));
    align-items: stretch; max-width: none;
  }
  .toast { animation-name: toastInTop; }
  @keyframes toastInTop { from { opacity: 0; transform: translateY(-6px); } }

  /* 좁은 화면에서는 상단 띠를 숨기고 푸터를 쓴다 */
  .topbar-by { display: none; }
  .foot {
    display: block;
    border-top: 1px solid var(--line);
    background: var(--panel);
  }

  /* FAB 이 푸터 문구를 가리므로 오른쪽 아래를 비워 둔다.
     .has-fab 는 FAB 을 그리는 화면에서 body 에 직접 붙인다(:has() 미지원 대비). */
  .has-fab .foot-inner { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .has-fab .foot-note { padding-right: 68px; }
}

/* 작은 화면에서 표 헤더 축약 */
@media (max-width: 380px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* iOS 입력 확대 방지 */
@supports (-webkit-touch-callout: none) {
  input, textarea, select { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important; animation: none !important;
  }
}

/* 인쇄 */
@media print {
  .topbar, .fab, .reply, .detail-actions, .toolbar, .stabs, .pager { display: none; }
  .wrap { padding: 0; max-width: none; }
  .detail, .thread { border: 0; box-shadow: none; }
}
