:root {
  --font-family-normal: "Pretendard", "Apple SD Gothic Neo", sans-serif;

  --font-size-h1: 24px;
  --font-size-h2: 18px;
  --font-size-b1: 15px;
  --font-size-b2: 14px;
  --font-size-b3: 13px;
  --font-size-b4: 12px;
  --font-size-b5: 11px;

  --line-height-h1: 32px;
  --line-height-h2: 24px;
  --line-height-b1: 22px;
  --line-height-b2: 20px;
  --line-height-b3: 19px;
  --line-height-b4: 18px;
  --line-height-b5: 16px;

  --font-weight-400: 400;
  --font-weight-500: 500;
  --font-weight-700: 700;

  --letter-spacing-normal: -0.3px;

  --brand-ocean: #0085ca;
  --brand-navy: #002869;
  --brand-royal: #1d74b3;
  --brand-deep: #28508f;
  --brand-gold: #ffc63f;

  --background-normal: #ffffff;
  --background-page: #f5f8fc;
  --background-strong: #002869;
  --background-subtle: #d7e6f2;
  --background-subtler: #eef5fa;
  --background-subtlest: #f5f8fc;
  --background-primary: #0085ca;
  --background-primary-subtle: #1d74b3;
  --background-primary-subtler: #e8f4fb;
  --background-modal: #ffffff;
  --background-dialog-container: rgba(0, 0, 0, 0.32);
  --background-card: #ffffff;
  --background-input: #ffffff;
  --background-input-disabled: #eef5fa;

  --foreground-normal: #1b2a3a;
  --foreground-subtle: #3d4f63;
  --foreground-subtler: #6b7d8f;
  --foreground-subtlest: #98a6b3;
  --foreground-muted: #c1c3cd;
  --foreground-primary: #0085ca;
  --foreground-inverse-static: #ffffff;
  --foreground-danger: #cd4434;

  --border-normal: #d5e0ea;
  --border-subtle: #e6eef4;
  --border-primary: #0085ca;
  --border-primary-subtle: #b5d4e8;

  --action-primary-fill: #0085ca;
  --action-primary-fill-hovered: #1d74b3;
  --action-secondary-fill: #ffffff;
  --action-secondary-fill-hovered: #e8f4fb;
  --action-secondary-border: #d5e0ea;
  --action-secondary-border-hovered: #0085ca;
  --action-tertiary-fill: #ffffff;
  --action-tertiary-fill-hovered: #eef5fa;
  --action-tertiary-border: #d5e0ea;
  --action-tertiary-border-hovered: #98a6b3;
  --action-danger-fill: #ffffff;
  --action-danger-fill-hovered: #f8edea;
  --action-danger-border: #d5e0ea;
  --action-danger-border-hovered: #cd4434;
  --action-ghost-primary-fill: transparent;
  --action-ghost-primary-fill-hovered: #e8f4fb;
  --action-ghost-secondary-fill: transparent;
  --action-ghost-secondary-fill-hovered: #eef5fa;

  --accent-red: #cd4434;
  --accent-red-subtle: #f8edea;
  --accent-gold: #ffc63f;
  --accent-teal: #2ec2b0;
  --accent-teal-subtle: #ecf8f7;

  --tag-outline-fill: #ffffff;
  --tag-outline-border: #d5e0ea;
  --tag-normal: #eef5fa;
  --tag-on-normal: #3d4f63;
  --tag-purple: #e8f4fb;
  --tag-on-purple: #0085ca;
  --tag-red: #f8edea;
  --tag-on-red: #cd4434;

  --hero-bg: #0085ca;
  --hero-title: #ffffff;
  --hero-text: rgba(255, 255, 255, 0.86);
  --hero-orb: #e8f4fb;
  --hero-wave: #0085ca;
  --hero-block: #0085ca;
  --hero-block-soft: #1d74b3;
}

[data-theme="light"] {
  color-scheme: light;
}

[data-theme="dark"] {
  --background-normal: #071a3d;
  --background-page: #06142f;
  --background-strong: #040e22;
  --background-subtle: #1a3d73;
  --background-subtler: #10284f;
  --background-subtlest: #06142f;
  --background-primary: #2aa3e0;
  --background-primary-subtle: #1d74b3;
  --background-primary-subtler: #12345f;
  --background-modal: #10284f;
  --background-dialog-container: rgba(0, 0, 0, 0.48);
  --background-card: #12345f;
  --background-input: #0c2144;
  --background-input-disabled: #10284f;

  --foreground-normal: #f4f8fc;
  --foreground-subtle: #d7e4f2;
  --foreground-subtler: #b4c6dc;
  --foreground-subtlest: #8aa0bb;
  --foreground-muted: #c1c3cd;
  --foreground-primary: #7ec8ea;
  --foreground-inverse-static: #ffffff;
  --foreground-danger: #cd4434;

  --border-normal: rgba(255, 255, 255, 0.22);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-primary: #2aa3e0;
  --border-primary-subtle: #2b5a94;

  --action-primary-fill: #0085ca;
  --action-primary-fill-hovered: #1d74b3;
  --action-secondary-fill: transparent;
  --action-secondary-fill-hovered: rgba(255, 255, 255, 0.08);
  --action-secondary-border: rgba(255, 255, 255, 0.28);
  --action-secondary-border-hovered: #7ec8ea;
  --action-tertiary-fill: transparent;
  --action-tertiary-fill-hovered: #003474;
  --action-tertiary-border: rgba(255, 255, 255, 0.28);
  --action-tertiary-border-hovered: #a6b7dd;
  --action-danger-fill: transparent;
  --action-danger-fill-hovered: #4a221e;
  --action-danger-border: rgba(255, 255, 255, 0.28);
  --action-danger-border-hovered: #cd4434;
  --action-ghost-primary-fill: transparent;
  --action-ghost-primary-fill-hovered: #0a3a7a;
  --action-ghost-secondary-fill: transparent;
  --action-ghost-secondary-fill-hovered: #003474;

  --accent-red: #cd4434;
  --accent-red-subtle: #4a221e;
  --accent-gold: #ffc63f;
  --accent-teal: #66dbcd;
  --accent-teal-subtle: #1b3c38;

  --tag-outline-fill: #003474;
  --tag-outline-border: rgba(255, 255, 255, 0.28);
  --tag-normal: #0a3a7a;
  --tag-on-normal: #d4deea;
  --tag-purple: #0a3a7a;
  --tag-on-purple: #7ec8ea;
  --tag-red: #4a221e;
  --tag-on-red: #cd4434;

  --hero-bg: #0a2348;
  --hero-title: #ffffff;
  --hero-text: #c9d8ea;
  --hero-orb: rgba(255, 255, 255, 0.12);
  --hero-wave: #a6b7dd;
  --hero-block: #0085ca;
  --hero-block-soft: #1d74b3;

  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--background-page);
  color: var(--foreground-normal);
  font-family: var(--font-family-normal);
  font-weight: var(--font-weight-400);
  letter-spacing: var(--letter-spacing-normal);
}

img {
  display: block;
}

button,
input {
  font: inherit;
  letter-spacing: inherit;
}

.typo-h1 {
  margin: 0;
  font-size: var(--font-size-h1);
  line-height: var(--line-height-h1);
  font-weight: var(--font-weight-700);
}

.typo-h2 {
  margin: 0;
  font-size: var(--font-size-h2);
  line-height: var(--line-height-h2);
  font-weight: var(--font-weight-700);
}

.typo-b1 {
  margin: 0;
  font-size: var(--font-size-b1);
  line-height: var(--line-height-b1);
  font-weight: var(--font-weight-400);
}

.typo-b2 {
  margin: 0;
  font-size: var(--font-size-b2);
  line-height: var(--line-height-b2);
  font-weight: var(--font-weight-400);
}

.typo-b3 {
  margin: 0;
  font-size: var(--font-size-b3);
  line-height: var(--line-height-b3);
  font-weight: var(--font-weight-400);
}

.typo-b4 {
  margin: 0;
  font-size: var(--font-size-b4);
  line-height: var(--line-height-b4);
  font-weight: var(--font-weight-500);
}

.typo-b5 {
  margin: 0;
  font-size: var(--font-size-b5);
  line-height: var(--line-height-b5);
  font-weight: var(--font-weight-400);
}

.header {
  height: 56px;
  background: var(--background-normal);
  border-bottom: 1px solid var(--border-normal);
}

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

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 2px;
  background: var(--background-subtler);
  border: 1px solid var(--border-normal);
  border-radius: 8px;
}

.theme-switch__btn {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--action-ghost-secondary-fill);
  color: var(--foreground-subtler);
  cursor: pointer;
}

.theme-switch__btn:hover {
  background: var(--action-ghost-secondary-fill-hovered);
}

.theme-switch__btn.is-active {
  background: var(--action-primary-fill);
  color: var(--foreground-inverse-static);
}

.theme-switch__btn.is-active:hover {
  background: var(--action-primary-fill-hovered);
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo__img {
  display: block;
  height: 28px;
  width: auto;
  max-width: min(200px, 46vw);
  object-fit: contain;
}

.logo__img--dark {
  display: none;
}

[data-theme="dark"] .logo__img--light {
  display: none;
}

[data-theme="dark"] .logo__img--dark {
  display: block;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  background: var(--hero-bg);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 460px);
  align-items: center;
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 24px 40px;
}

.hero__deco {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero__ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
}

.hero__ring--lg {
  width: 220px;
  height: 220px;
  right: 18%;
  top: -48px;
}

.hero__ring--md {
  width: 92px;
  height: 92px;
  right: 36%;
  bottom: 18%;
  border-color: rgba(255, 198, 63, 0.45);
}

.hero__dot {
  position: absolute;
  border-radius: 50%;
}

.hero__dot--gold {
  width: 10px;
  height: 10px;
  right: 28%;
  top: 28%;
  background: var(--accent-gold);
}

.hero__dot--red {
  width: 8px;
  height: 8px;
  right: 14%;
  bottom: 34%;
  background: #cd4434;
}

[data-theme="dark"] .header {
  background: #071a3d;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .theme-switch {
  background: #0c2144;
  border-color: rgba(255, 255, 255, 0.22);
}

[data-theme="dark"] .hero__mascot {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45))
    drop-shadow(0 0 18px rgba(126, 200, 234, 0.28));
}

[data-theme="dark"] .hero__boat {
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35)) brightness(1.08);
}

[data-theme="dark"] .search {
  background: #0c2144;
  border-color: rgba(255, 255, 255, 0.28);
}

[data-theme="dark"] .card {
  background: #153868;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .card:hover {
  background: #1c4a84;
  border-color: #2aa3e0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
}

.hero__copy,
.hero__visual {
  position: relative;
  z-index: 1;
}

.hero__eyebrow {
  color: var(--hero-text);
}

.hero__heading {
  margin-top: 10px;
}

.hero__title {
  margin: 0;
  color: var(--hero-title);
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.2;
  font-weight: var(--font-weight-700);
}

.hero__rule {
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 14px;
  background: var(--accent-gold);
  border-radius: 2px;
}

.hero__desc {
  margin-top: 14px;
  margin-bottom: 0;
  color: var(--hero-text);
}

.hero__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.hero__pills li {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: var(--font-size-b4);
  line-height: 28px;
  font-weight: var(--font-weight-500);
}

.hero__visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-width: 0;
  min-height: 260px;
}

.hero__orb {
  position: absolute;
  right: 8%;
  bottom: 8%;
  z-index: 0;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 36%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 72%);
}

.hero__mascot {
  position: relative;
  z-index: 2;
  height: clamp(150px, 22vw, 228px);
  width: auto;
  margin-right: clamp(-65px, -6vw, -80px);
  filter: drop-shadow(0 10px 16px rgba(0, 40, 80, 0.22));
}

.hero__boat {
  position: relative;
  z-index: 1;
  width: clamp(140px, 18vw, 220px);
  height: auto;
  margin-bottom: 8px;
  filter: drop-shadow(0 8px 12px rgba(0, 40, 80, 0.18));
}

.page {
  padding: 24px 24px 32px;
}

.page__inner {
  max-width: 1400px;
  margin: 0 auto;
}

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

.section-head .search {
  flex-shrink: 1;
}

.section-head__eyebrow {
  color: var(--foreground-subtler);
  text-transform: none;
}

.section-head .typo-h1 {
  margin-top: 4px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(280px, 100%);
  max-width: 100%;
  height: 36px;
  padding: 0 12px;
  background: var(--background-input);
  border: 1px solid var(--border-normal);
  border-radius: 8px;
}

.search__icon {
  flex-shrink: 0;
}

.search__input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--foreground-normal);
  outline: none;
}

.search__input::placeholder {
  color: var(--foreground-subtlest);
}

.search:focus-within {
  border-color: var(--border-primary);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 180px;
  max-height: 180px;
  min-height: 0;
  padding: 25px 25px;
  overflow: hidden;
  background: var(--background-card);
  border: 1px solid var(--border-normal);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.card:hover {
  transform: scale(1.03);
  background: var(--background-primary-subtler);
  border-color: var(--border-primary);
  box-shadow: 0 8px 20px rgba(0, 133, 202, 0.12);
}

.card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 0;
  margin-top: 0;
  overflow: hidden;
}

.card__body .typo-h2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: keep-all;
  line-height: 1.45;
}

.card__desc {
  color: var(--foreground-subtler);
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  flex-shrink: 0;
  gap: 0;
  margin-top: auto;
  padding-top: 14px;
}

.card__leader {
  display: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
}

.tag--purple {
  background: var(--tag-purple);
  color: var(--tag-on-purple);
}

.tag--normal {
  background: var(--tag-normal);
  color: var(--tag-on-normal);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  cursor: pointer;
}

.btn--primary {
  background: var(--action-primary-fill);
  border: 1px solid var(--action-primary-fill);
  color: var(--foreground-inverse-static);
  font-weight: var(--font-weight-500);
}

.btn--primary:hover {
  background: var(--action-primary-fill-hovered);
  border-color: var(--action-primary-fill-hovered);
}

.btn--secondary {
  background: var(--action-secondary-fill);
  border: 1px solid var(--action-secondary-border);
  color: var(--foreground-normal);
  font-weight: var(--font-weight-500);
}

.btn--secondary:hover {
  background: var(--action-secondary-fill-hovered);
  border-color: var(--action-secondary-border-hovered);
  color: var(--foreground-primary);
}

.empty {
  display: none;
  margin-top: 48px;
  text-align: center;
  color: var(--foreground-subtlest);
}

.empty.is-visible {
  display: block;
}

@media (max-width: 1279px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 300px);
  }
}

@media (max-width: 959px) {
  .header__inner,
  .hero__inner,
  .page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    min-height: 0;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    padding-top: 28px;
    padding-bottom: 20px;
    gap: 12px;
  }

  .hero__deco,
  .hero__orb {
    display: none;
  }

  .hero__title {
    font-size: 28px;
  }

  .hero__visual {
    justify-content: center;
    min-height: 160px;
  }

  .hero__mascot {
    height: 160px;
    margin-right: -40px;
  }

  .hero__boat {
    width: 150px;
  }

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

  .search {
    width: 100%;
  }
}

@media (max-width: 639px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  .hero__mascot {
    height: 140px;
    margin-right: -28px;
  }

  .hero__boat {
    width: 120px;
  }

  .card {
    padding: 20px;
  }

  .card:hover {
    transform: scale(1.015);
  }
}

@media (max-width: 419px) {
  .theme-switch__btn {
    padding: 0 8px;
  }

  .hero__boat {
    display: none;
  }

  .hero__mascot {
    margin-right: 0;
  }
}

/* ── Chat / Chart page ── */

.body--chat {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.body--chat .header {
  flex-shrink: 0;
}

.chat-page {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 24px 24px;
}

.chat-page__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.chat-page__head {
  flex-shrink: 0;
  margin-bottom: 9px;
}

.theme-switch--solo {
  margin-bottom: 9px;
}

.chat-page__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: var(--font-weight-500);
}

.chat-page__back:hover {
  text-decoration: none;
}

.chat-page__title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 4px;
}

.chat-page__title {
  margin: 0;
  word-break: keep-all;
}

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--background-card);
  border: 1px solid var(--border-normal);
  border-radius: 12px;
  overflow: hidden;
}

.chat-panel__messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 133, 202, 0.45) transparent;
}

.chat-panel__messages::-webkit-scrollbar {
  width: 6px;
}

.chat-panel__messages::-webkit-scrollbar-track {
  margin: 10px 0;
  background: transparent;
}

.chat-panel__messages::-webkit-scrollbar-thumb {
  background: rgba(0, 133, 202, 0.28);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.chat-panel__messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 133, 202, 0.55);
  background-clip: padding-box;
}

[data-theme="dark"] .chat-panel__messages {
  scrollbar-color: rgba(42, 163, 224, 0.55) transparent;
}

[data-theme="dark"] .chat-panel__messages::-webkit-scrollbar-thumb {
  background: rgba(42, 163, 224, 0.35);
  background-clip: padding-box;
}

[data-theme="dark"] .chat-panel__messages::-webkit-scrollbar-thumb:hover {
  background: rgba(42, 163, 224, 0.65);
  background-clip: padding-box;
}

.chat-msg {
  display: flex;
}

.chat-msg--user {
  justify-content: flex-end;
}

.chat-msg--bot {
  justify-content: flex-start;
}

.chat-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 200px;
  text-align: center;
  color: var(--foreground-subtler);
}

.chat-empty[hidden] {
  display: none;
}

.chat-empty__icon {
  width: 64px;
  height: 64px;
}

.chat-msg__bubble {
  max-width: min(560px, 88%);
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.5;
  word-break: keep-all;
}

.chat-msg--chart {
  width: 100%;
}

.chat-msg__chart-card {
  width: min(100%, 640px);
  padding: 16px;
  background: var(--background-normal);
  border: 1px solid var(--border-normal);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}

[data-theme="dark"] .chat-msg__chart-card {
  background: #0c2144;
  border-color: rgba(255, 255, 255, 0.16);
}

.chat-msg__chart-text {
  margin: 0 0 8px;
  color: var(--foreground-subtler);
}

.chat-msg__chart-title {
  margin: 0 0 12px;
  word-break: keep-all;
}

.chat-msg__chart-wrap {
  position: relative;
  height: 260px;
  margin-bottom: 12px;
}

.chat-msg__chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.chat-msg__chart-actions {
  display: flex;
  justify-content: flex-end;
}

.chat-msg--user .chat-msg__bubble {
  background: var(--action-primary-fill);
  color: var(--foreground-inverse-static);
  border-bottom-right-radius: 4px;
}

.chat-msg--bot .chat-msg__bubble {
  background: var(--background-subtler);
  color: var(--foreground-normal);
  border-bottom-left-radius: 4px;
}

[data-theme="dark"] .chat-msg--bot .chat-msg__bubble {
  background: #0c2144;
  color: var(--foreground-subtle);
}

.chat-panel__suggestions-wrap {
  flex-shrink: 0;
  padding: 0 20px 14px;
  border-top: 1px solid var(--border-subtle);
  background: var(--background-subtler);
}

.chat-panel__suggestions-label {
  margin: 12px 0 8px;
  color: var(--foreground-subtler);
  font-weight: var(--font-weight-500);
}

.chat-panel__suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chat-suggestion {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-normal);
  border-radius: 8px;
  background: var(--background-card);
  color: var(--foreground-normal);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.chat-suggestion:hover {
  border-color: var(--border-primary);
  background: var(--background-primary-subtler);
  box-shadow: 0 4px 12px rgba(0, 133, 202, 0.1);
  transform: translateY(-1px);
}

.chat-suggestion__index {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--action-primary-fill);
  color: var(--foreground-inverse-static);
  font-size: var(--font-size-b5);
  font-weight: var(--font-weight-700);
  line-height: 1;
}

.chat-suggestion__text {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
  word-break: keep-all;
}

[data-theme="dark"] .chat-panel__suggestions-wrap {
  background: #071a3d;
}

[data-theme="dark"] .chat-suggestion {
  background: #0c2144;
  border-color: rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .chat-suggestion:hover {
  background: #12345f;
  border-color: #2aa3e0;
}

.chat-panel__form {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--background-normal);
}

.chat-panel__input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-normal);
  border-radius: 8px;
  background: var(--background-input);
  color: var(--foreground-normal);
}

.chat-panel__input:focus {
  outline: none;
  border-color: var(--border-primary);
}

.body--chat.is-detail-open {
  overflow: hidden;
}

.detail-panel__tab {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 36px;
  padding: 14px 8px;
  border: 0;
  border-radius: 10px 0 0 10px;
  background: var(--action-primary-fill);
  color: var(--foreground-inverse-static);
  cursor: pointer;
  transform: translateY(-50%);
  box-shadow: -4px 0 16px rgba(0, 133, 202, 0.28);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.detail-panel__tab[hidden] {
  display: none;
}

.detail-panel__tab:hover {
  background: var(--action-primary-fill-hovered);
  transform: translateY(-50%) translateX(-2px);
  box-shadow: -6px 0 20px rgba(0, 133, 202, 0.34);
}

.detail-panel__tab-chevron {
  display: block;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-right: 2px;
}

.detail-panel__tab-text {
  font-weight: var(--font-weight-500);
  line-height: 1.35;
  text-align: center;
}

.detail-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.detail-panel[hidden] {
  display: none;
}

.detail-panel__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.32);
  cursor: pointer;
}

.detail-panel__sheet {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: 100%;
  background: var(--background-card);
  border-left: 1px solid var(--border-normal);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  animation: detail-slide-in 0.24s ease;
}

@keyframes detail-slide-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.detail-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-panel__title {
  margin: 0;
  word-break: keep-all;
}

.detail-panel__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-normal);
  border-radius: 8px;
  background: var(--background-normal);
  color: var(--foreground-subtler);
  cursor: pointer;
}

.detail-panel__close:hover {
  border-color: var(--border-primary);
  color: var(--foreground-primary);
}

.detail-panel__summary {
  padding: 12px 20px;
  color: var(--foreground-subtler);
  background: var(--background-subtler);
  border-bottom: 1px solid var(--border-subtle);
}

.detail-panel__body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 133, 202, 0.45) transparent;
}

.detail-panel__body::-webkit-scrollbar {
  width: 6px;
}

.detail-panel__body::-webkit-scrollbar-track {
  background: transparent;
}

.detail-panel__body::-webkit-scrollbar-thumb {
  background: rgba(0, 133, 202, 0.28);
  border-radius: 999px;
}

.detail-panel__body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 133, 202, 0.55);
}

[data-theme="dark"] .detail-panel__body {
  scrollbar-color: rgba(42, 163, 224, 0.55) transparent;
}

[data-theme="dark"] .detail-panel__body::-webkit-scrollbar-thumb {
  background: rgba(42, 163, 224, 0.35);
}

[data-theme="dark"] .detail-panel__body::-webkit-scrollbar-thumb:hover {
  background: rgba(42, 163, 224, 0.65);
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table th,
.detail-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.detail-table th {
  background: var(--background-subtler);
  color: var(--foreground-subtle);
  font-weight: var(--font-weight-500);
}

.detail-table tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 959px) {
  .chat-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .chat-panel__suggestions {
    grid-template-columns: 1fr;
  }

  .chat-msg__chart-wrap {
    height: 220px;
  }

  .detail-panel__sheet {
    width: 100%;
  }
}
