/* ezra-workspace.css: see v10/CONTRACT.md "Workspace". Tokens and css/ezra-ui.css components only; no raw colours, no new @media widths.
 * Layout for the workspace pane tabs (components/ezra-canvas.js, ezra-ws-*.js, lib/ws-ui.js), the WorkspaceAction
 * card (ezra-ws-action.js) and the Track / Alert buttons on answer blocks. Panels size by container queries. */

/* ── Tabs (.ez-seg role=tablist) ───────────────────────────────────────────── */
ezra-canvas.is-ws .ez-ws-tabs {
  display: flex; flex-shrink: 0; margin: var(--sp-2) 14px 0; max-width: calc(100% - 28px);
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
}
ezra-canvas.is-ws .ez-ws-tabs::-webkit-scrollbar { display: none; }
.ez-ws-tabs button { flex-shrink: 0; }
.ez-ws-tabs .ez-count-badge { margin-left: 2px; }
ezra-canvas.is-ws .ez-cv-body { padding-top: var(--sp-3); }
.ez-ws-tp { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.ez-ws-tp:focus-visible { outline-offset: -2px; }

/* ── Panel frame (lib/ws-ui.js panelFrame) ─────────────────────────────────── */
.ez-ws-panel { container: wsp / inline-size; display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.ez-ws-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); min-height: var(--ctl-h); }
.ez-ws-gap { flex: 1 1 auto; }
.ez-ws-title { font-size: var(--fs-13); font-weight: 600; color: var(--bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ez-ws-count, .ez-ws-asof { font-size: var(--fs-12); color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ez-ws-status { display: flex; align-items: center; font-size: var(--fs-12); color: var(--muted); }
.ez-ws-skel { width: 100%; }
.ez-ws-empty { padding: var(--sp-4) var(--sp-3); }
.ez-ws-sym { display: inline-block; max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; font: 600 var(--fs-13)/var(--lh-tight) var(--mono); color: var(--bright); }
.ez-chip.ez-ws-sym { max-width: 12ch; font-size: var(--fs-12); }
.ez-ws-panel .ez-num { font-variant-numeric: tabular-nums; }
/* row actions: quiet until the row is hovered or focused; always there on touch */
.ez-ws-acts { display: inline-flex; align-items: center; gap: 2px; justify-self: end; opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
:is(.ez-ws-wrow, .ez-ws-lrow, .ez-ws-frow):is(:hover, :focus-within, .is-active) .ez-ws-acts,
:is(.ez-ws-frow, .ez-ws-wrow):is(:hover, :focus-within) .ez-ws-why { opacity: 1; }
@media (hover: none), (pointer: coarse) { .ez-ws-acts, .ez-ws-frow .ez-ws-why { opacity: 1; } }
/* shared row look */
:is(.ez-ws-wrow, .ez-ws-frow, .ez-ws-arow, .ez-ws-jrow) {
  position: relative; border-bottom: 1px solid var(--border); cursor: pointer; min-width: 0;
  transition: background-color var(--dur-fast) var(--ease);
}
:is(.ez-ws-wrow, .ez-ws-frow, .ez-ws-arow, .ez-ws-jrow):last-child { border-bottom: 0; }
:is(.ez-ws-wrow, .ez-ws-frow, .ez-ws-arow, .ez-ws-jrow, .ez-ws-plan):hover { background: var(--bg3); }
:is(.ez-ws-wrow, .ez-ws-frow, .ez-ws-arow, .ez-ws-jrow, .ez-ws-lrow, .ez-ws-plan):focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
:is(.ez-ws-wrow, .ez-ws-plan, .ez-ws-lrow).is-active { box-shadow: inset 2px 0 0 var(--p); }
/* value flash (rolling-number flashDirection): the shared ez-flash keyframes from ezra.css */
.ez-ws-panel [data-flash] { border-radius: var(--r-xs); }
@media (prefers-reduced-motion: no-preference) {
  .ez-ws-panel [data-flash="up"] { animation: ez-flash-up calc(var(--dur-slow) * 3.75) var(--ease-out); }
  .ez-ws-panel [data-flash="down"] { animation: ez-flash-down calc(var(--dur-slow) * 3.75) var(--ease-out); }
  .ez-ws-frow.is-new { animation: ez-rise var(--dur-slow) var(--ease-out); }
}

/* ── Watchlist ─────────────────────────────────────────────────────────────── */
.ez-ws-add { display: flex; gap: var(--sp-1); flex: 1 1 160px; min-width: 0; }
.ez-ws-add-in { flex: 1; min-width: 0; height: var(--ctl-h-sm); text-transform: uppercase; }
.ez-ws-add-in::placeholder { text-transform: none; }
.ez-ws-listsel { height: var(--ctl-h-sm); max-width: 14ch; }
.ez-ws-listname { font-size: var(--fs-12); font-weight: 600; color: var(--muted); max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ez-ws-err { margin-top: calc(-1 * var(--sp-1)); }
.ez-ws-wl { display: flex; flex-direction: column; }
.ez-ws-wrow {
  display: grid; align-items: center; gap: 2px var(--sp-2); padding: 6px var(--sp-2) 6px var(--sp-2);
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  grid-template-areas: "sym px chg acts" "meta meta meta meta";
}
.ez-ws-wrow > .ez-ws-sym { grid-area: sym; }
.ez-ws-px { grid-area: px; font-size: var(--fs-13); font-weight: 600; color: var(--bright); text-align: right; padding: 0 2px; }
.ez-ws-chg { grid-area: chg; min-width: 7ch; font-size: var(--fs-12); font-weight: 600; color: var(--muted); text-align: right; padding: 0 2px; }
.ez-ws-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); min-width: 0; min-height: 20px; }
.ez-ws-wrow > .ez-ws-acts { grid-area: acts; }
.ez-ws-meta .ez-chip { height: 20px; padding: 0 6px; font-size: var(--fs-11); max-width: 18ch; overflow: hidden; text-overflow: ellipsis; }
.ez-ws-near { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-11); color: var(--muted); min-width: 0; }
.ez-ws-near-l { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ez-ws-near b { color: var(--text); font-weight: 600; }
.ez-ws-pending, .ez-ws-note { font-size: var(--fs-11); color: var(--faint); }
.ez-ws-rowstale { font-size: var(--fs-11); }
.ez-ws-wrow.is-missing .ez-ws-px { color: var(--faint); }
.ez-ws-wrow[aria-busy="true"] { opacity: .5; }
@container wsp (min-width: 560px) {
  .ez-ws-wrow { grid-template-columns: 9ch 9ch 8ch minmax(0, 1fr) auto; grid-template-areas: "sym px chg meta acts"; }
  .ez-ws-meta { flex-wrap: nowrap; overflow: hidden; }
}

/* ── Levels (LevelsLadder look, one more column for the row actions) ───────── */
.ez-ws-lad .ez-lad-row { grid-template-columns: 4px minmax(0, 1fr) auto 64px auto; }
.ez-ws-lrow.is-nearest { background: var(--amber-wash); }
.ez-ws-lrow.is-nearest:hover { background: var(--bg3); }
@container wsp (max-width: 380px) { .ez-ws-lad .ez-lad-kind { display: none; } }
/* answer LevelsLadder rows gain the Alert button for workspace members */
.ez-lad-ws .ez-lad-row:has(> .ez-ws-btn:not([hidden])) { grid-template-columns: 4px minmax(0, 1fr) auto 64px auto; }
.ez-lad-row > .ez-ws-btn { height: 24px; padding: 0 var(--sp-2); }
@container (max-width: 420px) { .ez-lad-row > .ez-ws-btn span:last-child { display: none; } }

/* ── Track / Alert buttons on answer blocks (.ez-btn.is-sm) ────────────────── */
.ez-btn.ez-ws-btn > span:first-child { display: inline-grid; }
.ez-btn.ez-ws-btn.is-sent, .ez-btn.ez-ws-btn.is-sent:hover { color: var(--p-text); border-color: var(--p-text); opacity: 1; cursor: default; }
.ez-scn-card > .ez-ws-btn { align-self: flex-start; margin-top: auto; }

/* ── Plans ─────────────────────────────────────────────────────────────────── */
.ez-ws-planlist { display: flex; flex-direction: column; gap: var(--sp-2); }
.ez-card.ez-ws-plan { display: flex; flex-direction: column; gap: var(--sp-2); padding: 10px var(--sp-3); cursor: pointer; }
.ez-ws-plan-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.ez-ws-plan-px { font-size: var(--fs-12); color: var(--muted); }
.ez-ws-plan-r { font-size: var(--fs-14); color: var(--bright); min-width: 5ch; text-align: right; }
.ez-ws-plan-lv { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); font-size: var(--fs-12); color: var(--text); }
.ez-ws-plan-lv small { color: var(--faint); font-size: var(--fs-11); }
.ez-ws-prog { position: relative; height: 26px; }
.ez-ws-prog-track { position: absolute; left: 6px; right: 6px; top: 6px; height: 6px; border-radius: var(--r-full); background: var(--bg3); }
.ez-ws-prog-track > span { position: absolute; top: 0; height: 100%; }
.ez-ws-prog-risk { left: 0; background: var(--bear-wash); border-radius: var(--r-full) 0 0 var(--r-full); box-shadow: inset 0 0 0 1px var(--bear); }
.ez-ws-prog-zone { background: var(--p2); box-shadow: inset 0 0 0 1px var(--level-entry); }
.ez-ws-prog-reward { background: var(--bull-wash); border-radius: 0 var(--r-full) var(--r-full) 0; box-shadow: inset 0 0 0 1px var(--bull); }
.ez-ws-prog-track > .ez-ws-prog-tick { width: 2px; height: 12px; top: -3px; margin-left: -1px; background: var(--bull); }
.ez-ws-prog-tick > span { position: absolute; top: 13px; left: 50%; transform: translateX(-50%); font-size: var(--fs-11); color: var(--faint); white-space: nowrap; }
.ez-ws-prog-track > .ez-ws-prog-px { width: 12px; height: 12px; top: -3px; margin-left: -6px; border-radius: 50%; background: var(--level-spot); box-shadow: 0 0 0 2px var(--card); }
.ez-ws-prog-px.is-stop { background: var(--bear); }
.ez-ws-prog-px.is-target { background: var(--bull); }
@media (prefers-reduced-motion: no-preference) { .ez-ws-prog-px { transition: left var(--dur-slow) var(--ease); } }
.ez-ws-plan-foot { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-12); color: var(--faint); }
.ez-ws-plan-label { min-width: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ez-ws-plan-when { white-space: nowrap; }
.ez-ws-journal { display: flex; flex-direction: column; gap: var(--sp-3); }
.ez-ws-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
@container wsp (max-width: 380px) { .ez-ws-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ez-ws-tile { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2) 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--card); min-width: 0; }
.ez-ws-tile b { font-size: var(--fs-17); color: var(--bright); }
.ez-ws-mini { width: 100%; border-collapse: collapse; font-size: var(--fs-12); --ez-tfs: var(--fs-12); }
.ez-ws-mini caption { text-align: left; padding-bottom: var(--sp-1); }
.ez-ws-mini :is(th, td) { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.ez-ws-mini th { color: var(--faint); font-weight: 600; }
.ez-ws-mini .is-num { text-align: right; }
.ez-ws-jlist { display: flex; flex-direction: column; }
.ez-ws-jrow { display: grid; grid-template-columns: 9ch 5ch auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2); padding: 6px var(--sp-2); font-size: var(--fs-12); }
.ez-ws-jdir { color: var(--muted); }
.ez-ws-jwhen { color: var(--faint); text-align: right; }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.ez-ws-formwrap { padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r); background: var(--card); }
.ez-ws-form { display: flex; flex-direction: column; gap: 10px; }
.ez-ws-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.ez-ws-field { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.ez-ws-field > label { font-size: var(--fs-12); font-weight: 600; color: var(--muted); }
.ez-ws-field > small { font-size: var(--fs-11); color: var(--faint); }
.ez-ws-field :is(.ez-input, .ez-select)[aria-invalid] { border-color: var(--bear); }
.ez-ws-field.is-symbol .ez-input { text-transform: uppercase; }
.ez-ws-form-actions { display: flex; gap: var(--sp-2); }
.ez-ws-alist { display: flex; flex-direction: column; }
.ez-ws-arow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--sp-2); padding: var(--sp-2); }
.ez-ws-arow.is-off .ez-ws-amain { opacity: .6; }
.ez-ws-abell { display: inline-grid; color: var(--p-text); }
.ez-ws-arow.is-off .ez-ws-abell { color: var(--faint); }
.ez-ws-amain { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ez-ws-atext { font-size: var(--fs-13); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ez-ws-asub { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-11); color: var(--faint); }
.ez-ws-asub .ez-chip { height: 18px; padding: 0 6px; font-size: var(--fs-11); }
.ez-ws-anote { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Tape / News ───────────────────────────────────────────────────────────── */
.ez-ws-flist { display: flex; flex-direction: column; }
.ez-ws-frow { display: grid; align-items: center; gap: var(--sp-2); padding: 5px var(--sp-2); font-size: var(--fs-12); min-height: 34px; }
.is-tape .ez-ws-frow { grid-template-columns: 6ch 7ch minmax(0, 1fr) auto 7ch auto; }
.is-tape .ez-ws-fs, .is-tape .ez-ws-fk { display: none; }
@container wsp (min-width: 520px) {
  .is-tape .ez-ws-frow { grid-template-columns: 6ch 7ch minmax(0, 1fr) auto 7ch 6ch minmax(0, .8fr) auto; }
  .is-tape .ez-ws-fs, .is-tape .ez-ws-fk { display: block; }
}
.ez-ws-ft { color: var(--faint); }
.ez-ws-fc, .ez-ws-fk { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ez-ws-fp { text-align: right; color: var(--bright); }
.ez-ws-fs { text-align: right; color: var(--muted); }
.ez-chip.ez-ws-side { height: 20px; padding: 0 6px; font-size: var(--fs-11); }
.ez-ws-frow > .ez-ws-why { opacity: 0; }
.is-news .ez-ws-frow { grid-template-columns: 9ch minmax(0, 1fr) auto; align-items: start; padding: var(--sp-2); }   /* 9ch: "Yesterday" over "7:50 PM" */
.ez-ws-fbody { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ez-ws-fh { --ez-a: var(--text); --ez-a-hover: var(--bright); font-size: var(--fs-13); line-height: var(--lh-snug); color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ez-ws-fm { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-11); color: var(--faint); min-width: 0; }
.ez-ws-fm .ez-ws-sym { font-size: var(--fs-11); }

/* ── Pins (the canvas pin card look, .ez-cv-pin) ───────────────────────────── */
.ez-ws-pinlist { display: flex; flex-direction: column; gap: var(--sp-3); }

/* ── Popovers (.ez-pop) ────────────────────────────────────────────────────── */
.ez-ws-pop { display: flex; flex-direction: column; gap: var(--sp-2); width: min(300px, calc(100vw - 32px)); }
.ez-ws-pop h4 { margin: 0; }
.ez-ws-kindseg { display: flex; flex-wrap: wrap; }
.ez-ws-pop-desc { margin: 0; font-size: var(--fs-12); }

/* ── Notice toast ──────────────────────────────────────────────────────────── */
.ez-ws-toast .ez-ws-toast-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ── WorkspaceAction card (ezra-ws-action) ─────────────────────────────────── */
ezra-ws-action { display: block; container-type: inline-size; }
.ez-card.ez-ws-act { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 14px; border-left: 3px solid var(--p); }
.ez-ws-act-icon { flex-shrink: 0; display: grid; place-items: center; width: var(--ctl-h); height: var(--ctl-h); border-radius: var(--r-full); background: var(--p1); color: var(--p-text); }
.ez-ws-act.is-done { border-left-color: var(--bull); }
.ez-ws-act.is-done .ez-ws-act-icon { background: var(--bull-wash); color: var(--bull-text); }
.ez-ws-act-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ez-ws-act-text { margin: 0; font-size: var(--fs-14); font-weight: 600; color: var(--bright); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.ez-ws-act-sub { margin: 0; font-size: var(--fs-12); color: var(--muted); }
.ez-ws-act-err { margin-top: var(--sp-1); }
.ez-ws-act-err.is-note { color: var(--muted); }
.ez-ws-act-btns { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ez-ws-act.is-dismissed { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) 0; font-size: var(--fs-13); }
.ez-ws-act-dim { color: var(--faint); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container (max-width: 480px) {
  .ez-card.ez-ws-act { flex-wrap: wrap; }
  .ez-ws-act-main { flex-basis: calc(100% - var(--ctl-h) - var(--sp-3)); }
  .ez-ws-act-btns { width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .ez-ws-acts, .ez-ws-prog-px, :is(.ez-ws-wrow, .ez-ws-frow, .ez-ws-arow, .ez-ws-jrow) { transition: none; }
}
