/* os/apps/workshop.css — Workshop: one evidence-complete case (Gallery
   quality review) plus two narrowed summary cases, plus a compact optional
   Console disclosure. Owned by the workshop worker. Paper interior, wide
   measure for prose, full width for the inspected artifact. No hacker theme. */

.app-workshop {
  /* token fallbacks if shell.css tokens are absent (dev-in-isolation safety) */
  --ws-blue-600: var(--blue-600, #1d5be6);
  --ws-ink: var(--ink, #101828);
  --ws-ink-2: var(--ink-2, #344054);
  --ws-ink-3: var(--ink-3, #667085);
  --ws-line: var(--line, #e4e7ec);
  --ws-line-2: var(--line-2, #d0d5dd);
  --ws-paper: var(--paper, #fbfcfe);
  --ws-paper-2: var(--paper-2, #f4f6fa);
  --ws-amber: var(--amber, #f4c542);
  --ws-ok: var(--ok, #1f8f5f);
  --ws-danger: var(--danger, #c0392b);
  --ws-radius-lg: var(--radius-lg, 16px);
  --ws-radius-md: var(--radius-md, 10px);
  --ws-radius-sm: var(--radius-sm, 6px);
  --ws-space-2: var(--space-2, 8px);
  --ws-space-3: var(--space-3, 12px);
  --ws-space-4: var(--space-4, 16px);
  --ws-space-5: var(--space-5, 24px);
  --ws-space-6: var(--space-6, 32px);
  --ws-font-sans: var(--font-sans, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  --ws-font-mono: var(--font-mono, "JetBrains Mono", "IBM Plex Mono", Menlo, Consolas, monospace);
  --ws-ease: var(--ease-out, cubic-bezier(.16, 1, .3, 1));
  --ws-dur: var(--dur-fast, 140ms);

  height: 100%;
  background: var(--ws-paper);
  color: var(--ws-ink);
  font-family: var(--ws-font-sans);
  font-size: 15px;
  line-height: 1.55;
  overflow-y: auto;
}

.app-workshop h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 8px; }
.app-workshop h3 { font-size: 18px; line-height: 1.3; margin: var(--ws-space-6) 0 8px; }
.app-workshop h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ws-ink-3); margin: 0 0 6px; font-weight: 600; }
.app-workshop p { margin: 0 0 12px; max-width: 68ch; }
.app-workshop code, .app-workshop pre { font-family: var(--ws-font-mono); }
/* Any excerpt block scrolls inside itself rather than widening the app. */
.app-workshop pre { max-width: 100%; overflow-x: auto; }
.app-workshop .mono { font-family: var(--ws-font-mono); font-size: 13px; }

.ws-root { min-height: 100%; }
.ws-view { padding: var(--ws-space-6); max-width: 900px; margin: 0 auto; }
.ws-page { display: flex; flex-direction: column; gap: var(--ws-space-5); }

/* ---- case selector ---- */
.ws-case-select { flex-wrap: wrap; }
.ws-case-select button { display: inline-flex; align-items: center; gap: 6px; }
.ws-tag {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
  color: var(--ws-ink-3); background: var(--ws-paper-2); border: 1px solid var(--ws-line);
  border-radius: 999px; padding: 1px 7px;
}
.ws-case-summary-tag {
  display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  font-weight: 600; color: var(--ws-ink-3); margin-bottom: 6px;
}

/* ---- case header ---- */
.ws-eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ws-blue-600); font-weight: 600; margin: 0 0 4px; max-width: none; }
.ws-lede { max-width: 66ch; color: var(--ws-ink-2); font-size: 16px; }
.ws-field { margin-bottom: var(--ws-space-4); }

/* ---- lead verdict pair: the accepted plate beside the rejected one ----
   Each gallery strip is four equal panels (colour | depth | matte | fill), so
   an image sized to 400% of an overflow-hidden box shows exactly the colour
   panel. The box width is derived from that panel's own aspect ratio, so the
   panel is never stretched or side-cropped; both stages share one height so
   the two verdicts read as a pair. */
.ws-verdict-pair {
  --ws-verdict-h: 260px;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--ws-space-4);
  align-items: start; margin: var(--ws-space-4) 0 var(--ws-space-5);
}
.ws-verdict { margin: 0; min-width: 0; }
.ws-verdict-stage {
  height: var(--ws-verdict-h); display: flex; align-items: center; justify-content: flex-start;
}
.ws-verdict-crop {
  /* flex-item auto minimum size would otherwise inflate this box to the
     400%-wide image's intrinsic width, so pin it explicitly. */
  flex: 0 0 auto; min-width: 0;
  width: calc(var(--ws-panel-ar) * var(--ws-verdict-h)); max-width: 100%; overflow: hidden;
  border: 1px solid var(--ws-line); border-radius: var(--ws-radius-md); background: #0e0e10;
}
.ws-verdict-crop img { display: block; width: 400%; max-width: none; height: auto; }
.ws-verdict figcaption { display: block; margin-top: var(--ws-space-3); }
.ws-verdict-mark {
  display: block; font-weight: 600; font-size: 15px; color: var(--ws-ink);
  padding-left: 14px; position: relative;
}
.ws-verdict-mark::before {
  content: ''; position: absolute; left: 0; top: .45em; width: 8px; height: 8px; border-radius: 50%;
}
.ws-verdict-mark-accepted::before { background: var(--ws-ok); }
.ws-verdict-mark-rejected::before { background: var(--ws-danger); }
.ws-verdict-reason { display: block; margin-top: 4px; padding-left: 14px; font-size: 13px; color: var(--ws-ink-3); }
.ws-verdict-reason .mono { color: var(--ws-ink-2); }

/* ---- plate switcher + viewer ---- */
.ws-strip-title { margin-bottom: 4px; }
.ws-strip-note { font-size: 13px; color: var(--ws-ink-3); margin-bottom: var(--ws-space-2); }
.ws-plate-select, .ws-case-select-mobile { display: none; }
.ws-plate-select label, .ws-case-select-mobile label {
  display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ws-ink-3); font-weight: 600; margin-bottom: 4px;
}
.ws-plate-select select, .ws-case-select-mobile select {
  width: 100%; min-height: 44px; padding: 0 10px; font: inherit; color: var(--ws-ink);
  background: var(--ws-paper); border: 1px solid var(--ws-line-2); border-radius: var(--ws-radius-md);
}

/* ---- technical evidence disclosure ---- */
.ws-evidence { border: 1px solid var(--ws-line); border-radius: var(--ws-radius-lg); background: var(--ws-paper-2); }
.ws-evidence > summary {
  cursor: pointer; list-style: none; padding: var(--ws-space-3) var(--ws-space-4);
  font-weight: 600; display: flex; align-items: baseline; gap: 8px; min-height: 44px;
}
.ws-evidence > summary::-webkit-details-marker { display: none; }
.ws-evidence > summary::before { content: '▸ '; color: var(--ws-ink-3); }
.ws-evidence[open] > summary::before { content: '▾ '; }
.ws-evidence-hint { font-weight: 400; color: var(--ws-ink-3); font-size: 13px; }
.ws-evidence-body { border-top: 1px solid var(--ws-line); padding: var(--ws-space-4); background: var(--ws-paper); border-radius: 0 0 var(--ws-radius-lg) var(--ws-radius-lg); }
.ws-evidence-file { font-size: 12px; color: var(--ws-ink-3); margin: 0 0 var(--ws-space-3); max-width: none; word-break: break-word; }
.ws-evidence .ws-plate-grid { margin-top: 0; }
.ws-evidence .ws-mechanism h3:first-child, .ws-evidence .ws-verify h3:first-child { margin-top: var(--ws-space-5); }

.ws-plate-switch { flex-wrap: wrap; margin: var(--ws-space-4) 0 var(--ws-space-5); }
.ws-plate { margin: 0 0 var(--ws-space-3); }
.ws-plate-imgwrap { position: relative; border-radius: var(--ws-radius-lg); overflow: hidden; border: 1px solid var(--ws-line); background: #0e0e10; }
.ws-plate-imgwrap img { display: block; width: 100%; height: auto; }
.ws-plate figcaption { margin-top: 8px; font-family: var(--ws-font-mono); font-size: 12px; color: var(--ws-ink-3); }
.ws-credit { font-size: 13px; }

.ws-plate-annotation {
  position: absolute; border: 2px dashed var(--ws-amber); border-radius: var(--ws-radius-sm);
  box-shadow: 0 0 0 2000px rgba(8, 8, 10, .35);
  display: flex; align-items: flex-end;
}
.ws-plate-annotation-label {
  display: inline-block; background: rgba(16, 24, 40, .88); color: #fff; font-size: 12px;
  line-height: 1.3; padding: 6px 8px; border-radius: 0 0 var(--ws-radius-sm) var(--ws-radius-sm);
  max-width: 100%;
}

.ws-plate-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--ws-space-4); margin-top: var(--ws-space-4); align-items: start; }
.ws-plate-grid > * { min-width: 0; }
.ws-gate-card, .ws-recorded-card { margin: 0; }
.ws-gate-card h4, .ws-recorded-card h4 { margin-bottom: var(--ws-space-3); }
.ws-score { color: var(--ws-ink-3); font-size: 13px; margin: var(--ws-space-3) 0 0; }
.ws-recorded-card p { max-width: none; overflow-wrap: anywhere; }
.ws-recorded-veto { margin-top: 4px; color: var(--ws-ink-2); word-break: break-word; }

.ws-gate-scroll { overflow-x: auto; }
.ws-gate-table { width: 100%; min-width: 300px; font-size: 13px; }
.ws-gate-table th, .ws-gate-table td { padding: 6px 8px; }
.ws-evidence .ws-gate-table th, .ws-evidence .ws-gate-table td { padding: 6px; }
.ws-check-pass { color: var(--ws-ok); font-weight: 600; }
.ws-check-fail { color: var(--ws-danger); font-weight: 600; }

/* ---- code/mechanism excerpts ---- */
.ws-mechanism pre, .ws-excerpt pre {
  background: var(--ws-paper-2); border: 1px solid var(--ws-line); border-radius: var(--ws-radius-md);
  padding: var(--ws-space-3) var(--ws-space-4); overflow-x: auto; font-size: 12.5px; line-height: 1.55; margin: 0 0 var(--ws-space-3);
}
.ws-mechanism pre code, .ws-excerpt pre code { white-space: pre; }
.ws-excerpt-file { font-family: var(--ws-font-mono); font-size: 12px; color: var(--ws-ink-3); margin: 0 0 8px; max-width: none; }

.ws-excerpt { margin: var(--ws-space-3) 0; border: 1px solid var(--ws-line); border-radius: var(--ws-radius-md); padding: var(--ws-space-3) var(--ws-space-4); }
.ws-excerpt summary { cursor: pointer; font-weight: 500; color: var(--ws-blue-600); list-style: none; }
.ws-excerpt summary::-webkit-details-marker { display: none; }
.ws-excerpt summary::before { content: '▸ '; }
.ws-excerpt[open] summary::before { content: '▾ '; }
.ws-excerpt[open] summary { margin-bottom: var(--ws-space-3); }

.ws-verify, .ws-contribution, .ws-mechanism { max-width: 68ch; }
.ws-verify p, .ws-contribution p { max-width: none; }

.ws-related { display: flex; flex-wrap: wrap; gap: var(--ws-space-3); margin-top: var(--ws-space-5); }

/* ---- console (compact optional disclosure, not a featured surface) ---- */
.ws-console-disclosure { border: 1px solid var(--ws-line); border-radius: var(--ws-radius-lg); background: var(--ws-paper-2); }
.ws-console-disclosure > summary {
  cursor: pointer; list-style: none; padding: var(--ws-space-3) var(--ws-space-4); font-weight: 600;
  display: flex; align-items: baseline; gap: 8px; min-height: 40px;
}
.ws-console-disclosure > summary::-webkit-details-marker { display: none; }
.ws-console-disclosure > summary::before { content: '▸ '; color: var(--ws-ink-3); }
.ws-console-disclosure[open] > summary::before { content: '▾ '; }
.ws-console-hint { font-weight: 400; color: var(--ws-ink-3); font-size: 13px; }
.ws-console-body { border-top: 1px solid var(--ws-line); padding: var(--ws-space-4); }
.ws-transcript { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-bottom: var(--ws-space-3); }
.ws-tline { font-size: 14px; }
.ws-tline p { margin: 0 0 8px; max-width: none; }
.ws-tline p:last-child { margin-bottom: 0; }
.ws-tline-cmd { font-family: var(--ws-font-mono); color: var(--ws-ink); }
.ws-tline-out { color: var(--ws-ink-2); }
.ws-tline code { background: var(--ws-paper); border: 1px solid var(--ws-line); border-radius: 4px; padding: 1px 5px; font-size: 12.5px; }
.ws-cmd-list { margin: 0 0 8px; padding-left: 18px; }
.ws-cmd-list li { margin-bottom: 4px; }
.ws-hint { margin: 0; color: var(--ws-ink-3); font-size: 14px; }
.ws-console-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ws-find-results { display: flex; flex-direction: column; gap: 4px; }
.ws-find-row {
  display: flex; justify-content: space-between; gap: var(--ws-space-3); text-align: left; width: 100%;
  padding: 8px 10px; border-radius: var(--ws-radius-sm); border: 1px solid var(--ws-line); background: var(--ws-paper);
  color: var(--ws-ink); font-size: 13.5px; min-height: 40px;
}
.ws-find-row:hover { background: var(--ws-paper-2); }
.ws-find-kind { color: var(--ws-ink-3); font-size: 12px; }

.ws-console-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--ws-space-3); }
.ws-suggest { font-family: var(--ws-font-mono); font-size: 12.5px; border: 1px solid var(--ws-line); border-radius: var(--ws-radius-sm); padding: 4px 9px; min-height: 32px; }

.ws-console-form { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--ws-line); padding-top: var(--ws-space-3); }
.ws-prompt { font-family: var(--ws-font-mono); color: var(--ws-ink-3); }
.ws-console-input {
  flex: 1 1 auto; border: 1px solid var(--ws-line); border-radius: var(--ws-radius-sm); background: var(--ws-paper);
  font-family: var(--ws-font-mono); font-size: 14px; color: var(--ws-ink); height: 36px; padding: 0 10px;
}
.ws-console-input:focus-visible { outline: 3px solid var(--ws-blue-600, #2f73f0); outline-offset: 1px; }
.ws-console-run { flex: 0 0 auto; }

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .app-workshop .ws-case-select button,
  .app-workshop .ws-plate-switch button { transition: none; }
}

/* ---- mobile: stack the plate grid, keep annotation legible, no overflow ----
   Both segmented controls are replaced by labelled selects at this width, so
   nothing wraps into a block of pills. */
@media (max-width: 760px) {
  .ws-view { padding: var(--ws-space-4); }
  .ws-plate-grid { grid-template-columns: 1fr; }
  .ws-plate-annotation-label { font-size: 11px; }
  .ws-console-suggest button { min-height: 40px; }
  .ws-console-input { height: 40px; }
  .ws-transcript { max-height: 220px; }

  .ws-case-select, .ws-plate-switch { display: none; }
  .ws-plate-select, .ws-case-select-mobile { display: block; }
  .ws-plate-select { margin: var(--ws-space-4) 0 var(--ws-space-3); }

  .ws-verdict-pair { grid-template-columns: 1fr; gap: var(--ws-space-5); }
  .ws-verdict-stage { height: auto; }
  .ws-verdict-crop { width: 100%; }
  .ws-evidence-body { padding: var(--ws-space-3); }
}

/* Quiet captions for the gallery selection page. Preserve photo aspect ratios. */
.ws-photo-selection .ws-verdict figcaption { font-size: 14px; font-weight: 400; color: var(--ws-ink-2); }
.ws-photo-selection .ws-photo-credit { font-size: 12px; color: var(--ws-ink-3); margin-bottom: var(--ws-space-5); }
