/* Responsive: 320px telefon, 7"-8" tablet ~600-800px, 10" ~1024px, 20" dev ~1920px+; her boyutta uyumlu */
:root {
    --kiosk-header-h1: clamp(22px, 4.4vmin, 62px);
    --kiosk-header-p: clamp(11px, 2vmin, 22px);
    --kiosk-banner-title: clamp(12px, 2.6vmin, 28px);
    --kiosk-banner-sub: clamp(10px, 1.8vmin, 18px);
    --kiosk-section-title: clamp(16px, 3.5vmin, 42px);
    --kiosk-card-pad: clamp(6px, 1.4vmin, 28px);
    --kiosk-grid-gap: clamp(12px, 2.5vmin, 28px);
    --kiosk-grid-min: min(120px, min(38vw, 38vh));
    --kiosk-safe-top: max(6px, env(safe-area-inset-top));
    --kiosk-safe-right: max(6px, env(safe-area-inset-right));
    --kiosk-safe-bottom: max(6px, env(safe-area-inset-bottom));
    --kiosk-safe-left: max(6px, env(safe-area-inset-left));
    /* Sayfa yatay padding: tüm ekranlarda taşmayı önler */
    --kiosk-page-pad-x: max(clamp(12px, 2.5vw, 24px), var(--kiosk-safe-left));
    --kiosk-page-pad-y: max(clamp(8px, 1.5vh, 20px), var(--kiosk-safe-top));
    --kiosk-overlay-left-width: 50%;
    --kiosk-overlay-right-width: 50%;
    --kiosk-overlay-hint-font: clamp(28px, 5vmin, 45px);
    --kiosk-overlay-media-max: 98%;
    --kiosk-overlay-logo-max: 98%;
    --kiosk-overlay-media-radius: 6px;
    --kiosk-solid-bg: #6255a4;
}

/* Kiosk sayfasında DB bildirgeci gösterilmez; versiyon kutusu genel stil ile görünür */
#siramatik-db-badge {
    display: none !important;
}

.connection-badges-kiosk {
    position: fixed !important;
    top: auto !important;
    bottom: var(--kiosk-safe-bottom) !important;
    right: var(--kiosk-safe-right) !important;
    left: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 2px !important;
    z-index: 10000 !important;
}

.connection-badges-kiosk .connection-badge {
    width: 4px !important;
    height: 4px !important;
    min-width: 4px !important;
    min-height: 4px !important;
    min-width: 6px !important;
    min-height: 6px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
}

.connection-badges-kiosk #connection-newver {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

.connection-badges-kiosk #connection-newver.connection-newver-show {
    display: inline-flex !important;
    visibility: visible !important;
    width: 6px !important;
    height: 6px !important;
    min-width: 6px !important;
    min-height: 6px !important;
    background: #dc2626 !important;
    min-width: 6px !important;
    min-height: 6px !important;
    background: #22c55e !important;
    opacity: 1 !important;
}

/* Başlangıç overlay: ekranı kaplar, firma/logo üstte büyük, uyarı altta */
/* v112: SİMETRİK SAF TABLO İSKELETİ */
.kiosk-debug-table {
    display: grid !important;
    grid-template-rows: 17vh 1fr 17vh !important; /* Header ve Footer eşit ve büyük */
    grid-template-columns: 1fr !important;
    width: 99vw !important;
    height: 99vh !important;
    position: fixed !important;
    top: 0.5vh !important;
    left: 0.5vw !important;
    z-index: 99999 !important; /* HER ŞEYİN ÜSTÜNDE */
    border: 10px solid transparent !important;
    background: var(--kiosk-solid-bg) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

.table-row-1 {
    grid-row: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border-bottom: 5px solid transparent !important;
    background: var(--kiosk-solid-bg) !important;
    color: white !important;
    padding: 0 20px !important;
}

.kiosk-start-overlay-hint {
    font-size: clamp(24px, 5vh, 48px) !important;
    font-weight: 900 !important;
    margin: 0 !important;
    color: #ff4757 !important; /* PARLAK KIRMIZI */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5) !important;
}

.table-row-2 {
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: var(--kiosk-overlay-left-width, 50%) var(--kiosk-overlay-right-width, 50%) !important;
    min-height: 0 !important;
    background: var(--kiosk-solid-bg) !important;
}

/* Başlangıç overlay: tek sütun aktifse yatayda ortala */
.kiosk-debug-table.overlay-only-logo .table-row-2,
.kiosk-debug-table.overlay-only-media .table-row-2 {
    grid-template-columns: 1fr !important;
}

.kiosk-debug-table.overlay-only-logo .table-col-right {
    display: none !important;
}

.kiosk-debug-table.overlay-only-logo .table-col-left {
    grid-column: 1 !important;
    border-right: none !important;
    width: 100% !important;
    height: 100% !important;
    justify-content: center !important;
    align-items: center !important;
}

.kiosk-debug-table.overlay-only-media .table-col-left {
    display: none !important;
}

.kiosk-debug-table.overlay-only-media .table-col-right {
    grid-column: 1 !important;
    width: 100% !important;
    height: 100% !important;
    border-right: none !important;
    justify-content: center !important;
    align-items: center !important;
}

.table-col-left {
    grid-column: 1 !important;
    border-right: 5px solid transparent !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
}

.kiosk-overlay-logo {
    max-width: var(--kiosk-overlay-logo-max) !important; /* Sol kolonun %98'i */
    max-height: var(--kiosk-overlay-logo-max) !important;
    object-fit: contain !important;
    margin-bottom: 25px !important;
}

.kiosk-overlay-firma {
    font-size: clamp(24px, 5vh, 42px) !important;
    color: white !important;
    text-align: center !important;
    margin: 0 !important;
    width: 90% !important; /* Sol kolonun %90'ı */
}

/* v117: %100 RESPONSIVE GARANTİ MODU - HER EKRANDA TAM %90 */
.table-col-right {
    grid-column: 2 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: hidden !important;
    position: relative !important;
    padding: 0 !important;
    background: transparent !important;
}

/* v125: DEMİR YUMRUK TEMİZLİĞİ - SİYAHLIK VE MAVİ KUTU TAMAMEN SÖKÜLDÜ */
.table-col-right {
    padding: 0 !important; /* Hücre içindeki tüm boşlukları öldürür */
    background: transparent !important;
    overflow: hidden !important;
}

.kiosk-overlay-media {
    display: flex !important;
    width: 100% !important; /* Hücrenin TAMAMI */
    height: 100% !important;
    margin: 0 !important;
    border-radius: var(--kiosk-overlay-media-radius) !important;
    background: #6255a4 !important; /* Boş alanlar arka plan rengi */
    overflow: hidden !important;
    position: relative !important;
    border: none !important; /* MAVİ (CYAN) KUTU ÖLDÜRÜLDÜ */
    box-shadow: none !important;
}

/* Overlay medya: slide katmanı tam alan, içerik (img/video/iframe-wrap) ortalı */
.kiosk-overlay-media .kiosk-overlay-slide {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: transparent !important;
    overflow: hidden !important;
}

.kiosk-overlay-media img,
.kiosk-overlay-media video,
.kiosk-overlay-media iframe {
    width: auto !important;
    height: auto !important;
    max-width: var(--kiosk-overlay-media-max) !important;
    max-height: var(--kiosk-overlay-media-max) !important;
    object-fit: contain !important; /* Kırpma yok, ortalı */
    border-radius: inherit !important;
    transform: none !important;
    background: transparent !important;
    border: none !important;
    /* Ön ekran (overlay) medya alanı tamamen pasif olmalı:
       - Video üstüne dokununca tarayıcı denetimleri çıkmasın
       - Tüm dokunuşlar overlay tıklaması sayılıp diğer ekrana geçsin */
    pointer-events: none !important;
}

/* Iframe/video wrapper ve slide katmanı da tıklama yakalamasın */
.kiosk-overlay-media .kiosk-overlay-slide,
.kiosk-overlay-media .kiosk-overlay-iframe-wrap,
.kiosk-overlay-media .kiosk-overlay-iframe {
    pointer-events: none !important;
}

/* YouTube/iframe: oranı koruyup ortala */
.kiosk-overlay-media .kiosk-overlay-iframe-wrap {
    width: var(--kiosk-overlay-media-max) !important;
    height: auto !important;
    max-width: var(--kiosk-overlay-media-max) !important;
    max-height: var(--kiosk-overlay-media-max) !important;
    aspect-ratio: 16 / 9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border-radius: var(--kiosk-overlay-media-radius) !important;
    overflow: hidden !important;
}

.kiosk-overlay-media .kiosk-overlay-iframe-wrap .kiosk-overlay-iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: var(--kiosk-overlay-media-radius) !important;
}

.table-row-3 {
    grid-row: 3 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border-top: 5px solid transparent !important;
    background: var(--kiosk-solid-bg) !important;
}

.kiosk-overlay-banner-capsule {
    background: rgba(139, 0, 0, 0.85) !important; /* ŞIK KOYU BORDO */
    border: 3px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 60px !important; 
    padding: 10px 40px !important; 
    width: 75% !important; 
    height: auto !important;
    margin: 2vh auto !important; /* ALTTAN VE ÜSTTEN %2 BOŞLUK (Margin-Pah) */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
}

.kiosk-overlay-banner-title {
    font-size: clamp(14px, 3vh, 26px) !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    margin: 0 !important;
}

.kiosk-overlay-banner-sub {
    font-size: clamp(10px, 2vh, 18px) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    margin: 0 !important;
}

.kiosk-start-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: var(--kiosk-solid-bg);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding: var(--kiosk-safe-top) var(--kiosk-safe-right) var(--kiosk-safe-bottom) var(--kiosk-safe-left);
    box-sizing: border-box;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.kiosk-start-overlay.kiosk-start-overlay-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.kiosk-start-overlay.kiosk-start-overlay-fading {
    opacity: 0;
    /* Tabletlerde click-through'u engellemek için fade sırasında pointer-events açık kalır */
    pointer-events: auto;
}

.kiosk-start-overlay-inner {
    display: grid;
    grid-template-rows: auto 1fr auto;
    width: 100%;
    min-height: 100%;
    min-width: 0;
    align-items: stretch;
    justify-content: stretch;
    gap: clamp(8px, 2vmin, 20px);
    overflow-x: hidden;
    box-sizing: border-box;
}

.kiosk-overlay-topbar {
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding-top: clamp(8px, 1.2vh, 18px);
}

.kiosk-start-overlay-inner.no-media .kiosk-overlay-media {
    display: none !important;
}

/* Tanıtım penceresi yok: tek kolon, logo tüm genişlikte yatay ortada ve yaklaşık 2x (tam boy) */
.kiosk-start-overlay-inner.no-media .kiosk-start-main {
    grid-template-columns: 1fr;
    justify-items: center;
}

.kiosk-start-overlay-inner.no-media .kiosk-overlay-left {
    grid-column: 1;
    width: 100%;
    max-width: 100%;
}

.kiosk-start-overlay-inner.no-media .kiosk-overlay-logo {
    width: min(800px, min(92vw, 90vmin));
    height: min(600px, min(72vmin, calc(100dvh - 240px)));
}

.kiosk-start-overlay-inner.no-media .kiosk-overlay-brand .kiosk-overlay-logo {
    margin-bottom: -52px;
}

.kiosk-start-overlay-inner.no-media .kiosk-overlay-firma {
    margin: -135px 0 0;
}

.kiosk-start-main {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: var(--kiosk-overlay-left-width) var(--kiosk-overlay-right-width);
    align-items: stretch;
    justify-items: center;
    gap: clamp(20px, 4vw, 60px);
    padding: 0 var(--kiosk-page-pad-x);
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .kiosk-start-main {
        grid-template-columns: 1.2fr 1.8fr; /* Logo daha küçük, görsel daha geniş yan yana */
        align-items: center;
        gap: clamp(10px, 2vw, 30px);
        padding: 0 clamp(8px, 2vw, 20px);
        min-height: 50vh;
    }

    .kiosk-overlay-left {
        width: 100%;
        justify-content: center;
    }

    .kiosk-overlay-media {
        width: 100%;
        max-height: 60vh;
    }
}

.kiosk-overlay-left {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: stretch; /* Ana satırın tamamını kapsasın */
    text-align: center;
    gap: 0;
    padding: 0;
    box-sizing: border-box;
    min-width: 0; /* Grid sütununda taşmayı ve yanlış genişlik hesaplarını engelle */
}


/* Geniş ekran + yatay: kolon payları yalnızca --kiosk-overlay-* ile (ayar kaydırıcısı) */
@media (min-width: 900px) and (orientation: landscape) {
    .kiosk-start-main {
        grid-template-columns: var(--kiosk-overlay-left-width) var(--kiosk-overlay-right-width);
        align-items: stretch;
    }
}

.kiosk-start-overlay-click-layer {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
}

.kiosk-overlay-brand {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Logo + firma adı arası: boşluk olmasın */
    gap: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    /* Sol sütunda video ile aynı üst hizaya kilitle (yatayda yine ortalı kalsın) */
    align-self: center;
}

.kiosk-overlay-firma {
    /* Logo ile arayı tamamen kapat */
    margin-top: 0;
}

.kiosk-overlay-cta {
    /* Firma adından sonra tam 1 satır boşluk */
    margin-top: 1lh;
    margin-top: max(1lh, 12px);
    padding: 0;
}

.kiosk-overlay-cta .kiosk-start-overlay-text {
    margin: 0;
}

.kiosk-overlay-logo {
    width: min(400px, 62vmin); /* %25 büyütüldü (320px -> 400px) */
    height: min(300px, 44vmin); /* %25 büyütüldü (240px -> 300px) */
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.kiosk-start-overlay-inner:not(.no-media) .kiosk-overlay-logo {
    width: min(70%, 100%);
    height: min(70%, 100%);
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
}

.kiosk-start-overlay-inner:not(.no-media) .kiosk-overlay-brand {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.kiosk-start-overlay-inner:not(.no-media) .kiosk-overlay-firma {
    margin: 0;
    font-size: clamp(18px, 4.2vmin, 44px);
    line-height: 1.1;
}

.kiosk-overlay-brand .kiosk-overlay-logo {
    /* Logo altındaki boşluğu minimize et */
    margin: 0;
    padding: 0;
    margin-bottom: 0;
}

.kiosk-overlay-brand .kiosk-overlay-firma {
    margin: 0;
    padding: 0;
}

.kiosk-overlay-left {
    /* Küçük ekranlarda taşmayı azalt */
    min-height: 0;
}

/* Çok küçük ekranlarda (telefon/8") logo ve metin daha agresif küçülsün.
   Tanıtım slaytı kapalı (.no-media): logo tam ekran kolunda büyüsün; aksi halde
   max-width/max-height 280px büyük kutunun width/height ile çakışıp logoyu minik gösterirdi (Pi 800x480 vb.). */
@media (max-width: 520px), (max-height: 520px) {
    .kiosk-start-overlay-inner:not(.no-media) .kiosk-overlay-logo {
        width: min(240px, 52vmin);
        height: min(240px, 52vmin);
        max-width: 280px;
        max-height: 280px;
    }

    .kiosk-header-logo {
        width: min(240px, 52vmin);
        height: min(240px, 52vmin);
        max-width: 280px;
        max-height: 280px;
    }
    .kiosk-overlay-firma {
        font-size: clamp(16px, 5vmin, 28px);
        line-height: 1.15;
    }
    .kiosk-start-overlay-text {
        font-size: clamp(14px, 4.5vmin, 24px);
        line-height: 1.25;
    }
    .kiosk-overlay-banner {
        padding: clamp(10px, 2.2vmin, 14px) clamp(12px, 2.6vmin, 16px);
        margin-bottom: 0;
    }

    .kiosk-start-overlay-inner.no-media .kiosk-overlay-logo {
        width: min(800px, min(92vw, 90vmin));
        height: min(600px, min(72vmin, calc(100dvh - 240px)));
        max-width: min(96vw, 92vmin);
        max-height: min(85dvh, 78vmin);
    }

    .kiosk-start-overlay-inner.no-media .kiosk-overlay-brand .kiosk-overlay-logo {
        margin-bottom: -36px;
    }

    .kiosk-start-overlay-inner.no-media .kiosk-overlay-firma {
        margin: -88px 0 0;
    }
}

/* Yatay dar ekran: kolon oranı ayarlardan gelir; burada sabit %42/%58 uygulanmaz */
@media (max-height: 520px) and (orientation: landscape) {
    .kiosk-start-overlay-inner:not(.no-media) {
        gap: clamp(8px, 1.8vw, 14px);
        padding: 0 var(--kiosk-page-pad-x);
    }
    .kiosk-start-overlay-inner:not(.no-media) .kiosk-overlay-brand {
        transform: none;
    }
}

.kiosk-overlay-logo img {
    width: 100%;
    height: 100%;
    max-width: var(--kiosk-overlay-logo-max);
    max-height: var(--kiosk-overlay-logo-max);
    object-fit: contain;
    object-position: center center;
    display: block;
    margin: 0 auto;
}

.kiosk-overlay-logo:empty {
    background: transparent;
}

.kiosk-overlay-firma {
    margin: -100px 0 0; /* Büyüyen logoyla orantılı artırıldı */
    font-size: clamp(30px, 6.25vmin, 65px); /* %25 büyütüldü (24px -> 30px) */
    font-weight: 800;
    color: #fff;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    line-height: 1.1;
    max-width: 100%;
    word-break: break-word;
}

.kiosk-overlay-firma.kiosk-overlay-firma--hint {
    font-size: clamp(14px, 2.8vmin, 22px);
    font-weight: 600;
    opacity: 0.92;
}

.kiosk-overlay-media {
    grid-column: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    max-height: none;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    align-self: stretch;
    margin: 0 auto;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    border: none;
    background: #6255a4 !important;
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 80vh; 
    overflow: hidden !important; 
    aspect-ratio: auto; 
    box-shadow: none !important;
    /* Medya yerleşimi: ana içerik %95, arka plan dolgu (siyah yok) */
    --kiosk-media-inset: 2.5%;
    --kiosk-media-bg: none;
}

@media (max-width: 900px) {
    .kiosk-overlay-media {
        grid-column: 2;
        max-height: 80vh;
    }
}

/* Medya her ekranda taşmasın: yüksekliği viewport'a göre sınırlansın */
@media (max-width: 900px) {
    .kiosk-overlay-media {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .kiosk-overlay-media {
        max-height: min(38vh, 38dvh);
    }
}

.kiosk-overlay-media:empty {
    display: none;
}

.kiosk-overlay-media .kiosk-overlay-demo {
    width: 100%;
    height: 100%;
    min-height: 160px;
    position: relative;
    overflow: hidden;
    border-radius: clamp(12px, 2vmin, 20px);
    background: rgba(255, 255, 255, 0.08);
}

.kiosk-overlay-demo-shape {
    position: absolute;
    border-radius: 50%;
    animation: kiosk-demo-float 8s ease-in-out infinite;
}

.kiosk-overlay-demo-shape:nth-child(1) {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.35);
    left: 10%;
    top: 20%;
    animation-delay: 0s;
}

.kiosk-overlay-demo-shape:nth-child(2) {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.25);
    right: 15%;
    top: 30%;
    animation-delay: -2s;
}

.kiosk-overlay-demo-shape:nth-child(3) {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    left: 30%;
    bottom: 25%;
    animation-delay: -4s;
}

.kiosk-overlay-demo-shape:nth-child(4) {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.3);
    right: 25%;
    bottom: 15%;
    animation-delay: -1s;
}

.kiosk-overlay-demo-shape:nth-child(5) {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.18);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -3s;
}

@keyframes kiosk-demo-float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    25% {
        transform: translate(15px, -20px) scale(1.1);
        opacity: 0.9;
    }

    50% {
        transform: translate(-10px, 10px) scale(0.95);
        opacity: 1;
    }

    75% {
        transform: translate(-20px, -15px) scale(1.05);
        opacity: 0.95;
    }
}

.kiosk-overlay-media img,
.kiosk-overlay-media video,
.kiosk-overlay-media iframe {
    position: static;
    inset: auto;
    width: auto !important;
    height: auto !important;
    max-width: var(--kiosk-overlay-media-max) !important;
    max-height: var(--kiosk-overlay-media-max) !important;
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
    border: none !important;
    border-radius: var(--kiosk-overlay-media-radius);
    margin: 0;
    display: block;
    z-index: 1;
    background: transparent !important;
}

/* YouTube/iframe: kırpma yok, ortalı */
.kiosk-overlay-media iframe {
    display: block !important;
    transform: none !important;
}

.kiosk-overlay-media .kiosk-overlay-iframe-wrap {
    width: var(--kiosk-overlay-media-max) !important;
    max-width: var(--kiosk-overlay-media-max) !important;
    height: auto !important;
    max-height: var(--kiosk-overlay-media-max) !important;
    aspect-ratio: 16 / 9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border-radius: var(--kiosk-overlay-media-radius) !important;
    overflow: hidden !important;
}

.kiosk-overlay-media .kiosk-overlay-iframe-wrap .kiosk-overlay-iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: var(--kiosk-overlay-media-radius) !important;
}

.kiosk-overlay-media .kiosk-overlay-slide {
    display: none;
    position: relative;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.kiosk-overlay-media .kiosk-overlay-slide.active {
    display: flex;
}

.kiosk-overlay-media .kiosk-overlay-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--kiosk-overlay-media-radius);
    margin: 0;
}

.kiosk-overlay-cta {
    flex-shrink: 0;
    margin: 0;
    margin-top: 0;
}

.kiosk-start-overlay-text {
    margin: 0;
    font-size: clamp(18px, 5vmin, 48px);
    font-weight: 800;
    color: #fff;
    text-align: center;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    line-height: 1.3;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* En küçük ekranlarda metin uzunluğu taşmasın */
@media (max-width: 420px), (max-height: 420px) {
    .kiosk-start-overlay-text {
        font-size: clamp(13px, 4.2vmin, 18px);
        line-height: 1.22;
        letter-spacing: 0;
    }
    .kiosk-overlay-banner .kiosk-overlay-banner-title {
        font-size: clamp(12px, 2.8vmin, 16px);
        line-height: 1.25;
    }
    .kiosk-overlay-banner .kiosk-overlay-banner-sub {
        font-size: clamp(10px, 2.4vmin, 14px);
        line-height: 1.25;
    }
}

.kiosk-overlay-banner-wrapper {
    grid-row: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(8px, 2vmin, 15px);
    width: 100%;
    /* Ekranın en altına yapışmasın, biraz daha yukarı kalksın */
    padding-bottom: clamp(12px, 3.5vh, 48px);
}

.kiosk-overlay-banner {
    width: 100%;
    max-width: min(95%, 1100px);
    padding: clamp(10px, 2.2vmin, 18px) clamp(12px, 3vmin, 26px);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: clamp(18px, 6vmin, 100px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    box-sizing: border-box;
}

.kiosk-overlay-banner .kiosk-overlay-banner-title {
    font-size: var(--kiosk-banner-title);
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.kiosk-overlay-banner .kiosk-overlay-banner-sub {
    font-size: var(--kiosk-banner-sub);
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

/* Çok dar ekranlarda balon kutuyu daha kompakt tut */
@media (max-width: 520px), (max-height: 520px) {
    .kiosk-overlay-banner-wrapper {
        gap: clamp(8px, 2vmin, 12px);
        padding-bottom: clamp(8px, 2.5vh, 28px);
    }
    .kiosk-overlay-banner {
        max-width: min(98%, 520px);
        padding: clamp(8px, 2.2vmin, 14px) clamp(10px, 3vmin, 18px);
        border-radius: clamp(14px, 5vmin, 60px);
    }
}

.kiosk-start-overlay-hint {
    font-size: var(--kiosk-overlay-hint-font);
    font-weight: 900;
    color: #e30613; /* Kurumsal kırmızı */
    text-shadow: 0 0 20px rgba(227, 6, 19, 0.4);
    letter-spacing: 2px;
    margin: 0;
    animation: kiosk-pulse-premium 1.5s ease-in-out infinite;
    text-transform: uppercase;
}

/* ==========================================================
   EKRAN BOYUTU PROFİLLERİ (Responsive + ince ayar katmanı)
   body[data-screen-profile="..."]
   ========================================================== */
body[data-screen-profile="7"] {
    --kiosk-header-h1: clamp(18px, 3.6vmin, 46px);
    --kiosk-header-p: clamp(10px, 1.8vmin, 18px);
    --kiosk-banner-title: clamp(11px, 2.2vmin, 22px);
    --kiosk-banner-sub: clamp(9px, 1.6vmin, 16px);
    --kiosk-section-title: clamp(14px, 3vmin, 30px);
    --kiosk-card-pad: clamp(4px, 1.1vmin, 16px);
    --kiosk-grid-gap: clamp(10px, 2vmin, 22px);
    --kiosk-grid-min: min(96px, min(32vw, 32vh));
    --kiosk-overlay-hint-font: clamp(18px, 3.6vmin, 28px);
}

body[data-screen-profile="8"] {
    --kiosk-header-h1: clamp(20px, 4vmin, 52px);
    --kiosk-section-title: clamp(15px, 3.2vmin, 34px);
    --kiosk-grid-min: min(105px, min(34vw, 34vh));
    --kiosk-overlay-hint-font: clamp(20px, 3.8vmin, 30px);
}

body[data-screen-profile="10"] {
    --kiosk-overlay-hint-font: clamp(22px, 4.2vmin, 34px);
}

body[data-screen-profile="15"] {
    --kiosk-overlay-hint-font: clamp(24px, 4.6vmin, 40px);
}

body[data-screen-profile="21"] {
    --kiosk-header-h1: clamp(26px, 4.8vmin, 78px);
    --kiosk-section-title: clamp(18px, 3.8vmin, 56px);
    --kiosk-grid-min: min(140px, min(40vw, 40vh));
    --kiosk-overlay-hint-font: clamp(30px, 5.2vmin, 56px);
}

@keyframes kiosk-pulse-premium {
    0%, 100% { transform: scale(1); opacity: 1; filter: brightness(1); }
    50% { transform: scale(1.05); opacity: 0.9; filter: brightness(1.2); }
}

html {
    height: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    /* Font stack: kiosk/TV cihazlarda tutarlı tipografi */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
}

body {
    background: var(--kiosk-solid-bg);
    color: white;
    text-align: center;
    padding: var(--kiosk-safe-top) var(--kiosk-safe-right) var(--kiosk-safe-bottom) var(--kiosk-safe-left);
    min-height: 100vh;
    min-height: 100dvh;
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

.header {
    margin-bottom: clamp(8px, 1.5vh, 20px);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 1.2vmin, 12px);
}

.header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Logo üstte, firma adı altta: boşluk yok denecek kadar az */
    gap: clamp(0px, 0.4vmin, 4px);
    max-width: 100%;
}

/* Ana ekran logosu: ön ekran (.kiosk-overlay-logo) ile aynı boyut mantığı */
.kiosk-header-logo {
    width: min(400px, 62vmin);
    height: min(300px, 44vmin);
    border-radius: 0;
    background: transparent;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: visible;
    box-shadow: none;
    border: none;
}

.kiosk-header-logo.kiosk-header-logo--has {
    display: flex;
}

.kiosk-header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.header h1 {
    /* Seçim ekranında firma adı daha büyük */
    font-size: clamp(44px, 7.2vmin, 140px);
    margin: 0;
    font-weight: 900;
    letter-spacing: 0.3px;
    text-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
    /* Küçük ekranlarda taşmayı engelle */
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
}

.header p {
    font-size: var(--kiosk-header-p);
    opacity: 0.9;
    transition: all 0.3s ease;
}

/* DARALMA MODU (SHRINK) */
body.has-alt-selection .header {
    margin-bottom: 5px;
}

body.has-alt-selection .header h1 {
    /* Daralma modunda da daha büyük kalsın */
    font-size: clamp(28px, 4.6vh, 56px);
}

body.has-alt-selection .header p {
    display: none;
    /* Subtitle gizle yer açmak için */
}

body.has-alt-selection .kiosk-banner {
    display: none;
    /* Banner'ı da gizle yer açmak için */
}

body.has-alt-selection #departman-secimi .kiosk-section-title {
    font-size: clamp(14px, 2.5vh, 22px);
    margin: 5px 0;
}

body.has-alt-selection #departman-listesi {
    padding-top: 5px;
    padding-bottom: 5px;
    grid-template-rows: auto;
    align-content: start;
}

body.has-alt-selection .departman-card {
    padding: clamp(6px, 1vh, 12px);
    min-height: 0;
    max-height: 80px;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    justify-content: flex-start;
}

body.has-alt-selection .departman-card .kod {
    font-size: 24px;
    margin: 0;
}

body.has-alt-selection .departman-card h2 {
    font-size: 18px;
    margin: 0;
    text-align: left;
}

body.has-alt-selection .departman-card .bekleyen {
    display: none;
}

/* Sağ Üst Geri Dön Butonu - tüm ekran boyutlarına uyumlu */
.exit-button {
    position: fixed;
    top: var(--kiosk-safe-top);
    right: var(--kiosk-safe-right);
    background: rgba(231, 76, 60, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 24px);
    border-radius: 50px;
    font-size: clamp(14px, 3.5vw, 18px);
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: none;
    align-items: center;
    gap: clamp(6px, 1.5vw, 10px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    z-index: 1000;
    will-change: transform;
    box-sizing: border-box;
}

.exit-button:hover {
    background: rgba(192, 57, 43, 1);
    /* Koyu kırmızı */
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.5);
}

.exit-button.show {
    display: flex;
    /* Gösterildiğinde flex yap */
}

.exit-button .x-icon {
    font-size: clamp(18px, 4vw, 24px);
    font-weight: bold;
    line-height: 1;
}

/* 1 saniyelik kısa uyarı (Tamam gerektirmez) */
#kiosk-brief-toast {
    display: none;
    position: fixed;
    bottom: 28%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: clamp(14px, 2.5vw, 18px);
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#kiosk-brief-toast.show {
    display: block;
}

.departman-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--kiosk-grid-min), 1fr));
    gap: var(--kiosk-grid-gap);
    row-gap: var(--kiosk-grid-gap);
    column-gap: var(--kiosk-grid-gap);
    width: 100%;
    max-width: 100%;
    margin: 0;
    flex: 1;
    min-height: 0;
    align-content: center;
    padding: var(--kiosk-page-pad-y) clamp(6px, 1vw, 16px);
    box-sizing: border-box;
}

.departman-card {
    background: white;
    color: #667eea;
    padding: var(--kiosk-card-pad);
    border-radius: clamp(10px, 2vmin, 24px);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    max-height: min(45vh, 45dvh);
    overflow: hidden;
    will-change: transform;
    box-sizing: border-box;
}

.departman-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.departman-card h2 {
    font-size: clamp(12px, 2.2vmin, 32px);
    margin: clamp(2px, 0.8vh, 12px) 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.departman-card .kod {
    font-size: clamp(18px, 4vmin, 52px);
    font-weight: bold;
    color: #764ba2;
}

.departman-card .bekleyen {
    font-size: clamp(9px, 1.4vmin, 18px);
    color: #666;
    margin-top: 2px;
}

#departman-secimi {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Düzeltme: hidden yerine auto — çok departman varsa kaydırmayı etkinleştirir */
    overflow-x: hidden;
    overflow-y: auto;
}

#alt-secenekler-konteynir {
    flex: 1;
    min-height: 0;
    display: none;
    flex-direction: column;
    justify-content: center;
    margin-top: clamp(8px, 1.5vh, 20px) !important;
    padding: clamp(10px, 2vw, 20px) !important;
    overflow: hidden;
}

/* ==========================================================
   BİLET EKRANI — Rijit responsive: asla taşma, asla scroll
   Strateji: vmin birimleri + orientation tabanlı layout
   vmin = min(viewport_w, viewport_h) → her iki yönde de ölçeklenir
   ========================================================== */

/* ==========================================================
   BİLET EKRANI (RESIZABLE & RIGID SYSTEM) — v260302.255
   ========================================================== */

#numara-ekrani {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 2vmin, 20px);
    overflow: hidden;
}

.bilet-main-wrapper {
    width: min(1200px, 100%);
    max-height: 98dvh;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 2vh, 24px);
    align-items: center;
    justify-content: center;
}

.bilet-konteynir {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(12px, 3vmin, 40px);
    width: 100%;
    align-items: stretch;
    justify-content: center;
}

/* --- TELEFON & KÜÇÜK EKRAN OPTİMİZASYONU --- */
@media (max-width: 850px) {
    /* Yatay Taşma Engeli (Landscape Squeeze) */
    @media (orientation: landscape) {
        .bilet-konteynir {
            gap: 12px;
            grid-template-columns: 1.1fr 1fr;
        }

        .bilet-panel-info,
        .bilet-panel-action {
            padding: 12px !important;
        }

        .bilet-box-number .numara {
            font-size: clamp(35px, 20vh, 85px);
        }

        .bilet-qr-card {
            width: min(120px, 35vh);
            padding: 8px;
        }

        .bilet-box-header h2 {
            font-size: clamp(12px, 3vh, 18px);
        }

        .bilet-btn-print {
            padding: 8px 16px;
            font-size: 14px;
        }
    }

    /* Dikey Taşma Engeli (Portrait Squeeze) */
    @media (orientation: portrait) {
        .bilet-konteynir {
            grid-template-columns: 1fr;
            max-width: 95vw;
            gap: 12px;
        }

        .bilet-panel-info,
        .bilet-panel-action {
            padding: 15px !important;
        }

        .bilet-box-number .numara {
            font-size: clamp(45px, 12vh, 110px);
        }

        .bilet-qr-card {
            width: min(220px, 35vh);
            padding: 12px;
        }

        .bilet-box-details {
            gap: 8px;
        }

        .bilet-btn-print {
            padding: 12px 20px;
            font-size: clamp(14px, 2.5vh, 20px);
        }
    }
}

/* --- BİLET BİLGİ KARTI --- */
.bilet-panel-info {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: clamp(15px, 3vmin, 30px);
    padding: clamp(15px, 4vmin, 60px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: clamp(6px, 1.2vh, 18px);
}

.bilet-box-header h2 {
    font-size: clamp(14px, 3.2vmin, 28px);
    letter-spacing: 2px;
    opacity: 0.9;
    margin: 0;
    font-weight: 800;
}

.bilet-box-number .numara {
    font-size: clamp(50px, 18vmin, 140px);
    font-weight: 900;
    line-height: 1;
    color: #fff;
    margin: 5px 0;
    text-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.bilet-box-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(4px, 0.8vh, 10px);
    width: 100%;
}

.bilet-box-details .mesaj {
    font-size: clamp(12px, 2.4vmin, 21px);
    opacity: 0.9;
    font-weight: 500;
}

.bilet-box-details .bekleme-info {
    font-size: clamp(10px, 2vmin, 16px);
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 18px;
    border-radius: 99px;
    font-weight: 600;
}

.bilet-box-details .tahmini-bekleme {
    font-size: clamp(12px, 2.2vmin, 20px);
    font-weight: 900;
    color: #ffd700;
}

.bilet-box-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 5px;
}

.bilet-btn-print {
    background: #10b981;
    color: white;
    border: none;
    padding: clamp(12px, 2.8vmin, 24px) clamp(20px, 4.5vmin, 45px);
    border-radius: clamp(10px, 2vmin, 18px);
    font-size: clamp(14px, 2.5vmin, 24px);
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bilet-btn-print:active {
    transform: scale(0.96);
}

/* --- KAREKOD AKSİYON KARTI --- */
.bilet-panel-action {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: clamp(15px, 3vmin, 30px);
    padding: clamp(12px, 3.2vmin, 35px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 2.5vh, 32px);
}

.bilet-qr-card {
    background: white;
    padding: clamp(12px, 3vmin, 30px);
    border-radius: clamp(15px, 3vmin, 30px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(290px, 46vmin);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.bilet-qr-footer {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bilet-qr-label {
    color: #1e293b;
    font-weight: 900;
    font-size: clamp(12px, 2.2vmin, 19px);
    margin: 0;
}

.bilet-qr-timer {
    color: #f43f5e;
    font-weight: 800;
    font-size: clamp(10px, 1.8vmin, 15px);
    margin-top: 2px;
    display: block;
    min-height: 1.2em;
}

.bilet-panel-nav {
    width: 100%;
}

.bilet-btn-back {
    background: #ef4444;
    /* KIRMIZI BUTON */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: clamp(12px, 2.8vmin, 20px);
    border-radius: 15px;
    font-size: clamp(13px, 2.3vmin, 19px);
    font-weight: 900;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
    text-transform: uppercase;
}

.bilet-btn-back:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.5);
}

.bilet-btn-back:active {
    transform: translateY(0);
}

@keyframes kiosk-qr-akilli-parlaklik {
    0% {
        box-shadow:
            0 0 0 3px rgba(74, 222, 128, 0.7),
            0 12px 36px rgba(22, 101, 52, 0.6);
    }

    100% {
        box-shadow:
            0 0 0 5px rgba(134, 239, 172, 0.95),
            0 0 32px 8px rgba(74, 222, 128, 0.55),
            0 16px 48px rgba(22, 101, 52, 0.75);
    }
}

/* Karekod okundu: yalnızca yeşil kutu (ortada, çok büyük) */
#numara-ekrani #qr-akilli-mesaj.bilet-smart-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    z-index: 200;
    width: min(96vw, 960px);
    max-width: min(96vw, 960px);
    box-sizing: border-box;
    margin: 0;
    padding: clamp(36px, 7vmin, 72px) clamp(40px, 7.5vmin, 80px);
    font-size: clamp(26px, 5.8vmin, 52px);
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.32;
    text-align: center;
    color: #fff;
    background: linear-gradient(180deg, #22c55e 0%, #15803d 50%, #14532d 100%);
    border: 8px solid #86efac;
    border-radius: clamp(22px, 3.5vmin, 34px);
    box-shadow:
        0 0 0 3px rgba(74, 222, 128, 0.7),
        0 12px 36px rgba(22, 101, 52, 0.6);
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.45),
        0 0 12px rgba(255, 255, 255, 0.35);
    animation: kiosk-qr-akilli-parlaklik 1.1s ease-in-out infinite alternate;
}

/* Animasyonlar */
@keyframes biletSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes biletSlideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.info-section {
    box-sizing: border-box;
}


/* print-btn: vmin ile her ekrana uyar */
.print-btn {
    background: #2ecc71;
    color: white;
    border: none;
    padding: clamp(6px, 1.6vmin, 18px) clamp(10px, 2.2vmin, 30px);
    border-radius: clamp(6px, 1.5vmin, 15px);
    font-size: clamp(11px, 2vmin, 20px);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1.2vmin, 10px);
    width: 100%;
    max-width: min(320px, 95%);
    /* Yatayda yayılmasını engelle */
    margin: clamp(4px, 1.2vmin, 18px) auto 0;
    box-shadow: 0 6px 18px rgba(46, 204, 113, 0.3);
    box-sizing: border-box;
}


.print-btn:hover {
    transform: scale(1.03);
    background: #27ae60;
}

/* QR paneli: vmin ile her ekrana uyar */
.qr-section {
    background: white;
    padding: clamp(8px, 2vmin, 26px);
    border-radius: clamp(10px, 2vmin, 26px);
    color: #2c3e50;
    text-align: center;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
    width: 100%;
    /* vmin: her yönde ekrana oranlı QR kutusu */
    max-width: min(280px, 35vmin);
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(2px, 0.8vmin, 8px);
    min-height: 0;
}

@media (max-height: 480px) {
    .qr-section {
        padding: clamp(4px, 1vmin, 10px);
        gap: 2px;
    }

    .qr-section p {
        font-size: 0.8em;
        margin: 2px 0;
    }
}

.qr-section p {
    margin: clamp(4px, 1vmin, 10px) 0 0;
    font-size: clamp(12px, 2.2vmin, 20px);
    font-weight: bold;
}

#qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    height: auto;
    padding: clamp(4px, 1vw, 6px);
    background: white;
}

#qrcode canvas,
#qrcode img {
    /* vmin ile her yönde oranlı boyut — kısa ekranlarda daha da küçük */
    max-width: min(200px, 26vmin) !important;
    max-height: min(200px, 26vmin) !important;
    width: auto !important;
    height: auto !important;
}

.numara-ekrani-cikis-bar {
    position: absolute;
    top: var(--kiosk-safe-top);
    right: var(--kiosk-safe-right);
    left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, 1vmin, 8px);
    padding: clamp(4px, 1vmin, 10px) clamp(8px, 1.8vmin, 16px);
    background: rgba(231, 76, 60, 0.95);
    color: white;
    font-size: clamp(12px, 2.6vmin, 22px);
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    border-radius: 999px;
}

.numara-ekrani-cikis-bar:hover {
    background: rgba(192, 57, 43, 1);
}

.numara-ekrani-cikis-yazi {
    display: none;
}

.numara-ekrani-cikis-x {
    font-size: clamp(18px, 3.8vmin, 30px);
    line-height: 1;
    opacity: 0.95;
}

.qr-section .back-btn {
    padding: clamp(4px, 1.2vmin, 10px) clamp(8px, 2vmin, 16px);
    font-size: clamp(10px, 1.8vmin, 14px);
    font-weight: 800;
    margin: 4px 0 0;
    background: rgba(231, 76, 60, 0.95);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    width: 90%;
    border-radius: 4px;
}

.qr-section .back-btn:hover {
    background: rgba(192, 57, 43, 1);
}

#qr-sayac {
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: clamp(4px, 1vmin, 10px);
    font-size: clamp(10px, 1.8vmin, 15px);
}

.qr-aciklama {
    font-size: clamp(11px, 1.8vw, 13px);
    color: #7f8c8d;
    margin-bottom: clamp(8px, 1.5vw, 12px);
    text-align: center;
}

#numara-ekrani .qr-akilli-mesaj-dis {
    width: 100%;
    max-width: 100%;
    margin-top: clamp(6px, 1.4vmin, 18px);
    padding: clamp(10px, 2.2vmin, 24px) clamp(12px, 2.8vmin, 36px);
    background: #1e40af;
    color: #fff;
    border-radius: clamp(8px, 2vmin, 18px);
    font-size: clamp(11px, 2.6vmin, 24px);
    font-weight: 800;
    text-align: center;
    line-height: 1.3;
    box-shadow: 0 6px 24px rgba(30, 64, 175, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    box-sizing: border-box;
}



.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.back-btn-large {
    padding: clamp(14px, 2.5vw, 24px) clamp(24px, 4vw, 40px) !important;
    font-size: clamp(16px, 3vw, 24px) !important;
    font-weight: bold;
    width: 100%;
    margin-top: clamp(12px, 2vh, 20px);
    color: #333;
    border-color: #333;
}

/* Dijital Fiş Tasarımı */
#fis-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: var(--kiosk-safe-top) var(--kiosk-safe-right) var(--kiosk-safe-bottom) var(--kiosk-safe-left);
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

/* Otomatik fiş mesajı: tarama süresi geçtiği için yazdırıldı bilgisi */
#fis-otomatik-mesaj {
    display: none;
    max-width: 420px;
    width: 90%;
    margin-bottom: 12px;
    padding: 12px 16px;
    background: rgba(255, 193, 7, 0.95);
    color: #1a1a1a;
    border-radius: 10px;
    font-size: clamp(12px, 2.2vw, 15px);
    line-height: 1.4;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    user-select: none;
}

#fis-otomatik-mesaj.show {
    display: block;
}

.fis-paper {
    background: white;
    color: #333;
    width: min(320px, calc(100vw - 2 * var(--kiosk-page-pad-x)), 90vw);
    max-width: 360px;
    padding: clamp(12px, 2vmin, 24px) clamp(12px, 2vmin, 20px);
    border-radius: clamp(6px, 1vmin, 10px);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    position: relative;
    font-family: 'Courier New', Courier, monospace;
    text-align: center;
    animation: slideDown 0.5s ease;
    box-sizing: border-box;
}

.fis-paper #fis-hospital {
    font-size: clamp(16px, 3.2vmin, 26px) !important;
    margin-bottom: 0 !important;
}

.fis-paper #fis-numara {
    font-size: clamp(32px, 10vmin, 56px) !important;
}

.fis-paper #fis-kuyruk {
    font-size: clamp(12px, 2.5vmin, 18px) !important;
}

.fis-paper #fis-tarih {
    font-size: clamp(9px, 1.8vmin, 12px) !important;
}

.fis-paper #fis-qrcode canvas,
.fis-paper #fis-qrcode img {
    max-width: min(88px, 24.3vw) !important;
    height: auto !important;
}

.fis-paper::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: linear-gradient(-45deg, white 5px, transparent 0), linear-gradient(45deg, white 5px, transparent 0);
    background-size: 10px 15px;
    background-repeat: repeat-x;
}

@keyframes slideDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.departman-card.active {
    background: #ffd700;
    color: #1a1a2e;
    transform: scale(1.05);
    box-shadow: 0 0 30px #ffd700;
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
    will-change: opacity, transform;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sol alt: görünmez dokunma alanı → tek dokunuşta çark (parmak için min. ~88px) */
.kiosk-settings-reveal-zone {
    position: fixed;
    bottom: max(4px, calc(var(--kiosk-safe-bottom) - 8px));
    left: max(4px, calc(var(--kiosk-safe-left) - 8px));
    width: clamp(88px, 15vmin, 128px);
    height: clamp(88px, 15vmin, 128px);
    z-index: 999;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.kiosk-settings-reveal-zone--off {
    display: none !important;
    pointer-events: none !important;
}

/* Sol Alt Ayarlar Butonu (başlangıçta gizli) */
.settings-button {
    position: fixed;
    bottom: var(--kiosk-safe-bottom);
    left: var(--kiosk-safe-left);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    width: clamp(calc(40px * 1.2), calc(10vmin * 1.2), calc(56px * 1.2));
    height: clamp(calc(40px * 1.2), calc(10vmin * 1.2), calc(56px * 1.2));
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.3s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(calc(18px * 1.2), calc(4vmin * 1.2), calc(26px * 1.2));
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-width: clamp(calc(40px * 1.2), calc(10vmin * 1.2), calc(56px * 1.2));
    min-height: clamp(calc(40px * 1.2), calc(10vmin * 1.2), calc(56px * 1.2));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.settings-button--revealed {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.settings-button--revealed:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
}

@keyframes kioskGearTapPulse {
    0%,
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.35), 0 6px 22px rgba(0, 0, 0, 0.35);
    }
}

.settings-button--revealed.settings-button--tap-feedback {
    animation: kioskGearTapPulse 0.38s ease;
}

/* Ayarlar Modal */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: var(--kiosk-safe-top) var(--kiosk-safe-right) var(--kiosk-safe-bottom) var(--kiosk-safe-left);
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.settings-panel {
    background: white;
    color: #333;
    padding: clamp(12px, 2.5vw, 25px);
    border-radius: clamp(12px, 2vw, 20px);
    max-width: min(1200px, calc(100vw - 2 * var(--kiosk-page-pad-x)));
    width: 100%;
    max-height: calc(100vh - 2 * var(--kiosk-page-pad-y));
    max-height: calc(100dvh - 2 * var(--kiosk-page-pad-y));
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.settings-panel h2 {
    flex-shrink: 0;
    margin-bottom: 10px;
}

.settings-panel>p {
    flex-shrink: 0;
    margin-bottom: 15px;
}

.settings-panel .settings-grid {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 10px;
}

.settings-panel .settings-grid::-webkit-scrollbar {
    width: 6px;
}

.settings-panel .settings-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.settings-panel .settings-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.settings-panel .settings-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Sekmeli kiosk ayarları: daha geniş panel, gruplar yan yana */
.settings-panel--tabs {
    position: relative;
    max-width: min(1420px, calc(100vw - 2 * var(--kiosk-page-pad-x)));
    width: 100%;
    min-height: min(560px, 72dvh);
    max-height: calc(100dvh - 2 * var(--kiosk-page-pad-y));
    padding: clamp(14px, 2.2vw, 28px);
}

.settings-panel-head {
    flex-shrink: 0;
    padding-bottom: clamp(10px, 1.6vh, 16px);
    margin-bottom: 0;
    border-bottom: 1px solid #e2e8f0;
}

.settings-panel-head h2 {
    margin-top: 0;
    margin-bottom: clamp(4px, 0.8vh, 8px);
}

.settings-panel-head .settings-desc {
    margin: 0;
    color: #64748b;
    font-size: clamp(12px, 1.7vmin, 15px);
    line-height: 1.45;
}

.kiosk-settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    flex-shrink: 0;
    padding: clamp(12px, 1.8vh, 18px) 0;
    border-bottom: 1px solid #e2e8f0;
}

.kiosk-settings-tab {
    margin: 0 !important;
    padding: clamp(10px, 1.6vmin, 14px) clamp(14px, 2.2vmin, 20px) !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: clamp(12px, 1.7vmin, 15px) !important;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.kiosk-settings-tab:hover {
    border-color: #c7d2fe !important;
    background: #eef2ff !important;
    color: #4338ca !important;
}

.kiosk-settings-tab--active {
    border-color: #6366f1 !important;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%) !important;
    color: #3730a3 !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.kiosk-settings-panels-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-top: 4px;
}

.kiosk-settings-tab-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    animation: kiosk-tab-fade 0.2s ease;
}

@keyframes kiosk-tab-fade {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

.kiosk-settings-tab-panel--active {
    display: flex;
}

.settings-tab-inner {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: clamp(14px, 2vh, 22px) 6px 8px 2px;
    box-sizing: border-box;
}

.settings-tab-inner::-webkit-scrollbar {
    width: 8px;
}

.settings-tab-inner::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.settings-tab-inner::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

.settings-device-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(14px, 2.2vw, 28px);
    align-items: start;
}

.settings-queue-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(14px, 2.2vw, 24px);
    align-items: start;
}

.settings-tab-inner--queue .settings-queue-two-cols {
    margin-bottom: clamp(12px, 2vh, 20px);
}

.settings-section--wide {
    grid-column: 1 / -1;
}

@media (max-width: 960px) {

    .settings-device-cols,
    .settings-queue-two-cols {
        grid-template-columns: 1fr;
    }
}

.password-modal-actions--simple {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
}

.password-modal-actions--simple .password-modal-btn-confirm,
.password-modal-actions--simple .password-modal-btn-cancel {
    min-height: clamp(48px, 11vmin, 56px);
}

.settings-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.settings-inline-actions .btn-save {
    margin: 0 !important;
}

.settings-small-note--indented {
    margin-left: clamp(22px, 4vmin, 32px);
}

.settings-print-status {
    margin-top: 8px;
    min-height: 1.2em;
}

.settings-desc--compact {
    margin-bottom: clamp(12px, 2vh, 18px) !important;
}

.settings-section--danger-zone {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 40%, #fff 100%);
}

.settings-danger-hint {
    margin-top: 8px;
    margin-bottom: clamp(16px, 2.5vh, 22px);
    color: #92400e;
}

.kiosk-exit-kiosk-btn--settings {
    max-width: 420px;
    width: 100%;
}

.settings-btn-kiosk-reset {
    margin-top: 4px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.kiosk-exit-confirm-layer--settings {
    position: absolute;
    inset: 0;
    z-index: 30;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(4px);
    justify-content: center;
    padding: clamp(24px, 5vmin, 48px);
}

.settings-panel--tabs .settings-footer-actions {
    margin-top: clamp(10px, 2vh, 18px);
    padding-top: clamp(12px, 2vh, 20px);
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Düzeltme: sabit px → clamp (telefon + TV uyumu) */
    gap: clamp(10px, 2vw, 20px);
    margin-top: clamp(8px, 1.5vh, 15px);
    margin-bottom: clamp(6px, 1vh, 10px);
}

@media (max-width: 900px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .settings-panel {
        max-height: calc(100dvh - 24px);
    }
}

.settings-section {
    background: #f8fafc;
    /* Düzeltme: sabit 15px → clamp */
    padding: clamp(10px, 2vw, 15px);
    border-radius: clamp(8px, 1.5vw, 12px);
    border: 1px solid #e2e8f0;
}

.settings-section h3 {
    margin-top: 0;
    margin-bottom: clamp(8px, 1.5vw, 15px);
    /* Düzeltme: sabit 16px → clamp */
    font-size: clamp(13px, 2vw, 17px);
    color: #1e293b;
    font-weight: 600;
}

.settings-section-full {
    grid-column: 1 / -1;
}

.settings-panel h2 {
    margin-top: 0;
    color: #667eea;
}

.settings-panel label {
    display: block;
    margin: 15px 0 5px;
    font-weight: bold;
}

.settings-panel select {
    width: 100%;
    padding: clamp(6px, 1.2vw, 10px);
    border: 2px solid #ddd;
    border-radius: 8px;
    /* Düzeltme: sabit 16px → clamp */
    font-size: clamp(13px, 1.8vw, 16px);
}

.settings-panel button {
    margin: clamp(6px, 1vw, 10px) 5px;
    padding: clamp(8px, 1.5vw, 12px) clamp(14px, 2.5vw, 24px);
    border: none;
    border-radius: 8px;
    /* Düzeltme: sabit 16px → clamp */
    font-size: clamp(13px, 1.8vw, 16px);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-save {
    background: #22c55e;
    color: white;
}

.btn-save:hover {
    background: #16a34a;
}

.btn-cancel {
    background: #e74c3c;
    color: white;
}

.btn-cancel:hover {
    background: #c0392b;
}

.btn-reset {
    background: #f39c12;
    color: white;
}

.btn-reset:hover {
    background: #d68910;
}

/* Akıllı takip bannerı - tüm ekran boyutlarına uyumlu */
.kiosk-banner {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: clamp(8px, 1.5vh, 15px) clamp(10px, 2vw, 25px);
    border-radius: clamp(8px, 1.5vw, 15px);
    margin: 0 auto clamp(6px, 1vh, 15px);
    max-width: min(900px, calc(100vw - 2 * var(--kiosk-page-pad-x)));
    box-shadow: 0 8px 30px rgba(245, 87, 108, 0.4);
    animation: pulse 3s infinite;
    will-change: transform;
    flex-shrink: 0;
    box-sizing: border-box;
}

.kiosk-banner-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 2vw, 20px);
    flex-wrap: wrap;
}

.kiosk-banner-icon {
    font-size: clamp(24px, 5vw, 48px);
}

.kiosk-banner-text {
    text-align: left;
}

.kiosk-banner-title {
    font-size: var(--kiosk-banner-title);
    font-weight: bold;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.kiosk-banner-sub {
    font-size: var(--kiosk-banner-sub);
    opacity: 0.95;
}

.kiosk-section-title {
    font-size: var(--kiosk-section-title);
    margin-bottom: clamp(12px, 2vh, 40px);
    flex-shrink: 0;
}

.alt-secenekler-konteynir {
    display: none;
    flex: 1;
    width: 100%;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
    margin-top: clamp(12px, 2vh, 50px);
    padding: clamp(8px, 1.8vw, 32px);
    /* Seçim ekranında alanın rengi değişmesin */
    background: transparent;
    border-radius: clamp(12px, 2vw, 30px);
    /* Çerçeve çizgisini görünmez yap (UI yormasın) */
    border: 2px dashed transparent;
    overflow: hidden;
}

.kiosk-alt-baslik {
    font-size: clamp(18px, 3.5vw, 32px);
    margin-bottom: clamp(12px, 2vh, 30px);
    color: #ffd700;
    flex-shrink: 0;
}

.kiosk-alt-baslik:empty {
    display: none;
    margin: 0;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

/* Ekran yönü: bilet konteyneri her zaman sayfa padding’ine uyar */
body.orientation-portrait .bilet-konteynir {
    max-width: min(520px, 100%);
    margin: 0 auto;
}

body.orientation-landscape .bilet-konteynir {
    max-width: min(1200px, calc(100vw - 2 * var(--kiosk-page-pad-x)));
}

/* Yatay ekranda (özellikle tabletler) genel küçültme:
   - Kartlar, başlıklar ve banner daha kompakt
   - Tüm içerik dikeyde ekrana sığmaya daha yatkın */
body.orientation-landscape {
    --kiosk-header-h1: clamp(20px, 3.6vmin, 56px);
    --kiosk-header-p: clamp(10px, 1.6vmin, 18px);
    --kiosk-banner-title: clamp(11px, 2.2vmin, 22px);
    --kiosk-banner-sub: clamp(9px, 1.6vmin, 16px);
    --kiosk-section-title: clamp(14px, 3vmin, 32px);
    --kiosk-card-pad: clamp(4px, 1vmin, 18px);
    --kiosk-grid-gap: clamp(12px, 2vmin, 24px);
    --kiosk-grid-min: min(100px, min(32vw, 32vh));
}

body.orientation-landscape .kiosk-banner {
    padding: clamp(6px, 1vh, 10px) clamp(8px, 1.4vw, 18px);
    max-width: min(820px, calc(100vw - 2 * var(--kiosk-page-pad-x)));
}

body.orientation-landscape .departman-card {
    max-height: min(32vh, 32dvh);
}

body.orientation-landscape .departman-card .kod {
    font-size: clamp(16px, 3.2vmin, 42px);
}

body.orientation-landscape .departman-card h2 {
    font-size: clamp(11px, 2vmin, 26px);
}

body.orientation-landscape .departman-card .bekleyen {
    font-size: clamp(8px, 1.2vmin, 14px);
}

body.orientation-landscape .kiosk-alt-baslik {
    font-size: clamp(16px, 3vmin, 26px);
}

body.orientation-landscape .alt-secenekler-konteynir {
    margin-top: clamp(8px, 1.2vh, 20px);
    padding: clamp(6px, 1.4vw, 26px);
}

/* ==========================================================
   DEBUG GRID (ÖN EKRAN) — ?debug=1 veya ?grid=1
   ========================================================== */
body[data-debug-grid="1"] #kiosk-start-overlay-inner {
    outline: 2px dashed rgba(255, 255, 255, 0.65);
    outline-offset: -8px;
}

/* Debug çizgileri görünür olsun diye tıklama katmanını kapat */
body[data-debug-grid="1"] .kiosk-start-overlay-click-layer {
    display: none !important;
}

/* Overlay’in kendisini de çerçevele (en üstte görünsün) */
body[data-debug-grid="1"] #kiosk-start-overlay {
    outline: 3px dashed rgba(255, 255, 255, 0.8);
    outline-offset: -6px;
}

body[data-debug-grid="1"] .kiosk-start-main {
    outline: 3px solid rgba(34, 197, 94, 0.95); /* yeşil: ana 2 kolon alanı */
    outline-offset: -3px;
    position: relative;
}

body[data-debug-grid="1"] .kiosk-start-main::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(34, 197, 94, 0.95);
    transform: translateX(-1px);
    pointer-events: none;
}

body[data-debug-grid="1"] .kiosk-overlay-left {
    outline: 3px solid rgba(59, 130, 246, 0.95); /* mavi: sol kolon */
    outline-offset: -3px;
}

body[data-debug-grid="1"] .kiosk-overlay-media {
    outline: 3px solid rgba(239, 68, 68, 0.95); /* kırmızı: video kolonu */
    outline-offset: -3px;
}

body[data-debug-grid="1"] .kiosk-overlay-banner--bottom {
    outline: 3px solid rgba(250, 204, 21, 0.95); /* sarı: alt şerit */
    outline-offset: -3px;
}

/* Çok küçük ekran (telefon): grid tek/çift sütun, kartlar sığsın */
@media (max-width: 400px) {
    :root {
        --kiosk-grid-min: min(85px, min(45vw, 45vh));
    }
}

/* Küçük ekranlar ve dikey: grid hücreleri ekrana sığsın */
@media (max-width: 600px),
(max-height: 500px) {
    :root {
        --kiosk-grid-min: min(100px, min(42vw, 42vh));
    }
}

/* Dikey ekran: bölüm kartları daha kompakt */
@media (orientation: portrait) {
    .departman-grid {
        align-content: start;
        padding-top: clamp(8px, 2vh, 20px);
    }

    .departman-card {
        max-height: min(35vh, 35dvh);
    }
}

/* Küçük ekranlarda bilet ekranı tek kolon (yukarıdaki clamp’ler boyutları zaten ölçekliyor) */
@media (max-width: 700px) {
    .qr-section {
        justify-self: center;
    }
}

/* Yazıcı: Sadece fiş içeriği basılsın */
@media print {
    body * {
        visibility: hidden;
    }

    #fis-modal,
    #fis-modal * {
        visibility: visible;
    }

    #fis-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #fff;
        display: flex !important;
        justify-content: center;
        align-items: center;
        z-index: 99999;
    }

    .fis-paper {
        box-shadow: none;
    }

    .back-btn-large {
        display: none !important;
    }
}

/* ==========================================================
   YENİ RESPONSIVE SINIFLAR — HTML inline style temizliği
   ========================================================== */

/* Bağlantı durum göstergesi: safe-area farkında, clamp font */
.connection-status-bar {
    position: fixed;
    top: max(15px, env(safe-area-inset-top, 15px));
    right: max(15px, env(safe-area-inset-right, 15px));
    display: none;
    background: #f39c12;
    color: white;
    text-align: center;
    padding: clamp(6px, 1.2vw, 10px) clamp(10px, 1.8vw, 14px);
    z-index: 99999;
    font-weight: bold;
    font-size: clamp(11px, 1.5vmin, 14px);
    border-radius: 20px;
    min-width: clamp(100px, 15vw, 140px);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* Şifre modalı: küçük telefon + TV uyumlu */
.password-ask-modal-wrap {
    z-index: 11000;
}

.password-modal-panel {
    max-width: min(400px, calc(100vw - 32px));
    text-align: center;
    position: relative;
    overflow: hidden;
}

.password-modal-main-block {
    position: relative;
    z-index: 1;
}

.password-modal-icon {
    font-size: clamp(28px, 8vmin, 48px);
    margin-bottom: clamp(12px, 2.5vmin, 22px);
}

.password-modal-title {
    margin-bottom: clamp(10px, 2vmin, 16px);
    color: #2c3e50;
    font-size: clamp(16px, 3vmin, 22px);
}

.password-modal-desc {
    color: #7f8c8d;
    font-size: clamp(12px, 2vmin, 15px);
    margin-bottom: clamp(14px, 2.5vmin, 22px);
}

.password-modal-input {
    width: 100%;
    padding: clamp(10px, 2vmin, 16px);
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: clamp(18px, 4vmin, 26px);
    text-align: center;
    margin-bottom: clamp(16px, 3vmin, 26px);
    outline: none;
    box-sizing: border-box;
}

.password-modal-actions {
    display: flex;
    gap: clamp(6px, 1.5vw, 12px);
}

.password-modal-actions--kiosk-touch {
    flex-direction: column;
    align-items: stretch;
    gap: clamp(10px, 2vmin, 16px);
}

.kiosk-exit-kiosk-btn {
    width: 100%;
    min-height: clamp(48px, 12vmin, 56px);
    padding: clamp(12px, 2.5vmin, 16px) clamp(14px, 3vmin, 20px);
    margin: 0;
    border: none;
    border-radius: 12px;
    background: #ef4444;
    color: #fff;
    font-weight: 700;
    font-size: clamp(14px, 3vmin, 17px);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.kiosk-exit-kiosk-btn:active {
    filter: brightness(0.92);
}

.password-modal-actions-inline {
    display: flex;
    flex-direction: row;
    gap: clamp(6px, 1.5vw, 12px);
    width: 100%;
}

.password-modal-actions-inline .password-modal-btn-confirm {
    flex: 2;
    margin: 0 !important;
    min-height: clamp(44px, 10vmin, 52px);
    touch-action: manipulation;
}

.password-modal-actions-inline .password-modal-btn-cancel {
    flex: 1;
    margin: 0 !important;
    min-height: clamp(44px, 10vmin, 52px);
    touch-action: manipulation;
}

.kiosk-exit-confirm-layer {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 4;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: clamp(16px, 4vmin, 28px);
    box-sizing: border-box;
    background: #fff;
    text-align: center;
}

.kiosk-exit-confirm-layer--visible {
    display: flex;
}

.kiosk-exit-confirm-title {
    margin: 0 0 clamp(10px, 2vmin, 14px);
    color: #2c3e50;
    font-size: clamp(17px, 3.5vmin, 22px);
    font-weight: 700;
    line-height: 1.3;
}

.kiosk-exit-confirm-desc {
    margin: 0 0 clamp(20px, 4vmin, 28px);
    color: #7f8c8d;
    font-size: clamp(13px, 2.5vmin, 16px);
    line-height: 1.45;
}

.kiosk-exit-confirm-actions {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2vmin, 14px);
}

.kiosk-exit-confirm-yes,
.kiosk-exit-confirm-no {
    width: 100%;
    min-height: clamp(50px, 12vmin, 58px);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: clamp(15px, 3vmin, 18px);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.kiosk-exit-confirm-yes {
    background: #ef4444;
    color: #fff;
}

.kiosk-exit-confirm-yes:active {
    filter: brightness(0.92);
}

.kiosk-exit-confirm-no {
    background: #e8ecf0;
    color: #2c3e50;
}

.kiosk-exit-confirm-no:active {
    filter: brightness(0.97);
}

.password-modal-btn-confirm {
    flex: 2;
    margin: 0 !important;
}

.password-modal-btn-cancel {
    flex: 1;
    margin: 0 !important;
}

/* Fiş kağıdı: inline style bağımsız CSS elemanları */
.fis-hospital-name {
    font-weight: bold;
    margin-bottom: clamp(6px, 1.5vmin, 12px);
}

.fis-divider {
    border-top: 1px dashed #ccc;
    margin: clamp(5px, 1vmin, 10px) 0;
}

/* Fiş düzeninde hastane/kurum adı ile çizgi arası boşluk minimum olsun */
.fis-paper .fis-divider {
    margin: 0 !important;
    margin-bottom: clamp(2px, 0.6vmin, 6px) !important;
}

.fis-label {
    margin: clamp(3px, 0.8vmin, 6px) 0;
}

.fis-numara-buyuk {
    font-weight: bold;
    margin: clamp(6px, 1.5vmin, 12px) 0;
}

.fis-kuyruk-adi {
    font-weight: 900;
    margin-bottom: clamp(5px, 1vmin, 10px);
}

.fis-qrcode-wrap {
    margin: clamp(6px, 1.5vmin, 12px) auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fis-aciklama {
    opacity: 0.7;
    margin-top: clamp(4px, 1vmin, 10px);
    text-align: center;
}

.fis-tarih {
    opacity: 0.6;
    margin-top: clamp(6px, 1.2vmin, 12px);
    white-space: pre-line;
}

/* Fiş boyutları: !important eski CSS override'larıyla uyumlu */
.fis-paper .fis-hospital-name {
    font-size: clamp(14px, 3vmin, 22px);
}

.fis-paper .fis-label {
    font-size: clamp(10px, 2vmin, 14px);
}

.fis-paper .fis-numara-buyuk {
    font-size: clamp(32px, 10vmin, 56px);
}

.fis-paper .fis-kuyruk-adi {
    font-size: clamp(12px, 2.5vmin, 18px);
    font-weight: 900;
}

/* 80 mm önizleme: kağıt genişliği 80 mm; başlık satırları ortalı (58 mm varsayılan .fis-paper’a dokunulmaz) */
.fis-paper.fis-paper--80mm {
    width: min(80mm, calc(100vw - 2 * var(--kiosk-page-pad-x)), 96vw);
    max-width: 80mm;
}

.fis-paper.fis-paper--80mm .fis-hospital-name,
.fis-paper.fis-paper--80mm .fis-kuyruk-adi {
    display: block;
    width: 100%;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.fis-paper.fis-paper--80mm #fis-qrcode canvas,
.fis-paper.fis-paper--80mm #fis-qrcode img {
    max-width: min(120px, 32vw) !important;
}

.fis-paper.fis-paper--80mm .fis-aciklama {
    display: block;
    text-align: center;
    white-space: normal;
    max-width: 100%;
}

.fis-paper .fis-aciklama {
    font-size: clamp(8px, 1.6vmin, 11px);
}

.fis-paper .fis-tarih {
    font-size: clamp(9px, 1.8vmin, 12px);
}

/* Ayarlar Modalı Form Elemanları */
.settings-panel h2 {
    margin-bottom: clamp(6px, 1.2vmin, 12px);
    color: #667eea;
    font-size: clamp(18px, 3.5vmin, 28px);
}

.settings-panel .settings-desc {
    color: #666;
    font-size: clamp(12px, 1.8vmin, 15px);
    margin-bottom: clamp(12px, 2.5vmin, 24px);
}

.settings-form-group {
    margin-bottom: clamp(10px, 2vmin, 16px);
}

.settings-form-group-last {
    margin-bottom: 0;
}

.settings-label {
    display: block;
    margin-bottom: clamp(4px, 0.8vmin, 8px);
    font-size: clamp(13px, 1.8vmin, 15px);
    color: #475569;
    font-weight: 500;
}

.settings-input {
    width: 100%;
    padding: clamp(8px, 1.5vmin, 12px) clamp(10px, 1.8vmin, 14px);
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: clamp(13px, 1.8vmin, 15px);
    box-sizing: border-box;
}

.settings-input-readonly {
    border: 1px dashed #cbd5e1;
    font-size: clamp(11px, 1.5vmin, 13px);
    font-family: monospace;
    background: #f1f5f9;
    color: #64748b;
}

.settings-small-note {
    display: block;
    margin-top: clamp(3px, 0.6vmin, 6px);
    font-size: clamp(10px, 1.4vmin, 12px);
    color: #64748b;
}

.settings-label-checkbox {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1vmin, 10px);
    font-size: clamp(13px, 1.8vmin, 15px);
    color: #475569;
    cursor: pointer;
    font-weight: 500;
}

.settings-checkbox {
    width: clamp(16px, 2.5vmin, 22px);
    height: clamp(16px, 2.5vmin, 22px);
    cursor: pointer;
}

.settings-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(8px, 1.5vmin, 12px);
}

.settings-section-header h3 {
    margin: 0;
}

.settings-btn-clear {
    background: #6b7280;
    color: white;
    padding: clamp(4px, 0.8vmin, 8px) clamp(8px, 1.5vmin, 14px);
    border: none;
    border-radius: 6px;
    font-size: clamp(11px, 1.5vmin, 13px);
    cursor: pointer;
    font-weight: 500;
}

.settings-select-multiple {
    width: 100%;
    padding: clamp(4px, 0.8vmin, 8px);
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: clamp(12px, 1.6vmin, 14px);
    height: clamp(100px, 15vmin, 180px);
    box-sizing: border-box;
}

.settings-label-full {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: clamp(14px, 2vmin, 17px);
    color: #2c3e50;
    font-weight: 600;
    margin: 0;
}

.settings-desc-full {
    margin: clamp(6px, 1vmin, 10px) 0 0 clamp(24px, 4vmin, 40px);
    font-size: clamp(11px, 1.6vmin, 13px);
    color: #64748b;
    line-height: 1.4;
}

.settings-textarea {
    width: 100%;
    padding: clamp(8px, 1.5vmin, 12px);
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: clamp(12px, 1.6vmin, 14px);
    resize: vertical;
    box-sizing: border-box;
}

.settings-input-range {
    width: 100%;
    margin: 6px 0 2px;
}

.settings-range-value {
    font-size: clamp(12px, 1.8vmin, 14px);
    font-weight: 600;
    color: #334155;
}

.settings-footer-actions {
    margin-top: clamp(16px, 3vmin, 30px);
    padding-top: clamp(16px, 3vmin, 30px);
    border-top: 2px solid #e2e8f0;
    display: flex;
    gap: clamp(8px, 1.5vmin, 16px);
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.settings-footer-actions button {
    min-width: clamp(100px, 15vmin, 160px);
    margin: 0 !important;
}

/* Bilet Ekranı Bilgi Mesajı */
.qr-success-message {
    display: none;
    margin: clamp(6px, 1vmin, 12px) 0;
    padding: clamp(8px, 1.5vmin, 14px) clamp(12px, 2vmin, 20px);
    background: #dcfce7;
    color: #166534;
    border-radius: clamp(8px, 1.2vmin, 12px);
    font-size: clamp(12px, 2vmin, 18px);
    font-weight: 600;
    text-align: center;
}

/* Manuel Klavye Tetikleyici Butonu */
.input-with-keyboard {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.manual-keyboard-trigger {
    position: absolute;
    right: 8px;
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.manual-keyboard-trigger:active {
    background: #6366f1;
    color: white;
    transform: scale(0.9);
}

.manual-keyboard-trigger i {
    font-size: 16px;
}

/* Input padding ayarı (ikonun üstüne binmemesi için) */
.password-modal-input.has-trigger, 
#device-name-input.has-trigger {
    padding-right: 50px !important;
}

/* Tablet modunda daha büyük buton */
@media (max-width: 1024px) {
    .manual-keyboard-trigger {
        width: 42px;
        height: 42px;
        right: 10px;
    }
    .manual-keyboard-trigger i {
        font-size: 20px;
    }
    .password-modal-input.has-trigger, 
    #device-name-input.has-trigger {
        padding-right: 60px !important;
    }
}

/* Sayfa yenilemesi sonrası odak ve ilk dokunuş: düğmede takılı kalan :active / hayalet tıklamayı azaltır */
.kiosk-focus-sink {
    position: fixed;
    left: 0;
    top: 0;
    width: 2px;
    height: 2px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    pointer-events: none;
    z-index: 1;
}

.kiosk-load-pointer-shield {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: transparent;
    pointer-events: auto;
}

.kiosk-load-pointer-shield--off {
    display: none !important;
    pointer-events: none !important;
}