.ws-system-root {
  --ws-black: var(--black, #000);
  --ws-panel: var(--panel, #080808);
  --ws-panel-strong: var(--panel-strong, #101010);
  --ws-ink: var(--ink, #f3f1ec);
  --ws-muted: var(--muted, #969897);
  --ws-dim: var(--dim, #666a69);
  --ws-line: var(--line, rgba(243, 241, 236, 0.11));
  --ws-line-strong: var(--line-strong, rgba(243, 241, 236, 0.2));
  --ws-accent: var(--accent, #f3f1ec);
  --ws-accent-soft: var(--accent-soft, rgba(243, 241, 236, 0.12));
  --ws-sans: var(--sans, Inter, ui-sans-serif, system-ui, sans-serif);
  --ws-mono: var(--mono, "SFMono-Regular", "Cascadia Code", monospace);
  --ws-feedback: var(--motion-feedback, 160ms);
  --ws-surface: var(--motion-surface, 240ms);
  --ws-ease: var(--motion-ease-out, cubic-bezier(0.23, 1, 0.32, 1));
}

.ws-system-root :is(button, input, select, textarea) {
  font: inherit;
}

.ws-system-root :is(button, input, select, textarea):focus-visible {
  outline: 2px solid var(--ws-accent);
  outline-offset: 3px;
}

.ws-switcher,
.ws-system-surface {
  color: var(--ws-ink);
  font-family: var(--ws-sans);
  letter-spacing: 0;
}

.ws-switcher {
  position: absolute;
  z-index: 4;
  inset: 78px auto 0 0;
  display: none;
  width: 210px;
  flex-direction: column;
  padding: 14px 12px;
  background: var(--ws-black);
}

.ws-system-root:is(
  [data-surface="history"],
  [data-surface="permissions"],
  [data-surface="handoff"],
  [data-surface="generated"]
) .ws-switcher {
  display: flex;
}

.ws-switcher > p {
  margin: 0;
  padding: 12px 10px 16px;
  color: var(--ws-dim);
  font: 650 12px/1.2 var(--ws-mono);
  text-transform: uppercase;
}

.ws-switcher button {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 70px;
  border: 0;
  border-radius: 4px;
  padding: 15px 12px 15px 16px;
  background: transparent;
  color: var(--ws-muted);
  text-align: left;
  cursor: pointer;
  transition: background var(--ws-feedback) ease, color var(--ws-feedback) ease;
}

.ws-switcher button:hover {
  background: var(--ws-panel);
  color: var(--ws-ink);
}

.ws-switcher button.is-active {
  background: var(--ws-panel-strong);
  color: var(--ws-ink);
}

.ws-switcher button.is-active::after {
  position: absolute;
  inset: 14px auto 14px 0;
  width: 2px;
  background: var(--ws-ink);
  content: "";
}

.ws-switcher button span {
  font-size: 14px;
  font-weight: 650;
}

.ws-switcher button small {
  color: var(--ws-dim);
  font-size: 12px;
  line-height: 1.35;
}

.ws-switcher button.is-active small {
  color: var(--ws-muted);
}

.ws-storage-state {
  margin-top: auto;
  padding: 18px 10px 10px;
  color: var(--ws-muted);
  font: 600 12px/1.4 var(--ws-mono);
}

.ws-storage-state::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border: 1px solid var(--ws-muted);
  border-radius: 50%;
  background: transparent;
  content: "";
}

.ws-storage-state[data-available="false"]::before {
  background: var(--ws-dim);
}

.ws-system-surface {
  padding: 28px 36px 48px 246px;
  background: var(--ws-black);
  animation: ws-surface-enter var(--ws-surface) var(--ws-ease) both;
}

.ws-system-root[data-surface="history"] [data-surface-view="history"],
.ws-system-root[data-surface="permissions"] [data-surface-view="permissions"],
.ws-system-root[data-surface="handoff"] [data-surface-view="handoff"],
.ws-system-root[data-surface="generated"] [data-surface-view="generated"] {
  display: block;
}

.ws-system-surface > * {
  width: 100%;
  max-width: 1760px;
  margin-right: auto;
}

.ws-surface-heading {
  min-height: 86px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 24px;
}

.ws-surface-heading p,
.ws-generated-brief > span,
.ws-history-detail > p:first-child,
.ws-permission-explainer > p:first-child,
.ws-task-label > span,
.ws-device-node > span {
  margin: 0;
  color: var(--ws-muted);
  font: 650 12px/1.3 var(--ws-mono);
  text-transform: uppercase;
}

.ws-surface-heading h2 {
  margin: 8px 0 0;
  max-width: 760px;
  font-size: 32px;
  line-height: 1.08;
  font-weight: 620;
  text-wrap: balance;
}

.ws-surface-heading > span {
  flex: 0 0 auto;
  padding-top: 4px;
  color: var(--ws-muted);
  font: 600 12px/1.3 var(--ws-mono);
}

.ws-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.ws-section-heading h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 650;
}

.ws-section-heading p {
  max-width: 58ch;
  margin: 0;
  color: var(--ws-muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.ws-primary,
.ws-history-actions button,
.ws-handoff-actions button,
.ws-generated-inputs > button {
  min-height: 42px;
  border: 1px solid var(--ws-line-strong);
  border-radius: 4px;
  padding: 0 16px;
  background: transparent;
  color: var(--ws-ink);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color var(--ws-feedback) ease, background var(--ws-feedback) ease, color var(--ws-feedback) ease;
}

.ws-primary {
  border-color: var(--ws-ink);
  background: var(--ws-ink);
  color: var(--ws-black);
}

:is(.ws-primary, .ws-history-actions button, .ws-handoff-actions button, .ws-generated-inputs > button):hover:not(:disabled) {
  border-color: var(--ws-ink);
}

.ws-primary:hover:not(:disabled) {
  background: var(--ws-ink);
}

:is(.ws-primary, .ws-history-actions button, .ws-handoff-actions button):disabled {
  border-color: var(--ws-line);
  background: var(--ws-panel);
  color: var(--ws-dim);
  cursor: not-allowed;
}

/* History */
.ws-history-layout {
  min-height: calc(100% - 112px);
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(440px, 1.18fr);
  gap: 34px;
}

.ws-history-layout[data-empty="true"] {
  grid-template-columns: minmax(0, 1fr);
}

.ws-history-layout[data-empty="true"] .ws-history-list {
  align-content: center;
  justify-items: center;
  min-height: min(620px, calc(100dvh - 260px));
  padding: 36px 0 120px;
}

.ws-history-layout[data-empty="true"] .ws-history-detail {
  display: none;
}

.ws-history-list {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 0 80px;
}

.ws-history-row {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 102px;
  border: 0;
  border-radius: 4px;
  padding: 18px;
  background: transparent;
  color: var(--ws-ink);
  text-align: left;
  cursor: pointer;
  transition: background var(--ws-feedback) ease;
}

.ws-history-row:hover,
.ws-history-row.is-selected {
  background: var(--ws-panel-strong);
}

.ws-history-row.is-selected::after {
  position: absolute;
  inset: 16px auto 16px 0;
  width: 2px;
  background: var(--ws-ink);
  content: "";
}

.ws-history-row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ws-history-row-heading strong {
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 640;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-history-row-heading i {
  flex: 0 0 auto;
  color: var(--ws-muted);
  font: 600 12px/1 var(--ws-mono);
  font-style: normal;
}

.ws-history-row > span,
.ws-history-row time {
  color: var(--ws-muted);
  font: 550 12px/1.35 var(--ws-mono);
  text-transform: capitalize;
}

.ws-history-detail {
  min-width: 0;
  padding: 28px 0 80px;
}

.ws-history-detail h3 {
  margin: 9px 0 14px;
  font-size: 27px;
  line-height: 1.15;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.ws-history-prompt {
  max-width: 70ch;
  margin: 0 0 24px;
  color: var(--ws-muted);
  font-size: 14px;
  line-height: 1.55;
}

.ws-history-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  gap: 8px;
}

.ws-history-facts div {
  min-width: 0;
  border-radius: 4px;
  padding: 15px;
  background: var(--ws-panel);
}

.ws-history-facts dt,
.ws-history-section h4 {
  color: var(--ws-dim);
  font: 650 12px/1.3 var(--ws-mono);
  text-transform: uppercase;
}

.ws-history-facts dd {
  margin: 7px 0 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-history-section {
  margin-top: 25px;
}

.ws-history-section h4 {
  margin: 0 0 10px;
}

.ws-history-section ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ws-history-section li {
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 0.65fr);
  gap: 18px;
  border-radius: 4px;
  padding: 12px 14px;
  background: var(--ws-panel);
}

.ws-history-section li strong,
.ws-history-section li span {
  font-size: 13px;
  line-height: 1.45;
}

.ws-history-section li strong {
  font-weight: 620;
}

.ws-history-section li span {
  color: var(--ws-muted);
  white-space: pre-wrap;
}

.ws-history-actions,
.ws-handoff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.ws-handoff-actions {
  grid-area: actions;
  align-self: start;
}

.ws-history-actions .ws-danger {
  color: #ff8b8b;
}

.ws-empty {
  width: min(760px, 100%);
  min-height: 380px;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 46px clamp(0px, 3vw, 46px);
  border-top: 1px solid var(--ws-line-strong);
  border-bottom: 1px solid var(--ws-line-strong);
}

.ws-empty-kicker {
  margin-bottom: 16px;
  color: var(--ws-muted);
  font: 650 12px/1.2 var(--ws-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ws-empty h3 {
  max-width: 14ch;
  margin: 0 0 16px;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.04;
  font-weight: 620;
}

.ws-empty p {
  max-width: 58ch;
  margin: 0 0 30px;
  color: var(--ws-muted);
  font-size: 15px;
  line-height: 1.58;
}

.ws-empty-preview {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 30px;
  border-top: 1px solid var(--ws-line);
  border-bottom: 1px solid var(--ws-line);
}

.ws-empty-preview div { min-width: 0; padding: 16px 20px 16px 0; }
.ws-empty-preview dt { color: var(--ws-dim); font: 600 12px/1.2 var(--ws-mono); text-transform: uppercase; }
.ws-empty-preview dd { margin: 7px 0 0; color: var(--ws-ink); font-size: 14px; }

/* Permissions */
.ws-permissions-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1.4fr) minmax(300px, 0.6fr);
  gap: 0 34px;
  padding-top: 26px;
}

.ws-permission-list {
  border-top: 1px solid var(--ws-line-strong);
}

.ws-permission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  min-height: 88px;
  border-bottom: 1px solid var(--ws-line);
  padding: 13px 12px;
  transition: background var(--ws-feedback) ease;
}

.ws-permission-row.is-selected {
  background: var(--ws-panel);
}

.ws-permission-copy {
  display: grid;
  align-content: center;
  gap: 6px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ws-ink);
  text-align: left;
  cursor: pointer;
}

.ws-permission-copy strong {
  font-size: 15px;
  font-weight: 650;
}

.ws-permission-copy span {
  max-width: 67ch;
  color: var(--ws-muted);
  font-size: 13px;
  line-height: 1.4;
}

.ws-permission-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ws-permission-controls select {
  width: 172px;
  min-height: 38px;
  border: 1px solid var(--ws-line-strong);
  border-radius: 4px;
  padding: 0 30px 0 10px;
  background: var(--ws-panel-strong);
  color: var(--ws-ink);
  font-size: 12px;
}

.ws-switch {
  min-width: 54px;
  min-height: 38px;
  border: 1px solid var(--ws-line-strong);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--ws-panel);
  color: var(--ws-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.ws-switch[aria-checked="true"] {
  border-color: var(--ws-accent);
  background: var(--ws-accent-soft);
  color: var(--ws-accent);
}

.ws-permission-explainer {
  align-self: start;
  border-top: 1px solid var(--ws-line-strong);
  border-bottom: 1px solid var(--ws-line);
  padding: 22px 0 24px;
}

.ws-permission-explainer h3 {
  margin: 9px 0 16px;
  font-size: 25px;
  font-weight: 620;
}

.ws-permission-explainer > strong {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--ws-muted);
  font: 650 12px/1.3 var(--ws-mono);
}

.ws-permission-explainer > strong.is-on {
  color: var(--ws-accent);
}

.ws-permission-explainer > p:not(:first-child) {
  margin: 0 0 14px;
  color: var(--ws-muted);
  font-size: 14px;
  line-height: 1.55;
}

.ws-honesty {
  max-width: 72ch;
  color: var(--ws-muted);
  font-size: 13px;
  line-height: 1.5;
}

.ws-keep-generated {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--ws-ink);
  font-size: 13px;
}

.ws-keep-generated input {
  width: 16px;
  height: 16px;
  accent-color: var(--ws-accent);
  cursor: pointer;
}

.ws-matrix {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 34px;
  padding-bottom: 60px;
}

.ws-matrix-scroll {
  max-width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--ws-line-strong);
}

.ws-matrix table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.ws-matrix th,
.ws-matrix td {
  height: 54px;
  border-bottom: 1px solid var(--ws-line);
  padding: 9px 13px;
  font-size: 13px;
  text-align: center;
}

.ws-matrix thead th {
  color: var(--ws-muted);
  font: 600 12px/1.2 var(--ws-mono);
}

.ws-matrix th:first-child {
  width: 230px;
  text-align: left;
}

.ws-matrix tbody th {
  font-weight: 620;
}

.ws-matrix input,
.ws-generated-actions input {
  width: 18px;
  height: 18px;
  accent-color: var(--ws-accent);
  cursor: pointer;
}

/* Handoff */
.ws-handoff-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1.35fr) minmax(280px, 0.65fr);
  grid-template-areas:
    "stage picker"
    "actions picker"
    "walkthrough walkthrough";
  gap: 0 38px;
  padding-top: 28px;
}

.ws-handoff-stage {
  grid-area: stage;
  min-width: 0;
  border-bottom: 1px solid var(--ws-line);
  padding-bottom: 26px;
}

.ws-task-label h3 {
  margin: 8px 0 30px;
  font-size: 27px;
  line-height: 1.16;
  font-weight: 620;
}

.ws-device-route {
  display: grid;
  grid-template-columns: minmax(170px, 0.35fr) minmax(160px, 0.3fr) minmax(170px, 0.35fr);
  align-items: center;
  gap: 18px;
}

.ws-device-node {
  min-height: 126px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--ws-line-strong);
  border-radius: 6px;
  padding: 20px;
  background: var(--ws-panel);
}

.ws-device-node strong {
  font-size: 22px;
  font-weight: 620;
}

.ws-device-node small {
  color: var(--ws-muted);
  font-size: 12px;
  line-height: 1.4;
}

.ws-transfer-track {
  position: relative;
  height: 24px;
}

.ws-transfer-track i {
  position: absolute;
  inset: 11px 0 auto;
  height: 2px;
  background: var(--ws-line-strong);
  transform-origin: left center;
}

.ws-transfer-track b {
  position: absolute;
  top: 5px;
  left: 0;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ws-black);
  background: var(--ws-accent);
  opacity: 0;
}

.ws-device-route[data-phase="sending"] .ws-transfer-track i,
.ws-device-route[data-phase="complete"] .ws-transfer-track i {
  background: var(--ws-accent);
}

.ws-device-route[data-phase="sending"] .ws-transfer-track b {
  opacity: 1;
  animation: ws-transfer 1.4s var(--ws-ease) both;
}

.ws-device-route[data-phase="complete"] .ws-transfer-track b {
  left: calc(100% - 14px);
  opacity: 1;
}

.ws-device-picker {
  grid-area: picker;
  border-top: 1px solid var(--ws-line-strong);
  padding-top: 17px;
}

.ws-device-picker [data-device-list] {
  border-top: 1px solid var(--ws-line);
}

.ws-device-option {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 86px;
  border: 0;
  border-bottom: 1px solid var(--ws-line);
  padding: 14px 12px;
  background: transparent;
  color: var(--ws-ink);
  text-align: left;
  cursor: pointer;
}

.ws-device-option:hover:not(:disabled),
.ws-device-option.is-selected {
  background: var(--ws-panel);
}

.ws-device-option.is-selected strong {
  color: var(--ws-accent);
}

.ws-device-option:disabled {
  color: var(--ws-dim);
  cursor: not-allowed;
}

.ws-device-option strong {
  font-size: 15px;
  font-weight: 650;
}

.ws-device-option span,
.ws-device-option small {
  color: var(--ws-muted);
  font-size: 12px;
  line-height: 1.35;
}

.ws-handoff-walkthrough {
  grid-area: walkthrough;
  margin-top: 34px;
  padding-bottom: 60px;
}

.ws-handoff-walkthrough ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ws-line-strong);
  list-style: none;
}

.ws-handoff-walkthrough li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  min-height: 130px;
  border-right: 1px solid var(--ws-line);
  border-bottom: 1px solid var(--ws-line);
  padding: 18px;
}

.ws-handoff-walkthrough li:last-child {
  border-right: 0;
}

.ws-handoff-walkthrough li > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--ws-line-strong);
  color: var(--ws-muted);
  font: 650 12px/1 var(--ws-mono);
}

.ws-handoff-walkthrough li strong {
  font-size: 14px;
}

.ws-handoff-walkthrough li p {
  margin: 7px 0 0;
  color: var(--ws-muted);
  font-size: 13px;
  line-height: 1.45;
}

.ws-handoff-walkthrough li em {
  grid-column: 2;
  color: var(--ws-dim);
  font: 600 12px/1.2 var(--ws-mono);
  font-style: normal;
}

.ws-handoff-walkthrough li[data-state="active"] > span,
.ws-handoff-walkthrough li[data-state="done"] > span {
  border-color: var(--ws-accent);
  color: var(--ws-accent);
}

.ws-handoff-walkthrough li[data-state="active"] em,
.ws-handoff-walkthrough li[data-state="done"] em {
  color: var(--ws-accent);
}

/* Generated workspace */
.ws-prompt-form {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--ws-line-strong);
}

.ws-prompt-form > label {
  color: var(--ws-muted);
  font: 650 12px/1.3 var(--ws-mono);
  text-transform: uppercase;
}

.ws-prompt-form > div {
  display: flex;
  gap: 10px;
}

.ws-prompt-form input {
  min-width: 0;
  flex: 1 1 auto;
  min-height: 44px;
  border: 1px solid var(--ws-line-strong);
  border-radius: 4px;
  padding: 0 14px;
  background: var(--ws-panel);
  color: var(--ws-ink);
  font-size: 14px;
}

.ws-prompt-form input::placeholder,
.ws-generated-inputs input::placeholder {
  color: var(--ws-muted);
  opacity: 1;
}

.ws-generated-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(480px, 1.28fr);
  grid-template-areas:
    "brief primitives"
    "inputs output"
    "actions trace";
  gap: 0 34px;
  padding-bottom: 70px;
}

.ws-generated-layout[hidden] {
  display: none;
}

.ws-generated-brief {
  grid-area: brief;
  padding: 28px 0;
}

.ws-generated-brief > span {
  color: var(--ws-accent);
}

.ws-generated-brief h3 {
  margin: 10px 0 12px;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 620;
}

.ws-generated-brief > p {
  max-width: 62ch;
  margin: 0;
  color: var(--ws-muted);
  font-size: 14px;
  line-height: 1.55;
}

.ws-generated-brief dl {
  margin: 24px 0 0;
  border-top: 1px solid var(--ws-line);
}

.ws-generated-brief dl div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid var(--ws-line);
  padding: 10px 0;
}

.ws-generated-brief dt,
.ws-generated-brief dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.ws-generated-brief dt {
  color: var(--ws-dim);
  font-family: var(--ws-mono);
}

.ws-generated-brief dd {
  color: var(--ws-muted);
  overflow-wrap: anywhere;
}

.ws-primitives {
  grid-area: primitives;
  padding: 28px 0;
}

.ws-primitives ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ws-line-strong);
  list-style: none;
}

.ws-primitives li {
  position: relative;
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 8px;
  border-right: 1px solid var(--ws-line);
  border-bottom: 1px solid var(--ws-line);
  padding: 16px;
  overflow: hidden;
}

.ws-primitives li:last-child {
  border-right: 0;
}

.ws-primitives li::after {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: var(--ws-accent);
  content: "";
  transform: scaleX(0);
  transform-origin: left center;
}

.ws-primitives li[data-state="shaping"]::after {
  animation: ws-shaping 700ms var(--ws-ease) infinite;
}

.ws-primitives li[data-state="ready"]::after {
  transform: scaleX(1);
  transition: transform var(--ws-surface) var(--ws-ease);
}

.ws-primitives li > span,
.ws-primitives li em {
  color: var(--ws-dim);
  font: 600 12px/1.2 var(--ws-mono);
  font-style: normal;
}

.ws-primitives li strong {
  font-size: 14px;
  font-weight: 640;
}

.ws-primitives li[data-state="ready"] em {
  color: var(--ws-accent);
}

.ws-generated-inputs,
.ws-generated-output,
.ws-generated-actions,
.ws-generated-trace {
  border-top: 1px solid var(--ws-line-strong);
  padding: 22px 0 30px;
}

.ws-generated-inputs { grid-area: inputs; }
.ws-generated-output { grid-area: output; }
.ws-generated-actions { grid-area: actions; }
.ws-generated-trace { grid-area: trace; }

.ws-generated-inputs [data-generated-inputs] {
  display: grid;
  gap: 10px;
}

.ws-generated-inputs label {
  display: grid;
  grid-template-columns: minmax(120px, 0.36fr) minmax(0, 0.64fr);
  align-items: center;
  gap: 14px;
}

.ws-generated-inputs label > span {
  color: var(--ws-muted);
  font-size: 13px;
}

.ws-generated-inputs input {
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--ws-line-strong);
  padding: 0 4px;
  background: transparent;
  color: var(--ws-ink);
  font-size: 13px;
}

.ws-generated-inputs > button {
  margin-top: 15px;
}

.ws-generated-output textarea {
  display: block;
  width: 100%;
  min-height: 250px;
  resize: vertical;
  border: 1px solid var(--ws-line-strong);
  border-radius: 4px;
  padding: 16px;
  background: var(--ws-panel);
  color: var(--ws-ink);
  font: 500 13px/1.6 var(--ws-mono);
}

.ws-generated-output .ws-primary {
  margin-top: 12px;
}

.ws-generated-actions [data-generated-actions] {
  border-top: 1px solid var(--ws-line);
}

.ws-generated-actions label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 61px;
  border-bottom: 1px solid var(--ws-line);
  padding: 12px 4px;
}

.ws-generated-actions label > span {
  display: grid;
  gap: 4px;
}

.ws-generated-actions strong {
  font-size: 13px;
  font-weight: 620;
}

.ws-generated-actions small {
  color: var(--ws-muted);
  font-size: 12px;
}

.ws-generated-trace ol {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ws-line);
  list-style: none;
}

.ws-generated-trace li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  min-height: 48px;
  border-bottom: 1px solid var(--ws-line);
  padding: 13px 3px;
}

.ws-generated-trace li strong,
.ws-generated-trace li span {
  font-size: 13px;
  line-height: 1.35;
}

.ws-generated-trace li strong {
  font-weight: 610;
}

.ws-generated-trace li span {
  color: var(--ws-muted);
  text-align: right;
}

.ws-generated-trace li[data-state="done"] span,
.ws-generated-trace li[data-state="active"] span {
  color: var(--ws-accent);
}

@keyframes ws-transfer {
  from { left: 0; }
  to { left: calc(100% - 14px); }
}

@keyframes ws-shaping {
  0% { transform: scaleX(0); transform-origin: left center; }
  55% { transform: scaleX(1); transform-origin: left center; }
  56% { transform-origin: right center; }
  100% { transform: scaleX(0); transform-origin: right center; }
}

@keyframes ws-surface-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (min-width: 1800px) {
  .ws-switcher { width: 236px; }
  .ws-system-surface { padding-left: 276px; padding-right: 54px; }
  .ws-surface-heading h2 { font-size: 34px; }
  .ws-history-layout { grid-template-columns: minmax(420px, 0.76fr) minmax(620px, 1.24fr); }
  .ws-generated-layout { grid-template-columns: minmax(420px, 0.7fr) minmax(680px, 1.3fr); }
}

@media (max-width: 1120px) {
  .ws-switcher { width: 178px; }
  .ws-switcher button { padding-left: 18px; padding-right: 18px; }
  .ws-system-surface { padding-left: 208px; padding-right: 28px; }
  .ws-history-layout,
  .ws-permissions-layout,
  .ws-handoff-layout,
  .ws-generated-layout {
    grid-template-columns: 1fr;
  }
  .ws-history-list { padding-right: 0; padding-bottom: 20px; }
  .ws-history-detail { padding-left: 0; }
  .ws-permission-explainer { margin-top: 28px; }
  .ws-matrix { grid-column: auto; }
  .ws-handoff-layout {
    grid-template-areas: "stage" "picker" "actions" "walkthrough";
  }
  .ws-device-picker { margin-top: 28px; }
  .ws-generated-layout { grid-template-areas: "brief" "primitives" "inputs" "output" "actions" "trace"; }
  .ws-primitives { border-top: 1px solid var(--ws-line-strong); }
}

@media (max-width: 760px) {
  .ws-switcher {
    position: sticky;
    inset: auto;
    top: 68px;
    z-index: 4;
    width: 100%;
    min-height: 63px;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    gap: 6px;
    padding: 8px 12px;
    scrollbar-width: none;
  }
  .ws-switcher::-webkit-scrollbar { display: none; }
  .ws-switcher > p,
  .ws-storage-state { display: none; }
  .ws-switcher button {
    flex: 1 0 104px;
    min-height: 62px;
    border-top: 0;
    border-radius: 4px;
    padding: 11px 13px;
  }
  .ws-switcher button:last-of-type { border-right: 0; border-bottom: 0; }
  .ws-switcher button.is-active::after { inset: auto 12px 0; width: auto; height: 2px; }
  .ws-switcher button small { display: none; }
  .ws-system-surface {
    min-height: calc(100dvh - 185px);
    padding: 22px 20px 72px;
  }
  .ws-surface-heading {
    min-height: 74px;
    gap: 16px;
    padding-bottom: 18px;
  }
  .ws-surface-heading h2 { font-size: 25px; }
  .ws-surface-heading > span { max-width: 106px; text-align: right; }
  .ws-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .ws-section-heading p { text-align: left; }
  .ws-history-facts { grid-template-columns: 1fr; }
  .ws-empty-preview { grid-template-columns: 1fr; }
  .ws-empty-preview div + div { border-top: 1px solid var(--ws-line); }
  .ws-history-section li { grid-template-columns: 1fr; gap: 5px; }
  .ws-permission-row { grid-template-columns: 1fr; gap: 12px; padding: 15px 8px; }
  .ws-permission-controls { justify-content: space-between; }
  .ws-permission-controls select { min-width: 0; width: min(210px, calc(100vw - 126px)); }
  .ws-device-route { grid-template-columns: 1fr; }
  .ws-transfer-track { width: 24px; height: 60px; justify-self: center; }
  .ws-transfer-track i { inset: 0 auto 0 11px; width: 2px; height: auto; }
  .ws-transfer-track b { top: 0; left: 5px; }
  .ws-device-route[data-phase="sending"] .ws-transfer-track b { animation: ws-transfer-mobile 1.4s var(--ws-ease) both; }
  .ws-device-route[data-phase="complete"] .ws-transfer-track b { top: calc(100% - 14px); left: 5px; }
  .ws-handoff-walkthrough ol { grid-template-columns: 1fr; }
  .ws-handoff-walkthrough li { min-height: 110px; border-right: 0; }
  .ws-prompt-form { grid-template-columns: 1fr; gap: 8px; }
  .ws-prompt-form > div { flex-direction: column; }
  .ws-prompt-form .ws-primary { width: 100%; }
  .ws-primitives ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-primitives li:nth-child(2) { border-right: 0; }
  .ws-generated-inputs label { grid-template-columns: 1fr; gap: 5px; }
  .ws-generated-output textarea { min-height: 300px; }
}

@media (max-width: 420px) {
  .ws-system-surface { padding-left: 16px; padding-right: 16px; }
  .ws-surface-heading h2 { font-size: 22px; }
  .ws-surface-heading > span { font-size: 12px; }
  .ws-history-detail h3,
  .ws-task-label h3,
  .ws-generated-brief h3,
  .ws-permission-explainer h3 { font-size: 23px; }
  .ws-history-actions,
  .ws-handoff-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .ws-history-actions .ws-primary { grid-column: 1 / -1; }
  .ws-handoff-actions .ws-primary { grid-column: 1 / -1; }
  .ws-primitives li { min-height: 104px; padding: 13px; }
}

@keyframes ws-transfer-mobile {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ws-system-root *,
  .ws-system-root *::before,
  .ws-system-root *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
