/* moiterm Ofis görünümü (#/ofis): tam alan 3B sahne + sade CEO arayüzü. Renkler tema belirteçlerinden. */
.ofis-v { position: relative; flex: 1; min-height: calc(100dvh - 120px); border-radius: var(--r-lg); overflow: hidden; background: #e8e4dc; isolation: isolate; }
.ofis-sahne { position: absolute; inset: 0; }
.ofis-sahne canvas { display: block; width: 100%; height: 100%; }
.ofis-ust { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; align-items: center; gap: 8px; z-index: 3; pointer-events: none; }
.ofis-ust > * { pointer-events: auto; }
.ofis-bos { flex: 1; pointer-events: none; }
.ofis-cip, .ofis-dg { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--r-full); background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line); color: var(--text); backdrop-filter: blur(8px); box-shadow: var(--elev-1); }
.ofis-dg { position: relative; padding: 0 10px; cursor: pointer; font: inherit; }
.ofis-dg:hover { border-color: var(--accent); }
.ofis-logo { font-family: var(--mono); font-weight: 700; color: var(--accent); }
.ofis-ad { max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ofis-ust .kn-mode { background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(8px); }
.ofis-halka svg { transform: rotate(-90deg); }
.hk-a { fill: none; stroke: var(--line-2); stroke-width: 4; }
.hk-b { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray var(--dur-2) var(--ease); }
.ofis-gz { font-size: var(--fs-13); font-variant-numeric: tabular-nums; }
.ofis-rozet { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: var(--fs-12); display: grid; place-items: center; }
.ofis-bildirim { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); z-index: 4; padding: 8px 14px; border-radius: var(--r-full); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--elev-1); font-size: var(--fs-14); max-width: calc(100% - 32px); animation: ofis-in var(--dur-2) var(--ease); }
.ofis-bildirim.hata { border-color: var(--bad); color: var(--bad); top: 100px; }
@keyframes ofis-in { from { opacity: 0; transform: translate(-50%, -6px); } }
.ofis-kur { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; gap: 12px; text-align: center; padding: 24px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); }
.ofis-kur h2 { margin: 0; font-size: var(--fs-24); }
.ofis-kur p { margin: 0 auto; max-width: 440px; color: var(--muted); line-height: 1.5; }
.ofis-kur .btn { justify-self: center; }
.ofis-alt { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(640px, calc(100% - 24px)); z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.ofis-kart { padding: 12px 14px; border-radius: var(--r-lg); background: var(--panel-solid); border: 1px solid var(--line); border-left: 4px solid var(--accent); box-shadow: var(--elev-1); animation: ofis-yukari var(--dur-2) var(--ease); }
.ofis-kart.k-oneri, .ofis-kart.k-plan_onay { border-left-color: #f0b43c; }
.ofis-kart.k-kabul { border-left-color: var(--ok); }
.ofis-kart.k-durdu { border-left-color: var(--bad); }
@keyframes ofis-yukari { from { opacity: 0; transform: translateY(8px); } }
.ok-ust { display: flex; justify-content: space-between; gap: 8px; }
.ok-n { font-size: var(--fs-12); color: var(--muted); }
.ofis-kart p { margin: 6px 0 10px; color: var(--muted); font-size: var(--fs-14); line-height: 1.45; overflow-wrap: anywhere; }
.ok-dg { display: flex; flex-wrap: wrap; gap: 8px; }
.ofis-kart p.ok-not { margin-top: -6px; padding-left: 8px; border-left: 2px solid var(--line-2); font-style: italic; }
.ok-detay { margin: -4px 0 10px; font-size: var(--fs-13); }
.ok-detay summary { cursor: pointer; color: var(--accent); min-height: 32px; display: flex; align-items: center; }
.ok-detay ol, .ok-detay ul { margin: 4px 0 8px; padding-left: 18px; max-height: 40vh; overflow: auto; }
.okd-hat li.atla { color: var(--muted); }
.okd-liste { list-style: none; padding-left: 0 !important; }
.okd-liste li { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.okd-liste small, .okd-kanit { color: var(--muted); }
.okd-kanit { white-space: pre-wrap; }
.okd-bolum { margin-top: 6px; }
.ofis-is { display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 16px; border-radius: 26px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--elev-1); }
.ofis-is:focus-within { border-color: var(--accent); }
.ofis-is textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-16); line-height: 22px; padding: 9px 0; max-height: 120px; }
.ofis-gonder { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; }
.ofis-gonder:disabled { opacity: .45; cursor: default; }
.ofis-kisi { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(0, 0, 0, .15); }
.ofis-kisi-k { min-width: 240px; max-width: calc(100% - 32px); padding: 16px; border-radius: var(--r-lg); background: var(--panel-solid); border: 1px solid var(--line); display: grid; gap: 4px; }
.ofis-kisi-k small { color: var(--muted); }
.ofis-kisi-k p { margin: 8px 0; }
.ofis-cekmece { position: absolute; top: 60px; right: 10px; bottom: 10px; width: min(380px, calc(100% - 20px)); z-index: 6; background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--elev-1); /* üst çubuğun altında: düğmeler açık panelde de tıklanır */ display: flex; flex-direction: column; animation: ofis-sag var(--dur-2) var(--ease); }
@keyframes ofis-sag { from { transform: translateX(24px); opacity: 0; } }
.oc-ust { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.oc-liste { flex: 1; overflow: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.oc-bos { color: var(--muted); margin: 0; line-height: 1.5; }
.oc-is { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.oi-ust { display: flex; justify-content: space-between; gap: 8px; }
.oi-d { font-size: var(--fs-12); color: var(--muted); white-space: nowrap; }
.oi-d.d-kabul_bekliyor, .oi-d.d-plan_onay { color: #b7791f; }
.oi-d.d-bitti { color: var(--ok); }
.oi-d.d-durdu { color: var(--bad); }
.oi-bolum { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.oi-bolum span { font-size: var(--fs-12); padding: 2px 8px; border-radius: var(--r-full); background: var(--panel-2); color: var(--muted); }
.oi-bolum .b-gecti { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.oi-bolum .b-suruyor, .oi-bolum .b-inceleme { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.oc-msj small { color: var(--muted); }
.oc-msj p { margin: 2px 0 0; overflow-wrap: anywhere; }
.oc-ekip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.oc-uyari { flex-basis: 100%; margin: 0; padding: 6px 8px; border-radius: var(--r-sm); border-left: 3px solid #f0b43c; background: var(--panel-solid); color: var(--muted); font-size: var(--fs-13); overflow-wrap: anywhere; }
.oc-ekip > div { display: grid; min-width: 0; }
.oc-ekip small { color: var(--muted); }
.oc-ekip select { max-width: 58%; min-height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--input-bg); color: var(--text); padding: 0 6px; }
@media (max-width: 520px) {
  .ofis-v { min-height: calc(100dvh - 150px); border-radius: 0; }
  .ofis-cip { display: none; } /* telefonda ofis adı sığmıyor; tek başına anlamsız >_ simgesi kalmasın */
  .ofis-ust { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { .ofis-kart, .ofis-cekmece, .ofis-bildirim { animation: none; } }
/* Ofis ayrı uygulama: tam ekran (moiterm yan menüsü yok) */
.ofis-v.tam { position: fixed; inset: 0; min-height: 0; border-radius: 0; z-index: 1; }
.ofis-av { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--panel) 88%, transparent); background: var(--accent); color: var(--on-accent); font-weight: 700; cursor: pointer; box-shadow: var(--elev-1); }
.ofis-av:hover { outline: 2px solid var(--accent); outline-offset: 2px; }

/* İlk giriş seçimi */
.kip-ekran { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px 16px; background: var(--bg); text-align: center; }
.kip-ekran h1 { margin: 0; font-size: var(--fs-24); }
.kip-alt { margin: 0 0 12px; color: var(--muted); }
.kip-kartlar { display: grid; grid-template-columns: repeat(2, minmax(0, 300px)); gap: 16px; width: 100%; justify-content: center; }
.kip-kart { display: grid; gap: 6px; padding: 12px 12px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel-solid); color: var(--text); text-align: left; cursor: pointer; font: inherit; transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease); }
.kip-kart:hover, .kip-kart:focus-visible { transform: translateY(-3px); border-color: var(--accent); }
.kip-kart img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-md); }
.kip-kart b { font-size: var(--fs-16); }
.kip-kart span { color: var(--muted); font-size: var(--fs-14); line-height: 1.45; }
@media (max-width: 560px) { .kip-kartlar { grid-template-columns: minmax(0, 1fr); max-width: 360px; } .kip-kart { grid-template-columns: 96px 1fr; grid-template-rows: auto 1fr; align-items: start; } .kip-kart img { grid-row: span 2; } }

/* Avatar menüsü: ortada açılır */
.gm-arka { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .35); backdrop-filter: blur(3px); animation: gm-in var(--dur-2) var(--ease); }
.gm { width: min(400px, 100%); padding: 16px; border-radius: var(--r-lg); background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--elev-1); display: grid; gap: 10px; animation: gm-buyu var(--dur-2) var(--ease); }
.gm-ust { display: flex; align-items: center; gap: 10px; min-width: 0; padding-bottom: 4px; }
.gm-av { flex: none; }
.gm-sec { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-md); border: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.gm-sec img { width: 56px; height: 56px; border-radius: var(--r-sm); object-fit: cover; }
.gm-sec span { display: grid; gap: 2px; min-width: 0; }
.gm-sec small { color: var(--muted); }
.gm-sec.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.gm-sec:hover, .gm-sec:focus-visible { border-color: var(--accent); }
.gm-alt { display: flex; justify-content: space-between; padding-top: 4px; }
@keyframes gm-in { from { opacity: 0; } }
@keyframes gm-buyu { from { opacity: 0; transform: scale(.96); } }


/* Gerçek durum: ofis geneli, kullanım, işin şu anki adımı, başlat paneli */
.ofis-sis .sis-nokta, .oc-sis .sis-nokta { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.sis-hazir .sis-nokta { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.sis-eksik .sis-nokta { background: #f0b43c; }
.sis-kapali .sis-nokta { background: var(--bad); }
.ofis-sis .sis-m { font-size: var(--fs-13); white-space: nowrap; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
.ofis-kul { gap: 4px; font-size: var(--fs-13); font-variant-numeric: tabular-nums; cursor: default; }
.ofis-kul.kul-uyari { color: #b7791f; }
.ofis-kul.kul-kotu { color: var(--bad); }
.ofis-ne { margin: 0; padding: 6px 14px; border-radius: var(--r-full); background: color-mix(in srgb, var(--panel-solid) 92%, transparent); border: 1px solid var(--line); font-size: var(--fs-13); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ofis-ne b { color: var(--text); }
.oi-ne { margin: 6px 0 0; font-size: var(--fs-13); color: var(--muted); }
.ofis-kart.k-baslat { border-left-color: var(--accent); }
.ofis-sec { min-height: 36px; min-width: 0; flex: 1; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--input-bg); color: var(--text); padding: 0 8px; }
.oc-sis { display: flex; align-items: center; gap: 8px; }
.oc-baslat { display: flex; gap: 8px; align-items: center; }
.oc-dur { font-size: var(--fs-12); padding: 2px 8px; border-radius: var(--r-full); background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.oc-dur.dur-hazir, .oc-dur.dur-calisiyor { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.oc-dur.dur-onay { background: color-mix(in srgb, #f0b43c 22%, transparent); color: #b7791f; }
.oc-dur.dur-kapali, .oc-dur.dur-claude_yok, .oc-dur.dur-ulasilamiyor, .oc-dur.dur-hata { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.oc-gelismis summary { cursor: pointer; color: var(--muted); font-size: var(--fs-13); }
.oc-gelismis[open] { display: grid; gap: 10px; }
@media (max-width: 520px) { .ofis-sis .sis-m { display: none; } }

/* Sahne yüklenirken: boş ekran yerine gösterge */
.ofis-yukle { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 12px; color: #6b5a45; font-size: var(--fs-14); background: #efe6d8; }
/* İş iptali */
.oi-iptal { margin-top: 6px; }
/* Telefonda paneller alttan açılır ve içeriğe göre boyutlanır (ofis görünür kalır) */
@media (max-width: 520px) {
  .ofis-cekmece { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 72dvh; height: auto; animation-name: ofis-alttan; }
  .ofis-cekmece .oc-liste { flex: 0 1 auto; }
}
@keyframes ofis-alttan { from { transform: translateY(24px); opacity: 0; } }
.ofis-kart.k-komut_onay { border-left-color: #f0b43c; }

/* Müdür sohbeti: sol alt (geniş ekran), telefonda iş kutusunun üstünde */
.ofis-sohbet-kok { position: absolute; left: 14px; bottom: 14px; z-index: 4; width: min(360px, calc(100% - 28px)); }
.ofis-sohbet-cip { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 300px; padding: 8px 12px 8px 8px; border-radius: var(--r-full); background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--elev-1); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.osc-av { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #5aa9e6; color: #fff; font-weight: 700; }
.osc-m { display: grid; min-width: 0; }
.osc-m b { font-size: var(--fs-13); }
.osc-m small { color: var(--muted); font-size: var(--fs-12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ofis-sohbet { display: flex; flex-direction: column; max-height: min(60dvh, 520px); border-radius: var(--r-lg); background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--elev-1); overflow: hidden; animation: ofis-yukari var(--dur-2) var(--ease); }
.os-ust { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.os-ust b { flex: 1; }
.os-dur { font-size: var(--fs-12); padding: 2px 8px; border-radius: var(--r-full); background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.os-dur.acik { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.os-liste { flex: 1; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.os-m { max-width: 85%; align-self: flex-start; padding: 8px 10px; border-radius: 14px 14px 14px 4px; background: var(--panel-2); }
.os-m.ben { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: color-mix(in srgb, var(--accent) 22%, var(--panel-2)); }
.os-m small { display: block; color: var(--muted); font-size: var(--fs-12); margin-bottom: 2px; }
.os-m p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.4; }
.os-yaziyor p { display: flex; gap: 4px; padding: 4px 0; }
.os-yaziyor i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: os-nokta 1.2s infinite ease-in-out; }
.os-yaziyor i:nth-child(2) { animation-delay: .15s; } .os-yaziyor i:nth-child(3) { animation-delay: .3s; }
@keyframes os-nokta { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
/* Orta-dar ekranlarda iş kutusuyla çakışmasın: kutunun üstüne çıkar */
/* Dar ekran: sohbet en altta, iş kutusu ve kart onun üstünde (çakışmasın) */
@media (max-width: 1100px) { .ofis-alt { bottom: 68px; } .ofis-sohbet-kok { bottom: 12px; } .ofis-sohbet { max-height: 46dvh; } }
@media (max-width: 520px) { .ofis-sohbet-kok { left: 12px; right: 12px; width: auto; } .ofis-sohbet-cip { max-width: none; } }
@media (prefers-reduced-motion: reduce) { .os-yaziyor i { animation: none; } }
