html.theme-light {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --on-primary: #ffffff;
  --title: #1d3554;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #ffffff;
  --elevated: #e8f3ff;
  --selected: #d4e8ff;
  --text: #334155;
  --muted: #7b8796;
  --border: #e6ebf2;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 8px 24px rgba(0,0,0,.14);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.3);
  --focus-ring: #bfdbfe;
}

html.theme-dark {
  --primary: #7aa2f7;
  --primary-dark: #5a7dc7;
  --on-primary: #0b1020;
  --bg: #16181e;
  --surface: #24283b;
  --surface-2: #1f2335;
  --surface-3: #1a1b26;
  --elevated: #2a2f45;
  --selected: #33466e;
  --title: #c0caf5;
  --text: #c0caf5;
  --muted: #8a93b8;
  --border: rgba(122, 162, 247, 0.16);
  --danger: #f7768e;
  --success: #9ece6a;
  --shadow: 0 8px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.45);
  --focus-ring: rgba(122, 162, 247, 0.5);
}

html.theme-blue {
  --primary: #1e8ad4;
  --primary-dark: #1670ad;
  --on-primary: #ffffff;
  --bg: #0a1522;
  --surface: #15273d;
  --surface-2: #0f1e30;
  --surface-3: #0c1929;
  --elevated: #1e3a5f;
  --selected: #1a5688;
  --title: #e8f4ff;
  --text: #e8f4ff;
  --muted: #8fbbe0;
  --border: rgba(94, 181, 255, 0.16);
  --danger: #ff6b6b;
  --success: #5ce0a0;
  --shadow: 0 8px 24px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.45);
  --focus-ring: rgba(30, 138, 212, 0.45);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Pretendard", "Noto Sans KR", -apple-system, "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
}

.topbar {
  height: 52px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  z-index: 30;
}
.topbar-brand {
  width: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-right: 1px solid var(--border);
  background: var(--surface-3);
  overflow: hidden;
  flex-shrink: 0;
}
.brand-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
}
.brand-mark {
  display: block;
  height: 34px;
  width: auto;
  object-fit: contain;
  background: transparent;
}
.brand-word {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.03em;
  line-height: 1;
  background-image: linear-gradient(180deg, #f3e4bc 0%, #d4b36a 36%, #a07c3c 68%, #c9a45c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.topbar-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
}
.topbar-left-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar-left-tools label { margin: 0; white-space: nowrap; }
.topbar-left-tools select { width: 180px; }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.muted { color: var(--muted); }
.listen-note { font-size: 12px; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-select {
  width: auto;
  padding: 5px 8px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.leftpanel {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface-3);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
  scrollbar-width: thin;
}
.lp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}
.lp-card.is-active {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}
.lp-card-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: none;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  text-align: left;
}
.lp-card-title[aria-expanded="true"] { border-bottom-color: var(--border); }
.lp-card-chevron { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.lp-card-body { padding: 6px; }
.leftpanel [data-page] {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 7px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leftpanel [data-page]:hover { background: var(--surface-2); color: var(--text); }
.leftpanel [data-page].on {
  color: var(--primary);
  background: var(--selected);
  font-weight: 700;
}

.panel-toggle {
  position: absolute;
  top: 50%;
  left: 240px;
  transform: translateY(-50%);
  z-index: 20;
  width: 15px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  color: var(--muted);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.panel-toggle:hover { color: var(--primary); background: var(--elevated); }
.app-shell.is-collapsed .leftpanel,
.app-shell.is-collapsed .topbar-brand {
  width: 0;
  padding: 0;
  border-right: none;
  overflow: hidden;
}
.app-shell.is-collapsed .panel-toggle { left: 0; }

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.main-area .content {
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding: 20px;
}

h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--title, var(--text));
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin: 2px 0 16px;
}
.page-head h2 {
  display: flex;
  align-items: center;
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.page-head h2::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-right: 8px;
  background: var(--primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E") center / contain no-repeat;
}
.page-actions { display: flex; gap: 8px; flex-shrink: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px 14px;
  margin-bottom: 14px;
  box-shadow: none;
}
.grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 10px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--focus-ring);
  border-color: var(--primary);
}
textarea { min-height: 84px; resize: vertical; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--on-primary); }
.btn.ghost { background: var(--surface); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; min-width: 72px; border-radius: 6px; }
.btn.icon,
.btn.sm.icon { width: 28px; min-width: 28px; max-width: 28px; height: 28px; padding: 0; flex: 0 0 28px; }
.btn.icon svg { width: 14px; height: 14px; }
.cell-actions,
.user-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.cell-actions .btn,
.user-actions .btn {
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  line-height: 1;
  box-sizing: border-box;
}
.page { display: none; }
.page.on { display: block; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: center; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cell-text { text-align: left; max-width: 420px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--surface-2); white-space: nowrap; }
.care-table tr.is-clickable,
.history-line.is-clickable { cursor: pointer; }
.care-table tr:hover td,
.user-table tr:hover td { background: var(--elevated); }
.care-table tr.is-selected td,
.care-table tr.is-selected:hover td,
.user-table tr.is-selected td,
.user-table tr.is-selected:hover td { background: var(--selected); }
.care-table tr.is-selected td:first-child,
.user-table tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.cell-actions { white-space: nowrap; }
.row > .btn:not(.ghost),
.detail-actions > .btn:not(.ghost),
.page-actions > .btn:not(.ghost) {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.row > .btn:not(.ghost):hover,
.detail-actions > .btn:not(.ghost):hover,
.page-actions > .btn:not(.ghost):hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--on-primary);
}
.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px 2px 0;
  color: var(--muted);
  font-size: 13px;
}
.pager-nav, .pager-current {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
}
.pager-nav:disabled { color: #c5cdd6; border-color: var(--border); background: var(--surface); }
.pager-size {
  width: auto;
  height: 28px;
  padding: 0 8px;
  border-radius: 4px;
  color: var(--text);
  background: var(--surface);
}
.call {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.inbox-list { display: flex; flex-direction: column; gap: 4px; }
.inbox-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.is-selected {
  background: var(--selected);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
.inbox-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.inbox-who { font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.inbox-num {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.inbox-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 2px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.inbox-meta span + span::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 7px 1px 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  vertical-align: middle;
}
.inbox-item .badge,
.call-detail .badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 12px;
}
.call-detail { padding-top: 2px; }
.detail-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.detail-name { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.detail-phone {
  margin-top: 1px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.detail-facts {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.detail-facts div { display: contents; }
.detail-facts dt { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.detail-facts dd { margin: 0; font-size: 13px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.detail-message {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.detail-actions .btn { min-width: 96px; }
.badge {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--elevated);
  color: var(--primary);
  font-weight: 700;
}
.badge.sms { background: var(--surface-2); color: var(--success); }
.num { font-size: 18px; letter-spacing: -0.03em; }
.meta { color: var(--muted); font-size: 12px; }
.result { white-space: pre-wrap; font-size: 13px; color: var(--muted); }
.result.ok { color: var(--success); }
.result.bad { color: var(--danger); }
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 50;
}
#overlay.show { display: grid; }
.popup {
  width: min(560px, 100%);
  max-height: min(88vh, 860px);
  overflow: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.popup-name { font-size: 28px; margin-top: 8px; font-weight: 700; }
.popup .cid { font-size: 32px; margin: 4px 0; letter-spacing: -0.04em; }
.kicker { color: var(--primary); font-weight: 700; font-size: 13px; }
.pop-history { margin: 12px 0; display: grid; gap: 8px; max-height: 180px; overflow: auto; }
.history-line, .history-item { padding: 8px 10px; border-top: 1px solid var(--border); border-radius: 8px; }
.history-line.is-selected {
  background: var(--selected);
  box-shadow: inset 3px 0 0 var(--primary);
}
.history-list { display: grid; }
.pop-note { display: grid; gap: 8px; margin-bottom: 12px; }
.stat-row { display: flex; gap: 12px; margin: 12px 0; }
.stat-card { flex: 1; background: var(--surface-2); border-radius: 10px; padding: 14px; display: grid; gap: 4px; }
.stat-card strong { font-size: 28px; }
.hour-chart { display: flex; align-items: end; gap: 4px; height: 120px; margin: 8px 0 16px; }
.hour-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.hour-bar span { display: block; width: 100%; min-height: 2px; background: var(--primary); border-radius: 3px 3px 0 0; }
.hour-bar small { color: var(--muted); font-size: 10px; }
.empty { color: var(--muted); padding: 12px 0; }
.note { color: var(--muted); font-size: 13px; line-height: 1.5; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e3a6b;
  padding: 24px;
}
.login-box {
  --login-surface: #ffffff;
  --login-surface-2: #f8fafc;
  --login-text: #0f172a;
  --login-muted: #64748b;
  --login-border: #e2e8f0;
  --login-primary: #2563eb;
  --login-primary-dark: #1d4ed8;
  --login-on-primary: #ffffff;
  --login-danger: #dc2626;
  width: 400px;
  max-width: 100%;
  background: var(--login-surface);
  color: var(--login-text);
  border-radius: 14px;
  padding: 32px 36px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 22px;
}
.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.login-logo img {
  display: block;
  height: 64px;
  width: auto;
  object-fit: contain;
  background: transparent;
}
.login-logo .brand-word {
  font-size: 30px;
  letter-spacing: -0.03em;
}
.login-brand p {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--login-muted);
}
.login-box .field { margin-bottom: 14px; }
.login-box .field label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--login-muted);
}
.login-box .field input {
  width: 100%;
  border: 1px solid var(--login-border);
  background: var(--login-surface-2);
  color: var(--login-text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.login-box .field input:focus {
  border-color: var(--login-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  outline: none;
}
.login-error {
  color: var(--login-danger);
  font-size: 12px;
  margin: 4px 0 0;
}
.login-submit {
  width: 100%;
  margin-top: 10px;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  background: var(--login-primary);
  color: var(--login-on-primary);
}
.login-submit:hover { background: var(--login-primary-dark); }
.login-demo {
  margin: 16px 0 0;
  text-align: center;
  color: var(--login-muted);
  font-size: 12px;
}

.account-menu { position: relative; }
.header-icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.header-icon-btn svg { width: 20px; height: 20px; }
.header-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.header-icon-btn.active {
  color: var(--primary);
  box-shadow: 0 0 0 1.5px var(--primary);
  background: var(--surface);
}
.account-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 248px;
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  z-index: 40;
}
.account-popover-head {
  margin: 12px 12px 0;
  padding: 14px 10px 12px;
  border-radius: 6px;
  background: var(--surface-2);
  text-align: center;
}
.account-popover-name { font-size: 18px; font-weight: 700; line-height: 1.3; }
.account-popover-sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.account-popover-meta { padding: 14px 18px 10px; }
.account-popover-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.account-popover-label { color: var(--primary); font-weight: 600; min-width: 2.5em; }
.account-popover-value { color: var(--muted); }
.account-popover-expire {
  margin: 0 14px;
  padding: 14px 8px 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.account-popover-expire-title { color: var(--primary); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.account-popover-expire-date { font-size: 16px; font-weight: 700; line-height: 1.35; }
.account-popover-expire-remain { margin-top: 4px; font-size: 12px; color: var(--muted); }
.account-popover-actions {
  margin: 0 14px 8px;
  padding: 8px 0 6px;
  border-top: 1px solid var(--border);
}
.account-popover-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 9px 6px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}
.account-popover-action svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }
.account-popover-action:hover { background: var(--surface-2); color: var(--text); }
#pwOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 60;
}
#pwOverlay.show, #userOverlay.show, #userDeleteOverlay.show { display: grid; }
#userOverlay, #userDeleteOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 60;
  overflow: auto;
}
.user-dialog { width: min(640px, 100%); }
.user-dialog h2 { margin: 0 0 8px; font-size: 18px; }
.user-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.user-toolbar h2 { margin-bottom: 6px; }
.user-toolbar .note { margin: 0; }
.user-toolbar .btn { flex-shrink: 0; }
.table-wrap { overflow-x: auto; }
.user-table { width: 100%; min-width: 640px; }
.user-actions { white-space: nowrap; }
.pw-dialog { width: min(400px, 100%); }
.pw-dialog h2 { margin: 0 0 8px; font-size: 18px; }
.admin-user {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-top: 12px;
  background: var(--surface-2);
}
.home { max-width: 1080px; }
.home-hero {
  margin-bottom: 22px;
  padding: 28px 28px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--elevated), var(--surface) 58%);
}
.home-kicker {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.home-hero h2 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--title);
}
.home-hero p {
  max-width: 640px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}
.home-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.home-pills span {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--title);
  font-size: 12px;
  font-weight: 600;
}
.home-block { margin-bottom: 22px; }
.home-block-head { margin-bottom: 12px; }
.home-block-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--title);
}
.home-block-head p { margin: 0; color: var(--muted); font-size: 13px; }
.home-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-steps li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 148px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.step-no {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 13px;
  font-weight: 700;
}
.home-steps strong { color: var(--title); font-size: 14px; }
.home-steps li > span:last-child { color: var(--muted); font-size: 13px; line-height: 1.55; }
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.home-card {
  padding: 18px 18px 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.home-card-top { display: flex; align-items: center; gap: 10px; }
.home-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--elevated);
  color: var(--primary);
}
.home-icon svg { width: 18px; height: 18px; display: block; }
.home-card h4 { margin: 0; font-size: 15px; color: var(--title); }
.home-card > p { margin: 10px 0 0; color: var(--text); font-size: 13px; line-height: 1.6; }
.home-card ul { margin: 10px 0 0; padding: 0; list-style: none; }
.home-card li {
  position: relative;
  padding: 8px 0 8px 14px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}
.home-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}
.admin-user h3 { margin: 0 0 10px; font-size: 15px; }
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.admin-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.line-checks { margin: 14px 0 4px; }
.line-checks-title { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.line-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.line-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
}
.line-card.is-on {
  background: var(--selected);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}
.line-card input {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: var(--primary);
}
.line-card-body { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; }
.line-card-name,
.line-card-phone { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-card-name { flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--title); }
.line-card-phone { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }

.ring-test {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.ring-test-box {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 28px 24px;
}
.ring-test-box h1 {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--title);
}
.ring-test-box .note { margin: 0 0 16px; }
.ring-test-box .field { margin-bottom: 14px; }
.ring-test-box label { margin-top: 0; }
.ring-test-status { min-height: 20px; margin: 12px 0 0; font-size: 13px; line-height: 1.5; }
.ring-test-status.ok { color: var(--success); }
.ring-test-status.bad { color: var(--danger); }

@media (max-width: 900px) {
  .topbar { height: auto; flex-wrap: wrap; }
  .topbar-brand { width: 100%; border-right: none; border-bottom: 1px solid var(--border); height: 48px; }
  .app-body { flex-direction: column; }
  .leftpanel { width: 100%; display: flex; gap: 8px; overflow-x: auto; padding: 8px; }
  .lp-card { min-width: 180px; margin-bottom: 0; }
  .panel-toggle { display: none; }
  .grid, .home-grid { grid-template-columns: 1fr; }
  .listen-note { display: none; }
  .main-area .content { padding: 16px; }
}
