
:root{
  --shell-bg:#d8e5f8;
  --shell-bg-2:#b9cff0;
  --window-edge:#6b89b6;
  --top-1:#4f7fc7;
  --top-2:#2d5caa;
  --ribbon-1:#fdfefe;
  --ribbon-2:#dce9fb;
  --text:#183a68;
  --muted:#5d76a0;
  --paper:#ffffff;
  --panel:#dfeafb;
  --line:#b8cae4;
  --line-dark:#8ca7cf;
  --button-1:#ffffff;
  --button-2:#ddeafb;
  --accent:#f8a111;
  --shadow:0 15px 40px rgba(0,0,0,.20);
}

body.dark{
  --shell-bg:#1b2940;
  --shell-bg-2:#0f1827;
  --window-edge:#324f7e;
  --top-1:#3d5d90;
  --top-2:#20375b;
  --ribbon-1:#2c4267;
  --ribbon-2:#20314f;
  --text:#e8f1ff;
  --muted:#b6c7e6;
  --paper:#ffffff;
  --panel:#162338;
  --line:#3a5277;
  --line-dark:#466287;
  --button-1:#fdfefe;
  --button-2:#d9e8fb;
  --accent:#ffb13b;
}

*{box-sizing:border-box}
body{
  margin:0;
  background:linear-gradient(var(--shell-bg), var(--shell-bg-2));
  font-family:Segoe UI, Tahoma, Arial, sans-serif;
  color:var(--text);
  min-height:100vh;
  padding:18px;
}
button,input{
  font:inherit;
}
.window-shell{
  max-width:1450px;
  margin:0 auto;
  border:1px solid var(--window-edge);
  border-radius:12px;
  overflow:hidden;
  box-shadow:var(--shadow);
  background:var(--panel);
}
.topbar{
  display:flex;
  gap:14px;
  align-items:center;
  padding:10px 14px;
  background:linear-gradient(var(--top-1),var(--top-2));
  color:#fff;
}
.app-orb{
  width:38px;
  height:38px;
  border-radius:50%;
  display:grid;
  place-items:center;
  font-weight:800;
  background:radial-gradient(circle at 30% 30%, #ffd474, #f18d00 70%);
  box-shadow:inset 0 2px 4px rgba(255,255,255,.45), 0 3px 8px rgba(0,0,0,.25);
}
.title-wrap{display:flex; flex-direction:column; gap:2px}
.suite-title{font-weight:700; letter-spacing:.2px}
.suite-subtitle{font-size:12px; opacity:.9}
.topbar-actions{margin-left:auto; display:flex; gap:8px}
.quick-access{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:8px 12px;
  background:linear-gradient(#fdfefe,#edf4ff);
  border-bottom:1px solid var(--line);
}
.left-qa,.right-qa{display:flex; gap:8px; align-items:center}
.status-pill{
  display:inline-flex;
  align-items:center;
  min-height:32px;
  padding:0 12px;
  border:1px solid var(--line-dark);
  border-radius:999px;
  background:linear-gradient(#fff,#e9f2ff);
  color:#244d84;
}
.mini-btn, .quick-access button, .ribbon button, .sheet-tab, .workspace-tab, .sheet-controls button{
  border:1px solid var(--line-dark);
  border-radius:4px;
  background:linear-gradient(var(--button-1),var(--button-2));
  color:#244d84;
  min-height:26px;
  padding:3px 7px;
  font-size:13px;
  line-height:1.1;
  cursor:pointer;
}
.mini-btn.accent{background:linear-gradient(#ffd677,#ffb52f)}
.tab-strip{
  display:flex;
  gap:6px;
  padding:10px 12px 0;
  background:linear-gradient(#edf4ff,#d6e6fb);
}
.workspace-tab{
  border-bottom:none;
  border-radius:7px 7px 0 0;
  padding:7px 12px;
}
.workspace-tab.active{
  background:linear-gradient(#fff,#f9fbff);
  font-weight:700;
}
.ribbon-shell{
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  background:linear-gradient(var(--ribbon-1),var(--ribbon-2));
}
.ribbon{
  display:none;
  gap:8px;
  flex-wrap:wrap;
  padding:8px;
}
.ribbon.active{display:flex}
.ribbon-group{
  min-width:180px;
  padding:8px;
  border:1px solid var(--line);
  border-radius:7px;
  background:linear-gradient(#fff,#edf4ff);
}
.ribbon-group.wide{min-width:380px}
.ribbon-buttons{
  display:flex;
  gap:4px;
  flex-wrap:wrap;
  min-height:26px;
}
.group-label{
  margin-top:5px;
  text-align:center;
  font-size:11px;
  color:#59739e;
}
.formula-bar-wrap, .slide-meta-bar{
  display:flex;
  gap:8px;
  align-items:center;
}
.formula-bar-wrap input, .slide-meta-bar input{
  flex:1;
  min-width:120px;
  padding:8px 10px;
  border:1px solid var(--line-dark);
  border-radius:4px;
}
.formula-label{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border:1px solid var(--line-dark);
  border-radius:4px;
  background:linear-gradient(#fff,#edf4ff);
  font-weight:700;
}
.about-ribbon-text{line-height:1.4}
.workspace{
  min-height:76vh;
  padding:18px;
  background:var(--panel);
}
.panel{display:none}
.panel.active{display:block}
.writer-surface{
  padding:24px 0;
}
.page{
  width:min(100%, 900px);
  margin:0 auto;
  min-height:980px;
  padding:64px 76px;
  background:var(--paper);
  color:#222;
  box-shadow:0 8px 28px rgba(0,0,0,.16);
  outline:none;
}
.sheet-topbar{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.sheet-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.sheet-tab.active{
  background:linear-gradient(#fff,#fff6e5);
  border-color:#d19a39;
  color:#8b5600;
  font-weight:700;
}
.sheet-controls{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.sheet-controls input{
  width:88px;
  padding:7px 8px;
  border:1px solid var(--line-dark);
  border-radius:4px;
}
.sheet-surface{
  background:var(--paper);
  box-shadow:0 8px 28px rgba(0,0,0,.16);
  padding:12px;
  overflow:auto;
}
table{
  border-collapse:collapse;
  width:max-content;
  min-width:100%;
}
th,td{
  border:1px solid #c8d4e8;
  min-width:108px;
  height:34px;
  padding:6px 8px;
  color:#222;
  background:#fff;
}
th{
  position:sticky;
  top:0;
  background:linear-gradient(#f7fbff,#dfeafb);
  z-index:1;
}
td.selected{
  outline:2px solid #4f84d6;
  outline-offset:-2px;
}
.slides-layout{
  display:grid;
  grid-template-columns:240px 1fr;
  gap:18px;
}
.slide-sidebar{
  background:#fff;
  box-shadow:0 8px 28px rgba(0,0,0,.16);
  min-height:640px;
  padding:12px;
}
.slide-item{
  border:1px solid #bfd0ea;
  border-radius:7px;
  padding:12px;
  margin-bottom:12px;
  background:linear-gradient(#fff,#eef5ff);
  cursor:pointer;
  color:#223;
}
.slide-item.active{
  border-color:#4f84d6;
  box-shadow:0 0 0 2px rgba(79,132,214,.18);
}
.slide-stage-wrap{
  display:grid;
  place-items:center;
}
.slide-stage{
  width:min(100%, 1000px);
  aspect-ratio:16/9;
  padding:54px 64px;
  background:#fff;
  color:#162844;
  box-shadow:0 12px 32px rgba(0,0,0,.16);
  outline:none;
  font-size:28px;
}
.slide-theme-classic{background:linear-gradient(#ffffff,#eff6ff)}
.slide-theme-dark{background:linear-gradient(#1a2b46,#0f1a2e); color:#fff}
.slide-theme-warm{background:linear-gradient(#fff9f0,#ffe0ba); color:#5a3513}
.about-card{
  width:min(100%, 900px);
  margin:0 auto;
  padding:34px;
  background:#fff;
  color:#222;
  box-shadow:0 8px 28px rgba(0,0,0,.16);
}
@media print{
  body{background:#fff; padding:0}
  .topbar,.quick-access,.tab-strip,.ribbon-shell,.sheet-topbar,.slide-sidebar{display:none !important}
  .window-shell,.workspace,.panel,.panel.active{border:none; box-shadow:none; background:#fff; padding:0; margin:0; display:block}
  .page,.sheet-surface,.slide-stage,.about-card{box-shadow:none; margin:0 auto}
}


/* ===== v5 additions ===== */
.ribbon select{
  border:1px solid var(--line-dark);
  border-radius:4px;
  background:linear-gradient(var(--button-1),var(--button-2));
  color:#244d84;
  min-height:26px;
  padding:2px 6px;
  font-size:13px;
  line-height:1.1;
  cursor:pointer;
}
.color-wrap{
  display:inline-flex;
  align-items:center;
  gap:4px;
  border:1px solid var(--line-dark);
  border-radius:4px;
  background:linear-gradient(var(--button-1),var(--button-2));
  color:#244d84;
  min-height:26px;
  padding:2px 6px;
  font-size:13px;
  line-height:1.1;
  cursor:pointer;
  font-weight:700;
}
.color-wrap input[type=color]{
  width:22px;
  height:16px;
  border:none;
  padding:0;
  background:none;
  cursor:pointer;
}
.find-bar{
  display:flex;
  gap:8px;
  align-items:center;
  padding:8px 14px;
  background:linear-gradient(#fff8e6,#ffedc2);
  border-bottom:1px solid var(--line);
}
.find-bar input{
  padding:7px 10px;
  border:1px solid var(--line-dark);
  border-radius:4px;
  min-width:180px;
}
.find-bar button{
  border:1px solid var(--line-dark);
  border-radius:4px;
  background:linear-gradient(#fff,#f4e5c2);
  padding:7px 11px;
  cursor:pointer;
  color:#6b4c00;
}
.find-close{margin-left:auto}
#findStatus{font-size:12px;color:#8a6d1d}
.doc-table{
  border-collapse:collapse;
  width:100%;
  margin:12px 0;
}
.doc-table td{
  border:1px solid #b9c7dd;
  padding:8px 10px;
  min-width:60px;
}
.slide-item-notes{
  margin-top:8px;
  font-size:12px;
  color:#5d7091;
}
.slide-theme-ocean{background:linear-gradient(#e8f7ff,#b3dcf5); color:#0d3a5c}
.slide-theme-mint{background:linear-gradient(#f0fff6,#c2f0d8); color:#134d31}
.present-overlay{
  position:fixed;
  inset:0;
  background:#000;
  z-index:1000;
  display:grid;
  grid-template-rows:1fr auto;
  cursor:pointer;
}
.present-stage{
  width:100%;
  height:100%;
  padding:8vh 10vw;
  box-sizing:border-box;
  font-size:4vh;
  overflow:auto;
}
.present-hud{
  position:fixed;
  bottom:14px;
  right:18px;
  color:#aaa;
  font-family:monospace;
  font-size:14px;
  background:rgba(0,0,0,.45);
  padding:4px 10px;
  border-radius:6px;
}
.about-card .fine{color:#8aa0c0;font-size:12px;margin-top:18px}


.present-overlay[hidden]{display:none !important}
.find-bar[hidden]{display:none !important}

@media (max-width: 760px){
  body{
    padding:0;
    font-size:14px;
  }
  .window-shell{
    width:100%;
    min-height:100vh;
    border:0;
    border-radius:0;
    box-shadow:none;
  }
  .topbar{
    gap:8px;
    padding:8px 10px;
  }
  .app-orb{
    width:28px;
    height:28px;
    font-size:16px;
  }
  .suite-title{
    font-size:16px;
  }
  .suite-subtitle{
    display:none;
  }
  .topbar-actions{
    gap:5px;
  }
  .quick-access{
    align-items:flex-start;
    gap:3px;
    padding:3px 4px;
  }
  .left-qa,.right-qa{
    gap:3px;
    flex-wrap:wrap;
  }
  .status-pill{
    min-height:18px;
    padding:0 5px;
    font-size:10px;
  }
  .mini-btn,.quick-access button,.ribbon button,.sheet-tab,.workspace-tab,.sheet-controls button{
    min-height:18px;
    padding:1px 4px;
    font-size:10px;
    line-height:1.1;
    border-radius:3px;
  }
  .mini-btn.accent{
    padding-inline:5px;
  }
  .tab-strip{
    gap:3px;
    padding:4px 4px 0;
    overflow-x:auto;
    flex-wrap:nowrap;
  }
  .workspace-tab{
    flex:0 0 auto;
    padding:4px 6px;
  }
  .ribbon{
    gap:2px;
    padding:2px 3px;
  }
  .ribbon-group,.ribbon-group.wide{
    min-width:0;
    width:100%;
    max-width:100%;
    padding:2px;
    border-radius:4px;
  }
  .ribbon-group .group-label{
    order:-1;
    margin:0;
    min-height:18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:1px 6px;
    border:1px solid var(--line-dark);
    border-radius:3px;
    background:linear-gradient(var(--button-1),var(--button-2));
    color:#244d84;
    font-size:10px;
    font-weight:700;
    cursor:pointer;
  }
  .ribbon-group .group-label::after{
    content:"▾";
    font-size:9px;
    opacity:.75;
  }
  .ribbon-group.open .group-label::after{
    content:"▴";
  }
  .ribbon-group:not(.open) > :not(.group-label){
    display:none;
  }
  .ribbon-group.open{
    display:flex;
    flex-direction:column;
    gap:2px;
  }
  .ribbon-buttons{
    gap:2px;
    min-height:18px;
  }
  .ribbon select{
    max-width:92px;
    min-height:18px;
    padding:0 3px;
    font-size:10px;
  }
  .color-wrap{
    min-height:18px;
    padding:0 3px;
    font-size:10px;
  }
  .color-wrap input[type=color]{
    width:14px;
    height:12px;
  }
  .formula-bar-wrap,.slide-meta-bar{
    gap:5px;
  }
  .formula-bar-wrap input,.slide-meta-bar input{
    min-width:110px;
    padding:5px 7px;
    font-size:13px;
  }
  .formula-label{
    width:28px;
    height:28px;
  }
  .workspace{
    min-height:0;
    padding:8px;
  }
  .writer-surface{
    padding:8px 0;
  }
  .page{
    min-height:680px;
    padding:28px 24px;
    font-size:15px;
  }
  .page h1{
    font-size:26px;
  }
  .page h2{
    font-size:21px;
  }
  .sheet-topbar{
    gap:6px;
    margin-bottom:8px;
  }
  .sheet-tabs,.sheet-controls{
    gap:5px;
  }
  .sheet-controls input{
    width:64px;
    padding:4px 6px;
    font-size:13px;
  }
  .sheet-surface{
    padding:6px;
  }
  th,td{
    min-width:82px;
    height:28px;
    padding:4px 6px;
    font-size:13px;
  }
  .slides-layout{
    display:block;
  }
  .slide-sidebar{
    display:flex;
    gap:6px;
    min-height:0;
    overflow-x:auto;
    padding:6px;
    margin-bottom:8px;
  }
  .slide-item{
    flex:0 0 136px;
    margin:0;
    padding:7px;
    font-size:12px;
  }
  .slide-stage{
    padding:24px 28px;
    font-size:16px;
  }
  .about-card{
    padding:18px;
  }
  .find-bar{
    gap:5px;
    padding:6px;
    flex-wrap:wrap;
  }
  .find-bar input{
    min-width:120px;
    flex:1;
    padding:5px 7px;
    font-size:13px;
  }
  .find-bar button{
    padding:4px 7px;
    font-size:13px;
  }
}


/* Compact ribbon: content-sized category tabs, one useful tool row. */
.ribbon.active { display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:8px; }
.ribbon-group,.ribbon-group.wide,.ribbon-group.open { display:contents; }
.ribbon-group .group-label {
  order:0; flex:0 0 auto; width:auto; min-height:30px; margin:0;
  display:inline-flex; align-items:center; gap:6px; padding:6px 10px;
  border:1px solid transparent; border-radius:6px; background:transparent;
  color:#35547b; font-size:12px; font-weight:600; cursor:pointer;
}
.ribbon-group .group-label::after { content:'▾'; font-size:10px; }
.ribbon-group.open .group-label { background:#fff; border-color:#a8bddb; color:#174989; }
.ribbon-group.open .group-label::after { content:'▴'; }
.ribbon-group:not(.open)>:not(.group-label) { display:none; }
.ribbon-group.open>:not(.group-label) { order:1; flex-basis:100%; margin-top:3px; }
.ribbon-buttons { align-items:center; gap:5px; }
.mini-btn,.quick-access button,.ribbon button,.sheet-tab,.workspace-tab,.sheet-controls button {
  min-height:30px; width:auto; flex:0 0 auto; padding:5px 9px; font-size:12px;
  line-height:1.2; border-radius:5px; white-space:nowrap;
}
.ribbon select,.color-wrap { min-height:30px; font-size:12px; padding:4px 6px; }
.ribbon select { max-width:150px; }
.color-wrap input[type=color] { width:22px; height:18px; }
.topbar { flex-wrap:wrap; }
.topbar-actions { flex-wrap:wrap; gap:6px; }
.quick-access { flex-wrap:wrap; gap:8px; padding:8px; }
.left-qa,.right-qa { flex-wrap:wrap; gap:5px; }
.status-pill { min-height:24px; padding:3px 7px; font-size:11px; }
#statusText { border:0; border-radius:0; background:transparent; max-width:100%; }
button:hover,.group-label:hover { filter:brightness(.96); }
button:focus-visible,.group-label:focus-visible { outline:2px solid #3979cf; outline-offset:2px; }
body.dark .ribbon-group .group-label { color:#dce9ff; }
body.dark .ribbon-group.open .group-label { color:#174989; }
@media(max-width:760px){
  .ribbon.active { gap:3px; padding:6px; }
  .ribbon-group .group-label { padding:5px 8px; }
  .suite-title { font-size:15px; }
  .topbar-actions { margin-left:auto; }
}
@media print { .panel:not(.active) { display:none !important; } }
/* GXT Office — quiet chrome, compact tools, generous writing space. */
:root{--shell-bg:#f3f4f7;--shell-bg-2:#f3f4f7;--window-edge:#e1e5ed;--panel:#f1f3f7;--line:#e0e4ec;--line-dark:#d5dbe5;--text:#263247;--muted:#738097;--button-1:#fff;--button-2:#fff;--shadow:0 12px 42px #24314a0a}
body{background:var(--shell-bg);padding:20px;font-family:Inter,"Segoe UI",sans-serif}
.window-shell{border-radius:14px;max-width:1480px}
.topbar{background:#fff;color:#263247;padding:16px 20px;gap:10px;border-bottom:1px solid var(--line)}
.app-orb{background:#4f46e5;box-shadow:none;border-radius:10px;width:34px;height:34px;font-size:18px;color:#fff}
.suite-title{letter-spacing:-.4px;font-size:17px}
.suite-subtitle{color:#7a8598;font-size:11px;letter-spacing:.2px;margin-top:2px}
.mini-btn,.quick-access button,.ribbon button,.sheet-tab,.workspace-tab,.sheet-controls button{background:#fff;color:#45516a;border-color:#dce1e9;box-shadow:0 1px 2px #17243d04}
#loadLocalBtn{background:#4f46e5;border-color:#4f46e5;color:#fff;padding-inline:15px}
.quick-access{background:#fff;padding:9px 20px;gap:7px}
.quick-access button{border-color:transparent;background:transparent;box-shadow:none}
.quick-access button:hover{background:#f0f2f7}
.right-qa{margin-left:auto}
.status-pill{background:#f5f6fa;border:0;color:#748098;font-size:10px;min-height:22px}
#statusText{color:#59657a}
.tab-strip{background:#fff;padding:0 20px;gap:20px;border-bottom:1px solid var(--line)}
.workspace-tab{border:0;border-bottom:2px solid transparent;border-radius:0;background:none;padding:12px 2px;min-height:40px;box-shadow:none;color:#7b8596;font-size:13px}
.workspace-tab.active{background:none;border-bottom-color:#4f46e5;color:#4f46e5;font-weight:600}
.ribbon-shell{background:#fafbfe;border-top:0}
.ribbon.active{padding:10px 18px;gap:5px}
.ribbon-group .group-label{color:#7b8495;font-weight:500;border-radius:5px;padding:5px 10px;min-height:28px}
.ribbon-group.open .group-label{background:#ecebff;color:#4f46e5;border-color:transparent}
.ribbon-group .group-label::after{font-size:9px;opacity:.6}
.ribbon-group.open>:not(.group-label){padding-top:7px;padding-bottom:2px;margin-top:0}
.ribbon-buttons{gap:6px}
.ribbon button,.ribbon select,.color-wrap{background:#fff;border-color:#dce1e9;color:#45516a;border-radius:5px;min-height:30px}
.ribbon select{font-size:12px}
.workspace{padding:30px;background:var(--panel)}
.writer-surface{padding:0}
.page{box-shadow:0 3px 18px #25365809;border:1px solid #e5e8ee;border-radius:2px;min-height:980px;padding:64px 72px;line-height:1.65;font-family:"Segoe UI",sans-serif}
.page h1{font-size:32px;font-weight:650;letter-spacing:-1px;line-height:1.2;margin-bottom:22px;color:#1f293b}
.page h2{letter-spacing:-.5px;color:#344259}
.page p{color:#424e62}
.sheet-surface,.slide-sidebar,.slide-stage,.about-card{box-shadow:0 3px 18px #25365809;border:1px solid #e5e8ee;border-radius:8px}
th{background:#f4f5fa;color:#65738b;font-size:12px;font-weight:500}
td,th{border-color:#e4e8f0}
td.selected{outline-color:#7169e9}
.sheet-tab.active{background:#ecebff;color:#4f46e5;border-color:#d3cff8}
.slide-item{background:#fafbfe;border-color:#e2e6ef;border-radius:6px}
.slide-item.active{border-color:#8b83f3;box-shadow:0 0 0 2px #7066ed12}
.find-bar{background:#f7f7fd}
.find-bar button{background:#fff;border-color:#dce1e9;color:#45516a}
button:focus-visible,.group-label:focus-visible{outline-color:#7367ea}
body.dark{--shell-bg:#161b27;--panel:#1b2130;--line:#303849;--line-dark:#3b4559;--window-edge:#303849;--text:#e6eaf4}
body.dark .topbar,body.dark .quick-access,body.dark .tab-strip{background:#202736;color:#e6eaf4}
body.dark .ribbon-shell{background:#252d3d}
body.dark .ribbon-group .group-label{color:#b9c3d7}
body.dark .ribbon-group.open .group-label{color:#dcd8ff;background:#413960}
body.dark .quick-access button,body.dark .workspace-tab{color:#b9c3d7}
body.dark .workspace-tab.active{color:#b2aaff;border-bottom-color:#a69cf6}
body.dark .status-pill{background:#30394c;color:#c2cadd}
body.dark #statusText{color:#c2cadd}
@media(max-width:760px){
  body{padding:0}.window-shell{border-radius:0}
  .topbar{padding:13px 14px}.suite-title{font-size:16px}.suite-subtitle{display:block;font-size:10px}
  .quick-access{padding:7px 10px}.left-qa{gap:1px}.right-qa{gap:4px}
  .tab-strip{padding:0 14px;gap:22px}.workspace-tab{padding:10px 2px}
  .ribbon.active{padding:8px 10px;gap:3px}.ribbon-group .group-label{padding:5px 8px;font-size:11px}
  .workspace{padding:18px 12px}.page{padding:34px 28px;min-height:760px;font-size:15px}.page h1{font-size:28px}
}
@media(max-width:400px){.suite-subtitle{display:none}.topbar{gap:7px}.app-orb{width:28px;height:28px}.topbar-actions{gap:3px}.mini-btn{padding:5px 7px}.right-qa{margin-left:0}.workspace{padding:12px 8px}.page{padding:26px 20px}}
@media print{body{padding:0}.page{border:0;padding:0}.workspace{padding:0}.panel:not(.active){display:none!important}}

body.dark .quick-access button:hover{background:#30394c;color:#e6eaf4}
body.dark .ribbon button,body.dark .ribbon select,body.dark .color-wrap,body.dark .mini-btn{background:#30394c;color:#e6eaf4;border-color:#46516a}
body.dark #loadLocalBtn{background:#675ae8;border-color:#675ae8}
