/* OS Studios Cloud Production Suite — shared styles.

   Every page of the suite links this file before its own <style>:

     <link rel="stylesheet" href="/shared/cps.css">

   It holds what the pages have in common: the colour tokens, the base of the page, and
   the parts every tool uses (buttons, fields, the top bar, dialogs, toasts). A page's own
   <style> comes after it and holds only what is particular to that page; where a page
   needs a different value (a wider dialog, roomier fields), it sets just that property
   under the same selector.

   Change a colour here and it changes in every tool. Not covered: the signage boards
   (public/signage/, a TV display with its own palette file) and the tool switcher
   (shared/cps.js), which carries its own styles so it also works on pages without this
   file; it reads the tokens below where they exist. */

/* ---- tokens ---- */
:root{
  /* surfaces, from the page up */
  --bg:#141414; --panel:#1c1c1c; --panel2:#242424; --field:#101010;
  --line:#2e2e2e;
  /* text: body, secondary, and the quietest that still reads (4.7:1 on a panel) */
  --txt:#e8e8e8; --txt-dim:#9a9a9a; --txt-faint:#8e8e8e;
  --accent:#d0d0d0;
  /* state: good, attention, wrong */
  --green:#8fd19e; --orange:#e0b06a; --red:#e0a0a0;
  /* One colour per tool, for its identity only: its name in the tool menu, its card on
     the home page, the line under its top bar, its selected tabs. Never for state: good,
     attention and wrong keep the three colours above, whatever tool they appear in. */
  --tool-multiview:#fea61f; --tool-clipper:#f2584c; --tool-techbook:#47b179;
  --focus:rgba(232,232,232,.8);
  --radius:8px;
  --ease-out:cubic-bezier(.2,.8,.2,1);   /* critically damped: eases out with no overshoot */
}

/* A tool's page names itself on <html data-tool="…"> (the home page does the same on a
   tool's card); what is shared reads --tool, and a page without one stays neutral. */
[data-tool="multiview"]{--tool:var(--tool-multiview)}
[data-tool="clipper"]{--tool:var(--tool-clipper)}
[data-tool="techbook"]{--tool:var(--tool-techbook)}

/* ---- base ---- */
*{box-sizing:border-box}
body{margin:0; background:var(--bg); color:var(--txt);
  font:14px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}
a{color:#cfcfcf}
/* Keyboard focus only (a mouse click draws nothing); the outline follows the element's own radius */
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--focus); outline-offset:2px}

/* ---- buttons ----
   Plain, .primary (the one action a screen is for), .ghost (no fill until pressed),
   .danger (removes something), .sm (in table rows and tight bars). */
button{font:inherit; color:var(--txt); cursor:pointer; background:var(--panel2); border:1px solid var(--line);
  border-radius:6px; padding:6px 11px; transition:transform .1s ease-out}
button:hover{background:#2e2e2e}
button:disabled{opacity:.4; cursor:not-allowed}
button:disabled:hover{background:var(--panel2)}
button.primary{background:#e8e8e8; color:#141414; border-color:#e8e8e8; font-weight:600}
button.primary:hover{background:#fff}
button.primary:disabled:hover{background:#e8e8e8}
button.danger{border-color:#5a3a3a; color:#e0b0b0}
button.sm{padding:3px 8px; font-size:12px}
button.ghost{background:transparent}
button.ghost:disabled:hover{background:transparent}
/* Press feedback: instant, and a touch darker than hover */
button:active{transform:scale(.97); background:#1e1e1e}
button.primary:active{background:#d4d4d4}
button.ghost:active{background:rgba(0,0,0,.25)}
button:disabled:active{transform:none}

/* A row of buttons where one is chosen (.on); the script also sets aria-pressed */
.seg{display:inline-flex; border:1px solid var(--line); border-radius:6px; overflow:hidden}
.seg button{border:0; border-radius:0}
.seg button+button{border-left:1px solid var(--line)}
.seg button.on{background:#e8e8e8; color:#141414; font-weight:600}

/* The close button in the corner of a dialog or panel; the page places it */
.xclose{width:32px; height:32px; padding:0; border-radius:8px; background:transparent; color:var(--txt-dim);
  font-size:16px; line-height:1; display:flex; align-items:center; justify-content:center}
.xclose:hover{background:#2a2a2a; color:#fff}

/* ---- fields ---- */
input,select,textarea{font:inherit; color:var(--txt); background:var(--field); border:1px solid var(--line);
  border-radius:6px; padding:8px 10px}
label.fld{display:block; margin:12px 0 4px; color:var(--txt-dim); font-size:12px}
.err{color:var(--red); font-size:12.5px; min-height:16px}

/* ---- top bar ---- */
header{display:flex; align-items:center; gap:12px; padding:9px 14px; background:var(--panel);
  border-bottom:1px solid var(--line); box-shadow:inset 0 -2px 0 var(--tool, transparent)}   /* the tool's colour as a line under its bar */
.spacer{flex:1}
.sep{width:1px; height:24px; background:var(--line)}
.who{color:var(--txt-dim); font-size:12px}

/* ---- small text ---- */
.muted{color:var(--txt-faint); font-size:12.5px}
/* "or" between two ways to sign in */
.or{display:flex; align-items:center; gap:10px; color:var(--txt-faint); font-size:12px; margin:16px 0}
.or::before,.or::after{content:""; flex:1; height:1px; background:var(--line)}

/* ---- dialogs ----
   <div class="scrim"><div class="modal" role="dialog" …>…</div></div>
   .show puts the dialog in the layout, .in plays the enter (and its removal the exit).
   The page's script moves focus in and out and makes the page behind inert. */
.scrim{position:fixed; inset:0; background:rgba(0,0,0,.6); display:none; z-index:50; opacity:0; transition:opacity .16s ease-out}
.scrim.show{display:flex}
.scrim.in{opacity:1}
.modal{position:relative; background:var(--panel); border:1px solid var(--line); border-radius:12px; width:100%; padding:20px;
  opacity:0; transform:scale(.96); transition:opacity .16s ease-out,transform .16s ease-out}
.scrim.in .modal{opacity:1; transform:none}
.modal:focus{outline:none}   /* focused by script, never by Tab */
.modal .row{display:flex; gap:10px; justify-content:flex-end; margin-top:18px}

/* ---- toast: <div class="toast" id="toast" role="status" aria-live="polite"> ---- */
.toast{position:fixed; bottom:18px; left:50%; transform:translateX(-50%); background:#2a2a2a; border:1px solid var(--line);
  color:#eee; padding:9px 16px; border-radius:8px; z-index:60; opacity:0; transition:opacity .2s; pointer-events:none}
.toast.show{opacity:1}

@media (prefers-reduced-motion: reduce){
  .scrim{transition:opacity .12s}
  .modal{transform:none; transition:opacity .12s}
}
