/* CompuMan windows: minimize, maximize and close buttons on the .win boxes (used by index, terms and backup-demo).
   Goes with windows.js. Each page sets html.os-win or html.os-mac in a tiny script in its <head>.
   The boxes look like windows on the visitor's own computer: html.os-win (Windows, Android, others)
   or html.os-mac (Mac, iPhone, iPad). Closed and minimized boxes wait in a taskbar / Dock at the bottom. */
.win>h2 .wtitle{min-width:0}
.wctl{display:flex;align-items:center;gap:2px;margin-left:auto;flex:none}
.wctl button{display:flex;align-items:center;justify-content:center;padding:0;cursor:pointer;color:#000}
.wctl svg{display:block}
.wctl button:focus-visible{outline:2px dotted currentColor;outline-offset:2px}
.os-win .wctl button{width:22px;height:20px;background:var(--silver);border:1px solid;border-color:#fff #000 #000 #fff;box-shadow:inset -1px -1px 0 var(--mid),inset 1px 1px 0 #DFDFDF}
.os-win .wctl button:active{border-color:#000 #fff #fff #000;box-shadow:inset 1px 1px 0 var(--mid)}
.os-win .wctl .w-close{margin-left:3px}
.os-win .wctl svg{width:10px;height:10px}
.os-win .wctl button:focus-visible{outline-color:#fff}
.os-mac .win{padding:0;border:1px solid #8C8C8C;border-radius:10px;overflow:hidden;box-shadow:0 12px 28px rgba(0,0,0,.35)}
.os-mac .win>h2{background:linear-gradient(#EEEEEE,#D3D3D3);color:#262626;border-bottom:1px solid #A6A6A6;padding:7px 12px;
  font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;font-size:15px;font-weight:600;letter-spacing:0}
.os-mac .win>h2 .wtitle{flex:1;text-align:center}
.os-mac .win>h2::after{content:"";width:55px;flex:none} /* balances the three lights so the title sits in the middle */
.os-mac .wctl{order:-1;margin:0;gap:8px}
.os-mac .wctl button{width:13px;height:13px;border-radius:50%;border:.5px solid rgba(0,0,0,.22)}
.os-mac .wctl .w-close{order:1;background:#FF5F57}
.os-mac .wctl .w-min{order:2;background:#FEBC2E}
.os-mac .wctl .w-max{order:3;background:#28C840}
.os-mac .wctl svg{width:7px;height:7px;opacity:0}
.os-mac .wctl:hover svg,.os-mac .wctl button:focus-visible svg{opacity:.65}
.os-mac .pane{margin-top:0;border:0}
/* maximized: the box fills the screen */
.win.max{position:fixed;inset:12px;z-index:60;display:flex;flex-direction:column;margin:0}
.win.max{overflow:auto}
.win.max>.pane:only-of-type{flex:1;overflow:auto} /* one pane fills the window; the demo's several panes just scroll */
.win-backdrop{position:fixed;inset:0;z-index:59;background:rgba(0,0,0,.5)}
/* minimize / close: the box drops toward the bottom bar */
.win.going{transition:transform .22s ease-in,opacity .22s ease-in;transform:translateY(30vh) scale(.25);opacity:0}
@media (prefers-reduced-motion:reduce){.win.going{transition:none}}
/* the taskbar (Windows) or Dock (Mac) that holds closed and minimized boxes */
.tray{position:fixed;z-index:20;display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.tray[hidden]{display:none}
.tray .tlabel{font-size:14px;font-weight:700;padding:0 4px}
.tray button{max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}
.os-win .tray{left:0;right:0;bottom:0;padding:5px 8px;background:var(--silver);border-top:2px solid #fff;box-shadow:0 -1px 0 #DFDFDF}
.os-win .tray button{height:32px;padding:0 12px;background:var(--silver);color:#000;font:700 15px var(--serif);border:2px solid;border-color:#fff #000 #000 #fff}
.os-win .tray button:active{border-color:#000 #fff #fff #000}
.os-mac .tray{left:50%;transform:translateX(-50%);bottom:10px;max-width:calc(100% - 20px);justify-content:center;padding:7px 10px;
  background:rgba(235,235,242,.72);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border:1px solid rgba(255,255,255,.6);border-radius:18px;box-shadow:0 10px 28px rgba(0,0,0,.35)}
.os-mac .tray .tlabel{font:600 13px -apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;color:#333}
.os-mac .tray button{height:34px;padding:0 14px;border:0;border-radius:10px;background:rgba(255,255,255,.85);color:#1D1D1F;
  font:600 14px -apple-system,BlinkMacSystemFont,"Helvetica Neue",Arial,sans-serif;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.os-mac .tray button:hover{background:#fff}
.tray button:focus-visible{outline:3px dotted var(--navy);outline-offset:2px}
body.has-tray{padding-bottom:56px}
@media (max-width:640px){
  .tray button{max-width:200px}
  .os-win .tray .tlabel{display:none} /* room for both buttons on one row */
  .os-win .tray button{padding:0 9px;font-size:14px}
  /* pages with the red call bar along the bottom of phones: sit just above it */
  html.os-win body:has(.callbar) .tray{bottom:67px}
  html.os-mac body:has(.callbar) .tray{bottom:76px}
  body.has-tray:has(.callbar){padding-bottom:130px}
}
