/* The answer renderer and voice composer share the same solid surfaces and control states. */
.ask-page {
  --ask-coss-control-radius: var(--coss-control-radius, 8px);
  --ask-coss-card-radius: calc(var(--ask-coss-control-radius) + 4px);
  --ask-coss-surface: var(--card, var(--bg-elev));
  --ask-coss-subtle: var(--muted, var(--glass-bg-soft));
  --ask-coss-fg: var(--foreground, var(--text));
  --ask-coss-muted: var(--muted-foreground, var(--text-2));
  --ask-coss-control-shadow: var(--coss-control-shadow, 0 1px 2px rgba(0, 0, 0, 0.12));
  --ask-coss-panel-shadow: var(--coss-popover-shadow, 0 12px 28px rgba(0, 0, 0, 0.12));
}

body.ask-page .ask-shell {
  --ask-card-bg: var(--ask-coss-surface);
  --ask-card-border: var(--border);
  --ask-muted: var(--ask-coss-muted);
  --ask-top-pt: 8px;
  --ask-top-pb: 8px;
  --ask-pad-x: clamp(16px, 2.5vw, 28px);
}

.ask-page .ask-shell .ask-topbar,
.ask-page .ask-shell .ask-bar {
  background: var(--background, var(--bg));
  border-color: var(--border);
}

.ask-page .ask-shell .ask-topbar-title {
  color: var(--ask-coss-fg);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

.ask-page :is(.ask-topbar, .ask-sheet) .icon-btn {
  border-radius: var(--ask-coss-control-radius);
  color: var(--ask-coss-muted);
}

.ask-page :is(.ask-topbar, .ask-sheet, .ask-bar) :is(.material-symbols-outlined, .ask-role-icon) {
  font-size: 20px;
}

.ask-page .ask-shell .ask-state {
  width: fit-content;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--ask-coss-control-radius);
  background: var(--ask-coss-surface);
  color: var(--ask-coss-muted);
  font-size: 12px;
  line-height: 1.25;
}

.ask-page .ask-shell :is(.ask-hint, .ask-positioning-note) {
  color: var(--ask-coss-muted);
}

.ask-page .ask-shell .ask-hint {
  color: var(--ask-coss-fg);
  font-size: clamp(19px, 2.2vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.28;
}

.ask-page .ask-shell .ask-positioning-note {
  width: min(100%, 480px);
  font-size: 13px;
  text-wrap: pretty;
}

.ask-page .ask-shell .ask-daily-heading {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.ask-page .ask-shell .ask-daily-heading button {
  min-height: 44px;
  padding-inline: 8px;
  border-radius: var(--ask-coss-control-radius);
}

.ask-page .ask-shell .ask-storage-note {
  font-size: 12px;
}

.ask-page .ask-shell .ask-examples > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-inline: 12px;
  font-size: 14px;
  line-height: 1.48;
}

.ask-page .ask-shell .ask-examples > button::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-inline-end: 3px;
  border-block-start: 1.5px solid currentColor;
  border-inline-end: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.65;
}

.ask-page .ask-shell #ask-input-beam {
  padding: 1px;
  border-radius: var(--ask-coss-card-radius);
}

.ask-page .ask-shell #ask-bar-idle #ask-input-beam {
  background: var(--ask-coss-surface);
  box-shadow: inset 0 0 0 1px var(--border), var(--ask-coss-control-shadow);
}

.ask-page .ask-shell #ask-input-beam:focus-within {
  outline: 2px solid var(--ring, var(--text));
  outline-offset: 1px;
}

.ask-page .ask-shell #ask-input {
  border-radius: max(0px, calc(var(--ask-coss-card-radius) - 1px));
  background: transparent;
  color: var(--ask-coss-fg);
  font-size: 16px;
}

.ask-page .ask-shell #ask-input::placeholder {
  color: var(--ask-coss-muted);
}

.ask-page .ask-shell .ask-input-limit {
  color: var(--ask-coss-muted);
  font-variant-numeric: tabular-nums;
}

.ask-page :is(.ask-role-dialog, #ask-role-dialog, #ask-profile-dialog, .ask-onboarding, .ask-sheet, .ask-more-menu, .ask-history-menu) {
  border-color: var(--border);
  border-radius: var(--ask-coss-card-radius);
  background: var(--popover, var(--ask-coss-surface));
  color: var(--ask-coss-fg);
  box-shadow: var(--ask-coss-panel-shadow);
}

.ask-page .ask-role-dialog::backdrop,
.ask-page .ask-sheet-mask {
  background: var(--coss-overlay, rgba(0, 0, 0, 0.55));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.ask-page :is(.ask-role-dialog, .ask-onboarding, .ask-sheet) :is(h2, h3) {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.ask-page .ask-shell .ask-more-menu {
  width: max-content;
  max-width: min(20rem, calc(100vw - 24px));
  padding: 4px;
  transform-origin: top right;
}

.ask-page .ask-shell .ask-more-menu:not([hidden]) {
  animation: ask-coss-menu-enter 140ms ease-out both;
}

@keyframes ask-coss-menu-enter {
  from { opacity: 0; translate: 0 -3px; }
  to { opacity: 1; translate: 0 0; }
}

.ask-page :is(.ask-more-menu, .ask-history-menu) > :is(button, a) {
  border-radius: var(--ask-coss-control-radius);
}

.ask-page :is(.ask-more-menu, .ask-history-menu) > :is(button, a):is(:hover, :focus-visible) {
  background: var(--ask-coss-subtle);
}

.ask-page :is(.ask-role-dialog, #ask-role-dialog) :is(select, textarea),
.ask-page :is(.ask-profile-panel, #ask-profile-dialog) :is(.ask-profile-textarea, .ask-profile-select) {
  border-color: var(--border);
  border-radius: var(--ask-coss-control-radius);
  background: var(--ask-coss-surface);
  color: var(--ask-coss-fg);
}

.ask-page :is(.ask-profile-panel, .ask-profile-summary, .ask-profile-earlier, .ask-profile-original, .ask-profile-clear-confirm) {
  border-color: var(--border);
  border-radius: var(--ask-coss-card-radius);
  background: var(--ask-coss-surface);
}

.ask-page .ask-profile-panel .ask-profile-question {
  color: var(--ask-coss-fg);
  letter-spacing: -0.015em;
}

.ask-page .ask-profile-choices .ask-profile-choice {
  border-radius: var(--ask-coss-control-radius);
  background: var(--ask-coss-surface);
  color: var(--ask-coss-fg);
}

.ask-page .ask-profile-choices .ask-profile-choice:has(input:checked) {
  border-color: var(--ring, var(--text));
  background: var(--ask-coss-subtle);
  box-shadow: inset 0 0 0 1px var(--ring, var(--text));
}

.ask-page .ask-profile-choice input {
  accent-color: var(--primary, var(--text));
}

.ask-page :is(.ask-profile-host, .ask-role-dialog) :is(.ask-profile-error, #ask-role-error):not([hidden]),
.ask-page .ask-shell .ask-err:not([hidden]) {
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--coss-danger, var(--danger));
  border-radius: var(--ask-coss-control-radius);
  background: var(--ask-coss-surface);
  color: var(--ask-coss-fg);
}

.ask-page .ask-shell .ask-examples > button,
.ask-page .ask-answer-hierarchy :is(.ask-layout-controls button, .ask-followup button),
.ask-page :is(.ask-shell .ask-model-limit, .ask-shell .ask-jump-latest, .ask-answer-actions button, .ask-clarification-actions button,
  .ask-history-delete, .ask-history-more, .ask-model-action, .ask-btn.is-ghost, .ask-profile-button:not(.is-primary)),
.ask-page :is(.ask-role-dialog, #ask-role-dialog) button:not([type="submit"]) {
  border: 1px solid var(--border);
  border-radius: var(--ask-coss-control-radius);
  background: var(--ask-coss-surface);
  color: var(--ask-coss-fg);
  box-shadow: var(--ask-coss-control-shadow);
  touch-action: manipulation;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.ask-page :is(.ask-profile-host, #ask-profile-dialog) :is(.ask-profile-button.is-subtle, .ask-profile-header .ask-profile-button, .ask-profile-exit .ask-profile-button) {
  border-color: transparent;
  background: transparent;
  color: var(--ask-coss-muted);
  box-shadow: none;
}

.ask-page .ask-shell .ask-act,
.ask-page .ask-shell .ask-voice-action {
  border-radius: var(--ask-coss-control-radius);
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.ask-page .ask-shell :is(#ask-mic, #ask-send:disabled) {
  border: 1px solid var(--border);
  background: var(--ask-coss-surface);
  color: var(--ask-coss-muted);
}

.ask-page :is(.ask-shell #ask-send:not(:disabled), .ask-shell .ask-voice-action.is-primary, .ask-profile-host .ask-profile-button.is-primary, .ask-btn.is-primary),
.ask-page :is(.ask-role-dialog, #ask-role-dialog) .ask-role-actions button[type="submit"] {
  border: 1px solid transparent;
  border-radius: var(--ask-coss-control-radius);
  background: var(--primary, var(--text));
  color: var(--primary-foreground, var(--bg));
  box-shadow: var(--ask-coss-control-shadow);
  font-weight: 600;
}

.ask-page #ask-profile-clear-confirm {
  color: var(--coss-danger, var(--danger));
}

.ask-page .ask-shell .ask-voice-live {
  border-radius: var(--ask-coss-card-radius);
  background: var(--ask-coss-surface);
}

@media (hover: hover) {
  .ask-page .ask-shell .ask-examples > button:hover,
  .ask-page .ask-answer-hierarchy :is(.ask-layout-controls button, .ask-followup button):hover,
  .ask-page :is(.ask-shell #ask-mic, .ask-shell .ask-model-limit, .ask-shell .ask-jump-latest, .ask-answer-actions button,
    .ask-clarification-actions button, .ask-history-more, .ask-model-action, .ask-btn.is-ghost, .ask-profile-button:not(.is-primary)):hover:not(:disabled),
  .ask-page .ask-profile-choices .ask-profile-choice:hover,
  .ask-page .ask-shell .ask-daily-heading button:hover:not(:disabled),
  .ask-page .ask-role-dialog button:not([type="submit"]):hover,
  .ask-page .ask-answer-rail a:hover {
    background: var(--ask-coss-subtle);
    color: var(--ask-coss-fg);
  }

  .ask-page :is(.ask-shell #ask-send, .ask-shell .ask-voice-action.is-primary, .ask-profile-host .ask-profile-button.is-primary, .ask-btn.is-primary,
    .ask-role-dialog .ask-role-actions button[type="submit"]):hover:not(:disabled) {
    background: var(--coss-primary-hover, var(--primary, var(--text)));
  }
}

.ask-page :is(.ask-shell, .ask-role-dialog, .ask-onboarding, .ask-sheet) :is(button, a, summary, select, textarea):focus-visible {
  outline: 2px solid var(--ring, var(--text));
  outline-offset: 2px;
}

.ask-page .ask-shell #ask-input:focus-visible {
  outline: none;
}

.ask-page .ask-answer-hierarchy {
  --ask-reading-body: clamp(15px, 1.6vw, 16px);
  color: var(--ask-coss-muted);
}

.ask-page .ask-answer-hierarchy .ask-core-judgment {
  padding: clamp(16px, 3vw, 28px);
  border-color: var(--border);
  border-radius: var(--ask-coss-card-radius);
  background: var(--ask-coss-surface);
  box-shadow: var(--ask-coss-control-shadow);
}

.ask-page .ask-answer-hierarchy .ask-core-judgment .ask-summary {
  color: var(--ask-coss-fg);
  font-size: clamp(21px, 2.2vw, 29px);
  font-weight: 600;
  line-height: 1.42;
  letter-spacing: -0.025em;
}

.ask-page .ask-answer-hierarchy .ask-core-judgment .ask-summary.is-long-summary {
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.65;
  letter-spacing: normal;
}

.ask-page .ask-answer-hierarchy :is(.ask-core-eyebrow, .ask-section-eyebrow) {
  letter-spacing: 0.045em;
}

.ask-page .ask-answer-hierarchy .ask-section-title {
  color: var(--ask-coss-fg);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.ask-page .ask-answer-hierarchy .ask-answer-section:not(.ask-core-judgment) {
  padding-block: clamp(21px, 3vw, 30px);
}

.ask-page :is(.ask-user-quote, .ask-candidate-panel, .ask-mobile-answer-toc, .ask-history-item),
.ask-page .ask-answer-hierarchy :is(.ask-grounding-groups, .ask-caveat, .ask-research-source, .ask-diagram-preview),
.ask-page .ask-answer-hierarchy .ask-model-list > .ask-model-card,
.ask-page .ask-answer[data-response-kind="clarification"] {
  border-color: var(--border);
  border-radius: var(--ask-coss-card-radius);
  background: var(--ask-coss-surface);
  box-shadow: none;
}

.ask-page .ask-answer-hierarchy :is(.ask-critical-flags a, .ask-chip),
.ask-page .ask-history-open-label {
  border-radius: var(--ask-coss-control-radius);
}

.ask-page .ask-answer-hierarchy :is(.ask-grounding-details, .ask-model-details, .ask-source-card)[open] > summary,
.ask-page .ask-answer-rail a[aria-current="location"] {
  background: var(--ask-coss-subtle);
  color: var(--ask-coss-fg);
}

.ask-page .ask-answer-hierarchy :is(.ask-grounding-details, .ask-model-details, .ask-source-card) > summary {
  border-radius: var(--ask-coss-control-radius);
  transition: background-color 140ms ease;
}

@media (min-width: 1024px) {
  .ask-page .ask-answer-stage .ask-answer-sidebar {
    padding-inline-end: 10px;
    border-inline-end: 1px solid var(--border);
  }

  .ask-page .ask-answer-stage .ask-user-quote {
    background: transparent;
  }

  .ask-page .ask-answer-stage .ask-user-quote-text {
    font-size: 17px;
    line-height: 1.55;
  }

  .ask-page #ask-preview {
    border-radius: var(--ask-coss-card-radius) 0 0 var(--ask-coss-card-radius);
  }
}

@media (max-width: 440px) {
  .ask-page .ask-shell {
    --ask-bar-pad-x: 12px;
  }

  /* The guide's bilingual hint may wrap. Reserve a second line only while it is shown. */
  .ask-page .ask-shell.has-profile-guide[data-ask-state="idle"] #ask-bar-idle #ask-input:placeholder-shown {
    min-height: 72px;
  }

  .ask-page .ask-shell.has-profile-guide #ask-input::placeholder {
    font-size: 14px;
  }

  .ask-page .ask-mobile-answer-toc ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .ask-page .ask-layout-control-buttons button {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ask-page .ask-shell .ask-more-menu:not([hidden]) {
    animation: none;
  }

  .ask-page :is(.ask-shell, .ask-answer-hierarchy, .ask-role-dialog, .ask-onboarding, .ask-sheet) :is(button, a, summary) {
    transition-duration: 0s;
  }
}
