/* Ask is a bounded application workspace; other dibs pages keep their document layout. */
body.ask-workspace-page { height: var(--ask-viewport-height, 100dvh); min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
body.ask-workspace-page > header, body.ask-workspace-page > nav { flex: 0 0 auto; }
body.ask-workspace-page > footer { display: none; }
body.ask-workspace-page .ask-workspace-shell { flex: 1 1 0; min-height: 0; max-width: none; width: 100%; padding: 0; display: flex; flex-direction: column; }
.ask-workspace { flex: 1 1 0; min-height: 0; width: 100%; display: grid; grid-template-columns: 16rem minmax(0, 1fr); max-width: none; }
.ask-workspace-rail { min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem 1rem; border-right: 1px solid var(--color-line); background: var(--color-sunk, var(--color-page)); }
.ask-rail-heading { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: .5rem; font-size: 1.25rem; }
.ask-history-toggle { min-height: 44px; cursor: pointer; font-size: .8rem; font-weight: 600; color: var(--color-muted); }
.ask-history-content { font-size: .875rem; }
.ask-new-conversation { display: grid; gap: .5rem; margin: .75rem 0 1.25rem; }
.ask-new-conversation button { width: 100%; height: auto; min-height: 44px; padding-block: .5rem; }
.ask-history-content [data-conversation-history] li { gap: .5rem; }
.ask-history-content .ask-limits { margin-top: 1.5rem; }
.ask-tool-links { display: grid; margin-top: 1rem; }
.ask-tool-links a { min-height: 44px; display: flex; align-items: center; color: var(--color-brand); }
.ask-workspace-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ask-workspace-heading { display: flex; align-items: center; gap: .75rem; flex: 0 0 auto; min-height: 56px; padding: .375rem 1.75rem; }
.ask-thread-heading { font-size: 1.2rem; line-height: 1.2; }
.ask-stage { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.ask-reading { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.5rem max(1.5rem, calc((100% - 48rem) / 2)); scroll-padding-block: 1rem; }
.ask-workspace .ask-thread, .ask-workspace #assistant-error, .ask-workspace [data-thinking-target="pending"] { max-width: 48rem; width: 100%; margin-inline: auto; }
.ask-workspace .ask-thread { margin-top: 0; padding-bottom: 1.5rem; }
.ask-workspace .ask-thread:empty { margin: 0; padding: 0; }
.ask-empty-intro { text-align: center; max-width: 42rem; margin: 0 auto 1.5rem; }
.ask-empty-intro h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.18; margin-bottom: .75rem; }
.ask-empty-intro p { font-size: 1rem; }
.ask-workspace[data-has-conversation="false"] .ask-stage { justify-content: safe center; overflow-y: auto; padding-bottom: 8vh; }
.ask-workspace[data-has-conversation="false"] .ask-reading { flex: 0 0 auto; overflow: visible; padding-block: 1rem 0; }
.ask-workspace[data-has-conversation="false"] .ask-new-conversation { display: none; }
.ask-workspace[data-has-conversation="true"] .ask-empty-intro,
.ask-workspace[data-has-conversation="true"] .ask-start { display: none; }
.ask-workspace #assistant-composer { flex: 0 0 auto; width: 100%; max-height: min(65%, 34rem); overflow-y: auto; padding: .5rem max(1.5rem, calc((100% - 48rem) / 2)) max(.5rem, env(safe-area-inset-bottom)); background: var(--color-page); }
.ask-workspace[data-has-conversation="false"] #assistant-composer { max-height: none; overflow: visible; }
.ask-workspace .ask-composer { max-width: 48rem; width: 100%; margin: 0 auto; padding: 0; background: transparent; border: 0; box-shadow: none; }
.ask-composer-surface { border: 1px solid var(--color-line); border-radius: 1.5rem; padding: .75rem 1rem .625rem; background: var(--color-card); box-shadow: 0 4px 20px color-mix(in srgb, var(--color-ink) 4%, transparent); }
.ask-composer-surface:focus-within { border-color: var(--color-brand); }
.ask-workspace .ask-question-field { display: block; min-height: 64px; width: 100%; max-height: 9rem; resize: vertical; border: 0; border-radius: 0; padding: .375rem .125rem; background: transparent; line-height: 1.5; outline: none; box-shadow: none; }
.ask-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .25rem; }
.ask-composer-footer p { max-width: 24rem; }
.ask-composer-footer button { flex: 0 0 auto; min-height: 44px; border-radius: 999px; padding-inline: 1.25rem; }
.ask-workspace .ask-allowance { margin-bottom: .375rem; }
.ask-allowance > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: .35rem; font-size: .8rem; padding: .375rem .25rem; }
.ask-allowance[open] > summary { margin-bottom: .5rem; }
.ask-composer-details > summary { display: flex; align-items: center; justify-content: center; min-height: 44px; cursor: pointer; font-size: .75rem; color: var(--color-muted); }
.ask-composer-details > summary::after { content: "+"; margin-left: .5rem; }
.ask-composer-details[open] > summary::after { content: "-"; }
.ask-composer-details > summary:focus-visible, .ask-workspace button:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 3px; }
.ask-workspace .ask-start { width: 100%; max-width: 48rem; margin: .5rem auto 0; padding-inline: 1.5rem; text-align: center; }
.ask-workspace .ask-starters { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 0; }
.ask-workspace .ask-starter { display: inline-flex; align-items: center; width: auto; min-height: 44px; border: 1px solid var(--color-line); border-radius: 999px; padding: .5rem 1rem; background: transparent; font-size: .875rem; text-align: center; box-shadow: none; }
.ask-workspace .ask-starter span { margin: 0; font-size: inherit; }
.ask-history-open, .ask-history-close, .ask-history-backdrop { display: none; }
.ask-workspace[data-embedded="true"] { display: block; }
.ask-workspace[data-embedded="true"] .ask-workspace-rail,
.ask-workspace[data-embedded="true"] .ask-workspace-heading,
.ask-workspace[data-embedded="true"] .ask-empty-intro,
.ask-workspace[data-embedded="true"] .ask-start { display: none; }
.ask-workspace[data-embedded="true"] .ask-reading { flex: none; overflow: visible; padding: 0; }
.ask-workspace[data-embedded="true"] #assistant-composer { max-height: none; padding: 0; overflow: visible; }
@media (max-width: 899px) {
  .ask-workspace { grid-template-columns: minmax(0, 1fr); }
  .ask-workspace-heading { min-height: 52px; padding: .25rem 1rem; gap: .75rem; }
  .ask-history-open, .ask-history-close { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: .5rem .75rem; border-radius: .5rem; color: var(--color-brand); font-size: .875rem; }
  .ask-workspace-rail { position: fixed; z-index: 61; top: 0; bottom: 0; left: 0; width: min(20rem, calc(100vw - 3rem)); max-height: var(--ask-viewport-height, 100dvh); visibility: hidden; transform: translateX(-100%); background: var(--color-page); box-shadow: 8px 0 30px #0002; }
  .ask-workspace[data-history-open="true"] .ask-workspace-rail { visibility: visible; transform: none; }
  .ask-history-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 60; background: #0006; border: 0; }
  .ask-reading { padding: 1rem; }
  .ask-workspace #assistant-composer { padding-inline: .75rem; }
  .ask-workspace[data-has-conversation="false"] .ask-stage { padding-bottom: 4vh; }
  .ask-empty-intro { padding-inline: .5rem; margin-bottom: 1rem; }
  .ask-empty-intro p { font-size: .9375rem; }
  .ask-composer-surface { padding: .625rem .875rem; border-radius: 1.25rem; }
  .ask-composer-footer p { font-size: .75rem; }
  .ask-workspace .ask-start { padding-inline: .75rem; }
  .ask-workspace .ask-starter { padding-inline: .75rem; }
}
@media (max-height: 600px) {
  .ask-workspace[data-has-conversation="false"] .ask-stage { justify-content: flex-start; padding-bottom: 0; }
  .ask-workspace[data-has-conversation="true"] #assistant-composer { max-height: 60%; }
  .ask-workspace .ask-question-field { min-height: 48px; max-height: 5rem; }
}
@media (prefers-reduced-motion: no-preference) { .ask-workspace-rail { transition: transform .16s ease; } }

.ask-shell-flash { flex: 0 0 auto; max-height: 25dvh; overflow-y: auto; }
.ask-shell-notices { flex: 0 0 auto; max-height: 25dvh; overflow-y: auto; }
.ask-shell-notices > * { margin: .5rem 1rem; }
.ask-footer-links { display: flex; flex-wrap: wrap; column-gap: 1rem; margin-top: 1.5rem; font-size: .8rem; }
.ask-footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-brand); text-decoration: underline; }
@media (max-width: 899px) {
  .ask-workspace[data-has-conversation="false"] .ask-stage { padding-bottom: 0; }
  .ask-workspace[data-has-conversation="false"] .ask-reading { flex: 1 1 auto; min-height: 8rem; display: flex; flex-direction: column; justify-content: center; }
  .ask-workspace[data-has-conversation="false"] .ask-start { order: 1; margin-bottom: .375rem; }
  .ask-workspace[data-has-conversation="false"] #assistant-composer { order: 2; }
}

.ask-workspace .ask-start { border-top: 0; padding-top: .25rem; }
.ask-workspace .ask-starter span { text-transform: none; letter-spacing: normal; color: var(--color-body); }
.ask-workspace [data-thinking-target="starterStatus"]:empty { display: none; }
.ask-history-content .ask-limits > summary { font-family: inherit; font-size: .875rem; font-weight: 600; }

/* Respect enlarged text without letting the compact header push Menu off-screen. */
body.ask-workspace-page > header > div > .ml-auto { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }

/* With enlarged text and little vertical room, document flow preserves every control. */
body.ask-workspace-page.ask-height-constrained { height: auto; min-height: 100dvh; overflow: auto; }
body.ask-height-constrained .ask-workspace-shell, body.ask-height-constrained .ask-stage { flex: none; }
body.ask-height-constrained .ask-reading { flex: none; max-height: 50dvh; min-height: 8rem; }
body.ask-height-constrained .ask-workspace #assistant-composer { max-height: none; overflow: visible; }
body.ask-height-constrained .ask-workspace[data-has-conversation="false"] .ask-stage { justify-content: flex-start; }

/* A single app bar on phones and tablets; desktop retains its site navigation. */
.ask-mobile-menu { display: none; }
@media (max-width: 899px) {
  body.ask-workspace-page > header { display: none; }
  .ask-workspace-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; padding-inline: 12px; border-bottom: 1px solid var(--color-line); background: var(--color-card); }
  .ask-history-open { justify-self: start; width: 44px; padding: 8px; }
  .ask-thread-heading { text-align: center; max-width: max(3.5ch, calc(100vw - 12rem)); }
  .ask-mobile-menu { display: block; justify-self: end; min-width: 0; }
  .ask-mobile-menu > details > summary { padding-inline: 8px; gap: 6px; }
  .ask-mobile-menu > details > summary > span { display: none; }
  .ask-mobile-menu > details > summary > span.sm\:hidden { display: inline; }
}

/* Enlarged text reflows inside the workspace instead of widening its scroller. */
.ask-empty-intro { min-width: 0; width: 100%; overflow-wrap: anywhere; }
.ask-composer-footer { flex-wrap: wrap; }
.ask-composer-footer p { flex: 1 1 10ch; }
.ask-composer-footer button { margin-left: auto; }
@media (max-width: 899px) {
  .ask-workspace[data-has-conversation="false"] .ask-reading { flex-shrink: 0; padding-inline: 12px; }
  .ask-empty-intro { padding-inline: 0; }
}
