:root {
    color-scheme: light dark;
    --zemin: #f4f1ec;
    --yan: #fbfaf7;
    --kart: #ffffff;
    --cizgi: #e4dfd6;
    --yazi: #1f1d1a;
    --soluk: #766f65;
    --vurgu: #3b5bdb;
    --vurgu-koyu: #2f4ac0;
    --vurgu-yazi: #ffffff;
    --secili: #ebe7df;
    --balon-ben: #dfe6ff;
    --balon-o: #ffffff;
    --akis: #ece8e1;
    --yesil: #2b8a3e;
    --kirmizi: #c92a2a;
    --golge: 0 1px 1.5px rgba(40, 30, 10, .10);
    --yaricap: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --zemin: #121416;
        --yan: #181b1e;
        --kart: #1f2327;
        --cizgi: #2a2f35;
        --yazi: #e8e6e3;
        --soluk: #8f959c;
        --vurgu: #7c93ff;
        --vurgu-koyu: #6a82f5;
        --vurgu-yazi: #0d1020;
        --secili: #23282d;
        --balon-ben: #2a3873;
        --balon-o: #22272c;
        --akis: #0f1113;
        --yesil: #51cf66;
        --kirmizi: #ff6b6b;
        --golge: 0 1px 1.5px rgba(0, 0, 0, .35);
    }
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

/* Sayfa hiçbir yönde kaymaz; yalnızca mesaj akışı ve sohbet listesi dikey kayar */
html { overflow: hidden; overscroll-behavior: none; }

body {
    background: var(--zemin);
    color: var(--yazi);
    font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    width: 100%;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.soluk { color: var(--soluk); }

:focus-visible { outline: 2px solid var(--vurgu); outline-offset: 2px; }

/* ---------- Genel yerleşim ---------- */

.uyg {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    /* Uygulama her zaman ekranın görünen kısmını tam kaplar. Telefonda klavye açılınca
       --gorunen (görünen yükseklik) ve --kayma (tarayıcının sayfayı ittiği miktar) betikle
       güncellenir; böylece başlık üstte, yazı alanı klavyenin hemen üstünde kalır. */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    height: calc(var(--gorunen, 100dvh) - var(--cubuk, 0px));
    transform: translateY(var(--kayma, 0px));
    overflow: hidden;
    max-width: 1500px;
    margin: 0 auto;
}

/* Sohbet sayfasında belgenin kendisi hiç kaymaz (iPhone'da klavye açılınca sayfanın sürüklenmesini önler) */
body.uygulama { position: fixed; top: 0; left: 0; right: 0; bottom: 0; }

/* Klavye açıkken alt güvenli alan boşluğuna gerek yok */
.klavye .yaz, .gorusmede .yaz { padding-bottom: 8px; }

.yan {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--yan);
    border-right: 1px solid var(--cizgi);
}

.yan-ust, .sohbet-ust {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--cizgi);
    background: var(--yan);
}

.yan-ad, .baslik { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.yan-ad strong, .baslik strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yan-ad span, .baslik span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.simge-dgm {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--soluk);
    text-decoration: none;
}
.simge-dgm:hover { background: var(--secili); color: var(--yazi); }

/* ---------- Avatar ---------- */

.av {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: .02em;
    user-select: none;
}
.av.k { width: 26px; height: 26px; font-size: 11px; }
.av .nokta {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--yesil);
    border: 2.5px solid var(--yan);
}

/* ---------- Sesli oda ---------- */

.oda {
    margin: 12px 12px 4px;
    padding: 12px;
    border: 1px solid var(--cizgi);
    border-radius: var(--yaricap);
    background: var(--kart);
}
.oda.canli { border-color: color-mix(in srgb, var(--yesil) 55%, var(--cizgi)); }
.oda-bas { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.oda-ad { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.oda-ad svg { color: var(--soluk); }
.oda.canli .oda-ad svg { color: var(--yesil); }
.oda-dgm { display: inline-flex; gap: 6px; }
.oda-uye { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 13px; }

.uye {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 3px;
    border-radius: 999px;
    background: var(--secili);
    transition: box-shadow .12s;
}
.uye b { font-weight: 500; }
.uye svg { color: var(--kirmizi); }
.uye.konusuyor { box-shadow: 0 0 0 2px var(--yesil); }

.oda.mini { display: none; }

/* ---------- Düğmeler ---------- */

.dgm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--cizgi);
    border-radius: 999px;
    background: var(--kart);
    font-weight: 500;
    font-size: 14px;
}
a.dgm { text-decoration: none; }
.dgm:hover { background: var(--secili); }
.dgm:disabled { opacity: .6; cursor: default; }
.dgm.ana { background: var(--vurgu); border-color: var(--vurgu); color: var(--vurgu-yazi); }
.dgm.ana:hover { background: var(--vurgu-koyu); }
.dgm.kirmizi { color: var(--kirmizi); }
.dgm.kare { padding: 0; width: 34px; }
.dgm.kapali { background: var(--kirmizi); border-color: var(--kirmizi); color: #fff; }
.dgm.genis { width: 100%; min-height: 44px; font-size: 15px; }

/* ---------- Sohbet listesi ---------- */

.liste { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 6px 8px 12px; }

.oge {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 12px;
    background: none;
    text-align: left;
}
.oge:hover { background: color-mix(in srgb, var(--secili) 60%, transparent); }
.oge.secili { background: var(--secili); }
.oge-orta { flex: 1; min-width: 0; }
.oge-ust { display: flex; align-items: baseline; gap: 8px; }
.oge-ust strong { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oge-ust time { flex: none; font-size: 12px; color: var(--soluk); }
.oge-alt { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.oge-alt span { flex: 1; min-width: 0; font-size: 14px; color: var(--soluk); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oge-alt .yaziyor { color: var(--vurgu); }
.rozet {
    flex: none;
    font-style: normal;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--vurgu);
    color: var(--vurgu-yazi);
    font-size: 12px;
    font-weight: 600;
    line-height: 21px;
    text-align: center;
}
.oge.okunmamis .oge-ust time { color: var(--vurgu); font-weight: 600; }

/* ---------- Sohbet penceresi ---------- */

.sohbet { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--akis); }

.bos {
    flex: 1;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 6px;
    padding: 24px;
    color: var(--soluk);
    text-align: center;
}

.pencere { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.geri { display: none; margin-left: -8px; }

.akis {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px max(14px, 6%) 10px;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.akis-bilgi { margin: 30px auto; text-align: center; color: var(--soluk); font-size: 14px; }

.gun { display: flex; justify-content: center; margin: 12px 0 8px; }
.gun span {
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--kart);
    color: var(--soluk);
    font-size: 12px;
    font-weight: 500;
    box-shadow: var(--golge);
}

.satir { display: flex; margin-top: 2px; }
.satir.ilk { margin-top: 9px; }
.satir.ben { justify-content: flex-end; }

.balon {
    max-width: min(78%, 620px);
    padding: 7px 10px 6px 11px;
    border-radius: var(--yaricap);
    background: var(--balon-o);
    box-shadow: var(--golge);
    overflow-wrap: anywhere;
}
.satir.ben .balon { background: var(--balon-ben); }
.satir.o.ilk .balon { border-top-left-radius: 4px; }
.satir.ben.ilk .balon { border-top-right-radius: 4px; }

.kim { margin-bottom: 1px; font-size: 13px; font-weight: 600; }
.metin { white-space: pre-wrap; }
.metin a { color: var(--vurgu); }
.alt {
    float: right;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 7px 0 -2px 12px;
    color: var(--soluk);
    font-size: 11px;
    line-height: 1;
}
.tik { display: inline-flex; }
.tik.okundu { color: var(--vurgu); }

.asagi {
    position: absolute;
    right: 18px;
    bottom: 76px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--cizgi);
    border-radius: 50%;
    background: var(--kart);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.yaz {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 12px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    background: var(--yan);
    border-top: 1px solid var(--cizgi);
}
.yaz textarea {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    max-height: 140px;
    padding: 10px 14px;
    border: 1px solid var(--cizgi);
    border-radius: 21px;
    background: var(--kart);
    resize: none;
    font-size: 16px;
    line-height: 1.3;
}
.yaz textarea:focus { outline: none; border-color: var(--vurgu); }
.gonder {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--vurgu);
    color: var(--vurgu-yazi);
}
.gonder:hover { background: var(--vurgu-koyu); }

.uyari {
    position: fixed;
    left: 50%;
    top: calc(var(--kayma, 0px) + var(--gorunen, 100dvh) - var(--cubuk, 0px) - 132px);
    z-index: 20;
    max-width: calc(100vw - 32px);
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--yazi);
    color: var(--zemin);
    font-size: 14px;
    transform: translateX(-50%);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}

/* ---------- Giriş sayfası ---------- */

.giris-sayfa { display: grid; place-items: center; min-height: 100%; padding: 16px; overflow: auto; }
.giris {
    width: 100%;
    max-width: 360px;
    padding: 28px 24px 24px;
    border: 1px solid var(--cizgi);
    border-radius: 18px;
    background: var(--kart);
}
.giris-logo {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--vurgu);
    color: var(--vurgu-yazi);
}
.giris h1 { margin: 16px 0 2px; font-size: 22px; }
.giris p { margin: 0 0 18px; }
.giris label { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 500; color: var(--soluk); }
.giris input {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 11px 12px;
    border: 1px solid var(--cizgi);
    border-radius: 10px;
    background: var(--zemin);
    font-size: 16px;
    color: var(--yazi);
}
.giris input:focus { outline: none; border-color: var(--vurgu); }
.giris-hata { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--kirmizi) 12%, transparent); color: var(--kirmizi); font-size: 14px; }

/* ---------- Telefon ---------- */

@media (max-width: 760px) {
    .uyg { grid-template-columns: minmax(0, 1fr); }
    .yan { border-right: 0; }
    .sohbet { display: none; }
    body.sohbet-acik .yan { display: none; }
    body.sohbet-acik .sohbet { display: flex; }
    .geri { display: inline-grid; }
    .akis { padding-left: 10px; padding-right: 10px; }
    .balon { max-width: 86%; }

    /* Sohbet açıkken sesli oda küçük bir şerit olarak üstte kalır */
    .oda.mini.canli, .oda.mini.icinde { display: block; margin: 0; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--cizgi); border-radius: 0; }
    .oda.mini .oda-uye { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Kurulum ve yönetim sayfaları ---------- */

body.duz { overflow: auto; }
.panel { max-width: 860px; margin: 0 auto; padding: 20px 16px 60px; }
.panel-ust { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-ust h1 { margin: 0; font-size: 22px; }
.kutu { margin-bottom: 16px; padding: 18px; border: 1px solid var(--cizgi); border-radius: 16px; background: var(--kart); }
.kutu h2 { margin: 0 0 4px; font-size: 17px; }
.kutu > p { margin: 0 0 14px; color: var(--soluk); font-size: 14px; }
.kutu h3 { margin: 18px 0 8px; font-size: 14px; }
.alanlar { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.alan { display: block; font-size: 13px; font-weight: 500; color: var(--soluk); }
.alan.tam { grid-column: 1 / -1; }
.alan input, .alan select, .alan textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
    padding: 10px 12px;
    border: 1px solid var(--cizgi);
    border-radius: 10px;
    background: var(--zemin);
    color: var(--yazi);
    font-size: 15px;
}
.alan textarea { min-height: 70px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.alan small { display: block; margin-top: 4px; font-weight: 400; }
.alan input:focus, .alan select:focus, .alan textarea:focus { outline: none; border-color: var(--vurgu); }
.sira { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.denetim { margin: 0; padding: 0; list-style: none; }
.denetim li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--cizgi); font-size: 14px; }
.denetim li:first-child { border-top: 0; }
.denetim b { font-weight: 600; }
.denetim span { color: var(--soluk); }
.isaret { flex: none; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.isaret.ok { background: var(--yesil); }
.isaret.dikkat { background: #e8890c; }
.isaret.hata { background: var(--kirmizi); }
.isaret.bekle { background: var(--soluk); }
.bilgi { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.bilgi.ok { background: color-mix(in srgb, var(--yesil) 14%, transparent); }
.bilgi.hata { background: color-mix(in srgb, var(--kirmizi) 13%, transparent); color: var(--kirmizi); }
.kod {
    display: block;
    margin: 8px 0;
    padding: 12px;
    border: 1px solid var(--cizgi);
    border-radius: 10px;
    background: var(--zemin);
    font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace;
    white-space: pre;
    overflow-x: auto;
}
.tablo-sar { overflow-x: auto; }
.tablo { width: 100%; border-collapse: collapse; font-size: 14px; }
.tablo th, .tablo td { padding: 9px 8px; border-top: 1px solid var(--cizgi); text-align: left; vertical-align: middle; }
.tablo th { border-top: 0; color: var(--soluk); font-size: 12px; font-weight: 600; }
.tablo td form { display: inline-flex; gap: 6px; }
.tablo input { width: 130px; padding: 6px 9px; border: 1px solid var(--cizgi); border-radius: 8px; background: var(--zemin); color: var(--yazi); font-size: 14px; }
.etiket { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--secili); font-size: 12px; }
.dgm.kucuk { min-height: 30px; padding: 0 11px; font-size: 13px; }
details.kutu summary { cursor: pointer; font-weight: 600; font-size: 17px; }
details.kutu[open] summary { margin-bottom: 12px; }

/* ---------- Bildirim düğmesi ve öneri kartı ---------- */

#zil[aria-pressed="true"] { color: var(--vurgu); }
#zil[aria-pressed="true"] .zil-cizgi { display: none; }
.oner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 12px 0;
    padding: 10px 8px 10px 12px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--vurgu) 13%, var(--kart));
    border: 1px solid color-mix(in srgb, var(--vurgu) 35%, var(--cizgi));
    font-size: 13.5px;
    line-height: 1.35;
}
.oner > svg { flex: none; color: var(--vurgu); }
.oner-yazi { flex: 1; min-width: 0; }
.oner-yazi strong { display: block; font-size: 14px; }
.oner .dgm { flex: none; }
.oner .kapat { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--soluk); font-size: 18px; line-height: 1; }
.oner .kapat:hover { background: var(--secili); }
.dgm.kare.secili { background: var(--vurgu); border-color: var(--vurgu); color: var(--vurgu-yazi); }

/* ---------- Birebir arama ---------- */

#gorusme { margin-bottom: 0; }
.gorusme-durum { align-self: center; }
.gorusme-sure { font-variant-numeric: tabular-nums; }
.simge-dgm:disabled { opacity: .4; cursor: default; }
.simge-dgm:disabled:hover { background: none; color: var(--soluk); }
.dgm.yesil { background: var(--yesil); border-color: var(--yesil); color: #fff; }
.gelen {
    position: fixed;
    top: calc(var(--kayma, 0px) + max(12px, env(safe-area-inset-top)));
    left: 50%;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(420px, calc(100vw - 24px));
    padding: 12px 14px;
    border: 1px solid var(--cizgi);
    border-radius: 18px;
    background: var(--kart);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .28);
    transform: translateX(-50%);
}
.gelen-yazi { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gelen-yazi strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gelen-yazi span { font-size: 13px; }

/* ---------- Uygulama kilidi ---------- */

.kilit {
    position: fixed;
    top: var(--kayma, 0px);
    left: 0;
    right: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    height: var(--gorunen, 100dvh);
    padding: 16px;
    background: var(--zemin);
    overflow: auto;
}
.kilit-ic { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(300px, 100%); }
.kilit-ic strong { font-size: 18px; }
.kilit-nokta { min-height: 26px; font-size: 20px; letter-spacing: 8px; color: var(--vurgu); }
.kilit-hata { min-height: 20px; margin: 0; color: var(--kirmizi); font-size: 14px; text-align: center; }
.tuslar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; }
.tuslar button {
    aspect-ratio: 1.25;
    border: 1px solid var(--cizgi);
    border-radius: 18px;
    background: var(--kart);
    font-size: 24px;
    font-weight: 500;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.tuslar button:active { background: var(--secili); }
.tuslar .tus-gir { background: var(--vurgu); border-color: var(--vurgu); color: var(--vurgu-yazi); }
/* Kilit ekranındaki hesap makinesi */
.kilit:has(.hm) { background: #000; color: #fff; place-items: end center; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.hm { width: min(360px, 100%); gap: 14px; align-items: stretch; }
.hm-ekran { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; min-height: 140px; padding: 0 8px; overflow: hidden; }
.hm-ust { min-height: 22px; color: #8e8e93; font-size: 18px; white-space: nowrap; }
.hm-deger { font-size: 64px; font-weight: 300; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hm-tuslar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.hm-tuslar button {
    aspect-ratio: 1;
    border: 0;
    border-radius: 999px;
    background: #333336;
    color: #fff;
    font-size: 30px;
    font-weight: 400;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: filter .12s;
}
.hm-tuslar button:active { filter: brightness(1.45); }
.hm-tuslar .hm-is { background: #a5a5a5; color: #000; font-size: 24px; font-weight: 500; }
.hm-tuslar .hm-op { background: #ff9f0a; font-size: 34px; }
.hm-tuslar .hm-sifir { grid-column: span 2; aspect-ratio: auto; text-align: left; padding-left: 30px; }
.hm .kilit-gorusme { background: #1c1c1e; border-color: #2c2c2e; color: #fff; }

/* Giriş sayfası: aynı hesap makinesi; ortak şifre doğru girilince tuşların yerinde isim alanı açılır */
body.giris-hm { background: #000; }
.hm-formlu .hm-tuslar { display: none; }
.hm-form { display: flex; flex-direction: column; gap: 12px; }
.hm-form input {
    width: 100%;
    box-sizing: border-box;
    min-height: 54px;
    padding: 0 18px;
    border: 1px solid #3a3a3c;
    border-radius: 16px;
    background: #1c1c1e;
    color: #fff;
    font: inherit;
    font-size: 18px;
}
.hm-form input:focus { outline: none; border-color: #ff9f0a; }
.hm-form input::placeholder { color: #8e8e93; }
.hm-form-dgm { display: flex; gap: 12px; }
.hm-form-dgm button { flex: 1; min-height: 54px; border: 0; border-radius: 999px; font: inherit; font-size: 18px; }
.hm-geri { background: #333336; color: #fff; }
.hm-gir { background: #ff9f0a; color: #fff; font-weight: 600; }
.hm-hata { margin: 0; color: #ff6b6b; font-size: 14px; text-align: center; }

.kilit-gorusme { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--cizgi); border-radius: 14px; background: var(--kart); }
.kilit-gorusme span { flex: 1; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.kilit-gorusme svg { color: var(--yesil); }

/* ---------- Görüşme çubuğu (ekranın altında) ---------- */
/* Telefon kulağa tutulunca ekranın üst kısmı kulağa değer; görüşme düğmeleri bu yüzden altta durur.
   Çubuk görünürken uygulama onun yüksekliği kadar kısalır. Klavye açıkken çubuk gizlenir. */

html.gorusmede:not(.klavye) { --cubuk: calc(138px + env(safe-area-inset-bottom)); }
.cagri-cubuk {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--kayma, 0px) + var(--gorunen, 100dvh) - var(--cubuk, 0px));
    z-index: 40;
    box-sizing: border-box;
    height: var(--cubuk, 0px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 14px max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid color-mix(in srgb, var(--yesil) 55%, var(--cizgi));
    background: var(--kart);
    overflow: hidden;
}
.klavye .cagri-cubuk { display: none; }
.cc-ust { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; }
.cc-ad { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-ad svg { flex: none; color: var(--yesil); }
.cc-durum { margin-left: auto; color: var(--soluk); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cagri-cubuk .oda-alt { margin-top: 0; }
.cc-dgm { display: flex; gap: 10px; margin-top: auto; }
.cc-dgm .dgm { flex: 1; min-height: 50px; border-radius: 16px; font-size: 15px; }
.cc-dgm .dgm.kare { width: auto; }
.cc-dgm .dgm svg { width: 22px; height: 22px; }
.cc-dgm .dgm.kirmizi { flex: 1.4; background: var(--kirmizi); border-color: var(--kirmizi); color: #fff; }

/* ---------- Şifreleme bilgisi ---------- */

.metin.acilmaz { font-style: italic; color: var(--soluk); }
.bilgi-kutu {
    position: fixed;
    top: var(--kayma, 0px);
    left: 0;
    right: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    height: var(--gorunen, 100dvh);
    padding: 16px;
    background: rgba(0, 0, 0, .45);
}
.bilgi-ic { display: flex; flex-direction: column; gap: 8px; width: min(380px, 100%); padding: 20px; border-radius: 18px; background: var(--kart); font-size: 14px; }
.bilgi-ic strong { font-size: 17px; }
.bilgi-ic p { margin: 0 0 6px; }
.guvenlik-kod { font: 600 17px/1.6 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; text-align: center; }

/* ---------- Görüntülü görüşme ---------- */

.uyari { z-index: 40; }
.sahne {
    position: fixed;
    top: var(--kayma, 0px);
    left: 0;
    right: 0;
    z-index: 25;
    display: flex;
    flex-direction: column;
    height: var(--gorunen, 100dvh);
    background: #0b0c0e;
    color: #e8e6e3;
    overflow: hidden;
}
.sahne[hidden] { display: none; }
.sahne-ust {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: max(10px, env(safe-area-inset-top)) 16px 8px;
    font-size: 13px;
    color: #b6bbc1;
}
.sahne-izgara {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(0, 1fr);
    gap: 6px;
    padding: 0 6px;
}
.sahne-izgara .kare {
    position: relative;
    min-width: 0;
    min-height: 0;
    border-radius: 16px;
    background: #1a1d21;
    overflow: hidden;
}
.sahne-izgara .kare video { width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
.sahne-izgara .kare.kamera video { display: block; }
.sahne-izgara .kare.kamera .kare-bos { display: none; }
.kare-bos { position: absolute; inset: 0; display: grid; place-items: center; }
.kare-bos .av { width: 84px; height: 84px; font-size: 30px; }
.kare-ad {
    position: absolute;
    left: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sahne-ben {
    position: absolute;
    right: 12px;
    bottom: calc(96px + env(safe-area-inset-bottom));
    width: min(28vw, 150px);
    aspect-ratio: 3 / 4;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 14px;
    background: #000;
    object-fit: cover;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
.sahne-ben[hidden] { display: none; }
.sahne-ben.ayna { transform: scaleX(-1); }
.sahne-dugme {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 14px 12px max(14px, env(safe-area-inset-bottom));
}
.sahne-dgm {
    display: grid;
    place-items: center;
    flex: none;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: #2a2e34;
    color: #fff;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.sahne-dgm:hover { background: #363b42; }
.sahne-dgm:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sahne-dgm.kapali { background: #fff; color: #17191c; }
.sahne-dgm.secili { background: #7c93ff; color: #0d1020; }
.sahne-dgm.kirmizi { background: #e03131; }
.sahne-dgm.kirmizi svg { transform: rotate(135deg); }
@media (min-width: 700px) {
    .sahne-izgara[data-sayi="2"], .sahne-izgara[data-sayi="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sahne-izgara[data-sayi="3"] .kare:last-child { grid-column: 1 / -1; justify-self: center; width: calc(50% - 3px); }
    .sahne-ben { width: 180px; aspect-ratio: 4 / 3; }
}
@media (max-width: 380px) {
    .sahne-dugme { gap: 8px; }
    .sahne-dgm { width: 46px; height: 46px; }
}

/* ---------- Bağlantı kalitesi ---------- */

.oda-alt { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; margin-top: 8px; font-size: 12px; color: var(--soluk); }
.kalite-ic { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cubuklar { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.cubuklar i { width: 3px; border-radius: 1px; background: currentColor; opacity: .3; }
.cubuklar i:nth-child(1) { height: 4px; }
.cubuklar i:nth-child(2) { height: 8px; }
.cubuklar i:nth-child(3) { height: 12px; }
.cubuklar i.dolu { opacity: 1; }
.kalite-ic.s3 .cubuklar { color: var(--yesil); }
.kalite-ic.s2 .cubuklar { color: #e8a100; }
.kalite-ic.s1 { color: var(--kirmizi); }
.sahne .kalite-ic.s3 .cubuklar { color: #51cf66; }
.sahne .kalite-ic.s1 { color: #ff8787; }

/* ---------- Zil sesi düğmesi, odaya çağrı ---------- */

#zilSes[aria-pressed="true"] .zil-cizgi { display: none; }
#zilSes[aria-pressed="false"] .ses-dalga { display: none; }
.oda-alt-dgm { display: inline-flex; gap: 6px; }
.oda-alt-dgm .dgm { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Yönetim: sorun kaydı ---------- */

.sorun-liste { max-height: 440px; margin-top: 12px; border: 1px solid var(--cizgi); border-radius: 12px; overflow: auto; }
.sorun { display: grid; grid-template-columns: 82px 118px minmax(0, 1fr); gap: 2px 10px; align-items: baseline; padding: 8px 12px; border-top: 1px solid var(--cizgi); font-size: 13px; }
.sorun:first-child { border-top: 0; }
.sorun time { color: var(--soluk); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sorun-tur { font-weight: 600; }
.sorun-tur.t-baglanti, .sorun-tur.t-kopma { color: var(--kirmizi); }
.sorun-tur.t-sunucu { color: var(--soluk); }
.sorun span { overflow-wrap: anywhere; }
@media (max-width: 560px) {
    .sorun { grid-template-columns: auto minmax(0, 1fr); }
    .sorun span { grid-column: 1 / -1; }
}
