:root {
  --blue: #0878e8;
  --blue-dark: #07376f;
  --ink: #062b58;
  --muted: #68809e;
  --line: #d3e2f1;
  --soft: #f3f8fd;
  --green: #0bb884;
  --shadow: 0 18px 55px rgba(19, 67, 116, 0.12);
}
* {
  box-sizing: border-box;
}
html,
body {
  min-height: 100%;
  margin: 0;
  font-family: Manrope, system-ui, sans-serif;
  color: var(--ink);
  background: #f2f7fc;
}
button,
input,
textarea {
  font: inherit;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 99;
  background: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--blue);
}
.skip-link:focus {
  top: 16px;
}
.consult-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.consult-header {
  height: 84px;
  padding: 0 max(24px, calc((100vw - 1440px) / 2));
  display: grid;
  grid-template-columns: 240px 1fr minmax(220px, 310px) auto;
  align-items: center;
  gap: 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.consult-brand img {
  width: 194px;
  max-height: 48px;
  object-fit: contain;
  object-position: left center;
}
.consult-agent {
  display: flex;
  align-items: center;
  gap: 12px;
}
.consult-agent__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #0878e8, #075dcc);
  color: #fff;
  font-size: 20px;
}
.consult-agent span:last-child {
  display: grid;
}
.consult-agent strong {
  font-size: 15px;
}
.consult-agent small {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
}
.consult-agent small i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 6px;
}
.consult-progress span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.consult-progress div {
  height: 7px;
  border-radius: 999px;
  background: #e8f0f8;
  margin-top: 7px;
  overflow: hidden;
}
.consult-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0878e8, #00b7f0);
  border-radius: inherit;
  transition: width 0.35s ease;
}
.consult-header nav {
  display: flex;
  gap: 8px;
}
.consult-header nav button,
.consult-header nav a {
  height: 42px;
  min-width: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  padding: 0 13px;
  cursor: pointer;
}
.consult-header nav button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.consult-main {
  width: min(1280px, calc(100% - 40px));
  margin: 26px auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  flex: 1;
  min-height: 0;
}
.consult-chat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 138px);
  overflow: hidden;
}
.consult-feed {
  padding: 28px clamp(20px, 4vw, 54px);
  flex: 1;
  overflow: auto;
  scroll-behavior: smooth;
}
.message {
  display: flex;
  gap: 11px;
  margin: 0 0 18px;
  align-items: flex-end;
  animation: messageIn 0.28s ease both;
}
.message--user {
  justify-content: flex-end;
}
.message__avatar {
  width: 35px;
  height: 35px;
  border-radius: 12px;
  background: #e7f3ff;
  color: var(--blue);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.message__body {
  max-width: min(690px, 82%);
}
.message__label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 5px 3px;
}
.message__bubble {
  white-space: pre-line;
  border: 1px solid var(--line);
  background: #f7fbff;
  padding: 14px 17px;
  border-radius: 6px 18px 18px 18px;
  font-size: 15px;
  line-height: 1.65;
}
.message--user .message__bubble {
  background: linear-gradient(135deg, #0878e8, #076ad6);
  color: #fff;
  border-color: transparent;
  border-radius: 18px 6px 18px 18px;
}
.message--user .message__label {
  text-align: right;
}
.typing {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 23px;
}
.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7f9ab6;
  animation: typing 1s infinite;
}
.typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing i:nth-child(3) {
  animation-delay: 0.3s;
}
.consult-composer {
  border-top: 1px solid var(--line);
  background: #fbfdff;
  padding: 20px clamp(18px, 3vw, 38px) calc(20px + env(safe-area-inset-bottom));
  position: relative;
}
.composer-card {
  display: grid;
  gap: 14px;
}
.composer-card__hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.composer-field {
  display: grid;
  gap: 7px;
}
.composer-field > span,
.composer-legend {
  font-size: 13px;
  font-weight: 800;
}
.composer-field input,
.composer-field textarea,
.composer-field select {
  width: 100%;
  border: 1px solid #bcd1e5;
  border-radius: 14px;
  background: #fff;
  padding: 13px 15px;
  color: var(--ink);
  outline: none;
  font-size: 15px;
  resize: vertical;
}
.composer-field textarea {
  min-height: 108px;
}
.composer-field textarea.large {
  min-height: 142px;
}
.composer-field input:focus,
.composer-field textarea:focus,
.composer-field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(8, 120, 232, 0.11);
}
.field-error {
  color: #d63853;
  font-size: 12px;
  min-height: 18px;
}
.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.choice {
  border: 1px solid #cbdceb;
  border-radius: 999px;
  background: #fff;
  color: #274d75;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 42px;
}
.choice:hover,
.choice.is-selected {
  border-color: #6bb5f7;
  background: #eaf5ff;
  color: #0069d6;
}
.composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}
.consult-button {
  border: 0;
  border-radius: 13px;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
}
.consult-button--primary {
  background: linear-gradient(135deg, #0878e8, #076bd9);
  color: #fff;
  box-shadow: 0 9px 22px rgba(8, 120, 232, 0.2);
}
.consult-button--secondary {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}
.consult-button--ghost {
  background: transparent;
  color: var(--blue);
}
.consult-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}
.trust-line {
  display: flex;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.consult-side {
  display: grid;
  align-content: start;
  gap: 14px;
}
.consult-side__card,
.consult-side__draft {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(21, 65, 106, 0.06);
}
.consult-side__card > i {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #e7fbf4;
  color: #00a779;
  font-size: 21px;
}
.consult-side__card strong {
  display: block;
  font-size: 16px;
  margin-top: 15px;
}
.consult-side__card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.consult-side__card ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
}
.consult-side__card li i {
  color: var(--green);
  margin-right: 7px;
}
.consult-side__draft {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 16px;
}
.consult-side__draft > i {
  font-size: 21px;
  color: var(--blue);
}
.consult-side__draft span {
  display: grid;
}
.consult-side__draft strong {
  font-size: 12px;
}
.consult-side__draft small {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.analysis-card,
.recommend-card,
.summary-card,
.success-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 20px;
  padding: 22px;
}
.analysis-card h2,
.recommend-card h2,
.summary-card h2,
.success-card h2 {
  font-size: 21px;
  margin: 0 0 8px;
}
.analysis-card p,
.recommend-card > p,
.summary-card > p,
.success-card > p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.analysis-list {
  display: grid;
  gap: 11px;
  margin-top: 20px;
}
.analysis-list span {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #70859b;
}
.analysis-list span i {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #eef4fa;
  display: grid;
  place-items: center;
}
.analysis-list span.is-done {
  color: var(--green);
}
.analysis-list span.is-done i {
  background: #e5faf3;
}
.recommend-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 7px 11px;
  background: #e8f4ff;
  color: #0671dd;
  font-size: 11px;
  font-weight: 800;
}
.recommend-card h3 {
  font-size: 20px;
  margin: 13px 0 8px;
}
.recommend-card__reason {
  background: #f6faff;
  border-radius: 14px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
}
.recommend-scope {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 0;
  list-style: none;
}
.recommend-scope li {
  display: flex;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.recommend-scope i {
  color: var(--green);
}
.alternative-list {
  display: grid;
  gap: 9px;
}
.alternative-list article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
}
.alternative-list strong {
  font-size: 13px;
}
.alternative-list p {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.summary-sections {
  display: grid;
  gap: 11px;
  margin: 18px 0;
}
.summary-section {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.summary-section small {
  color: var(--muted);
  font-weight: 700;
}
.summary-section p {
  grid-column: 1/-1;
  margin: 0;
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.6;
}
.summary-section button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 14px;
  background: #f4f9fe;
  padding: 14px;
  font-size: 12px;
  line-height: 1.55;
}
.consent input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  flex: 0 0 auto;
}
.success-card {
  text-align: center;
  padding: 32px;
}
.success-card__icon {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  background: #e2faf2;
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 30px;
  margin: 0 auto 18px;
}
.success-detail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  margin: 21px 0;
}
.success-detail span {
  background: #f8fbfe;
  padding: 14px;
  display: grid;
  gap: 4px;
}
.success-detail small {
  font-size: 10px;
  color: var(--muted);
}
.success-detail strong {
  font-size: 13px;
}
.upload-box {
  border: 1px dashed #86bff1;
  border-radius: 14px;
  background: #f7fbff;
  padding: 15px;
  display: flex;
  gap: 11px;
  align-items: center;
  cursor: pointer;
}
.upload-box i {
  font-size: 21px;
  color: var(--blue);
}
.upload-box span {
  display: grid;
  font-size: 12px;
}
.upload-box strong {
  font-size: 13px;
}
.uploaded-file {
  font-size: 12px;
  color: var(--green);
  font-weight: 700;
}
.is-spinning {
  animation: spin 0.8s linear infinite;
}
@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 900px) {
  .consult-header {
    height: auto;
    min-height: 76px;
    padding: 12px 16px;
    grid-template-columns: 1fr auto auto;
  }
  .consult-brand {
    display: none;
  }
  .consult-progress {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .consult-header nav button span {
    display: none;
  }
  .consult-main {
    width: min(100% - 20px, 760px);
    margin: 10px auto;
    display: block;
  }
  .consult-side {
    display: none;
  }
  .consult-chat {
    min-height: calc(100dvh - 110px);
    border-radius: 18px;
  }
  .consult-feed {
    padding: 20px 15px;
  }
  .consult-composer {
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
  }
  .message__body {
    max-width: 88%;
  }
  .message__bubble {
    font-size: 14px;
  }
  .choice {
    padding: 9px 12px;
  }
  .recommend-scope {
    grid-template-columns: 1fr;
  }
  .success-detail {
    grid-template-columns: 1fr;
  }
  .composer-actions {
    flex-wrap: wrap;
  }
  .consult-button {
    flex: 1;
    min-width: 140px;
  }
  .consult-agent__icon {
    width: 40px;
    height: 40px;
  }
  .consult-agent strong {
    font-size: 14px;
  }
}
@media (max-width: 480px) {
  .consult-header {
    gap: 9px;
  }
  .consult-agent small {
    font-size: 11px;
  }
  .consult-header nav button,
  .consult-header nav a {
    height: 40px;
    min-width: 40px;
    padding: 0 10px;
  }
  .consult-main {
    width: 100%;
    margin: 0;
  }
  .consult-chat {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    min-height: calc(100dvh - 102px);
  }
  .consult-feed {
    padding-bottom: 16px;
  }
  .message__avatar {
    width: 31px;
    height: 31px;
  }
  .message__body {
    max-width: 91%;
  }
  .composer-actions .consult-button {
    width: 100%;
    flex-basis: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
