:root {
  --bg: #090d16;
  --bg-soft: #0f1524;
  --panel: rgba(18, 24, 39, 0.78);
  --panel-2: rgba(28, 36, 56, 0.9);
  --panel-3: rgba(36, 46, 72, 0.95);
  --panel-hover: rgba(45, 57, 88, 0.98);
  --border: rgba(167, 188, 255, 0.14);
  --border-strong: rgba(167, 188, 255, 0.28);
  --text: #eff4ff;
  --muted: #a2b0d0;
  --muted-2: #7f8eb0;
  --accent: #8fb4ff;
  --accent-2: #7ef0c5;
  --accent-3: #ff9ed8;
  --accent-4: #ffd36e;
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.25);
  --sidebar-width: 320px;
  --topbar-height: 74px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(98, 136, 255, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(126, 240, 197, 0.10), transparent 24%),
    radial-gradient(circle at bottom right, rgba(255, 158, 216, 0.10), transparent 24%),
    linear-gradient(180deg, #0b1020 0%, #090d16 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
}

a {
  color: #9fc3ff;
  text-decoration: none;
}

a:hover {
  color: #d1e2ff;
  text-decoration: underline;
}

a:visited {
  color: #9fc3ff;
}

button,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 360px;
  height: 360px;
  top: -80px;
  left: -100px;
  background: rgba(108, 141, 255, 0.18);
}

.orb-2 {
  width: 320px;
  height: 320px;
  right: -80px;
  top: 110px;
  background: rgba(126, 240, 197, 0.12);
}

.orb-3 {
  width: 280px;
  height: 280px;
  right: 22%;
  bottom: -80px;
  background: rgba(255, 158, 216, 0.10);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(255,255,255,0.7), transparent 82%);
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  min-width: 0;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 14, 24, 0.95), rgba(10, 14, 22, 0.92));
  backdrop-filter: blur(22px);
}

.sidebar-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 26px 20px 26px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #8fb4ff 0%, #7ef0c5 45%, #ff9ed8 100%);
  color: #071019;
  font-size: 22px;
  font-weight: 900;
  box-shadow:
    0 10px 24px rgba(143, 180, 255, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.28);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-panel {
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.sidebar-section + .sidebar-section {
  margin-top: 24px;
}

.sidebar-label {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

.sidebar-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.example-btn {
  width: 100%;
  text-align: left;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(31, 39, 61, 0.92), rgba(23, 29, 47, 0.96));
  color: var(--text);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.example-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background:
    linear-gradient(180deg, rgba(42, 53, 82, 0.98), rgba(29, 37, 58, 0.98));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.example-title {
  display: block;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}

.example-meta {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-footer-version {
  color: #d7e5ff;
  font-size: 12px;
  font-weight: 650;
}

.sidebar-footer-copy {
  color: var(--muted-2);
  font-size: 12px;
}

.sidebar-overlay {
  display: none;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 12, 19, 0.74);
  backdrop-filter: blur(18px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.topbar-emoji {
  font-size: 18px;
}

.topbar-subtitle {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 12px;
}

.topbar-badge {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(143, 180, 255, 0.12), rgba(255, 158, 216, 0.08));
  color: #dce8ff;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(25, 32, 48, 0.9);
  color: var(--text);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.menu-btn:hover {
  background: rgba(34, 44, 63, 0.96);
  border-color: var(--border-strong);
}

.chat-shell {
  width: 70%;
  margin: 0 auto;
  padding: 20px 28px 16px;
  height: calc(100vh - var(--topbar-height));
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hero {
  margin-bottom: 24px;
  padding: 24px 22px 20px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(21, 28, 45, 0.88), rgba(18, 23, 35, 0.82));
  box-shadow: var(--shadow-md);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(143, 180, 255, 0.12), rgba(255, 158, 216, 0.12));
  color: #dfeaff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title {
  margin: 14px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.hero-emoji {
  font-size: 0.92em;
}

.hero-text {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;

  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE/old Edge */
}

.messages::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;              /* Chrome/Safari */
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  margin-bottom: 18px;
}

.avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 760;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.avatar.user {
  background: linear-gradient(135deg, #2f6feb, #7d8dff);
  color: #fff;
}

.avatar.assistant {
  background: linear-gradient(135deg, #8fb4ff, #7ef0c5, #ff9ed8);
  color: #09111b;
}

.bubble {
  max-width: min(1100px, 100%);
  min-width: 0;
  padding: 18px 20px;
  border-radius: 24px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow-md);
}



.bubble.user {
  background: linear-gradient(135deg, rgba(43, 84, 175, 0.98), rgba(96, 84, 228, 0.96));
  color: #f7fbff;
}

.bubble.assistant {
  background: linear-gradient(180deg, rgba(25, 32, 49, 0.96), rgba(19, 25, 38, 0.98));
  border: 1px solid var(--border);
}

.answer-title {
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.answer-subtitle {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.loading {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--muted);
}

.loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--muted);
  animation: blink 1.2s infinite ease-in-out;
}

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

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

@keyframes blink {
  0%, 80%, 100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.summary-box {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(31, 40, 58, 0.94), rgba(25, 32, 47, 0.92));
  color: #dfe9fb;
}

.cards {
  display: grid;
  gap: 14px;
  margin: 18px 0 22px;
}

.entity-card {
  min-width: 0;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(31, 40, 58, 0.94), rgba(24, 31, 45, 0.96));
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}

.entity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.entity-head-main {
  min-width: 0;
}

.entity-name {
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.entity-type {
  margin-top: 5px;
  color: #97d4ff;
  font-size: 13px;
  font-weight: 600;
}

.entity-site a {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(143, 180, 255, 0.12), rgba(255, 158, 216, 0.10));
  border: 1px solid rgba(143, 180, 255, 0.18);
  color: #b8d2ff;
  text-decoration: none;
}

.entity-site a:hover {
  background:
    linear-gradient(135deg, rgba(143, 180, 255, 0.16), rgba(255, 158, 216, 0.14));
  text-decoration: none;
}

.entity-desc {
  margin-bottom: 14px;
  color: #e7eefc;
}

.entity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.meta-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: #d8e5f8;
  font-size: 12px;
}

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

.source-item {
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(143, 180, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  overflow-wrap: anywhere;
}

.source-item a {
  color: #9fc3ff;
  font-weight: 650;
}

.source-item a:hover {
  color: #cfe0ff;
}

.source-quote {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(20, 26, 38, 0.78);
  -webkit-overflow-scrolling: touch;
  width: 100%;
  /* 스크롤바 항상 표시 */
  overflow-y: visible;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 180, 255, 0.35) rgba(255,255,255,0.05);
}

.table-wrap::-webkit-scrollbar {
  height: 6px;
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
  border-radius: 0 0 20px 20px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(143, 180, 255, 0.35);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(143, 180, 255, 0.55);
}

table {
  border-collapse: collapse;
  background: transparent;
  table-layout: fixed;
  width: 100%;
  min-width: 1100px;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(147, 168, 203, 0.1);
  font-size: 14px;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(31, 39, 57, 0.98);
  color: #dfe8fb;
  font-weight: 700;
  white-space: nowrap;
}

td { color: #edf3ff; }

table th:nth-child(1), table td:nth-child(1) { width: 16%; }  /* Entity Name */
table th:nth-child(2), table td:nth-child(2) { width: 30%; }  /* Description */
table th:nth-child(3), table td:nth-child(3) { width: 12%; }  /* Website */
table th:nth-child(4), table td:nth-child(4) { width: 16%; }  /* Location */
table th:nth-child(5), table td:nth-child(5) { width: 16%; }  /* Cuisine Type */
table th:nth-child(6), table td:nth-child(6) { width: 16%; }   /* Price Range */
table th:nth-child(n+6), table td:nth-child(n+6) { width: 16%; }

tr:last-child td { border-bottom: none; }

.composer-wrap {
  flex-shrink: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(167, 188, 255, 0.08);
  backdrop-filter: blur(10px);
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px;
  border-radius: 26px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(21, 27, 40, 0.96), rgba(17, 22, 33, 0.98));
  box-shadow: var(--shadow-lg);
}

.composer-input-wrap {
  flex: 1;
  min-width: 0;
  padding: 2px 4px;
}

.composer textarea {
  width: 100%;
  max-height: 180px;
  min-width: 0;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

.composer textarea::placeholder {
  color: var(--muted-2);
}

.composer button {
  flex-shrink: 0;
  padding: 13px 18px;
  border: none;
  border-radius: 16px;
  background:
    linear-gradient(135deg, #8fb4ff 0%, #7ef0c5 45%, #ff9ed8 100%);
  color: #071120;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
  box-shadow: 0 12px 28px rgba(143, 180, 255, 0.24);
}

.composer button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.composer button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.composer-hint {
  margin-top: 10px;
  padding-left: 8px;
  color: var(--muted-2);
  font-size: 12px;
}

.empty-state {
  margin: auto 0;
  padding: 24px 0 30px;
}

.empty-title {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.05em;
  font-weight: 800;
  margin-bottom: 14px;
}

.empty-text {
  max-width: 700px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

@media (max-width: 1040px) {
  .chat-shell {
    width: 85%;
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar {
    padding: 0 18px;
  }
}

@media (max-width: 900px) {
  .page {
    display: block;
  }

  .menu-btn {
    display: inline-grid;
    place-items: center;
  }

  .topbar-badge {
    display: none;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 336px);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar-inner {
    position: relative;
    height: 100%;
  }

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

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
  }

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

  .topbar {
    height: 68px;
    padding: 0 14px;
  }

  .chat-shell {
    width: 100%;
    padding: 16px 12px 112px;
    min-height: calc(100vh - 68px);
  }

  .table-wrap {
    max-width: calc(100vw - 28px);
  }

  .hero {
    padding: 18px 16px 16px;
    border-radius: 22px;
  }

  .hero-text {
    font-size: 14px;
  }

  .message {
    gap: 10px;
  }

  .avatar {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    font-size: 12px;
  }

  .bubble {
    max-width: 100%;
    padding: 15px 15px;
    border-radius: 18px;
  }

  .entity-card {
    padding: 15px;
    border-radius: 18px;
  }

  .entity-head {
    flex-direction: column;
    align-items: stretch;
  }

  .composer {
    border-radius: 20px;
    padding: 10px;
  }

  th,
  td {
    padding: 12px;
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  .topbar-title {
    font-size: 15px;
  }

  .topbar-subtitle {
    display: none;
  }

  .hero-title {
    font-size: 30px;
  }

  .empty-title {
    font-size: 30px;
  }

  .empty-text {
    font-size: 15px;
  }

  .answer-title,
  .entity-name {
    font-size: 17px;
  }

  .entity-desc,
  .source-quote {
    font-size: 13px;
  }

  .summary-box,
  .entity-card,
  .table-wrap {
    border-radius: 16px;
  }

  .composer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .composer button {
    width: 100%;
  }

  .composer-hint {
    padding-left: 2px;
  }
}