/* Digital Desk wears the Digital Lab's own look: /field-study/theme.css (loaded first) owns every colour, the type,
   the stickers and the dark/light roles. The names below are Desk's older ones, kept as aliases of the Lab's roles
   so the layout rules read them; no colour is named in this file. */
:root {
  --panel-alt: var(--bg);
  --border: var(--divider);
  --border-strong: var(--control-edge);
  --primary: var(--text);
  --primary-bright: var(--text);
  --primary-dim: color-mix(in srgb, var(--text) 12%, transparent);
  --magenta: var(--danger);
  --sub: var(--text);
  --muted: var(--text-dim);
  --font: var(--display);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  background: var(--primary-bright);
  color: var(--bg);
  font-weight: 750;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-bar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(20px, calc((100vw - 1040px) / 2));
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand > span:last-child {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand small {
  color: var(--primary-bright);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--control-edge);
  background: var(--surface);
  color: var(--primary-bright);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link[aria-current="page"] {
  color: var(--text);
}

.nav-link--connect {
  border: 1px solid var(--border-strong);
  color: var(--primary-bright);
}

.identity-action,
.text-action {
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--primary-bright);
  font-size: 12px;
  font-weight: 680;
}

.identity-action {
  min-height: 32px;
  padding: 0 2px 0 8px;
}

.identity-panel {
  position: fixed;
  z-index: 50;
  top: 68px;
  right: max(18px, calc((100vw - 1040px) / 2));
  width: min(380px, calc(100vw - 28px));
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--pop-lg) var(--pop-lg) 0 var(--edge);
}

.identity-panel__inner {
  padding: 18px;
}

.identity-panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.identity-panel h2 {
  margin: 3px 0 3px;
  font-size: 19px;
}

.identity-panel__heading p:last-child {
  max-width: 280px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.identity-close {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.identity-close:hover,
.identity-close:focus-visible {
  border-color: var(--primary);
  color: var(--primary-bright);
}

.gate-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.identity-form {
  display: grid;
  gap: 11px;
}

.identity-form label,
.gate-form label,
.capability-choice {
  display: grid;
  gap: 6px;
  color: var(--sub);
  font-size: 11px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  outline: 0;
  background: var(--bg);
  color: var(--text);
  padding: 9px 11px;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-dim);
}

.identity-form__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.primary-action--compact {
  min-width: 106px;
  min-height: 40px;
  padding: 8px 14px;
}

main {
  width: min(100% - 40px, 1040px);
  min-height: calc(100vh - 170px);
  margin: 0 auto;
}

.visually-hidden {
  position: absolute !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.view {
  padding: clamp(56px, 9vw, 116px) 0 64px;
}

.view--home {
  display: grid;
  min-height: calc(100dvh - 58px);
  place-items: center;
  padding: 42px 0 82px;
}

.hero {
  width: min(100%, 720px);
  margin: 0 auto;
  text-align: center;
}

.hero-wordmark {
  display: inline-flex;
  max-width: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0;
  color: var(--text);
  font-size: clamp(38px, 7vw, 58px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.hero-wordmark__mark {
  display: grid;
  width: 1.08em;
  height: 1.08em;
  place-items: center;
  border: 1px solid var(--control-edge);
  background: var(--surface);
  color: var(--primary-bright);
  box-shadow: 0 0 38px color-mix(in srgb, var(--primary) 16%, transparent);
}

.hero-wordmark__mark svg {
  width: 0.88em;
  height: 0.88em;
}

.hero-wordmark__name {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22em;
}

.hero-wordmark__name strong {
  font-weight: 780;
}

.hero-wordmark__name small {
  color: var(--primary-bright);
  font-family: var(--mono);
  font-size: 0.34em;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero-tagline {
  margin: 13px 0 0;
  color: var(--sub);
  font-size: clamp(15px, 2vw, 17px);
}

.home-resume {
  width: min(100%, 620px);
  margin: 18px auto 0;
  text-align: left;
}

.home-resume p {
  margin: 0 14px 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-work-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-work-list li {
  border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}

.home-work-list li:last-child {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}

.home-work-list a {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
}

.home-work-list a:hover,
.home-work-list a:focus-visible {
  background: color-mix(in srgb, var(--panel) 78%, transparent);
}

.home-work-list a > span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.home-work-list strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-work-list small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.home-work-list__arrow {
  flex: 0 0 auto;
  color: var(--primary-bright);
}

.eyebrow,
.section-kicker,
.field-label {
  margin: 0;
  color: var(--primary-bright);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.eyebrow span {
  color: var(--text-dim);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 840px;
  margin-bottom: 16px;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 0.98;
  letter-spacing: -0.052em;
}

.hero-copy,
.view-copy {
  max-width: 770px;
  margin-bottom: 34px;
  color: var(--sub);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
}

.idea-form {
  width: min(100%, 620px);
  margin: 28px auto 0;
}

.idea-control {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: var(--pop) var(--pop) 0 var(--edge);
}

.idea-control:focus-within {
  border-color: var(--primary);
  box-shadow: calc(var(--pop) + 1px) calc(var(--pop) + 1px) 0 var(--edge);
}

.idea-control input {
  min-width: 0;
  min-height: 54px;
  flex: 1 1 auto;
  border: 0;
  border-radius: 999px 0 0 999px;
  outline: 0;
  background: transparent;
  padding: 0 20px;
  color: var(--text);
  font-size: 16px;
}

.idea-search-action {
  min-width: 76px;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--primary-bright);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.idea-search-action:hover {
  background: var(--primary-dim);
  outline: 0;
}

.idea-search-action:focus-visible {
  background: var(--primary-bright);
  box-shadow: inset 0 0 0 2px var(--edge);
  color: var(--bg);
  outline: 0;
}

.idea-control input:focus {
  box-shadow: none;
}

.idea-control input::placeholder {
  color: var(--muted);
  opacity: 0.82;
}

textarea {
  min-height: 118px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 19px 20px;
  font-size: 16px;
  line-height: 1.55;
}

textarea::placeholder {
  color: var(--muted);
  opacity: 0.78;
}

.primary-action,
.secondary-action {
  cursor: pointer;
  border: 0;
  border-radius: 0;
  font-weight: 760;
}

.primary-action {
  display: flex;
  min-width: 178px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 20px;
  background: var(--primary-bright);
  color: var(--bg);
}

.idea-control .primary-action {
  min-width: 112px;
  min-height: 54px;
  border-radius: 999px;
  padding: 0 22px;
  transition: background-color 120ms ease, box-shadow 120ms ease, color 120ms ease, transform 120ms ease;
}

.idea-control .primary-action:focus-visible {
  background: var(--text);
  box-shadow: inset 0 0 0 3px var(--primary-bright);
  color: var(--bg);
  outline: 0;
}

.idea-control .primary-action[data-keyboard-pressed="true"] {
  background: var(--text);
  box-shadow: inset 0 0 0 3px var(--primary-bright);
  color: var(--bg);
  filter: brightness(1.08);
  transform: scale(0.96);
}

.primary-action:hover {
  filter: brightness(1.08);
}

.primary-action:focus-visible,
.secondary-action:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-bright);
  outline-offset: 3px;
}

.idea-meta {
  min-height: 22px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.idea-meta p {
  margin-bottom: 0;
}

.form-status {
  color: var(--text);
  text-align: center;
}

.today {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body[data-route="home"] footer {
  display: none;
}

.is-file-preview .app-bar nav {
  display: none;
}

.form-status--left {
  margin: 0;
  text-align: left;
}

.section-heading {
  display: flex;
  min-height: 42px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-heading--compact {
  min-height: auto;
}

.section-kicker {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9px;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
  letter-spacing: -0.012em;
}

.source-state {
  padding-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 11px;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.case-stage {
  color: var(--primary-bright);
  text-transform: uppercase;
}

.view--connect,
.view--new-case,
.view--case {
  max-width: 850px;
}

.connection-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  margin-top: 36px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
}

.connection-block > div {
  display: grid;
  gap: 7px;
  padding: 16px 18px;
}

.connection-block code {
  overflow: hidden;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-action {
  min-width: 124px;
  padding: 12px 18px;
  border-left: 1px solid var(--border-strong);
  background: var(--primary-dim);
  color: var(--primary-bright);
}

.connection-note {
  margin: 10px 0 32px;
  color: var(--muted);
  font-size: 12px;
}

.connection-setup {
  margin-top: 34px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.provider-list,
.token-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.provider-list li,
.token-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  padding: 13px 15px;
}

.provider-list strong,
.token-list strong {
  display: block;
  font-size: 13px;
}

.provider-list small,
.token-list small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.provider-state {
  color: var(--primary-bright);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
  text-transform: uppercase;
}

.credential-setup {
  margin-top: 28px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  padding: 20px;
}

.credential-setup h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.credential-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(230px, 1.25fr) minmax(140px, 0.65fr) auto;
  align-items: end;
  gap: 14px;
}

.credential-form > label,
.credential-form fieldset {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--sub);
  font-size: 11px;
  font-weight: 700;
}

.credential-form fieldset {
  min-height: 66px;
  border: 1px solid var(--border);
  padding: 8px 10px;
}

.credential-form fieldset label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}

.credential-form input[type="checkbox"] {
  width: 14px;
  min-height: 14px;
}

.credential-once {
  margin-top: 18px;
  border: 1px solid var(--primary);
  background: var(--bg);
}

.credential-once pre {
  overflow: auto;
  margin: 0;
  padding: 14px;
  color: var(--primary-bright);
  font-family: var(--mono);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-all;
}

.credential-history {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.token-list button {
  white-space: nowrap;
}

.back-link {
  display: inline-block;
  margin-top: 30px;
  color: var(--primary-bright);
  font-size: 13px;
  font-weight: 680;
  text-decoration: none;
}

.case-frame-form {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

.case-frame-form label {
  display: grid;
  gap: 7px;
  color: var(--sub);
  font-size: 11px;
  font-weight: 700;
}

.case-frame-form input,
.case-frame-form textarea {
  border: 1px solid var(--border-strong);
  background: var(--panel);
}

.case-frame-form textarea {
  min-height: 132px;
  padding: 13px 14px;
}

.next-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.next-step__active {
  color: var(--primary-bright);
}

.case-view-card {
  margin-top: 30px;
  padding: 22px 24px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--primary-bright);
  background: var(--panel);
}

.case-view-card h1 {
  margin-bottom: 14px;
  font-size: clamp(28px, 5vw, 48px);
}

.case-view-card p {
  color: var(--sub);
}

.workflow-action {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
}

.case-frame-form .workflow-action {
  margin-top: 2px;
}

.workflow-action .connection-note {
  margin: 0;
}

.gate-panel,
.run-panel,
.agent-trace-panel,
.proposals-panel,
.gate-b-panel,
.finalize-panel {
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
}

.gate-panel h2,
.run-panel h2,
.agent-trace-panel h2,
.proposals-panel h2,
.gate-b-panel h2,
.finalize-panel h2 {
  margin-top: 3px;
  font-size: 22px;
}

.proposal-list,
.signed-set,
.event-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.proposal-list li,
.signed-set li,
.event-list li {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 12px 14px;
}

.proposal-list li[data-status="accepted"] {
  border-color: var(--text-dim);
}

.proposal-list li[data-status="rejected"],
.proposal-list li[data-status="invalidated"] {
  border-color: var(--border);
  opacity: 0.78;
}

.proposal-item__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.proposal-item__heading strong {
  color: var(--text);
}

.proposal-item__state {
  border: 1px solid var(--border-strong);
  color: var(--sub);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 4px 7px;
  text-transform: uppercase;
  white-space: nowrap;
}

.proposal-list li[data-status="accepted"] .proposal-item__state {
  border-color: var(--text-dim);
  color: var(--text-dim);
}

.proposal-list li[data-status="pending"] .proposal-item__state {
  border-color: var(--primary-bright);
  color: var(--primary-bright);
}

.proposal-item p,
.event-list p,
.signed-set p {
  margin: 0;
  color: var(--sub);
}

.agent-trace-panel > h3 {
  margin: 20px 0 8px;
  color: var(--sub);
  font-size: 12px;
}

.capability-progress-list,
.agent-trace-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.capability-progress-list li,
.agent-trace-list li {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 12px 14px;
}

.capability-progress-list li[data-state="satisfied"],
.agent-trace-list li[data-status="succeeded"],
.agent-trace-list li[data-status="repaired"] {
  border-left: 3px solid var(--primary-bright);
}

.capability-progress-list li[data-state="pending"],
.agent-trace-list li[data-status="pending"],
.agent-trace-list li[data-status="reported"] {
  border-left: 3px solid var(--border-strong);
}

.capability-progress-list li[data-state="unavailable"],
.agent-trace-list li[data-status="failed"],
.agent-trace-list li[data-status="blocked"] {
  border-left: var(--ol) solid var(--control-edge);
}

.capability-progress-list p,
.agent-trace-list p {
  margin: 0;
  color: var(--sub);
}

.trace-item__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trace-state,
.trace-count {
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.07em;
  padding: 3px 6px;
  text-transform: uppercase;
}

.trace-boundary,
.trace-failure {
  color: var(--text-dim) !important;
}

.trace-repair {
  color: var(--primary-bright) !important;
}

.trace-origin,
.trace-time {
  color: var(--muted) !important;
  font-family: var(--mono);
  font-size: 10px;
}

.agent-trace-groups {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.agent-trace-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
}

.labelled-id {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.labelled-id code {
  color: var(--text);
  font-size: 10px;
}

.decision-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.proposal-payload {
  margin: 6px 0 0;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.signed-record {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  padding: 14px;
}

.signed-record div {
  display: grid;
  gap: 3px;
}

.signed-record dt {
  color: var(--muted);
  font-size: 11px;
}

.signed-record dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.finalize-steps {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.finalize-steps__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.finalize-steps .secondary-action {
  border: 1px solid var(--border-strong);
}

.gate-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.gate-form .field-wide {
  grid-column: 1 / -1;
}

.gate-form textarea {
  min-height: 92px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  padding: 11px 12px;
}

.capability-choice {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--border);
  padding: 12px;
}

.capability-choice legend {
  padding: 0 4px;
  color: var(--muted);
}

.capability-choice label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.capability-choice input {
  width: 15px;
  min-height: 15px;
}

.capability-choice__artifact-only {
  align-items: flex-start !important;
  opacity: 0.78;
}

.capability-choice__artifact-only span {
  display: grid;
  gap: 3px;
}

.capability-choice__artifact-only strong {
  color: var(--sub);
  font-size: 12px;
}

.capability-choice__artifact-only small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.draft-authoring-choice {
  margin: 0;
  border: 1px solid var(--border);
  padding: 12px;
}

.draft-authoring-choice legend {
  padding: 0 4px;
  color: var(--muted);
}

.draft-authoring-choice label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.draft-authoring-choice input {
  width: 15px;
  min-height: 15px;
  margin-top: 2px;
}

.draft-authoring-choice span {
  display: grid;
  gap: 3px;
}

.draft-authoring-choice strong {
  color: var(--text);
  font-size: 12px;
}

.draft-authoring-choice small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.workflow-action--inline {
  justify-content: flex-start;
}

.handoff {
  margin-top: 18px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
}

.handoff-access {
  display: grid;
  gap: 10px;
  max-width: 680px;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 68%, transparent);
  padding: 14px;
}

.handoff-access legend {
  padding: 0 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.handoff-access__choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--sub);
  cursor: pointer;
}

.handoff-access__choice input {
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  margin-top: 2px;
}

.handoff-access__choice span {
  display: grid;
  gap: 2px;
}

.handoff-access__choice strong {
  color: var(--text);
  font-size: 12px;
}

.handoff-access__choice small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.handoff-access__fallback {
  margin-left: 26px;
  border-left: var(--ol-thin) solid var(--control-edge);
  padding-left: 11px;
}

.run-start {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 10px;
}

.run-checklist-title {
  max-width: 680px;
  margin: 4px 0 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.run-checklist {
  display: grid;
  gap: 6px;
  max-width: 680px;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 68%, transparent);
  padding: 12px 14px 12px 30px;
  color: var(--sub);
}

.run-checklist li {
  line-height: 1.5;
}

.run-step-link {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.run-plan {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
}

.run-plan summary {
  color: var(--sub);
  cursor: pointer;
}

.run-plan pre {
  max-height: 320px;
  margin: 10px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Both scroll boxes take keyboard focus, so they can be scrolled without a mouse. */
.run-plan pre:focus-visible,
.handoff pre:focus-visible {
  outline: 2px solid var(--primary-bright);
  outline-offset: 2px;
}

.handoff__heading .text-action.is-next {
  border: 1px solid var(--primary-bright);
  padding: 8px 12px;
  font-size: 13px;
}

.fit-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.run-guard {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
  border: 1px solid var(--primary-bright);
  padding: 12px 14px;
  color: var(--text);
}

.run-guard p {
  margin: 0;
}

.prefill-note {
  margin: 2px 0 0;
  color: var(--text-dim);
}

.prefill-mark {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: none;
}

label[data-prefilled="lab"] > span:first-child,
legend[data-prefilled="lab"] {
  color: var(--text-dim);
}

.agent-access-state {
  display: grid;
  gap: 8px;
  max-width: 680px;
  margin: 0 0 18px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  padding: 14px;
}

.agent-access-state[hidden] {
  display: none;
}

.agent-access-state__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-access-state__badge {
  border: 1px solid var(--border-strong);
  color: var(--sub);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  padding: 4px 7px;
  text-transform: uppercase;
}

.agent-access-state[data-status="active"] .agent-access-state__badge {
  border-color: var(--text-dim);
  color: var(--text-dim);
}

.agent-access-state[data-status="expired"] .agent-access-state__badge,
.agent-access-state[data-status="revoked"] .agent-access-state__badge {
  border-color: var(--magenta);
  color: var(--magenta);
}

.agent-access-state p {
  margin: 0;
  color: var(--sub);
}

.agent-access-state code {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 10px;
}

.agent-access-state__revoke {
  justify-self: start;
  margin-top: 2px;
}

.oauth-consent-page {
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
}

.oauth-consent {
  width: min(100%, 480px);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  box-shadow: var(--pop-lg) var(--pop-lg) 0 var(--edge);
  padding: clamp(24px, 5vw, 38px);
}

.oauth-consent h1 {
  margin: 8px 0 14px;
  font-size: clamp(30px, 7vw, 50px);
}

.oauth-consent > p:not(.section-kicker) {
  color: var(--sub);
  line-height: 1.55;
}

.oauth-consent dl {
  display: grid;
  gap: 8px;
  margin: 22px 0;
}

.oauth-consent dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.oauth-consent dt,
.oauth-consent dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
}

.oauth-consent dt {
  color: var(--muted);
  text-transform: uppercase;
}

.oauth-consent dd {
  overflow-wrap: anywhere;
  color: var(--text);
}

.oauth-consent__actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 24px;
}

.handoff__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

.handoff pre {
  overflow: auto;
  max-height: 330px;
  margin: 0;
  padding: 14px;
  color: var(--sub);
  font-family: var(--mono);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}

.handoff .connection-note {
  margin: 0;
  padding: 0 14px 14px;
}

footer {
  display: flex;
  width: min(100% - 40px, 1040px);
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding: 20px 0 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.noscript-note {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 420px;
  padding: 12px 14px;
  border: var(--ol-thin) dashed var(--text);
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 680px) {
  .app-bar {
    min-width: 0;
    padding: 0 16px;
  }

  .brand {
    flex: 0 0 auto;
  }

  .app-bar nav {
    min-width: 0;
  }

  .identity-action {
    overflow: hidden;
    max-width: 108px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-link[data-home-link] {
    display: none;
  }

  main,
  footer {
    width: min(100% - 28px, 1040px);
  }

  .view {
    padding-top: 50px;
  }

  .view--home {
    min-height: calc(100dvh - 58px);
    padding: 34px 0 64px;
  }

  .hero-wordmark {
    gap: 10px;
    font-size: clamp(34px, 11vw, 48px);
  }

  .hero-tagline {
    margin-top: 10px;
    font-size: 15px;
  }

  .idea-form {
    margin-top: 24px;
  }

  .idea-control input {
    padding: 0 15px;
    font-size: 15px;
  }

  .idea-control .primary-action {
    min-width: 96px;
    padding: 0 17px;
  }

  .idea-search-action {
    min-width: 64px;
    padding: 0 10px;
  }

  .hero-copy,
  .view-copy {
    font-size: 16px;
  }

  .connection-block,
  .gate-form,
  .credential-form {
    grid-template-columns: 1fr;
  }

  .identity-panel {
    top: 64px;
    right: 14px;
    max-height: calc(100dvh - 76px);
    overflow: auto;
  }

  .gate-form .field-wide {
    grid-column: 1;
  }

  .identity-form__actions {
    flex-wrap: wrap;
  }

  .primary-action {
    min-height: 54px;
  }

  .secondary-action {
    min-height: 46px;
    border-top: 1px solid var(--border-strong);
    border-left: 0;
  }

  footer,
  .workflow-action,
  .handoff__heading,
  .proposal-item__heading,
  .trace-item__heading,
  .agent-trace-group h3 {
    flex-direction: column;
    align-items: flex-start;
  }

  .decision-actions,
  .finalize-steps__actions,
  .run-start {
    flex-direction: column;
    align-items: stretch;
  }

  .run-guard {
    align-items: flex-start;
  }

  .capability-choice {
    grid-template-columns: 1fr;
  }

  .provider-list li,
  .token-list li {
    grid-template-columns: 1fr;
  }

  .provider-state {
    text-align: left;
  }

  .view:not(.view--home) .form-status {
    text-align: left;
  }
}

@media (max-width: 360px) {
  .app-bar {
    padding: 0 12px;
  }

  main {
    width: calc(100% - 22px);
  }

  .brand > span:last-child {
    gap: 4px;
  }

  .brand small {
    display: none;
  }

  .idea-control input {
    padding-left: 13px;
    font-size: 14px;
  }

  .idea-control .primary-action {
    min-width: 82px;
    gap: 8px;
    padding: 0 13px;
  }


  .idea-search-action {
    min-width: 54px;
    padding: 0 7px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
.course-draft-choice {
  margin: 1.25rem 0;
  padding: 1rem;
  border: var(--ol-thin) solid var(--control-edge);
  background: var(--surface);
}
.course-draft-choice h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.course-draft-choice p { margin: 0 0 1rem; }
.course-draft-choice__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
#desk-course-context:empty { display: none; }
#desk-course-context { margin-bottom: 1.5rem; min-width: 0; }

/* ==== The Digital Lab's look for Desk's parts =====================================================================
   theme.css (loaded first) draws the colours, the type and the stickers; this layer gives Desk's own parts the Lab's
   shapes: one sticky header with the app's tile and the Lab's dark/light switch, sticker cards, fields and pill
   buttons, mono kickers, states by shape and word. Layout above stays Desk's. No colour is named here. */
body { font-family: var(--display); font-weight: 500; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* The way back to the Lab: one quiet line above the header. */
.lab-bar { display: block; padding: 6px max(16px, calc((100% - 1312px) / 2)) 0; }
.lab-bar-link {
  display: inline-flex; align-items: center; gap: 0.4em; min-height: 44px;
  color: var(--text-dim); font: 700 max(12px, 0.76rem)/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
}
.lab-bar-link:hover { color: var(--text); text-decoration: underline 3px var(--link-line); text-underline-offset: 0.3em; }

/* The header: the Lab's. */
.app-bar.site-header {
  min-height: 4.65rem; padding: 0 max(16px, calc((100% - 1312px) / 2));
  border-bottom: var(--ol) solid var(--rule); background: var(--bg); backdrop-filter: none;
}
.brand.wordmark { gap: 10px; min-height: 2.75rem; }
.brand.wordmark > span:last-child { display: block; }
.brand.wordmark strong { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; text-transform: none; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.header-actions nav { gap: 10px; }
.nav-link, .identity-action {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border: var(--ol-thin) solid var(--control-edge); border-radius: var(--pill);
  color: var(--text); background: var(--surface); box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge);
  font: 700 0.9rem/1.2 var(--display); text-decoration: none; letter-spacing: 0;
}
.nav-link--connect { border-color: var(--control-edge); color: var(--text); }
.nav-link[aria-current="page"] { border-color: var(--edge); color: var(--on-picked); background: var(--picked); box-shadow: 1px 1px 0 var(--edge); }
.identity-action { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 680px) {
  .identity-action[data-authenticated="true"] .identity-account-label { display: none; }
}
@media (hover: hover) {
  :is(.nav-link, .identity-action):hover { transform: translate(-1px, -1px); box-shadow: calc(var(--pop-sm) + 1px) calc(var(--pop-sm) + 1px) 0 var(--edge); }
}

/* Kickers: small muted mono, never lime. */
.section-kicker, .field-label, .next-step, .run-checklist-title, .eyebrow span {
  color: var(--text-dim); font-family: var(--mono); font-weight: 700; font-size: max(12px, 0.76rem); letter-spacing: 0.12em; text-transform: uppercase;
}
.section-kicker { margin-bottom: 6px; }

/* Cards: a sticker on the room. */
.case-view-card, .gate-panel, .run-panel, .agent-trace-panel, .proposals-panel, .gate-b-panel, .finalize-panel,
.course-draft-choice, .credential-setup, .identity-panel, .oauth-consent {
  border: var(--ol) solid var(--edge); border-radius: var(--r-lg); color: var(--text); background: var(--surface);
  box-shadow: var(--pop) var(--pop) 0 var(--edge);
}
.case-view-card { border-left: var(--ol) solid var(--edge); box-shadow: var(--pop-lg) var(--pop-lg) 0 var(--edge); }
.gate-panel, .run-panel, .agent-trace-panel, .proposals-panel, .gate-b-panel, .finalize-panel { padding: clamp(18px, 3vw, 28px); }
.identity-panel { box-shadow: var(--pop-lg) var(--pop-lg) 0 var(--edge); }
.connection-setup { border-top: var(--ol-thin) solid var(--divider); }
.connection-note, .view-copy, .hero-tagline, .case-meta, .source-state { color: var(--text-dim); }
.case-view-card h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.04; }
.gate-panel h2, .run-panel h2, .proposals-panel h2, .gate-b-panel h2, .finalize-panel h2, .agent-trace-panel h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.15; }

/* Fields: typed in, picked from. */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  border: var(--ol) solid var(--control-edge); border-radius: var(--r); color: var(--text); background-color: var(--surface);
  box-shadow: var(--pop) var(--pop) 0 var(--edge); font-family: var(--display); font-weight: 600;
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { border-color: var(--control-edge); box-shadow: var(--pop) var(--pop) 0 var(--edge); }
:is(input, textarea)::placeholder { color: var(--text-dim); opacity: 1; }
select {
  appearance: none; padding-right: 44px;
  background: linear-gradient(45deg, transparent 50%, var(--text) 50%) right 22px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--text) 50%, transparent 50%) right 15px center / 7px 7px no-repeat, var(--surface);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--text); width: 20px; height: 20px; }
:is(input, select, textarea)[aria-invalid="true"] { border-color: var(--danger); }
/* The entrance: one pill holding the idea, Search and Start (Desk's aperture, in the Lab's sticker). */
.idea-control { border: var(--ol) solid var(--control-edge); background: var(--surface); }
.idea-control input:not([type="checkbox"]) { border: 0; box-shadow: none; background: transparent; }
.idea-control:focus-within { border-color: var(--edge); box-shadow: calc(var(--pop) + 1px) calc(var(--pop) + 1px) 0 var(--edge); }
.idea-search-action { color: var(--text); font-weight: 800; }

/* Buttons: one lime action per screen; the rest are secondary or text links. */
.primary-action {
  border: var(--ol) solid var(--edge); border-radius: var(--pill); color: var(--on-accent); background: var(--accent);
  box-shadow: var(--pop) var(--pop) 0 var(--edge); font-family: var(--display); font-weight: 800; letter-spacing: -0.01em;
  transition: transform var(--t-press) var(--ease), box-shadow var(--t-press) var(--ease);
}
.primary-action:hover { color: var(--on-accent); background: var(--accent); transform: translate(-1px, -1px); box-shadow: calc(var(--pop) + 1px) calc(var(--pop) + 1px) 0 var(--edge); }
.primary-action:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--edge); }
.idea-control .primary-action { border-width: var(--ol); }
.secondary-action, .agent-access-state__revoke, .token-list button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; min-height: 44px; padding: 0 1.1rem;
  border: var(--ol) solid var(--control-edge); border-radius: var(--pill); color: var(--text); background: var(--surface);
  box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge); font-family: var(--display); font-weight: 800;
}
.text-action, .back-link, .run-step-link {
  color: var(--text); font-family: var(--display); font-weight: 700; text-decoration: underline 3px var(--link-line); text-underline-offset: 0.3em;
}
.text-action:hover, .back-link:hover, .run-step-link:hover { text-decoration-thickness: 5px; }
:is(.primary-action, .secondary-action):disabled {
  border: var(--ol) dashed var(--control-edge); color: var(--text-dim); background: var(--surface); box-shadow: none; transform: none; opacity: 1; cursor: not-allowed;
}

/* Filled from the Lab: one quiet line, never a colour. */
.prefill-note, .prefill-mark { color: var(--text-dim); }
.prefill-note { font-weight: 700; }
legend[data-prefilled="lab"] { color: var(--text); }
.gate-form label, .identity-form label, .capability-choice { color: var(--text); font-size: 0.9rem; }
.capability-choice, .draft-authoring-choice, .handoff-access { border: var(--ol-thin) solid var(--divider); border-radius: var(--r); }

/* Lists: rows split by dividers. */
.event-list li, .agent-trace-list li, .token-list li, .home-work-list li, .proposal-list li { border-color: var(--divider); }
.home-work-list a:hover strong { text-decoration: underline 3px var(--link-line); text-underline-offset: 0.3em; }
.labelled-id code, .connection-block code, .agent-access-state code { color: var(--text-dim); font-family: var(--mono); }
pre, .proposal-payload, .handoff pre, .run-plan pre, .credential-once pre {
  border: var(--ol-thin) solid var(--control-edge); border-radius: var(--r); color: var(--text); background: var(--bg); font-family: var(--mono);
}

/* States by shape and a word (never a colour alone): accepted = the picked sticker, waiting = dashed, closed = dotted. */
.proposal-item__state, .agent-access-state__badge, .case-stage {
  border: var(--ol-thin) solid var(--control-edge); border-radius: var(--pill); color: var(--text); font: 700 0.78rem/1.2 var(--display); letter-spacing: 0.04em; padding: 2px 10px;
}
.proposal-list li[data-status="accepted"] .proposal-item__state, .agent-access-state[data-status="active"] .agent-access-state__badge { border: var(--ol-thin) solid var(--edge); color: var(--on-picked); background: var(--picked); }
.proposal-list li[data-status="pending"] .proposal-item__state { border-style: dashed; color: var(--text); }
.proposal-list li[data-status="rejected"] .proposal-item__state, .proposal-list li[data-status="invalidated"] .proposal-item__state,
.agent-access-state[data-status="revoked"] .agent-access-state__badge { border-style: dotted; color: var(--text-dim); }

/* The case's steps: where it is, and the one thing to do next. */
.case-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.case-steps li {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px;
  border: var(--ol-thin) solid var(--control-edge); border-radius: var(--r); color: var(--text); background: var(--surface);
  box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge); font: 700 0.92rem/1.2 var(--display);
}
.case-steps .workflow-question-n { width: 1.7em; height: 1.7em; font-size: 0.85rem; transform: none; box-shadow: none; }
.case-steps li[data-state="done"] { color: var(--text-dim); box-shadow: none; }
.case-steps li[data-state="done"] .workflow-question-n { border-style: solid; background: transparent; }
.case-steps li[aria-current="step"] { border-color: var(--edge); color: var(--on-picked); background: var(--picked); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge); font-weight: 800; }
.case-steps li[aria-current="step"] .workflow-question-n { border-color: var(--on-picked); color: var(--on-picked); background: transparent; }
.case-steps li[data-state="later"] { border-style: dashed; box-shadow: none; color: var(--text-dim); }
.case-steps-line { margin: 10px 0 0; color: var(--text-dim); }

/* One lime action per screen: only the current step's panel keeps it; the others read as the quiet sticker. */
.view--case[data-step]:not([data-step="approve"]) #gate-panel .primary-action:not(:disabled),
.view--case[data-step]:not([data-step="handoff"]) #run-panel .primary-action:not(:disabled),
.view--case[data-step]:not([data-step="review"]) #proposals-panel .primary-action:not(:disabled),
.view--case[data-step]:not([data-step="sign"]) #gate-b-panel .primary-action:not(:disabled),
.view--case[data-step]:not([data-step="finish"]) #finalize-panel .primary-action:not(:disabled) {
  border-color: var(--control-edge); color: var(--text); background: var(--surface); box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge);
}
/* While reviewing, only the first waiting proposal's Accept is lime. (Its own rule: a browser without "of" drops only this.) */
.view--case[data-step="review"] .proposal-list li:not(:nth-child(1 of [data-status="pending"])) .primary-action:not(:disabled) {
  border-color: var(--control-edge); color: var(--text); background: var(--surface); box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge);
}

/* The helper ("Review my next move"): the Lab planner's parts (lab-discovery.css), loaded after client.css so scoped
   higher. Its Ask stays a quiet sticker: the case step's action is the screen's one lime. */
.case-view-card > details { margin-top: 14px; }
.case-view-card > details > summary {
  display: inline-flex; align-items: center; gap: 0.5em; min-height: 44px; color: var(--text); font-weight: 800; cursor: pointer;
  text-decoration: underline 3px var(--link-line); text-underline-offset: 0.3em;
}
.case-view-card > details > pre { color: var(--text); font: 700 0.78rem/1.5 var(--mono); }
.view--case .lab-assist { margin-top: 12px; color: var(--text); background: var(--surface); border: var(--ol-thin) solid var(--control-edge); border-radius: var(--r); font: 500 1rem/1.5 var(--display); }
.view--case .lab-assist .la-eyebrow { color: var(--text-dim); font: 700 max(12px, 0.76rem)/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.view--case .lab-assist h3 { font: 800 1.25rem/1.2 var(--display); letter-spacing: -0.02em; }
.view--case .lab-assist :is(input:not([type=checkbox]), textarea, select) { border: var(--ol) solid var(--control-edge); border-radius: var(--r); color: var(--text); background: var(--surface); box-shadow: none; font-weight: 600; }
.view--case .lab-assist button { border: var(--ol) solid var(--control-edge); border-radius: var(--pill); color: var(--text); background: var(--surface); box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge); font-weight: 800; }
.view--case .lab-assist button:hover:not(:disabled) { border-color: var(--control-edge); }
.view--case .lab-assist [type=submit], .view--case .lab-assist button[type=submit]:is(:hover, :focus-visible):not(:disabled) { border-color: var(--edge); color: var(--text); background: var(--surface); }
.view--case .lab-assist button:disabled { border-style: dashed; color: var(--text-dim); box-shadow: none; opacity: 1; }
.view--case .lab-assist :is(details, article) { border-color: var(--divider); }
.view--case .lab-assist :is(.la-status, .la-confirm) { border-color: var(--control-edge); }
.view--case :is(.lab-assist, .lab-workspace) :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.view--case .lab-workspace { --lw-blue: var(--text-dim); --lw-ink: var(--text); --lw-bg: var(--surface); border-color: var(--control-edge); border-top-color: var(--control-edge); border-radius: var(--r-lg); font-family: var(--display); }
.view--case .lab-workspace :is(input, textarea, select) { border: var(--ol) solid var(--control-edge); border-radius: var(--r); color: var(--text); background: var(--surface); box-shadow: none; }
.view--case .lab-workspace :is(button, .lw-link) { border: var(--ol) solid var(--control-edge); border-radius: var(--pill); color: var(--text); background: var(--surface); box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge); font-family: var(--display); font-weight: 800; }
.view--case .lab-workspace :is([data-lw-review], [data-lw-active]) { border-left-color: var(--picked); background: var(--bg); }
.view--case .lab-workspace [data-lw-status] { color: var(--text-dim); }
.view--case .lab-workspace :is(details, article, .lw-result-grid article, [data-lw-note-options] label) { border-color: var(--divider); background: transparent; }
.view--case .lab-workspace :is(small, .lw-result-grid dt) { color: var(--text-dim); }
.view--case .lab-workspace .lw-result-grid h5 { font-family: var(--display); }

/* The entrance tile: the Lab's Desk badge, not an empty box. */
.hero-wordmark__mark.lab-badge {
  --badge-size: 0.95em;
  display: inline-block; width: var(--badge-size); height: var(--badge-size);
  border: var(--ol) solid var(--edge); border-radius: 26%;
  background: var(--badge-art, none) center / 72% no-repeat, var(--tile);
  box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge); transform: rotate(-6deg);
}

footer { border-top: var(--ol) solid var(--rule); color: var(--text-dim); }

@media (max-width: 680px) {
  .app-bar.site-header { min-height: 62px; }
  .header-actions, .header-actions nav { gap: 6px; }
  .nav-link, .identity-action { padding: 0 10px; font-size: 0.82rem; }
  .case-steps { gap: 5px; }
  .case-steps li { flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 4px 2px; font-size: 0.72rem; text-align: center; }
}
/* Narrow phones: the tile names Desk (its name stays for screen readers) so Connect, the account and the theme fit. */
@media (max-width: 480px) {
  /* The Lab's thicker field edge, paid back in side padding so a prefilled line still shows whole. */
  :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):not(.idea-control *) { padding-inline: 8px; }
  select:not(.idea-control *) { padding-right: 40px; }
  .brand.wordmark > span:last-child {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .primary-action, .nav-link, .identity-action, .case-steps li { transition: none; transform: none !important; }
}

/* The optional workspace uses the same width and cards in Lab and Desk. */
.has-collection-workspace #main-content { max-width:none; width:100%; padding:28px max(20px,calc((100vw - 1320px)/2)); }
.has-collection-workspace [data-view][hidden] { display:none !important; }
.desk-collection-utility { margin:0 48px 28px; max-width:856px; border-top:2px solid var(--divider); padding:20px 0; }
.desk-collection-utility summary { cursor:pointer; font-weight:700; }
.desk-collection-controls { display:flex; flex-wrap:wrap; gap:16px; align-items:center; margin-top:16px; }
.desk-collection-controls label { display:grid; gap:6px; max-width:100%; }
.desk-collection-controls input { max-width:100%; min-height:44px; border:2px solid var(--edge); border-radius:12px; padding:8px; background:var(--surface); color:var(--text); }
.desk-collection-controls ul { width:100%; }
.desk-collection-status { color:var(--text-dim); }
@media(max-width:600px) { .has-collection-workspace #main-content { padding:18px 16px; } .desk-collection-utility { margin:0 0 24px; } }
