/* Staffly Link workspaces: pieces on top of link.css. */
.ws-search { display: flex; gap: 8px; margin: 0 0 16px; }
.ws-search input { flex: 1; min-width: 0; }
.ws-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 0 0 20px; }
.ws-tile { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: var(--surface); display: grid; gap: 4px; color: var(--ink); text-align: left; }
a.ws-tile:hover { background: var(--hover); text-decoration: none; }
.ws-tile b { font-size: 17px; font-weight: 600; }
.ws-tile small, .ws-muted { color: var(--muted); font-size: 14px; }
.ws-big { font-size: 28px; font-weight: 500; line-height: 1; }
.ws-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); margin-bottom: 8px; }
.ws-row > div { min-width: 0; }
.ws-row b { overflow-wrap: anywhere; }
.ws-row small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.ws-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ws-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.ws-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 14px; height: auto; font-size: 15px; color: var(--muted); cursor: pointer; }
.ws-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.ws-form { display: grid; gap: 10px; max-width: 560px; }
.ws-form label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.ws-form .inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ws-form .inline label { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; color: var(--ink); }
.ws-perms { display: flex; gap: 6px; flex-wrap: wrap; }
.ws-perm { font-size: 12.5px; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--dim-fg); }
.ws-perm.on { background: var(--accent-soft); color: var(--accent); }
.ws-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; counter-reset: s; }
.ws-steps li { counter-increment: s; display: flex; gap: 10px; align-items: baseline; }
.ws-steps li::before { content: counter(s); width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.ws-log { font-size: 14px; }
.ws-log td, .ws-log th { padding: 8px 10px; }
.ws-log code { background: var(--hover); padding: 1px 6px; border-radius: 4px; font-size: 13px; overflow-wrap: anywhere; }
.ws-pri-urgent { color: var(--bad); font-weight: 700; } .ws-pri-high { color: var(--warn); font-weight: 600; }
.ws-over { color: var(--bad); font-weight: 600; }
.ws-empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: 8px; }
.ws-source { font-size: 12.5px; color: var(--muted); }
.ws-source b { color: var(--accent); font-weight: 600; }
.ws-modal-bg { position: fixed; inset: 0; background: rgba(9, 30, 66, 0.54); display: grid; place-items: center; z-index: 80; padding: 16px; }
.ws-modal { background: var(--surface); color: var(--ink); border-radius: 8px; padding: 22px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; }
.ws-modal h3 { margin: 0 0 12px; font-size: 19px; }
.ws-modal .ws-acts { margin-top: 14px; justify-content: flex-end; }
.ws-checklist { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.ws-hist { color: var(--muted); font-size: 13.5px; display: grid; gap: 4px; margin-top: 8px; }
@media (max-width: 760px) { .ws-grid { grid-template-columns: 1fr; } }

.ws-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 4px; }
.ws-bar > i { display: block; height: 100%; background: var(--accent, #5865f2); border-radius: 4px; }
.ws-bar > i.ok { background: var(--ok, #2e9e5b); }
.ws-req { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 13px; margin-top: 8px; min-width: 220px; }
.ws-req .ws-bar { grid-column: 1 / -1; }
.ws-reqform { display: grid; grid-template-columns: 1.4fr 1.2fr 0.9fr 0.8fr auto; gap: 6px; margin-bottom: 8px; align-items: center; }
.ws-reqform small { grid-column: 1 / -1; }
.ws-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ws-stats .lk-card { margin: 0; } .ws-stats b { display: block; font-size: 26px; }
.ws-spark { width: 100%; max-width: 340px; height: auto; color: var(--accent, #5865f2); }
.ws-card-link { display: block; color: inherit; text-decoration: none; }
@media (max-width: 600px) { .ws-reqform { grid-template-columns: 1fr 1fr; } }

.ws-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.ws-tabs a { padding: 8px 12px; text-decoration: none; color: inherit; border-bottom: 2px solid transparent; }
.ws-tabs a[aria-selected="true"] { border-bottom-color: var(--accent, #5865f2); font-weight: 600; }
.ws-video { width: 100%; max-width: 420px; max-height: 60vh; border-radius: 8px; background: #000; }
.ws-step { padding: 2px 8px; border-radius: 10px; background: var(--line); font-size: 12px; } .ws-step.on { background: var(--accent, #5865f2); color: #fff; }
.ws-row > div:last-child:not(:first-child) { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.ws-ed { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); height: min(60vh, 520px); font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ws-ed-gut { padding: 8px 8px 8px 10px; text-align: right; color: var(--muted, #8a8f98); user-select: none; overflow: hidden; background: var(--bg, rgba(127,127,127,.06)); border-right: 1px solid var(--line); }
.ws-ed-gut span { display: block; } .ws-ed-gut .err { color: #d33; font-weight: 700; }
.ws-ed-box { position: relative; flex: 1; min-width: 0; }
.ws-ed-hl, .ws-ed-ta { position: absolute; inset: 0; margin: 0; padding: 8px 10px; border: 0; font: inherit; line-height: inherit; white-space: pre; tab-size: 2; overflow: auto; }
.ws-ed-hl { pointer-events: none; color: var(--ink, inherit); }
.ws-ed-ta { background: transparent; color: transparent; caret-color: var(--ink, #000); resize: none; outline: none; }
.ws-ed-hl .ln { display: block; } .ws-ed-hl .ln.err { background: rgba(220, 50, 50, .18); }
.ws-ed-hl i { font-style: normal; } .ws-ed-hl .c { color: #6a737d; } .ws-ed-hl .s { color: #0a7d4b; } .ws-ed-hl .k { color: #7b3fd0; } .ws-ed-hl .n { color: #b35a00; } .ws-ed-hl .a { color: #0b66d0; font-weight: 600; }
:root[data-theme="dark"] .ws-ed-hl .c { color: #8b949e; } :root[data-theme="dark"] .ws-ed-hl .s { color: #7ee2a8; } :root[data-theme="dark"] .ws-ed-hl .k { color: #c8a6ff; } :root[data-theme="dark"] .ws-ed-hl .n { color: #ffb366; } :root[data-theme="dark"] .ws-ed-hl .a { color: #79b8ff; }
.ws-log { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg, rgba(127,127,127,.08)); border-radius: 6px; padding: 10px; font: 12.5px/1.5 ui-monospace, Menlo, Consolas, monospace; margin: 8px 0; }
.ws-run { padding: 10px 0; border-bottom: 1px solid var(--line); }
.ws-hook { word-break: break-all; display: inline-block; padding: 6px 8px; background: var(--bg, rgba(127,127,127,.08)); border-radius: 6px; }

/* ---------- Studio block builder ---------- */
.bb { display: grid; gap: 10px; margin-bottom: 14px; }
.bb-list { display: grid; gap: 10px; }
.bb-block { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; background: var(--surface); padding: 12px 14px; }
.bb-notify, .bb-createTask, .bb-recordQuota, .bb-raiseEvent, .bb-log { border-left-color: var(--ok); }
.bb-eachStaff, .bb-activity, .bb-loadValue { border-left-color: var(--warn); }
.bb-if, .bb-stop { border-left-color: #8777d9; }
.bb-saveValue, .bb-addToValue, .bb-setVar, .bb-math { border-left-color: var(--muted); }
.bb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bb-ctl { display: inline-flex; gap: 4px; }
.bb-ctl button { border: 1px solid var(--line2); background: var(--surface); color: var(--ink); border-radius: 6px; min-width: 32px; height: 32px; cursor: pointer; font-size: 14px; }
.bb-ctl button:hover { background: var(--hover); }
.bb-help { display: block; color: var(--muted); margin: 2px 0 8px; }
.bb-fields { display: grid; gap: 10px; }
.bb-field { display: grid; gap: 4px; }
.bb-flabel { font-size: 13px; color: var(--muted); }
.bb-inwrap { display: flex; gap: 6px; align-items: stretch; flex-wrap: wrap; }
.bb-inwrap input, .bb-inwrap textarea { flex: 1 1 220px; min-width: 0; }
.bb-field input, .bb-field textarea, .bb-field select, .bb-add, .bb-ins, .ws-sample { font: inherit; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 6px; background: var(--surface); color: var(--ink); }
.bb-ins { width: auto; flex: 0 0 auto; max-width: 100%; color: var(--accent); }
.bb-add { width: 100%; border-style: dashed; color: var(--accent); cursor: pointer; }
.bb-inner { margin-top: 12px; padding: 10px 10px 10px 12px; background: var(--hover); border-radius: 8px; }
.bb-inner-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 8px; }
.bb-else { background: var(--accent-soft); }
.ws-sample { width: 100%; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; box-sizing: border-box; }
@media (max-width: 640px) { .bb-block { padding: 10px; } .bb-inwrap { flex-direction: column; } }
