/* Shared document renderer: the same controls adapt to each answer and viewport. */
.ask-document { margin-top: 24px; }
.ask-basis { display: inline-flex; align-items: center; padding: 4px 10px; margin: 0 0 12px; border: 1px solid #dedcf5; border-radius: 20px; background: #f5f2ff; color: #5e4b92; font-size: 11px; font-weight: 650; line-height: 1.4; }
.ask-basis-estimate { background: #fff8e8; border-color: #eddaad; color: #795512; }
.ask-ui-section > h3:has(+ .ask-basis) { margin-bottom: 10px; }
.ask-related-pages { margin-top: 20px; }
.ask-rich-hero { padding: 28px 30px; margin-bottom: 24px; background: linear-gradient(115deg, #edf6ff, #f7f7ff); }
.ask-rich-hero .ask-answer-intro { margin: 0; max-width: 960px; font-size: 20px !important; line-height: 1.55 !important; }
.ask-assumptions { margin-top: 16px; font-size: 13px; color: #526484; }
.ask-assumptions summary { cursor: pointer; font-weight: 600; }
.ask-assumptions ul { padding-left: 20px; margin: 10px 0 0; }
.ask-assumptions li + li { margin-top: 7px; }

/* Keep document order. Only adjacent small supporting controls share a row. */
.ask-rich-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ask-section-wide { grid-column: 1 / -1; }
.ask-ui-section { min-width: 0; padding: 24px; background: #fff; border: 1px solid #d4e1f7; border-radius: 16px; overflow-wrap: anywhere; }
.ask-ui-section > h3 { font-size: 22px; margin-bottom: 18px; }
.ask-ui-section > p { margin-top: 0; }
.ask-ui-section > .ask-source-links { margin-bottom: 18px; }
.ask-ui-items { display: flex; flex-direction: column; gap: 20px; }
.ask-ui-item { position: relative; display: flex; align-items: flex-start; gap: 18px; min-width: 0; }
.ask-ui-item-content { min-width: 0; flex: 1; }
.ask-ui-item h4 { line-height: 1.4; }
.ask-ui-item p { margin: 8px 0 0; color: #425578; font-size: 15px; line-height: 1.65; }
.ask-ui-image { width: 112px; height: 100px; object-fit: cover; border-radius: 12px; }
.ask-ui-card_group { border: 0; padding: 0; background: none; }
.ask-ui-card_group .ask-ui-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ask-ui-card_group .ask-ui-item { flex-direction: column; border: 1px solid #d4e1f7; border-radius: 16px; padding: 24px; background: #fff; }
.ask-ui-card_group .ask-ui-image { width: 100%; height: 180px; }
.ask-ui-card_group .ask-ui-item-content { display: flex; flex-direction: column; width: 100%; flex: 1; }
.ask-ui-card_group .ask-ui-item-content > .ask-source-links { margin-top: auto; padding-top: 18px; }
.ask-ui-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ask-ui-actions .ask-button { font-size: 13px; padding: 9px 14px; min-height: 44px; }
.ask-key-value { display: block; font-size: 30px; color: #153c72; line-height: 1.2; margin-top: 8px; overflow-wrap: anywhere; }
.ask-step-number, .ask-check { flex: 0 0 34px; height: 34px; background: #e8f1ff; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #0759f7; }
.ask-check { background: #eaf8ee; color: #267345; }
.ask-ui-timeline .ask-ui-item + .ask-ui-item, .ask-ui-steps .ask-ui-item + .ask-ui-item { border-top: 1px solid #e3eafb; padding-top: 20px; }
.ask-tone-caution:is(.ask-ui-callout, .ask-ui-status) { background: #fff8e8; border-color: #f1dfaf; }
.ask-tone-positive:is(.ask-ui-callout, .ask-ui-status) { background: #edf9f1; border-color: #cde7d7; }
.ask-tone-info:is(.ask-ui-callout, .ask-ui-status) { background: #f0f7ff; }
.ask-ui-status .ask-key-value { font-size: 40px; }

/* Named source links sit with the claims they support, rather than numeric footnotes. */
.ask-source-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), min(380px, 100%))); gap: 10px; margin-top: 14px; }
.ask-page .ask-inline-source { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 11px 13px; min-height: 66px; background: #f7faff; border: 1px solid #dce7fb; border-radius: 11px; color: #17254d; text-decoration: none; transition: border-color .15s, background .15s; }
.ask-page .ask-inline-source:hover { text-decoration: none; border-color: #83acff; background: #edf4ff; }
.ask-inline-source > img { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.ask-source-icon { display: grid; place-items: center; width: 40px; height: 44px; border-radius: 9px; color: #0759f7; background: #e8f1ff; flex-shrink: 0; }
.ask-source-icon svg { width: 24px; height: 24px; }
.ask-inline-source-copy { display: grid; gap: 3px; min-width: 0; }
.ask-inline-source-copy small { color: #62769b; font-size: 10px; line-height: 1.3; }
.ask-inline-source-copy strong { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.ask-inline-source-copy > span { color: #62769b; font-size: 11px; line-height: 1.4; }
.ask-source-arrow { color: #0759f7; font-size: 20px; margin-left: auto; flex-shrink: 0; }
.ask-rich-hero .ask-inline-source { background: #ffffffc9; }

.ask-comparison { overflow-x: auto; }
.ask-comparison table { width: 100%; border-collapse: collapse; font-size: 15px; table-layout: fixed; }
.ask-comparison th, .ask-comparison td { text-align: left; padding: 16px; vertical-align: top; overflow-wrap: anywhere; }
.ask-comparison thead { background: #edf4ff; }
.ask-comparison thead th:first-child { width: 21%; }
.ask-ui-table .ask-comparison thead th:first-child { width: 42%; }
.ask-comparison tbody th { color: #17254d; font-size: 14px; }
.ask-comparison tbody td { color: #425578; line-height: 1.6; }
.ask-comparison tbody + tbody { border-top: 1px solid #dfe8f8; }
.ask-comparison .ask-comparison-sources td { padding-top: 0; }
.ask-comparison-sources .ask-source-links { margin-top: 0; }
.ask-helper-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ask-helper-form label { display: grid; align-content: start; gap: 7px; font-size: 14px; font-weight: 700; }
.ask-helper-form input, .ask-helper-form select { min-width: 0; width: 100%; border: 1px solid #b8cbed; border-radius: 9px; padding: 12px; background: #fff; color: #153052; font: inherit; box-sizing: border-box; }
.ask-helper-form .ask-help, .ask-helper-form [data-ask-progress] { grid-column: 1 / -1; margin: 0; }
.ask-helper-form .ask-button { justify-self: start; }
.ask-about-inline { font-size: 12px; color: #5c6e8e; margin: 16px 0; }
.ask-about-inline summary { cursor: pointer; }
.ask-document .ask-source-details { margin-top: 18px; }
.ask-document .ask-source-details > summary::after { content: "+"; float: right; color: #0759f7; }
.ask-document .ask-source-details[open] > summary::after { content: "−"; }
.ask-document .ask-answer-tools { margin-top: 22px; }
.ask-classic .ask-rich-hero { background: #fff; }
.ask-classic .ask-rich-layout { grid-template-columns: minmax(0, 1fr); }

@media (max-width: 760px) {
    .ask-rich-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .ask-rich-hero { padding: 21px; }
    .ask-rich-hero .ask-answer-intro { font-size: 17px !important; }
    .ask-ui-section { padding: 18px; }
    .ask-ui-section > h3 { font-size: 20px; }
    .ask-ui-card_group { padding: 0; }
    .ask-ui-card_group .ask-ui-items { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .ask-ui-card_group .ask-ui-item { padding: 18px; }
    .ask-ui-card_group .ask-ui-image { height: 155px; }
    .ask-ui-image { width: 70px; height: 70px; }
    .ask-ui-item { gap: 12px; }
    .ask-ui-item p { font-size: 14px; }
    .ask-step-number, .ask-check { flex-basis: 28px; height: 28px; font-size: 14px; }
    .ask-source-links { grid-template-columns: minmax(0, 1fr); }
    .ask-inline-source > img { width: 40px; height: 40px; }
    .ask-page .ask-inline-source { padding: 10px; gap: 10px; }
    .ask-inline-source-copy strong { font-size: 12px; }
    .ask-source-icon { width: 30px; height: 36px; }
    .ask-source-icon svg { width: 22px; height: 22px; }
    .ask-source-arrow { font-size: 18px; }
    .ask-key-value { font-size: 26px; }
    .ask-comparison table, .ask-comparison tbody, .ask-comparison tr, .ask-comparison th, .ask-comparison td { display: block; width: auto; }
    .ask-comparison thead { display: none; }
    .ask-comparison tbody { padding: 14px 0 0; }
    .ask-comparison tbody th { background: #edf4ff; border-radius: 7px; padding: 11px 12px; }
    .ask-comparison td { padding: 12px; font-size: 14px; }
    .ask-comparison td[data-label]::before { content: attr(data-label); display: block; font-weight: 700; color: #17254d; margin-bottom: 4px; }
    .ask-comparison .ask-comparison-sources td { padding: 0 0 14px; }
    .ask-helper-form { grid-template-columns: minmax(0, 1fr); }
    .ask-helper-form input, .ask-helper-form select { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .ask-page .ask-inline-source { transition: none; }
}
