@font-face {
    font-family: "Averia Serif Libre";
    font-style: normal;
    font-weight: 400;
    src: url("../fonts/averia-serif-libre-v9-latin-regular.woff2")
        format("woff2");
}

@font-face {
    font-family: "Averia Serif Libre";
    font-style: normal;
    font-weight: 700;
    src: url("../fonts/averia-serif-libre-v9-latin-700.woff2") format("woff2");
}

:root {
    --page-bg: oklch(91.519% 0.0433 87.96 / 100%);
    --bg-image: url("../images/bg.png");
    --bg-opacity: 1;
    --bg-filter: none;
    --topbar-bg: oklch(100% 0 0 / 86%);
    --topbar-border: oklch(75.054% 0.1791 58.28 / 100%);
    --topbar-shadow: oklch(0% 0 0 / 16%);
    --control-bg: oklch(100% 0 0 / 85%);
    --control-text: oklch(17.764% 0 0 / 100%);
    --control-dropdown-bg: oklch(100% 0 0 / 100%);
    --control-dropdown-bg-hover: oklch(90% 0 0 / 100%);
    --button-text: oklch(20.97% 0.0349 58.95 / 100%);
    --button-bg: linear-gradient(
        to bottom,
        oklch(100% 0 0 / 100%) 5%,
        oklch(85.821% 0.1686 87.5 / 100%) 100%
    );
    --button-bg-hover: linear-gradient(
        to top,
        oklch(100% 0 0 / 100%) 5%,
        oklch(85.821% 0.1686 87.5 / 100%) 100%
    );
    --input-bg: oklch(100% 0 0 / 90%);
    --input-text: oklch(23.956% 0.0216 107.92 / 100%);
    --input-border: oklch(55.944% 0.1562 42.5 / 65%);
    --focus-outline: oklch(80.235% 0.1646 71.62 / 35%);
    --panel-bg: oklch(100% 0 0 / 62%);
    --panel-border: oklch(80.235% 0.1646 71.62 / 100%);
    --text: oklch(25.466% 0.0745 135.06 / 88%);
    --muted-text: oklch(50.52% 0.026 107.29 / 100%);
    --accent: oklch(55.944% 0.1562 42.5 / 100%);
    --accent-strong: oklch(43.8% 0.129 38.95 / 100%);
    --starter-bg: oklch(100% 0 0 / 48%);
    --starter-hover-bg: oklch(100% 0 0 / 72%);
    --starter-border: oklch(55.944% 0.1562 42.5 / 38%);
    --user-bubble-bg: oklch(97.876% 0.0297 92.31 / 86%);
    --user-bubble-border: oklch(55.944% 0.1562 42.5 / 72%);
    --oracle-bubble-bg: oklch(100% 0 0 / 68%);
    --sticker-bg: oklch(100% 0 0 / 68%);
    --image-border: oklch(55.944% 0.1562 42.5 / 55%);
    --scrollbar-thumb: oklch(62% 0.13 55 / 58%);
    --scrollbar-thumb-hover: oklch(54% 0.15 45 / 76%);
    --scrollbar-track: oklch(100% 0 0 / 22%);
    --feedback-bg: oklch(96% 0 0 / 72%);
    --feedback-border: oklch(55% 0 0 / 38%);
    --feedback-text: oklch(28% 0 0 / 96%);
    --feedback-input-bg: oklch(100% 0 0 / 74%);
    --feedback-input-border: oklch(48% 0 0 / 52%);
    --feedback-input-text: oklch(22% 0 0 / 100%);
    --feedback-muted: oklch(42% 0 0 / 88%);
    --feedback-error: oklch(45% 0.18 28 / 100%);
    --feedback-checkbox-bg: oklch(100% 0 0 / 88%);
    --feedback-checkbox-border: oklch(48% 0 0 / 62%);
    --feedback-checkbox-checked-bg: oklch(54% 0.16 294 / 100%);
    --feedback-checkbox-checked-border: oklch(66% 0.18 294 / 100%);
    --feedback-checkbox-check: oklch(100% 0 0 / 100%);
}

body.i18n-loading .topbar-actions,
body.i18n-loading .subline,
body.i18n-loading .oracle-form,
body.i18n-loading .feedback-section,
body.i18n-loading .modal-panel {
    visibility: hidden;
}

html[data-theme="dark"] {
    --page-bg: oklch(19.561% 0.0394 249.77 / 100%);
    --bg-image: url("../images/bg.png");
    --bg-opacity: 1;
    --bg-filter: invert(1) saturate(1.25) brightness(0.55) contrast(1.5);
    --topbar-bg: oklch(20% 0.00005 271.152 / 80%);
    --topbar-border: oklch(50% 0.1 242.36 / 72%);
    --topbar-shadow: oklch(18.063% 0.053 251.33 / 35%);
    --control-bg: oklch(18% 0.12 264.05 / 100%);
    --control-text: oklch(80% 0.0495 250.67 / 100%);
    --control-dropdown-bg: oklch(15% 0.05 278.14 / 100%);
    --control-dropdown-bg-hover: oklch(40% 0 0 / 100%);
    --button-text: oklch(80% 0.0495 250.67 / 100%);
    --button-bg: linear-gradient(
        to top,
        oklch(20% 0.119 242.36 / 92%) 5%,
        oklch(65% 0.0962 237.58 / 82%) 100%
    );
    --button-bg-hover: linear-gradient(
        to bottom,
        oklch(20% 0.119 242.36 / 92%) 5%,
        oklch(65% 0.0962 237.58 / 82%) 100%
    );
    --input-bg: oklch(15% 0.00005 271.152 / 40%);
    --input-text: oklch(70% 0.1 71.62 / 100%);
    --input-border: oklch(65.147% 0.124 243.31 / 62%);
    --focus-outline: oklch(75.058% 0.1268 240.07 / 34%);
    --panel-bg: oklch(20% 0.00005 271.152 / 50%);
    --panel-border: oklch(50% 0.1 242.36 / 72%);
    --text: oklch(80% 0.0495 250.67 / 100%);
    --muted-text: oklch(80% 0.0495 250.67 / 75%);
    --accent: oklch(51.415% 0.1215 245.7 / 100%);
    --accent-strong: oklch(35.926% 0.0981 251.18 / 100%);
    --starter-bg: oklch(20% 0.00005 271.152 / 50%);
    --starter-hover-bg: oklch(15% 0.00005 271.152 / 50%);
    --starter-border: oklch(67.154% 0.1243 241.72 / 50%);
    --user-bubble-bg: oklch(20% 0.00005 271.152 / 50%);
    --user-bubble-text: oklch(70% 0.1 71.62 / 100%);
    --user-bubble-border: oklch(65% 0.1 242.36 / 72%);
    --oracle-bubble-bg: oklch(20% 0.00005 271.152 / 50%);
    --sticker-bg: oklch(100% 0 0 / 56%);
    --image-border: oklch(71.181% 0.1308 241.63 / 58%);
    --scrollbar-thumb: oklch(62% 0.1 242 / 58%);
    --scrollbar-thumb-hover: oklch(74% 0.11 240 / 78%);
    --scrollbar-track: oklch(15% 0.04 260 / 28%);
    --feedback-bg: oklch(18% 0 0 / 64%);
    --feedback-border: oklch(68% 0 0 / 34%);
    --feedback-text: oklch(84% 0 0 / 96%);
    --feedback-input-bg: oklch(12% 0 0 / 52%);
    --feedback-input-border: oklch(70% 0 0 / 38%);
    --feedback-input-text: oklch(86% 0 0 / 100%);
    --feedback-muted: oklch(78% 0 0 / 78%);
    --feedback-error: oklch(78% 0.16 28 / 100%);
    --feedback-checkbox-bg: oklch(24% 0 0 / 78%);
    --feedback-checkbox-border: oklch(78% 0 0 / 44%);
    --feedback-checkbox-checked-bg: oklch(58% 0.16 294 / 100%);
    --feedback-checkbox-checked-border: oklch(72% 0.17 294 / 100%);
    --feedback-checkbox-check: oklch(100% 0 0 / 100%);
}

* {
    box-sizing: border-box;
}

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

body {
    background: oklch(0% 0 0 / 0%);
    color: var(--text);
    display: flex;
    flex-direction: column;
    font-family: "Averia Serif Libre", Georgia, serif;
    font-size: clamp(18px, 1.2vw + 14px, 20px);
    line-height: 1.45;
    min-height: 100vh;
    padding-top: 64px;
    position: relative;
    text-align: center;
    z-index: 0;
}

body::before {
    background-image: var(--bg-image);
    background-position: left top;
    bottom: 0;
    content: "";
    filter: var(--bg-filter);
    left: 0;
    opacity: var(--bg-opacity);
    pointer-events: none;
    position: fixed;
    right: 0;
    top: 0;
    z-index: -1;
    transition: all 0.5s;
}

html {
    background: var(--page-bg);
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    scrollbar-width: thin;
}

* {
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    scrollbar-width: thin;
}

*::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    background-clip: padding-box;
    border: 3px solid oklch(0% 0 0 / 0%);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
    background-clip: padding-box;
    border: 2px solid oklch(0% 0 0 / 0%);
}

body.auth-body {
    padding-top: 0;
}

.topbar {
    align-items: center;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    box-shadow: 0 1px 4px var(--topbar-shadow);
    display: grid;
    grid-template-columns: 1fr auto;
    height: 48px;
    gap: 12px;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 2;
    padding: 0 14px;
    transition: all 0.5s;
}

.topbar-logo-link {
    align-items: center;
    background: var(--control-bg);
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--control-text);
    display: inline-flex;
    grid-column: 1;
    height: 32px;
    justify-content: center;
    justify-self: start;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    pointer-events: none;
    transform: scale(0.52);
    transform-origin: center;
    transition:
        border-color 1s,
        background 1s;
    width: 32px;
}

.topbar-spacer {
    grid-column: 1;
    min-width: 32px;
}

.topbar-logo-link.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.topbar-logo {
    border-radius: inherit;
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.topbar a {
    border-radius: 5px;
    color: var(--control-text);
    border: 1px solid var(--accent);
    padding: 5px;
    transition: all 1s;
    background: var(--control-bg);
    text-decoration: none;
}

.topbar .topbar-logo-link {
    border-radius: 999px;
    height: 32px;
    padding: 0;
    width: 32px;
}

.brand {
    align-items: center;
    color: var(--control-text);
    display: inline-flex;
    font-weight: 700;
    gap: 10px;
    text-decoration: none;
}

.topbar-actions {
    align-items: center;
    display: flex;
    gap: 8px;
    grid-column: 2;
    justify-self: end;
    min-width: 0;
}

.new-chat-link,
.theme-toggle,
.thread-pdf-button,
.lang-toggle,
.logout-link {
    align-items: center;
    background: var(--control-bg);
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--control-text);
    display: inline-flex;
    height: 32px;
    justify-content: center;
    padding: 0;
    position: relative;
    width: 32px;
    transition: all 1s;
}

.theme-toggle:hover,
.thread-pdf-button:hover,
.lang-toggle:hover,
.logout-link:hover,
.new-chat-link:hover,
.topbar-logo-link:hover,
.topbar a:hover {
    border-color: var(--accent-strong);
}

.lang-menu {
    position: relative;
}

.lang-toggle {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.lang-options {
    background: var(--control-dropdown-bg);
    border: 1px solid var(--accent);
    border-radius: 10px;
    box-shadow: 0 8px 18px var(--topbar-shadow);
    display: grid;
    gap: 3px;
    left: 50%;
    padding: 5px;
    position: absolute;
    top: calc(100% + 12px);
    transform: translateX(-50%);
    z-index: 4;
}

.lang-options[hidden] {
    display: none;
}

.lang-option {
    background: oklch(100% 0 0 / 0%);
    border: 0;
    border-radius: 7px;
    color: var(--control-text);
    display: block;
    font-size: 0.8rem;
    line-height: 1;
    min-width: 42px;
    padding: 8px 9px;
    text-align: center;
    text-decoration: none;
}

.lang-option:hover {
    background: var(--control-dropdown-bg-hover);
}

.new-chat-link svg,
.thread-pdf-button svg,
.logout-link svg {
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 18px;
}

.thread-pdf-button:disabled {
    cursor: default;
    opacity: 0.45;
}

.modal-backdrop {
    align-items: center;
    background: oklch(8% 0.02 255 / 92%);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 20;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 22px 60px oklch(0% 0 0 / 28%);
    color: var(--text);
    max-width: 460px;
    padding: 22px;
    width: min(100%, 460px);
}

.modal-panel h2 {
    font-size: 1.18rem;
    line-height: 1.25;
    margin: 0 0 10px;
    text-align: left;
}

.modal-panel p {
    color: var(--muted-text);
    line-height: 1.5;
    margin: 0;
    text-align: left;
}

.modal-actions {
    align-items: stretch;
    display: grid;
    gap: 10px;
    justify-items: stretch;
    margin-top: 20px;
}

.modal-actions button {
    min-height: 46px;
    width: 100%;
}

.modal-action-button {
    align-items: center;
    background: var(--control-bg);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--control-text);
    display: inline-flex;
    gap: 10px;
    justify-content: left;
    line-height: 1.1;
    padding: 0.7em 1em;
    text-align: left;
}

.modal-action-button:hover {
    background: var(--control-bg);
    border-color: var(--accent-strong);
}

.modal-action-button svg {
    fill: none;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 20px;
}

.modal-action-label {
    min-width: 0;
}

.modal-action-save {
}

.modal-action-stay {
}

.modal-action-new {
}

.icon-label {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.theme-icon {
    display: inline-flex;
    inset: 0;
    opacity: 0;
    position: absolute;
    transform: scale(0.72) rotate(-18deg);
    transition:
        opacity 160ms ease,
        transform 160ms ease;
}

.theme-icon svg {
    fill: none;
    height: 18px;
    margin: auto;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 18px;
}

.theme-icon-moon svg {
    fill: currentColor;
    stroke: currentColor;
}

html:not([data-theme="dark"]) .theme-icon-moon,
html[data-theme="dark"] .theme-icon-sun {
    opacity: 1;
    transform: scale(1) rotate(0);
}

.page {
    flex: 1 0 auto;
    margin: 0 auto;
    max-width: 1024px;
    padding: 0 12px 48px;
    width: 100%;
}

footer {
    flex: 0 0 auto;
    padding: 0 12px 18px;
}

.footer {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    color: var(--muted-text);
    font-size: 0.85rem;
    margin: 0 auto;
    max-width: 1000px;
    padding: 10px 12px;
    text-align: center;
    transition: all 0.5s;
}

.footer-version {
    display: block;
    font-size: 0.74rem;
    margin: 12px 0;
    opacity: 0.72;
    text-align: center;
}

.footer a {
    color: var(--control-text);
    text-decoration: none;
}

.footer a:hover {
    color: var(--accent-strong);
}

html[data-theme="dark"] .footer a {
    color: oklch(82% 0.16 235deg);
}

html[data-theme="dark"] .footer a:hover {
    color: oklch(90% 0.11 210deg);
}

.feedback-section {
    background: var(--feedback-bg);
    border: 1px solid var(--feedback-border);
    border-radius: 12px;
    color: var(--feedback-text);
    margin: -26px auto 18px;
    max-width: 1000px;
    padding: 0 12px;
    width: calc(100% - 24px);
}

.feedback-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: inherit;
    display: flex;
    justify-content: space-between;
    padding: 18px 12px;
    text-align: left;
    width: 100%;
}

html[data-theme="dark"] .feedback-section {
    background: var(--feedback-bg);
    border-color: var(--feedback-border);
    color: var(--feedback-text);
}

html[data-theme="dark"] .feedback-toggle {
    color: inherit;
}

.feedback-toggle:hover {
    background: transparent;
}

html[data-theme="dark"] .feedback-toggle:hover {
    background: transparent;
}

.feedback-toggle-label {
    font-size: clamp(18px, 1.2vw + 14px, 20px);
}

.feedback-toggle-icon::before {
    content: "+";
    display: inline-block;
    font-size: 1.2rem;
    line-height: 1;
}

.feedback-toggle[aria-expanded="true"] .feedback-toggle-icon::before {
    content: "-";
}

.feedback-panel {
    background: transparent;
    border: 0;
    color: inherit;
    margin-top: 0;
    padding: 0 12px 20px;
    text-align: left;
}

html[data-theme="dark"] .feedback-panel {
    background: transparent;
    border-color: transparent;
}

.feedback-form {
    display: grid;
    gap: 0;
}

.feedback-label {
    height: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.feedback-form textarea {
    background: var(--feedback-input-bg);
    border-color: var(--feedback-input-border);
    color: var(--feedback-input-text);
}

html[data-theme="dark"] .feedback-form textarea {
    background: var(--feedback-input-bg);
    border-color: var(--feedback-input-border);
    color: var(--feedback-input-text);
}

.feedback-attach {
    font-weight: 700;
}

.feedback-hints,
.feedback-status {
    color: var(--feedback-muted);
    font-size: 0.86rem;
    margin: 12px 0 0;
}

html[data-theme="dark"] .feedback-hints,
html[data-theme="dark"] .feedback-status {
    color: var(--feedback-muted);
}

.feedback-status.is-error {
    color: var(--feedback-error);
}

html[data-theme="dark"] .feedback-status.is-error {
    color: var(--feedback-error);
}

.feedback-attach {
    align-items: center;
    display: flex;
    gap: 9px;
    justify-content: flex-start;
    line-height: 1.25;
    margin-top: 18px;
    width: fit-content;
}

.feedback-attach input {
    appearance: none;
    background: var(--feedback-checkbox-bg);
    border: 1px solid var(--feedback-checkbox-border);
    border-radius: 4px;
    box-shadow: inset 0 1px 1px oklch(0% 0 0 / 8%);
    cursor: pointer;
    flex: 0 0 20px;
    height: 20px;
    margin: 0;
    position: relative;
    width: 20px;
}

.feedback-attach input:checked {
    background: var(--feedback-checkbox-checked-bg);
    border-color: var(--feedback-checkbox-checked-border);
}

.feedback-attach input:checked::after {
    border: solid var(--feedback-checkbox-check);
    border-width: 0 2.5px 2.5px 0;
    content: "";
    height: 11px;
    left: 5px;
    position: absolute;
    top: 1px;
    transform: rotate(45deg);
    width: 6px;
}

.feedback-attach input:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

.feedback-attach input:disabled {
    cursor: default;
    opacity: 0.55;
}

.feedback-attach-label {
    display: inline-block;
    text-align: left;
}

.feedback-submit {
    justify-self: start;
    margin-top: 18px;
}

.feedback-consent-actions {
    grid-template-columns: 1fr 1fr;
}

.feedback-consent-actions .modal-action-button {
    justify-content: center;
    min-width: 0;
    text-align: center;
    white-space: normal;
}

.logo-wrap {
    border-radius: 999px;
    display: block;
    height: 150px;
    margin: 0 auto 22px;
    opacity: 1;
    overflow: hidden;
    position: relative;
    transform: scale(1);
    transition: none;
    width: 150px;
}

.page img.logo {
    border-radius: inherit;
    display: block;
    height: 100%;
    width: 100%;
}

.logo-magic-overlay {
    inset: 0;
    mix-blend-mode: screen;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.logo-core-burst {
    animation: logo-core-burst 20s cubic-bezier(0.05, 0.75, 0.12, 1) infinite;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

.logo-crystal-core {
    animation: logo-crystal-blink 20s ease-in-out infinite;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

.logo-crystal-ring {
    animation: logo-crystal-ripple 20s cubic-bezier(0.06, 0.85, 0.16, 1)
        infinite;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

.logo-ring-1 {
    animation-delay: 0.16s;
}

.logo-ring-2 {
    animation-delay: 0.42s;
}

.logo-sparkle-dot,
.logo-sparkle-star {
    animation: logo-tiny-twinkle 6s ease-in-out infinite;
    fill: oklch(100% 0 0 / 100%);
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

.logo-sparkle-dot {
    stroke: oklch(98% 0.056 95 / 100%);
    stroke-width: 0.25;
}

.logo-sparkle-star {
    fill: oklch(99% 0.022 95 / 100%);
}

.logo-sparkle-1 {
    animation-delay: 0.2s;
    animation-duration: 5.8s;
}
.logo-sparkle-2 {
    animation-delay: 1.4s;
    animation-duration: 7.2s;
}
.logo-sparkle-3 {
    animation-delay: 2.6s;
    animation-duration: 6.5s;
}
.logo-sparkle-4 {
    animation-delay: 3.1s;
    animation-duration: 8s;
}
.logo-sparkle-5 {
    animation-delay: 4.4s;
    animation-duration: 6.8s;
}
.logo-sparkle-6 {
    animation-delay: 5.3s;
    animation-duration: 7.4s;
}
.logo-sparkle-7 {
    animation-delay: 2.1s;
    animation-duration: 8.6s;
}
.logo-sparkle-8 {
    animation-delay: 6.1s;
    animation-duration: 7.8s;
}
.logo-sparkle-9 {
    animation-delay: 3.7s;
    animation-duration: 5.9s;
}
.logo-sparkle-10 {
    animation-delay: 7.2s;
    animation-duration: 8.2s;
}
.logo-sparkle-11 {
    animation-delay: 0.9s;
    animation-duration: 7.6s;
}
.logo-sparkle-12 {
    animation-delay: 2.8s;
    animation-duration: 6.4s;
}

.logo-sparkle-13 {
    translate: 144px 130px;
    animation-delay: 0.9s;
    animation-duration: 7.6s;
}
.logo-sparkle-14 {
    translate: 176px 121px;
    animation-delay: 2.8s;
    animation-duration: 6.4s;
}
.logo-sparkle-15 {
    translate: 184px 167px;
    animation-delay: 4.9s;
    animation-duration: 8.1s;
}
.logo-sparkle-16 {
    translate: 134px 178px;
    animation-delay: 6.5s;
    animation-duration: 7.1s;
}
.logo-sparkle-17 {
    translate: 116px 153px;
    animation-delay: 1.8s;
    animation-duration: 8.7s;
}
.logo-sparkle-18 {
    translate: 157px 164px;
    animation-delay: 5.6s;
    animation-duration: 6.9s;
}

.logo-wrap.is-docked,
.logo-wrap:has(img.logo.is-docked) {
    opacity: 0;
    transform: scale(0.42);
}

@keyframes logo-tiny-twinkle {
    0%,
    76%,
    100% {
        opacity: 0;
        transform: scale(0.25);
    }

    80% {
        opacity: 1;
        transform: scale(1.35);
    }

    84% {
        opacity: 0.35;
        transform: scale(0.65);
    }

    88% {
        opacity: 0.85;
        transform: scale(1.05);
    }

    93% {
        opacity: 0;
        transform: scale(0.3);
    }
}

@keyframes logo-core-burst {
    0%,
    72%,
    100% {
        opacity: 0;
        transform: scale(0.12);
    }

    1.2% {
        opacity: 0.85;
        transform: scale(0.65);
    }

    2.8% {
        opacity: 0.45;
        transform: scale(1.45);
    }

    7% {
        opacity: 0;
        transform: scale(2.2);
    }
}

@keyframes logo-crystal-blink {
    0%,
    72%,
    100% {
        opacity: 0;
        transform: scale(0.15);
    }

    4% {
        opacity: 0.5;
        transform: scale(0.65);
    }

    12% {
        opacity: 0.25;
        transform: scale(1.05);
    }

    24% {
        opacity: 0;
        transform: scale(1.25);
    }
}

@keyframes logo-crystal-ripple {
    0%,
    75%,
    100% {
        opacity: 0;
        transform: scale(0.18);
    }

    4% {
        opacity: 0.45;
    }

    14% {
        opacity: 0.3;
    }

    31% {
        opacity: 0.12;
        transform: scale(1.65);
    }

    50% {
        opacity: 0;
        transform: scale(2.1);
    }
}

.title-panel,
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.5s;
}

.title-panel {
    margin-bottom: 22px;
    margin-top: 12px;
    padding: 12px 18px 14px;
}

h1 {
    font-size: clamp(1.55rem, 4vw + 0.45rem, 2.25rem);
    line-height: 1.1;
    margin: 0;
}

.subline {
    color: var(--text);
    font-family: "Averia Serif Libre", Georgia, serif;
    font-size: clamp(1rem, 1.1vw + 0.8rem, 1.15rem);
    margin-top: 8px;
    transition: all 0.5s;
}

.panel {
    padding: 24px;
    text-align: left;
}

.panel + .panel {
    margin-top: 18px;
}

h2 {
    font-size: 1.35rem;
    line-height: 1.2;
    margin: 0 0 16px;
}

.oracle-form {
    display: grid;
    gap: 12px;
}

.starter-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.starter-toggle {
    align-items: center;
    background: var(--starter-bg);
    border: 1px solid var(--starter-border);
    border-radius: 8px;
    color: var(--text);
    display: none;
    font-size: 1rem;
    font-weight: 700;
    justify-content: space-between;
    line-height: 1.2;
    min-height: 2.3em;
    padding: 0.45em 0.75em;
    width: 100%;
}

.starter-toggle:hover {
    background: var(--starter-hover-bg);
}

.starter-toggle-icon::before {
    content: "▾";
    display: inline-block;
    transform: rotate(-90deg);
    transition: transform 160ms ease;
}

.starter-toggle[aria-expanded="true"] .starter-toggle-icon::before {
    transform: rotate(0deg);
}

.starter-chip {
    background: var(--starter-bg);
    border: 1px solid var(--starter-border);
    border-radius: 12px;
    color: var(--text);
    font-size: clamp(1rem, 0.8vw + 0.82rem, 1.05rem);
    font-weight: 400;
    line-height: 1.3;
    min-height: 94px;
    padding: 14px;
    text-align: left;
    transition: all 0.5s;
}

.starter-chip:hover {
    background: var(--starter-hover-bg);
}

label {
    font-weight: 700;
}

input:not([type="checkbox"]),
textarea {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--input-text);
    font: inherit;
    padding: 12px;
    width: 100%;
    transition: all 0.5s;
}

textarea {
    max-height: min(48vh, 420px);
    min-height: 140px;
    overflow: auto;
    resize: vertical;
}

input:not([type="checkbox"]):focus,
textarea:focus {
    border-color: var(--accent-strong);
    outline: 2px solid var(--focus-outline);
}

.login-page {
    align-items: center;
    display: flex;
    min-height: calc(100vh - 64px);
}

body.auth-body .login-page {
    align-items: flex-start;
    padding-top: clamp(32px, 5vh, 72px);
}

.auth-panel {
    max-width: 760px;
    text-align: center;
    width: 100%;
}

.auth-panel h1 {
    background: oklch(0% 0 0 / 0%);
    border: 0;
    margin-top: 8px;
    padding: 0;
}

.auth-logo-wrap {
    margin-bottom: 4px;
}

.auth-form {
    display: grid;
    gap: 10px;
    margin-top: 0;
    text-align: left;
}

.auth-choices {
    display: grid;
    gap: 34px;
    margin-top: clamp(30px, 4vh, 48px);
    margin-left: auto;
    margin-right: auto;
    max-width: 520px;
}

.auth-choices .auth-form + .auth-form {
    border-top: 1px solid var(--panel-border);
    padding-top: 28px;
}

.auth-form h2 {
    font-size: clamp(1.3rem, 2.2vw, 1.7rem);
    line-height: 1.15;
    margin: 0 0 2px;
    text-align: center;
}

.auth-form-description {
    color: var(--muted-text);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.45;
    margin: 0 auto 10px;
    max-width: 34em;
    text-align: center;
    text-wrap: balance;
}

.auth-form label {
    margin-top: 4px;
    text-align: center;
}

.auth-error {
    color: var(--accent-strong);
    font-weight: 700;
    margin: 0;
}

.setup-success {
    color: oklch(46% 0.13 150deg);
    font-weight: 700;
    margin: 0;
}

.lang-options .lang-option {
    border: 0;
}

button {
    background: var(--button-bg);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--button-text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0.68em 1em;
}

button:hover {
    background: var(--button-bg-hover);
}

.topbar .lang-options .lang-option {
    background: oklch(100% 0 0 / 0%);
    border: 0;
    border-radius: 7px;
    color: var(--control-text);
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    min-height: 0;
    min-width: 42px;
    padding: 8px 9px;
    text-align: center;
    text-decoration: none;
    width: 100%;
}

.topbar .lang-options .lang-option:hover {
    background: var(--control-dropdown-bg-hover);
}

.topbar .new-chat-link,
.topbar .theme-toggle,
.topbar .thread-pdf-button,
.topbar .lang-toggle,
.topbar .logout-link {
    background: var(--control-bg);
    border: 1px solid var(--accent);
    border-radius: 999px;
    color: var(--control-text);
    flex: 0 0 32px;
    height: 32px;
    padding: 0;
    width: 32px;
}

button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.conversation {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    margin-top: 0;
}

.message-row {
    display: flex;
    scroll-margin-top: 62px;
}

.message-row.user {
    justify-content: flex-end;
}

.message-row.oracle {
    align-items: flex-end;
    justify-content: flex-start;
}

.message-row.oracle .message-bubble {
    flex: 0 1 min(760px, 88%);
    min-width: 0;
    width: min(760px, 88%);
}

.message-bubble {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    max-width: min(760px, 88%);
    padding: 18px;
    text-align: left;
}

.message-row.user .message-bubble {
    color: var(--user-bubble-text);
    white-space: pre-wrap;
}

.oracle-panel.follow-up-panel {
    margin-top: 18px;
}

.message-row.user .message-bubble {
    background: var(--user-bubble-bg);
    border-color: var(--user-bubble-border);
}

.message-row.oracle .message-bubble {
    background: var(--oracle-bubble-bg);
}

.message-meta {
    color: var(--muted-text);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.answer-opening,
.answer-mantra {
    margin-bottom: 10px;
}

.answer-mantra {
    font-size: calc(1em * var(--mantra-scale, 1));
    line-height: 1.8;
    min-height: 2.2em;
}

.mantra-unit {
    white-space: nowrap;
}

.element-sticker {
    background: var(--sticker-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px 0 0 12px;
    border-right: 0;
    margin: 18px -18px 18px auto;
    padding: 10px 14px 12px 12px;
    width: max-content;
}

.element-images {
    display: flex;
    gap: 5px;
    justify-content: right;
}

.element-images img {
    height: 48px;
    /*object-fit: contain;*/
    width: 48px;
}

.answer-text {
    white-space: normal;
}

.answer-segment {
    display: block;
}

.answer-segment + .answer-segment {
    margin-top: 1em;
}

.answer-text p {
    margin: 0 0 1em;
}

.answer-text p:last-child,
.answer-text ul:last-child {
    margin-bottom: 0;
}

.answer-text ul {
    margin: 0 0 1em 1.25em;
    padding: 0;
}

.answer-text li + li {
    margin-top: 0.35em;
}

.answer-title {
}

.answer-elements {
}

.answer-body {
}

.answer-element-explanation {
    color: var(--muted-text);
}

.answer-interpretation {
}

.answer-followup-invitation {
}

.reading-actions {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 36px;
}

.reading-actions button {
    flex-shrink: 1;
    font-size: clamp(0.72rem, 1.65vw, 1rem);
    line-height: 1;
    min-width: 0;
    padding-left: clamp(10px, 2.1vw, 18px);
    padding-right: clamp(10px, 2.1vw, 18px);
    white-space: nowrap;
}

.reading-actions .image-action,
.reading-actions .export-action {
    min-width: 0;
}

.thread-inline-actions {
    align-items: center;
    align-self: flex-end;
    display: flex;
    gap: 8px;
    margin: 8px 0 0 16px;
    max-width: min(92%, 720px);
}

.message-row.user .thread-inline-actions {
    align-self: flex-end;
    margin-left: 0;
    margin-right: 16px;
}

.message-row.oracle .thread-inline-actions {
    align-items: flex-start;
    align-self: flex-end;
    flex: 1 1 auto;
    flex-direction: column;
    margin: 8px 0 0 16px;
    max-width: none;
    min-width: 0;
}

.message-row.oracle .inline-lang-menu {
    margin-left: 6px;
    order: -1;
}

.thread-action-button,
.inline-lang-toggle {
    align-items: center;
    background: var(--control-bg);
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    color: var(--control-text);
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 650;
    gap: 6px;
    justify-content: center;
    line-height: 1;
    min-height: 32px;
    padding: 0 11px;
    transition: all 1s;
}

.thread-action-button {
    padding: 2px 11px;
}

.thread-action-button:hover,
.inline-lang-toggle:hover {
    border-color: var(--accent-strong);
    background: var(--control-bg);
}

.thread-action-button svg {
    fill: none;
    height: 25px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 25px;
}

.inline-lang-menu {
    margin-left: 2px;
    position: relative;
}

.inline-lang-toggle {
    font-size: 1rem;
    padding: 0;
    width: 34px;
}

.inline-lang-options {
    background: var(--control-dropdown-bg);
    border: 1px solid var(--accent);
    border-radius: 10px;
    bottom: calc(100% + 8px);
    box-shadow: 0 8px 18px var(--topbar-shadow);
    display: grid;
    gap: 3px;
    left: 50%;
    padding: 5px;
    position: absolute;
    transform: translateX(-50%);
    z-index: 5;
}

.inline-lang-options[hidden] {
    display: none;
}

.image-action {
    min-width: 0;
}

.image-action button.is-generating {
    animation: image-button-rainbow 7s ease-in-out infinite;
    background: linear-gradient(
        115deg,
        oklch(82% 0.13 25 / 88%),
        oklch(88% 0.14 80 / 88%),
        oklch(86% 0.13 145 / 88%),
        oklch(82% 0.12 210 / 88%),
        oklch(84% 0.12 292 / 88%),
        oklch(82% 0.13 25 / 88%)
    );
    background-size: 320% 100%;
    border-color: oklch(92% 0.08 90 / 85%);
    box-shadow:
        0 0 0 1px oklch(100% 0 0 / 28%) inset,
        0 0 18px oklch(80% 0.13 230 / 24%);
    color: oklch(18% 0.04 250 / 100%);
    opacity: 1;
}

@keyframes image-button-rainbow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .image-action button.is-generating {
        animation: none;
        background-position: 50% 50%;
    }

    .page img.logo,
    .logo-wrap,
    .logo-magic-overlay,
    .logo-magic-overlay *,
    .topbar-logo-link {
        animation: none;
        transition: none;
    }

    .logo-magic-overlay {
        display: none;
    }
}

.export-action {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
}

.reading-actions.has-image {
    align-items: stretch;
    display: block;
}

.reading-actions.has-image .export-action {
    margin-top: 8px;
}

.export-pdf-button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 40px;
}

.export-pdf-button.is-loading {
    cursor: wait;
    opacity: 0.72;
}

.download-link {
    align-items: center;
    backdrop-filter: blur(6px);
    background: oklch(17.912% 0.0051 145.36 / 58%);
    border: 1px solid oklch(100% 0 0 / 58%);
    border-radius: 999px;
    color: oklch(100% 0 0 / 100%);
    display: inline-flex;
    height: 36px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 12px;
    text-decoration: none;
    top: 12px;
    width: 36px;
}

.download-link:hover {
    background: oklch(17.912% 0.0051 145.36 / 78%);
}

.download-link svg {
    fill: none;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 20px;
}

.suggestion-heading {
    color: var(--muted-text);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-top: 30px;
    margin-bottom: 7px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
}

.new-thread-suggestion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.new-thread-question-action {
    background: var(--control-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: var(--control-text);
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.2;
    padding: 10px 14px;
    text-align: left;
}

.new-thread-question-action:hover {
    background: var(--control-bg);
    border-color: var(--accent-strong);
}

.suggestion-chip {
    background: var(--starter-bg);
    border: 1px solid var(--starter-border);
    border-radius: 0 999px 999px 0;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 400;
    inline-size: fit-content;
    max-inline-size: min(100%, 42ch);
    padding: 8px 16px 8px 18px;
    text-align: left;
    text-wrap: balance;
    transition:
        background 180ms ease,
        border-color 180ms ease;
}

button.suggestion-chip:hover {
    background: var(--starter-hover-bg);
    border-color: var(--accent-strong);
    color: var(--text);
}

.generated-image-wrap {
    display: inline-block;
    margin-top: 14px;
    max-width: 100%;
    position: relative;
}

.generated-image {
    border: 1px solid var(--image-border);
    border-radius: 10px;
    cursor: zoom-in;
    display: block;
    max-width: 100%;
}

.generated-image:focus-visible {
    outline: 3px solid var(--focus-outline);
    outline-offset: 4px;
}

body.has-image-lightbox {
    overflow: hidden;
}

.image-lightbox {
    align-items: center;
    background: oklch(0% 0 0 / 82%);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 2.5vh 2.5vw;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 20;
}

.image-lightbox[hidden] {
    display: none;
}

.image-lightbox-frame {
    display: inline-block;
    margin: 0;
    max-height: 95vh;
    max-width: 95vw;
    position: relative;
}

.image-lightbox-image {
    border: 1px solid oklch(100% 0 0 / 32%);
    border-radius: 10px;
    box-shadow: 0 18px 70px oklch(0% 0 0 / 52%);
    display: block;
    height: auto;
    max-height: 95vh;
    max-width: 95vw;
    object-fit: contain;
    width: auto;
}

.image-lightbox-close,
.image-lightbox-nav {
    align-items: center;
    background: oklch(0% 0 0 / 54%);
    border: 1px solid oklch(100% 0 0 / 34%);
    border-radius: 999px;
    color: oklch(100% 0 0 / 94%);
    cursor: pointer;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: fixed;
    transition:
        background 180ms ease,
        border-color 180ms ease;
    width: 38px;
}

.image-lightbox-close[hidden],
.image-lightbox-nav[hidden] {
    display: none;
}

.image-lightbox-close:hover,
.image-lightbox-nav:hover {
    background: oklch(0% 0 0 / 74%);
    border-color: oklch(100% 0 0 / 58%);
}

.image-lightbox-close svg,
.image-lightbox-nav svg {
    fill: none;
    height: 21px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.3;
    width: 21px;
}

.image-lightbox-close {
    right: max(16px, 2vw);
    top: max(12px, 2vh);
}

.image-lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
}

.image-lightbox-prev {
    left: max(10px, 1.2vw);
}

.image-lightbox-next {
    right: max(10px, 1.2vw);
}

.image-lightbox-download {
    position: absolute;
    right: 10px;
    top: 10px;
}

@media (max-width: 900px) {
    .thread-inline-actions {
        flex-wrap: wrap;
        margin-left: 10px;
        max-width: calc(100% - 20px);
    }

    .message-row.oracle {
        align-items: flex-start;
        flex-direction: column;
    }

    .message-row.oracle .message-bubble {
        width: 100%;
    }

    .message-row.oracle .thread-inline-actions {
        flex-direction: row;
        margin-left: 10px;
        max-width: calc(100% - 20px);
    }

    .thread-action-button {
        flex: 1 1 140px;
    }
}

@media (max-width: 420px) {
    body {
        font-size: 18px;
    }

    .title-panel {
        padding: 10px 12px 12px;
    }

    h1 {
        font-size: clamp(1.35rem, 7vw, 1.7rem);
    }

    .panel {
        padding: 18px;
    }

    input,
    textarea,
    button,
    .message-bubble {
        font-size: 1rem;
    }

    .starter-chip {
        min-height: auto;
        padding: 13px;
    }

    .starter-help {
        display: grid;
        gap: 8px;
    }

    .starter-toggle {
        display: inline-flex;
    }

    .starter-grid {
        grid-template-columns: 1fr;
        margin-bottom: 0;
    }

    .starter-help:not(.is-open) .starter-grid {
        display: none;
    }

    .topbar {
        gap: 8px;
        grid-template-columns: 1fr auto;
        padding: 0 10px;
    }

    .topbar-actions {
        grid-column: 2;
    }
}

@media (min-width: 421px) and (max-width: 760px) {
    .starter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
