/* Video Üretimi (S-0113): the pane tabs and the fixed frame (21 Nov 2026, user, tablet: "biten videolar görünmüyor;
   üst menü iki satır, altta da menüler var; standart, kolay ve basit"). Loaded after ajan.css and overrides its old
   grid and phone switch without editing that file (other sessions work there). Writes no dialog rule: the P-0040
   player keeps its own (ajan.css). Panes: ajan-duzen.js writes .ajan-govde[data-acik="sohbetler sohbet videolar"]. */

/* ---- The frame: on this page the document does not scroll, the panes do; the footers show on the other pages. ---- */
/* min-height:0: style.css's body{min-height:100vh} would make the frame taller than a mobile browser tab with its URL
   bar showing (100vh > 100dvh there), and the bottom menu would cover the message box. */
body:has(#ajan-workspace){display:flex;flex-direction:column;height:100vh;height:100dvh;min-height:0;overscroll-behavior-y:none}
body:has(#ajan-workspace)>#app{display:flex;flex:1 1 0;flex-direction:column;min-height:0}
body:has(#ajan-workspace)>.site-footer,body:has(#ajan-workspace) #app>.footer{display:none}
body:has(#ajan-workspace) #view{display:flex;flex:1 1 0;flex-direction:column;min-height:360px;padding-top:12px;padding-bottom:12px}
#ajan-workspace{flex:1 1 0;gap:10px;min-height:0}

/* ---- The page bar: the pane tabs on the left; Hafıza, Pano and Yeni konuşma on the right. ---- */
.ajan-cubuk{display:flex;flex:none;align-items:center;justify-content:space-between;gap:10px;min-width:0}
.ajan-paneller{flex:0 1 auto;flex-wrap:nowrap;min-width:0;margin:0}
/* The Sohbetler tab: its word; on a narrow phone only its list icon (the word stays for screen readers), so four tabs
   fit 390 px ("Sohbetler" and "Sohbet" ran into each other once Notlar came). */
.ajan-paneller>button .icon{display:none}
.ajan-paneller>button{flex:0 0 auto;min-height:36px;padding:6px 14px;white-space:nowrap}
.ajan-cubuk-sag{display:flex;flex:none;align-items:center;gap:6px}
.ajan-cubuk-sag .btn{min-height:36px;padding:6px 12px}
.ajan-cubuk-sag .btn[aria-pressed="true"]{border-color:var(--accent-1);color:var(--accent-1)}
.ajan-cubuk-sag .count{margin-left:0}

/* ---- The panes, side by side; each scrolls inside itself. Share: list 1, chat 3.2, finished videos 1.3 (the
   desktop look before), from a zero base so the chat keeps its width; each keeps a readable minimum. ---- */
#ajan-workspace>.ajan-govde{display:flex;flex:1 1 0;align-items:stretch;gap:14px;min-height:0}
/* position:relative: a pane scrolls inside itself, so its absolutely placed children (the .sr-only labels) must be
   held by it; otherwise they reach past the screen and the document scrolls (1205×705 tablet: 4 px). */
#ajan-workspace>.ajan-govde>*{display:none;position:relative;min-width:0;min-height:0}
#ajan-workspace>.ajan-govde[data-acik~="sohbetler"]>.ajan-liste{display:flex;flex:1 1 0;flex-direction:column;gap:6px;min-width:min(260px,28%);overflow-y:auto;overscroll-behavior:contain}
#ajan-workspace>.ajan-govde[data-acik~="sohbet"]>.ajan-sohbet{display:flex;flex:3.2 1 0;min-width:min(420px,45%)}
#ajan-workspace>.ajan-govde[data-acik~="videolar"]>.ajan-videolar{display:block;flex:1.3 1 0;min-width:min(340px,40%);overflow-y:auto;overscroll-behavior:contain}
/* The chat alone on a wide screen stays a comfortable width. */
#ajan-workspace>.ajan-govde[data-acik="sohbet"]>.ajan-sohbet{max-width:1100px;margin-inline:auto}
/* The conversation list shows at every width (ajan.css hid it for a select on phones; the Sohbetler tab replaces that). */
#ajan-workspace .ajan-konusmalar{display:flex}

/* ---- The chat pane: one header row; messages and the strips under them scroll together; the box stays below. ---- */
#ajan-workspace .ajan-sohbet{flex-direction:column;gap:8px;container:sohbet/inline-size}
#ajan-workspace .ajan-ust{flex:none;align-items:center}
.ajan-ust-baslik{min-width:0}
.ajan-ust-baslik h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ajan-ust-alt{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0}
.ajan-ust-alt .ajan-saglayici:empty{display:none}
#ajan-workspace .ajan-ust-dugmeler{flex:none;flex-wrap:nowrap}
.ajan-ust-dugmeler .btn{gap:6px}
.ajan-on-uretim{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.ajan-on-uretim select{width:auto;min-width:0}
.ajan-akis{display:flex;position:relative;flex:1 1 0;flex-direction:column;gap:10px;min-height:120px;overflow-y:auto;overscroll-behavior:contain;padding-bottom:10px;background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card)}
#ajan-workspace .ajan-akis>.ajan-mesajlar{flex:none;min-height:0;max-height:none;overflow:visible;background:none;border:0;border-radius:0}
.ajan-akis>div{padding:0 12px}
.ajan-akis>div:empty{display:none}
#ajan-workspace .ajan-sohbet>.ajan-yaz,#ajan-workspace .ajan-sohbet>.ajan-durum,#ajan-workspace .ajan-sohbet>[data-ajan-video-serit],
#ajan-workspace .ajan-sohbet>.ajan-arsivde{flex:none}
/* A narrow chat: the header buttons show their icons, then "Ön üretim" drops its word (the select keeps its name). */
@container sohbet (max-width:899px){
  .ajan-ust-dugmeler .ajan-yazi{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .ajan-ust-dugmeler .btn{padding:8px 10px}
}
@container sohbet (max-width:559px){
  .ajan-ust{flex-wrap:wrap}
}
/* A short screen (a phone turned sideways, a tablet with its keyboard): the message box takes less room. */
@media (max-height:560px){#ajan-workspace .ajan-yaz textarea{min-height:0;max-height:20vh}}

/* ---- Biten videolar: one column when narrow; list beside the order and merge once the pane is wide (replaces
   ajan.css's 801–1360 px grid, whose heading rule never matched). ---- */
/* Not when the panel lies over the whole page (.tam, 0.51.409, ajan.css): that keeps its own grid and its fixed place. */
#ajan-workspace .ajan-videolar{container:kurgu/inline-size}
/* align-items:stretch: ajan.css's 801–1360 px grid set start, which shrank the Film koşusu strip on a tablet. */
#ajan-workspace .ajan-videolar:not(.tam) .ajan-videolar-icerik{display:flex;flex-direction:column;align-items:stretch}
/* The pane scrolls inside itself: the list's own box (ajan.css max-height + scroll) would be a scroller inside a
   scroller, and with a long film "Onaylı sıra" sat under a box taller than the pane. */
#ajan-workspace .ajan-videolar:not(.tam) .kurgu-videolar{max-height:none;overflow:visible}
@container kurgu (min-width:760px){
  #ajan-workspace .ajan-videolar:not(.tam) .ajan-videolar-icerik{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);align-items:start;gap:14px}
  #ajan-workspace .ajan-videolar:not(.tam) .ajan-videolar-icerik>:not(.kurgu-liste):not(.kurgu-yan){grid-column:1/-1}
}
@media (min-width:801px){#ajan-workspace>.ajan-govde>.ajan-videolar.tam{position:fixed}}

/* ---- Notlar (stage C, 21 Nov 2026): the project's idea book, beside the chat like Biten videolar. ---- */
#ajan-workspace>.ajan-govde[data-acik~="notlar"]>.ajan-notlar-bolum{display:block;flex:1.2 1 0;min-width:min(320px,38%);overflow-y:auto;overscroll-behavior:contain}
.ajan-notlar-kutu{display:flex;flex-direction:column;gap:12px;padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:var(--r-card)}
.ajan-notlar-bas h2{margin:0;font-size:1.05rem}
.ajan-not-yeni{display:flex;flex-direction:column;gap:6px}
.ajan-not-yeni textarea{width:100%;min-height:64px;resize:vertical}
.ajan-not-yeni-alt,.ajan-not-araclar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}
.ajan-not-araclar{justify-content:flex-start}
.ajan-not-grup{display:flex;flex-direction:column;gap:8px}
.ajan-not-grup h3,.ajan-not-grup>summary{margin:4px 0 0;font-size:.95rem;font-weight:600;cursor:pointer}
.ajan-not-liste{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}
.ajan-not-satir{display:flex;gap:8px;padding:10px 12px;background:var(--panel-2);border:1px solid var(--line);border-radius:var(--r-field)}
.ajan-not-oneri{border-color:var(--accent-2)}
.ajan-not-kullanildi{opacity:.72}
.ajan-not-sec{display:flex;align-items:flex-start;padding-top:2px}
.ajan-not-govde{display:flex;flex:1;flex-direction:column;gap:4px;min-width:0}
.ajan-not-metin{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.ajan-not-dugmeler{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:4px}
.ajan-not-dugmeler .btn,.ajan-not-araclar .btn,.ajan-not-yeni-alt .btn{display:inline-flex;align-items:center;gap:6px;min-height:36px}
/* A suggestion of the manager waits: a dot on the tab (its name is the dot's label). */
.ajan-paneller [data-kurgu-bolum="notlar"]{position:relative}
/* 23 Nov 2026: versions not watched yet (kurgu_paneli.yeni_mi), a count on the Biten videolar tab */
.ajan-paneller [data-kurgu-bolum="videolar"][data-yeni]::after{content:attr(data-yeni);display:inline-block;margin-left:5px;
  vertical-align:1px;min-width:16px;height:16px;padding:0 4px;box-sizing:border-box;border-radius:8px;background:var(--accent-2);color:#0b0e13;font-size:10px;
  font-weight:700;line-height:16px;text-align:center}
.ajan-not-nokta{position:absolute;top:5px;right:5px;width:8px;height:8px;border-radius:50%;background:var(--accent-2)}
@media (pointer:coarse){.ajan-not-dugmeler .btn,.ajan-not-dugmeler .icon-btn,.ajan-not-araclar .btn{min-height:44px;min-width:44px}}

/* ---- Hafıza and Pano fill the frame and scroll inside it. ---- */
#ajan-workspace>.ajan-duz{position:relative;flex:1 1 0;min-height:0;overflow:auto;overscroll-behavior:contain}

/* ---- A phone (one pane): the tabs share the bar; below 560 px the right-hand buttons show their icons only. ---- */
@media (max-width:800px){
  .ajan-paneller{flex:1 1 auto}
  .ajan-paneller>button{flex:1 1 0;min-width:0;min-height:44px;padding:4px 6px}
  .ajan-cubuk-sag .btn{min-width:44px;min-height:44px}
}
@media (max-width:560px){
  .ajan-cubuk{gap:6px}
  .ajan-cubuk-sag{gap:4px}
  .ajan-cubuk-sag .ajan-yazi{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .ajan-cubuk-sag .btn{padding:6px}
  .ajan-paneller>button{font-size:12px;line-height:1.15;white-space:normal}
  .ajan-paneller>button[data-kurgu-bolum="sohbetler"]{position:relative;flex:0 0 44px;padding:0}
  .ajan-paneller>button[data-kurgu-bolum="sohbetler"] .icon{display:block;margin:auto}
  .ajan-paneller>button[data-kurgu-bolum="sohbetler"] .ajan-yazi{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}

/* ---- Touch (stage D, 21 Nov 2026): on a screen without a mouse the controls that showed on hover are always there,
   and the small row icons take a finger. Pointer and hover follow the device, not the width (the user's 1280 px tablet). */
@media (hover:none){
  #ajan-workspace .kurgu-aralik-btn{opacity:.8}
  #ajan-workspace .ajan-konusma-islem,#ajan-workspace .ajan-duzelt-dugme{opacity:1}
}
@media (pointer:coarse){
  .ajan-paneller>button,.ajan-cubuk-sag .btn{min-height:44px}
  #ajan-workspace .ajan-konusma-islem .icon-btn{width:40px;height:40px}
  #ajan-workspace .ajan-konusma-satir .ajan-konusma{padding-right:92px}
  #ajan-workspace .kurgu-aralik-btn{min-height:36px;padding:6px 12px}
  #ajan-workspace .ajan-duzelt-dugme{min-width:36px;min-height:36px}
}
