/* Telefon: Ayarlar ekrani tek sutun, tam ekran (yalnizca 699px ve alti).
Alanlar 16px (odakta yakinlastirma olmasin), hedefler >= 44px, genis tablolar kendi kabinda kayar.
portal.css/kurumsal.css kurallari gereken yerde !important ile eziliyor. */

@media (max-width: 699px) {

  /* --- Pencere --- */
  body:not(.sql-sekmesi) #profile-modal {
    left: 0 !important;
    right: 0 !important;
    padding: 0 !important;
  }
  body:not(.sql-sekmesi) #profile-modal .modal-card.ayar-pencere,
  body:not(.sql-sekmesi) #profile-modal .modal-card.ayar-pencere.genis {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    padding: 0 !important;
    gap: 0 !important;
    border: 0 !important;
    overflow: hidden;
  }

  /* ✕ menu seridinin sag ucunda */
  body:not(.sql-sekmesi) #profile-modal #profile-close {
    top: 10px !important;
    right: 10px !important;
    width: 44px !important;
    height: 44px !important;
  }

  /* --- Menu: ustte yatay serit --- */
  body:not(.sql-sekmesi) #profile-modal .ayar-menu {
    order: 1;
    flex: none;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 12px !important;
    margin-right: 58px;   /* ✕'in yeri */
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }
  body:not(.sql-sekmesi) #profile-modal .ayar-menu::-webkit-scrollbar { display: none; }
  body:not(.sql-sekmesi) #profile-modal .ayar-menu h3 { display: none !important; }
  body:not(.sql-sekmesi) #profile-modal .ayar-menu .ayar-sekme {
    flex: none !important;
    min-height: 44px;
    padding: 6px 12px 6px 6px !important;
    white-space: nowrap;
    scroll-snap-align: start;
    font-size: 14px !important;
  }
  body:not(.sql-sekmesi) #profile-modal .ayar-menu .ayar-sekme[hidden] { display: none !important; }
  body:not(.sql-sekmesi) #profile-modal .ayar-menu .ayar-sekme:hover { transform: none !important; }

  /* --- Icerik --- */
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik {
    order: 2;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 12px 14px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    -webkit-overflow-scrolling: touch;
  }}

/* --- Bolum icerikleri --- */
@media (max-width: 699px) {

  /* --- Alanlar: tam genislik, 16px, 44px --- */
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=range]):not([type=color]),
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik select,
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik textarea {
    font-size: 16px !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=range]):not([type=color]),
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik select {
    min-height: 44px;
  }
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik input[type=number],
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik input[type=time],
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik input[type=date],
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik input[type=datetime-local] {
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--fg);
    font-family: inherit;
  }
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik textarea { min-height: 88px; }

  body:not(.sql-sekmesi) #profile-modal .ayar-icerik input[type=checkbox],
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik input[type=radio] {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    flex: none;
  }
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik label:has(> input[type=checkbox]),
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik label:has(> input[type=radio]) {
    min-height: 40px;
    align-items: center;
  }

  /* --- Yan yana alan gruplari tek sutun (alan+dugme satirlari haric) --- */
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .form-row { flex-wrap: wrap; }
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .form-row > div,
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .form-row > label:not(.onay-satir) {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    width: 100%;
  }
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .form-row > div > input,
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .form-row > div > select,
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .form-row > div > .parola-sar { width: 100% !important; }
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .form-row > input { flex: 1 1 0; min-width: 0; }

  /* --- Dugmeler --- */
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .pbtn,
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .lg-sifirla {
    min-height: 44px;
    padding-left: 14px;
    padding-right: 14px;
    font-size: 15px;
  }
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .pbtn.kr-mini { min-height: 40px; font-size: 14px; }
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .lg-dugme,
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .kl-islem {
    width: 40px !important;
    height: 40px !important;
    font-size: 17px;
  }
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .parola-goz { width: 44px; height: 40px; }
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .parola-sar > input { padding-right: 48px !important; }

  /* --- Tablolar kendini kaydirir --- */
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .lg-sar,
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik .kr-tablo-sar {
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  /* Saga yapisik sutunlar telefonda ekrani kapatiyordu: normal akista kalir. */
  body:not(.sql-sekmesi) #profile-modal .lg-tbl .ku-s-islem,
  body:not(.sql-sekmesi) #profile-modal .lg-tbl .lg-s-son { position: static !important; }
}

/* --- Liste arac seridi ve sayfalama --- */
@media (max-width: 699px) {
  body:not(.sql-sekmesi) #profile-modal .lg-arac .lg-bosluk { flex: 1 0 100%; height: 0; }
  body:not(.sql-sekmesi) #profile-modal .lg-arac .lg-mini-sec,
  body:not(.sql-sekmesi) #profile-modal .lg-sayfa select { min-height: 40px !important; height: 40px !important; font-size: 16px !important; }
  body:not(.sql-sekmesi) #profile-modal .lg-arac .lg-etiket { font-size: 13px; }
  body:not(.sql-sekmesi) #profile-modal .lg-sayfa-dugme {
    min-width: 40px;
    min-height: 40px;
  }
  body:not(.sql-sekmesi) #profile-modal .lg-alt { flex-wrap: wrap; row-gap: 8px; }
  body:not(.sql-sekmesi) #profile-modal .lg-suzgec .lg-sifirla { min-height: 40px; font-size: 13px; }
}

/* --- Ayarlarin ustune acilan pencereler: telefonda tam ekran, ✕ hep gorunur --- */
@media (max-width: 699px) {
  body:not(.sql-sekmesi):has(#profile-modal:not([hidden])) .modal:not(#profile-modal),
  .modal.kr-modal {
    padding: 0 !important;
    place-items: stretch !important;
    overflow: hidden !important;
  }
  body:not(.sql-sekmesi):has(#profile-modal:not([hidden])) .modal:not(#profile-modal) > .modal-card,
  .modal.kr-modal > .modal-card {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body:not(.sql-sekmesi):has(#profile-modal:not([hidden])) .modal:not(#profile-modal) > .modal-card > h3,
  .modal.kr-modal > .modal-card > h3 {
    padding-right: 56px;
    min-height: 44px;
    display: flex;
    align-items: center;
    margin-top: 0;
  }
  body:not(.sql-sekmesi):has(#profile-modal:not([hidden])) .modal:not(#profile-modal) > .modal-card > .modal-x,
  .modal.kr-modal > .modal-card > .modal-x {
    position: fixed !important;
    top: 10px !important;
    right: 10px !important;
    width: 44px !important;
    height: 44px !important;
    z-index: 10;
    display: grid;
    place-items: center;
    font-size: 20px;
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    background: var(--panel) !important;
    color: var(--fg) !important;
  }

  body:not(.sql-sekmesi):has(#profile-modal:not([hidden])) .modal:not(#profile-modal) input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=range]):not([type=color]),
  body:not(.sql-sekmesi):has(#profile-modal:not([hidden])) .modal:not(#profile-modal) select,
  body:not(.sql-sekmesi):has(#profile-modal:not([hidden])) .modal:not(#profile-modal) textarea {
    font-size: 16px !important;
    max-width: 100%;
  }
  body:not(.sql-sekmesi):has(#profile-modal:not([hidden])) .modal:not(#profile-modal) input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not([type=range]):not([type=color]),
  body:not(.sql-sekmesi):has(#profile-modal:not([hidden])) .modal:not(#profile-modal) select { min-height: 44px; }
  body:not(.sql-sekmesi):has(#profile-modal:not([hidden])) .modal:not(#profile-modal) .pbtn { min-height: 44px; }
  body:not(.sql-sekmesi):has(#profile-modal:not([hidden])) .modal:not(#profile-modal) input[type=checkbox] { width: 22px; height: 22px; }
  body:not(.sql-sekmesi):has(#profile-modal:not([hidden])) .modal:not(#profile-modal) .form-row { flex-wrap: wrap; }
}

@media (max-width: 699px) {
  body:not(.sql-sekmesi) #profile-modal .lg-tbl .lg-suzgec input,
  body:not(.sql-sekmesi) #profile-modal .lg-tbl .lg-suzgec select { min-width: 96px; }
}

@media (max-width: 699px) {
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik label:has(> input[type=checkbox]:first-child),
  body:not(.sql-sekmesi) #profile-modal .ayar-icerik label:has(> input[type=radio]:first-child) {
    display: flex !important;
    align-items: center;
    gap: 10px;
  }
}
