/* Cross-browser fallbacks: Safari (incl. iOS), Edge, Firefox, Chrome. */
html {
    height: 100%;
    height: 100dvh;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.app-body {
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
}

body.cs-chat-open,
body.cs-chat-open .cs-shell {
    height: 100vh;
    max-height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
}

@media (max-width: 1023px) {
    .cs-more-panel {
        height: 100vh;
        height: 100dvh;
    }
    body.cs-overlay-open .cs-fab { display: none !important; }
}

@media (max-width: 760px) {
    .cs-popup { padding: 0; align-items: stretch; }
    .cs-popup-panel,
    .cs-inspector-panel,
    .cs-command-panel,
    .cs-file-preview-panel {
        width: 100%;
        max-height: none;
        height: 100%;
        height: 100dvh;
        height: -webkit-fill-available;
        border-radius: 0;
    }
}

input,
select,
textarea,
.form-control,
.form-select {
    font-size: var(--cs-fs-body);
}
@media (max-width: 767px) {
    input,
    select,
    textarea,
    .form-control,
    .form-select {
        font-size: 16px;
    }
}

.cs-chat-list,
.cs-chat-thread-body,
.cs-chat-details-body,
.cs-command-list,
.cs-sheet-panel,
.cs-more-panel,
.cs-quick-strip {
    -webkit-overflow-scrolling: touch;
}

.cs-chat-composer {
    padding-bottom: calc(.4rem + constant(safe-area-inset-bottom));
    padding-bottom: calc(.4rem + env(safe-area-inset-bottom, 0px) + var(--cs-keyboard, 0px));
}

dialog.cs-cal-dialog.is-fallback-open {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    max-width: none;
    margin: 0;
    padding: 16px;
    border: 0;
    background: rgba(17, 17, 17, .35);
    z-index: var(--cs-z-modal);
}
dialog.cs-cal-dialog.is-fallback-open form {
    background: var(--cs-surface);
    border-radius: 16px;
    padding: 18px;
    width: min(420px, 92vw);
    box-shadow: var(--cs-shadow-lg);
}

button,
[type="button"],
[type="submit"],
[data-quick-open],
.cs-quick-strip button,
.cs-chat-chips button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(200, 16, 46, .12);
}

input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: var(--cs-text);
    box-shadow: 0 0 0 1000px var(--cs-surface) inset;
    transition: background-color 9999s ease-out;
}
