/*
 * Executable component primitives.
 *
 * These classes own the visible handoff from explanation to execution. Route
 * sheets may position them, but may not restyle their command, action, or
 * outer proof surface.
 */

html[data-design-system="halde"] .ds-command{
  width:100%;
  min-width:0;
  min-height:56px;
  container-type:inline-size;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:stretch;
  overflow:hidden;
  color:var(--command-text);
  border:1px solid var(--artifact-rule);
  border-radius:0;
  background:var(--command-bg);
  box-shadow:none;
}

html[data-design-system="halde"] .ds-command code{
  min-width:0;
  display:flex;
  align-items:center;
  padding:12px clamp(13px,2vw,20px);
  overflow-x:auto;
  color:inherit;
  font-family:var(--font-technical);
  font-size:clamp(10px,3cqw,14px);
  font-weight:500;
  font-variant-ligatures:none;
  letter-spacing:0;
  line-height:1.35;
  scrollbar-width:thin;
  white-space:nowrap;
}

html[data-design-system="halde"] .ds-command button{
  min-width:104px;
  min-height:100%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin:0;
  padding:0 16px;
  color:var(--command-action-text);
  border:0;
  border-left:1px solid var(--artifact-rule);
  border-radius:0;
  background:var(--command-action-bg);
  box-shadow:none;
  font-family:var(--font-editorial);
  font-size:10px;
  font-weight:650;
  letter-spacing:.05em;
  line-height:1;
  text-transform:uppercase;
}

html[data-design-system="halde"] .ds-command button:is(:hover,:focus-visible){
  color:var(--artifact-text);
  background:var(--artifact-bg-raised);
  box-shadow:inset 0 -3px 0 var(--accent);
}

html[data-design-system="halde"] .ds-command--compact{
  min-height:40px;
}

html[data-design-system="halde"] .ds-command--compact code{
  padding:8px 10px;
  font-size:clamp(9px,2.5cqw,11px);
}

html[data-design-system="halde"] .ds-command--compact button{
  min-width:76px;
  padding-inline:10px;
  font-size:9px;
}

html[data-design-system="halde"] .ds-proof-frame{
  min-width:0;
  overflow:hidden;
  color:var(--text-primary);
  border:1px solid var(--border-default);
  background:var(--bg-surface);
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--text-primary) 7%,transparent),var(--shadow-soft);
}

html[data-design-system="halde"] .ds-proof-frame--artifact{
  color:var(--artifact-text);
  border-color:var(--artifact-rule);
  background:var(--artifact-bg);
  box-shadow:none;
}

html[data-design-system="halde"] .ds-code-panel{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  padding:18px 22px 20px;
  border-top:0;
}

html[data-design-system="halde"] .ds-code-panel .lab{
  color:var(--artifact-muted);
  opacity:1;
  white-space:nowrap;
}

html[data-design-system="halde"] .ds-code-panel code{
  min-width:0;
  display:grid;
  gap:7px;
  color:inherit;
  font:500 clamp(11px,.9vw,13px)/1.55 var(--font-technical);
  letter-spacing:0;
}

html[data-design-system="halde"] .ds-code-panel code span{
  min-width:0;
  display:grid;
  grid-template-columns:3.5ch minmax(0,1fr);
  gap:.75ch;
}

html[data-design-system="halde"] .ds-code-panel code b{
  color:var(--accent);
  font-weight:700;
  text-align:right;
}

html[data-design-system="halde"] .ds-code-panel code em{
  min-width:0;
  font-style:normal;
  overflow-wrap:anywhere;
  white-space:normal;
}

@media (max-width:960px){
  html[data-design-system="halde"] .ds-command--stack-compact{
    grid-template-columns:minmax(0,1fr);
  }

  html[data-design-system="halde"] .ds-command--stack-compact code{
    min-height:48px;
    overflow-x:visible;
  }

  html[data-design-system="halde"] .ds-command--stack-compact button{
    min-height:44px;
    border-top:1px solid var(--artifact-rule);
    border-left:0;
  }
}

@media (max-width:620px){
  html[data-design-system="halde"] .ds-command{
    min-height:52px;
  }

  html[data-design-system="halde"] .ds-command button{
    min-width:78px;
    padding-inline:10px;
    font-size:9px;
  }

  html[data-design-system="halde"] .ds-code-panel{
    gap:8px;
    padding:14px;
  }
}

@media (min-width:961px) and (max-height:800px){
  html[data-design-system="halde"] .ds-command--compact{
    min-height:32px;
  }

  html[data-design-system="halde"] .ds-command--compact code{
    padding:5px 9px;
    font-size:9px;
  }

  html[data-design-system="halde"] .ds-command--compact button{
    min-width:68px;
    padding-inline:8px;
    font-size:8px;
  }
}
