.consult-page {
  --consult-ink: #141538;
  --consult-blue: #291bc1;
  --consult-muted: #555a75;
  --consult-border: #dddff0;
  padding: 24px 0 56px;
  background: #f6f6fc;
  color: var(--consult-ink);
}

.consult-page [hidden] { display: none !important; }
.consult-page .wrap { max-width: 1160px; }
.consult-page h1 { margin: 0 0 18px; font-size: clamp(32px, 4.4vw, 50px); line-height: 1.08; letter-spacing: -.055em; }
.consult-page h1 strong { color: var(--consult-blue); }
.consult-page :is(button, a):focus-visible { outline: 2px solid var(--consult-blue); outline-offset: 2px; }
.consult-chat { overflow: hidden; border: 1px solid var(--consult-border); border-radius: 19px; background: #fff; box-shadow: 0 18px 45px #20165a0c; }
.consult-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 8px 22px; border-bottom: 1px solid var(--consult-border); }
.consult-header h2 { margin: 0; font-size: .95rem; font-weight: 700; letter-spacing: normal; }
.consult-reset, .consult-link {
  border: 0; border-radius: 4px; padding: 6px 0; background: transparent; color: var(--consult-blue);
  font: inherit; font-size: .86rem; font-weight: 600; text-decoration: underline; text-underline-offset: .2em; cursor: pointer;
}

.consult-thread {
  display: grid; align-content: start; gap: 16px;
  min-height: min(185px, 28vh); max-height: clamp(241px, calc(100vh - 288px), 580px);
  overflow: auto; padding: 19px 22px; background: linear-gradient(#fbfaff, #fff 190px);
  scroll-padding: 12px 0; overscroll-behavior-y: contain;
}
.consult-thread:focus-visible { outline: 2px solid var(--consult-blue); outline-offset: -3px; }
.consult-advisor { display: grid; grid-template-columns: 31px minmax(0, 1fr); align-items: start; gap: 11px; min-width: 0; }
.consult-mark { display: grid; place-items: center; height: 31px; border-radius: 9px; background: var(--consult-blue); color: #fff; font-size: .8rem; font-weight: 700; }
.consult-reply, .consult-user { overflow-wrap: anywhere; }
.consult-thread p { margin: 0; }
.consult-thread .consult-author { margin-bottom: 4px; color: var(--consult-muted); font-size: .77rem; font-weight: 700; }
.consult-reply > p + p { margin-top: .4rem; }
.consult-reply .consult-criteria { margin-top: 5px; color: var(--consult-muted); font-size: .85rem; }
.consult-user { justify-self: end; max-width: min(88%, 670px); padding: 9px 13px; border-radius: 14px 14px 4px 14px; background: #efedff; color: #231a63; }
.consult-user .consult-author { text-align: right; }
.consult-actions, .consult-card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.consult-actions button, .consult-card-actions button, .consult-choice {
  border: 1px solid #d6d4ec; border-radius: 9px; background: white; color: #302399;
  font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.consult-actions button, .consult-card-actions button { padding: 5px 9px; font-size: .8rem; }
.consult-actions button:hover, .consult-card-actions button:hover, .consult-choice:hover, .consult-choice[aria-pressed="true"] { background: #f0eeff; border-color: #a79edb; }
.consult-thread button:disabled { color: #62647a; background: #f6f6fb; border-color: var(--consult-border); cursor: default; }
.consult-choice-grid, .consult-models { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-top: 12px; }
.consult-choice { padding: 9px 11px; min-width: 0; font-size: .94rem; }
.consult-choice > span { display: block; margin-top: 2px; color: var(--consult-muted); font-size: .79rem; font-weight: 400; }
.consult-bike { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--consult-border); border-radius: 12px; background: white; }
.consult-bike > img { display: block; width: 100%; height: 107px; object-fit: contain; padding: 4px 7px; background: #f7f8fd; }
.consult-bike-main { display: flex; flex: 1; flex-direction: column; padding: 9px 10px; }
.consult-bike h3 { font-size: .96rem; line-height: 1.32; letter-spacing: normal; margin: 0 0 3px; }
.consult-bike-price { color: #2516ae; font-weight: 700; }
.consult-bike ul, .consult-points { margin: 3px 0 7px; padding-left: 18px; color: #373c5a; font-size: .81rem; }
.consult-bike .consult-card-actions { margin-top: auto; align-items: baseline; padding-top: 4px; }
.consult-bike a, .consult-reply a { color: var(--consult-blue); font-weight: 600; text-underline-offset: .15em; }
.consult-card-actions a { font-size: .82rem; }
.consult-response-model { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--consult-border); }
.consult-compose { display: grid; gap: 3px; padding: 9px 22px 16px; background: white; }
.consult-entry {
  display: flex; align-items: stretch; gap: 7px; min-height: 49px; padding: 5px;
  border: 1px solid #a7a2d8; border-radius: 12px; background: white;
}
.consult-entry:focus-within { box-shadow: 0 0 0 3px #efedff; border-color: #665ad3; }
.consult-entry input, .consult-entry input:focus {
  min-width: 0; width: 100%; padding: 4px 7px; border: 0; color: var(--consult-ink);
  outline: none; box-shadow: none; background: transparent; font: inherit;
}
.consult-entry input::placeholder { color: #646681; }
.consult-send { border: 0; border-radius: 8px; padding: 6px 13px; background: var(--consult-blue); color: white; font: inherit; font-size: .88rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.consult-send:disabled { opacity: .55; cursor: progress; }
.consult-send span { margin-left: 3px; }
.consult-compose > .consult-link { justify-self: start; }
.consult-help { margin: 13px 0 0; font-size: .88rem; color: var(--consult-muted); }
.consult-help a { text-decoration: underline; text-underline-offset: .14em; }

@media (max-width: 760px) {
  .consult-page { padding-top: 17px; }
  .consult-header, .consult-thread { padding-inline: 13px; }
  .consult-compose { padding-inline: 13px; }
  .consult-advisor { grid-template-columns: 26px minmax(0,1fr); gap: 7px; }
  .consult-mark { height: 26px; }
  .consult-choice-grid, .consult-models { grid-template-columns: 1fr; }
  .consult-bike { display: grid; grid-template-columns: minmax(85px, 35%) 1fr; }
  .consult-bike > img { height: 100%; min-height: 100px; }
  .consult-thread { max-height: clamp(230px, calc(100vh - 270px), 520px); }
  .consult-entry input { font-size: 16px; }
}
