/* Workshop components: classes only, no framework. Every value comes from tokens.css; the faces from fonts/<product>.css. */

/* Which faces each product uses: the scale is shared, the faces are the theme's. */
:root, [data-theme="navegando"] {
  --ws-display: var(--font-nav-display); --ws-display-stretch: 100%;
  --ws-body: var(--font-nav-body); --ws-label: var(--font-nav-mono); --ws-mono: var(--font-nav-mono);
  --ws-label-weight: 500;
}
[data-theme="threeops"], [data-theme="threeops-light"] {
  --ws-display: var(--font-ops-display); --ws-display-stretch: 92%;
  --ws-body: var(--font-ops-body); --ws-label: var(--font-ops-mono); --ws-mono: var(--font-ops-mono);
  --ws-label-weight: 500;
}
[data-theme="map"] {
  --ws-display: var(--font-map-hud); --ws-display-stretch: 100%;
  --ws-body: var(--font-map-body); --ws-label: var(--font-map-hud); --ws-mono: ui-monospace, Consolas, monospace;
  --ws-label-weight: 600;
}
/* Sunken tracks (segmented controls, steppers) sit a step below the page: darker on dark themes, a touch darker on
   light. Declared on every theme, so var(--bg) resolves to that theme's ground. */
:root, [data-theme] { --ws-sunken: color-mix(in srgb, var(--bg) 70%, black); }
[data-theme="threeops-light"], [data-theme="navegando-harbor"] { --ws-sunken: color-mix(in srgb, var(--bg) 90%, var(--text)); }

html, body { background: var(--bg); color: var(--text); }
body { margin: 0; font: 400 15px/1.55 var(--ws-body); -webkit-font-smoothing: antialiased; }
.ws-page { padding: var(--space-5) var(--space-4); display: grid; gap: var(--space-4); }
.ws-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.ws-stack { display: grid; gap: var(--space-3); }

/* type */
.ws-display { font: 700 40px/1.05 var(--ws-display); font-stretch: var(--ws-display-stretch); letter-spacing: -0.015em; text-transform: none; margin: 0; }
[data-theme^="threeops"] .ws-display { letter-spacing: -0.02em; }
[data-theme="map"] .ws-display { text-transform: uppercase; letter-spacing: 0.01em; }
.ws-title { font: 650 22px/1.25 var(--ws-body); letter-spacing: -0.01em; margin: 0; }
.ws-label { font: var(--ws-label-weight) 11px/1.3 var(--ws-label); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); }
.ws-mono, .ws-id { font: 400 13px/1.5 var(--ws-mono); font-variant-numeric: tabular-nums; }
.ws-id { color: var(--text-muted); }
.ws-soft { color: var(--text-soft); }
.ws-muted { color: var(--text-muted); }
.ws-num { font-variant-numeric: tabular-nums; }

/* focus: one rule everywhere */
:where(button, a, input, select, textarea, [tabindex]):focus-visible { outline: var(--focus-ring) solid var(--focus); outline-offset: 2px; }

/* Surfaces: depth comes from tone and shadow, not outlines */
.ws-surface { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-1); }

/* Button */
.ws-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--control-md); padding: 0 var(--space-4);
  border: 0; border-radius: var(--radius-sm); background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow-1);
  font: 600 14px/1 var(--ws-body); letter-spacing: 0; cursor: pointer; text-decoration: none; transition: background-color 120ms, filter 120ms; }
.ws-btn:hover { background: color-mix(in srgb, var(--surface-raised) 85%, var(--text)); }
.ws-btn--primary { background: var(--accent); color: var(--on-accent); }
.ws-btn--primary:hover { background: var(--accent); filter: brightness(1.08); }
.ws-btn--quiet { background: transparent; box-shadow: none; color: var(--text-soft); }
.ws-btn--quiet:hover { background: var(--surface-raised); color: var(--text); }
.ws-btn--danger { background: color-mix(in srgb, var(--bad) 12%, transparent); box-shadow: none; color: var(--bad); }
.ws-btn--danger:hover { background: color-mix(in srgb, var(--bad) 20%, transparent); }
.ws-btn--small { min-height: var(--control-sm); padding: 0 var(--space-3); font-size: 13px; }
.ws-btn[disabled], .ws-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; filter: none; }
@media (pointer: coarse) { .ws-btn, .ws-seg button, .ws-input, .ws-select { min-height: var(--control-touch); } }

/* SegmentedControl: a sunken track with a raised thumb */
.ws-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--ws-sunken); }
.ws-seg button { min-height: calc(var(--control-md) - 6px); padding: 0 var(--space-4); border: 0; border-radius: var(--radius-pill); background: transparent;
  color: var(--text-soft); cursor: pointer; font: 600 13px/1 var(--ws-body); }
.ws-seg button:hover { color: var(--text); }
.ws-seg button[aria-pressed="true"] { background: var(--selected); color: var(--on-selected); box-shadow: var(--shadow-1); }

/* Field: inputs keep a visible edge so they read as controls (3:1) */
.ws-field { display: grid; gap: 6px; max-width: 360px; }
.ws-field > label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.ws-input, .ws-select { min-height: var(--control-md); padding: 0 var(--space-3); border: var(--hairline) solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font: 400 15px/1.4 var(--ws-body); transition: border-color 120ms; }
.ws-input:hover, .ws-select:hover { border-color: var(--text-muted); }
.ws-input::placeholder { color: var(--text-muted); }
.ws-hint { font-size: 13px; color: var(--text-muted); }
.ws-field--error .ws-input { border-color: var(--bad); }
.ws-error { font-size: 13px; color: var(--bad); }
.ws-error::before { content: "! "; font-weight: 700; }

/* StatusPill: the status color as text on its own 12% tint, with a dot. The word carries the meaning. */
.ws-status { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 10px; border-radius: var(--radius-pill);
  font: 600 12px/1 var(--ws-body); letter-spacing: 0; white-space: nowrap; color: var(--text-soft); background: color-mix(in srgb, var(--text) 8%, transparent); }
.ws-status::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-dot); background: currentColor; }
.ws-status--good { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.ws-status--bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.ws-status--warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.ws-status--info { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); }
.ws-status--accent { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Card */
.ws-card { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-1); padding: var(--space-5); display: grid; gap: var(--space-3); }
.ws-card--action { cursor: pointer; text-decoration: none; color: inherit; transition: background-color 120ms, transform 120ms; }
.ws-card--action:hover { background: var(--surface-raised); }
.ws-card--accent { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), var(--shadow-1);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface)); }
.ws-card__head { display: flex; gap: var(--space-2); align-items: center; justify-content: space-between; }

/* Tile grid: separate soft tiles with a shared gap */
.ws-grid { display: grid; gap: var(--space-3); }
.ws-grid > * { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-1); }

/* StatTile */
.ws-stat { padding: var(--space-5); display: grid; gap: var(--space-2); align-content: start; }
.ws-stat__value { font: 700 40px/1 var(--ws-display); font-stretch: var(--ws-display-stretch); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.ws-stat__unit { font: 400 13px/1 var(--ws-body); color: var(--text-muted); margin-left: var(--space-1); letter-spacing: 0; }
.ws-meter { position: relative; height: 6px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--text) 10%, transparent); margin-top: var(--space-2); }
.ws-meter__fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--good); }
.ws-meter__fill--bad { background: var(--bad); }
.ws-meter__budget { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--text); }

/* Table */
.ws-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-1); overflow: hidden; font-size: 14px; }
.ws-table th { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: var(--hairline) solid var(--line);
  font: 600 12px/1.3 var(--ws-body); color: var(--text-muted); }
.ws-table td { padding: var(--space-3) var(--space-4); border-bottom: var(--hairline) solid color-mix(in srgb, var(--line) 60%, transparent); vertical-align: top; }
.ws-table tr:last-child td { border-bottom: 0; }
.ws-table tbody tr:hover td { background: color-mix(in srgb, var(--text) 3%, transparent); }
.ws-table .ws-r { text-align: right; font-variant-numeric: tabular-nums; }
.ws-up { color: var(--good); } .ws-down { color: var(--bad); }

/* Dialog */
.ws-scrim { background: var(--scrim); backdrop-filter: blur(6px); display: grid; place-items: center; padding: var(--space-5); }
.ws-dialog { width: min(480px, 100%); background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); overflow: hidden; }
.ws-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5) 0; }
.ws-dialog__body { padding: var(--space-5); display: grid; gap: var(--space-3); }
.ws-dialog__foot { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-4) var(--space-5); background: color-mix(in srgb, var(--bg) 35%, transparent); }
.ws-close { width: var(--control-sm); height: var(--control-sm); border: 0; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text-soft); cursor: pointer; font-size: 18px; line-height: 1; }
.ws-close:hover { background: color-mix(in srgb, var(--text) 14%, transparent); color: var(--text); }

/* Toast */
.ws-toast { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); background: var(--surface-raised);
  border-radius: var(--radius-md); box-shadow: var(--shadow-2); max-width: 420px; }
.ws-toast__mark { width: 8px; height: 8px; border-radius: var(--radius-dot); background: var(--good); flex: none; }
.ws-toast--bad .ws-toast__mark { background: var(--bad); }

/* StageStepper: a sunken track; the current stage is the raised accent segment */
.ws-steps { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 4px; border-radius: var(--radius-md); background: var(--ws-sunken); }
.ws-steps li { flex: 1 1 0; min-width: 96px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); display: grid; gap: 2px; color: var(--text-muted); }
.ws-steps .ws-step__name { font: 600 13px/1.3 var(--ws-body); }
.ws-steps .ws-step__note { font-size: 12px; }
.ws-steps li[data-state="done"] { color: var(--text-soft); }
.ws-steps li[data-state="done"] .ws-step__name::before { content: "✓ "; color: var(--good); }
.ws-steps li[aria-current="step"] { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-1); }

/* Verdict (a gate or a verify result) */
.ws-verdict { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-1); overflow: hidden; }
.ws-verdict__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.ws-verdict__head + * { border-top: var(--hairline) solid var(--line); }
.ws-checklist { list-style: none; margin: 0; padding: var(--space-3) var(--space-4); display: grid; gap: var(--space-2); }
.ws-checklist li { display: grid; grid-template-columns: 20px 1fr; gap: var(--space-2); align-items: start; }
.ws-check { font: 700 13px/1.5 var(--ws-mono); text-align: center; }
.ws-check--yes { color: var(--good); } .ws-check--no { color: var(--warn); } .ws-check--fail { color: var(--bad); }

/* EmptyState */
.ws-empty { display: grid; justify-items: start; gap: var(--space-2); padding: var(--space-6) var(--space-5); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 45%, transparent); }
.ws-empty p { margin: 0; max-width: var(--measure); color: var(--text-soft); }

/* BarChart (HTML bars; the drawing is the table) */
.ws-bars { display: grid; gap: var(--space-3); }
.ws-bar { display: grid; grid-template-columns: 112px 1fr 64px; gap: var(--space-3); align-items: center; font-size: 13px; }
.ws-bar__track { height: 10px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.ws-bar__fill { height: 100%; border-radius: var(--radius-pill); }
.ws-stack-bar { display: flex; height: 12px; gap: 2px; border-radius: var(--radius-pill); overflow: hidden; }
.ws-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); font-size: 12px; color: var(--text-soft); }
.ws-legend i { display: inline-block; width: 10px; height: 10px; border-radius: var(--radius-dot); margin-right: var(--space-1); vertical-align: -1px; }
