/* Lab workspace foundation: the parts every redesigned task room shares with the Isophone Lab entrance.
   Components only (ws-*); colour tokens come from the page (base.css for the bench, georeference-lab.css for
   georeference), so this file matches nothing on pages that do not use the classes.
   - station head: the room's own number lit in mono, its name in the display face, ruler ticks on its lower edge
   - escape: Home is the lab's signal pill, Classic a quiet outlined link; both step aside inside a lab room, whose
     rail already carries them
   - task environment: the same paper and ruler world as the entrance, tinted by the room's accent, only on the
     surfaces around the work; map and plot plates stay clean
   Type is rem (follows the browser text size), never viewport-scaled, tracking zero. */
.ws {
  --ws-head: 3.5rem; --ws-hit: 2.75rem;
  --ws-t0: .75rem; --ws-t1: .875rem; --ws-t2: 1rem; --ws-t3: 1.125rem; --ws-t4: 1.375rem;
  --ws-accent: var(--signal); --ws-accent-ink: var(--ink);
  --ws-tick: repeating-linear-gradient(90deg, var(--rule-2) 0 1px, transparent 1px 40px),
             repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 8px);
  letter-spacing: 0;
}
.ws[data-ws="bench"] { --ws-accent: #38bdf8; --ws-accent-ink: #0369a1; }
.ws[data-ws="geo"] { --ws-accent: #2bd4f0; --ws-accent-ink: #0b6f84; }
:root[data-theme="dark"] .ws[data-ws="bench"] { --ws-accent-ink: #7dd3fc; }
:root[data-theme="dark"] .ws[data-ws="geo"] { --ws-accent-ink: #67e8f9; }

/* ---------- station head ---------- */
.ws-head {
  position: relative; display: flex; align-items: center; gap: .5rem; min-width: 0; height: var(--ws-head);
  padding: 0 .5rem 0 .75rem; border-bottom: 1px solid var(--ink);
  background: radial-gradient(42rem 9rem at 0 0, color-mix(in oklab, var(--ws-accent) 16%, transparent), transparent 70%), var(--paper);
}
.ws-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; pointer-events: none;
  background: var(--ws-tick); background-size: 100% 6px, 100% 3px; background-position: left bottom; background-repeat: no-repeat;
}
.ws-id { display: flex; align-items: center; gap: .625rem; min-width: 0; flex: none; padding-right: .25rem; }
.ws-no { display: grid; place-items: center; min-width: 2rem; height: 1.5rem; padding: 0 .375rem; border-radius: 2px; background: var(--slab); color: var(--signal); font: 600 .8125rem/1 var(--f-num); }
:root[data-theme="dark"] .ws-no { background: #121412; color: #d4f347; box-shadow: inset 0 0 0 1px var(--rule-2); }
.ws-title { display: grid; min-width: 0; line-height: 1.15; }
.ws-title b { font: 600 var(--ws-t3)/1.15 var(--f-display); color: var(--ink); white-space: nowrap; }
.ws-title small { font-size: var(--ws-t0); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-head .pick select { min-height: var(--ws-hit); }
.ws-gap { flex: 1 1 0; min-width: .25rem; }

/* ---------- escape: Home pill, Classic link ---------- */
.ws-escape { display: flex; align-items: center; gap: .375rem; flex: none; }
.ws-home {
  display: inline-flex; align-items: center; gap: .5rem; min-height: var(--ws-hit); padding: 0 1rem 0 .75rem; border-radius: 999px;
  background: var(--signal); color: #121412; font: 600 var(--ws-t1)/1 var(--f-ui); text-decoration: none; white-space: nowrap;
  transition: box-shadow var(--t) var(--ease), transform 160ms var(--ease);
}
.ws-home:hover { box-shadow: 0 0 0 3px color-mix(in oklab, var(--signal) 38%, transparent); }
.ws-home:active { transform: scale(.97); }
.ws-home .i { width: 1.125rem; height: 1.125rem; }
.ws-classic {
  display: inline-flex; align-items: center; gap: .5rem; min-height: var(--ws-hit); padding: 0 .75rem; border: 1px solid var(--rule-2); border-radius: var(--r, 4px);
  color: var(--ink-2); font: 600 var(--ws-t0)/1.2 var(--f-ui); text-decoration: none; white-space: nowrap;
}
.ws-classic:hover { color: var(--ink); background: var(--rule); }
.ws-classic .i { width: 1rem; height: 1rem; }
/* inside a lab room the rail already offers Home and Classic and names the room */
html[data-lab-host] .ws-escape, html[data-lab-host] .ws-id { display: none !important; }

/* ---------- panel heads: a lit index over a hairline, never a filled bar ---------- */
.ws-ph { display: flex; align-items: center; gap: .5rem; min-height: var(--ws-hit); min-width: 0; }
.ws-ph h2, .ws-ph h3 { margin: 0; font: 650 var(--ws-t1)/1.3 var(--f-ui); color: var(--ink); white-space: nowrap; }
.ws-k { font: 600 var(--ws-t0)/1 var(--f-num); color: var(--ws-accent-ink); }
.ws-meta { margin: 0; font-size: var(--ws-t0); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- plate: the map/plot window; ruler ticks on its outer edges only, nothing over the content ---------- */
.ws-plate { position: relative; }
.ws-plate > .ws-edge { position: absolute; z-index: 3; pointer-events: none; background: var(--ws-tick); background-repeat: no-repeat; }
.ws-edge.top { left: 0; right: 0; top: 0; height: 6px; background-size: 100% 6px, 100% 3px; background-position: left top; }
.ws-edge.left { top: 0; bottom: 0; left: 0; width: 6px;
  background: repeating-linear-gradient(180deg, var(--rule-2) 0 1px, transparent 1px 40px) left top / 6px 100% no-repeat,
              repeating-linear-gradient(180deg, var(--rule) 0 1px, transparent 1px 8px) left top / 3px 100% no-repeat; }
.ws-corner { position: absolute; z-index: 3; width: 14px; height: 14px; pointer-events: none; border: 0 solid var(--ws-accent); }
.ws-corner.tr { top: 6px; right: 6px; border-width: 1.5px 1.5px 0 0; }
.ws-corner.bl { bottom: 6px; left: 6px; border-width: 0 0 1.5px 1.5px; }

/* the room's surface around the work: paper + ruler grid + the accent's glow (never painted on a map or plot) */
.ws-surface {
  background:
    radial-gradient(36rem 24rem at 100% 0, color-mix(in oklab, var(--ws-accent) 9%, transparent), transparent 72%),
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--plate);
  background-blend-mode: normal;
}
:root[data-theme="dark"] .ws-surface { background-color: var(--plate); }

:root[data-motion="reduced"] .ws-home { transition: none; }
@media (prefers-reduced-motion: reduce) { .ws-home { transition: none; } }
