/* ─────────────────────────────────────────────────────────────
   수지 AI 사옥 · 기본 레이아웃 & 컴포넌트
   스킨별 색/질감은 skins.css 에서 덮어씁니다.
   ───────────────────────────────────────────────────────────── */
:root {
  --bg: #f4f5f7;
  --bg-grad: radial-gradient(1100px 520px at 85% -10%, #e8e7ff 0%, transparent 60%), #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: #eef2ff;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #059669;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 28px rgba(16, 24, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
  --nav-h: 0px;
  --top-h: 58px;
  --sidebar-w: 248px;
  --bubble-owner: #eef2ff;
  --bubble-owner-ink: #1e1b4b;
  --bubble-agent: #ffffff;
  --bubble-agent-ink: #111827;
  --scene-bg: #0f172a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-grad);
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }

/* ── 앱 골격 ──────────────────────────────────────────────── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--top-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px 0 16px;  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 6px 4px;
  font-weight: 800; font-size: 16px; letter-spacing: -0.02em; color: var(--ink);
}
.brand .brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: 16px;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.skinswitch {
  display: flex; gap: 2px; padding: 3px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
}
.skinswitch button {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  white-space: nowrap;
}
.skinswitch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.iconbtn {
  border: 1px solid var(--line); background: var(--panel);
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-size: 16px; color: var(--ink);
}
.iconbtn:hover { background: var(--panel-2); }

.layout { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  border-right: 1px solid var(--line);
  padding: 16px 12px 28px;
  position: sticky; top: var(--top-h); align-self: flex-start;
  height: calc(100dvh - var(--top-h));
  overflow-y: auto;
  background: color-mix(in srgb, var(--panel) 72%, transparent);
}
.main {
  flex: 1; min-width: 0;
  padding: 22px clamp(14px, 3vw, 30px) calc(28px + var(--nav-h));
}
.side-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 14px 8px 8px;
}
.side-title button {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px;
  width: 24px; height: 24px; line-height: 1; font-size: 14px; color: var(--muted);
}
.navlist { display: flex; flex-direction: column; gap: 2px; }
.navlist a, .navlist button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 10px; border: 0; background: none;
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; text-align: left;
}
.navlist a:hover, .navlist button:hover { background: var(--panel-2); }
.navlist .active { background: var(--accent-soft); color: var(--accent); }
.navlist .ico { width: 20px; text-align: center; }

.roomlist, .agentlist { display: flex; flex-direction: column; gap: 2px; }
.roomitem {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: 10px; border: 0; background: none; text-align: left;
  color: var(--ink);
}
.roomitem:hover { background: var(--panel-2); }
.roomitem.active { background: var(--accent-soft); }
.roomitem .rico { font-size: 17px; width: 22px; text-align: center; }
.roomitem .rname { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roomitem .rsub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 132px; }
.roomitem .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: 0 0 auto; }
.roomitem.paused { opacity: .72; }
.agentchip {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px;
  font-size: 13px; color: var(--ink);
}
.agentchip .avatar { font-size: 16px; }
.agentchip .badge { margin-left: auto; }

.badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px;
  background: var(--warn); color: #fff; font-size: 11px; font-weight: 800;
}
.badge.soft { background: var(--accent-soft); color: var(--accent); }
.badge.danger { background: var(--danger); }
.badge.ok { background: var(--ok); }
.badge.gray { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }

/* ── 페이지 공통 ──────────────────────────────────────────── */
.page { display: flex; flex-direction: column; gap: 16px; max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(20px, 2.6vw, 26px); }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.card h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card h2 .count { font-size: 12px; color: var(--muted); font-weight: 700; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head .btn { margin-left: auto; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi .k-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi .k-value { font-size: 27px; font-weight: 850; letter-spacing: -0.03em; margin-top: 4px; }
.kpi .k-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi .k-ico { position: absolute; right: 12px; top: 12px; font-size: 18px; opacity: .8; }

.home-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.roomgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.roomcard {
  text-align: left; border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.roomcard:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.roomcard .rc-top { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.roomcard .rc-top .rico { font-size: 19px; }
.roomcard .rc-last { font-size: 12.5px; color: var(--muted); min-height: 32px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.roomcard .rc-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }

.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 10px; padding: 10px 4px;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.empty { padding: 18px 6px; color: var(--muted); font-size: 13px; text-align: center; }

/* ── 버튼·입력 ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 8px 13px; border-radius: 10px; font-size: 13px; font-weight: 700;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.btn:hover { background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.sm { padding: 5px 9px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: var(--panel);
  border-radius: 10px; padding: 9px 11px; font-size: 14px; outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; font-weight: 700; color: var(--muted); }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.formgrid .full { grid-column: 1 / -1; }

/* ── 채팅방 ───────────────────────────────────────────────── */
.room-page { max-width: 980px; }
.room-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; box-shadow: var(--shadow);
}
.room-head .rh-ico { font-size: 26px; }
.room-head h1 { font-size: 18px; }
.room-head .rh-sub { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.room-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button {
  border: 0; background: none; padding: 9px 13px; font-size: 13.5px; font-weight: 700; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.chat { display: flex; flex-direction: column; min-height: 0; }
.msgs {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 6px 8px; overflow-y: auto;
  height: calc(100dvh - var(--top-h) - 258px - var(--nav-h));
  min-height: 280px;
  scroll-behavior: smooth;
}
.dayline { align-self: center; font-size: 11px; color: var(--muted); background: var(--panel-2);
  padding: 3px 10px; border-radius: 999px; }
.msg { display: flex; flex-direction: column; gap: 3px; max-width: min(76%, 620px); }
.msg.owner { align-self: flex-end; align-items: flex-end; }
.msg.agent { align-self: flex-start; }
.msg.system { align-self: center; max-width: 92%; }
.msg .who { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; padding: 0 4px; }
.bubble {
  padding: 9px 13px; border-radius: 15px; font-size: 14px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; border: 1px solid transparent;
}
.msg.owner .bubble { background: var(--bubble-owner); color: var(--bubble-owner-ink); border-bottom-right-radius: 5px; }
.msg.agent .bubble { background: var(--bubble-agent); color: var(--bubble-agent-ink); border-color: var(--line); border-bottom-left-radius: 5px; }
.msg.system .bubble {
  background: color-mix(in srgb, var(--warn) 10%, var(--panel)); color: var(--ink);
  border-color: color-mix(in srgb, var(--warn) 30%, var(--line));
  font-size: 12.5px; text-align: center; border-radius: 12px;
}
.msg .foot { font-size: 10.5px; color: var(--muted); padding: 0 4px; display: flex; gap: 6px; align-items: center; }
.hop { font-size: 10px; border: 1px solid var(--line); border-radius: 999px; padding: 0 5px; color: var(--muted); }
.mention { color: var(--accent); font-weight: 700; }

.composer {
  position: sticky; bottom: calc(var(--nav-h));
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid var(--line); border-radius: 14px; padding: 8px;
  display: flex; gap: 8px; align-items: flex-end; box-shadow: var(--shadow);
}
.composer textarea {
  flex: 1; border: 0; background: transparent; resize: none; min-height: 38px; max-height: 140px;
  padding: 8px 6px; outline: none; font-size: 14px; line-height: 1.5;
}
.composer .send { width: 40px; height: 40px; border-radius: 11px; border: 0; background: var(--accent); color: #fff; font-size: 17px; }
.mentionbar { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 4px 6px; }
.chip {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.paused-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--warn) 12%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  border-radius: 12px; padding: 9px 12px; font-size: 12.5px;
}
.paused-banner b { font-weight: 800; }

/* ── 파일 ─────────────────────────────────────────────────── */
.filegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.filecard {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel-2);
  display: flex; flex-direction: column;
}
.filecard .thumb { height: 104px; background: #eef0f4 center/cover no-repeat; display: grid; place-items: center; font-size: 26px; }
.filecard .fmeta { padding: 9px 10px; font-size: 12px; }
.filecard .fname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filecard .fsize { color: var(--muted); font-size: 11px; margin-top: 2px; }
.filecard .fops { display: flex; gap: 4px; padding: 0 8px 8px; }
.drop {
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center;
  color: var(--muted); font-size: 13px; background: var(--panel-2);
}
.drop.hot { border-color: var(--accent); background: var(--accent-soft); }

/* ── 진행바·사용량 ────────────────────────────────────────── */
.progress { height: 9px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.progress.warn > i { background: var(--warn); }
.progress.danger > i { background: var(--danger); }
.usagegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.usagecard { display: flex; flex-direction: column; gap: 9px; }
.usagecard .u-top { display: flex; align-items: baseline; gap: 6px; }
.usagecard .u-name { font-weight: 800; font-size: 15px; }
.usagecard .u-plan { font-size: 11.5px; color: var(--muted); }
.usagecard .u-nums { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.usagecard .u-pct { font-size: 22px; font-weight: 850; letter-spacing: -0.03em; }
.usagecard .u-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.statline { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }

/* ── D-day 배지 ───────────────────────────────────────────── */
.dday { font-size: 11.5px; font-weight: 850; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.dday.hot { background: color-mix(in srgb, var(--danger) 12%, #fff); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.dday.soon { background: color-mix(in srgb, var(--warn) 12%, #fff); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.dday.done { background: var(--panel-2); color: var(--muted); text-decoration: line-through; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { font-size: 11px; color: var(--muted); text-align: center; padding: 4px 0; font-weight: 700; }
.cal .cell {
  min-height: 64px; border: 1px solid var(--line); border-radius: 9px; padding: 4px 5px;
  font-size: 11px; background: var(--panel); display: flex; flex-direction: column; gap: 2px;
}
.cal .cell.out { opacity: .38; }
.cal .cell.today { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.cal .cell .d { font-weight: 800; color: var(--muted); }
.cal .cell .ev { background: var(--accent-soft); color: var(--accent); border-radius: 5px; padding: 1px 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.cal .cell .ev.hot { background: color-mix(in srgb, var(--danger) 12%, #fff); color: var(--danger); }

/* ── 잠금 화면 ────────────────────────────────────────────── */
.lock {
  min-height: 100dvh; display: grid; place-items: center; padding: 22px;
  background: radial-gradient(900px 600px at 50% -10%, #312e81 0%, #0f172a 55%, #020617 100%);
}
.lock-card {
  width: min(400px, 100%); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: 22px; padding: 26px 22px; color: #f8fafc; text-align: center;
  box-shadow: 0 30px 70px rgba(0,0,0,.45); backdrop-filter: blur(14px);
}
.lock-card .lock-mark {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(145deg, #6366f1, #4338ca); font-size: 30px;
  box-shadow: 0 16px 36px rgba(79,70,229,.5);
}
.lock-card h1 { font-size: 21px; letter-spacing: -0.02em; }
.lock-card .sub { color: #cbd5e1; font-size: 13px; margin-top: 6px; line-height: 1.5; }
.lock-card form { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.lock-card input {
  width: 100%; text-align: center; letter-spacing: .35em; font-size: 20px; padding: 13px;
  border-radius: 13px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff;
  outline: none;
}
.lock-card input:focus { border-color: #818cf8; box-shadow: 0 0 0 4px rgba(129,140,248,.18); }
.lock-card button {
  padding: 13px; border-radius: 13px; border: 0; font-weight: 800; font-size: 15px;
  background: linear-gradient(145deg, #6366f1, #4f46e5); color: #fff;
}
.lock-msg { min-height: 18px; font-size: 12.5px; color: #fca5a5; margin-top: 8px; }
.lock-foot { margin-top: 16px; font-size: 11px; color: #94a3b8; }
.shake { animation: shake .34s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-7px)} 75%{transform:translateX(7px)} }

/* ── 모달·토스트 ──────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 90;
  display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px);
}
.modal {
  width: min(520px, 100%); max-height: 88dvh; overflow: auto; background: var(--panel);
  border-radius: 18px; box-shadow: 0 30px 70px rgba(0,0,0,.35); border: 1px solid var(--line);
}
.modal-head { display: flex; align-items: center; gap: 8px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15.5px; }
.modal-head .x { margin-left: auto; border: 0; background: none; font-size: 19px; color: var(--muted); }
.modal-body { padding: 15px 17px; display: flex; flex-direction: column; gap: 11px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 17px; border-top: 1px solid var(--line); }
.toast {
  position: fixed; left: 50%; bottom: calc(78px + var(--nav-h)); transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; z-index: 120; box-shadow: 0 12px 30px rgba(0,0,0,.3);
  max-width: min(92vw, 520px); text-align: center;
}
.toast.err { background: var(--danger); }

/* ── 하단 탭 (모바일) ────────────────────────────────────── */
.bottomnav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: color-mix(in srgb, var(--panel) 94%, transparent); border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(12px);
}
.bottomnav .bn {
  flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 0; color: var(--muted); font-size: 10.5px; font-weight: 700; text-decoration: none;
}
.bottomnav .bn .bi { font-size: 19px; line-height: 1; }
.bottomnav .bn.active { color: var(--accent); }
.bottomnav .startbtn { display: none; }
.bottomnav .clock { display: none; }
[data-skin="retro"] .bottomnav .clock { display: block; }

/* ── 반응형 ───────────────────────────────────────────────── */
@media (max-width: 960px) {
  .home-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  :root { --nav-h: 62px; }
  .sidebar { display: none; }
  .bottomnav { display: flex; }
  .main { padding: 14px 12px calc(20px + var(--nav-h)); }
  .skinswitch button { padding: 6px 8px; font-size: 11.5px; }
  .brand span { font-size: 15px; }
  .msgs { height: calc(100dvh - var(--top-h) - 246px - var(--nav-h)); }
  .formgrid { grid-template-columns: 1fr; }
  .room-actions { width: 100%; }
  .room-actions .btn { flex: 1; }
}
@media (max-width: 560px) {
  .skinswitch button .sk-full { display: none; }
  .lock-card { padding: 22px 16px; }
  .kpis { gap: 9px; }
  .kpi .k-value { font-size: 23px; }
}
@media (max-width: 430px) {
  .brand > span:last-child { display: none; }
  .topbar { padding-left: 12px; gap: 6px; }
  .topbar-right { gap: 5px; }
  .skinswitch { padding: 2px; }
  .skinswitch button { padding: 6px 7px; }
  .iconbtn { width: 33px; height: 33px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
