.ask-view {
  --ask-ink: #1e293b;
  --ask-muted: #52657c;
  --ask-line: #e0ebf5;
  --ask-blue: #075985;
  --ask-surface: #fff;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  color: var(--ask-ink);
  background:
    linear-gradient(180deg, transparent, var(--ask-surface) calc(144px + env(safe-area-inset-top, 0px))),
    linear-gradient(90deg, #e1e7fc, #e0f3fc);
  user-select: text;
}

.ask-view.hidden, .ask-view [hidden] { display: none !important; }
.ask-view :focus-visible { outline: 2px solid var(--ask-blue); outline-offset: 2px; }
.ask-view button { cursor: pointer; }
.ask-view svg { width: 20px; height: 20px; flex: none; }

.ask-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ask-workspace {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.ask-rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: none;
}

.ask-toolbar {
  display: grid;
  grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr);
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 56px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 10px 6px;
}

.ask-toolbar h1 {
  position: relative;
  text-align: center;
  font-size: 1.125rem;
  line-height: 1.3;
  font-weight: 700;
}

.ask-toolbar h1::after {
  position: absolute;
  inset-block-start: calc(100% + 5px);
  inset-inline: 0;
  width: 28px;
  height: 3px;
  margin-inline: auto;
  border-radius: 999px;
  background: #39b4cc;
  content: "";
}

.ask-rail h2 { font-size: 19px; line-height: 1.35; font-weight: 800; }

.ask-toolbar-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  justify-self: start;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #25496b;
}

.ask-toolbar-button:last-child { justify-self: end; }
.ask-toolbar-button:hover { background: rgb(255 255 255 / 74%); }

.ask-icon-button, .ask-new, .ask-report {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 5px 10px;
  border-radius: 12px;
  border: 1px solid var(--ask-line);
  background: var(--ask-surface);
  color: var(--ask-blue);
  font-size: 13px;
  font-weight: 690;
}

.ask-icon-button { width: 44px; justify-content: center; }
.ask-icon-button svg { width: 18px; height: 18px; }
.ask-icon-button:hover, .ask-new:hover, .ask-report:hover { background: #eef8ff; }

.ask-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  padding: 12px 14px 16px;
}

.ask-intro {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1px 0 4px;
}

.ask-mascot {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 15px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  box-shadow: 0 3px 8px rgb(37 99 235 / 19%);
}

.ask-mascot svg { width: 34px; height: 34px; }
.ask-intro-copy { min-width: 0; }
.ask-intro h2 { font-size: 17px; line-height: 1.35; font-weight: 800; }
.ask-intro p { margin-top: 4px; color: var(--ask-muted); font-size: 12px; line-height: 1.5; }
.ask-topics-heading { margin: 12px 0 7px; color: var(--ask-muted); font-size: 12px; font-weight: 740; }

.ask-topics { display: grid; gap: 7px; }
.ask-topic {
  width: 100%;
  min-height: 47px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 5px 10px;
  border-radius: 14px;
  border: 1px solid var(--ask-line);
  background: #f7f9fc;
  text-align: left;
  box-shadow: 0 2px 4px rgb(30 64 175 / 3%);
}

.ask-topic:hover { background: #edf8ff; border-color: #bfddf9; }
.ask-topic-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background: #e3f3fe;
  color: var(--ask-blue);
}

.ask-topic-icon svg { width: 17px; height: 17px; }
.ask-topic[data-topic="transition"] .ask-topic-icon { background: #fff0cd; color: #865300; }
.ask-topic[data-topic="salary"] .ask-topic-icon { background: #eee9ff; color: #4f37a1; }
.ask-topic[data-topic="communication"] .ask-topic-icon { background: #ffe7ee; color: #9f2958; }
.ask-topic[data-topic="growth"] .ask-topic-icon { background: #dcf4ee; color: #14634f; }
.ask-topic-copy { min-width: 0; }
.ask-topic-copy strong, .ask-topic-copy small { display: block; overflow-wrap: anywhere; }
.ask-topic-copy strong { color: var(--ask-ink); font-size: 14px; line-height: 1.3; font-weight: 730; }
.ask-topic-copy small { margin-top: 2px; color: var(--ask-muted); font-size: 11px; line-height: 1.35; }
.ask-topic > .ask-end-icon { width: 14px; height: 14px; color: #73869f; }

.ask-turn + .ask-turn { margin-top: 16px; }
.ask-question {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 9px auto;
  padding: 9px 12px;
  border-radius: 15px 15px 5px 15px;
  background: #d9f1ff;
  color: #134c70;
}

.ask-question p, .ask-answer :is(p, h3, h4) { margin: 0; overflow-wrap: anywhere; }
.ask-question p { white-space: pre-wrap; font-size: 14px; line-height: 1.55; }
.ask-answer {
  padding: 12px;
  border: 1px solid var(--ask-line);
  border-radius: 16px 16px 16px 5px;
  background: var(--ask-surface);
  font-size: 14px;
  line-height: 1.62;
}

.ask-answer-source {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  color: var(--ask-blue);
  font-size: 12px;
  font-weight: 740;
}

.ask-answer-source svg { width: 15px; height: 15px; }
.ask-answer h3 { margin-bottom: 5px; font-size: 17px; line-height: 1.42; font-weight: 780; }
.ask-answer .ask-identification {
  margin-top: 9px;
  padding: 6px 8px;
  border-left: 2px solid #9e9cea;
  border-radius: 0 6px 6px 0;
  background: #f2f0ff;
  color: #423e72;
  font-size: 12px;
}

.ask-answer h4 { margin-top: 12px; font-size: 14px; font-weight: 750; }
.ask-step-list { margin: 4px 0 0; padding: 0; list-style: none; counter-reset: ask-steps; }
.ask-step-list li {
  position: relative;
  padding: 7px 0 7px 25px;
  border-bottom: 1px solid var(--ask-line);
  counter-increment: ask-steps;
}

.ask-step-list li::before {
  content: counter(ask-steps);
  position: absolute;
  top: 9px;
  left: 0;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e1f1fe;
  color: var(--ask-blue);
  font-size: 11px;
  font-weight: 720;
}

.ask-step-list strong { display: block; color: #234a74; font-weight: 730; }
.ask-answer .ask-next-question { margin-top: 11px; color: #234a74; font-weight: 670; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.ask-chip {
  min-height: 44px;
  padding: 5px 9px;
  border: 1px solid #c8e0f3;
  border-radius: 999px;
  color: var(--ask-blue);
  background: #eef8ff;
  text-align: left;
  font-size: 12px;
  font-weight: 670;
}

.ask-chip:hover { background: #dcefff; }

.ask-composer {
  flex: none;
  padding: 6px 14px max(9px, var(--ask-composer-safe, env(safe-area-inset-bottom, 0px)));
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.ask-input-box {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 5px;
  border: 1px solid #dbe7f2;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 5px 18px rgb(15 42 72 / 9%);
}

.ask-input-box:focus-within {
  border-color: #548eb7;
  box-shadow: 0 0 0 2px #e3f1fc, 0 5px 18px rgb(15 42 72 / 8%);
}

.ask-input-box textarea {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  max-height: min(116px, calc(var(--ask-viewport-height, 100dvh) * .3));
  padding: 10px 7px 10px 9px;
  border: 0;
  background: transparent;
  color: var(--ask-ink);
  caret-color: var(--ask-blue);
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  resize: none;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  user-select: text;
}

.ask-input-box textarea:focus { outline: none; }
.ask-input-box textarea::placeholder { color: #66788e; }
.ask-send {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: #106f90;
  color: #fff;
}

.ask-send:hover:not(:disabled) { background: #0c607e; }
.ask-send:disabled { color: #5c7489; background: #edf4fa; cursor: default; }
.ask-send svg { width: 20px; height: 20px; }
.ask-note, .ask-alert { margin: 6px 0 0; color: var(--ask-muted); font-size: 11px; line-height: 1.42; }
.ask-note { text-align: center; }
.ask-alert { color: #9f2347; }
.ask-alert:empty { margin: 0; height: 0; }

.ask-rail {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 14px;
  background: linear-gradient(180deg, #e8f5ff, #f7f8fd 48%);
}

.ask-view.is-history-open .ask-rail { display: flex; }
.ask-new, .ask-report { margin-top: 8px; justify-content: flex-start; }
.ask-new svg, .ask-report svg { width: 17px; height: 17px; }
.ask-report svg:last-child { margin-left: auto; }
.ask-history { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 14px 0; }
.ask-history h3 { margin-bottom: 5px; color: var(--ask-muted); font-size: 13px; font-weight: 720; }
.ask-subtle { margin: 7px 0; color: var(--ask-muted); font-size: 13px; }
.ask-history ul { margin: 0; padding: 0; list-style: none; }
.ask-history li + li { margin-top: 6px; }
.ask-history-item {
  display: grid;
  gap: 2px;
  min-height: 44px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--ask-line);
  border-radius: 10px;
  background: var(--ask-surface);
  text-align: left;
}

.ask-history-item:hover, .ask-history-item[aria-current="true"] { background: #eaf6ff; border-color: #bcdaf1; }
.ask-history-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ask-history-item span { color: var(--ask-muted); font-size: 11px; }

@media (max-width: 350px) {
  .ask-scroll, .ask-composer { padding-inline: 10px; }
}
