/* Çalışma alanı + Sohbet — Pall Mac birebir.
   Kaynak: PallMac/MacRootView.swift (kenar çubuğu, ayırıcı, sayfa geçişi),
   PallMac/MacChatView.swift (konuşma, baloncuk, yazma kutusu, bildirim),
   EfeaktifApp/PAL/MarkdownText.swift, PALIndicator.swift, PALShimmerText.swift,
   PALMessageActions.swift, EfeaktifApp/GlassCard.swift.
   Ölçüler Mac ekran görüntüsünden (1381×854 pt pencere) piksel piksel ölçüldü. */

/* 30 Eyl (Roy): gezinme iOS gibi — kenar çubuğu YOK. Yalnız iki ekran: Sohbet / Pano,
   üstte ortada iOS anahtarı (EfeaktifApp/PAL/PALView.swift PALScreenSwitch + topBar).
   Kontroller içeriğin ÜSTÜNDE yüzer: şerit, ayırıcı, arka plan yok. */
#stage-app { --pm-top: 56px; }                 /* topBar: 8 + 40 + 8 */
#pm-sidebar, #pm-divider { display: none !important; }

.pm-detail { position: absolute; inset: 0; background: var(--pal-bg); overflow: hidden; }
/* Ekran değişimi: opaklık easeInOut .25 (PALView: .animation(.easeInOut(0.25), value: screen)) */
.pm-page, .pm-chat {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease-in-out, visibility 0s linear .25s;
}
.pm-page.pm-in, .pm-chat.pm-in { opacity: 1; visibility: visible; transition: opacity .25s ease-in-out, visibility 0s linear 0s; }

/* Üst geçiş: kayan içerik yüzen kontrollerin altında erir (96 pt, arka plan → saydam) */
.pm-topfade {
  position: absolute; left: 0; right: 0; top: 0; height: 96px; z-index: 5; pointer-events: none;
  background: linear-gradient(180deg, #F2F5FA 0%, rgba(242,245,250,0) 100%);
}

/* topBar: ZStack, yatay 16, üst/alt 8 */
.pm-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 6;
  height: 56px; padding: 8px 16px; pointer-events: none;
}
.pm-top > * { pointer-events: auto; }

/* Cam: Liquid Glass yaklaşık karşılığı (düğme katmanı) */
.pm-g {
  background: rgba(255,255,255,.62);
  -webkit-backdrop-filter: blur(14px) saturate(1.8); backdrop-filter: blur(14px) saturate(1.8);
  box-shadow: inset 0 .5px 0 rgba(255,255,255,.95), inset 0 0 0 .5px rgba(255,255,255,.7), 0 0 0 .5px rgba(0,0,0,.05), 0 2px 10px rgba(0,0,0,.08);
  transition: transform .18s ease-out, background-color .18s ease-out;
}
.pm-g:active { transform: scale(.96); background-color: rgba(255,255,255,.8); }

/* Sol: "Pall" + PALSnap (17) cam kapsül düğme — HStack 3, iç dolgu 2/1 + .glass düğme payı */
.pm-brand {
  position: absolute; left: 16px; top: 10px; height: 36px;
  display: flex; align-items: center; gap: 3px;
  padding: 0 14px 0 16px; border-radius: 999px;
  transition: opacity .25s ease-in-out, transform .18s ease-out;
}
.pm-brand .pm-wordmark { font-size: 15px; letter-spacing: 5.1px; line-height: 18px; }
.pm-brand img { height: 17px; width: auto; display: block; transition: opacity .3s ease-in-out, width .3s ease-in-out; }
.pm-brand.pm-nosnap img { opacity: 0; width: 0; }

/* Sağ: 40×40 cam daire içinde profil karakteri */
.pm-me {
  position: absolute; right: 16px; top: 8px; width: 40px; height: 40px; border-radius: 50%;
  overflow: hidden; padding: 0; transition: opacity .25s ease-in-out, transform .18s ease-out;
}
.pm-me .pm-avatar { width: 40px; height: 40px; }
.pm-top.pm-onpano .pm-brand, .pm-top.pm-onpano .pm-me { opacity: 0; pointer-events: none; }

/* PALScreenSwitch: HStack 4, iki kapsül tek cam gövdede kaynaşır; seçim = koyu renk, kayar */
.pm-switch {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 0; border-radius: 999px; height: 36px;
}
.pm-switch .pm-thumb {
  position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 999px;
  background: rgba(20,23,31,.92);
  box-shadow: inset 0 .5px 0 rgba(255,255,255,.25), inset 0 0 0 .5px rgba(255,255,255,.12);
  transition: left .5s cubic-bezier(.25,1.12,.4,1), width .5s cubic-bezier(.25,1.12,.4,1);
}
.pm-seg {
  position: relative; z-index: 1; height: 36px; padding: 8px 16px; border-radius: 999px;
  font-size: 15px; line-height: 20px; font-weight: 400; color: var(--pal-text);
  transition: color .3s ease-in-out;
  -webkit-user-select: none; user-select: none;
}
.pm-seg[aria-selected="true"] { color: #fff; font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .pm-switch .pm-thumb { transition: left .2s ease-in-out, width .2s ease-in-out; }
}

/* Profil menüsü (web: yalnız "Çıkış yap") */
.pm-menu {
  position: absolute; right: 16px; top: 54px; z-index: 20; min-width: 160px; padding: 5px;
  background: rgba(246,246,246,.9); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  border-radius: 12px; box-shadow: 0 0 0 .5px rgba(0,0,0,.14), 0 10px 30px rgba(0,0,0,.16);
  animation: pcFadeIn .15s ease-out both;
}
.pm-menu .pm-menu-who { padding: 6px 10px 7px; font-size: 12px; color: var(--pal-text2); border-bottom: 1px solid rgba(0,0,0,.08); margin-bottom: 4px; }
.pm-menu button { display: flex; align-items: center; width: 100%; height: 30px; padding: 0 10px; border-radius: 7px; font-size: 15px; color: var(--pal-text); text-align: left; }
.pm-menu button:hover { background: rgba(0,0,0,.06); }

/* ---------- Sohbet ---------- */
.pc-root { position: absolute; inset: 0; }
.pc-scroll {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
}
.pc-col {
  max-width: 900px; margin: 0 auto;
  padding: calc(var(--pm-top) + 20px) 24px 20px;
  display: flex; flex-direction: column; gap: 16px; align-items: stretch;
}
.pc-bottom-space { flex: none; }  /* yazma kutusu kadar boşluk (safeAreaBar) */

.pc-fade { animation: pcFadeIn .3s ease-in-out both; }
@keyframes pcFadeIn { from { opacity: 0; } to { opacity: 1; } }
.pc-out { animation: pcFadeOut .3s ease-in-out both; }
@keyframes pcFadeOut { from { opacity: 1; } to { opacity: 0; } }

/* Kullanıcı baloncuğu: sağda, solda en az 80 boşluk, 13 pt, 11/16 dolgu, köşe 20, regularMaterial + 0.5 çizgi */
.pc-user { display: flex; justify-content: flex-end; padding-left: 80px; }
.pc-bubble {
  background: #F2F2F2;
  border-radius: 20px;
  box-shadow: inset 0 0 0 .5px rgba(0,0,0,.10);
  padding: 11px 16px; font-size: 13px; line-height: 16px; color: var(--pal-text);
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
  -webkit-user-select: text; user-select: text; max-width: 100%;
}

/* Pall cevabı: VStack 8 (metin + eylem satırı -2) */
.pc-asst { display: flex; flex-direction: column; gap: 8px; }
.pc-sumhead { font-size: 13px; font-weight: 600; color: var(--pal-text2); margin-bottom: -2px; }

/* MarkdownText: bloklar arası 11 */
.md { display: flex; flex-direction: column; gap: 11px; color: var(--pal-text); -webkit-user-select: text; user-select: text; cursor: text; }
.md p { font-size: 13px; line-height: 20px; margin: -2px 0; }   /* lineSpacing yalnız satır ARASINA eklenir */                         /* body, lineSpacing 4 */
.md .md-h { font-weight: 700; }
.md .md-h1 { font-size: 22px; line-height: 28px; padding-top: 10px; margin: -1px 0; }  /* title bold */
.md .md-h2 { font-size: 17px; line-height: 22px; padding-top: 10px; margin: -1px 0; }  /* title2 bold */
.md .md-h3 { font-size: 15px; line-height: 20px; padding-top: 5px; font-weight: 600; margin: -1px 0; }
.md .md-h4 { font-size: 13px; line-height: 18px; padding-top: 5px; font-weight: 700; margin: -1px 0; }
.md .md-li { display: flex; gap: 10px; align-items: baseline; font-size: 13px; line-height: 19px; margin: -1.5px 0; }
.md .md-li > .md-mk { flex: none; }
.md .md-li > .md-tx { flex: 1; min-width: 0; }
.md .md-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--pal-ink); display: inline-block; transform: translateY(-2px); }
.md .md-arrow { width: 12px; height: 12px; display: inline-block; transform: translateY(1px); color: var(--pal-ink); }
.md .md-num { font-weight: 600; color: var(--pal-ink); }
.md .md-gap { height: 7px; }
.md code { font-family: var(--font-mono); font-size: .92em; }
.md .ni.md-ic { --c: var(--pal-ink); vertical-align: baseline; }
.md strong { font-weight: 600; }

/* PALMessageActions: 32×32, aralık 2, #8E8E93, sıralı giriş (easeOut .3, 0/.12/.24/.36/.48, y +6) */
.pc-acts { display: flex; gap: 2px; margin-top: -2px; }
.pc-acts .pc-act:nth-child(5) { margin-left: -4px; }   /* macOS Menu etiketi 4 pt sola oturur (ölçüldü) */
.pc-act {
  width: 32px; height: 32px; display: grid; place-items: center; position: relative;
  opacity: 0; transform: translateY(6px);
  transition: opacity .3s cubic-bezier(0,0,.58,1), transform .3s cubic-bezier(0,0,.58,1);
}
.pc-acts.pc-rev .pc-act { opacity: 1; transform: none; }
.pc-act .ni { --c: #8E8E93; transition: opacity .2s ease-in-out, transform .2s ease-in-out; }
.pc-act.pc-on .ni { --c: var(--pal-ink); }
.pc-act.pc-busy .ni { --c: rgba(20,23,31,.5); }
.pc-act svg.pc-stop { width: 11px; height: 11px; color: #8E8E93; }

/* ••• menüsü (macOS NSMenu benzeri) */
.pc-menu {
  position: fixed; z-index: 50; min-width: 190px; padding: 5px;
  background: rgba(246,246,246,.86); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  border-radius: 10px; box-shadow: 0 0 0 .5px rgba(0,0,0,.18), 0 10px 30px rgba(0,0,0,.18);
  font-size: 13px; color: var(--pal-text);
  animation: pcFadeIn .12s ease-out both;
}
.pc-menu button { display: flex; align-items: center; gap: 8px; width: 100%; height: 24px; padding: 0 10px; border-radius: 5px; text-align: left; }
.pc-menu button:hover { background: #0A82FF; color: #fff; }
.pc-menu button.pc-danger { color: #E0352B; }
.pc-menu button.pc-danger:hover { color: #fff; }
.pc-menu hr { border: 0; height: 1px; background: rgba(0,0,0,.1); margin: 5px 10px; }
.pc-menu svg { width: 14px; height: 14px; flex: none; }

/* PALThinkingIndicator: HStack 8, 32 pt karalama + ShimmerText 14 medium */
.pc-think { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.pc-scribble { width: 32px; height: 32px; flex: none; }
.pc-scribble svg { width: 100% !important; height: 100% !important; display: block; }
.pc-dots { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; gap: 3.84px; flex: none; }
.pc-dots i { width: 5.76px; height: 5.76px; border-radius: 50%; background: var(--pal-ink); opacity: .3; }
.pc-dots i.on { opacity: 1; }
.pc-shimmer { position: relative; font-size: 14px; font-weight: 500; line-height: 17px; flex: 1; min-width: 0; transition: opacity .45s ease-in-out; }
.pc-shimmer .pc-base { color: rgba(0,0,0,.336); }                     /* textSecondary × 0.6 */
.pc-shimmer .pc-band {
  position: absolute; inset: 0; color: transparent;
  background-image: linear-gradient(90deg, rgba(15,18,28,0) 0%, rgba(15,18,28,.55) 40%, #0F121C 50%, rgba(15,18,28,.55) 60%, rgba(15,18,28,0) 100%);
  background-size: 55% 100%; background-repeat: no-repeat;
  -webkit-background-clip: text; background-clip: text;
  animation: pcSweep 1.5s linear infinite;
}
/* bant ofseti −0.9w → +1.2w; boy 0.55w ⇒ konum% = ofset / 0.45w */
@keyframes pcSweep { from { background-position: -200% 0; } to { background-position: 266.667% 0; } }

/* iOS thinkingView: karalama 30, tek satır (baştan kesik), dikey 4; giriş opaklık + 8 pt yükselme */
.pc-think-ios { padding: 4px 0; min-height: 38px; animation: pcRise .3s ease-in-out both; }
.pc-think-ios .pc-shimmer { white-space: nowrap; overflow: hidden; }
.pc-think.pc-out { animation: pcFadeOut .3s ease-in-out both; }
@keyframes pcRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* StreamingWordsText (iOS): FlowLayout(aralık 5, satır arası 7); kelime opaklık + 4 pt, easeOut .22 */
.md.sw { cursor: default; }
.sw .sw-flow { display: flex; flex-wrap: wrap; column-gap: 5px; row-gap: 7px; }
.sw .sw-p { font-size: 13px; line-height: 16px; }
.sw .md-h { margin: 0; line-height: normal; }
.sw .md-li { margin: 0; line-height: 16px; }
.sw .sw-w { display: inline-block; opacity: 0; transform: translateY(4px); transition: opacity .22s cubic-bezier(0,0,.58,1), transform .22s cubic-bezier(0,0,.58,1); color: var(--pal-text); }
.sw .sw-w.sw-in { opacity: 1; transform: none; }
.sw .sw-b { font-weight: 600; }

/* Boş durum: PALSnap 64 (opaklık .95) + ≤4 kelime title3 üçüncül; üstten 60 */
.pc-empty { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 60px; }
.pc-empty img { height: 64px; width: auto; opacity: .95; display: block; }
.pc-empty span { font-size: 15px; line-height: 19px; color: var(--pal-text3); transition: opacity .5s ease-in-out; }

/* Onay isteyen eylem (dışa dönük araç) — ince cam hap, mavi tek eylem */
.pc-onay { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; line-height: 18px; color: var(--pal-text2); }
.pc-onay-btn {
  height: 28px; padding: 0 14px; border-radius: 14px; font-size: 12px; font-weight: 600; color: #fff; background: var(--pal-ink);
}
.pc-onay-btn:disabled { background: var(--pal-text3); }

/* ---------- Yazma kutusu: yüzen, arkasında 56 pt yukarı taşan geçiş ---------- */
.pc-composer-wrap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 6px 24px 18px;
  pointer-events: none;
}
.pc-composer-wrap::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; top: -56px;
  background: linear-gradient(180deg, rgba(242,245,250,0) 0%, #F2F5FA 100%);
}
.pc-composer {
  position: relative; max-width: 880px; margin: 0 auto; pointer-events: auto;
  display: flex; align-items: flex-end;
  border-radius: 26px;
  background: #FAFCFF;
  box-shadow: inset 0 1px 0 #FFFFFF, inset 0 0 0 .5px rgba(255,255,255,.9), 0 5px 14px rgba(0,0,0,.10);
}
.pc-field { position: relative; flex: 1; min-width: 0; }
.pc-input {
  display: block; width: 100%; resize: none; border: 0; outline: 0; background: transparent;
  padding: 11px 16px; margin: 0;
  font: 400 13px/16px var(--font); color: var(--pal-text);
  height: 38px; max-height: 118px; overflow-y: auto;
}
/* ShimmerOnceText "Pall'a yaz…": üçüncül renk, beyaz çapraz bant (%60), tek geçiş 1.0 sn easeInOut */
.pc-ph {
  position: absolute; left: 16px; top: 11px; pointer-events: none;
  font-size: 13px; line-height: 16px; white-space: nowrap;
}
.pc-ph .pc-base { color: var(--pal-text3); }
.pc-ph .pc-band {
  position: absolute; inset: 0; color: transparent;
  background-image: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.55) 40%, #fff 50%, rgba(255,255,255,.55) 60%, rgba(255,255,255,0) 100%);
  background-size: 60% 100%; background-repeat: no-repeat; background-position: 300% 0;
  -webkit-background-clip: text; background-clip: text;
}
.pc-ph.pc-shine .pc-band { animation: pcOnce 1s ease-in-out both; }
@keyframes pcOnce { from { background-position: -225% 0; } to { background-position: 300% 0; } }

.pc-trail { flex: none; margin: 0 6px 1px 0; width: 36px; height: 36px; position: relative; }
.pc-trail > button {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  transition: transform .5s cubic-bezier(.3,1.3,.5,1), opacity .3s ease-in-out;
}
.pc-voice { background: #EDEDF1; }
.pc-voice .ni { --s: 20px; --c: var(--pal-ink); }
.pc-send { background: var(--pal-ink); }
.pc-send .ni { --s: 16px; --c: #fff; }
.pc-send:disabled { background: var(--pal-text3); }
.pc-trail > button.pc-hide { transform: scale(.01); opacity: 0; pointer-events: none; }

/* "Mesaj kopyalandı" hapı: footnote medium, 10/16, ultraThinMaterial, alttan 84 */
.pc-toast {
  position: absolute; left: 50%; bottom: 84px; z-index: 4;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  font-size: 10px; font-weight: 500; line-height: 13px; color: var(--pal-text);
  padding: 10px 16px; border-radius: 999px; white-space: nowrap;
  background: rgba(250,250,252,.62); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.7), 0 2px 8px rgba(0,0,0,.06);
  transition: transform .45s cubic-bezier(.25,1.15,.4,1), opacity .3s ease-in-out;
}
.pc-toast.pc-show { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .pc-shimmer .pc-band, .pc-ph .pc-band { animation: none; background: none; }
  .pc-act, .pm-chat, .pm-page { transition: none; }
}
