:root {
  --bg: #eef1f7;
  --card: #ffffff;
  --primary: #1e3a8a;
  --primary-2: #2749a8;
  --primary-soft: #eef3ff;
  --accent: #2563eb;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fff7ed;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --header-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

/* ---------- 공통 요소 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid transparent;
  background: #fff; color: var(--text); font-weight: 600; font-size: 14px;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); text-decoration: none; }
.btn-ghost { background: #f8fafc; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: #f1f5f9; text-decoration: none; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; padding: 13px; font-size: 16px; }
.icon-btn {
  background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 10px; padding: 7px 10px; font-size: 13px; font-weight: 600;
}
.icon-btn:hover { background: rgba(255, 255, 255, .24); }
.icon-btn.plain { background: #f8fafc; color: var(--text); border-color: var(--border); }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- 로그인 ---------- */
.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 100% -10%, #dbe6ff 0%, transparent 55%),
    radial-gradient(900px 500px at -10% 110%, #e3ecff 0%, transparent 50%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card); border-radius: 20px;
  padding: 32px 26px 26px; box-shadow: var(--shadow); border: 1px solid var(--border);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand h1 { font-size: 21px; margin: 14px 0 4px; letter-spacing: -.4px; }
.login-brand p { margin: 0; color: var(--muted); font-size: 13px; }
.brand-mark {
  display: inline-grid; place-items: center; width: 44px; height: 34px; border-radius: 9px;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .5px;
}
.brand-mark.big { width: 56px; height: 44px; font-size: 16px; border-radius: 12px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 13px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: #fff; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.login-error {
  background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca;
  border-radius: 9px; padding: 9px 11px; font-size: 13px; margin: 0 0 12px;
}
.login-foot { color: var(--muted); font-size: 12px; text-align: center; margin: 18px 0 0; line-height: 1.6; }

/* ---------- 헤더 ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, #1c357f 0%, var(--primary) 100%);
  color: #fff; padding: 12px 16px 12px; box-shadow: 0 2px 12px rgba(15, 23, 42, .18);
}
.header-inner {
  max-width: 1280px; margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 16px; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { font-size: 11px; opacity: .78; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.search-inner { max-width: 1280px; margin: 10px auto 0; }
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .55; }
.search-input {
  width: 100%; padding: 11px 40px 11px 38px; border-radius: 11px; border: 1px solid rgba(255,255,255,.5);
  background: #fff; color: var(--text); caret-color: var(--text);
  font-size: 16px; outline: none; box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
}
.search-input::placeholder { color: #94a3b8; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: #eef2f7; color: var(--muted); width: 26px; height: 26px;
  border-radius: 50%; font-size: 12px; line-height: 1;
}

/* ---------- 본문 ---------- */
.app-main { max-width: 1280px; margin: 0 auto; padding: 14px 16px calc(40px + var(--safe-b)); }
.banner {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--warn-soft); border: 1px solid #fed7aa; color: #7c2d12;
  border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px;
}
.banner:hover { background: #ffedd5; }
.banner-legal { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.banner-legal:hover { background: #fee2e2; }
.banner-legal .banner-link { color: var(--danger); }
.banner-icon { font-size: 17px; }
.banner-text { flex: 1; }
.banner-link { font-weight: 700; color: var(--warn); white-space: nowrap; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  padding: 8px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.tab em { font-style: normal; opacity: .75; margin-left: 2px; font-size: 12px; }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tab.active em { opacity: .9; }
.toolbar-right { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
  font-size: 13.5px; font-weight: 600; color: var(--text);
}
.list-meta {
  display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px;
  margin: 2px 2px 10px;
}

/* ---------- 호실 카드 ---------- */
.layout { display: block; }
.room-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.room-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04); cursor: pointer;
  transition: box-shadow .15s, border-color .15s, transform .05s;
  display: flex; flex-direction: column; gap: 7px;
}
.room-card:hover { border-color: #c7d2fe; box-shadow: var(--shadow); }
.room-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, .18); }
.room-card.is-expired { border-left: 3px solid #fca5a5; }
.room-card.is-due { border-left: 4px solid #fbbf24; }.room-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.room-no { font-size: 17px; font-weight: 750; letter-spacing: -.2px; }
.badge {
  font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: #f1f5f9; color: var(--muted); white-space: nowrap;
}
.badge.sheet-office { background: var(--primary-soft); color: #1d4ed8; }
.badge.sheet-retail { background: #f5f3ff; color: #6d28d9; }
.badge.due { background: var(--warn-soft); color: var(--warn); }
.badge.expired { background: var(--danger-soft); color: var(--danger); }
.badge.legal { background: #7f1d1d; color: #fff; letter-spacing: -.1px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.done { background: #ecfeff; color: #0e7490; }
.badge.file { background: #f8fafc; color: #475569; border: 1px solid var(--border); }
.room-contractor {
  font-size: 14.5px; color: #1e293b; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.room-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.room-sub b { color: #334155; font-weight: 600; }
.dday-num { font-weight: 800; }
.empty-hint, .empty {
  text-align: center; color: var(--muted); font-size: 14px; padding: 40px 10px;
}
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

/* ---------- 상세 ---------- */
.detail-pane { display: none; }
.detail-pane.open { display: block; }
.detail-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.detail-head {
  display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff;
  border-radius: 16px 16px 0 0; z-index: 2;
}
.detail-title { flex: 1; min-width: 0; }
.detail-title input {
  width: 100%; font-size: 20px; font-weight: 750; border: 0; border-bottom: 1px dashed transparent;
  padding: 0 0 2px; outline: none; background: transparent; letter-spacing: -.3px;
}
.detail-title input:hover, .detail-title input:focus { border-bottom-color: var(--border-strong); }
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.detail-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.legal-note {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--danger-soft); border: 1px solid #fecaca; border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; color: #7f271d; line-height: 1.5;
}
.legal-note strong { font-size: 13px; color: var(--danger); }
.detail-close { display: none; }
.field-line { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: start; }
.field-line > label, .field-line > .label { font-size: 13px; font-weight: 650; color: var(--muted); padding-top: 9px; }
.detail-body input[type="text"], .detail-body input[type="tel"], .detail-body input[type="date"],
.detail-body textarea, .detail-body select {
  width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px;
  font-size: 15px; background: #fbfdff; outline: none; transition: border-color .15s, background .15s;
}
.detail-body input:focus, .detail-body textarea:focus, .detail-body select:focus {
  border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.detail-body textarea { resize: vertical; min-height: 74px; line-height: 1.55; }
.detail-body textarea.tall { min-height: 130px; }
.hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.hint.warn { color: var(--warn); }
.hint.danger { color: var(--danger); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check-row input { width: 17px; height: 17px; accent-color: var(--primary); }

.contract-box { border-top: 1px dashed var(--border); padding-top: 14px; }
.contract-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.contract-head h3 { font-size: 14px; margin: 0; }
.file-list { display: flex; flex-direction: column; gap: 7px; }
.file-item {
  display: flex; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px;
}
.file-icon { font-size: 16px; }
.file-main { flex: 1; min-width: 0; }
.file-name { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 11.5px; color: var(--muted); }
.file-actions { display: flex; gap: 4px; }
.file-actions button, .file-actions a {
  border: 1px solid var(--border); background: #fff; border-radius: 7px; padding: 4px 8px; font-size: 12px;
  color: #334155; text-decoration: none; font-weight: 600;
}
.file-actions button:hover, .file-actions a:hover { background: #eef2f7; }
.upload-input { display: none; }
.drop-zone {
  border: 1.5px dashed var(--border-strong); border-radius: 11px; padding: 14px; text-align: center;
  color: var(--muted); font-size: 13px; background: #fbfdff;
}
.drop-zone.over { border-color: var(--accent); background: var(--primary-soft); color: var(--accent); }
.detail-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted);
  position: sticky; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
  border-radius: 0 0 16px 16px;
}
.save-state.saving { color: var(--warn); }
.save-state.saved { color: var(--ok); }
.save-state.error { color: var(--danger); }

/* ---------- 모달 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 80;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; width: 100%; max-width: 720px; max-height: 92vh; display: flex; flex-direction: column;
  border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(15,23,42,.25); overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.modal-head strong { font-size: 16px; }
.modal-head .icon-btn { background: #f1f5f9; color: var(--text); border-color: var(--border); }
.modal-head-actions { display: flex; align-items: center; gap: 6px; }
.modal-body { padding: 16px; overflow: auto; }
.modal-preview { max-width: 1000px; height: 92vh; }
.preview-body { flex: 1; overflow: auto; background: #f1f5f9; display: flex; }
.preview-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-body img { max-width: 100%; margin: auto; display: block; }
.preview-body .preview-fallback { margin: auto; text-align: center; padding: 30px; }

.admin-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.admin-tabs .tab { border-radius: 8px; }
.admin-panel h3 { margin: 4px 0 6px; font-size: 15px; }
.admin-panel hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; align-items: end; }
.form-grid label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.form-grid input, .form-grid select {
  width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--border-strong);
  border-radius: 9px; font-size: 15px; background: #fff; outline: none;
}
.form-grid .form-actions { display: flex; align-items: end; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; color: var(--muted); font-weight: 700; background: #f8fafc; white-space: nowrap; }
.table td .row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: #22c55e; }
.status-dot.off { background: #cbd5e1; }
.import-result { margin-top: 14px; font-size: 13.5px; }
.import-result .ok-line { color: var(--ok); }
.import-result ul { margin: 6px 0; padding-left: 18px; }
.trash-item, .audit-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.audit-item { align-items: flex-start; }
.audit-time { color: var(--muted); font-size: 12px; white-space: nowrap; width: 96px; flex: none; }
.audit-body { flex: 1; min-width: 0; }
.audit-body b { font-weight: 650; }
.audit-detail { color: var(--muted); font-size: 12.5px; word-break: break-all; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13.5px;
  box-shadow: 0 8px 30px rgba(15,23,42,.3); z-index: 120; max-width: calc(100vw - 32px);
}
.toast.error { background: var(--danger); }

/* ---------- 반응형 ---------- */
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .brand-text span { display: none; }
  .toolbar-right { width: 100%; margin-left: 0; }
  .toolbar-right .select { flex: 1; }
  .field-line { grid-template-columns: 1fr; gap: 4px; }
  .field-line > label, .field-line > .label { padding-top: 0; }
  .app-header { padding: 10px 12px; }
  .app-main { padding: 12px 12px calc(40px + var(--safe-b)); }
  .detail-pane.open {
    position: fixed; inset: 0; z-index: 70; background: var(--bg); overflow: auto;
    padding: 0; display: block;
  }
  .detail-pane.open .detail-card { border-radius: 0; border: 0; min-height: 100vh; box-shadow: none; }
  body.detail-open { overflow: hidden; }
  .detail-pane.open .detail-head { border-radius: 0; }
  .detail-close { display: inline-flex; }
  .detail-foot { border-radius: 0; padding-bottom: calc(12px + var(--safe-b)); }
  .detail-body input[type="text"], .detail-body input[type="tel"], .detail-body input[type="date"],
  .detail-body textarea, .detail-body select { font-size: 16px; }
}
@media (min-width: 700px) {
  .room-list { grid-template-columns: 1fr 1fr; }
  .modal { border-radius: 18px; margin: auto; max-height: 88vh; }
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal-preview { height: 88vh; }
}
@media (min-width: 1024px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
  .layout.with-detail { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); }
  .room-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .layout.with-detail .room-list { grid-template-columns: 1fr; }
  .detail-pane.open { display: block; position: sticky; top: 118px; }
  .detail-pane.open .detail-card { max-height: calc(100vh - 134px); overflow: auto; display: flex; flex-direction: column; }
  .detail-pane.open .detail-body { overflow: visible; }
  .detail-close { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 보기 전환 / 층별 평면도 ---------- */
.view-switch-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.view-switch {
  display: inline-flex; padding: 3px; gap: 3px; background: #e2e8f0;
  border-radius: 12px; border: 1px solid var(--border-strong);
}
.view-btn {
  border: 0; background: transparent; color: #475569; font-size: 13.5px; font-weight: 700;
  padding: 7px 14px; border-radius: 9px; white-space: nowrap;
}
.view-btn.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.plan-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-left: auto; }

.plan-view { display: block; }
.floor-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; }
.floor-btn {
  border: 1px solid var(--border); background: #fff; color: #475569; border-radius: 10px;
  padding: 8px 12px; font-size: 13.5px; font-weight: 700; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.floor-btn em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.floor-btn.has-rooms { border-color: #bfdbfe; color: var(--primary); }
.floor-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.floor-btn.active em { color: #dbeafe; }

.plan-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15,23,42,.04); padding: 12px 12px 14px;
}
.plan-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.plan-title { display: flex; flex-direction: column; gap: 2px; }
.plan-title strong { font-size: 16px; letter-spacing: -.2px; }
.plan-title .muted { font-size: 12.5px; }
.plan-head-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }

.plan-canvas {
  --mk: 1;
  position: relative; width: fit-content; max-width: 100%; margin: 0 auto;
  border-radius: 12px; overflow: visible;
  background: #f8fafc; border: 1px solid var(--border);
  touch-action: manipulation;
}
.plan-canvas img {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 74vh;
  border-radius: 12px;
}
.plan-canvas.editing { touch-action: none; cursor: crosshair; }
.plan-markers { position: absolute; inset: 0; }

.plan-marker {
  position: absolute; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  min-width: calc(44px * var(--mk, 1)); padding: calc(4px * var(--mk, 1)) calc(8px * var(--mk, 1));
  border-radius: 999px;
  border: calc(2px * var(--mk, 1)) solid #fff; color: #fff;
  font-size: calc(12.5px * var(--mk, 1)); font-weight: 800;
  letter-spacing: -.2px; line-height: 1.1; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .28); cursor: pointer;
  background: #475569; transition: transform .1s, box-shadow .1s;
}
.plan-marker:hover { box-shadow: 0 3px 12px rgba(15, 23, 42, .4); z-index: 3; }
.plan-marker:active { transform: translate(-50%, -50%) scale(.96); }
.plan-marker.st-ok { background: #0f766e; }
.plan-marker.st-due { background: #ea580c; }
.plan-marker.st-legal { background: #9f1239; }
.plan-marker.st-none { background: #475569; }
.plan-marker.st-done { background: #64748b; }
.plan-marker.empty {
  background: rgba(248, 250, 252, .92); color: #64748b; border: 2px dashed #94a3b8;
  box-shadow: none; font-weight: 700;
}
.plan-marker.empty:hover { background: #fff; color: var(--primary); border-color: var(--primary); }
.plan-marker.active { outline: 3px solid #facc15; outline-offset: 1px; z-index: 4; }
.plan-marker .multi { font-size: 10.5px; opacity: .9; font-weight: 700; }
.plan-marker.dragging { cursor: grabbing; z-index: 9; box-shadow: 0 6px 18px rgba(15,23,42,.45); }
.plan-canvas.editing .plan-marker { cursor: grab; }

.plan-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.plan-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 11px; height: 11px; border-radius: 999px; display: inline-block; border: 1px solid rgba(255,255,255,.7); }
.legend-dot.ok { background: #0f766e; }
.legend-dot.due { background: #ea580c; }
.legend-dot.legal { background: #9f1239; }
.legend-dot.none { background: #475569; }
.legend-dot.empty { background: #fff; border: 1px dashed #94a3b8; }

.plan-summary { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 12.5px; color: #334155; }
.plan-summary b { font-weight: 800; }

.plan-rooms { margin-top: 12px; display: grid; grid-template-columns: 1fr; gap: 6px; }
.plan-room {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 8px 10px;
}
.plan-room:hover { border-color: #c7d2fe; background: #f8faff; }
.plan-room .pr-no { font-weight: 800; font-size: 13.5px; min-width: 52px; }
.plan-room .pr-name { flex: 1; font-size: 13px; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-section-title { font-size: 12.5px; font-weight: 800; color: var(--muted); margin: 14px 0 2px; }
.plan-empty-note { font-size: 13px; color: var(--muted); padding: 14px 4px; }
.modal-narrow { max-width: 420px; }

@media (min-width: 700px) {
  .plan-rooms { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .floor-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .floor-tabs::-webkit-scrollbar { display: none; }
  .plan-canvas img { max-height: 62vh; }
  .view-btn { padding: 7px 10px; font-size: 12.5px; }
  .floor-btn { padding: 7px 10px; font-size: 12.5px; }
}

@media (min-width: 1024px) {
  .layout.plan-mode { grid-template-columns: minmax(0, 1fr); }
  .layout.plan-mode.plan-with-detail { grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); }
}
