/* workspaces.css — design/42 §1 (P2): WORKSPACES — the topbar button (#tb-ws), its menu (#ws-menu, fixed under
   the button) and the Indicators modal's bar (#ws-bar). Colours are the page tokens, so both themes follow. */
:root { --ws-dirty: #f0b429; }
:root[data-theme="light"] { --ws-dirty: #b7791f; }

/* ---- #tb-ws: "Flow ▾" + the modified dot ---- */
#tb-ws { padding: 0 6px 0 8px; gap: 2px; color: var(--fg); font: inherit; font-size: 12px; font-weight: 600; }
#tb-ws .tb-ws-name { max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tb-ws .tb-ws-name.is-none { color: var(--muted); font-weight: 500; }
#tb-ws .tb-ws-dirty { color: var(--ws-dirty); font-size: 18px; line-height: 12px; margin: 0 1px 0 1px; }
#tb-ws.open { color: var(--fg); background: var(--panel-2); border-color: var(--border); }
#tb-ws.open .tip { display: none; }

/* ---- the menu ---- */
.ws-menu {
  position: fixed;
  z-index: 60;
  width: 284px;
  max-height: calc(100vh - 64px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  font-size: 12px;
}
.ws-head { padding: 4px 8px 6px; }
.ws-title { display: block; font-weight: 700; }
.ws-note { display: block; margin-top: 1px; color: var(--muted); font-size: 10.5px; line-height: 1.3; }
.ws-row { display: flex; align-items: center; border-radius: 6px; min-height: 28px; }
.ws-row:hover, .ws-row:focus-within { background: var(--panel-2); }
.ws-item, .ws-act {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
  background: transparent; color: var(--fg);
  border: 0; border-radius: 6px;
  padding: 5px 8px;
  font: inherit; font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.ws-item { flex: 1 1 auto; }
.ws-item:focus-visible, .ws-act:focus-visible, .ws-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ws-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-row.is-active .ws-name { font-weight: 600; }
.ws-meta { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.ws-kbd {
  flex: 0 0 auto;
  min-width: 17px; height: 17px; line-height: 15px;
  text-align: center;
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--muted);
  font: 600 10.5px/15px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ws-kbd.is-empty { border-color: transparent; }
.ws-mark { flex: 0 0 auto; width: 12px; text-align: center; color: var(--accent); font-weight: 700; }
.ws-mark.is-dirty { color: var(--ws-dirty); font-size: 16px; line-height: 12px; }
.ws-icon {
  flex: 0 0 auto;
  width: 24px; height: 24px; margin-right: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--muted);
  border: 1px solid transparent; border-radius: 5px;
  font: inherit; font-size: 12px;
  cursor: pointer;
  visibility: hidden;
}
.ws-row:hover .ws-icon, .ws-row:focus-within .ws-icon { visibility: visible; }
.ws-icon:hover { color: var(--fg); border-color: var(--border); background: var(--panel); }
.ws-icon-del:hover { color: var(--neg); border-color: var(--neg); }
.ws-sep { height: 1px; margin: 4px 2px; background: var(--border); }
.ws-act { width: 100%; justify-content: space-between; }
.ws-act:hover:not(:disabled) { background: var(--panel-2); }
.ws-act:disabled { color: var(--muted); opacity: 0.6; cursor: default; }
.ws-act-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the inline forms (Save as…, rename) and the delete confirm */
.ws-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 5px 6px; width: 100%; }
.ws-input, .ws-slot, .ws-sel {
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 3px 6px;
  font: inherit; font-size: 12px;
}
.ws-input { flex: 1 1 120px; min-width: 0; }
.ws-input:focus, .ws-slot:focus, .ws-sel:focus { outline: none; border-color: var(--accent); }
.ws-slot { max-width: 150px; }
.ws-tf { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; cursor: pointer; }
.ws-btn, .ws-bar-btn {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 8px;
  font: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer;
}
.ws-btn:hover, .ws-bar-btn:hover:not(:disabled) { color: var(--fg); border-color: var(--accent); }
.ws-btn.ws-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.ws-btn.ws-danger { color: var(--neg); border-color: var(--neg); }
.ws-btn.ws-danger:hover { background: var(--neg); color: #fff; }
.ws-bar-btn:disabled { opacity: 0.5; cursor: default; }
.ws-row.ws-confirm { gap: 6px; padding: 3px 6px; background: var(--panel-2); }
.ws-confirm-l { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- #ws-bar: the Indicators modal header (a drag handle: workspaces.js stops pointerdown on it) ---- */
.ind-ws-bar { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.ind-ws-bar .ws-sel { max-width: 170px; padding: 2px 4px; font-size: 11.5px; }
.ind-ws-bar .ws-sel.is-dirty { border-color: var(--ws-dirty); }
.ind-ws-bar .ws-form { padding: 0; width: auto; flex-wrap: nowrap; }
.ind-ws-bar .ws-input { flex: 0 1 130px; }
