:root {
  /* Lovart-inspired light SaaS */
  --ink: #333333;
  --ink-soft: #555555;
  --muted: #888888;
  --paper: #fafafa;
  --paper-2: #f5f5f5;
  --white: #ffffff;
  --panel: #ffffff;
  --line: #eaeaea;
  --line-soft: #f0f0f0;
  --accent: #1d2839;
  --accent-soft: #e8eef4;
  --accent-deep: #121a24;
  --secondary: #4ecdc4;
  --focus: #4ecdc4;
  --danger: #e03131;
  --warn: #f59f00;
  --ok: #2f9e44;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --font-display: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-body: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --nav-w: 248px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--paper);
}

.login-card {
  width: min(100%, 400px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem 1.7rem;
  display: grid;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.login-brand {
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  text-align: center;
}
.login-brand-logo {
  display: block;
  width: min(200px, 72%);
  height: auto;
  margin: 0 auto 0.15rem;
}
.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}
.login-brand p {
  text-align: center;
}
.login-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-card label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.login-card input {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.login-card input:focus {
  outline: 2px solid rgba(75, 124, 191, 0.35);
  border-color: var(--focus);
}

.login-remember {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.login-remember input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  accent-color: var(--accent);
}
.login-remember-note {
  margin: -0.35rem 0 0;
  padding-left: 1.6rem;
  font-size: 0.8rem;
  color: var(--warn);
  line-height: 1.4;
  font-weight: 600;
}

.login-error {
  margin: 0;
  min-height: 1.3em;
  color: var(--danger);
  font-size: 0.88rem;
}
.login-ok {
  margin: 0;
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 600;
}
.login-foot-link {
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}
.login-foot-link a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.shell {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #f5f5f5;
  color: var(--ink);
  padding: 1.25rem 0.9rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar .brand {
  padding: 0.25rem 0.45rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  text-align: center;
  flex-shrink: 0;
  max-height: min(48vh, 420px);
  overflow: auto;
}

.sidebar .site-logo {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none !important;
  color: inherit;
}

.sidebar .site-logo-jipgyeol {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 0.15rem 0.2rem 0.35rem;
}

.sidebar .brand-logo,
.sidebar .site-logo-img {
  display: block;
  width: 2.15rem;
  height: 2.15rem;
  max-width: 2.15rem;
  object-fit: contain;
  object-position: center;
  margin: 0;
  padding: 0.28rem;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #eaeaea;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sidebar .brand-logo-wordmark,
.sidebar .site-logo-jipgyeol .site-logo-img {
  width: auto;
  height: 2.35rem;
  max-width: min(100%, 11.5rem);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar .brand-title,
.sidebar .site-logo-crm {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.2rem;
  color: #0c1a28;
  line-height: 1;
  text-align: center;
  margin: 0;
}

.sidebar .brand-title span {
  color: #0c1a28;
}

.sidebar .org-name {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0 0.45rem;
  text-align: center;
  width: 100%;
}

.sidebar .industry-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 auto;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  background: var(--accent-soft);
}

.team-presence {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 0.35rem;
  padding: 0.1rem 0.1rem 0.15rem;
}
.team-presence-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: left;
}
.team-presence-toggle:hover {
  background: #ffffff;
  color: var(--ink);
}
.team-presence-title-text { flex-shrink: 0; }
.team-presence-meta {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
}
.team-presence-caret {
  margin-left: auto;
  font-size: 1.05rem;
  transition: transform 0.15s ease;
}
.team-presence.is-collapsed .team-presence-caret {
  transform: rotate(-90deg);
}
.team-presence.is-collapsed .team-presence-list {
  display: none;
}
.team-presence-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: -0.01em;
  padding: 0 0.35rem;
}
.team-presence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  max-height: 7.5rem;
  overflow: auto;
}
.team-presence-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
}
.team-presence-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--secondary);
  overflow: hidden;
}
.team-presence-avatar.has-photo {
  background: var(--line-soft);
  padding: 0;
}
.team-presence-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.team-presence-copy {
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}
.team-presence-copy strong {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.team-presence-status {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}
.team-presence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b0b0b0;
  flex-shrink: 0;
}
.team-presence-item[data-status="online"] .team-presence-dot { background: #2f9e44; }
.team-presence-item[data-status="online"] .team-presence-status { color: #2f9e44; }
.team-presence-item[data-status="away"] .team-presence-dot { background: #f59f00; }
.team-presence-item[data-status="away"] .team-presence-status { color: #c47f00; }
.team-presence-item[data-status="offline"] .team-presence-dot { background: #b0b0b0; }
.team-presence-item.is-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.team-presence-item.is-clickable:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.team-presence-item {
  position: relative;
}
.team-presence-badge {
  margin-left: auto;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.team-presence-badge[hidden] {
  display: none !important;
}

.dm-chat {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  width: min(100vw - 1.5rem, 380px);
}
.dm-chat.hidden { display: none !important; }
.dm-chat-card {
  background: var(--panel, #fff);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  max-height: min(70vh, 520px);
  overflow: hidden;
}
.dm-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.dm-chat-head h2 { margin: 0; font-size: 1.02rem; }
.dm-chat-retention {
  margin: 0;
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  line-height: 1.35;
}
.dm-chat-messages {
  overflow: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 220px;
  background: var(--paper, #fafafa);
}
.dm-chat-empty { margin: auto; color: var(--muted); font-size: 0.88rem; text-align: center; line-height: 1.5; }
.dm-chat-empty-hint { display: inline-block; margin-top: 0.35rem; font-size: 0.78rem; opacity: 0.9; }
.dm-bubble { max-width: 85%; display: grid; gap: 0.15rem; }
.dm-bubble.is-mine { align-self: flex-end; }
.dm-bubble.is-peer { align-self: flex-start; }
.dm-bubble-body {
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.dm-bubble.is-mine .dm-bubble-body {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.dm-bubble.is-peer .dm-bubble-body {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.dm-bubble-meta { font-size: 0.68rem; color: var(--muted); padding: 0 0.2rem; }
.dm-bubble.is-mine .dm-bubble-meta { text-align: right; }
.dm-chat-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem;
  border-top: 1px solid var(--line);
  background: #fff;
}
.dm-chat-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}
.dm-chat-error { margin: 0; padding: 0 0.85rem 0.65rem; font-size: 0.8rem; }

.account-card,
.account-chip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.account-card {
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  width: 100%;
  text-align: left;
}

.account-card.is-clickable,
#app-userbar.is-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.account-card.is-clickable:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.account-avatar.has-photo,
.profile-avatar-preview.has-photo {
  padding: 0;
  overflow: hidden;
  background: var(--line-soft);
  color: transparent;
}
.account-avatar img,
.profile-avatar-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  border-radius: 50%;
}
.profile-edit { display: grid; gap: 0.9rem; }
.profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.profile-avatar-preview {
  width: 64px;
  height: 64px;
  font-size: 1.35rem;
}
.profile-avatar-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.account-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #fff;
  background: var(--secondary);
  box-shadow: none;
  overflow: hidden;
  position: relative;
}

.account-avatar[data-tone="staff"] {
  background: #7a8ea3;
  box-shadow: none;
}

.account-copy {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.account-copy strong {
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-copy span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-badge {
  margin-left: auto;
  flex-shrink: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid #cfe0db;
}

.account-badge[data-tone="staff"] {
  background: #e8eef4;
  color: #3d5a80;
  border-color: #d2dde8;
}

.app-userbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: -0.15rem 0 1rem;
  position: sticky;
  top: 0;
  z-index: 5;
}

.account-chip {
  padding: 0.45rem 0.55rem 0.45rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(47, 53, 59, 0.06);
  backdrop-filter: blur(8px);
  max-width: min(100%, 360px);
}

.account-chip .account-avatar {
  width: 2.15rem;
  height: 2.15rem;
  font-size: 0.82rem;
}

.account-chip .account-copy strong {
  font-size: 0.88rem;
}

.sidebar .brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-weight: 700;
}

.sidebar .brand > span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.sidebar nav {
  display: grid;
  gap: 0.2rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
  align-content: start;
}

.sidebar nav button,
.sidebar nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar nav button > i,
.sidebar nav .nav-link > i {
  width: auto;
  height: auto;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  background: transparent;
  color: inherit;
}

/* 메뉴별 아이콘 색 — 기능별 은은한 단색 (solutions.css tone 변수 사용) */
.sidebar nav [data-view] > i,
.sidebar nav .nav-link > i {
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar nav button:hover,
.sidebar nav .nav-link:hover {
  background: #ffffff;
  color: var(--ink);
}

.sidebar nav button.is-active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: var(--shadow);
}

.sidebar nav button.is-active > i {
  box-shadow: none;
}

.sidebar nav .nav-logout {
  margin-top: 0.55rem;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 10px 10px;
  padding-top: 0.85rem;
}

.main {
  padding: 1.45rem clamp(1rem, 3vw, 2rem) 2.5rem;
  min-width: 0;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.25rem;
  font-weight: 700;
  color: var(--ink);
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: grid;
  gap: 0.35rem;
  box-shadow: var(--shadow);
}

.card span {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.card b {
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--ink);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow: auto;
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.toolbar input,
.toolbar select {
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  min-width: 160px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.8rem;
  background: var(--paper);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-new {
  background: #d7ebe4;
  color: var(--accent-deep);
}

.badge-done {
  background: #e8eef2;
  color: var(--muted);
}

.badge-progress {
  background: #fdead7;
  color: var(--warn);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.68rem 1.05rem;
  border-radius: var(--radius-sm);
  font-weight: 650;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-deep);
}

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--paper);
  color: var(--ink);
}

.btn-danger {
  color: var(--danger);
  border: 1px solid rgba(180,35,24,0.25);
  background: #fff8f7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.actions button {
  font-size: 0.78rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.hidden { display: none !important; }

/* 내 정보 등 — 다른 CRM 앱과 동일한 중앙 모달 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 50, 0.45);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 55;
}
.modal-backdrop.hidden { display: none !important; }
.modal-card {
  width: min(100%, 440px);
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line, #e2e8f0);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  padding: 1.1rem 1.15rem 1rem;
  display: grid;
  gap: 0.75rem;
  max-height: min(90vh, 720px);
  overflow: auto;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.modal-head h2 { margin: 0; font-size: 1.15rem; letter-spacing: -0.02em; }
.modal-close {
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted, #64748b);
  padding: 0.2rem 0.4rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.modal-body {
  display: grid;
  gap: 0.75rem;
}
.modal-body label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
  font-weight: 650;
}
.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.85rem;
  padding: 0.75rem 0.95rem;
  border: 1.5px solid #e2e0de;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.modal-body textarea {
  min-height: 8.5rem;
  resize: vertical;
  line-height: 1.55;
}
.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  outline: none;
  border-color: var(--secondary, #4ecdc4);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.22);
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 20, 26, 0.35);
  display: grid;
  justify-content: end;
  z-index: 50;
}

.drawer {
  width: min(100%, 420px);
  height: 100%;
  background: #fff;
  padding: 1.25rem;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 0.85rem;
}

.drawer.drawer-wide {
  width: min(100%, 560px);
}

.drawer h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0;
  letter-spacing: -0.03em;
}

.drawer dl {
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.drawer dt {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.drawer dd { margin: 0; }

.drawer textarea,
.drawer select {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.85rem;
  padding: 0.75rem 0.95rem;
  border: 1.5px solid #e2e0de;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
}

.drawer textarea { min-height: 8.5rem; resize: vertical; line-height: 1.55; }

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.field-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.drawer-form {
  display: grid;
  gap: 0.85rem;
}

.drawer-form input,
.drawer-form select,
.drawer-form textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.85rem;
  padding: 0.75rem 0.95rem;
  border: 1.5px solid #e2e0de;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.drawer-form textarea {
  min-height: 8.5rem;
  resize: vertical;
  line-height: 1.55;
}

.drawer-form input:focus,
.drawer-form select:focus,
.drawer-form textarea:focus {
  outline: none;
  border-color: var(--secondary, #4ecdc4);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.22);
}

.form-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.hope-conditions {
  display: grid;
  gap: 0.75rem;
  margin: 0.15rem 0 0.35rem;
}
.hope-conditions-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.hope-conditions-head strong {
  font-size: 0.95rem;
}

.match-panel {
  margin: 0.5rem 0 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 55%);
  display: grid;
  gap: 0.65rem;
}
.match-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.match-panel-head strong {
  font-size: 0.95rem;
}

.settle-panel {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 0.55rem;
}
.settle-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.settle-table-wrap {
  max-height: 220px;
  overflow: auto;
}
.settle-table td,
.settle-table th {
  font-size: 0.85rem;
}
.settle-toggle-ui {
  background: #e2e8f0 !important;
}
.settle-toggle-ui .kakao-icon {
  background: #64748b !important;
  color: #fff !important;
}
.kakao-toggle:has(#c-fee-settled:checked),
.kakao-toggle.settle-on {
  background: #ecfdf5;
  border-color: #6ee7b7;
  box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.2);
}
.kakao-toggle input#c-fee-settled:checked + .settle-toggle-ui {
  background: #059669 !important;
  transform: scale(1.04);
}
.kakao-toggle input#c-fee-settled:checked + .settle-toggle-ui .kakao-icon {
  background: #fff !important;
  color: #059669 !important;
}

.broker-fee-block {
  margin: 0.35rem 0 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  background: var(--paper);
  display: grid;
  gap: 0.55rem;
}
.broker-fee-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}
.broker-fee-head .field-label {
  margin: 0;
  font-weight: 700;
}
.broker-fee-row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 0.65rem;
  align-items: stretch;
}
@media (max-width: 640px) {
  .broker-fee-row { grid-template-columns: 1fr; }
}
.js-money,
input[data-money="1"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.broker-fee-settle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel, #fff);
  cursor: pointer;
  user-select: none;
}
.broker-fee-settle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.broker-fee-settle-ui {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #e2e8f0;
  flex-shrink: 0;
}
.broker-fee-settle-ui .kakao-icon {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: #64748b;
  color: #fff;
}
.broker-fee-settle-text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.broker-fee-settle-text strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}
.broker-fee-settle-text small {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}
.broker-fee-settle.settle-on,
.broker-fee-settle:has(#c-fee-settled:checked) {
  background: #ecfdf5;
  border-color: #6ee7b7;
}
.broker-fee-settle:has(#c-fee-settled:checked) .broker-fee-settle-ui,
.broker-fee-settle.settle-on .broker-fee-settle-ui {
  background: #059669;
}
.broker-fee-settle:has(#c-fee-settled:checked) .broker-fee-settle-ui .kakao-icon,
.broker-fee-settle.settle-on .broker-fee-settle-ui .kakao-icon {
  background: #fff;
  color: #059669;
}

.kakao-toggle:has(#c-alimtalk:checked),
.kakao-toggle.kakao-on {
  background: #fff8e8;
  border-color: #f0d000;
  box-shadow: inset 0 0 0 1px rgba(254, 229, 0, 0.55);
}

.btn-fee-settled {
  border-color: #6ee7b7 !important;
  background: #ecfdf5 !important;
  color: #047857 !important;
  font-weight: 750;
}
.btn-fee-pending {
  border-color: #fcd34d !important;
  background: #fffbeb !important;
  color: #b45309 !important;
  font-weight: 750;
}

.match-panel-body {
  min-height: 1.5rem;
}
.match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.match-item-btn,
.match-chip {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.match-item-btn:hover,
.match-chip:hover {
  border-color: #94a3b8;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.match-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}
.match-body strong {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-why {
  font-size: 0.75rem;
  color: #64748b;
}
.match-score {
  flex-shrink: 0;
  min-width: 2.1rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.match-score.is-high {
  background: #dcfce7;
  color: #166534;
}
.match-score.is-mid {
  background: #e0f2fe;
  color: #075985;
}
.match-score.is-low {
  background: #f1f5f9;
  color: #475569;
}
.match-empty {
  margin: 0;
}
.match-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.match-chip {
  width: auto;
  max-width: 100%;
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
}
.match-chip .match-score {
  min-width: 1.7rem;
  height: 1.4rem;
  font-size: 0.7rem;
}
.ledger-match-block {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--line);
}
.ledger-match-block > span {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.hope-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.85rem 0.9rem;
  display: grid;
  gap: 0.65rem;
}
.hope-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.hope-block-head strong {
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.hope-block .hope-checks {
  margin: 0;
}
.ledger-hope-list {
  display: grid;
  gap: 0.45rem;
  flex: 1 1 100%;
}
.ledger-hope-item {
  display: grid;
  gap: 0.15rem;
}
.ledger-hope-item span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
}
.ledger-hope-item strong {
  font-size: 0.88rem;
}
.ledger-detail-meta {
  align-items: flex-start;
}
.hope-checks {
  margin: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.hope-checks legend {
  padding: 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.hope-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.35rem 0;
}
.hope-row + .hope-row {
  border-top: 1px dashed var(--line);
  margin-top: 0.25rem;
  padding-top: 0.55rem;
}
.hope-label {
  min-width: 4.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}
.hope-checks .chk {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.hope-checks .chk input {
  width: auto;
  margin: 0;
  accent-color: var(--accent, #2f6fed);
}
.hope-must-inline {
  display: inline-flex !important;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.35rem;
  font-size: 0.75rem !important;
  font-weight: 650 !important;
  color: var(--muted, #6b7280);
  cursor: pointer;
}
.hope-must-inline input { accent-color: #b91c1c; }
.hope-must-hint { margin: 0.45rem 0 0; }
.market-panel-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.market-panel-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.hope-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}
.hope-tag {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #eef3ff;
  color: #2f4f9a;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-meet { background: #e8f1ff; color: #1f5bb5; }
.badge-pre { background: #fff3e0; color: #b65c00; }

.card-warn b { color: var(--warn); }

.kakao-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.kakao-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kakao-toggle-ui {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #d9d9d9;
  transition: background .2s ease, transform .2s ease;
}

.kakao-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #3c1e1e;
  color: #fee500;
  font-size: 0.72rem;
  font-weight: 800;
}

.kakao-toggle input:checked + .kakao-toggle-ui {
  background: #fee500;
  transform: scale(1.04);
}

.kakao-toggle-text {
  display: grid;
  gap: 0.15rem;
}

.kakao-toggle-text strong {
  font-size: 0.92rem;
}

.kakao-toggle-text small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.kakao-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 800;
  background: #f0f0f0;
  color: var(--muted);
  line-height: 1.25;
}

.kakao-pill.is-on {
  background: #fee500;
  color: #191600;
}

.kakao-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  display: inline-block;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.kakao-pill-sub {
  font-weight: 600;
  font-size: 0.7rem;
  opacity: 0.8;
}

.kakao-pill-sub.warn {
  color: var(--warn);
  opacity: 1;
  font-weight: 800;
}

.row-expire {
  background: #fff7ed;
}

.expire-soon {
  color: var(--warn);
  font-weight: 700;
  font-size: 0.82rem;
}
.sm { font-size: 0.82rem; }
.clamp { max-width: 240px; }
.empty-row {
  color: var(--muted);
  padding: 2rem 0.55rem !important;
}

/* Customer ledger */
.ledger-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ledger-summary-item {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel, #fff);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.ledger-summary-item strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.ledger-summary-item span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.ledger-summary-item.warn strong {
  color: var(--warn);
}
.ledger-panel {
  padding-top: 0.85rem;
}
.ledger-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.ledger-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.ledger-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.ledger-table-wrap {
  overflow-x: auto;
}
.ledger-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}
.ledger-table thead th {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ledger-table td {
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.9rem;
}
.ledger-col-toggle {
  width: 2.2rem;
  padding-left: 0.25rem !important;
  padding-right: 0.15rem !important;
}
.ledger-toggle,
.ledger-name-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.ledger-toggle {
  width: 1.7rem;
  height: 1.7rem;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
}
.ledger-toggle:hover,
.ledger-name-btn:hover strong {
  color: var(--ink, #111);
}
.ledger-toggle i {
  font-size: 1.2rem;
  transition: transform 0.15s ease;
}
.ledger-row.is-expanded .ledger-toggle i {
  transform: rotate(90deg);
}
.ledger-name-btn {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.ledger-name-btn strong {
  font-size: 0.95rem;
}
.ledger-type {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: #f3f4f6;
}
.ledger-type.is-buy {
  background: #ecfdf5;
  color: #047857;
}
.ledger-type.is-sell {
  background: #fff7ed;
  color: #c2410c;
}
.ledger-hope {
  max-width: 220px;
  line-height: 1.35;
  color: var(--text);
}
.ledger-next {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  max-width: 11rem;
}
.ledger-next-urgent {
  color: var(--warn);
}
.ledger-next-next {
  color: #0f766e;
}
.ledger-next-done {
  color: var(--muted);
}
.ledger-detail-row td {
  background: #fafafa;
  padding: 0 !important;
  border-bottom: 1px solid var(--line);
}
.ledger-detail {
  padding: 0.85rem 1rem 1rem 2.6rem;
}
.ledger-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem 1rem;
  margin-bottom: 0.65rem;
}
.ledger-detail-grid span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.1rem;
}
.ledger-detail-grid strong {
  font-size: 0.88rem;
  font-weight: 700;
}
.ledger-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}
.ledger-detail-meta .kakao-pill {
  flex-direction: row;
  align-items: center;
}
.ledger-note {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

/* Schedule calendar */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.cal-nav strong {
  min-width: 7.5rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.2rem;
  margin: -0.35rem 0 1rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}
.cal-legend .dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.cal-legend .dot.visit { background: #2f6fed; }
.cal-legend .dot.dist { background: #b65c00; }
.cal-legend .dot.movein { background: #1f6b58; }
.cal-legend .dot.deposit { background: #0f766e; }
.cal-legend .dot.mid { background: #0369a1; }
.cal-legend .dot.balance { background: #7c3aed; }
.cal-legend .dot.expire { background: #b91c1c; }
.cal-legend .dot.custom { background: #6b5b95; }
.cal-legend .dot.off { background: #8a5cf6; }

.cal-panel { padding: 0.75rem; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.cal-dow {
  background: #f4f7f9;
  padding: 0.55rem 0.4rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
}
.cal-dow.is-sun { color: #c23b2a; }
.cal-dow.is-sat { color: #1f5bb5; }
.cal-cell {
  min-height: 108px;
  background: var(--white);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.cal-cell.is-out {
  background: #f7f9fb;
  color: #a0aab4;
}
.cal-cell.is-today {
  box-shadow: inset 0 0 0 2px rgba(31, 107, 88, 0.45);
}
.cal-cell.has-off {
  background: #f7f3ff;
}
.cal-daynum {
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.1rem;
}
.cal-events {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-height: 0;
}
.cal-ev {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 6px;
  padding: 0.18rem 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-ev:hover { filter: brightness(0.96); }
.cal-ev.visit { background: #e8f0ff; color: #1f5bb5; }
.cal-ev.dist { background: #fff1e0; color: #9a4b00; }
.cal-ev.movein { background: #e5f5ef; color: #145044; }
.cal-ev.deposit { background: #ccfbf1; color: #0f766e; }
.cal-ev.mid { background: #e0f2fe; color: #0369a1; }
.cal-ev.balance { background: #ede9fe; color: #6d28d9; }
.cal-ev.expire { background: #fee2e2; color: #b91c1c; }
.cal-ev.off {
  background: #efe7ff;
  color: #5b35b0;
  cursor: default;
}
.cal-more {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
}

.subhead {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}
.holiday-panel { margin-top: 1rem; }
.holiday-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 0.85rem;
}
.holiday-form label {
  display: grid;
  gap: 0.3rem;
}
.holiday-form .field-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.holiday-form input,
.holiday-form select {
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.holiday-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.holiday-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
}
.holiday-list .meta {
  font-size: 0.88rem;
}
.holiday-list .meta strong { margin-right: 0.35rem; }
.holiday-list .meta span { color: var(--muted); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Dashboard */
.dash-year-label select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  font-weight: 700;
}
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.dash-card.dash-wide { grid-column: 1 / -1; }
.dash-card {
  border: 1px solid var(--line-soft);
  box-shadow: none;
  background: linear-gradient(180deg, #fffcf8 0%, #faf8f4 100%);
}
.dash-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.dash-card-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.dash-card-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.dash-card-head > strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.dash-split {
  display: grid;
  grid-template-columns: 152px 1fr;
  gap: 1.25rem;
  align-items: center;
}
.pie-wrap {
  position: relative;
  width: 148px;
  height: 148px;
}
.pie-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#e8e4db 0 100%);
  box-shadow: inset 0 0 0 1px rgba(47, 53, 59, 0.04);
}
.pie-wrap::after,
.pie-center {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: var(--panel);
}
.pie-wrap::after {
  content: "";
  box-shadow: 0 0 0 1px var(--line-soft);
  z-index: 0;
}
.pie-center {
  z-index: 1;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 0.05rem;
  background: transparent;
  box-shadow: none;
}
.pie-center strong {
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1;
}
.pie-center span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.dash-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.dash-legend li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.65rem;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 600;
}
.dash-legend .swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  margin-right: 0.45rem;
  display: inline-block;
  flex-shrink: 0;
}
.dash-legend .left {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--ink-soft);
  font-weight: 600;
}
.dash-legend .val {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-weight: 600;
}
.dash-legend .val b {
  color: var(--ink);
  font-weight: 700;
}
.dash-legend .val em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.dash-legend .legend-track {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
}
.dash-legend .legend-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  opacity: 0.85;
}
.dash-legend-empty {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-weight: 500;
}

.funnel { display: grid; gap: 0.7rem; }
.funnel-row {
  display: grid;
  grid-template-columns: 5.6rem 1fr 3.6rem;
  gap: 0.65rem;
  align-items: center;
}
.funnel-row span {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink-soft);
}
.funnel-bar {
  height: 10px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
}
.funnel-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.45s ease;
  min-width: 0;
}
.funnel-row.funnel-a .funnel-bar i { background: #9aa5b1; }
.funnel-row.funnel-b .funnel-bar i { background: #5b7c99; }
.funnel-row.funnel-c .funnel-bar i { background: var(--accent); }
.funnel-row em {
  font-style: normal;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-size: 0.88rem;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}
.funnel-row em small {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

.stats-expire-note {
  margin: 0;
  padding: 1.1rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}
.stats-expire-note strong {
  color: var(--accent-deep);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.dash-table-wrap { overflow: auto; max-height: 260px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.dash-table th,
.dash-table td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.dash-table th {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 800;
}
.dash-table button.linkish {
  background: none;
  border: 0;
  color: #1f5bb5;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
.dash-table button.linkish:hover { text-decoration: underline; }

.bar-chart {
  display: grid;
  gap: 0.85rem;
  min-height: 200px;
  padding: 0.15rem 0 0;
}
.bar-chart-plot {
  position: relative;
  min-height: 168px;
  padding: 1.15rem 0.15rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.bar-grid {
  position: absolute;
  inset: 1.15rem 0 0;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  pointer-events: none;
}
.bar-grid span {
  border-top: 1px dashed #e4dfd5;
}
.bar-chart-cols {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: end;
  height: 148px;
}
.bar-col {
  display: grid;
  gap: 0.4rem;
  align-content: end;
  min-width: 0;
  height: 100%;
}
.bar-pair {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 100%;
  overflow: visible;
  padding-top: 1.05rem;
}
.bar {
  width: 38%;
  max-width: 12px;
  border-radius: 999px 999px 3px 3px;
  min-height: 2px;
  position: relative;
  transition: height 0.4s ease, opacity 0.2s ease;
  opacity: 0.92;
}
.bar:hover { opacity: 1; }
.bar-val {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.bar-col:hover .bar-val,
.bar:hover .bar-val {
  opacity: 1;
  color: var(--ink-soft);
}

.addr-search-row {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
}
.addr-search-row input { flex: 1; min-width: 0; }
.addr-search-row .btn { flex-shrink: 0; white-space: nowrap; }

.map-side-item.is-active {
  border-color: #1f6b58;
  background: #e8f5f1;
}
.bar.ask { background: #5b7c99; }
.bar.deal { background: var(--accent); }
.bar.target { background: #cfd6d4; }
.bar.actual { background: var(--accent); }
.bar-col label {
  display: block;
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.bar-hint {
  display: flex;
  gap: 1.1rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}
.bar-hint i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.income-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.65rem;
  align-items: end;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.income-form label { display: grid; gap: 0.3rem; }
.income-form .field-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.income-form input,
.income-form select {
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

/* Listings · Map */
.lst-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  background: #e8eef3;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 800;
}
.lst-thumb.is-empty { border: 1px dashed var(--line); }
.pin-pill {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #efe7ff;
  color: #5b35b0;
  font-size: 0.7rem;
  font-weight: 800;
}
.unit-groups {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.unit-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #f8fafb;
}
.unit-group h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.unit-group h3 em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}
.unit-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.unit-group li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  font-size: 0.88rem;
}
.attach-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 0.65rem;
}
.attach-chip {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}
.attach-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attach-chip.file {
  width: auto;
  height: auto;
  padding: 0.45rem 1.6rem 0.45rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.attach-chip button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
}
.attach-chip .attach-size {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.1rem 0.15rem;
  background: rgba(20, 24, 28, 0.62);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: stretch;
}
.compare-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  min-height: 62vh;
}
.compare-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.compare-side-list {
  display: grid;
  gap: 0.4rem;
  overflow: auto;
  max-height: calc(100vh - 220px);
  padding-right: 0.15rem;
}
.compare-side-item {
  display: grid;
  gap: 0.12rem;
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.compare-side-item:hover {
  border-color: rgba(255, 85, 0, 0.35);
  background: #fff;
}
.compare-side-item.is-active {
  border-color: rgba(255, 85, 0, 0.55);
  background: rgba(255, 85, 0, 0.06);
  box-shadow: inset 3px 0 0 #ff5500;
}
.compare-side-item strong { font-size: 0.9rem; }
.compare-side-item span { font-size: 0.78rem; color: var(--muted); }
.compare-main {
  min-height: 0;
  overflow: auto;
  max-height: calc(100vh - 180px);
}
.market-panel {
  margin: 0 0 0.85rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(232, 244, 242, 0.55), var(--paper));
}
.market-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.market-summary { margin-bottom: 0.75rem; }
.market-platform-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.market-link-card {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.market-link-card:hover { border-color: rgba(45, 106, 98, 0.45); }
.market-link-card strong { font-size: 0.9rem; }
.market-link-card span { font-size: 0.75rem; color: var(--muted); }
.market-deal-tabs-note { margin: 0 0 0.65rem; }
.market-offer-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.7rem 0.8rem 0.85rem;
  margin-bottom: 0.65rem;
}
.market-offer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.market-offer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}
.market-offer-col-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  margin-bottom: 0.25rem;
}
.market-offer-count-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.market-offer-count-static {
  font-size: 0.86rem;
  font-weight: 700;
}
.market-offer-hint { margin: 0.15rem 0 0; font-size: 0.74rem; }
.market-offer-ext-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.market-offer-block.is-naver .market-offer-count-btn {
  color: #027a36;
}
.market-offer-block.is-naver .market-offer-ext-btn {
  color: #fff;
  background: #03c75a;
  border-color: #03c75a;
}
.market-offer-block.is-naver .market-offer-ext-btn:hover {
  background: #02a847;
  border-color: #02a847;
}
.market-offer-block.is-zigbang .market-offer-count-btn {
  color: #c24100;
}
.market-offer-block.is-zigbang .market-offer-ext-btn {
  color: #fff;
  background: #ff5500;
  border-color: #ff5500;
}
.market-offer-block.is-zigbang .market-offer-ext-btn:hover {
  background: #e04b00;
  border-color: #e04b00;
}

.market-offer-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.market-offer-modal[hidden] { display: none !important; }
.market-offer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 28, 0.45);
}
.market-offer-modal-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(82vh, 820px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}
.market-offer-modal.is-naver .market-offer-modal-panel {
  box-shadow: 0 18px 50px rgba(3, 199, 90, 0.18);
  border-color: rgba(3, 199, 90, 0.35);
}
.market-offer-modal.is-zigbang .market-offer-modal-panel {
  box-shadow: 0 18px 50px rgba(255, 85, 0, 0.16);
  border-color: rgba(255, 85, 0, 0.35);
}
.market-offer-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.market-offer-modal.is-naver .market-offer-modal-title { color: #027a36; }
.market-offer-modal.is-zigbang .market-offer-modal-title { color: #c24100; }
.market-offer-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.market-offer-modal.is-naver .market-offer-modal-ext {
  color: #fff;
  background: #03c75a;
  border-color: #03c75a;
}
.market-offer-modal.is-zigbang .market-offer-modal-ext {
  color: #fff;
  background: #ff5500;
  border-color: #ff5500;
}
.market-offer-modal-list {
  padding: 0.75rem 1rem 1rem;
  overflow: auto;
  display: grid;
  gap: 0.4rem;
  max-height: calc(min(82vh, 820px) - 76px);
}
.market-offer-modal-list .market-offer-card {
  padding: 0.55rem 0.7rem;
}
.market-offer-modal-list .market-offer-card strong {
  font-size: 0.92rem;
}
.market-offer-modal-close {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}
.market-offer-list {
  display: grid;
  gap: 0.35rem;
}
.market-offer-card {
  display: grid;
  gap: 0.1rem;
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafa;
  padding: 0.5rem 0.55rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.market-offer-card:hover {
  border-color: rgba(45, 106, 98, 0.45);
  background: #fff;
}
.market-offer-card strong { font-size: 0.84rem; }
.market-offer-card span { font-size: 0.78rem; }

/* 네이버 — 대표 그린 #03C75A */
.market-offer-block.is-naver {
  --offer-brand: #03c75a;
  --offer-brand-deep: #02a847;
  --offer-brand-soft: rgba(3, 199, 90, 0.12);
  border-color: rgba(3, 199, 90, 0.35);
  background: linear-gradient(180deg, rgba(3, 199, 90, 0.08), #fff 42%);
  box-shadow: inset 3px 0 0 var(--offer-brand);
}
.market-offer-block.is-naver .market-offer-head strong {
  color: var(--offer-brand-deep);
}
.market-offer-block.is-naver .market-offer-link {
  color: var(--offer-brand-deep);
  font-weight: 600;
}
.market-offer-card.is-naver {
  background: #fff;
  border-color: rgba(3, 199, 90, 0.32);
}
.market-offer-card.is-naver:hover {
  border-color: #03c75a;
  background: rgba(3, 199, 90, 0.06);
}
.market-offer-card.is-naver strong {
  color: #027a36;
}
.market-offer-card.is-naver.is-summary {
  border-style: dashed;
  background: rgba(3, 199, 90, 0.06);
}

/* 직방 — 대표 오렌지 #FF5500 */
.market-offer-block.is-zigbang {
  --offer-brand: #ff5500;
  --offer-brand-deep: #e04b00;
  --offer-brand-soft: rgba(255, 85, 0, 0.12);
  border-color: rgba(255, 85, 0, 0.35);
  background: linear-gradient(180deg, rgba(255, 85, 0, 0.09), #fff 42%);
  box-shadow: inset 3px 0 0 var(--offer-brand);
}
.market-offer-block.is-zigbang .market-offer-head strong {
  color: var(--offer-brand-deep);
}
.market-offer-block.is-zigbang .market-offer-link {
  color: var(--offer-brand-deep);
  font-weight: 600;
}
.market-offer-card.is-zigbang {
  background: #fff;
  border-color: rgba(255, 85, 0, 0.32);
}
.market-offer-card.is-zigbang:hover {
  border-color: #ff5500;
  background: rgba(255, 85, 0, 0.06);
}
.market-offer-card.is-zigbang strong {
  color: #c24100;
}
.market-offer-card.is-zigbang.is-summary {
  border-style: dashed;
  background: rgba(255, 85, 0, 0.06);
}

@media (max-width: 960px) {
  .market-offer-grid { grid-template-columns: 1fr; }
}
.market-deal-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.7rem 0.8rem 0.85rem;
  margin-bottom: 0.65rem;
}
.market-deal-section.is-listing-deal {
  border-color: rgba(45, 106, 98, 0.45);
  box-shadow: inset 3px 0 0 var(--accent);
}
.market-deal-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.market-deal-head strong {
  font-size: 0.95rem;
}
.market-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.market-stats > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  background: #fff;
  display: grid;
  gap: 0.15rem;
}
.market-stats span { font-size: 0.75rem; color: var(--muted); }
.market-stats strong { font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.market-diff {
  margin: 0 0 0.55rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: #e8eef2;
  font-weight: 700;
  font-size: 0.88rem;
}
.market-diff.high { background: #ffe8e6; color: #b42318; }
.market-diff.low { background: #d7ebe4; color: #2c544d; }
.market-table-wrap {
  overflow: auto;
  max-height: 240px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.market-help { padding-left: 1.15rem; line-height: 1.55; }
.market-drawer-block {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
@media (max-width: 720px) {
  .market-stats { grid-template-columns: 1fr; }
}
.map-panel { padding: 0.65rem; }
.listing-map {
  width: 100%;
  height: min(68vh, 640px);
  border-radius: 12px;
  background: #e8eef3;
  z-index: 1;
}
.map-side {
  max-height: min(68vh, 640px);
  overflow: auto;
  display: grid;
  gap: 0.45rem;
  align-content: start;
}
.map-side-item {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: grid;
  gap: 0.2rem;
}
.map-side-item:hover { border-color: rgba(31,107,88,.35); }
.map-side-item strong { font-size: 0.9rem; }
.map-side-item span { font-size: 0.78rem; color: var(--muted); }
button.linkish {
  background: none;
  border: 0;
  color: #1f5bb5;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
button.linkish:hover { text-decoration: underline; }

.dash-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.dash-quick-card {
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, background 0.15s ease;
  font: inherit;
  color: inherit;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.dash-quick-card:hover {
  border-color: rgba(61, 111, 102, 0.35);
  background: var(--accent-soft);
}
.dash-quick-card strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 0.2rem;
  color: var(--ink);
}
.dash-quick-card span {
  color: var(--muted);
  font-size: 0.82rem;
}
.stats-expire-note {
  margin: 0.25rem 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}
.sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(31, 107, 88, 0.22);
  background: linear-gradient(135deg, rgba(232, 244, 242, 0.95), rgba(239, 246, 255, 0.9));
  font-size: 0.88rem;
}
.sync-banner.soft {
  background: var(--paper);
  border-color: var(--line);
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.settings-grid .export-panel {
  grid-column: 1 / -1;
}
.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  width: 100%;
  font-weight: 650;
}
.export-btn > i {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.export-btn-template {
  border-style: dashed;
}
.export-btn-template > i {
  background: #f3f1ec;
  color: var(--ink-soft);
}
.export-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.25rem 0 1rem;
}
.import-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.file-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.import-modal {
  max-width: min(920px, 96vw);
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
}
.import-modal .drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.import-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.import-stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: var(--paper);
  display: grid;
  gap: 0.15rem;
}
.import-stat strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.import-stat span {
  font-size: 0.78rem;
  color: var(--muted);
}
.import-stat.warn strong { color: #b65c00; }
.import-stat.err strong { color: #b42318; }
.import-table-wrap {
  overflow: auto;
  max-height: min(42vh, 420px);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 0.85rem;
}
.import-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e8eef2;
  color: #374151;
}
.import-badge-create { background: #d7ebe4; color: #2c544d; }
.import-badge-update { background: #e8f1ff; color: #1f5bb5; }
.import-badge-conflict { background: #fff3e0; color: #b65c00; }
.import-badge-error { background: #ffe8e6; color: #b42318; }
.import-badge-skip { background: #f3f4f6; color: #6b7280; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; }
@media (max-width: 720px) {
  .import-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.settings-form {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.75rem;
}
.settings-form label { display: grid; gap: 0.3rem; }
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.check-row input { margin-top: 0.2rem; }
.account-hint {
  margin: 0.75rem 0;
  padding-left: 1.1rem;
  color: var(--ink);
  line-height: 1.7;
  font-size: 0.9rem;
}
.cal-legend .dot.custom,
.cal-ev.custom {
  --ev: #6b5b95;
}
.cal-ev.custom {
  background: rgba(107, 91, 149, 0.14);
  color: #4a3d73;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  border-radius: 4px;
  padding: 0.1rem 0.25rem;
}
.dot.custom {
  background: #6b5b95;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--paper);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .sidebar .brand { width: 100%; border-bottom: 0; padding-bottom: 0.2rem; }
  .app-userbar { display: none; }
  .sidebar nav { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .sidebar nav button,
  .sidebar nav .nav-link {
    flex-direction: column;
    gap: 0.35rem;
    text-align: center;
    font-size: 0.78rem;
    padding: 0.55rem 0.35rem;
  }
  .sidebar nav .nav-logout {
    margin-top: 0;
    border-top: 0;
    padding-top: 0.55rem;
  }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .holiday-form { grid-template-columns: 1fr 1fr; }
  .cal-cell { min-height: 88px; }
  .dash-grid { grid-template-columns: 1fr; }
  .income-form { grid-template-columns: 1fr 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .compare-layout { grid-template-columns: 1fr; }
  .compare-side-list,
  .compare-main { max-height: none; }
  .dash-quick { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .ledger-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .sidebar nav { grid-template-columns: 1fr 1fr; }
  .holiday-form { grid-template-columns: 1fr; }
  .dash-quick { grid-template-columns: 1fr; }
  table { min-width: 640px; }
  .cal-ev { font-size: 0.68rem; }
  .dash-split { grid-template-columns: 1fr; justify-items: center; }
  .dash-legend { width: 100%; max-width: 280px; }
  .income-form { grid-template-columns: 1fr; }
  .bar-chart-cols { gap: 0.2rem; }
  .bar { max-width: 9px; }
  .bar-val { opacity: 1; font-size: 0.55rem; }
  .ledger-summary { grid-template-columns: 1fr 1fr; }
  .ledger-detail { padding-left: 1rem; }
  .ledger-detail-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== AI hub + shared form fields (parity with industry CRM) ===== */
.muted { color: var(--muted); }
.ai-assist-hub { margin-top: 0.15rem; position: relative; }
.ai-hub-shell {
  position: relative;
  padding: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}
.ai-hub-hero,
.ai-hub-intro,
.ai-hub-kicker,
.ai-hub-title,
.ai-hub-lead,
.ai-hub-card-top { display: none !important; }

.ai-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 960px) {
  .ai-hub-grid { grid-template-columns: 1fr; }
}

.ai-hub-card {
  position: relative;
  display: grid;
  gap: 0.7rem;
  align-content: start;
  padding: 1rem 1.1rem;
  border-radius: var(--radius, 12px);
  background: var(--panel, #fff);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: visible;
}
.ai-hub-card::before { display: none; }
.ai-hub-card-wide { margin-bottom: 1rem; }
.ai-hub-card .subhead { margin: 0; }
.ai-hub-card .muted.sm { margin: 0; line-height: 1.45; }

.ai-hub-fields {
  display: grid;
  gap: 0.7rem;
}
.ai-hub-fields-inline {
  grid-template-columns: minmax(140px, 220px);
}
.ai-hub-fields label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ink-soft, var(--muted));
}

.panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.panel select,
.panel textarea,
.ai-hub-fields select,
.ai-hub-fields textarea,
.form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.form-grid select,
.form-grid textarea,
.alim-compose select,
.alim-compose textarea,
.alim-settings-form input:not([type="checkbox"]):not([type="radio"]),
.alim-toolbar input,
.alim-toolbar select {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.85rem;
  padding: 0.75rem 0.95rem;
  border: 1.5px solid #e2e0de;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.panel select,
.ai-hub-fields select,
.form-grid select,
.alim-compose select,
.alim-toolbar select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1rem;
  padding-right: 2.4rem;
  cursor: pointer;
}

.panel textarea,
.ai-hub-fields textarea,
.form-grid textarea,
.alim-compose textarea {
  min-height: 8.5rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  resize: vertical;
  line-height: 1.55;
}

textarea[data-mkt-body],
#alim-body,
.ai-hub-fields textarea[data-ai-copy-draft],
.ai-hub-fields textarea[data-ai-inq-draft],
.ai-hub-fields textarea[data-ai-listing-draft],
.ai-hub-fields textarea[data-ai-catalog-draft] {
  min-height: 11rem;
}

.panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.panel select:focus,
.panel textarea:focus,
.ai-hub-fields select:focus,
.ai-hub-fields textarea:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.alim-compose select:focus,
.alim-compose textarea:focus,
.alim-settings-form input:focus {
  outline: none;
  border-color: var(--secondary, #4ecdc4);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.22);
}

.ai-hub-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.ai-hub-result {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.15rem;
}
.ai-hub-result-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.ai-hub-out {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1.5px solid #e2e0de;
  border-radius: 12px;
  background: var(--paper, #fafafa);
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  min-height: 5.5rem;
  color: var(--ink);
}

.ai-analysis-charts,
.ai-analysis-charts--dash {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr);
  gap: 1rem;
  margin: 0.85rem 0 1rem;
}
@media (max-width: 900px) {
  .ai-analysis-charts,
  .ai-analysis-charts--dash { grid-template-columns: 1fr; }
}
.ai-chart-card {
  margin: 0;
  padding: 1rem 1.05rem 1.15rem;
  border-radius: var(--radius, 12px);
  border: 1px solid var(--line);
  background: var(--panel, #fff);
  min-width: 0;
}

.alim-compose { display: grid; gap: 0.7rem; margin-bottom: 0.85rem; }
.alim-compose label { display: grid; gap: 0.4rem; font-size: 0.88rem; font-weight: 650; }
.alim-settings-form { display: grid; gap: 0.75rem; max-width: 480px; }
.alim-toolbar input,
.alim-toolbar select { width: auto; min-width: 160px; }
