.hg-consultation-stack {
  position: fixed;
  right: 24px;
  bottom: 76px;
  width: min(430px, calc(100vw - 32px));
  height: min(720px, calc(100dvh - 100px));
  z-index: 1250;
}

.hg-consultation-stack[hidden] { display: none !important; }
.hg-consultation-stack::before,
.hg-consultation-stack::after { display: none; }

.floating-support { overflow: hidden; }
body[data-route] .floating-support.floating-support { display: grid; }

.hg-consultation-panel {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #d8dde2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(8, 11, 24, .2);
  z-index: 3;
}

.hg-consultation-tabs {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.hg-consultation-tab {
  position: absolute;
  left: -44px;
  width: 48px;
  min-height: 70px;
  padding: 7px 4px;
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 1px solid #cad5da;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: #edf3f5;
  color: #2d5c73;
  box-shadow: -6px 8px 18px rgba(8, 11, 24, .09);
  pointer-events: auto;
}

.hg-consultation-tab-avatar,
.hg-consultation-head-avatar,
.hg-consultation-message-avatar {
  overflow: hidden;
  border-radius: 50%;
}

.hg-consultation-tab-avatar { width: 28px; height: 28px; }
.hg-consultation-tab-avatar img,
.hg-consultation-head-avatar img,
.hg-consultation-message-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.hg-consultation-tab-name { max-height: 40px; overflow: hidden; writing-mode: vertical-rl; font-size: 10px; }
.hg-consultation-tab-dot { position: absolute; top: 3px; left: 2px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #d34242; }

.hg-consultation-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid #e6e8eb;
  background: #fff;
}

.hg-consultation-head-avatar { width: 36px; height: 36px; flex: 0 0 36px; background: #edf2f4; }
.hg-consultation-head-copy { min-width: 0; flex: 1; }
.hg-consultation-head-copy h2 { margin: 0; font-size: 14px; }
.hg-consultation-head-copy p { margin: 3px 0 0; color: #25835d; font-size: 10px; }
.hg-consultation-head-copy p::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.hg-consultation-head-action { width: 30px; height: 30px; border-radius: 8px; background: transparent; color: #555; font-size: 17px; }
.hg-consultation-head-action:hover { background: #f2f4f5; }

.hg-consultation-messages {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px;
  background: #f7f8f9;
  overscroll-behavior: contain;
}

.hg-consultation-message { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; }
.hg-consultation-message.is-user { justify-content: flex-end; }
.hg-consultation-message-avatar { width: 28px; height: 28px; flex: 0 0 28px; background: #e8eef1; }
.hg-consultation-message-body { display: grid; gap: 4px; max-width: 82%; min-width: 0; }
.hg-consultation-message.is-user .hg-consultation-message-body { justify-items: end; }
.hg-consultation-bubble { max-width: 100%; padding: 10px 12px; border: 1px solid #e2e5e8; border-radius: 4px 12px 12px 12px; background: #fff; color: #20242a; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.hg-consultation-message.is-user .hg-consultation-bubble { border-color: #25313a; border-radius: 12px 4px 12px 12px; background: #25313a; color: #fff; }
.hg-consultation-bubble.is-markdown { white-space: normal; }
.hg-consultation-message-body > .hg-consultation-bubble.is-markdown { width: fit-content; max-width: 100%; }
.hg-consultation-bubble.is-markdown > :first-child { margin-top: 0; }
.hg-consultation-bubble.is-markdown > :last-child { margin-bottom: 0; }
.hg-consultation-bubble.is-markdown p,
.hg-consultation-bubble.is-markdown ul,
.hg-consultation-bubble.is-markdown ol,
.hg-consultation-bubble.is-markdown blockquote,
.hg-consultation-bubble.is-markdown pre { margin: 0 0 8px; }
.hg-consultation-bubble.is-markdown ul,
.hg-consultation-bubble.is-markdown ol { padding-left: 18px; }
.hg-consultation-bubble.is-markdown a { color: #285f83; text-decoration: underline; }
.hg-consultation-system { margin: 10px auto 14px; color: #737982; font-size: 10px; text-align: center; }
.hg-support-message-meta { display: flex; gap: 8px; align-items: center; color: #8a8f95; font-size: 9px; }
.hg-consultation-message.is-user .hg-support-message-meta { justify-content: flex-end; }
.hg-support-delivery button { padding: 0; color: #a23232; font-size: inherit; text-decoration: underline; }
.hg-support-delivery.is-failed,
.hg-support-delivery.is-interrupted { color: #a23232; }
.hg-support-message-attachments { display: grid; gap: 4px; }
.hg-support-message-attachment { display: inline-flex; gap: 6px; align-items: center; max-width: 100%; padding: 6px 8px; border: 1px solid #dce1e5; border-radius: 7px; background: #fff; color: #4e565d; font-size: 10px; overflow-wrap: anywhere; }

.hg-support-welcome { margin: 0 0 14px; }
.hg-support-welcome > .hg-consultation-message { margin-bottom: 8px; }
.hg-support-welcome-actions { margin-left: 36px; padding: 10px; border: 1px solid #e0e4e7; border-radius: 10px; background: #fff; }
.hg-support-quick { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; }
.hg-support-quick button,
.hg-support-actions button { min-height: 31px; padding: 0 10px; border: 1px solid #d9dde1; border-radius: 8px; background: #fff; color: #30363b; font-size: 10px; }
.hg-support-quick button:hover,
.hg-support-actions button:hover { border-color: #77838c; background: #f3f5f6; }
.hg-support-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #e1e4e7; }
.hg-support-actions button:first-child { border-color: #25313a; background: #25313a; color: #fff; }

.hg-consultation-card,
.hg-support-workflow { margin: 0 0 12px; padding: 13px; border: 1px solid #dde2e5; border-radius: 10px; background: #fff; }
.hg-consultation-card h3,
.hg-support-workflow h3 { margin: 0 0 7px; font-size: 14px; }
.hg-consultation-card p,
.hg-support-workflow > p { margin: 0 0 11px; color: #6d7178; font-size: 10px; line-height: 1.55; }
.hg-lawyer-card-row { display: grid; gap: 8px; }
.hg-lawyer-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid #e0e4e7; border-radius: 9px; background: #fff; }
.hg-lawyer-card-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #e8eef1; color: #2d5c73; font-size: 11px; font-weight: 800; }
.hg-lawyer-card-copy { min-width: 0; }
.hg-lawyer-card-copy strong,
.hg-lawyer-card-copy span { display: block; }
.hg-lawyer-card-copy span { margin-top: 3px; overflow: hidden; color: #777c83; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.hg-lawyer-card button,
.hg-inline-submit,
.hg-support-primary { min-height: 33px; padding: 0 11px; border-radius: 7px; background: #252a31; color: #fff; font-size: 10px; font-weight: 700; }
.hg-support-danger { min-height: 38px; padding: 0 12px; border: 1px solid #913a3a; border-radius: 7px; background: #913a3a; color: #fff; font-size: 11px; font-weight: 750; }
.hg-support-danger:hover { border-color: #742c2c; background: #742c2c; }

.hg-support-workflow form,
.hg-inline-form { display: grid; gap: 10px; }
.hg-support-workflow label,
.hg-inline-form label { display: grid; gap: 5px; color: #4f565c; font-size: 10px; }
.hg-support-workflow input,
.hg-support-workflow textarea,
.hg-inline-form input,
.hg-inline-form textarea { width: 100%; padding: 9px; border: 1px solid #d9dde1; border-radius: 7px; background: #fff; color: #15181c; font-size: 11px; }
.hg-support-workflow textarea,
.hg-inline-form textarea { min-height: 78px; resize: vertical; }
.hg-support-workflow em { color: #b53131; font-style: normal; }
.hg-support-workflow small,
.hg-support-policy { color: #858b91; font-size: 9px; }
.hg-support-back { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; margin: 0 0 14px; padding: 0 11px; border: 1px solid #d8dde1; border-radius: 8px; background: #fff; color: #35414a; font-size: 11px; font-weight: 700; }
.hg-support-back:hover { border-color: #7c8790; background: #f4f6f7; }
.hg-support-back:focus-visible { outline: 2px solid #60727e; outline-offset: 2px; }
.hg-support-checkbox { grid-template-columns: auto 1fr; align-items: center; }
.hg-support-checkbox input { width: auto; }
.hg-support-summary { display: grid; grid-template-columns: 70px 1fr; gap: 7px; padding: 10px; border-radius: 8px; background: #f4f6f7; font-size: 10px; }
.hg-support-summary dt { color: #70777d; }
.hg-support-summary dd { margin: 0; }
.hg-support-workflow fieldset { display: flex; gap: 12px; padding: 9px; border: 1px solid #dfe3e6; border-radius: 8px; }
.hg-support-workflow legend { padding: 0 4px; font-size: 10px; font-weight: 700; }
.hg-support-workflow fieldset label { display: flex; align-items: center; gap: 4px; }
.hg-support-workflow fieldset input { width: auto; }
.hg-support-stars label { cursor: pointer; }
.hg-support-stars span { font-size: 24px; line-height: 1; }
.hg-support-success { text-align: center; }

.hg-consultation-composer { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 10px; border-top: 1px solid #e4e7e9; background: #fff; }
.hg-consultation-composer textarea { width: 100%; min-height: 44px; max-height: 100px; padding: 10px; border: 1px solid #d8dce0; border-radius: 9px; resize: vertical; outline: none; font-size: 12px; }
.hg-consultation-composer textarea:focus { border-color: #65717a; }
.hg-support-composer-actions { display: grid; grid-template-columns: auto minmax(0, 1fr) 72px; align-items: center; gap: 8px; }
.hg-support-composer-actions > div { grid-column: 1; min-width: 0; }
.hg-support-composer-hint { grid-column: 2; min-width: 0; }
.hg-support-icon-button { min-height: 31px; padding: 0 9px; border: 1px solid #d8dde1; border-radius: 7px; background: #fff; color: #4d565e; font-size: 10px; white-space: nowrap; }
.hg-support-send { grid-column: 3; width: 72px; min-width: 72px; min-height: 31px; justify-self: end; border-radius: 7px; background: #252a31; color: #fff; font-size: 10px; font-weight: 700; }
.hg-support-send:disabled,
.hg-support-primary:disabled,
.hg-support-danger:disabled { opacity: .5; cursor: wait; }
.hg-support-attachment-list > div,
.hg-support-offline-file { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.hg-support-attachment-list button,
.hg-support-offline-file button { color: #8b3232; font-size: 10px; }
.hg-support-error { margin: 0; color: #a23232; font-size: 10px; }
.hg-consultation-loading textarea { opacity: .75; }

.hg-appointment-actions { display: flex; gap: 8px; }
.hg-appointment-actions button { min-height: 32px; padding: 0 10px; border-radius: 7px; background: #252a31; color: #fff; font-size: 10px; }
.hg-appointment-actions button:last-child { background: #eceef0; color: #4f5359; }

@media (max-width: 850px) {
  body[data-route] .floating-support.floating-support { display: grid; right: 14px; bottom: 14px; width: 48px; height: 48px; }
}

@media (max-width: 720px) {
  .hg-consultation-stack { right: 10px; bottom: 12px; width: calc(100vw - 20px); height: calc(100dvh - 84px); }
  .hg-consultation-tabs { top: -34px; height: 35px; display: flex; gap: 5px; align-items: end; overflow: auto; }
  .hg-consultation-tab { position: relative !important; left: auto; top: auto !important; width: auto; min-width: 72px; min-height: 34px; grid-auto-flow: column; align-items: center; border-right: 1px solid #cad5da; border-radius: 9px 9px 0 0; }
  .hg-consultation-tab-name { writing-mode: horizontal-tb; max-height: none; }
  .hg-consultation-panel { border-radius: 12px; }
}

/* UI 30/48/49/50/51/53/54 alignment layer */
.hg-consultation-stack {
  --hg-ink: #10151d;
  --hg-muted: #66707a;
  --hg-line: #dfe3e7;
  --hg-soft: #f5f7f8;
  --hg-panel: #ffffff;
  --hg-success: #16855b;
  --hg-warning: #b56713;
  --hg-danger: #a33333;
  right: 20px;
  bottom: 84px;
  width: min(420px, calc(100vw - 32px));
  height: min(760px, calc(100dvh - 108px));
  color: var(--hg-ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.hg-consultation-panel {
  grid-template-rows: 50px auto minmax(0, 1fr);
  border-color: #d7dce1;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(10, 18, 28, .18);
}

.hg-consultation-head {
  min-height: 50px;
  padding: 0 10px 0 12px;
  gap: 9px;
}

.hg-consultation-head-avatar {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

.hg-consultation-head-copy h2 { font-size: 14px; line-height: 1.3; }
.hg-consultation-head-copy p { margin-top: 2px; font-size: 10px; }
.hg-consultation-head-action {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #343b43;
}
.hg-consultation-head-action:focus-visible,
.hg-consultation-tab:focus-visible,
.hg-consultation-stack button:focus-visible,
.hg-consultation-stack input:focus-visible,
.hg-consultation-stack textarea:focus-visible,
.hg-consultation-stack select:focus-visible {
  outline: 2px solid #315c82;
  outline-offset: 2px;
}

.hg-consultation-tabs {
  position: relative;
  inset: auto;
  z-index: 2;
  display: flex;
  gap: 4px;
  min-width: 0;
  padding: 6px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--hg-line);
  background: #fff;
  pointer-events: auto;
  scrollbar-width: thin;
}
.hg-consultation-tabs[hidden] { display: none !important; }
.hg-consultation-tab {
  position: relative;
  left: auto;
  top: auto !important;
  width: auto;
  min-width: max-content;
  min-height: 34px;
  padding: 3px 10px 3px 4px;
  grid-auto-flow: column;
  grid-template-columns: 26px auto;
  align-items: center;
  justify-items: start;
  gap: 6px;
  border: 1px solid var(--hg-line);
  border-radius: 8px;
  background: #fff;
  color: #424a53;
  box-shadow: none;
}
.hg-consultation-tab[aria-current="page"] { border-color: #202832; background: #202832; color: #fff; }
.hg-consultation-tab-avatar { width: 26px; height: 26px; background: #edf1f3; }
.hg-consultation-tab-name { max-height: none; writing-mode: horizontal-tb; font-size: 11px; }
.hg-consultation-tab-dot { top: 0; left: 0; }

.hg-consultation-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}
.hg-consultation-thread {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.hg-consultation-messages {
  padding: 14px 12px;
  background: #f7f8f9;
}
.hg-consultation-message { margin-bottom: 14px; }
.hg-consultation-message-body { max-width: 84%; }
.hg-consultation-bubble {
  padding: 10px 12px;
  border-color: #e1e5e8;
  border-radius: 5px 10px 10px 10px;
  color: #252a30;
  font-size: 12px;
  line-height: 1.65;
}
.hg-consultation-message.is-user .hg-consultation-bubble {
  border-color: #202832;
  border-radius: 10px 5px 10px 10px;
  background: #202832;
}
.hg-consultation-time,
.hg-support-message-meta { color: #7c858f; font-size: 10px; }
.hg-consultation-system { font-size: 11px; }
.hg-consultation-ended { padding: 9px; border: 1px solid #e0e3e6; border-radius: 8px; background: #fff; }

.hg-support-quick {
  margin: 0;
  gap: 6px;
}
.hg-support-quick button,
.hg-support-actions button {
  min-height: 34px;
  padding: 0 10px;
  border-color: #d7dce0;
  border-radius: 7px;
  color: #303740;
  font-size: 11px;
  white-space: nowrap;
}
.hg-support-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0 0;
  padding-top: 10px;
}
.hg-support-actions button:first-child { border-color: #202832; background: #202832; }
.hg-support-actions button:nth-child(4),
.hg-support-actions button:nth-child(5) { background: #f3f5f6; }

.hg-consultation-card,
.hg-support-workflow {
  margin-bottom: 12px;
  padding: 16px;
  border-color: var(--hg-line);
  border-radius: 10px;
}
.hg-consultation-card h3,
.hg-support-workflow h3 { margin-bottom: 8px; font-size: 15px; line-height: 1.35; }
.hg-consultation-card p,
.hg-support-workflow > p { color: var(--hg-muted); font-size: 11px; line-height: 1.65; }
.hg-support-workflow-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid #d9dfe3;
  border-radius: 50%;
  color: #26313a;
  font-size: 19px;
}

.hg-lawyer-recommendation { padding: 0; overflow: hidden; }
.hg-lawyer-recommendation > h3 { padding: 14px 14px 0; }
.hg-lawyer-recommendation-basis { padding: 12px 14px; border-bottom: 1px solid var(--hg-line); background: #f4f7f8; }
.hg-lawyer-recommendation-basis strong { display: block; margin-bottom: 4px; font-size: 11px; }
.hg-lawyer-recommendation-basis p { margin: 0; color: var(--hg-muted); font-size: 10px; line-height: 1.55; }
.hg-lawyer-card-row { padding: 4px 12px 12px; gap: 8px; }
.hg-lawyer-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
  border-color: #dfe3e6;
  border-radius: 9px;
}
.hg-lawyer-card-head { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 10px; }
.hg-lawyer-card-avatar,
.hg-lawyer-profile-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #e9eef1;
  color: #31596f;
  font-size: 13px;
  font-weight: 800;
}
.hg-lawyer-card-avatar img,
.hg-lawyer-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hg-lawyer-card-copy strong { font-size: 12px; }
.hg-lawyer-card-copy span { margin-top: 2px; font-size: 10px; line-height: 1.4; white-space: normal; }
.hg-lawyer-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.hg-lawyer-tags span { padding: 4px 7px; border: 1px solid #dfe3e6; border-radius: 5px; background: #f7f8f9; color: #59626b; font-size: 9px; }
.hg-lawyer-reason { padding-top: 2px; }
.hg-lawyer-reason strong { font-size: 10px; }
.hg-lawyer-reason p { margin: 3px 0 0; color: #5f6871; font-size: 10px; line-height: 1.55; }
.hg-lawyer-presence { margin: 0; color: #6c747d; font-size: 10px; }
.hg-lawyer-presence::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #939ba3; }
.hg-lawyer-presence.is-online { color: var(--hg-success); }
.hg-lawyer-presence.is-online::before { background: #20b777; }
.hg-lawyer-card-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 7px; }
.hg-lawyer-card-actions button,
.hg-lawyer-recommendation-actions button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d7dce0;
  border-radius: 6px;
  background: #fff;
  color: #252b32;
  font-size: 10px;
  font-weight: 650;
}
.hg-lawyer-card-actions .is-primary { border-color: #111823; background: #111823; color: #fff; }
.hg-lawyer-recommendation-actions { padding: 0 12px 12px; }

.hg-consultation-composer {
  gap: 7px;
  padding: 10px 12px 12px;
}
.hg-consultation-composer textarea {
  min-height: 46px;
  max-height: 112px;
  border-color: #d4d9dd;
  border-radius: 7px;
  font-size: 12px;
}
.hg-support-composer-actions { align-items: center; }
.hg-support-composer-hint { margin-left: auto; color: #89919a; font-size: 9px; }
.hg-support-icon-button,
.hg-support-send { min-height: 34px; border-radius: 6px; font-size: 10px; }
.hg-support-send { width: 72px; min-width: 72px; background: #111823; }
.hg-consultation-composer.is-disabled::before { content: "咨询已结束"; color: var(--hg-muted); font-size: 11px; }

.hg-support-workflow form,
.hg-inline-form { gap: 12px; }
.hg-support-workflow label,
.hg-inline-form label { color: #3f474f; font-size: 11px; font-weight: 650; }
.hg-support-workflow input,
.hg-support-workflow select,
.hg-support-workflow textarea,
.hg-inline-form input,
.hg-inline-form textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid #d6dce0;
  border-radius: 6px;
  background: #fff;
  color: #171b20;
  font-size: 11px;
  font-weight: 400;
}
.hg-support-workflow textarea,
.hg-inline-form textarea { min-height: 92px; }
.hg-support-workflow small,
.hg-support-policy { justify-self: end; color: #7c858e; font-size: 9px; font-weight: 400; }
.hg-support-file-field {
  padding: 10px;
  border: 1px dashed #cbd3d9;
  border-radius: 7px;
  background: #fafbfb;
}
.hg-support-file-field input { padding: 0; border: 0; background: transparent; }
.hg-support-file-field span { color: #7c858e; font-size: 9px; font-weight: 400; }
.hg-support-primary {
  min-height: 38px;
  border-radius: 6px;
  background: #111823;
  color: #fff;
  font-size: 11px;
}
.hg-support-back { color: #56616b; font-size: 10px; }
.hg-support-summary { grid-template-columns: 76px 1fr; gap: 9px; padding: 12px; font-size: 11px; }
.hg-support-workflow fieldset { padding: 11px; }
.hg-support-workflow legend { font-size: 11px; }
.hg-support-end-session > .hg-support-workflow-icon { background: #f4f7f8; color: #26343e; font-weight: 800; }
.hg-support-end-session form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hg-line); }
.hg-support-end-actions { display: grid; gap: 6px; padding: 11px; border: 1px solid #eadada; border-radius: 8px; background: #fbf7f7; }
.hg-support-end-actions .hg-support-danger { width: 100%; }
.hg-support-end-actions p { margin: 0; color: #7a6565; font-size: 9px; line-height: 1.5; text-align: center; }
.hg-support-end-session form > button:not(.hg-support-danger) { min-height: 34px; border: 1px solid #d8dde1; border-radius: 7px; background: #fff; color: #45515b; font-size: 10px; }
.hg-support-stars { flex-direction: row-reverse; justify-content: flex-end; }
.hg-support-stars input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.hg-support-stars span { color: #4e5861; font-size: 28px; }
.hg-support-stars input:checked + span,
.hg-support-stars label:hover span { color: #d28b19; }
.hg-support-success { min-height: 260px; display: grid; place-content: center; gap: 8px; }
.hg-support-success-actions { display: flex; justify-content: center; gap: 8px; }
.hg-support-success-actions > button { min-height: 38px; padding: 0 14px; border: 1px solid #d8dde1; border-radius: 6px; background: #fff; color: #35414a; font-size: 11px; font-weight: 700; }
.hg-support-success-actions > .hg-support-primary { border-color: #111823; background: #111823; color: #fff; }

.hg-lawyer-layer {
  position: fixed;
  inset: 0;
  z-index: 1300;
}
.hg-lawyer-layer[hidden] { display: none !important; }
.hg-lawyer-layer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(17, 24, 32, .54);
}
.hg-lawyer-layer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: min(440px, 100vw);
  height: 100dvh;
  overflow-y: auto;
  border-left: 1px solid #d7dce0;
  background: #fff;
  box-shadow: -20px 0 60px rgba(10, 18, 28, .18);
}
.hg-lawyer-layer-content.is-confirm {
  top: 50%;
  right: 50%;
  width: min(440px, calc(100vw - 28px));
  height: auto;
  max-height: calc(100dvh - 28px);
  border: 1px solid #d7dce0;
  border-radius: 10px;
  translate: 50% -50%;
  box-shadow: 0 26px 80px rgba(10, 18, 28, .25);
}
.hg-lawyer-profile { padding: 24px 24px 30px; }
.hg-lawyer-profile-head { display: grid; grid-template-columns: 54px minmax(0, 1fr) 32px; align-items: center; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--hg-line); }
.hg-lawyer-profile-head .hg-lawyer-profile-avatar { width: 54px; height: 54px; }
.hg-lawyer-profile h2 { margin: 0; font-size: 18px; }
.hg-lawyer-layer-close { width: 32px; height: 32px; border-radius: 6px; background: transparent; color: #283038; font-size: 18px; }
.hg-lawyer-profile > section { padding-top: 20px; }
.hg-lawyer-profile h3,
.hg-lawyer-confirm h3 { margin: 0 0 9px; font-size: 12px; }
.hg-lawyer-profile p,
.hg-lawyer-profile li { color: #58616a; font-size: 11px; line-height: 1.7; }
.hg-lawyer-profile ul { margin: 0; padding-left: 18px; }
.hg-lawyer-facts { display: grid; gap: 10px; padding: 18px 0; border-bottom: 1px solid var(--hg-line); }
.hg-lawyer-facts > div,
.hg-lawyer-confirm-facts > div { display: grid; grid-template-columns: 88px 1fr; gap: 10px; }
.hg-lawyer-facts dt,
.hg-lawyer-confirm-facts dt { color: #727b84; font-size: 10px; }
.hg-lawyer-facts dd,
.hg-lawyer-confirm-facts dd { margin: 0; color: #252b31; font-size: 11px; }
.hg-lawyer-profile-cta { width: 100%; margin-top: 24px; }
.hg-lawyer-confirm { padding: 22px; }
.hg-lawyer-confirm > header { display: flex; justify-content: space-between; gap: 14px; }
.hg-lawyer-confirm h2 { margin: 4px 0 0; font-size: 17px; }
.hg-lawyer-confirm-eyebrow,
.hg-lawyer-aside-eyebrow { color: #6d7780; font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.hg-lawyer-confirm > p { color: #65707a; font-size: 10px; line-height: 1.6; }
.hg-share-scope { display: grid; gap: 9px; margin: 18px 0; }
.hg-share-scope label { display: flex; align-items: center; gap: 8px; color: #31383f; font-size: 11px; }
.hg-privacy-note { display: grid; gap: 4px; padding: 11px; border: 1px solid #dfe4e7; border-radius: 7px; background: #f7f9fa; }
.hg-privacy-note strong { font-size: 10px; }
.hg-privacy-note span { color: #68727b; font-size: 9px; line-height: 1.55; }
.hg-lawyer-confirm-facts { display: grid; gap: 9px; padding: 12px 0; border-top: 1px solid var(--hg-line); border-bottom: 1px solid var(--hg-line); }
.hg-lawyer-confirm-warning { padding: 9px; border-radius: 6px; background: #fff8ea; color: #76571f !important; }
.hg-lawyer-confirm-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; margin-top: 16px; }
.hg-lawyer-confirm-actions button { min-height: 38px; border: 1px solid #d7dce0; border-radius: 6px; background: #fff; }
.hg-lawyer-confirm-actions .hg-support-primary { border-color: #111823; background: #111823; color: #fff; }

.hg-consultation-stack.is-lawyer-workspace {
  right: 20px;
  bottom: 20px;
  width: min(1120px, calc(100vw - 40px));
  height: min(820px, calc(100dvh - 40px));
}
.is-lawyer-workspace .hg-consultation-body { grid-template-columns: minmax(0, 1fr) 300px; }
.is-lawyer-workspace .hg-consultation-panel { border-radius: 10px; }
.is-lawyer-workspace .hg-consultation-message-body { max-width: 76%; }
.hg-lawyer-consultation-aside { min-width: 0; overflow-y: auto; padding: 18px; border-left: 1px solid var(--hg-line); background: #fff; }
.hg-lawyer-consultation-aside > section { padding: 0 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--hg-line); }
.hg-lawyer-consultation-aside h3 { margin: 0 0 9px; font-size: 12px; }
.hg-lawyer-consultation-aside p,
.hg-lawyer-consultation-aside dt,
.hg-lawyer-consultation-aside dd { color: #626c75; font-size: 10px; line-height: 1.6; }
.hg-lawyer-aside-person { display: grid; grid-template-columns: 46px 1fr; gap: 10px; align-items: center; margin: 11px 0 14px; }
.hg-lawyer-aside-person .hg-lawyer-profile-avatar { width: 46px; height: 46px; }
.hg-lawyer-aside-person h3 { margin: 0 0 3px; font-size: 13px; }
.hg-lawyer-aside-profile dl { display: grid; gap: 7px; }
.hg-lawyer-aside-profile dl > div { display: grid; grid-template-columns: 64px 1fr; }
.hg-lawyer-aside-profile dd { margin: 0; color: #2f373e; }
.hg-lawyer-aside-profile button,
.hg-lawyer-aside-footer button { width: 100%; min-height: 35px; margin-top: 12px; border: 1px solid #d5dbe0; border-radius: 6px; background: #fff; font-size: 10px; }
.hg-lawyer-shared-card { display: grid; gap: 4px; padding: 10px; border: 1px solid #dde2e6; border-radius: 7px; background: #f8f9fa; }
.hg-lawyer-shared-card strong { font-size: 10px; }
.hg-lawyer-shared-card span { color: #6c757d; font-size: 9px; line-height: 1.5; }

.hg-consultation-stack.is-ticket-workspace {
  right: 20px;
  bottom: 20px;
  width: min(1180px, calc(100vw - 40px));
  height: min(820px, calc(100dvh - 40px));
}
.is-ticket-workspace .hg-consultation-messages { padding: 0; background: #fff; }
.hg-ticket-center { min-height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.hg-ticket-center > header { display: flex; justify-content: space-between; gap: 16px; align-items: end; padding: 18px 20px 12px; }
.hg-ticket-center > header h3 { margin: 5px 0 3px; font-size: 18px; }
.hg-ticket-center > header p { margin: 0; color: var(--hg-muted); font-size: 10px; }
.hg-ticket-center > header .hg-support-primary { min-width: 108px; }
.hg-ticket-filters { display: flex; gap: 22px; padding: 0 20px; border-bottom: 1px solid var(--hg-line); }
.hg-ticket-filters button { position: relative; min-height: 38px; padding: 0 2px; background: transparent; color: #66707a; font-size: 11px; }
.hg-ticket-filters button[aria-pressed="true"] { color: #111820; font-weight: 750; }
.hg-ticket-filters button[aria-pressed="true"]::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: #111820; }
.hg-ticket-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr) 250px; min-height: 0; }
.hg-ticket-list { min-height: 0; overflow-y: auto; padding: 12px; border-right: 1px solid var(--hg-line); background: #fafbfb; }
.hg-ticket-list-item { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; margin-bottom: 8px; padding: 12px; border: 1px solid #e0e4e7; border-radius: 8px; background: #fff; text-align: left; }
.hg-ticket-list-item.is-active { border-color: #303943; box-shadow: inset 3px 0 #303943; }
.hg-ticket-list-item span:first-child { min-width: 0; }
.hg-ticket-list-item strong,
.hg-ticket-list-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-ticket-list-item strong { font-size: 11px; }
.hg-ticket-list-item small { margin-top: 4px; color: #747e87; font-size: 9px; }
.hg-ticket-list-item p { grid-column: 1 / -1; margin: 5px 0 0; color: #727b84; font-size: 9px; }
.hg-ticket-status { align-self: start; padding: 3px 6px; border-radius: 999px; background: #eef2f4; color: #5d6770; font-size: 9px; white-space: nowrap; }
.hg-ticket-status.is-waiting_user { background: #eef5ff; color: #25619b; }
.hg-ticket-status.is-completed { background: #e9f7ef; color: #187a53; }
.hg-ticket-status.is-processing { background: #fff3df; color: #9a5c0a; }
.hg-ticket-layout > main { min-width: 0; min-height: 0; overflow-y: auto; padding: 18px; }
.hg-ticket-progress { padding: 18px; border-left: 1px solid var(--hg-line); }
.hg-ticket-progress h3 { margin: 0 0 16px; font-size: 13px; }
.hg-ticket-progress > p { color: var(--hg-muted); font-size: 10px; line-height: 1.6; }
.hg-ticket-detail > header { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--hg-line); }
.hg-ticket-detail > header h3 { margin: 8px 0 0; font-size: 16px; }
.hg-ticket-detail > header > span { color: #717b84; font-size: 9px; }
.hg-ticket-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 0; }
.hg-ticket-facts > div { display: grid; grid-template-columns: 72px 1fr; }
.hg-ticket-facts dt { color: #778089; font-size: 9px; }
.hg-ticket-facts dd { margin: 0; font-size: 10px; }
.hg-ticket-detail section { padding: 14px 0; border-top: 1px solid var(--hg-line); }
.hg-ticket-detail h4 { margin: 0 0 9px; font-size: 11px; }
.hg-ticket-detail section > p { margin: 0; color: #555f68; font-size: 10px; line-height: 1.7; white-space: pre-wrap; }
.hg-ticket-thread { display: grid; gap: 8px; }
.hg-ticket-message { max-width: 86%; padding: 9px 10px; border-radius: 7px; background: #f1f3f5; }
.hg-ticket-message.is-user { justify-self: end; background: #e8edf0; }
.hg-ticket-message strong,
.hg-ticket-message time { font-size: 8px; color: #737d86; }
.hg-ticket-message p { margin: 4px 0; font-size: 10px; line-height: 1.6; }
.hg-ticket-reply { display: grid; gap: 10px; padding-top: 14px; }
.hg-ticket-reply label { display: grid; gap: 5px; color: #40484f; font-size: 10px; font-weight: 650; }
.hg-ticket-reply textarea { min-height: 70px; padding: 9px; border: 1px solid #d6dce0; border-radius: 6px; resize: vertical; }
.hg-ticket-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.hg-ticket-steps li { position: relative; min-height: 58px; display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; }
.hg-ticket-steps li:not(:last-child)::before { content: ""; position: absolute; top: 27px; bottom: 0; left: 12px; width: 1px; background: #d4dade; }
.hg-ticket-steps li > span { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #bfc7cd; border-radius: 50%; color: #747d85; font-size: 9px; background: #fff; }
.hg-ticket-steps li strong { padding-top: 5px; color: #6f7881; font-size: 10px; }
.hg-ticket-steps li.is-done > span,
.hg-ticket-steps li.is-current > span { border-color: #151b22; background: #151b22; color: #fff; }
.hg-ticket-steps li.is-current strong { color: #151b22; }
.hg-support-state { min-height: 180px; display: grid; place-content: center; gap: 6px; padding: 18px; text-align: center; }
.hg-support-state strong { font-size: 12px; }
.hg-support-state p { margin: 0; color: #747e87; font-size: 10px; line-height: 1.6; }
.hg-support-state button { justify-self: center; min-height: 34px; margin-top: 6px; padding: 0 12px; border: 1px solid #d5dbe0; border-radius: 6px; background: #fff; }
.hg-support-state.is-error { color: var(--hg-danger); }

.hg-consultation-stack.is-review-workspace {
  right: 20px;
  bottom: 20px;
  width: min(900px, calc(100vw - 40px));
  height: min(760px, calc(100dvh - 40px));
}
.is-review-workspace .hg-consultation-messages { padding: 20px; background: #fff; }
.hg-review-workflow { max-width: 780px; margin: 0 auto; }
.hg-review-workflow > header { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 16px; border: 1px solid var(--hg-line); border-radius: 9px; }
.hg-review-workflow > header > span,
.hg-review-grid article > span { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #bfc7cd; border-radius: 50%; font-size: 10px; }
.hg-review-workflow h3 { margin: 0 0 5px; font-size: 16px; }
.hg-review-workflow header p,
.hg-review-grid p { margin: 0; color: var(--hg-muted); font-size: 10px; line-height: 1.6; }
.hg-review-risk { margin: 14px 0; padding: 14px; border: 1px solid #ead8b8; border-radius: 8px; background: #fffaf0; }
.hg-review-risk strong { font-size: 11px; }
.hg-review-risk ul { margin: 7px 0 0; padding-left: 18px; color: #695a3e; font-size: 10px; line-height: 1.7; }
.hg-review-workflow form { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--hg-line); border-radius: 9px; }
.hg-review-workflow form label { display: grid; gap: 6px; font-size: 11px; font-weight: 650; }
.hg-review-workflow form textarea { min-height: 120px; padding: 10px; border: 1px solid #d5dbe0; border-radius: 6px; resize: vertical; }
.hg-review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.hg-review-grid article { padding: 14px; border: 1px solid var(--hg-line); border-radius: 8px; }
.hg-review-grid h4 { margin: 10px 0 5px; font-size: 11px; }
.hg-review-grid button { min-height: 32px; margin-top: 10px; padding: 0 10px; border: 1px solid #d5dbe0; border-radius: 6px; background: #fff; font-size: 9px; }
.hg-review-workflow > .hg-ticket-steps { grid-template-columns: repeat(5, 1fr); padding: 14px 0; }
.hg-review-workflow > .hg-ticket-steps li { grid-template-columns: 28px 1fr; min-height: 40px; }

@media (max-width: 980px) {
  .hg-consultation-stack.is-lawyer-workspace,
  .hg-consultation-stack.is-ticket-workspace,
  .hg-consultation-stack.is-review-workspace { right: 10px; bottom: 10px; width: calc(100vw - 20px); height: calc(100dvh - 20px); }
  .is-lawyer-workspace .hg-consultation-body { grid-template-columns: minmax(0, 1fr) 260px; }
  .hg-ticket-layout { grid-template-columns: 230px minmax(0, 1fr); }
  .hg-ticket-progress { display: none; }
}

@media (max-width: 720px) {
  body[data-route] .floating-support.floating-support { right: 14px; bottom: 14px; width: 50px; height: 50px; }
  .hg-consultation-stack,
  .hg-consultation-stack.is-lawyer-workspace,
  .hg-consultation-stack.is-ticket-workspace,
  .hg-consultation-stack.is-review-workspace { right: 0; bottom: 0; width: 100vw; height: 100dvh; }
  .hg-consultation-panel { border: 0; border-radius: 0; }
  .hg-consultation-tabs { top: auto; height: auto; min-height: 44px; align-items: center; padding: 5px 10px; }
  .hg-consultation-tab { min-width: max-content; min-height: 34px; border-radius: 8px; }
  .hg-consultation-head { padding-top: env(safe-area-inset-top); min-height: calc(50px + env(safe-area-inset-top)); }
  .hg-consultation-body,
  .is-lawyer-workspace .hg-consultation-body { grid-template-columns: minmax(0, 1fr); }
  .hg-lawyer-consultation-aside { display: none; }
  .hg-consultation-message-body,
  .is-lawyer-workspace .hg-consultation-message-body { max-width: 88%; }
  .hg-support-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hg-support-composer-hint { display: none; }
  .hg-lawyer-layer-content { width: 100vw; }
  .hg-lawyer-layer-content.is-confirm { bottom: 0; top: auto; right: 0; width: 100vw; max-height: calc(100dvh - 24px); border-radius: 12px 12px 0 0; translate: 0 0; }
  .hg-ticket-center > header { align-items: center; padding: 12px; }
  .hg-ticket-layout { grid-template-columns: minmax(0, 1fr); }
  .hg-ticket-list { max-height: 34vh; border-right: 0; border-bottom: 1px solid var(--hg-line); }
  .hg-ticket-layout > main { padding: 14px 12px calc(20px + env(safe-area-inset-bottom)); }
  .hg-ticket-filters { gap: 14px; padding: 0 12px; overflow-x: auto; }
  .hg-review-grid { grid-template-columns: 1fr; }
  .hg-review-workflow > .hg-ticket-steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hg-consultation-stack *,
  .hg-lawyer-layer * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Lawyer recommendations embedded in the primary AI conversation */
.auto-lawyer-recommendation {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid #dce2e6;
  border-radius: 10px;
  background: #fff;
}
.auto-lawyer-recommendation > header { padding: 14px 16px; border-bottom: 1px solid #e1e5e8; background: #f6f8f9; }
.auto-lawyer-recommendation > header > span { display: block; margin-bottom: 5px; color: #68737d; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.auto-lawyer-recommendation > header > strong { display: block; color: #111820; font-size: 16px; }
.auto-lawyer-recommendation > header > p { margin: 6px 0 0; color: #66717b; font-size: 11px; line-height: 1.6; }
.auto-lawyer-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px; }
.auto-lawyer-card { min-width: 0; display: grid; gap: 10px; padding: 14px; border: 1px solid #e0e4e7; border-radius: 8px; background: #fff; }
.auto-lawyer-card-head { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; align-items: center; }
.auto-lawyer-avatar { width: 46px; height: 46px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #e9eef1; color: #31596f; font-size: 13px; font-weight: 800; }
.auto-lawyer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.auto-lawyer-card-head strong,
.auto-lawyer-card-head span { display: block; }
.auto-lawyer-card-head strong { color: #182029; font-size: 12px; }
.auto-lawyer-card-head span { margin-top: 3px; overflow: hidden; color: #6a747d; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.auto-lawyer-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.auto-lawyer-tags > span { padding: 4px 7px; border: 1px solid #dfe3e6; border-radius: 5px; background: #f7f8f9; color: #59626b; font-size: 9px; }
.auto-lawyer-reason > strong { font-size: 10px; }
.auto-lawyer-reason > p { min-height: 45px; margin: 4px 0 0; color: #5f6871; font-size: 10px; line-height: 1.55; }
.auto-lawyer-presence { color: #7a838b; font-size: 10px; }
.auto-lawyer-presence::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #939ba3; }
.auto-lawyer-presence.is-online { color: #16855b; }
.auto-lawyer-presence.is-online::before { background: #20b777; }
.auto-lawyer-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 7px; }
.auto-lawyer-actions .button { min-width: 0; justify-content: center; white-space: nowrap; }

@media (max-width: 1000px) {
  .auto-lawyer-list { grid-template-columns: 1fr; }
  .auto-lawyer-reason > p { min-height: 0; }
}
