:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --ink: #1d1b19;
  --muted: #7b756d;
  --line: #e4dfd7;
  --accent: #1d1b19;
  --accent-ink: #ffffff;
  --danger: #b3261e;
  --danger-bg: #fdeceb;
  --warn-bg: #fff6dc;
  --ok: #2e7d4f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 20px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

/* ── 버튼 ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: #cfc8bd; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: #ecc4c0; }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.big { min-height: 50px; width: 100%; font-size: 16px; }
.btn.ghost { border-color: transparent; background: transparent; }

/* ── 상단 바 ───────────────────────────── */
#topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(246, 244, 240, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; letter-spacing: .14em; text-decoration: none; }
.page-title {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; margin-left: -8px; border-radius: 8px;
  color: var(--muted); font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.page-title:hover { background: var(--line); color: var(--ink); }
.pt-reload { font-size: 14px; opacity: .55; }
.page-title:hover .pt-reload { opacity: 1; }
.spacer { flex: 1; }
.who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
.who small { margin-left: 6px; padding: 2px 7px; border-radius: 99px; background: var(--line); font-size: 11px; }
#sync { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
#sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
#sync[data-state="saving"] i { background: #d99a00; }
#sync[data-state="offline"] i { background: var(--danger); }
@media (max-width: 720px) {
  #sync .sync-text { display: none; }
  #sync[data-state="offline"] .sync-text { display: inline; }
  /* 휴대폰: 도구 이름은 숨기고 ↻ 만 남긴다 */
  #topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .who { max-width: 40vw; }
  .brand { letter-spacing: .08em; }
  #logout-top { padding: 0 9px; }
  .who small { margin-left: 4px; }
  .page-title .pt-text { display: none; }
  .page-title { padding: 4px 6px; margin-left: -4px; }
  .pt-reload { font-size: 17px; opacity: .7; }
}

/* ── 로그인/안내 화면 ───────────────────── */
#gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
#topbar:not([hidden]) ~ #gate { min-height: calc(100dvh - 70px); }
.gate-card {
  width: 100%; max-width: 380px; padding: 32px 24px;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px; text-align: center;
}
.logo { font-size: 28px; font-weight: 800; letter-spacing: .2em; }
.gate-sub { color: var(--muted); margin-top: -10px; }
.gate-hint { color: var(--muted); font-size: 13px; }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; text-align: left; overflow-wrap: anywhere; }
.notice.warn { background: var(--warn-bg); }
.notice.error { background: var(--danger-bg); color: var(--danger); }

/* ── 본문 ─────────────────────────────── */
#main { max-width: 1200px; margin: 0 auto; padding: 16px 16px 80px; }

/* 첫 화면(업무 도구 목록): 도구 이름만 가운데에 보이는 카드 */
/* PC: 한 줄에 4개 · 휴대폰: 한 줄에 3개(낮은 카드) */
.tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.tool {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 98px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); text-decoration: none;
}
.tool h2 { font-size: 17px; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
/* 예전 화면이 남아 있어도 설명·주소 글씨는 보이지 않게 */
.tool p, .tool .path { display: none; }
@media (max-width: 640px) {
  .tools { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tool { min-height: 58px; padding: 6px 8px; }
  .tool h2 { font-size: 14.5px; line-height: 1.3; }
}
.section-title { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 8px; }
/* 첫 화면: "업무 도구" 제목 줄 (오른쪽에 대표 전용 메뉴) */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.section-head .section-title { margin-top: 0; }
.owner-links { display: flex; gap: 6px; }
.owner-link {
  padding: 4px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface);
  color: var(--muted); font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.owner-link:hover { color: var(--ink); border-color: #cfc8bd; }
#owner-links { display: contents; }
button.owner-link { font-family: inherit; cursor: pointer; line-height: 1.5; }
.owner-link.on { background: var(--ink); border-color: var(--ink); color: #fff; }
/* 카드 순서 바꾸기 (shared/tool-order.js) */
.tools.editing .tool {
  position: relative; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  outline: 2px dashed #cfc8bd; outline-offset: -2px;
}
.tools.editing .tool.dragging { cursor: grabbing; opacity: .75; outline-color: var(--ink); transform: scale(1.04); }
.tool-move { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; gap: 6px; }
.tool-mv {
  width: 30px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  font-size: 11px; color: var(--ink); cursor: pointer;
}
.tool-mv:disabled { opacity: .3; cursor: default; }
/* 대표: 카드 이름 바꾸기 (✎) */
.tool-name-input {
  width: 100%; max-width: 100%; min-height: 0; padding: 6px 8px; margin-bottom: 26px; border: 1.5px solid var(--ink); border-radius: 8px;
  font: inherit; font-size: 15px; font-weight: 700; text-align: center; user-select: text; -webkit-user-select: text; background: var(--bg);
}
@media (max-width: 640px) {
  .tools.editing .tool { min-height: 74px; align-items: flex-start; padding-top: 10px; }
  .tool-move { bottom: 5px; }
  .tool-mv { width: 28px; height: 22px; }
  .tool-name-input { font-size: 16px; padding: 4px 4px; margin-bottom: 22px; }
}

/* ── 입력 ─────────────────────────────── */
input, select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 16px; /* 아이폰에서 입력 시 화면이 확대되지 않도록 16px */
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid #8a8378; outline-offset: 1px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.field > span b { color: var(--danger); }

/* ── 알림 ─────────────────────────────── */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 99px;
  background: #1d1b19; color: #fff; font-size: 14px; font-weight: 600;
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); border-radius: 14px; }

/* ── 창(dialog) 공통 ───────────────────── */
dialog {
  border: 0; padding: 0; color: var(--ink);
  background: var(--surface); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
dialog::backdrop { background: rgba(29, 27, 25, .45); }

/* ── 표(직원 관리) ─────────────────────── */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 16px; }
.panel h2 { font-size: 16px; margin-bottom: 12px; }
.row-list { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.row-item:first-child { border-top: 0; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .grow b { display: block; }
.row-item .grow span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--line); white-space: nowrap; }
.form-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; align-items: end; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* 직원별 사용 도구 체크 */
.tool-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; }
.tool-checks-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.tool-checks .check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.tool-checks .check input { width: 18px; height: 18px; min-height: 0; padding: 0; }
.row-item.member { align-items: flex-start; }

.role-select { width: auto; min-height: 34px; padding: 4px 8px; font-size: 14px; }

/* 아이폰은 글자 크기가 16px 보다 작은 입력 칸을 누르면 화면을 확대한다. 모든 입력 칸을 16px 이상으로 맞춘다. */
@media (max-width: 900px), (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
}

/* 창(dialog)이 열려 있는 동안에는 뒤쪽 화면이 스크롤되지 않고, 창 안에서만 위아래로 움직인다. */
html:has(dialog[open]) { overflow: hidden; }
html:has(dialog[open]) body { overflow: hidden; }
dialog { overscroll-behavior: contain; }

/* ── 🔔 알림 설정 창 (shared/push.js) ───────────────── */
#push-top { font-size: 15px; padding: 0 9px; }
.push-dlg { width: min(440px, calc(100vw - 24px)); }
.push-box { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.push-box header { display: flex; align-items: center; gap: 8px; padding: 16px 18px 6px; }
.push-box header h3 { flex: 1; font-size: 17px; }
.push-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.push-intro { color: var(--muted); font-size: 14px; }
.push-hint { color: var(--muted); font-size: 12.5px; }
.push-wait { color: #9a6b00; font-weight: 600; }
.push-steps { margin: 8px 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.push-state { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.push-state b { display: block; }
.push-state small { color: var(--muted); font-size: 12.5px; }
.push-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #c9c2b8; }
.push-state.on .push-dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.push-body .field { display: flex; flex-direction: column; gap: 6px; }
.push-body .field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.push-devs { display: flex; gap: 8px; }
.push-dev {
  flex: 1; min-height: 42px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  font: inherit; font-weight: 700; cursor: pointer;
}
.push-dev.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.push-actions .btn:not(.big) { flex: 1; }
.push-list { border-top: 1px solid var(--line); padding-top: 12px; }
.push-list-title { font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.push-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.push-row:last-child { border-bottom: 0; }
.push-tag { flex: none; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--bg); }
.push-who { flex: 1; min-width: 0; }
.push-who b { display: block; font-size: 14px; }
.push-who small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 첫 화면: "이 기기에서 알림 받기" 한 줄 안내 */
.push-nudge {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding: 10px 14px;
  border-radius: 12px; background: var(--warn-bg); font-size: 14px; font-weight: 600;
}
.push-nudge span { flex: 1; min-width: 180px; }

/* ── 📢 공지 (첫 화면 맨 위 · shared/notices.js) ───────────────── */
.notice-board {
  margin-top: 4px; margin-bottom: 10px; padding: 14px 16px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border-left: 4px solid #d99a00;
}
.nb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.nb-head h2 { font-size: 15px; margin: 0; }
.nb-head .spacer { flex: 1; }
.nb-list { display: flex; flex-direction: column; gap: 8px; }
.nb-empty { color: var(--muted); font-size: 13px; }
.nb-item { padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.nb-item.unread { background: var(--warn-bg); }
.nb-top { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--muted); }
.nb-top b { color: var(--ink); font-size: 13px; }
.nb-text-view { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; }
.nb-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.nb-reads {
  border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 3px 10px;
  font: inherit; font-weight: 700; color: var(--ink); cursor: pointer;
}
.nb-sent { font-weight: 600; }
.nb-meta .btn.ghost { margin-left: auto; color: var(--muted); }
.nb-done { color: var(--ok); font-weight: 700; }
.nb-who { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.nb-who b { color: var(--ink); margin-right: 4px; }
/* 공지 쓰기 창 */
.nb-dlg { width: min(460px, calc(100vw - 24px)); }
.nb-form { display: flex; flex-direction: column; }
.nb-form header { display: flex; align-items: center; gap: 8px; padding: 16px 18px 6px; }
.nb-form header h3 { flex: 1; font-size: 17px; }
.nb-body { padding: 4px 18px 12px; display: flex; flex-direction: column; gap: 10px; }
.nb-body textarea { min-height: 120px; }
.nb-check, .nb-devs label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.nb-check input, .nb-devs input { width: 18px; height: 18px; min-height: 0; padding: 0; }
.nb-devs { display: flex; gap: 16px; padding-left: 26px; }
.nb-form footer { display: flex; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.nb-form footer .spacer { flex: 1; }
.tool-checks .shared-label { margin-left: 6px; padding-left: 12px; border-left: 1px solid var(--line); }

/* ── 자동 완성 목록 (shared/autocomplete.js) ───────────── */
.ac-box {
  position: fixed; z-index: 1000; max-height: 280px; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.ac-box button {
  border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 8px;
  font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ac-box button:hover, .ac-box button.on { background: var(--bg); }
/* ── 공용 날짜 고르기 (shared/datepicker.js) ─────────────────── */
input.dp-input {
  min-width: 0; max-width: 100%; text-align: left; cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237b756d' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
input.dp-input:disabled { cursor: default; }
.dp-pop {
  position: fixed; z-index: 1000; width: 300px; max-width: calc(100vw - 16px); padding: 10px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .22); font-size: 14px;
  -webkit-user-select: none; user-select: none;
}
.dp-head { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.dp-head b { flex: 1; text-align: center; font-size: 15px; }
.dp-nav { width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; }
.dp-nav:hover { background: #f1efe9; }
.dp-week, .dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 2px 0 4px; }
.dp-week span:first-child { color: #c2453b; }
.dp-week span:last-child { color: #3d6fd6; }
.dp-day {
  height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; touch-action: manipulation;
}
.dp-day:hover { background: #f1efe9; }
.dp-day.out { color: #b8b2a8; }
.dp-day.sun { color: #c2453b; }
.dp-day.sat { color: #3d6fd6; }
.dp-day.out.sun, .dp-day.out.sat { opacity: .5; }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.dp-day.sel { background: var(--ink); color: #fff; }
.dp-day:disabled { opacity: .3; cursor: default; background: transparent; }
.dp-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* ── ↶ 되돌리기 버튼 (shared/undo.js): 무언가 바꾸면 왼쪽 아래에 8초 동안 ── */
#undo-fab {
  position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60;
  padding: 9px 14px; border: 0; border-radius: 99px; background: var(--ink); color: #fff;
  font: inherit; font-size: 14px; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); cursor: pointer;
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
#undo-fab.show { opacity: 1; transform: none; pointer-events: auto; }
@media print { #undo-fab { display: none; } }

/* ── 직원 관리: 권한 표 (도구마다 안 보임 · 보기 · 수정) ───────────── */
.perm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.lv { display: inline-block; min-width: 44px; padding: 2px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 700; text-align: center; }
.lv-edit { background: #dff3e6; color: #1f6a3d; }
.lv-view { background: #e6eefb; color: #2d55a8; }
.lv-none { background: var(--bg); color: #b2aba1; }
.perm-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; -webkit-overflow-scrolling: touch; }
.perm-table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 13.5px; }
.perm-table th, .perm-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; white-space: nowrap; }
.perm-table thead th { font-size: 12px; color: var(--muted); font-weight: 700; white-space: normal; word-break: keep-all; min-width: 64px; }
.perm-table .pt-who {
  position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; min-width: 150px; max-width: 190px;
  white-space: normal; box-shadow: 1px 0 0 var(--line);
}
.pt-who b { display: block; font-size: 14px; }
.pt-who small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.pt-sum { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.pt-preset { margin-top: 4px; min-height: 28px; padding: 2px 6px; font-size: 12px; width: 100%; }
.pt-shared { background: #faf9f6; }
.pt-always { color: var(--muted); font-size: 12px; }
.perm-table tr.pt-owner td, .perm-table tr.pt-owner th { background: #fbfaf7; }
select.perm {
  width: auto; min-width: 62px; min-height: 32px; padding: 2px 22px 2px 8px; border-radius: 99px; border: 1px solid transparent;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
select.perm.lv-edit { background-color: #dff3e6; color: #1f6a3d; }
select.perm.lv-view { background-color: #e6eefb; color: #2d55a8; }
select.perm.lv-none { background-color: var(--bg); color: #9d968c; border-color: var(--line); }
.perm-help { margin-top: 10px; }
@media (max-width: 640px) {
  .perm-wrap { margin: 0 -14px; padding: 0 14px; }
  .perm-table .pt-who { min-width: 120px; max-width: 140px; }
}
/* 권한 표: 이름 · 구분 바로 고치기 */
.perm-table input.pt-name, .perm-table input.pt-title {
  width: 100%; min-height: 32px; padding: 3px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent;
  font: inherit; color: var(--ink);
}
.perm-table input.pt-name { font-size: 14px; font-weight: 700; padding-left: 6px; margin-left: -6px; }
.perm-table input.pt-title { min-width: 92px; text-align: center; font-size: 13px; font-weight: 600; background: var(--bg); }
.perm-table input.pt-name:hover, .perm-table input.pt-title:hover { border-color: var(--line); }
.perm-table input.pt-name:focus, .perm-table input.pt-title:focus { border-color: var(--ink); background: var(--surface); outline: none; }

/* ── 🩺 연결 상태 (shared/health.js · 대표만) ───────────────── */
.health-box { margin: 4px 0 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--danger-bg); border-left: 4px solid var(--danger); }
.health-box h2 { font-size: 15px; margin: 0 0 6px; color: var(--danger); }
.health-box ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hl-item b { font-size: 14px; }
.hl-item small { margin-left: 8px; color: var(--muted); font-size: 12px; }
.hl-item p { margin: 3px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }
.hl-item .hl-action { color: var(--ink); font-weight: 600; }
.hl-item .btn { margin-top: 6px; }
.hl-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hl-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 14px; }
.hl-list small { flex-basis: 100%; color: var(--danger); font-size: 12.5px; padding-left: 74px; }
.hl-dot { display: inline-block; min-width: 64px; text-align: center; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.hl-ok { background: #dff3e6; color: #1f6a3d; }
.hl-off { background: var(--bg); color: var(--muted); }
.hl-bad { background: var(--danger-bg); color: var(--danger); }
