:root {
  --h-chat-line: var(--hf-color-line);
  --h-chat-text: var(--hf-color-text-strong);
  --h-chat-muted: var(--hf-color-muted);
  --h-chat-blue: var(--hf-color-primary);
  --h-chat-blue-dark: var(--hf-color-primary-hover);
  --h-chat-blue-soft: var(--hf-color-primary-soft);
  --h-chat-surface: var(--hf-color-surface);
  --h-chat-page: var(--hf-color-surface-soft);
}

html {
  min-height: 100%;
}

body.h-chat-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--h-chat-text);
  background: var(--hf-chat-stage-bg);
  --hf-chat-line: var(--h-chat-line);
  --hf-chat-surface: var(--h-chat-surface);
  --hf-chat-notice-color: var(--hf-color-muted);
  --hf-chat-notice-bg: var(--h-chat-blue-soft);
  --hf-chat-notice-line: var(--hf-color-primary-border);
  --hf-chat-input-bg: var(--hf-color-surface-soft);
  --hf-chat-input-line: var(--hf-color-line);
  --hf-chat-focus: var(--hf-focus-color);
  --hf-chat-focus-shadow: var(--hf-focus-ring);
  --hf-chat-action: var(--hf-button-primary-bg);
  --hf-chat-action-hover: var(--hf-button-primary-hover-bg);
  --hf-chat-window-radius: 20px;
  --hf-chat-window-shadow: 0 12px 32px rgba(55, 72, 80, 0.08);
  --hf-chat-notice-margin: 16px 16px 0;
  --hf-chat-notice-padding: 11px 14px;
  --hf-chat-notice-font-size: 12px;
  --hf-chat-scroll-padding: 20px 18px 24px;
  --hf-chat-composer-padding: 12px 14px max(12px, env(safe-area-inset-bottom));
  --hf-chat-action-width: 76px;
  --hf-chat-action-font-size: 13px;
}

.h-chat-app-shell {
  min-width: 0;
}

.h-chat-main {
  width: 100%;
  min-width: 0;
}

.h-chat-page-shell {
  box-sizing: border-box;
}

.h-chat-back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  color: #607078;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.h-chat-back-link:hover,
.h-chat-back-link:focus {
  color: var(--h-chat-blue-dark);
  text-decoration: none;
}

.h-chat-title-group {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-align: left;
}

.h-chat-title-group strong {
  display: block;
}

.h-chat-title-group strong {
  color: #263238;
  font-size: 16px;
}

.h-chat-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: var(--hf-color-success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(71, 184, 123, 0.12);
}


.h-chat-security {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 12px 16px 0;
  padding: 12px 14px;
  background: #fffaf2;
  border: 1px solid #f2dfc1;
  border-radius: 12px;
}

.h-chat-security strong,
.h-chat-security span {
  display: block;
}

.h-chat-security strong {
  color: #5c4b35;
  font-size: 12px;
}

.h-chat-security span {
  margin-top: 3px;
  color: #8b765b;
  font-size: 11px;
  line-height: 1.45;
}

.h-chat-recaptcha {
  flex: 0 0 auto;
  min-height: 78px;
}

.h-chat-message-row {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  margin-top: 12px;
}

.h-chat-message-row:first-child {
  margin-top: 0;
}

.h-chat-message-row.is-mine {
  justify-content: flex-end;
}

.h-chat-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: block;
  object-fit: cover;
  background: #45b9df;
  border: 1px solid rgba(38, 135, 166, 0.16);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(40, 145, 178, 0.18);
}

.h-chat-bubble {
  max-width: min(76%, 620px);
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.h-chat-bubble p {
  margin: 0;
}

.h-chat-bubble-h {
  color: var(--hf-chat-bubble-peer-text);
  background: var(--hf-chat-bubble-peer-bg);
  border-bottom-left-radius: 5px;
}

.h-chat-bubble-mine {
  color: var(--hf-chat-bubble-mine-text);
  background: var(--hf-chat-bubble-mine-bg);
  border-bottom-right-radius: 5px;
}

.h-chat-bubble-content img {
  max-width: 100%;
  height: auto;
  margin-top: 8px;
  border-radius: 10px;
}

.h-chat-bubble-content iframe {
  width: min(100%, 560px) !important;
  aspect-ratio: 16 / 9;
  height: auto !important;
  margin-top: 8px;
  border: 0;
}

.h-chat-bubble-content a {
  color: #167d9f;
  word-break: break-all;
}

.h-chat-thinking {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 58px;
}

.h-chat-thinking img {
  width: 26px;
  height: auto;
}

.h-chat-side-panel {
  min-width: 0;
  padding: var(--hf-chat-side-padding);
  overflow-y: auto;
}

.h-chat-info-card {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.h-chat-eyebrow {
  display: block;
  color: #2e99bd;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.h-chat-info-heading strong {
  display: block;
  margin: 8px 0 7px;
  color: #334149;
  font-size: 15px;
  line-height: 1.45;
}

.h-chat-info-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.h-chat-info-heading i {
  color: #e0a53a;
  font-size: 18px;
}

.h-chat-learning-list {
  margin-top: 8px;
}

.h-chat-learning-item {
  padding: 10px 0;
  color: #68757c;
  border-top: 1px solid #eff2f3;
  font-size: 11px;
  line-height: 1.55;
}

.h-chat-learning-item:first-child {
  border-top: 0;
}

.h-chat-learning-item strong {
  color: #38474f;
  font-weight: 800;
}

.h-chat-learning-empty {
  margin: 7px 0 0;
  color: #97a1a6;
  font-size: 11px;
}



@media (max-width: 768px) {
  .h-chat-page > #foot_wrap {
    display: none;
  }

  body.h-chat-page .h-chat-main.hf-chat-stage[data-hf-chat-stage] {
    width: 100%;
    height: auto;
    min-height: 0;
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
  }

  body.h-chat-page .h-chat-page-shell.hf-chat-shell {
    width: 100%;
    height: auto;
    min-height: 0;
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
  }

  .h-chat-topline {
    min-height: 54px;
    flex: 0 0 auto;
    margin: 0;
    padding: 0 12px;
    background: rgba(251, 253, 254, 0.98);
    border-bottom: 1px solid #e7ecee;
  }

  .h-chat-back-link {
    font-size: 12px;
  }

  .h-chat-title-group strong {
    font-size: 14px;
  }

  body.h-chat-page .h-chat-layout.hf-chat-layout {
    width: 100%;
    height: auto;
    min-height: 0;
    flex: 1 1 0%;
    display: flex;
    overflow: hidden;
  }

  body.h-chat-page
    .h-chat-layout.hf-chat-layout
    > .h-chat-window.hf-chat-window[data-hf-chat-window] {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    flex: 1 1 0%;
  }

  .h-chat-security {
    display: block;
    margin: 8px 10px 0;
    padding: 10px;
  }

  .h-chat-recaptcha {
    min-height: 0;
    margin-top: 9px;
    overflow-x: auto;
  }

  .h-chat-bubble {
    max-width: 82%;
    font-size: 13px;
  }

  .h-chat-side-panel {
    display: none;
  }

}
