:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --panel: #ffffff;
  --soft: #f2f1ec;
  --line: #d9d7cf;
  --text: #171717;
  --muted: #575757;
  --brand: #185fa5;
  --brand-soft: #e6f1fb;
  --mint: #e1f5ee;
  --mint-text: #085041;
  --danger: #b4232b;
  --warning: #8a4f06;
  --success: #427612;
  --shadow: 0 10px 24px rgba(20, 20, 20, 0.08);
  --body-font-size: 13px;
  --bubble-font-size: 13px;
  --chat-font-size: 13px;
  --chat-line-height: 1.48;
  --table-font-size: 11px;
  --summary-value-font-size: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  font-size: var(--body-font-size);
  line-height: 1.6;
  padding: 14px;
  -webkit-font-smoothing: antialiased;
  touch-action: pan-x pan-y;
}

body.protecting {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: none;
  position: relative;
  width: min(100%, 850px);
  margin: 0 auto;
}

body.authenticated .app-shell {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 28px);
  min-height: 0;
}

.app-shell::after {
  content: attr(data-watermark);
  position: fixed;
  inset: auto 20px 18px auto;
  color: rgba(24, 95, 165, 0.16);
  font-size: 13px;
  pointer-events: none;
  z-index: 5;
}

.chat-topbar {
  display: grid;
  grid-template-columns: 42px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  background: var(--panel);
  padding: 7px 10px;
}

.topbar-button,
.topbar-logout,
.drawer-close {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.topbar-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.topbar-button:hover,
.topbar-button:focus-visible,
.topbar-logout:hover,
.topbar-logout:focus-visible,
.drawer-close:hover,
.drawer-close:focus-visible {
  background: var(--brand-soft);
  color: var(--brand);
  outline: none;
}

.topbar-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.topbar-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--mint-text);
  font-size: 12px;
  font-weight: 900;
}

.topbar-copy {
  min-width: 0;
}

.topbar-copy h1,
.topbar-copy p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-copy h1 {
  font-size: 15px;
  line-height: 1.2;
}

.topbar-copy p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.topbar-logout {
  min-height: 32px;
  border-radius: 8px;
  padding: 0 8px;
  color: #555;
  font-size: 12px;
  font-weight: 800;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 14;
  background: rgba(0, 0, 0, 0.28);
}

.info-drawer {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.drawer-panel {
  pointer-events: auto;
  width: min(100%, 850px);
  max-height: min(78dvh, 680px);
  margin: 0 auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--panel);
  box-shadow: 0 14px 40px rgba(20, 20, 20, 0.18);
  padding: 10px;
  -webkit-overflow-scrolling: touch;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 2px 9px;
}

.drawer-header strong {
  font-size: 14px;
}

.drawer-close {
  min-height: 30px;
  border-radius: 8px;
  padding: 0 9px;
  color: #555;
  font-size: 12px;
  font-weight: 800;
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 28px);
}

.login-panel[hidden],
body.authenticated .login-panel {
  display: none;
}

.login-card {
  width: min(100%, 440px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 26px;
  box-shadow: var(--shadow);
}

.login-brand {
  margin: 0 0 12px;
}

.login-card h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.25;
}

.login-card p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 13px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: #333;
  font-size: 15px;
  font-weight: 800;
}

.login-form input {
  height: 50px;
  border: 1px solid #c9c8c1;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 17px;
}

.login-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.12);
  outline: none;
}

.login-button {
  height: 50px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.login-error {
  display: none;
  margin-top: 13px;
  border: 1px solid #f09595;
  border-radius: 8px;
  background: #fcebeb;
  color: var(--danger);
  padding: 9px 12px;
  font-size: 15px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--mint-text);
  font-size: 16px;
  font-weight: 800;
}

.profile-copy {
  min-width: 0;
}

.profile-copy h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.profile-copy p {
  margin: 4px 0 0;
  color: #353535;
  font-size: 15px;
  line-height: 1.35;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--brand);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.brand svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.consultant-link {
  display: inline-grid;
  gap: 1px;
  min-width: 118px;
  border: 1px solid #c9d8e6;
  border-radius: 8px;
  background: #f8fbfe;
  color: var(--brand);
  padding: 6px 9px;
  text-align: right;
  text-decoration: none;
  line-height: 1.2;
}

.consultant-link span {
  color: #333;
  font-size: 13px;
  font-weight: 800;
}

.consultant-link strong {
  font-size: 14px;
  white-space: nowrap;
}

.consultant-link:hover,
.consultant-link:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}

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

.summary-card {
  appearance: none;
  text-align: left;
  cursor: pointer;
  min-height: 76px;
  background: var(--soft);
  border: 1px solid #eceae2;
  border-radius: 9px;
  padding: 13px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.summary-card:hover,
.summary-card:focus-visible {
  border-color: #aabfd3;
  box-shadow: 0 6px 16px rgba(20, 20, 20, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.summary-card span {
  display: block;
  color: #404040;
  font-size: 15px;
  line-height: 1.25;
}

.summary-card strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: var(--summary-value-font-size);
  line-height: 1.2;
}

.summary-card[data-tone="danger"] strong {
  color: var(--danger);
}

.summary-card[data-tone="warning"] strong {
  color: var(--warning);
}

.guide-row {
  display: flex;
  gap: 7px;
  margin: 10px 0 4px;
}

.guide-row:empty {
  display: none;
}

.guide-button {
  min-height: 32px;
  border: 1px solid #cbd3dc;
  border-radius: 8px;
  background: #f8fbfe;
  color: var(--brand);
  cursor: pointer;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}

.guide-button:hover,
.guide-button:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.quick-button {
  min-height: 36px;
  border: 1px solid #bfc0bd;
  border-radius: 999px;
  background: var(--panel);
  color: #343434;
  cursor: pointer;
  padding: 7px 13px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.quick-button:hover,
.quick-button:focus-visible {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  outline: none;
}

.chat-panel {
  display: grid;
  flex: 1 1 auto;
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 16px;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.message.user {
  flex-direction: row-reverse;
}

.message-divider {
  align-self: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ece9df;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.message-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
}

.message.user .message-icon {
  background: var(--brand);
  color: white;
}

.message-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bubble {
  max-width: min(76%, 590px);
  padding: 8px 11px;
  border-radius: 16px;
  font-size: var(--chat-font-size, var(--bubble-font-size));
  line-height: var(--chat-line-height);
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.message.assistant .bubble {
  background: var(--soft);
  border-top-left-radius: 5px;
}

.message.user .bubble {
  background: var(--brand);
  color: white;
  border-top-right-radius: 5px;
}

.visual-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  white-space: normal;
}

.visual-card {
  overflow: hidden;
  border: 1px solid #dedcd3;
  border-radius: 8px;
  background: #fff;
}

.visual-card summary {
  cursor: pointer;
  margin: 0;
  padding: 8px 11px;
  color: #222;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.visual-card[open] summary {
  border-bottom: 1px solid #eceae2;
}

.table-scroll {
  max-width: 100%;
  max-height: 220px;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.visual-card table {
  width: 100%;
  border-collapse: collapse;
  min-width: 430px;
}

.visual-card th,
.visual-card td {
  border-bottom: 1px solid #eeece5;
  padding: 7px 9px;
  text-align: left;
  font-size: var(--table-font-size);
  line-height: 1.35;
  vertical-align: top;
}

.visual-card th {
  background: #fafaf7;
  color: #383838;
  font-weight: 800;
}

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

.policy-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.policy-detail-button {
  width: 100%;
  border: 1px solid #e6e2d8;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  text-align: left;
}

.policy-detail-button:hover,
.policy-detail-button:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}

.policy-detail-button strong {
  font-size: 13px;
  line-height: 1.35;
}

.policy-detail-button span,
.policy-detail-button em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
}

.pie-wrap {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 13px;
}

.pie-chart {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--brand) 0 100%);
}

.pie-chart::after {
  content: "";
  position: absolute;
  inset: 27px;
  border-radius: 50%;
  background: #fff;
}

.pie-chart span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.pie-chart small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pie-chart.empty {
  background: #ebe9e2;
}

.pie-legend {
  display: grid;
  gap: 8px;
}

.pie-legend-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  color: #303030;
  font-size: 14px;
  line-height: 1.3;
}

.pie-legend-item span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

.pie-legend-item[data-tone="danger"] span {
  background: var(--danger);
}

.pie-legend-item[data-tone="warning"] span {
  background: var(--warning);
}

.pie-legend-item[data-tone="success"] span {
  background: var(--success);
}

.pie-legend-item strong,
.pie-legend-item em {
  min-width: 0;
  font-style: normal;
}

.pie-legend-item em {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.bar-list {
  display: grid;
  gap: 11px;
  padding: 12px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  color: #303030;
  font-size: 13px;
  line-height: 1.35;
}

.bar-label strong {
  white-space: nowrap;
}

.bar-track {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe9e2;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--brand);
}

.bar-item[data-tone="warning"] .bar-fill {
  background: var(--warning);
}

.bar-item[data-tone="danger"] .bar-fill {
  background: var(--danger);
}

.bar-item[data-tone="success"] .bar-fill {
  background: var(--success);
}

.admin-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e3e0d7;
}

.admin-feedback-status {
  color: #565656;
  font-size: 12px;
  font-weight: 700;
}

.admin-feedback button {
  min-height: 28px;
  border: 1px solid #cbd3dc;
  border-radius: 999px;
  background: #fff;
  color: #1d3550;
  padding: 4px 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.admin-feedback button:hover,
.admin-feedback button:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}

.admin-history h2,
.admin-knowledge h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.admin-history ul,
.admin-knowledge ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-history li,
.admin-knowledge li {
  border: 1px solid #e2dfd7;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.admin-history strong,
.admin-history span,
.admin-history em,
.admin-knowledge span {
  display: inline-block;
  margin-right: 8px;
  color: #565656;
  font-size: 12px;
}

.admin-history p,
.admin-knowledge p {
  margin: 6px 0 0;
  line-height: 1.45;
}

.admin-knowledge > p {
  margin: 0 0 10px;
  color: var(--muted);
}

.admin-knowledge li strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.admin-inline-button {
  min-height: 28px;
  margin-top: 8px;
  border: 1px solid #cbd3dc;
  border-radius: 999px;
  background: #fff;
  color: #1d3550;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.admin-inline-button:hover,
.admin-inline-button:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 70px;
}

.typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8f8f8f;
  animation: blink 1.2s infinite;
}

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

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

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

.error-box {
  display: none;
  margin: 0 16px 10px;
  border: 1px solid #f09595;
  border-radius: 8px;
  background: #fcebeb;
  color: var(--danger);
  padding: 9px 12px;
  font-size: 15px;
}

.composer {
  display: grid;
  grid-template-columns: 1fr 50px;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px 14px;
}

.composer input {
  width: 100%;
  height: 50px;
  border: 1px solid #c9c8c1;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 0 16px;
}

.composer input::placeholder {
  color: #747474;
}

.composer input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(24, 95, 165, 0.12);
}

.send-button {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid #bfc0bd;
  border-radius: 10px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
}

.send-button:hover,
.send-button:focus-visible {
  background: var(--brand);
  color: #fff;
  outline: none;
}

.send-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.send-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.privacy-mask {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  align-content: center;
  gap: 10px;
  background: rgba(247, 247, 244, 0.96);
  color: var(--text);
  z-index: 20;
  text-align: center;
}

.privacy-mask strong {
  color: var(--brand);
  font-size: 24px;
}

.privacy-mask span {
  display: block;
  font-size: 17px;
}

body.protecting .privacy-mask {
  display: grid;
}

@media (max-width: 720px) {
  body {
    padding: 0;
    font-size: 13px;
  }

  body.authenticated {
    height: 100dvh;
    overflow: hidden;
  }

  body.authenticated .app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    min-height: 0;
  }

  .chat-topbar {
    grid-template-columns: 40px 32px minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 48px;
    border-top: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding: 6px 8px;
  }

  .topbar-button {
    width: 36px;
    height: 36px;
  }

  .topbar-button svg {
    width: 22px;
    height: 22px;
  }

  .topbar-avatar {
    width: 32px;
    height: 32px;
    font-size: 11px;
  }

  .topbar-copy h1 {
    font-size: 14px;
  }

  .topbar-copy p,
  .topbar-logout {
    font-size: 11px;
  }

  .drawer-panel {
    width: 100%;
    max-height: 82dvh;
    border-right: 0;
    border-left: 0;
    border-radius: 0 0 14px 14px;
    padding: 9px 8px 12px;
  }

  .login-panel {
    min-height: calc(100dvh - 16px);
  }

  .login-card {
    padding: 20px;
  }

  .profile-card {
    align-items: center;
    min-height: 58px;
    border-radius: 8px;
    padding: 8px 10px;
    gap: 8px;
  }

  .avatar {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }

  .profile-copy h1 {
    font-size: 17px;
  }

  .profile-copy p {
    max-width: 38vw;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand {
    font-size: 13px;
  }

  .brand svg {
    width: 22px;
    height: 22px;
  }

  .consultant-link {
    min-width: auto;
    padding: 4px 6px;
  }

  .consultant-link span {
    font-size: 11px;
  }

  .consultant-link strong {
    font-size: 12px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 7px;
    padding: 0 7px;
  }

  .summary-card {
    min-height: 52px;
    border-radius: 8px;
    padding: 7px 9px;
  }

  .summary-card span {
    font-size: 12px;
  }

  .summary-card strong {
    margin-top: 2px;
    font-size: 18px;
  }

  .quick-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin: 7px 0;
    padding: 0 7px 1px;
    scrollbar-width: none;
  }

  .guide-row {
    overflow-x: auto;
    padding: 0 7px;
    margin: 7px 0 1px;
    scrollbar-width: none;
  }

  .guide-row::-webkit-scrollbar {
    display: none;
  }

  .guide-button {
    flex: 0 0 auto;
    min-height: 31px;
    font-size: 12px;
    white-space: nowrap;
  }

  .quick-row::-webkit-scrollbar {
    display: none;
  }

  .quick-button {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 5px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .chat-panel {
    flex: 1 1 auto;
    grid-template-rows: minmax(0, 1fr) auto auto;
    min-height: 0;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .messages {
    min-height: 0;
    height: auto;
    max-height: none;
    padding: 10px 8px;
    gap: 8px;
  }

  .message {
    gap: 7px;
  }

  .message-icon {
    width: 28px;
    height: 28px;
  }

  .bubble {
    max-width: min(82%, 430px);
    padding: 7px 10px;
  }

  .message.user .bubble {
    max-width: min(80%, 430px);
  }

  .composer {
    grid-template-columns: 1fr 46px;
    gap: 7px;
    padding: 8px;
  }

  .composer input,
  .send-button {
    height: 44px;
  }

  .send-button {
    width: 44px;
  }

  .visual-card h2 {
    font-size: 14px;
  }

  .visual-card summary {
    font-size: 13px;
  }

  .pie-wrap {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 11px;
    padding: 11px;
  }

  .pie-chart {
    width: 112px;
  }

  .pie-chart::after {
    inset: 24px;
  }

  .pie-chart span {
    font-size: 22px;
  }

  .pie-legend {
    gap: 7px;
  }

  .pie-legend-item {
    grid-template-columns: 9px minmax(0, 1fr) auto;
    gap: 6px;
    font-size: 13px;
  }

  .table-scroll {
    max-height: 260px;
    overflow-x: visible;
  }

  .visual-card table {
    display: block;
    min-width: 0;
  }

  .visual-card thead {
    display: none;
  }

  .visual-card tbody {
    display: grid;
  }

  .visual-card tr {
    display: block;
    border-bottom: 1px solid #eeece5;
    padding: 9px 12px;
  }

  .visual-card tr:last-child {
    border-bottom: none;
  }

  .visual-card td {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 8px;
    border-bottom: none;
    padding: 4px 0;
    font-size: 13px;
    line-height: 1.45;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  .visual-card td::before {
    content: attr(data-label);
    color: #535353;
    font-weight: 800;
  }
}

@media (max-width: 430px) {
  .profile-copy h1 {
    font-size: 17px;
  }

  .profile-copy p {
    font-size: 12px;
  }

  .chat-panel {
    min-height: 0;
  }

  .messages {
    min-height: 0;
    height: auto;
    padding: 9px 7px;
  }

  .bubble {
    max-width: calc(100% - 18px);
    padding: 7px 10px;
  }

  .pie-wrap {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 9px;
  }

  .pie-chart {
    width: 96px;
  }

  .pie-chart::after {
    inset: 21px;
  }

  .pie-chart span {
    font-size: 20px;
  }

  .visual-card td {
    grid-template-columns: 66px minmax(0, 1fr);
  }
}
