/* ========================================
   Seoul Mayor Chatbot : Design System
   ======================================== */

/* ── 답변 신뢰도 동적 경고 박스 (msg-warning) ── */
.msg-warning {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 0 0;
}
.msg-warning__box {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 8px;
  border: 1px solid;
}
.msg-warning__box--warn {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}
.msg-warning__box--strong {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}
.msg-warning__icon { flex-shrink: 0; }
.msg-warning__text { flex: 1; }

@media (prefers-color-scheme: dark) {
  .msg-warning__box--warn {
    color: #fcd34d;
    background: rgba(252, 211, 77, 0.12);
    border-color: rgba(252, 211, 77, 0.4);
  }
  .msg-warning__box--strong {
    color: #fca5a5;
    background: rgba(252, 165, 165, 0.12);
    border-color: rgba(252, 165, 165, 0.4);
  }
}


/* ========== Maintenance Overlay ========== */

.maintenance-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fb;
  padding: 24px;
}

@media (prefers-color-scheme: dark) {
  .maintenance-overlay { background: #1a1a2e; }
  .maintenance-card { background: #222240; color: #e0e0e0; }
  .maintenance-title { color: #fff !important; }
  .maintenance-desc { color: #ccc !important; }
  .maintenance-info { background: #2a2a4a; border-color: #3a3a5a; color: #ddd; }
  .timeline-item { color: #bbb; }
  .timeline-check.done { color: #6cc070; }
  .timeline-check.current { color: #7c9cff; }
  .timeline-check.pending { color: #555; }
  .maintenance-footer { color: #888; }
}
[data-theme="dark"] .maintenance-overlay { background: #1a1a2e; }
[data-theme="dark"] .maintenance-card { background: #222240; color: #e0e0e0; }
[data-theme="dark"] .maintenance-title { color: #fff !important; }
[data-theme="dark"] .maintenance-desc { color: #ccc !important; }
[data-theme="dark"] .maintenance-info { background: #2a2a4a; border-color: #3a3a5a; color: #ddd; }
[data-theme="dark"] .timeline-item { color: #bbb; }
[data-theme="dark"] .timeline-check.done { color: #6cc070; }
[data-theme="dark"] .timeline-check.current { color: #7c9cff; }
[data-theme="dark"] .timeline-check.pending { color: #555; }
[data-theme="dark"] .maintenance-footer { color: #888; }

.maintenance-card {
  max-width: 520px;
  width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 48px 36px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.maintenance-icon {
  margin-bottom: 10px;
}

.maintenance-icon svg {
  width: 40px;
  height: 40px;
  color: #5b7cfa;
}

.maintenance-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #000;
  margin-bottom: 12px;
  line-height: 1.4;
}

.maintenance-desc {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
}

.maintenance-info {
  background: #f0f4ff;
  border: 1px solid #d0dcf0;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.88rem;
  color: #444;
  line-height: 1.7;
}

.maintenance-timeline {
  text-align: left;
  margin: 0 auto 24px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: #555;
}

.timeline-check {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.timeline-check.done { color: #4caf50; font-weight: 700; }
.timeline-check.current { color: #5b7cfa; font-weight: 700; }
.timeline-check.pending { color: #ccc; }

.maintenance-footer {
  font-size: 0.8rem;
  color: #999;
  margin-top: 4px;
}

/* ========== Server Down Banner ========== */

.server-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--warning, #d97706);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  animation: bannerSlideDown 0.3s ease;
}

.server-banner--hidden {
  display: none;
}

.server-banner p {
  margin: 0;
}

.server-banner__btn {
  flex-shrink: 0;
  padding: 5px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.server-banner__btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

@keyframes bannerSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-hover: #f3f5f7;
  --surface-active: #edf0f3;

  --ink: #1a1d23;
  --ink-secondary: #4a5060;
  --ink-muted: #8b92a0;
  --ink-faint: #b4bac6;

  --border: #e2e5ea;
  --border-light: #eef0f3;
  --border-focus: #5b8def;

  --primary: #2563eb;
  --primary-hover: #1d4fd8;
  --primary-soft: #eff4ff;
  --primary-muted: #93b4f6;
  --msg-user-bg: #1a1d23;
  --msg-user-text: #ffffff;

  --accent: #e85d3a;
  --accent-soft: #fef3f0;

  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.14);

  --topbar-h: 56px;
  --sidebar-w: 300px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ========== Dark Mode ========== */

[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #1a1d25;
  --surface-hover: #22252e;
  --surface-active: #2a2d37;

  --ink: #e4e6eb;
  --ink-secondary: #b0b5c0;
  --ink-muted: #7a8194;
  --ink-faint: #4e5568;

  --border: #2e3240;
  --border-light: #2e3240;
  --border-focus: #5b8def;

  --primary: #5b8def;
  --primary-hover: #4a7de0;
  --primary-soft: #1a2540;
  --primary-muted: #3a5a9e;
  --msg-user-bg: #2f6fed;
  --msg-user-text: #ffffff;
  --msg-assistant-bg: #242730;
  --msg-assistant-text: #e4e6eb;

  --accent: #e85d3a;
  --accent-soft: #2a1a15;

  --success: #22c55e;
  --warning: #eab308;
  --error: #ef4444;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.4);
}

/* ========== Reset ========== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}

/* ========== Utilities ========== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.label-optional {
  font-size: 0.75em;
  font-weight: 400;
  color: var(--ink-muted);
  margin-left: 4px;
}

/* ========== Candidate Select Overlay ========== */

.candidate-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: overlayFadeIn 0.3s var(--ease);
}

.candidate-overlay--hidden {
  display: none;
}

.candidate-overlay__card {
  text-align: center;
  width: min(460px, 100%);
  margin: auto;
  flex-shrink: 0;
  padding: 36px 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s var(--ease);
}

.candidate-overlay__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  border-radius: var(--radius-full);
}

.candidate-overlay__icon svg {
  width: 26px;
  height: 26px;
  color: var(--primary);
}

.candidate-overlay__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.candidate-overlay__desc {
  font-size: 0.84rem;
  color: var(--ink-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.candidate-overlay__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.candidate-overlay__notice {
  margin-top: 20px;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.candidate-overlay__disclaimer {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: var(--radius-md);
  font-size: 0.73rem;
  line-height: 1.55;
  color: var(--ink-secondary);
  text-align: left;
}

.candidate-overlay__disclaimer p {
  margin: 0;
}

.candidate-overlay__disclaimer strong {
  color: var(--ink-primary);
}

.candidate-overlay__disclaimer-icon {
  flex-shrink: 0;
  font-size: 0.85rem;
  line-height: 1.55;
}

/* Select card (in overlay) */

.candidate-select-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.candidate-select-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.candidate-select-card:active {
  transform: translateY(-1px);
}

.candidate-select-card__avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--surface-hover);
  border: 3px solid var(--border-light);
  transition: border-color 0.2s var(--ease);
}

.candidate-select-card:hover .candidate-select-card__avatar {
  border-color: var(--primary-muted);
}

.candidate-select-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.candidate-select-card__party {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: -4px;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobile overlay adjustments */
@media (max-width: 400px) {
  .candidate-overlay__card {
    padding: 28px 20px 22px;
  }

  .candidate-select-card {
    padding: 18px 12px 16px;
  }

  .candidate-select-card__avatar {
    width: 60px;
    height: 60px;
  }
}

/* ========== App Shell ========== */

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* ========== Topbar ========== */

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 20;
}

.topbar__inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar__brand {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 9px;
  text-decoration: none;
  color: inherit;
}

.topbar__title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.topbar__tag {
  padding: 2px 8px;
  background: var(--surface-active);
  color: var(--ink-muted);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  transform: translateY(-1px);  /* baseline align tweak */
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ========== Buttons ========== */

.btn-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.btn-icon:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* Theme toggle icon visibility */
#themeToggle .icon-moon { display: none; }
#themeToggle .icon-sun  { display: block; }
[data-theme="dark"] #themeToggle .icon-moon { display: block; }
[data-theme="dark"] #themeToggle .icon-sun  { display: none; }

.btn-icon--sm {
  width: 28px;
  height: 28px;
}

.btn-icon--sm svg {
  width: 14px;
  height: 14px;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s var(--ease);
}

.btn-text:hover {
  color: var(--error);
  background: rgba(220, 38, 38, 0.06);
}

.btn-text svg {
  width: 14px;
  height: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  border: 1px solid transparent;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn--primary:hover {
  background: var(--primary-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-secondary);
  border-color: var(--border);
}

.btn--ghost:hover {
  background: var(--surface-hover);
}

/* ========== Main Layout ========== */

.main {
  flex: 1;
  display: flex;
  overflow: hidden;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ========== Sidebar ========== */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar__section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar__label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

/* ========== Candidate Cards ========== */

.candidate-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.candidate-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
}

.candidate-card:hover {
  border-color: var(--primary-muted);
  background: var(--primary-soft);
}

.candidate-card--active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.candidate-card--withdrawn {
  opacity: 0.55;
  background: var(--surface-hover);
}
.candidate-card--withdrawn .candidate-card__name {
  text-decoration: line-through;
  text-decoration-color: rgba(107, 114, 128, 0.55);
  color: var(--text-secondary);
}
.candidate-card--withdrawn .candidate-card__party {
  color: var(--text-secondary);
}
.candidate-card__status {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 8px;
  vertical-align: 1px;
}

.candidate-card__avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--surface-hover);
  flex-shrink: 0;
}

.candidate-card__info {
  min-width: 0;
}

.candidate-card__name {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.candidate-card__party {
  font-size: 0.76rem;
  color: var(--ink-muted);
  margin-top: 1px;
}

.candidate-card__check {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--primary);
  display: none;
  place-items: center;
}

.candidate-card--active .candidate-card__check {
  display: grid;
}

.candidate-card__check svg {
  width: 12px;
  height: 12px;
  color: #fff;
}

/* ========== Profile Form ========== */

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-secondary);
  margin-bottom: 4px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-size: 0.85rem;
  transition: border-color 0.15s var(--ease);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.12);
}

.field input::placeholder {
  color: var(--ink-faint);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ========== Sidebar Disclaimer ========== */

.sidebar__disclaimer {
  margin-top: auto;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--accent-soft);
  border-radius: var(--radius-md);
  font-size: 0.73rem;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.sidebar__disclaimer svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent);
}

.sidebar__disclaimer strong {
  color: var(--accent);
}

/* ========== Chat Area ========== */

.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ========== Chat Header ========== */

.chat-header {
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-header__info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header__avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--surface-hover);
  transition: transform 0.3s var(--ease-bounce);
}

.chat-header__avatar--switching {
  animation: avatarPop 0.3s var(--ease-bounce);
}

.chat-header__name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
}

.chat-header__party {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ========== Messages ========== */

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.messages::-webkit-scrollbar {
  width: 5px;
}

.messages::-webkit-scrollbar-track {
  background: transparent;
}

.messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.msg {
  max-width: min(85%, 580px);
  padding: 11px 16px;
  border-radius: var(--radius-lg);
  line-height: 1.65;
  font-size: 0.92rem;
  animation: msgIn 0.25s var(--ease);
  word-break: keep-all;
  overflow-wrap: break-word;
}

.msg p {
  margin: 0;
  white-space: pre-wrap;
}

.msg--system {
  align-self: flex-start;
  background: var(--primary-soft);
  color: var(--ink-secondary);
  border-bottom-left-radius: var(--radius-sm);
  border: 1px solid rgba(37, 99, 235, 0.1);
}

.msg--assistant {
  align-self: flex-start;
  background: var(--msg-assistant-bg, var(--surface));
  color: var(--msg-assistant-text, var(--ink));
  border: 1px solid var(--border-light);
  border-bottom-left-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.msg--user {
  align-self: flex-end;
  background: var(--msg-user-bg);
  color: var(--msg-user-text);
  border-bottom-right-radius: var(--radius-sm);
}

/* ========== Typing Indicator ========== */

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 10px 16px;
  background: var(--msg-assistant-bg, var(--surface));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  animation: msgIn 0.25s var(--ease);
}

.typing-indicator--hidden {
  display: none;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--ink-muted);
  animation: typingBounce 1.2s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

/* ========== Composer ========== */

.composer {
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--surface);
  flex-shrink: 0;
}

.composer__inner {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 14px;
  transition: border-color 0.2s var(--ease);
}

.composer__inner:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.1);
}

.composer textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  min-height: 24px;
  max-height: 120px;
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 6px 0;
  outline: none;
}

.composer textarea::placeholder {
  color: var(--ink-faint);
}

.composer__send {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.15s var(--ease);
}

.composer__send:hover {
  background: var(--primary-hover);
  transform: translateX(1px);
}

.composer__send:disabled {
  background: var(--ink-faint);
  cursor: not-allowed;
  transform: none;
}

.composer__send svg {
  width: 18px;
  height: 18px;
}

.composer__hint {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-align: right;
}

/* ========== Inline Citations (under each assistant message) ========== */

.msg-citations {
  margin-top: 8px;
}

.msg-citations__toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.msg-citations__toggle:hover {
  color: var(--primary);
  border-color: var(--primary-muted);
  background: var(--primary-soft);
}

.msg-citations__toggle svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}

.msg-citations__toggle--open svg {
  transform: rotate(180deg);
}

.msg-citations__list {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  animation: msgIn 0.2s var(--ease);
}

.msg-citations__list--visible {
  display: flex;
}

.cite {
  padding: 9px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg);
  transition: border-color 0.15s var(--ease);
}

.cite:hover {
  border-color: var(--primary-muted);
}

.cite__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cite__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cite__tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 500;
  background: var(--primary-soft);
  color: var(--primary);
}

.cite__tag--date {
  background: var(--surface-hover);
  color: var(--ink-muted);
}

.cite__tag--type {
  background: #e8f0fe;
  color: #1a56db;
  font-weight: 600;
}

.cite__tag--video {
  background: #fee2e2;
  color: #dc2626;
}

[data-theme="dark"] .cite__tag--type {
  background: #1e3a5f;
  color: #93bbfc;
}

[data-theme="dark"] .cite__tag--video {
  background: #4a1515;
  color: #fca5a5;
}

.cite__link {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 500;
  white-space: nowrap;
}

.cite__title-row {
  margin-top: 4px;
}

.cite__title-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.cite__title-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.cite__excerpt {
  margin: 5px 0 0;
  font-size: 0.78rem;
  color: var(--ink-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== Footer Survey Link ========== */

.site-footer__survey {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s var(--ease);
}

.site-footer__survey:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ========== Modal ========== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal--hidden {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
}

.modal__card {
  position: relative;
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s var(--ease);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.modal__head h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal__desc {
  font-size: 0.84rem;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ========== Survey Form ========== */

.survey-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.survey-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-secondary);
  margin-bottom: 4px;
}

.survey-field select,
.survey-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  font-size: 0.85rem;
}

.survey-field select:focus,
.survey-field textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.12);
}

.survey-field textarea {
  resize: vertical;
  min-height: 72px;
}

/* ========== Survey FAB ========== */

.survey-fab {
  display: none;
  position: fixed;
  right: 14px;
  bottom: 80px;
  z-index: 30;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.survey-fab:hover {
  background: var(--primary-soft);
  box-shadow: var(--shadow-lg);
}

.survey-fab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.survey-fab__label {
  white-space: nowrap;
}

/* ========== Animations ========== */

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@keyframes avatarPop {
  0% {
    transform: scale(0.85);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========== Site Footer ========== */

.site-footer {
  flex-shrink: 0;
  text-align: center;
  padding: 6px 24px 10px;
  font-size: 0.7rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

.site-footer__disclaimer {
  margin: 0 0 2px;
}

.site-footer__disclaimer strong {
  color: var(--ink-secondary);
  font-weight: 600;
}

.site-footer__copy {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.65rem;
}
.site-footer__data-notice {
  margin: 8px 0 0 0;
  color: var(--ink-faint);
  font-size: 0.62rem;
  line-height: 1.55;
  opacity: 0.85;
}
.site-footer__data-notice a {
  color: var(--ink-faint);
  text-decoration: underline;
}

/* ========== Desktop Sidebar Toggle ========== */

@media (min-width: 681px) {
  .sidebar--collapsed {
    display: none;
  }
}

/* ========== Responsive : Tablet ========== */

@media (max-width: 900px) {
  :root {
    --sidebar-w: 260px;
  }
}

/* ========== Responsive : Mobile ========== */

@media (max-width: 680px) {
  body {
    font-size: 14px;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: var(--topbar-h);
    bottom: 0;
    width: 300px;
    z-index: 35;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease);
    box-shadow: var(--shadow-lg);
  }

  .sidebar--open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    top: var(--topbar-h);
    z-index: 34;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
  }

  .sidebar-overlay--visible {
    opacity: 1;
    pointer-events: auto;
  }

  .survey-fab {
    display: flex;
  }

  .chat-header {
    padding: 10px 16px;
  }

  .messages {
    padding: 16px;
  }

  .composer {
    padding: 10px 16px 14px;
  }

  .msg {
    max-width: 92%;
  }

  .site-footer {
    display: none;
  }

  .topbar__tag {
    display: none;
  }

  .modal__card {
    padding: 18px;
  }

  .composer__hint {
    display: none;
  }

}

/* ===== 추천 질문 (다크모드 가독성) ===== */
.suggested-questions {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}
.sq-label {
  color: var(--ink-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.sq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.sq-chip {
  background: var(--surface);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}
.sq-chip:hover {
  background: var(--surface-hover);
  border-color: var(--primary-muted);
  color: var(--ink);
}
[data-theme="dark"] .sq-chip {
  background: rgba(255, 255, 255, 0.06);
  color: #d0dae8;
  border-color: rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .sq-chip:hover {
  background: rgba(91, 141, 239, 0.15);
  border-color: rgba(91, 141, 239, 0.4);
  color: #f0f0f0;
}
[data-theme="dark"] .sq-label { color: #c0cfe0; }
@media (max-width: 768px) {
  .sq-chips {
    flex-direction: column;
  }
  .sq-chip {
    width: 100%;
    text-align: left;
  }
  .sq-chips .sq-chip:nth-child(n+4) {
    display: none;
  }
}

/* ===== 액션 버튼 (복사, 따봉) 다크모드 가독성 ===== */
.msg-actions {
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem 0;
  margin-left: 3.2rem;
}
.btn-action {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.4rem;
  padding: 0.3rem 0.45rem;
  cursor: pointer;
  color: #8a9bb0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #d0dae8;
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-action.active,
.btn-action.voted {
  color: #e8732a;
  border-color: rgba(232, 115, 42, 0.4);
}

/* ===== 액션 버튼 다크모드 재수정 ===== */
.btn-action {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #5a6a7a !important;
}
.btn-action:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #8a9bb0 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
.btn-action.active,
.btn-action.voted {
  color: #e8732a !important;
  border-color: rgba(232, 115, 42, 0.3) !important;
  background: rgba(232, 115, 42, 0.08) !important;
}
.msg-actions {
  margin-left: 0 !important;
  padding-left: 0.5rem !important;
}

/* ============================================================
   v2 : 자치구 dropdown + avatar 없는 후보 카드
   ============================================================ */

.district-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s var(--ease);
}
.district-select:hover {
  border-color: var(--primary-muted);
}
.district-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* avatar 없는 카드 : 기호 + 이름 + 정당 */
.candidate-card--noavatar .candidate-card__avatar { display: none !important; }
.candidate-card--noavatar {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.candidate-card__giho {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--surface-active);
  color: var(--ink-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
}
.candidate-card--active .candidate-card__giho {
  background: var(--primary);
  color: #fff;
}
.candidate-card__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

/* 후보 선택 오버레이 : avatar 없는 카드 + 그룹 헤더 */
.candidate-overlay__group-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-secondary);
  margin: 18px 0 10px 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}
.candidate-overlay__group-title:first-child { margin-top: 4px; }

.candidate-overlay__subgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}

.candidate-select-card--noavatar {
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  position: relative;
}
.candidate-select-card--noavatar .candidate-select-card__avatar { display: none !important; }
.candidate-select-card--noavatar:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.candidate-select-card--noavatar .candidate-select-card__giho {
  position: absolute;
  top: 10px;
  right: 12px;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.candidate-select-card--noavatar .candidate-select-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.candidate-select-card--noavatar .candidate-select-card__party {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* ============================================================
   v2 : 자치구 선택 오버레이 + 사이드바 컴팩트화
   ============================================================ */

/* 진입 오버레이 카드는 가로로 더 넓게 (스크롤 최소화) */
.district-overlay-card {
  max-width: 880px !important;
  width: min(880px, 96vw) !important;
}

/* compact 변이: 헤더(아이콘, 제목, 설명) 제거 시 상단 padding 축소 */
.district-overlay-card--compact {
  padding-top: 22px !important;
  padding-bottom: 18px !important;
}
.district-overlay-card--compact .entry-section:first-of-type {
  margin-top: 0;
}

/* 자치구 검색 입력 */
.district-overlay__search {
  width: 100%;
  padding: 12px 16px;
  margin: 16px 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.district-overlay__search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* 25개 자치구 그리드 (가로로 더 넓게 → 6열) */
.district-overlay__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 8px;
  max-height: none;
  overflow: visible;
  padding: 2px;
}
@media (max-width: 640px) {
  .district-overlay__grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 420px) {
  .district-overlay__grid { grid-template-columns: repeat(3, 1fr); }
}

.district-overlay__btn {
  padding: 9px 4px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  font-family: inherit;
}
.district-overlay__btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   사이드바 : 컴팩트
   ============================================================ */

.sidebar__section {
  margin-bottom: 18px !important;
  padding-bottom: 0 !important;
}

.sidebar__label {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: var(--ink-secondary) !important;
  margin-bottom: 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* 사이드바 후보 카드 : avatar 없는 컴팩트 형태 (2-column grid) */
.sidebar .candidate-card--noavatar {
  padding: 7px 8px 7px 6px !important;
  gap: 6px !important;
  border-radius: var(--radius-md) !important;
  min-width: 0 !important;
  position: relative;
}
.sidebar .candidate-card__giho {
  width: 20px !important;
  height: 20px !important;
  font-size: 0.72rem !important;
  flex-shrink: 0 !important;
}
.sidebar .candidate-card__giho--pre {
  background: var(--surface-active) !important;
  color: var(--ink-muted) !important;
  font-size: 0.62rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em;
}
.sidebar .candidate-card--active .candidate-card__giho--pre {
  background: var(--primary) !important;
  color: #fff !important;
}
.sidebar .candidate-card__name {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar .candidate-card__party {
  font-size: 0.68rem !important;
  margin-top: 1px !important;
  color: var(--ink-muted) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar .candidate-card__main {
  min-width: 0 !important;
}
/* 체크 아이콘은 활성 시 우측 상단 작은 점으로 */
.sidebar .candidate-card__check {
  position: absolute !important;
  top: 4px !important;
  right: 4px !important;
  width: 12px !important;
  height: 12px !important;
}
.sidebar .candidate-card__check svg {
  width: 7px !important;
  height: 7px !important;
}

/* 후보 카드 : 2열 그리드 */
.sidebar .candidate-cards {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 5px !important;
}

/* 자치구 dropdown */
.district-select {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}
.district-select:hover { border-color: var(--primary-muted); }
.district-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* 맞춤 설정 폼도 컴팩트 */
.sidebar .profile-form .field input {
  padding: 7px 10px !important;
  font-size: 0.85rem !important;
}
.sidebar .profile-form .field label {
  font-size: 0.74rem !important;
  margin-bottom: 3px !important;
}
.sidebar .profile-form { gap: 6px !important; }

/* ============================================================
   추천 질문 : 관심 정책 매칭 chip 강조
   ============================================================ */
/* sq-chip--topic 도 일반 chip 과 동일하게 (별 강조 제거) */

/* ============================================================
   진입 오버레이 : 자치구 + 토글 demographic
   ============================================================ */

/* ── 진입 hero (서비스 소개) ── */
.entry-hero {
  margin: 0 0 20px;
  padding: 18px 4px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}
.entry-hero__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.entry-hero__sub {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.5;
}
.entry-hero__how {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.5;
}
@media (max-width: 480px) {
  .entry-hero { padding: 12px 4px; margin: 0 0 14px; }
  .entry-hero__title { font-size: 19px; }
  .entry-hero__sub { font-size: 13px; }
  .entry-hero__how { font-size: 12px; }
}

.entry-section {
  margin: 12px 0 10px;
  text-align: left;
  flex: 1;
  min-width: 0;
}

.entry-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

@media (max-width: 600px) {
  .entry-row { grid-template-columns: 1fr; gap: 4px; }
}

.entry-section__label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.entry-required {
  color: #ef4444;
  font-size: 0.74rem;
  font-weight: 600;
}

.entry-optional {
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

/* 자치구 grid 의 active 상태 */
.district-overlay__btn--active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  font-weight: 700;
}

/* Chip 그룹 (관심 정책 / 연령 / 직업) */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 7px 13px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s var(--ease);
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--primary-muted);
  color: var(--ink);
}

.chip--active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

/* 시작/skip 버튼 */
.entry-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 22px 0 4px;
}

.btn-primary.entry-start {
  width: 100%;
  padding: 13px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}

.btn-primary.entry-start:hover:not(:disabled) {
  background: var(--primary-hover, #1d4ed8);
}

.btn-primary.entry-start:disabled {
  background: var(--surface-active);
  color: var(--ink-muted);
  cursor: not-allowed;
}

.entry-skip {
  background: transparent;
  border: none;
  color: var(--ink-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 6px;
}

.entry-skip:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* 사이드바 자치구 라벨 옆 "바꾸기" 버튼 */
.sidebar__edit-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.sidebar__edit-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================================
   접히는 맞춤 설정 (details/summary)
   ============================================================ */
.sidebar__section--collapsible {
  display: block !important;  /* details 기본값 유지 */
  border-top: 1px solid var(--border-light);
  padding-top: 14px !important;
  margin-top: 4px !important;
}
/* 사이드바 최상단 위치 : 위쪽 구분선/여백 제거 */
.sidebar__section--top {
  border-top: none !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px !important;
}
.sidebar__section--collapsible > summary {
  cursor: pointer;
  list-style: none;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  user-select: none;
  padding: 2px 0;
  margin-bottom: 0 !important;
}
.sidebar__section--collapsible > summary::-webkit-details-marker { display: none; }
.sidebar__section--collapsible > summary::marker { content: ""; }
.sidebar__section--collapsible .chevron {
  width: 12px;
  height: 12px;
  color: var(--ink-muted);
  transition: transform 0.2s var(--ease);
  flex-shrink: 0;
  margin-left: auto;
}
.sidebar__section--collapsible[open] > summary .chevron {
  transform: rotate(180deg);
}
.sidebar__section--collapsible > summary:hover {
  color: var(--primary);
}
.sidebar__section--collapsible > summary:hover .chevron {
  color: var(--primary);
}
.sidebar__section--collapsible[open] {
  padding-bottom: 8px;
}
.sidebar__section--collapsible .profile-form {
  margin-top: 10px;
}

/* ============================================================
   스크롤바 : 윈도우에서도 Mac처럼 가리기
   (스크롤 자체는 동작, 트랙바 시각적으로만 제거)
   ============================================================ */
.sidebar,
.messages,
.district-overlay__grid,
.candidate-overlay {
  scrollbar-width: none !important;       /* Firefox */
  -ms-overflow-style: none !important;    /* Edge legacy / IE */
}
.sidebar::-webkit-scrollbar,
.messages::-webkit-scrollbar,
.district-overlay__grid::-webkit-scrollbar,
.candidate-overlay::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}
/* 기존 .messages::-webkit-scrollbar-thumb (5px) 무력화 */
.messages::-webkit-scrollbar-track,
.messages::-webkit-scrollbar-thumb {
  background: transparent !important;
}
