/* Shared controls for two private workspaces. Each workspace supplies its own palette. */
:root {
  --cm-paper:#f7f7f1; --cm-surface:#fffefa; --cm-soft:#edf0e6; --cm-ink:#23372c;
  --cm-muted:#546457; --cm-line:#d3d8cd; --cm-accent:#214839; --cm-on:#fffefa;
  --cm-focus:#426d45; --cm-danger:#9b3430; --cm-veil:rgb(21 31 24 / .46);
  --cm-font:"DM Sans","Segoe UI",Arial,sans-serif; --cm-heading:Georgia,"Times New Roman",serif;
}
body[data-app-mode="board"] {
  --cm-paper:#191a20; --cm-surface:#24252e; --cm-soft:#30313d; --cm-ink:#f2f1f7;
  --cm-muted:#b3b1c2; --cm-line:#434453; --cm-accent:#bba1fa; --cm-on:#241839;
  --cm-focus:#cbb6ff; --cm-danger:#ffb3a7; --cm-veil:rgb(10 10 14 / .68);
  --cm-font:Inter,"Segoe UI",Arial,sans-serif; --cm-heading:var(--cm-font);
  color-scheme:dark;
}
html,body { margin:0; overflow-x:clip; }
body { background:var(--cm-paper); color:var(--cm-ink); }
[hidden] {display:none!important}
.cm-auth,.cm-dialog,.cm-toast,.cm-jobbar,.rt-wrap {font:400 15px/1.48 var(--cm-font);color:var(--cm-ink)}
.cm-auth *,.cm-dialog *,.rt-wrap * {box-sizing:border-box}
.cm-auth h1,.cm-auth h2,.cm-dialog h2,.cm-dialog h3,.cm-auth p,.cm-dialog p {margin:0;min-width:0;overflow-wrap:break-word}
.cm-auth :focus-visible,.cm-dialog :focus-visible,.cm-jobbar:focus-visible,.rt-wrap :focus-visible {outline:3px solid var(--cm-focus);outline-offset:3px}
.cm-auth {min-height:100vh;min-height:100dvh;display:grid;grid-template-columns:1fr 1fr;background:var(--cm-surface)}
.cm-identity {position:relative;display:flex;flex-direction:column;justify-content:center;gap:32px;overflow:hidden;padding:clamp(36px,6vw,100px);background:var(--cm-soft)}
.cm-brand {position:absolute;top:clamp(28px,6vw,84px);left:clamp(36px,6vw,100px);display:flex;align-items:center;gap:12px;font-size:28px;font-weight:600;letter-spacing:-1.4px}
.cm-brandmark {width:28px;height:28px;display:grid;gap:3px;grid-template-columns:1fr 1fr;transform:rotate(-5deg);color:var(--cm-accent)}
.cm-brandmark i {background:currentColor;border-radius:2px}.cm-brandmark i:last-child {transform:translate(2px,2px)}
.cm-identity h1 {z-index:1;max-width:9ch;font:500 clamp(46px,5.8vw,90px)/1.01 var(--cm-heading);letter-spacing:-.055em}
.cm-auth-drawing {height:76px;display:flex;align-items:center;margin:12px 0}
.cm-auth-drawing i {display:block;width:68px;height:68px;background:var(--cm-accent);border:1px solid var(--cm-soft);transform:skew(-14deg);margin-right:-16px}
.cm-auth-drawing i:nth-child(2){opacity:.64}.cm-auth-drawing i:nth-child(3){opacity:.32}
.cm-auth-side {display:flex;align-items:center;justify-content:center;padding:48px 28px}
.cm-login {width:min(100%,360px);display:grid;gap:20px}
.cm-login h2,.cm-head h2 {font:500 36px/1.18 var(--cm-heading);letter-spacing:-.035em}
.cm-login .cm-intro {margin:-8px 0 8px}
.cm-field {display:grid;gap:7px;font-weight:500;min-width:0}
.cm-input {min-width:0;width:100%;font:inherit;line-height:1.25;color:var(--cm-ink);background:var(--cm-surface);border:1px solid var(--cm-line);padding:11px 12px;border-radius:7px}
.cm-input::placeholder {color:var(--cm-muted);opacity:.88}
.cm-primary,.cm-button,.cm-jobbar,.rt-message button {display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:8px 16px;border:1px solid var(--cm-line);border-radius:7px;color:var(--cm-ink);background:var(--cm-surface);font:500 14px/1.3 var(--cm-font);cursor:pointer}
.cm-primary,.cm-jobbar {background:var(--cm-accent);color:var(--cm-on);border-color:var(--cm-accent)}
.cm-button:hover,.rt-message button:hover {background:var(--cm-soft)}.cm-primary:hover,.cm-jobbar:hover {filter:brightness(.94)}
.cm-primary:disabled,.cm-button:disabled {opacity:.55;cursor:wait}
.cm-mutedlink,.cm-link {border:0;padding:5px 0;background:none;font:500 14px/1.4 var(--cm-font);cursor:pointer;text-align:left;color:var(--cm-accent)}
.cm-mutedlink {color:var(--cm-muted)}.cm-link:hover,.cm-mutedlink:hover {text-decoration:underline}
.cm-dialog {margin:auto;padding:0;width:min(560px,calc(100% - 32px));max-height:calc(100dvh - 48px);overflow:auto;overscroll-behavior:contain;border:1px solid var(--cm-line);border-radius:14px;background:var(--cm-surface);box-shadow:0 12px 48px var(--cm-veil)}
.cm-dialog::backdrop {background:var(--cm-veil)}
.cm-head {position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:16px;background:var(--cm-surface);border-bottom:1px solid var(--cm-line);padding:18px 24px}
.cm-head h2 {font-size:28px}
.cm-close {width:36px;height:36px;border:0;border-radius:7px;background:transparent;cursor:pointer;color:var(--cm-muted);font:400 28px/1 var(--cm-font)}
.cm-close:hover {background:var(--cm-soft);color:var(--cm-ink)}
.cm-body {display:grid;gap:20px;padding:24px}
.cm-body h3 {font:600 16px/1.35 var(--cm-font)}
.cm-intro,.cm-meta,.cm-empty,.cm-toolinfo p {color:var(--cm-muted)}
.cm-meta,.cm-toolinfo p {font-size:13px}
.cm-error {color:var(--cm-danger);font-size:14px}
.cm-form {display:grid;gap:16px}.cm-form > .cm-primary,.cm-body > .cm-button {justify-self:start}
.cm-filters,.cm-choices,.cm-inline,.cm-person,.cm-keyhead,.cm-rowactions {display:flex;align-items:center;gap:12px}
.cm-filters select {max-width:42%}.cm-choices > * {flex:1}
.cm-prompt {min-height:112px;resize:vertical}
.cm-tools {display:grid}.cm-toolrow {display:grid;gap:12px;padding:16px 0;border-top:1px solid var(--cm-line)}
.cm-toolrow:first-child {padding-top:0;border:0}.cm-toolrow:last-child {padding-bottom:0}
.cm-toolinfo {display:grid;grid-template-columns:1fr auto;gap:3px 12px;align-items:center}
.cm-toolinfo p {grid-column:1/-1}.cm-rowactions {flex-wrap:wrap;gap:8px 16px}
.cm-rowactions .cm-button {min-height:34px;padding:6px 12px}
.cm-keyrow {display:grid;gap:8px;border-top:1px solid var(--cm-line);padding-top:16px}.cm-keyhead,.cm-person {justify-content:space-between}
.cm-keyrow>.cm-mutedlink {justify-self:start}.cm-inline .cm-input {flex:1}
.cm-sharelink:not(:empty) {display:grid;align-items:start;gap:12px;background:var(--cm-soft);padding:16px;border-radius:8px}
.cm-sharelink button {justify-self:start}.cm-users {display:grid;gap:8px}.cm-users h3:not(:first-child) {margin-top:12px}
.cm-person {min-height:36px;border-bottom:1px solid var(--cm-line);overflow-wrap:anywhere}
.cm-steps {margin:0;padding-left:24px;color:var(--cm-muted)}.cm-steps li {padding:4px}.cm-current {color:var(--cm-accent);font-weight:600}
.cm-toast,.cm-jobbar {position:fixed;z-index:101;bottom:max(20px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);max-width:calc(100% - 32px)}
.cm-toast {padding:10px 16px;border:1px solid var(--cm-line);border-radius:8px;background:var(--cm-surface);box-shadow:0 3px 16px var(--cm-veil);text-align:center;pointer-events:none}
.cm-jobbar {bottom:76px;white-space:nowrap}
.rt-wrap {position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:0;overflow:hidden}
.rt-wrap .rt-frame {border:0;display:block;flex:1 1 0;width:100%;min-height:0;height:100%;background:transparent}
.rt-message {position:absolute;inset:0;display:flex;justify-content:center;align-items:center;align-content:center;gap:8px;flex-wrap:wrap;background:var(--cm-surface);color:var(--cm-ink);padding:16px;text-align:center;font-size:13px}
.rt-message span {max-width:100%}.rt-message button {min-height:30px;padding:4px 10px;font-size:12px}
.rt-credit {flex:0 0 auto;padding:2px 8px;color:var(--cm-muted);background:var(--cm-surface);font-size:10px;text-align:right}.rt-credit a {color:inherit}
@media(max-width:680px){
  .cm-auth {grid-template-columns:1fr;grid-template-rows:auto 1fr}
  .cm-identity {min-height:172px;padding:24px;gap:24px}.cm-brand {position:static;font-size:23px}
  .cm-identity h1 {font-size:40px;max-width:16ch}.cm-auth-drawing {display:none}
  .cm-auth-side {align-items:flex-start;padding:36px 24px}.cm-login {gap:16px}
  .cm-body,.cm-head {padding:16px}.cm-choices {align-items:stretch;flex-direction:column}
}
@media(prefers-reduced-motion:reduce) { .cm-dialog,.cm-toast {scroll-behavior:auto} }
