/* KurdChannel Portal v25 — single-scroll shell and responsive hardening */

/* One document scrollbar. Nested feature panels keep scrolling only where their
   contents genuinely require it (chat, tables, dialogs, member pickers). */
html {
    min-width: 320px;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body.app-body.kc-responsive-v25 {
    min-width: 320px;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: visible;
}

.kc-responsive-v25 .app-shell,
.kc-responsive-v25 .main-area {
    width: 100%;
    min-height: 100dvh;
    overflow: visible;
}

.kc-responsive-v25 .main-area {
    width: auto;
}

.kc-responsive-v25 .content-area,
.kc-responsive-v25 .content-area > *,
.kc-responsive-v25 :where(.panel-section, .panel-v24, .content-card, .form-card, .dashboard-card),
.kc-responsive-v25 :where(.topbar-start, .topbar-actions-v19, .page-heading) {
    min-width: 0;
    max-width: 100%;
}

.kc-responsive-v25 :where(img, video, canvas, iframe, svg) {
    max-width: 100%;
}

.kc-responsive-v25 :where(h1, h2, h3, h4, p, small, strong, b, a, button, label, td, th) {
    overflow-wrap: anywhere;
}

.kc-responsive-v25 :where(.table-wrap, .calendar-board-v15, .calendar-shell-v14, .role-matrix-panel-v15) {
    max-width: 100%;
    overscroll-behavior-inline: contain;
}

/* Desktop and laptop: the sidebar is fixed but never creates a second page
   scrollbar. Short screens use denser navigation so every admin item fits. */
@media (min-width: 821px) {
    .kc-responsive-v25 .sidebar {
        bottom: auto;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden !important;
        overscroll-behavior: none;
        scrollbar-width: none;
    }

    .kc-responsive-v25 .sidebar::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .kc-responsive-v25 .side-nav {
        min-height: 0;
    }

    .kc-responsive-v25 .main-area {
        min-height: 100vh;
        min-height: 100dvh;
    }
}

@media (min-width: 821px) and (max-height: 860px) {
    .kc-responsive-v25 .sidebar {
        padding: 10px 11px 9px;
    }

    .kc-responsive-v25 .sidebar-brand {
        min-height: 51px;
        padding: 2px 5px 8px;
    }

    .kc-responsive-v25 .sidebar-logo-image {
        width: 77px;
        height: 37px;
    }

    .kc-responsive-v25 .brand-link {
        gap: 8px;
    }

    .kc-responsive-v25 .brand-link b {
        font-size: 17px;
    }

    .kc-responsive-v25 .brand-link small {
        margin-top: 0;
        font-size: 9.5px;
    }

    .kc-responsive-v25 .sidebar-role-card {
        min-height: 45px;
        margin: 7px 2px 5px;
        padding: 7px 10px;
        gap: 9px;
    }

    .kc-responsive-v25 .sidebar-role-card strong {
        font-size: 12px;
    }

    .kc-responsive-v25 .sidebar-role-card small {
        font-size: 9.5px;
    }

    .kc-responsive-v25 .side-nav {
        gap: 2px;
        margin-top: 1px;
    }

    .kc-responsive-v25 .nav-item {
        min-height: 39px;
        padding: 7px 10px;
        gap: 9px;
        border-radius: 11px;
        font-size: 12.2px;
        line-height: 1.35;
    }

    .kc-responsive-v25 .nav-item .icon {
        width: 18px;
        height: 18px;
    }

    .kc-responsive-v25 .sidebar-bottom {
        padding-top: 5px;
    }

    .kc-responsive-v25 .sidebar-credit {
        padding: 6px;
        font-size: 9px;
    }
}

@media (min-width: 821px) and (max-height: 680px) {
    .kc-responsive-v25 .sidebar {
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .kc-responsive-v25 .sidebar-brand {
        min-height: 43px;
        padding-bottom: 5px;
    }

    .kc-responsive-v25 .sidebar-logo-image {
        width: 68px;
        height: 33px;
    }

    .kc-responsive-v25 .brand-link small,
    .kc-responsive-v25 .sidebar-role-card small,
    .kc-responsive-v25 .sidebar-credit {
        display: none;
    }

    .kc-responsive-v25 .sidebar-role-card {
        min-height: 38px;
        margin-block: 5px 3px;
        padding-block: 5px;
    }

    .kc-responsive-v25 .side-nav {
        gap: 1px;
    }

    .kc-responsive-v25 .nav-item {
        min-height: 35px;
        padding-block: 5px;
        font-size: 11.5px;
    }

    .kc-responsive-v25 .sidebar-bottom {
        display: none;
    }
}

@media (min-width: 821px) and (max-height: 540px) {
    .kc-responsive-v25 .sidebar {
        padding: 5px 9px;
    }

    .kc-responsive-v25 .sidebar-brand {
        min-height: 38px;
        padding: 0 4px 4px;
    }

    .kc-responsive-v25 .sidebar-logo-image {
        width: 58px;
        height: 28px;
    }

    .kc-responsive-v25 .brand-link b {
        font-size: 14px;
    }

    .kc-responsive-v25 .brand-link small,
    .kc-responsive-v25 .sidebar-role-card,
    .kc-responsive-v25 .sidebar-bottom {
        display: none;
    }

    .kc-responsive-v25 .side-nav {
        gap: 0;
        margin-top: 3px;
    }

    .kc-responsive-v25 .nav-item {
        min-height: 31px;
        padding: 4px 8px;
        gap: 7px;
        border-radius: 8px;
        font-size: 10.8px;
        line-height: 1.2;
    }

    .kc-responsive-v25 .nav-item .icon {
        width: 15px;
        height: 15px;
    }
}

/* Laptop widths */
@media (max-width: 1440px) and (min-width: 821px) {
    .kc-responsive-v25 .content-area {
        padding-inline: clamp(18px, 2vw, 26px);
    }

    .kc-responsive-v25 .admin-command-v24,
    .kc-responsive-v25 .conference-hero-v24 {
        gap: 22px;
    }
}

@media (max-width: 1120px) and (min-width: 821px) {
    .kc-responsive-v25 .admin-command-v24,
    .kc-responsive-v25 .conference-hero-v24 {
        grid-template-columns: minmax(0, 1fr) 220px;
        padding: 27px;
    }

    .kc-responsive-v25 .admin-command-v24 h2,
    .kc-responsive-v25 .conference-hero-v24 h2 {
        font-size: clamp(29px, 3.2vw, 39px);
    }

    .kc-responsive-v25 .metric-grid-v24 {
        gap: 11px;
    }

    .kc-responsive-v25 .metric-card-v24 {
        padding: 16px;
    }
}

/* Drawer/mobile shell. While the drawer is open the page is locked, so the
   drawer is the only scrollable surface rather than a second scrollbar. */
@media (max-width: 820px) {
    html.sidebar-open-root {
        height: 100dvh;
        overflow: hidden !important;
    }

    body.app-body.kc-responsive-v25.sidebar-open {
        height: 100dvh;
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    .kc-responsive-v25 .sidebar {
        top: 0;
        bottom: auto;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        padding-bottom: max(14px, env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto !important;
        overscroll-behavior-y: contain;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .kc-responsive-v25 .main-area {
        width: 100%;
        min-height: 100dvh;
        margin-right: 0;
    }

    .kc-responsive-v25 .topbar {
        min-width: 0;
        height: 68px;
        padding-right: max(12px, env(safe-area-inset-right));
        padding-left: max(12px, env(safe-area-inset-left));
        gap: 10px;
    }

    .kc-responsive-v25 .topbar-start {
        flex: 1 1 auto;
        overflow: hidden;
    }

    .kc-responsive-v25 .page-heading {
        min-width: 0;
    }

    .kc-responsive-v25 .page-heading span,
    .kc-responsive-v25 .page-heading h1 {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .kc-responsive-v25 .page-heading h1 {
        max-width: min(52vw, 340px);
        font-size: clamp(15px, 4.3vw, 18px);
    }

    .kc-responsive-v25 .topbar-actions-v19 {
        flex: 0 0 auto;
        gap: 7px;
    }

    .kc-responsive-v25 .notification-bell-v19,
    .kc-responsive-v25 .menu-toggle,
    .kc-responsive-v25 .profile-dropdown summary {
        flex: 0 0 auto;
    }

    .kc-responsive-v25 .notification-panel-v19 {
        position: fixed;
        top: 72px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        max-height: calc(100dvh - 84px);
    }

    .kc-responsive-v25 .profile-popover {
        position: fixed;
        top: 72px;
        right: 10px;
        left: 10px;
        width: auto;
        max-height: calc(100dvh - 84px);
        overflow-y: auto;
    }

    .kc-responsive-v25 .content-area {
        width: 100%;
        padding: 13px 12px 26px;
    }

    .kc-responsive-v25 :where(.panel-section, .panel-v24, .content-card, .form-card, .dashboard-card) {
        border-radius: 18px;
    }

    .kc-responsive-v25 .panel-section,
    .kc-responsive-v25 .panel-v24 {
        max-width: 100%;
    }

    .kc-responsive-v25 :where(.library-heading, .split-head, .panel-head-v24, .users-v11-footer, .library-footer, .settings-savebar-v22) {
        min-width: 0;
        gap: 12px;
    }

    .kc-responsive-v25 :where(.admin-command-actions-v24, .hero-actions, .panel-actions-v24, .user-actions, .country-actions, .editor-actions, .calendar-nav-v15) {
        flex-wrap: wrap;
    }

    .kc-responsive-v25 :where(.form-grid.two, .media-fields-grid, .modern-form-grid-v14, .calendar-form-v14, .calendar-form-v15, .voice-form-grid-v18, .invite-grid-v18) {
        grid-template-columns: minmax(0, 1fr);
    }

    .kc-responsive-v25 :where(.span-2, .modern-form-grid-v14 .span-2, .calendar-form-v14 .span-2, .calendar-form-v15 .span-2) {
        grid-column: auto;
    }

    .kc-responsive-v25 .quick-grid-v24 > a,
    .kc-responsive-v25 .metric-card-v24,
    .kc-responsive-v25 .conference-card-v24,
    .kc-responsive-v25 .user-profile-card-v11,
    .kc-responsive-v25 .compact-user-card-v14 {
        min-width: 0;
    }

    .kc-responsive-v25 .table-wrap {
        margin-inline: -2px;
        border-radius: 12px;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    .kc-responsive-v25 .app-footer {
        padding-right: max(14px, env(safe-area-inset-right));
        padding-left: max(14px, env(safe-area-inset-left));
    }
}

@media (max-width: 600px) {
    .kc-responsive-v25 .content-area {
        padding-inline: 10px;
    }

    .kc-responsive-v25 .admin-command-v24,
    .kc-responsive-v25 .conference-hero-v24,
    .kc-responsive-v25 :where(.users-v11-hero, .users-list-hero-v14, .user-editor-hero-v14, .messages-command-v17, .voice-command-v17, .collab-hero-v18, .calendar-hero-v15, .settings-top-v22) {
        padding: 20px 17px;
        border-radius: 20px;
    }

    .kc-responsive-v25 .admin-command-v24 h2,
    .kc-responsive-v25 .conference-hero-v24 h2 {
        font-size: clamp(24px, 8vw, 30px);
    }

    .kc-responsive-v25 .admin-command-actions-v24,
    .kc-responsive-v25 .conference-card-actions-v24,
    .kc-responsive-v25 .panel-actions-v24,
    .kc-responsive-v25 .hero-actions {
        align-items: stretch;
    }

    .kc-responsive-v25 .admin-command-actions-v24 > *,
    .kc-responsive-v25 .conference-card-actions-v24 > *,
    .kc-responsive-v25 .panel-actions-v24 > *,
    .kc-responsive-v25 .hero-actions > * {
        flex: 1 1 100%;
        width: 100%;
    }

    .kc-responsive-v25 .metric-grid-v24,
    .kc-responsive-v25 .conference-metrics-v24 {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .kc-responsive-v25 .metric-card-v24 {
        align-items: flex-start;
        padding: 13px 11px;
    }

    .kc-responsive-v25 .metric-icon-v24 {
        width: 39px;
        height: 39px;
    }

    .kc-responsive-v25 .metric-card-v24 strong {
        font-size: 21px;
    }

    .kc-responsive-v25 .quick-center-v24,
    .kc-responsive-v25 .recent-conferences-v24,
    .kc-responsive-v25 .livekit-panel-v24,
    .kc-responsive-v25 .activity-panel-v24 {
        padding: 16px;
    }

    .kc-responsive-v25 .quick-grid-v24 > a {
        padding: 12px;
    }

    .kc-responsive-v25 .library-heading,
    .kc-responsive-v25 .library-toolbar {
        padding-inline: 13px;
    }

    .kc-responsive-v25 .mobile-post-card {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    .kc-responsive-v25 .mobile-post-media {
        min-height: 145px;
    }

    .kc-responsive-v25 .country-admin-card,
    .kc-responsive-v25 .user-card-top {
        min-width: 0;
    }

    .kc-responsive-v25 .inline-reset form,
    .kc-responsive-v25 .log-search {
        flex-direction: column;
    }

    .kc-responsive-v25 dialog,
    .kc-responsive-v25 .post-dialog,
    .kc-responsive-v25 .calendar-dialog-v14,
    .kc-responsive-v25 .calendar-dialog-v15,
    .kc-responsive-v25 .broadcast-panel-v17,
    .kc-responsive-v25 .voice-builder-panel-v17,
    .kc-responsive-v25 .contact-picker-panel-v18,
    .kc-responsive-v25 .broadcast-panel-v18,
    .kc-responsive-v25 .voice-builder-panel-v18 {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 18px;
    }
}

@media (max-width: 420px) {
    .kc-responsive-v25 .page-heading span {
        display: none;
    }

    .kc-responsive-v25 .page-heading h1 {
        max-width: 43vw;
    }

    .kc-responsive-v25 .notification-bell-v19,
    .kc-responsive-v25 .menu-toggle,
    .kc-responsive-v25 .profile-dropdown summary {
        width: 40px;
        height: 40px;
    }

    .kc-responsive-v25 .metric-grid-v24,
    .kc-responsive-v25 .conference-metrics-v24 {
        gap: 7px;
    }

    .kc-responsive-v25 .metric-card-v24 {
        min-height: 88px;
        gap: 8px;
    }

    .kc-responsive-v25 .metric-card-v24 small {
        line-height: 1.45;
    }

    .kc-responsive-v25 .mobile-post-card {
        grid-template-columns: 1fr;
    }

    .kc-responsive-v25 .mobile-post-media {
        min-height: 180px;
        max-height: 220px;
    }

    .kc-responsive-v25 .mobile-post-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Login page: fit real phone and laptop heights without horizontal overflow. */
body.login-page {
    min-width: 320px;
    overflow-x: hidden;
}

@media (max-width: 1150px) {
    .login-v2-shell,
    .login-v2-panel {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .login-v2-panel {
        padding-top: max(24px, env(safe-area-inset-top));
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 620px) {
    .login-v2-panel {
        padding-inline: 14px;
    }

    .login-v2-form-card {
        width: 100%;
        padding: 24px 18px;
    }

    .login-v2-mobile-logo img {
        width: min(170px, 55vw);
    }
}

@media (max-height: 720px) and (min-width: 621px) and (max-width: 1150px) {
    .login-v2-panel {
        justify-content: flex-start;
        overflow-y: auto;
    }

    .login-v2-mobile-logo {
        margin-bottom: 10px;
    }

    .login-v2-form-card {
        margin-block: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
