/* Wexon Office — responsive UI system (loaded last).
   Breakpoints: XL >=1600 · Desktop 1280–1599 · Tablet-L 900–1279 · Tablet 600–899 · Mobile <600 */
:root{
  --header-h:64px;--dock-h:50px;--drawer-w:344px;--page-gap:16px;--panel-radius:14px;
  --bg:#0a0e10;--panel-bg-strong:rgba(9,14,17,.96);--border-hover:rgba(77,242,142,.38);--accent-soft:rgba(77,242,142,.12);--text:#edf3f0;
  --radius-sm:8px;--radius-md:12px;--radius-lg:16px;--shadow-panel:0 14px 40px rgba(0,0,0,.45);
  --header-height:var(--header-h);--drawer-width:var(--drawer-w);--dock-height:var(--dock-h);
  --fs-xs:11px;--fs-sm:12px;--fs-md:13px;--fs-lg:15px;--fs-xl:20px;
  --panel-bg:rgba(12,19,23,.94);--border:rgba(153,177,170,.18);--accent:#4df28e;
  --text-primary:#edf3f0;--text-muted:#8d9895;--safe-b:env(safe-area-inset-bottom,0px);
  --wx-sidebar:var(--drawer-w)!important;--wx-line:var(--border);--wx-green:var(--accent);--wx-card:var(--panel-bg);--wx-muted:var(--text-muted);
}
@media(max-width:1599px){:root{--drawer-w:320px;--page-gap:14px}}
@media(max-width:1279px){:root{--drawer-w:min(380px,calc(100vw - 16px));--page-gap:12px}}
@media(max-width:599px){:root{--header-h:56px;--dock-h:54px;--drawer-w:calc(100vw - 16px);--page-gap:10px}}

/* ---------- Header ---------- */
html body .topbar{height:var(--header-h)!important;padding:0 clamp(12px,2vw,32px)!important;gap:clamp(8px,1.4vw,24px)!important;flex-wrap:nowrap!important}
html body .brand{min-width:0!important;flex:none}
html body .brand-word{font-size:clamp(22px,2vw,29px)!important}
html body .topnav{flex:none;gap:4px!important}
html body .topnav .nav-item{min-height:40px}
html body .global-search{flex:0 1 clamp(220px,28vw,400px)!important;min-width:0!important;margin-left:auto}
html body .top-actions{flex:none;gap:clamp(6px,.8vw,14px)!important;margin-left:0}
html body .header-metrics,html body .clock,html body .api-state,html body .runtime-badge-hidden{display:none!important}
html body .icon-top.utility-nav,html body #helpBtn,html body #mobileWatchBtn,html body #installBtn{display:none!important}
html body #notificationBtn{display:inline-grid!important;place-items:center;width:40px;height:40px}
html body .founder-chip{flex:none}
html body .layout{top:var(--header-h)!important}
@media(max-width:1279px){
  html body .topnav .nav-item{min-width:0!important;padding:0 12px!important}
  html body .topnav .nav-item small{display:none!important}
  html body .founder-copy,html body .founder-chip>i{display:none!important}
  html body .global-search{display:flex!important;flex:none!important;width:44px!important;height:44px;padding:0!important;justify-content:center;cursor:pointer;margin-left:auto}
  html body .global-search input,html body .global-search kbd{position:absolute;opacity:0;width:0!important;padding:0!important;pointer-events:none}
  html body .global-search:focus-within{position:fixed!important;left:10px;right:10px;top:calc((var(--header-h) - 46px)/2);width:auto!important;height:46px;z-index:800;background:#0b1317!important;justify-content:flex-start;padding:0 14px!important;gap:10px}
  html body .global-search:focus-within input{position:static;opacity:1;width:100%!important;pointer-events:auto;font-size:16px}
  html body .wx-search-results{position:fixed;left:10px;right:10px;top:calc(var(--header-h) + 4px);max-height:60vh}
}
@media(max-width:599px){
  html body .topnav{display:none!important}
  html body .topbar{gap:8px!important}
  html body .brand{margin-right:auto}
  html body .global-search{margin-left:0}
  html body .icon-top,html body .founder-chip{min-width:44px;min-height:44px}
}

/* ---------- Bottom dock ---------- */
html body .wx-dock{bottom:calc(14px + var(--safe-b))!important;height:var(--dock-h);z-index:200}
html body .wx-dock button{height:calc(var(--dock-h) - 12px)!important;min-width:44px}
@media(max-width:1279px){html body .wx-dock button{padding:0 14px!important}}
@media(max-width:599px){
  html body .wx-dock{left:8px!important;right:8px!important;transform:none!important;width:auto!important;max-width:none!important;bottom:calc(8px + var(--safe-b))!important;justify-content:space-between;padding:5px;overflow:visible}
  html body .wx-dock button{flex:1 1 0;flex-direction:row!important;align-items:center;min-width:44px;padding:0 6px!important;justify-content:center;gap:0!important}
  html body .wx-dock button span{display:none!important}
  html body .wx-dock button.active{flex:1.7 1 0}
  html body .wx-dock button.active span{display:inline!important;margin-left:6px;font-size:12px}
  html body .wx-camera{bottom:calc(var(--dock-h) + 20px + var(--safe-b))!important}
}

/* ---------- Drawer / inspector ---------- */
html body .inspector{width:var(--drawer-w)!important;top:calc(var(--header-h) + 8px)!important;right:8px!important;bottom:8px!important;max-width:calc(100vw - 16px)!important;padding:clamp(14px,1.4vw,20px)!important}
@media(max-width:1279px){
  html body:not([data-view="office"]) .inspector{display:none!important}
  html body:not([data-view="office"]).wx-inspect .inspector{display:flex!important;z-index:600!important;box-shadow:0 0 0 100vmax rgba(0,0,0,.5),0 20px 60px #000c!important}
  html body[data-view="office"].office-drawer-open .inspector{z-index:600!important;box-shadow:0 20px 60px #000c!important}
  html body .wx-stage{right:0!important}
  html body .wxp{right:0!important}
}
@media(max-width:599px){html body .inspector{left:8px!important;right:8px!important;width:auto!important;top:calc(var(--header-h) + 6px)!important;bottom:calc(8px + var(--safe-b))!important}}
html body .wxp-inspect-close{top:12px;right:12px;width:44px;height:44px}

/* ---------- Pages ---------- */
html body .wxp{right:calc(var(--drawer-w) + var(--page-gap) + 8px);padding:var(--page-gap) var(--page-gap) calc(var(--dock-h) + 36px + var(--safe-b));gap:var(--page-gap);grid-template-columns:clamp(232px,17vw,280px) minmax(0,1fr);scroll-padding-bottom:120px}
html body[data-view="settings"] .wxp{right:0}
html body .wxp.wxp-settings{grid-template-columns:clamp(220px,16vw,270px) minmax(0,1fr) clamp(240px,17vw,290px)}
html body .wxp.wxp-analytics{grid-template-columns:minmax(0,1fr)}
.wxp-card,.wx-glass{border-radius:var(--panel-radius)}
.wxp-sum-toggle{display:none}
.wxp-tabs{display:none}
.wxp-collapse>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;cursor:pointer;min-height:24px}
.wxp-collapse>summary::-webkit-details-marker{display:none}
.wxp-collapse>summary i{font-style:normal;transition:transform .2s;color:var(--text-muted)}
.wxp-collapse[open]>summary i{transform:rotate(180deg)}
.wxp-collapse[open]>summary{margin-bottom:10px}
.wxp-collapse>summary h3{margin:0}
.wxp-grid{grid-template-columns:repeat(auto-fill,minmax(clamp(200px,15vw,240px),1fr))}
.wxp-person{padding:clamp(10px,1vw,14px)}
.wxp-activity{min-height:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.wxp-kpis{grid-template-columns:repeat(auto-fit,minmax(clamp(170px,14vw,230px),1fr))}
.wxp-main.wide{max-width:none}

@media(max-width:1279px){
  html body .wxp,html body .wxp.wxp-settings{grid-template-columns:minmax(0,1fr);align-content:start}
  html body .wxp-side{flex-direction:row;flex-wrap:wrap;align-self:stretch}
  html body .wxp-side>*{flex:1 1 240px;min-width:0}
  html body .wxp.wxp-settings>.wxp-side:last-of-type{display:flex}
  .wxp-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .wxp-agrid{grid-template-columns:repeat(6,minmax(0,1fr))}
  .wxp-agrid>div{grid-column:span 6!important}
  .wxp-agrid .a1,.wxp-agrid .a5{grid-column:span 3!important}
  .wxp-runtime{grid-template-columns:repeat(2,1fr)}
  .wxp-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .wxp-board{grid-template-columns:repeat(4,minmax(220px,1fr))}
  .wxp-map{height:170px!important}
}
@media(max-width:899px){
  /* collapsible summaries */
  html body .wxp-people>.wxp-side,html body .wxp-tasks>.wxp-side{display:none}
  html body .wxp-people.show-side>.wxp-side,html body .wxp-tasks.show-side>.wxp-side{display:flex}
  .wxp-sum-toggle{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:0 14px;background:var(--panel-bg);border:1px solid var(--border);border-radius:12px;color:var(--text-primary);font-size:13px;font-weight:600;cursor:pointer}
  .wxp-sum-toggle .wx-icon{width:17px;height:17px;color:var(--accent)}.wxp-sum-toggle i{margin-left:auto;font-style:normal;transition:transform .2s}
  .wxp-sum-toggle[aria-expanded="true"] i{transform:rotate(180deg)}
  .wxp-board{grid-template-columns:repeat(2,minmax(0,1fr));min-height:0}
  .wxp-map{height:150px!important}
  .wxp-agrid .a1,.wxp-agrid .a5{grid-column:span 6!important}
  html body .wxp-side>*{flex-basis:100%}
}
@media(max-width:599px){
  html body .wxp{padding:10px 10px calc(var(--dock-h) + 30px + var(--safe-b))}
  .wxp-grid{grid-template-columns:minmax(0,1fr)}
  .wxp-person{padding:10px 12px}.wxp-person-top{gap:10px}.wxp-avatar{width:40px;height:40px}
  .wxp-activity{-webkit-line-clamp:1}
  .wxp-controls{gap:8px}.wxp-controls>*{flex:1 1 100%;min-width:0}
  .wxp-controls select,.wxp-search input{height:44px;font-size:16px;width:100%}.wxp-search{flex:1 1 100%}
  .wxp-grid-card>header{position:sticky;top:0;z-index:5;background:var(--panel-bg);margin:-14px -14px 10px;padding:12px 14px;border-radius:var(--panel-radius) var(--panel-radius) 0 0}
  .wxp-hero{flex-direction:row;align-items:center}.wxp-hero h2{font-size:20px!important}.wxp-hero p{display:none}
  .wxp-primary{height:44px}
  /* tasks: status tabs + single column */
  .wxp-tabs{display:flex;gap:6px;overflow-x:auto;scroll-snap-type:x proximity;padding-bottom:2px;scrollbar-width:none}
  .wxp-tabs button{flex:1 0 auto;scroll-snap-align:start;min-height:44px;padding:0 12px;border-radius:10px;border:1px solid var(--border);background:#0a1216;color:var(--text-muted);font-size:12.5px;cursor:pointer;display:flex;align-items:center;gap:8px;white-space:nowrap}
  .wxp-tabs button b{background:#16222a;border-radius:99px;padding:1px 7px;font-size:11px;color:var(--text-primary)}
  .wxp-tabs button.active{border-color:var(--accent);color:var(--accent);background:rgba(77,242,142,.08)}
  .wxp-board{grid-template-columns:minmax(0,1fr)}
  .wxp-board .wxp-col{display:none}.wxp-board .wxp-col.tab-active{display:flex}
  .wxp-col>header{display:none}
  .wxp-task{padding:12px;cursor:pointer}.wxp-move button{min-height:44px}
  /* analytics */
  .wxp-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .wxp-kpi{flex-direction:column;align-items:flex-start;gap:8px;padding:12px}.wxp-kpi b{font-size:20px}
  .wxp-agrid{grid-template-columns:minmax(0,1fr)}.wxp-agrid>div,.wxp-agrid .a1,.wxp-agrid .a5{grid-column:span 1!important}
  .wxp-load{grid-template-columns:minmax(70px,1fr) 1.2fr 38px;gap:8px}
  .wxp-heat{grid-template-columns:repeat(2,minmax(0,1fr))}.wxp-runtime{grid-template-columns:repeat(2,1fr)}
  /* settings: category strip */
  html body .wxp-settings>.wxp-side:first-child .wxp-card>header{display:none}
  html body .wxp-settings>.wxp-side:first-child{align-self:auto}
  .wxp-nav{flex-direction:row;overflow-x:auto;gap:6px;scroll-snap-type:x proximity;scrollbar-width:none}
  .wxp-nav button{flex:0 0 auto;min-height:44px;scroll-snap-align:start;border-color:var(--border)}
  .wxp-nav small{display:none}
  html body .wxp-settings>.wxp-side:first-child>.wxp-card{padding:8px}
  .wxp-dev{grid-template-columns:1fr 1fr}.wxp-dev button{min-height:44px}
  .wxp-row-btn,.wxp-dept{min-height:44px}
  .wxp-kv{flex-wrap:wrap}
}

/* ---------- Office HUD ---------- */
.wx-status{width:clamp(232px,17vw,300px)!important}
.wx-events{width:clamp(250px,19vw,330px)!important}
@media(max-width:1279px){
  .wx-hud-tab{display:inline-flex;position:absolute;z-index:110;top:12px;min-height:44px;align-items:center;padding:0 16px;border-radius:99px;border:1px solid rgba(255,255,255,.14);background:rgba(9,13,15,.86);backdrop-filter:blur(8px);color:#e9efec;font-size:13px;cursor:pointer}
  .wx-hud-tab.tab-status{left:12px}.wx-hud-tab.tab-events{left:calc(12px + 8px + 118px)}
  .wx-hud-tab[aria-expanded="true"]{border-color:var(--accent);color:var(--accent)}
  .wx-status,.wx-events{display:none;top:64px!important;bottom:auto!important;left:12px!important;width:min(320px,calc(100vw - 24px))!important;z-index:130!important}
  .wx-office.show-status .wx-status,.wx-office.show-events .wx-events{display:block}
  .wx-event-list article:nth-child(n+3){display:grid!important}.wx-event-list article:nth-child(n+5){display:none!important}
  .wx-event-icon{display:grid!important}
  .wx-scene-help{display:none}
  .wx-camera{bottom:calc(var(--dock-h) + 26px + var(--safe-b))!important;right:12px!important;height:44px!important}
  .wx-camera button{min-width:44px!important;min-height:40px}
}
@media(max-width:599px){
  .wx-camera{right:8px!important}
  .wx-camera [data-wx-full]{display:none!important}
  .wx-hud-tab.tab-events{left:auto;right:10px}
  .wx-hud-tab.tab-status{left:10px}
  .wx-status,.wx-events{left:10px!important;width:calc(100vw - 20px)!important}
}
@media(prefers-reduced-motion:reduce){html body .inspector,.wxp-sum-toggle i,.wxp-collapse>summary i{transition:none!important}}
@media(max-width:599px){.wxp-tasks .wxp-controls select{flex:1 1 calc(50% - 4px)}.wxp-tasks .wxp-controls #wxTaskProject{flex:1 1 100%}}
@media(max-width:599px){.wxp-kpis>:last-child:nth-child(odd){grid-column:1/-1}}

/* ---------- Page dock: fixed to the viewport (not scrolled with .wxp), centred on the content column ---------- */
html body .wxp>.wx-dock{position:fixed;transform:translateX(-50%)}
@media(min-width:1280px){
  html body .wxp>.wx-dock{left:calc((100vw - var(--drawer-w) - var(--page-gap) - 8px)/2)!important}
  html body[data-view="settings"] .wxp>.wx-dock{left:50%!important}
}
@media(min-width:600px) and (max-width:1279px){html body .wxp>.wx-dock{left:50%!important}}
@media(max-width:599px){html body .wxp>.wx-dock{transform:none!important}}

/* ---------- Legacy technical surfaces (Hafıza, Agent OS, Onaylar, Sosyal, Terminal, Hakkında) ---------- */
html body .v6-legacy{right:0;padding:clamp(16px,2.4vw,32px) clamp(12px,2.4vw,32px) calc(var(--dock-h) + 40px + var(--safe-b))}
@media(min-width:1280px){html body:not([data-view="office"]):not([data-view="settings"]) .v6-legacy{right:calc(var(--drawer-w) + 8px)}}
html body .v6-legacy-art{top:var(--header-h)}
html body .wx-legacy-dock{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(14px + var(--safe-b))}
@media(min-width:1280px){html body:not([data-view="settings"]) .wx-legacy-dock{left:calc((100vw - var(--drawer-w) - 8px)/2)!important}}
@media(max-width:599px){html body .wx-legacy-dock{transform:none}}
.v6-legacy-content{min-width:0;overflow-wrap:anywhere}
.v6-legacy-content table{display:block;max-width:100%;overflow-x:auto}
.v6-legacy-content pre,.v6-legacy-content code{white-space:pre-wrap;word-break:break-word}
/* frontend.css gives the office drawer a fixed 100vh-based height; let top/bottom define it instead */
html body.office-fullscreen .inspector{height:auto!important}
