:root {
    --yess-sidebar-width: 17.5rem;
    --yess-scrollbar-size: 0.75rem;
    --yess-scrollbar-track: transparent;
    --yess-scrollbar-thumb: rgba(95, 107, 122, 0.38);
    --yess-scrollbar-thumb-hover: rgba(95, 107, 122, 0.62);
}

html {
    width: 100%;
    height: 100%;
}

body.yess-application {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
}

body.yess-application * {
    box-sizing: border-box;
}

.yess-theme-host {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--yess-color-background);
    color: var(--yess-color-text);
}

.yess-full-size,
.yess-module-surface,
.yess-module-shell,
.yess-page {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.yess-scroll-region {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.yess-scroll-region,
.yess-navigation,
.yess-main {
    scrollbar-color: var(--yess-scrollbar-thumb) var(--yess-scrollbar-track);
    scrollbar-width: thin;
}

.yess-scroll-region::-webkit-scrollbar,
.yess-navigation::-webkit-scrollbar,
.yess-main::-webkit-scrollbar {
    width: var(--yess-scrollbar-size);
    height: var(--yess-scrollbar-size);
}

.yess-scroll-region::-webkit-scrollbar-track,
.yess-navigation::-webkit-scrollbar-track,
.yess-main::-webkit-scrollbar-track {
    background: var(--yess-scrollbar-track);
}

.yess-scroll-region::-webkit-scrollbar-thumb,
.yess-navigation::-webkit-scrollbar-thumb,
.yess-main::-webkit-scrollbar-thumb {
    background: var(--yess-scrollbar-thumb);
    border: 0.2rem solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.yess-scroll-region::-webkit-scrollbar-thumb:hover,
.yess-navigation::-webkit-scrollbar-thumb:hover,
.yess-main::-webkit-scrollbar-thumb:hover {
    background: var(--yess-scrollbar-thumb-hover);
    border: 0.2rem solid transparent;
    background-clip: padding-box;
}

.yess-module-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.yess-module-shell__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 auto;
}

.yess-module-shell__header h1 {
    margin: 0;
}

.yess-module-shell__header p {
    margin: 0.35rem 0 0;
    color: var(--yess-color-muted);
}

.yess-module-shell__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.yess-module-shell__body {
    width: 100%;
    min-width: 0;
}

/* Dedicated shell for module pop-out pages. */
.yess-popout-layout {
    box-sizing: border-box;
    width: 100%;
    min-height: 100dvh;
    padding: var(--yess-space-3);
    background: var(--yess-color-background);
    color: var(--yess-color-text);
    overflow: hidden;
}

@media (max-width: 48rem) {
    .yess-popout-layout {
        padding: var(--yess-space-2);
    }
}

/* YESS-FILL-AVAILABLE-BEGIN
   Opt-in full-height page composition. Use this for work surfaces such as grids
   that must consume the remaining viewport area while headers and toolbars keep
   their natural height. */
.yess-page.yess-page-fill {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.yess-fill-available {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}
/* YESS-FILL-AVAILABLE-END */

/* Keep authentication and navigation reachable in constrained host windows. */
.yess-auth-theme { height: 100dvh; overflow: auto; }
.yess-auth-shell { box-sizing: border-box; min-height: 100%; }
.yess-shell > .yess-sidebar { max-height: 100dvh; overflow-y: auto; }
.yess-sidebar > .yess-navigation { flex-shrink: 0; }

/* Reusable, opt-in scroll layout for standalone module hosts.
   The Yess application body intentionally has overflow:hidden. */
.yess-standalone-scroll-host {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Conversation area scrolls independently of the page and keeps the
   question composer reachable during long support conversations. */
.yess-conversation-log {
    max-height: min(55dvh, 36rem);
    padding-inline-end: var(--yess-space-2, .5rem);
    overflow-wrap: anywhere;
}
.yess-conversation-log > .yess-form-field + .yess-form-field {
    margin-top: var(--yess-space-3, .75rem);
}
.yess-conversation-log .yess-form-field__help {
    overflow-wrap: anywhere;
}
