:root {
    color-scheme: light dark;
    --app-max-width: 980px;
    --footer-height: 54px;
    --composer-height: 220px;
    --composer-gap: 8px;
    --desktop-layout: 0;
    --accent: #1f6fff;
    --accent-strong: #195be8;
    --footer-bg: rgba(61, 71, 89, 0.74);
    --panel-bg: rgba(255, 255, 255, 0.97);
    --text-color: #1e293b;
    --border-soft: rgba(50, 79, 126, 0.2);

    --depth0-b: hsl(215 18% 96.5%);
    --depth0-c: hsl(215 16% 94.5%);

    --color1-a: hsl(205 66% 94%);
    --color1-b: hsl(205 64% 92%);
    --color1-c: hsl(205 58% 90%);

    --color2-a: hsl(152 44% 94%);
    --color2-b: hsl(152 42% 92%);
    --color2-c: hsl(152 36% 90%);

    --color3-a: hsl(350 62% 94%);
    --color3-b: hsl(350 60% 92%);
    --color3-c: hsl(350 54% 90%);
    --page-bg: #f4f7fc;
    --surface: white;
    --grid-major: rgba(38, 79, 146, 0.05);
    --grid-minor: rgba(38, 79, 146, 0.028);
    --muted-text: #526078;
    --secondary-text: #33415c;
    --input-text: #1f2a37;
    --link-text: #1f6fff;
    --link-hover: #1857c7;
    --selected-text: #0f4fcf;
    --highlight-text: #0a6fd8;
    --upgrade-text: #8063a2;
    --upgrade-hover: #695087;
    --success-text: #17803d;
    --success-bg: #ecfdf3;
    --error-text: #c62828;
    --error-bg: #fff1f1;
    --warning-text: #a86400;
    --warning-detail: #794600;
    --result-bg: rgba(250, 250, 220, 0.92);
    --numeric-bg: rgba(250, 250, 235, 0.92);
    --chip-bg: rgba(255, 255, 255, 0.86);
    --table-bg: rgba(255, 255, 255, 0.92);
    --table-head-bg: rgba(241, 246, 255, 0.86);
    --table-border: rgba(33, 51, 82, 0.32);
}

/* astra6: le système choisit la palette, indépendamment de la taille de l’écran. */
@media (prefers-color-scheme: dark) {
    :root {
        --footer-bg: rgba(18, 26, 39, 0.94);
        --panel-bg: #182231;
        --text-color: #e7edf7;
        --border-soft: rgba(165, 190, 225, 0.28);
        --table-border: #60738e;
        --depth0-b: #283342;
        --depth0-c: #323f50;
        --color1-a: #223a50;
        --color1-b: #29465e;
        --color1-c: #31516c;
        --color2-a: #203e35;
        --color2-b: #294b40;
        --color2-c: #325749;
        --color3-a: #442e3b;
        --color3-b: #513745;
        --color3-c: #5c404e;
        --page-bg: #101722;
        --surface: #1c2736;
        --grid-major: rgba(150, 180, 225, 0.045);
        --grid-minor: rgba(150, 180, 225, 0.025);
        --muted-text: #b6c4d8;
        --secondary-text: #d4deed;
        --input-text: #e7edf7;
        --link-text: #8bb9ff;
        --link-hover: #bad5ff;
        --selected-text: #a8caff;
        --highlight-text: #8bb9ff;
        --upgrade-text: #c9abea;
        --upgrade-hover: #e0c5fc;
        --success-text: #85dfaa;
        --success-bg: #17372a;
        --error-text: #ffaaaa;
        --error-bg: #42252c;
        --warning-text: #ffc578;
        --warning-detail: #ffd395;
        --result-bg: #353422;
        --numeric-bg: #2c2e24;
        --chip-bg: #1c2736;
        --table-bg: #1c2736;
        --table-head-bg: #26354a;
    }
}

body.wide-layout {
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    color: var(--text-color);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--page-bg);
    background-image:
        linear-gradient(var(--grid-major) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
        linear-gradient(var(--grid-minor) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
    background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
    background-repeat: repeat;
    overflow-y: auto;
}

#app {
    min-height: 100dvh;
    padding: 12px 8px;
}

#messages {
    max-width: var(--app-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
#messages article[data-empty="true"] {
    display: none;
}
.server-back-line {
    white-space: pre-wrap;
    word-break: break-word;
}

body.wide-layout #messages {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: auto;
}

body.started #messages {
    padding-bottom: calc(var(--composer-height) + var(--footer-height) + 34px);
}

.message {
    width: fit-content;
    max-width: 100%;
    border-radius: 16px;
    padding: 14px 16px;
    line-height: 1.45;
    border: 1px solid var(--border-soft);
    box-shadow: 0 12px 30px rgba(30, 53, 92, 0.14);
}

.message.user {
    padding: 8px 12px;
    border-radius: 12px;
    overflow-wrap: anywhere;
    margin-left: auto;
    background: linear-gradient(140deg, #1f6fff 0%, #4164ff 52%, #4a5dff 100%);
    color: #ffffff;
    box-shadow: 0 16px 34px rgba(34, 84, 209, 0.28);
}

.message.assistant {
    margin-right: auto;
    max-width: 100%;
    background: var(--panel-bg);
    color: var(--text-color);
    overflow-x: auto;
}

.feedback {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border-soft);
    font-size: 13px;
    color: var(--muted-text);
}

.feedbackForm {
    flex: 1 1 400px;
    min-width: 0;
}

.moreChip {
    flex: none;
    min-height: 40px;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--link-text);
    background: rgba(31, 111, 255, 0.08);
    cursor: pointer;
}

.moreChip:hover {
    color: var(--link-hover);
}

.upgradeChip {
    color: var(--upgrade-text);
    background: rgba(128, 99, 162, 0.07);
}

.upgradeChip:hover {
    color: var(--upgrade-hover);
}

.feedbackControls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.feedbackControls button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    height: 40px;
    padding: 0;
    border: 1px solid currentColor;
    border-radius: 50%;
    cursor: pointer;
}

.feedbackControls svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
}

.feedbackControls svg .eye {
    fill: currentColor;
    stroke: none;
}

.feedbackControls .feedbackHappy {
    color: var(--success-text);
    background: var(--success-bg);
}

.feedbackControls .feedbackUnhappy {
    color: var(--error-text);
    background: var(--error-bg);
}

.feedbackControls button:disabled {
    opacity: 0.5;
    cursor: default;
}

.feedbackReason {
    flex: 0 1 40ch;
    min-width: 0;
    width: 40ch;
    height: 40px;
    padding: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    font: inherit;
    color: var(--text-color);
    background: var(--surface);
}

.feedbackReason[aria-invalid="true"] {
    border-color: var(--error-text);
    outline-color: var(--error-text);
    box-shadow: 0 0 0 1px var(--error-text);
}

.feedbackReason[aria-invalid="false"] {
    border-color: var(--success-text);
    outline-color: var(--success-text);
    box-shadow: 0 0 0 1px var(--success-text);
}

.feedbackStatus:not(:empty) {
    flex-basis: 100%;
}

body.wide-layout .message.assistant {
    width: 100%;
    max-width: 100%;
}

.line {
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 16px;
    line-height: 1.52;
}

.line + .line {
    margin-top: 4px;
}

.line.d0.indent, .line.res, .line.num {
    display: table;
    width: 100%;
}

.line.question {
    background: transparent;
    padding: 2px 0;
    font-size: 16px;
    line-height: 1.4;
}

.line.d0 {
    padding: 8px 0;
    background: transparent;
}

.line.d1 {
    margin-left: 14px;
    font-size: 15px;
}

.line.d2 {
    margin-left: 24px;
    font-size: 14px;
}

.line.d3 {
    margin-left: 34px;
    font-size: 13px;
}

.line.d1, .line.d2, .line.d3 {
    padding: 8px;
    padding-left: 5px;
    background-color: var(--fill);
}

.line.indent:not(.smallinfo):not(.biginfo), .line.res, .line.num {
    padding-left: 20px;
}

.line.d0.indent {
    --fill: var(--depth0-b);
    padding-right: 8px;
    background-color: var(--fill);
}

.line.d0.indent.alt {
    --fill: var(--depth0-c);
}

.line.color1 {
    --fill: var(--color1-a);
}

.line.color2 {
    --fill: var(--color2-a);
}

.line.color3 {
    --fill: var(--color3-a);
}

.line.color1.indent {
    --fill: var(--color1-b);
}

.line.color1.indent.alt {
    --fill: var(--color1-c);
}

.line.color2.indent {
    --fill: var(--color2-b);
}

.line.color2.indent.alt {
    --fill: var(--color2-c);
}

.line.color3.indent {
    --fill: var(--color3-b);
}

.line.color3.indent.alt {
    --fill: var(--color3-c);
}

.line.b1 {
    margin-left: 14px;
}

.line.b2 {
    margin-left: 24px;
}

.line.b3 {
    margin-left: 34px;
}

.line.j {
    height: 18px;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.line.res, .line.num {
    padding-top: 8px;
    padding-bottom: 8px;
}

.line.res {
    background: var(--result-bg);
    font-size: 16px;
    font-weight: 700;
}

.line.num {
    background: var(--numeric-bg);
    font-size: 16px;
}

.numitem {
    margin-left: 10px;
    font-style: italic;
    font-weight: 700;
}

.stepnumber {
    font-weight: 700;
}

.line.ask {
    margin-top: 10px;
    padding: 6px 12px;
    background: transparent;
    border-left: 4px solid #1f6fff;
    border-radius: 0;
    font-size: 17px;
    font-style: italic;
    color: var(--secondary-text);
}

.asklabel {
    margin-right: 8px;
    font-style: normal;
    font-weight: 700;
    color: var(--link-text);
}

.line.smallinfo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 2px 0 4px 12px;
    background: var(--fill, transparent);
}

.subicon {
    flex: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1f6fff;
    color: #fff;
    font: 700 10px/16px Georgia, serif;
    text-align: center;
}

.subbubble {
    display: inline-block;
    background: var(--fill, rgba(31, 111, 255, 0.1));
    border: 1px solid rgba(31, 111, 255, 0.28);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 13px;
    line-height: 1.3;
    color: var(--secondary-text);
    white-space: nowrap;
}

.subbubble math, .subbubble m {
    font-size: 1em;
}

.subbubble:has(mfrac) {
    font-size: 14px;
    padding: 5px 11px;
}

.line.smallinfo:is(.b1, .b2, .b3) .subbubble {
    background: var(--surface);
}

.line.biginfo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 16px;
    background: var(--fill, rgba(31, 111, 255, 0.08));
    border: 1px solid rgba(31, 111, 255, 0.25);
    color: var(--secondary-text);
}

.line.biginfo:is(.b1, .b2, .b3) {
    --fill: var(--surface);
}

.line.biginfo.warn {
    background: var(--fill, rgba(216, 128, 0, 0.08));
    border-color: rgba(216, 128, 0, 0.25);
    color: var(--warning-detail);
}

.line.biginfo.warn .keyicon, .infoicon.warning .keyicon {
    background: #d88000;
}

.infoicon.warning .infocount {
    color: var(--warning-text);
}

.keyinfo {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.keytext {
    flex: 1;
}

.line.smallinfo .subicon {
    margin-left: auto;
}

.keyicon {
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 3px;
    border-radius: 50%;
    background: #1f6fff;
    color: #fff;
    font: 700 14px/22px Georgia, serif;
    text-align: center;
}

.subicon, .keyicon, .infoicon {
    cursor: pointer;
}

.infoicons {
    display: flex;
    flex: none;
    gap: 8px;
}

.infoicon {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.infoicon[hidden], .line.folded {
    display: none;
}

.infoicon .keyicon {
    margin-top: 0;
}

.infocount {
    font-size: 12px;
    font-weight: 700;
    color: var(--link-text);
}

math {
    math-style: normal;
    font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", "Noto Sans Math", math;
}

.line math, .line m {
    font-size: 1.1em;
    line-height: 1.2;
}

.line.d0:not(.indent) math, .line.d0:not(.indent) m,
.line.biginfo math, .line.biginfo m {
    background-color: var(--fill, var(--depth0-b));
    border-radius: 6px;
    padding: 2px 6px;
}

/* fable5: une somme découpée en plusieurs boîtes math est enveloppée dans .expr : un flex en ligne, dont la hauteur
   épouse la plus haute boîte, fractions comprises, et dont les boîtes passent à la ligne, pour un seul fond et un
   seul cadre au lieu d'un par boîte suivant la hauteur de chaque terme ; sur un écran étroit, l'expression peut
   commencer entièrement sous la phrase */
.expr {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    max-width: 100%;
}

.line.d0:not(.indent) .expr {
    background-color: var(--depth0-b);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 1.1em;
    line-height: 1.2;
}

.line.d0:not(.indent) .expr math, .line.d0:not(.indent) .expr m {
    background: none;
    border-radius: 0;
    padding: 2px 0;
    font-size: 1em;
}

.line.res math, .line.res m {
    font-size: 1.2em;
}

.line.res math:last-of-type {
    border: 2px solid var(--text-color);
    border-radius: 8px;
    padding: 7px 14px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* fable5: le cadre du résultat entoure l'expression entière quand elle est découpée en plusieurs boîtes */
.line.res .expr {
    border: 2px solid var(--text-color);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 1.2em;
    line-height: 1.2;
}

.line.res .expr math, .line.res .expr math:last-of-type {
    border: none;
    padding: 2px 0;
    font-size: 1em;
}

/* astra6: une conclusion encadre sa phrase entière, jamais le dernier nombre cité pour la démentir. */
.line.res > b, .line.res > .stepContent > b {
    display: inline-block;
    border: 2px solid var(--text-color);
    border-radius: 8px;
    padding: 7px 14px;
}

.line.res > b math, .line.res > b math:last-of-type, .line.res > b .expr,
.line.res > .stepContent > b math, .line.res > .stepContent > b .expr {
    border: none;
    padding: 2px 0;
}

.line math:has(+ math), .line math + math {
    margin: 4px 0;
}

.numitem math, .numitem m {
    font-size: 1.1em;
    line-height: 1.2;
}

math:has(> mn.long) {
    display: inline;
}

math:has(> mn.long) > * {
    display: inline math;
}

math:has(> mn.long) > mo {
    display: inline;
    white-space: pre;
}

math:has(> mn.long) > mn.long {
    display: inline;
    word-break: break-all;
}

.line.d0.numbered {
    background: var(--surface) !important;
    box-shadow: none !important;
}

.c {
    color: var(--highlight-text);
    font-weight: 700;
}

.warn {
    color: var(--warning-text);
}

.error {
    color: var(--error-text);
    font-weight: 700;
}

#composerShell {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 10px);
    background: transparent;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 18px 42px rgba(32, 55, 98, 0.2);
    backdrop-filter: blur(7px);
}

#heroLogoShell {
    position: fixed;
    left: 50%;
    width: min(280px, 47vw);
    top: calc(50% - (var(--composer-height) / 2) - 14px);
    transform: translate(-50%, -100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
    pointer-events: none;
    transition: top 220ms ease, left 220ms ease, transform 220ms ease;
}

#heroLogo {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 9px 20px rgba(32, 55, 98, 0.2));
    transition: width 220ms ease;
}

body.started #composerShell {
    top: auto;
    bottom: calc(var(--footer-height) + var(--composer-gap));
    transform: translateX(-50%);
}

body.started #heroLogoShell {
    display: none;
}

#composerForm {
    margin: 0;
}

.composerField {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 4px;
}

.composerField:focus-within {
    border-color: rgba(31, 111, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(31, 111, 255, 0.22);
}

#query {
    width: 100%;
    min-height: 62px;
    display: block;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--input-text);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.35;
    padding: 8px 10px;
    resize: none;
    overflow-y: auto;
    outline: none;
}

#submitButton {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(145deg, var(--accent), #3d7bff);
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    flex: 0 0 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 12px rgba(31, 111, 255, 0.25);
}

#submitButton:hover {
    background: linear-gradient(145deg, var(--accent-strong), #2e68ff);
}

.composerToolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    align-items: center;
    padding: 0 4px 4px;
}

.composerActions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.composerControl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    padding: 8px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    color: var(--input-text);
    background: transparent;
    text-decoration: none;
}

.composerControl:hover {
    background: rgba(31, 111, 255, 0.07);
}

.composerControl[aria-current="true"] {
    background: rgba(31, 111, 255, 0.16);
    color: var(--selected-text);
    font-weight: 700;
}

#cleanButton {
    width: 44px;
    flex-shrink: 0;
    background: rgba(31, 111, 255, 0.08);
}

#cleanButton:hover {
    background: rgba(31, 111, 255, 0.14);
}

#stretchButton[aria-pressed="true"] {
    background: rgba(31, 111, 255, 0.16);
    color: var(--selected-text);
}

#stretchButton {
    width: 44px;
    font-size: 20px;
}

.composerControl svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.line.examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 2px 0 4px;
    background: transparent;
}

.examplesLabel {
    font-size: 13px;
    color: var(--secondary-text);
}

.exampleChip {
    max-width: 100%;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: 4px 9px;
    font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    line-height: 1.3;
    color: var(--input-text);
    background: var(--chip-bg);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exampleChip:hover {
    border-color: rgba(31, 111, 255, 0.62);
    background: rgba(31, 111, 255, 0.12);
    color: var(--selected-text);
}

body.wide-layout #composerShell {
    left: 5px;
    right: 5px;
    width: auto;
    max-width: none;
    transform: translateY(-50%);
}

body.wide-layout.started #composerShell {
    transform: none;
}

#footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 30px;
    background: var(--footer-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.24);
    color: #f1f5fd;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px 4px;
    flex-wrap: wrap;
    text-align: center;
    padding: 4px;
    font-size: 12px;
    line-height: 18px;
}

#footer a {
    color: #a9d3ff;
    text-decoration: none;
    font-weight: 800;
}

#footer a:hover {
    text-decoration: underline;
}


.plain {
    font-weight: 400;
}

.signtable {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    margin: 4px 0;
    border: 1px solid var(--table-border);
    background: var(--table-bg);
    color: var(--text-color);
    font-size: 0.85em;
}

.signtable.datatable {
    table-layout: auto;
    width: auto;
    min-width: 100%;
    max-width: none;
}

.line:has(> .signtable.datatable) {
    overflow-x: auto;
}

.signtable th, .signtable td {
    border: 1px solid var(--table-border);
    padding: 8px 7px;
    margin: 0;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.signtable thead td {
    font-weight: 700;
    background: var(--table-head-bg);
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.25;
    font-size: 0.92em;
    padding: 7px 6px;
}

.signtable thead td math, .signtable thead td m {
    font-size: 0.95em;
}

.signtable tbody tr:last-child td:first-child {
    font-weight: 800;
}

.signtable math, .signtable m {
    font-size: 1em;
    line-height: 1.12;
}

.calm {
    text-align: center;
}

.line img.calm {
    display: block;
    max-width: 320px;
    margin: 6px auto;
    border-radius: 12px;
}

.line.bullet {
    padding-left: 1.6em;
}

.line.bullet + .line.head::before,
.line.examples + .line.head::before {
    content: "";
    display: block;
    width: 50%;
    margin: 22px auto 10px;
    border-top: 1px solid var(--border-soft);
}

/* sol6: le PNG conserve son rapport carré et tient dans la réponse, même sur mobile. */
.line.graph img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* astra6: le mobile est la base ; le mode bureau exige aussi assez de hauteur. */
#cleanButton span, #stretchButton, #footerBuiltWithStar, #footerBuiltWith {
    display: none;
}

#messages img[src="/images/think1.gif"] {
    width: 75px;
    height: 75px;
}

.line.res math:has(> mn.long) {
    display: block;
    max-width: 100%;
    line-height: 1.5;
    box-decoration-break: slice;
    -webkit-box-decoration-break: slice;
}

.infoicon, .infoClose {
    min-width: 36px;
    min-height: 36px;
    padding: 4px;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.infoClose {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    margin-left: auto;
}

.infoClose .keyicon {
    margin: 0;
}

.infoicon:focus-visible, .infoClose:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 8px;
}

@media (max-height: 500px) {
    #heroLogoShell {
        display: none;
    }
    #query {
        min-height: 40px;
        padding-block: 6px;
    }
}

@media (min-width: 901px) and (min-height: 501px) {
    :root {
        --desktop-layout: 1;
        --composer-gap: 14px;
    }
    #app {
        padding: 24px 14px;
    }
    .message {
        max-width: min(860px, 100%);
    }
    .message.user {
        padding: 14px 16px;
        border-radius: 16px;
    }
    .line, .line.res {
        font-size: 18px;
    }
    .line.question {
        padding: 6px 0;
        font-size: 17px;
        line-height: 1.52;
    }
    .line.d1 {
        font-size: 17px;
    }
    .line.d2 {
        font-size: 16px;
    }
    .line.d3 {
        font-size: 15px;
    }
    .line.d1, .line.b1 {
        margin-left: 40px;
    }
    .line.d2, .line.b2 {
        margin-left: 80px;
    }
    .line.d3, .line.b3 {
        margin-left: 120px;
    }
    .line.num {
        font-size: 17px;
    }
    .line.biginfo {
        font-size: 16px;
    }
    #composerShell {
        width: min(var(--app-max-width), calc(100% - 20px));
        border-radius: 18px;
        padding: 12px;
    }
    body.wide-layout #composerShell {
        left: 14px;
        right: 14px;
        width: auto;
    }
    #heroLogoShell {
        width: min(430px, 72vw);
    }
    #query {
        min-height: 88px;
        line-height: 1.45;
        padding: 12px 14px;
    }
    #submitButton {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 14px;
        font-size: 24px;
    }
    #cleanButton {
        width: auto;
    }
    #cleanButton span, #footerBuiltWithStar, #footerBuiltWith {
        display: inline;
    }
    #stretchButton {
        display: inline-flex;
    }
    .exampleChip {
        font-size: 12px;
        padding: 5px 11px;
    }
    #footer {
        min-height: 54px;
        padding: 8px 12px;
        font-size: 15px;
        line-height: normal;
        gap: 8px;
    }
    #messages img[src="/images/think1.gif"] {
        width: 150px;
        height: 150px;
    }
}

/* astra6: la formule et les informations partagent le même centre vertical. */
.line:has(> .infoicons), .line.d0.indent:has(> .infoicons) {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stepContent {
    flex: 1;
    min-width: 0;
}

.infoicon {
    position: relative;
    min-height: 28px;
    padding-block: 0;
}

/* astra6: garde 36 px de cible tactile sans agrandir la ligne de calcul. */
.infoicon::before {
    content: "";
    position: absolute;
    inset: -4px 0;
}

/* astra6: sur mobile, chaque réponse rend la place aux étapes ; le crayon rouvre la saisie. */
body.composer-closed #composerShell {
    display: none;
}

.replyActions {
    display: flex;
    margin-top: 12px;
}

.writeButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--accent), #3d7bff);
    color: white;
    box-shadow: 0 5px 12px rgba(31, 111, 255, 0.25);
    cursor: pointer;
}

.writeButton:hover {
    background: linear-gradient(145deg, var(--accent-strong), #2e68ff);
}

.writeButton:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 3px;
}

.writeButton svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (min-width: 901px) and (min-height: 501px) {
    body.composer-closed #composerShell {
        display: block;
    }

    .writeButton, .replyActions {
        display: none;
    }
}

#query::placeholder, .feedbackReason::placeholder {
    color: var(--muted-text);
    opacity: 1;
}
