/**
 * mobile.css — All mobile-specific CSS for the application.
 * Load this file last on every entry point so mobile behavior is always present.
 * Breakpoint: 768px unless noted.
 *
 * Convention: Styles are grouped by parent/source CSS file. Each section comment
 * states the source file, e.g. "/* ========== app.css ========== */"
 */

/* =============================================================================
   app.css
   ============================================================================= */

/* Global viewport */
body.is-mobile {
    overflow-x: hidden;
    max-width: 100%;
}
html:has(body.is-mobile) {
    overflow-x: hidden;
    max-width: 100%;
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100%;
    }
}

/* App layout: sidebar, header, container */
@media (max-width: 768px) {
    body {
        background: #fff;
    }
    .ot-main-content {
        flex-direction: column;
    }

    .ot-sidebar {
        position: fixed;
        top: 0;
        right: -200px;
        width: 200px;
        height: 95svh;
        height: 95dvh;
        height: 95vh;
        max-height: 100svh;
        background: #fff;
        border-left: 1px solid var(--border-color);
        z-index: 1000;
        transition: right 0.3s ease;
        box-shadow: -2px 0 8px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
    }

    .ot-sidebar.show {
        right: 0;
    }

    .ot-sidebar-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0.5rem;
        flex-shrink: 0;
        border-bottom: 1px solid var(--border-color);
        background: #f8f9fa;    
    }

    .ot-sidebar-account-name {
        font-size: 1rem;
        font-weight: 600;
        color: #333;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .ot-sidebar-user-name {
        font-size: 0.85rem;
        color: #666;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .ot-sidebar-nav {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ot-sidebar-user-menu {
        flex-shrink: 0;
        border-top: 1px solid var(--border-color);
        background: #f8f9fa;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .ot-content-area {
        flex: 1;
        width: 100%;
    }

    .ot-content-body {
        padding: 0 .5rem .5rem .5rem;
    }

    /* Page header: title shown in .ot-header-title in .ot-header; leaner spacing on mobile */
    .ot-page-header,
    .template-page-header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        flex-wrap: nowrap;
        padding: 0.5rem 0 .5rem 0;
        gap: 0.375rem;
        margin: 0;
    }
    .template-page-header-left {
        margin-right: 0;
        flex: 0 1 auto;
        min-width: 0;
    }
    .ot-page-toolbar,
    .template-page-toolbar {
        padding: 0;
        gap: 0.375rem;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }
    /* Page view switcher in toolbar: compact padding on mobile */
    #account-surveys-view-group .ot-button-group .ot-button,
    #client-surveys-view-group .ot-button-group .ot-button,
    .template-page-view-group .ot-button-group .ot-button {
        padding: 0.35rem 0.5rem;
    }
    .ot-page-filter-group,
    .template-component-filter-group {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 0.375rem;
    }

    /* Page toolbar with search: search shrinks to fill remaining space */
    .ot-page-toolbar .search-box,
    .template-page-toolbar .search-box {
        flex: 1 1 0;
        min-width: 60px;
        width: auto !important;
    }
    .ot-page-toolbar .search-box .search-box-input,
    .template-page-toolbar .search-box .search-box-input {
        width: 100%;
        min-width: 0;
    }
    .ot-page-toolbar .template-component-filter-group:has(.search-box),
    .template-page-toolbar .template-component-filter-group:has(.search-box) {
        flex: 1 1 0;
        min-width: 60px;
    }

    .ot-header {
        padding: .7rem;
        margin-bottom: 0;
        padding-right: 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .ot-header-left {
        display: flex;
        align-items: center;
        flex: 1;
        min-width: 0;
    }

    .ot-header-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: #333;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
        min-width: 0;
        display: block;
        padding-top: 5px;
    }

    .ot-logo {
        object-fit: cover;
        object-position: 100% center;
        width: 25px;
        height: 30px;
    }

    .ot-header button .btn-text {
        display: none;
    }

    .ot-account-name {
        display: none;
    }

    .ot-header-user-info {
        display: none;
    }

    .ot-mobile-menu-toggle {
        display: block;
        position: relative;
        background: none;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
        z-index: 1001;
        height: 40px;
        width: 40px;
    }

    .ot-sidebar.show ~ .ot-main-content .ot-header .ot-mobile-menu-toggle,
    .ot-sidebar.show + .ot-main-content .ot-header .ot-mobile-menu-toggle {
        display: none;
    }

    body.sidebar-open .ot-mobile-menu-toggle {
        display: none;
    }

    .ot-mobile-menu-toggle .icon-hamburger {
        width: 20px;
        height: 20px;
        background-size: 20px 20px;
        background-repeat: no-repeat;
        background-position: center;
        transition: 0.3s;
    }

    .ot-mobile-menu-toggle.active .icon-hamburger {
        transform: rotate(90deg);
    }

    .ot-mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .ot-mobile-overlay.show {
        display: block;
    }

    .ot-container {
        padding: 0;
        box-shadow: none;
        margin: 0;
        border-radius: 0;
        max-width: 100vw;
        width: 100vw;
    }

    .ot-filter-component {
        width: 100%;
    }

    .search-box {
        width: 100% !important;
        display: block;
    }

    .search-box-input {
        max-width: none;
        width: 100%;
    }


    .scrollable-table-container .grid-table-header {
        display: none !important;
    }
}

/* Client summary: template-component-card stack; full-width cards on mobile */
@media (max-width: 768px) {
    .client-summary-wrapper .template-component-card.template-component-card--summary-stats {
        width: 100%;
        max-width: none;
        flex: 1 1 100%;
    }

    .client-summary-stats-content {
        flex-direction: row;
        justify-content: space-around;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem 0.75rem;
        min-height: 4rem;
    }

    .client-summary-stat {
        flex: 1 1 0;
        min-width: 0;
    }

    .client-summary-stat-separator {
        width: 1px;
        height: 8rem;
        border: none;
        border-left: 1px solid var(--border-color);
        margin: 0;
        align-self: center;
        flex-shrink: 0;
    }

    .client-summary-wrapper #clientSuicideRiskCard,
    .client-summary-wrapper #clientAlertsCard,
    .client-summary-wrapper #clientRecentActivityCard {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }
}

/* Tabulator responsive collapse: wrap long values instead of overflowing */
@media (max-width: 768px) {
    .tabulator-responsive-collapse {
        overflow: visible;
    }
    .tabulator-responsive-collapse table {
        width: 100%;
    }
    .tabulator-responsive-collapse table td:first-child {
        width: 1%;
        white-space: nowrap;
        vertical-align: top;
    }
    .tabulator-responsive-collapse table td:last-child {
        word-break: break-word;
        overflow-wrap: anywhere;
        white-space: normal;
    }
}

/* =============================================================================
   utility.css
   ============================================================================= */

/* Client Detail: add-contact button first on mobile; contact cards full width (template-component-card) */
@media (max-width: 768px) {
    .template-component-card-stack--client-row > .client-detail-btn-add-contact {
        order: -1;
    }
    .template-component-card-stack--contacts > .template-component-card.template-component-card--fit-content {
        width: 100%;
        flex: 1 1 100%;
        min-width: 0;
        max-width: none;
    }
}

/* Overlay page */
@media (max-width: 768px) {
    body.overlay-page {
        background-color: #fff;
    }
    .ot-overlay-container {
        margin: 0;
        padding: 16px;
        border-radius: 0;
        box-shadow: none;
    }

    .ot-overlay-body {
        margin: 0 16px;
    }

    .ot-overlay-sub-header {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
}

/* Combobox */
@media (max-width: 768px) {
    .combobox-dropdown {
        max-height: 150px;
    }

    .combobox-option {
        padding: 0.625rem 1rem;
        font-size: 1rem;
    }
}

/* Popup fullscreen (popupBox — survey popups, etc.) */
@media (max-width: 768px) {
    .popupBox-backdrop.popupBox-mobile-fullscreen {
        align-items: stretch;
        justify-content: stretch;
        padding: 0;
    }
    .popupBox-backdrop.popupBox-mobile-fullscreen .popupBox {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0;
        min-width: 0;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px) + 20px);
    }
}

/* Grid sub-group */
@media (max-width: 768px) {
    .grid-sub-group {
        flex-direction: column;
    }

    .grid-sub-group .grid-group-item {
        width: 100% !important;
        border-right: none !important;
        padding-right: 0 !important;
        margin-right: 0 !important;
    }

    .grid-sub-group .grid-group-item:not(:last-child) {
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }
}

/* Visibility: .mobile-hide (hide on mobile), .desktop-hide (hide on desktop) */
@media (max-width: 768px) {
    .mobile-hide {
        display: none !important;
    }
}
@media (min-width: 769px) {
    .desktop-hide {
        display: none !important;
    }
}

/* Grid, grid-form, grid-table */
@media (max-width: 768px) {
    .mobile-only {
        display: inline-flex !important;
    }
    .ot-filter-badge--empty {
        display: none !important;
    }

    .flex-row.mobile-wrap {
        flex-direction: column;
        align-items: flex-start;
        row-gap: 0.5rem;
    }

    .grid-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin: 0.5rem 0;
    }

    .grid-group,
    .grid-group[data-cols="2"],
    .grid-group[data-cols="3"],
    .grid-group[data-cols="4"] {
        flex-direction: column;
    }

    .grid-group .grid-group-item,
    .grid-group[data-cols="2"] .grid-group-item,
    .grid-group[data-cols="3"] .grid-group-item,
    .grid-group[data-cols="4"] .grid-group-item {
        width: 100%;
        margin-top: 0;
        margin-bottom: 0;
    }

    .grid-table {
        display: block;
        border: none;
        background: transparent;
        margin: 0.5rem 0;
        box-shadow: none;
        border-radius: 0;
        overflow: visible;
    }
    .grid-header {
        display: block;
        background: var(--background-color);
        padding: 0.75rem;
        font-weight: 600;
        font-size: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 4px 4px 0 0;
        color: #333;
        position: sticky;
        top: -0.5rem;
        margin: 0;
        z-index: 10;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .grid-row {
        display: block;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 0;
        margin-bottom: 0;
        padding: 1rem;
        box-shadow: none;
    }

    .grid-row:first-of-type {
        border-radius: 4px 4px 0 0;
    }

    .grid-row:last-of-type {
        border-radius: 0 0 4px 4px;
        margin-bottom: 0.5rem;
    }

    .grid-row:only-of-type {
        border-radius: 4px;
    }

    .grid-row + .grid-row {
        border-top: none;
    }

    .grid-form {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0;
        margin: 0.5rem 0;
    }

    .grid-form-row {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.25rem 1rem;
        margin: 0;
        width: 100%;
        min-width: 0;
    }

    .grid-form-row:last-child {
        border-bottom: none;
    }

    .grid-form-label {
        text-align: left !important;
        padding: 0;
        font-weight: 600;
        color: #333;
        min-width: 80px;
        flex-shrink: 0;
    }

    .grid-form-field {
        padding: 0;
        display: flex;
        align-items: center;
        flex: 1;
        width: 100%;
        min-width: 0;
    }

    .grid-form-field:has(input, select) {
        padding-left: 0;
    }

    .grid-form-field > * {
        width: 100%;
        min-width: 0;
    }

    .grid-form-field .flex-inline {
        width: auto;
        justify-content: flex-start;
        align-items: center;
    }

    .grid-form-field .flex-inline span[class^="icon-"] {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .popupBox-body .grid-form-field {
        border-bottom: none;
    }

    .grid-form-label:empty {
        display: none;
    }

    .grid-sub-group .grid-group-item:not(:has(.grid-header)) {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .grid-sub-group .grid-group-item:not(:has(.grid-header)) + .grid-group-item:not(:has(.grid-header)) {
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: 1px solid #f0f0f0 !important;
    }

    .grid-sub-group .grid-group-item.no-gap.no-border:not(:has(.grid-header)) {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .grid-sub-group .grid-group-item.no-gap.no-border:not(:has(.grid-header)) + .grid-group-item.no-gap.no-border:not(:has(.grid-header)) {
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: 1px solid #f0f0f0 !important;
    }

    .grid-sub-group .grid-group-item:has(.grid-header) + .grid-group-item:not(:has(.grid-header)) {
        margin-top: 1rem;
        padding-top: 0;
    }

    .grid-form {
        margin: 0;
    }

    /* ---- utility.css: stacked-form-inline ---- */
    .stacked-form-inline {
        flex-direction: column;
    }

    .grid-table-header-alternate {
        display: block;
        background: var(--background-color);
        padding: 0.75rem;
        font-weight: 600;
        font-size: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 4px 4px 0 0;
        position: sticky;
        top: -0.5rem;
        margin: 0;
        z-index: 10;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .grid-table-header {
        display: none;
    }

    .grid-table-body {
        display: block;
        border: none;
    }

    .grid-table-row {
        display: block;
        background: white;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        margin-bottom: 0.5rem;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .grid-table-row:first-child {
        border-top: none;
        border-radius: 0 0 4px 4px;
        margin-top: 0;
    }

    .grid-table-row:hover:not(.no-hover) {
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

    .grid-table-cell {
        display: flex;
        border: none;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f0f0f0;
        text-align: left;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        max-width: none;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .grid-table-cell:last-child {
        border-bottom: none;
    }

    .grid-table-cell::before {
        content: attr(data-label) ": ";
        font-weight: 700;
        font-size: 0.875rem;
        display: block;
        max-width: 100px;
        min-width: 100px;
        flex-shrink: 0;
        word-wrap: break-word;
        word-break: break-word;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: right;
    }
}

/* Cards: remove max-height so page scrolls naturally */
@media (max-width: 768px) {
    .template-component-card {
        max-height: none;
    }
}

/* Card body (template-component-card-body) */
@media (max-width: 768px) {
    .template-component-card-body[data-cols="2"],
    .template-component-card-body[data-cols="3"] {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   survey.css
   ============================================================================= */

/* Survey page: container, contentbody, footer, date/time, button group */
@media (max-width: 768px) {
    html:has(body.survey-page) {
        height: 100%;
        overflow: hidden;
    }

    body.survey-page {
        background-color: #ffffff;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .ot-survey-container {
        margin: 0;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        height: 100%;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .ot-survey-header {
        padding: 0.75rem 1rem;
        flex-shrink: 0;
        background: #fff;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
    }

    .ot-survey-content-container {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .ot-survey-details {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        flex-shrink: 0;
    }

    .ot-survey-contentbody {
        flex: 1;
        min-height: 0;
        padding: 1rem;
        background: #fff;
        border-radius: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .ot-survey-contentbody.survey-completed-lock {
        padding-bottom: calc(1rem + 20px);
    }

    .ot-survey-footer {
        flex-shrink: 0;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px) + 20px);
        align-items: flex-end;
    }

    .ot-survey-footer .survey-complete-later {
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px) + 20px);
    }

    .ot-survey-footer .survey-missing-required-notice {
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px) + 20px);
    }

    .survey-control-date,
    .survey-control-time {
        min-width: 140px;
        width: 140px;
        text-align: left !important;
    }

    .survey-icon-wrapper .survey-control-date,
    .survey-icon-wrapper .survey-control-time {
        width: 140px !important;
    }
    ::-webkit-date-and-time-value {
        text-align: left;
    }

    .survey-button-group {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
    }

    .survey-button-group .survey-button {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
        border-right: none;
        border-bottom: 1px solid #ccc;
        border-radius: 0;
        padding-left: 0.75rem;
    }

    .survey-button-group .survey-button:first-child {
        border-top-left-radius: 6px;
        border-top-right-radius: 6px;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .survey-button-group .survey-button:last-child {
        border-bottom: none;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        border-bottom-left-radius: 6px;
        border-bottom-right-radius: 6px;
    }

    .survey-button-group .survey-button > span {
        text-align: left;
    }

    /* Radio/option layout: stack horizontally-rendered options vertically (no re-render on resize); match native vertical spacing */
    .survey-options-container.survey-options-horizontal {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    .survey-options-container.survey-options-horizontal .survey-option-item {
        display: flex;
        align-items: flex-start;
        margin-bottom: 0.5rem;
    }
    .survey-options-container.survey-options-horizontal .survey-option-item:last-child {
        margin-bottom: 0;
    }
    .survey-options-container.survey-options-horizontal .survey-option-numeric {
        flex-direction: row !important;
        align-items: center;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    .survey-options-container.survey-options-horizontal .survey-option-numeric input[type="checkbox"] {
        margin: 0 0.35rem 0 0 !important;
    }
    .survey-options-container.survey-options-horizontal .survey-option-numeric .survey-option {
        display: inline-block;
        text-align: left;
        margin-top: 0;
        margin-left: 0;
    }
    .survey-options-container.survey-options-horizontal .survey-option-numeric:last-child {
        margin-bottom: 0;
    }

    /* Legend inline: stack first / options / last vertically on narrow viewports */
    .survey-legend-inline .survey-legend-inline-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.35em;
    }
    .survey-legend-inline .survey-legend-inline-row .survey-legend-options-area {
        min-width: 0;
    }
    .survey-legend-inline .survey-legend-options-area .survey-options-container.survey-options-horizontal {
        white-space: normal;
        display: flex;
    }
    /* When legend has more than 2 items, show only first and last on narrow viewports */
    .survey-legend-inline .survey-legend-middle-row {
        display: none;
    }

    /* Legend position 'below' (Never, Sometimes, Always in a row): on narrow viewports show Never above radios, Always below, hide Sometimes */
    .survey-legend-control-wrapper:has(.survey-legend-wrapper.survey-legend-below.survey-legend-horizontal) {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    .survey-legend-control-wrapper .survey-legend-wrapper.survey-legend-below.survey-legend-horizontal {
        display: contents;
    }
    .survey-legend-control-wrapper .survey-legend-wrapper.survey-legend-below .survey-legend-item.survey-legend-first {
        order: -1;
        text-align: left;
    }
    .survey-legend-control-wrapper .survey-legend-wrapper.survey-legend-below .survey-legend-item.survey-legend-middle {
        display: none;
    }
    .survey-legend-control-wrapper .survey-legend-wrapper.survey-legend-below .survey-legend-item.survey-legend-last {
        order: 1;
        text-align: left;
    }
}

/* =============================================================================
   html.css
   ============================================================================= */

/* Select elements */
@media (max-width: 768px) {
    select {
        padding: 10px 12px;
        padding-right: 36px;
        background-size: 18px;
    }

    select option {
        padding: 10px 12px;
    }
}

/* =============================================================================
   login.css
   ============================================================================= */

/* 480px breakpoint */
@media screen and (max-width: 480px) {
    .ot-footer {
        padding-bottom: 2rem;
    }

    .login-forgot-password {
        position: absolute;
        right: 0;
        bottom: 0;
        text-align: left;
        margin-top: 0.5rem;
    }
}

/* =============================================================================
   kiosk.css
   ============================================================================= */

/* Only when body.kiosk-page */
@media (max-width: 768px) {
    html:has(body.kiosk-page), body.kiosk-page {
        overflow-x: hidden;
        max-width: 100%;
        padding: 1rem;
    }
    body.kiosk-page .ot-overlay-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    html:has(body.kiosk-page), body.kiosk-page {
        background: #fff;
        padding: 0;
    }

    body.kiosk-page.overlay-page {
        background: #fff;
    }
    body.kiosk-page .ot-overlay-container {
        margin: 1rem;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    body.kiosk-page .ot-overlay-body {
        padding: 1rem;
    }

    body.kiosk-page .keypad-button {
        font-size: 1.1rem;
        min-height: 30px;
    }

    body.kiosk-page .keypad-button.action,
    body.kiosk-page .keypad-button.clear {
        min-height: 25px;
    }

    body.kiosk-page #PIN {
        font-size: 1.1rem;
        padding: 0.5rem;
    }

    body.kiosk-page .pin-title {
        font-size: 1.1rem;
    }
}

@media (max-height: 768px) {
    html:has(body.kiosk-page), body.kiosk-page {
        background: #fff;
    }
    body.kiosk-page .keypad-button {
        aspect-ratio: 2;
    }
    body.kiosk-page.overlay-page {
        background: #fff;
    }
    body.kiosk-page .ot-overlay-container {
        margin: auto;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    /* Assistant side panel: full width on mobile */
    .assistant-panel {
        width: 100vw;
    }
    .ot-header-assistant-btn {
        margin-left: 0.25rem;
    }
}

/* ========== templates.css ========== */
@media (max-width: 768px) {
    /* Connection banner: full width sticky, larger touch padding */
    .connection-banner {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    /* Card grid entry wrappers: fill viewport on mobile regardless of inline width/max-width */
    .card-grid-entry {
        min-width: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

