:root {
    color-scheme: light dark;
    --app-max-width: 980px;
    --footer-height: 54px;
    --header-height: 48px;
    --composer-width: calc(100% - 10px);
    --composer-height: 220px;
    --composer-gap: 8px;
    --desktop-layout: 0;
    --accent: #1f6fff;
    --accent-strong: #195be8;
    --footer-bg: #244f7c;
    --bar-glow: #3473b5;
    --bar-shadow: rgba(20, 50, 90, 0.25);
    --heading-color: #315f91;
    --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% 97%);
    --color1-b: hsl(205 64% 95%);
    --color1-c: hsl(205 58% 93%);

    --color2-a: hsl(152 44% 97%);
    --color2-b: hsl(152 42% 95%);
    --color2-c: hsl(152 36% 93%);

    --color3-a: hsl(350 62% 97%);
    --color3-b: hsl(350 60% 95%);
    --color3-c: hsl(350 54% 93%);
    --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);
}

@media (prefers-color-scheme: dark) {
    :root {
        --footer-bg: #163653;
        --bar-glow: #24578a;
        --bar-shadow: rgba(0, 0, 0, 0.4);
        --heading-color: #9bc5ef;
        --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: #27425b;
        --color1-b: #2e4e69;
        --color1-c: #365977;
        --color2-a: #25483e;
        --color2-b: #2f5549;
        --color2-c: #386051;
        --color3-a: #4d3443;
        --color3-b: #5a3d4d;
        --color3-c: #654656;
        --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;
    --composer-width: calc(100% - 10px);
}

* {
    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: calc(var(--header-height) + 12px) 8px 12px;
}

body:not(.started) #app {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    padding: calc(var(--header-height) + 20px) 0 calc(var(--footer-height) + 20px);
}

body:not(.started) #messages {
    display: none;
}

#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);
}

.feedbackLabel, .feedback:not(.reasonOpen) .feedbackReason {
    display: none;
}

.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"], .contactForm textarea[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"], .contactForm textarea[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%;
}

@media (max-width: 900px), (max-height: 500px) {
    .feedback {
        gap: 8px 6px;
    }
    .feedbackForm, .feedbackControls {
        display: contents;
    }
    .feedback > .moreChip {
        flex: 1 1 0;
        min-width: 0;
        margin-inline: 12px;
        padding: 8px;
        font-size: 12px;
    }
    .feedbackReason {
        flex: 1 1 100%;
        width: 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 {
    margin: 0;
    background: transparent;
    font-weight: normal;
    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) {
    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 {
    width: calc(100% + 16px);
    margin-inline: -8px;
    padding: 8px 6px 8px 17px;
}

.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;
}

.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, .line.res > .stepContent > math:last-of-type {
    border: 2px solid var(--text-color);
    border-radius: 8px;
    padding: 7px 10px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.line.res > .expr, .line.res > .stepContent > .expr {
    border: 2px solid var(--text-color);
    border-radius: 8px;
    padding: 7px 10px;
    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;
}

.line.res > b, .line.res > .stepContent > b {
    display: inline-block;
    border: 2px solid var(--text-color);
    border-radius: 8px;
    padding: 7px 10px;
}

.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: relative;
    margin: 0 auto;
    width: var(--composer-width);
    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 {
    width: min(230px, 52vw);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

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

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

body.started #heroLogoShell, body.started #homeBenefits {
    display: none;
}

#homeBenefits {
    display: grid;
    align-items: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: var(--composer-width);
    margin: 0 auto;
}

.benefitCard {
    border: 1px solid rgba(31, 111, 255, 0.95);
    border-radius: 14px;
    background: var(--panel-bg);
    box-shadow: 0 5px 16px rgba(30, 53, 92, 0.04);
}

.benefitCard summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 52px;
    padding: 14px 12px;
    list-style: none;
    cursor: pointer;
}

.benefitCard summary::-webkit-details-marker {
    display: none;
}

.benefitCard summary::after {
    content: "";
    flex: 0 0 7px;
    height: 7px;
    border-right: 2px solid var(--muted-text);
    border-bottom: 2px solid var(--muted-text);
    transform: rotate(45deg);
}

.benefitCard[open] summary::after {
    transform: rotate(225deg);
}

.benefitCard summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    border-radius: 14px;
}

.benefitCard h2 {
    margin: 0;
    color: var(--heading-color);
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: -0.4px;
}

.benefitCard ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0 12px 16px;
    list-style: none;
}

.benefitCard li {
    position: relative;
    padding-left: 17px;
    color: var(--secondary-text);
    font-size: 13px;
    line-height: 1.45;
}

.benefitCard li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-text);
    font-weight: 700;
}

@media (max-width: 360px) {
    #homeBenefits {
        grid-template-columns: 1fr;
    }
}

#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);
}

#cleanButton {
    background: rgba(31, 111, 255, 0.16);
    color: var(--selected-text);
    width: auto;
    flex-shrink: 0;
}

#stretchButton: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;
    background: rgba(31, 111, 255, 0.08);
}

.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);
}

#footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 30px;
    background: linear-gradient(100deg, var(--footer-bg), var(--bar-glow) 50%, var(--footer-bg));
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 -2px 8px var(--bar-shadow);
    color: #f1f5fd;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0 4px;
    flex-wrap: wrap;
    text-align: center;
    padding: 2px 4px;
    font-size: 12px;
    line-height: 14px;
}

.footerCredit {
    display: none;
    align-items: center;
    gap: inherit;
    white-space: nowrap;
}

#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;
    font-size: 15.5px;
    line-height: 1.2;
}

.line.bullet:has(.exampleChip) {
    line-height: 1.5;
}

.line.bullet .exampleChip {
    vertical-align: middle;
    padding: 2px 8px;
}

.chipItem {
    white-space: nowrap;
}

.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);
}

.line.graph img {
    display: block;
    max-width: 100%;
    height: auto;
}

#stretchButton {
    display: none;
}

#messages .waiting-image {
    width: 75px;
    height: 75px;
}

.waiting-icons {
    font-size: 20px;
    letter-spacing: 0.2em;
}

.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) {
    .feedbackLabel, .feedback:not(.reasonOpen) .feedbackReason {
        display: inline;
    }
    :root {
        --desktop-layout: 1;
        --footer-height: 46px;
        --header-height: 54px;
        --composer-width: min(var(--app-max-width), calc(100% - 20px));
        --composer-gap: 14px;
    }
    #app {
        padding: calc(var(--header-height) + 24px) 14px 24px;
    }
    .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 {
        border-radius: 18px;
        padding: 12px;
    }
    body.wide-layout {
        --composer-width: calc(100% - 28px);
    }
    #heroLogoShell {
        width: min(340px, 34dvh);
    }
    #homeBenefits {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
    }
    .benefitCard {
        padding: 20px 16px;
    }
    .benefitCard summary {
        min-height: 0;
        padding: 0;
        cursor: default;
    }
    .benefitCard summary::after {
        display: none;
    }
    .benefitCard ul {
        margin-top: 14px;
        padding: 0;
    }
    .benefitCard h2 {
        font-size: 24px;
    }
    .benefitCard li {
        font-size: 14px;
    }
    #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;
    }
    #stretchButton {
        display: inline-flex;
    }
    .exampleChip {
        font-size: 12px;
        padding: 5px 11px;
    }
    #footer {
        min-height: 46px;
        padding: 4px 12px;
        font-size: 15px;
        line-height: normal;
        gap: 8px;
    }
    .footerCredit {
        display: inline-flex;
    }
    #messages .waiting-image {
        width: 150px;
        height: 150px;
    }
}

.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;
}

.infoicon::before {
    content: "";
    position: absolute;
    inset: -4px 0;
}

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;
}

#header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    background: linear-gradient(100deg, var(--footer-bg), var(--bar-glow) 50%, var(--footer-bg));
    color: #f1f5fd;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px var(--bar-shadow);
}

.headerInner {
    position: relative;
    width: var(--composer-width);
    min-height: calc(var(--header-height) - 1px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.headerBrand {
    color: inherit;
    text-decoration: none;
    min-height: 44px;
    padding: 0 8px;
    border-radius: 10px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.headerName {
    display: block;
    font-size: 22px;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.4px;
}

#headerLogo {
    display: flex;
    height: calc(var(--header-height) - 4px);
    align-items: center;
}

#headerLogo img {
    display: block;
    width: auto;
    height: 100%;
    object-fit: contain;
}

body:not(.started):has(#heroLogoShell) #headerLogo {
    display: none;
}

.languageCode {
    display: none;
}

@media (max-width: 600px) {
    .headerBrand {
        gap: 6px;
    }
    .headerName {
        font-size: 16px;
    }
    #headerLogo {
        height: 28px;
    }
    .languageName {
        display: none;
    }
    .languageCode {
        display: inline;
    }
}

.headerMenu {
    position: relative;
}

.headerMenu summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    border-radius: 10px;
    list-style: none;
    cursor: pointer;
    font-size: 14px;
}

.headerMenu summary::-webkit-details-marker {
    display: none;
}

.headerMenu svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.headerMenu .dropdownArrow {
    width: 18px;
    height: 18px;
}

.headerMenu[open] summary, .headerMenu summary:hover, .headerBrand[href]:hover {
    background: rgba(255, 255, 255, 0.12);
}

.headerMenu summary:focus-visible, .headerDropdown a:focus-visible, .headerBrand:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

.headerDropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    max-width: calc(100vw - 10px);
    max-height: calc(100dvh - var(--header-height) - 12px);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-color);
    box-shadow: 0 12px 30px rgba(30, 53, 92, 0.2);
}

#languageMenu .headerDropdown {
    left: auto;
    right: 0;
}

.headerDropdown a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 7px;
    color: inherit;
    font-size: 14px;
    text-decoration: none;
}

.headerDropdown a:hover, .headerDropdown a[aria-current="true"] {
    background: rgba(31, 111, 255, 0.16);
    color: var(--selected-text);
}

@media (min-width: 901px) and (min-height: 501px) {
    .headerMenu summary, .headerDropdown a {
        font-size: 16px;
    }
}

body:has(.page) #headerLogo {
    display: flex;
}

.page {
    max-width: 760px;
    min-height: 100dvh;
    margin: 0 auto;
    padding: calc(var(--header-height) + 16px) 16px calc(var(--footer-height) + 24px);
    line-height: 1.5;
}

.page h1, .page h2 {
    color: var(--heading-color);
}

.page h1 {
    margin: 8px 0 20px;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.4px;
    text-align: center;
}

.release {
    margin-bottom: 14px;
    scroll-margin-top: calc(var(--header-height) + 12px);
    padding: 12px 16px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--panel-bg);
}

.release h2 {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 600;
}

.release ul {
    margin: 0;
    padding-inline-start: 20px;
}

.release li {
    margin: 4px 0;
    overflow-wrap: break-word;
}

.release code {
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--depth0-c);
    white-space: nowrap;
    font-size: 0.92em;
    direction: ltr;
    unicode-bidi: isolate;
}

.story {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 18px 16px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--panel-bg);
}

.story img {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    border-radius: 16px;
    object-fit: cover;
}

.story .avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
}

.story div {
    flex: 1;
    min-width: 0;
}

.story h2 {
    margin: 0 0 8px;
    font-size: 21px;
    font-weight: 600;
}

.story p {
    margin: 0 0 10px;
}

.story ul {
    margin: 0 0 10px;
    padding-inline-start: 20px;
}

.story li {
    margin: 4px 0;
}

.story a {
    color: var(--link-text);
}

.contactForm {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 16px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--panel-bg);
}

.contactForm label {
    color: var(--muted-text);
    font-size: 14px;
    font-weight: 600;
}

.contactForm select, .contactForm textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface);
    color: var(--input-text);
    font: inherit;
    font-size: 16px;
}

.contactForm select {
    min-height: 44px;
    margin-bottom: 8px;
}

.contactForm textarea {
    min-height: 220px;
    resize: vertical;
}

.contactForm button {
    align-self: center;
    min-width: 160px;
    min-height: 44px;
    margin-top: 8px;
    padding: 10px 24px;
    border: 0;
    border-radius: 22px;
    background: var(--accent);
    color: white;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.contactForm button:hover {
    background: var(--accent-strong);
}

.contactForm button:disabled {
    opacity: 0.6;
    cursor: default;
}

.contactStatus {
    min-height: 1.5em;
    margin: 0;
    text-align: center;
}

.contactStatus.sent {
    color: var(--success-text);
}

.contactStatus.failed {
    color: var(--error-text);
}

.page.wide {
    max-width: 1120px;
}

.pageIntro {
    margin: 0 0 20px;
    color: var(--secondary-text);
    font-size: 19px;
    text-align: center;
}

.pageIntro p {
    margin: 4px 0;
}

.pageIntro ul {
    display: inline-block;
    margin: 4px 0 0;
    padding-inline-start: 1.2em;
    text-align: start;
}

.pageIntro li {
    margin: 4px 0;
}

.pageIntro .introLead {
    color: var(--text-color);
    font-size: 23px;
    font-weight: 600;
}

.cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.helpGuide {
    grid-column: 1 / -1;
}

.helpGuide h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 6px;
    font-size: 18px;
}

.helpGuide .infoicon, .helpGuide .keyicon {
    cursor: default;
}

.card {
    scroll-margin-top: calc(var(--header-height) + 12px);
    padding: 16px;
    border: 1px solid rgba(31, 111, 255, 0.95);
    border-radius: 14px;
    background: var(--panel-bg);
    box-shadow: 0 5px 16px rgba(30, 53, 92, 0.04);
}

.card h2 {
    margin: 0;
    font-size: 21px;
    letter-spacing: -0.4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.catIcon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 13%, transparent);
    color: var(--heading-color);
    font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", "Times New Roman", serif;
    font-size: 19px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1;
}

.card p {
    margin: 0 0 12px;
}

.card .cardDesc {
    margin: 2px 0 12px;
    color: var(--secondary-text);
    font-size: 14px;
}

.card code {
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--depth0-c);
    font-size: 0.92em;
    white-space: nowrap;
}

.cardChips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card .exampleChip {
    display: inline-block;
    padding: 6px 11px;
    font-size: 13px;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
    direction: ltr;
}

.cardExamples {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.cardExamples li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.cardExamples .result {
    color: var(--secondary-text);
    font-size: 14px;
}

.cardMore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--link-text);
    font-weight: 600;
    text-decoration: none;
}

.cardChips + .cardMore {
    margin-top: 14px;
}

.cardArrow {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: 15px;
    line-height: 1;
}

.cardMore:is(:hover, :focus-visible) .cardArrow {
    background: var(--link-text);
    border-color: var(--link-text);
    color: var(--surface);
}

@media (min-width: 901px) and (min-height: 501px) {
    .page h1 {
        font-size: 32px;
    }
    .release {
        padding: 16px 22px;
    }
    .story {
        flex-direction: row;
        align-items: flex-start;
        gap: 28px;
        padding: 24px 28px;
    }
    .story:first-of-type img {
        order: 1;
    }
    .story img {
        width: 220px;
        height: 220px;
    }
    .story .avatar {
        width: 145px;
        height: 145px;
    }
    .pageIntro {
        font-size: 22px;
    }
    .pageIntro .introLead {
        font-size: 28px;
    }
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    .card {
        padding: 20px 22px;
    }
}
