/* Feature 050: final cascade for the current guide's controls and composition.
   Loaded after destination CSS. Technical graph nodes retain their own geometry. */
html body :is(button,.button):not(.graph-record){
  font-family:var(--kleis-font-family);font-size:var(--kleis-font-size-label);
  line-height:1.5;min-height:var(--kleis-control-hit-target);
  border-radius:var(--kleis-control-radius);white-space:normal;overflow-wrap:anywhere;
  background-image:var(--kleis-button-sheen);box-shadow:var(--kleis-button-depth);
  transition:background-color 120ms,border-color 120ms,color 120ms,box-shadow 120ms;
}
html body :is(button,.button):where(:not(.graph-record):not(.secondary):not(.inline-record-action):not(.atlas-result):not(.atlas-connection):not(.danger):not(:disabled):not([aria-disabled=true])):hover{
  background-color:var(--kleis-color-interactive-hover);color:var(--kleis-color-text-inverse);
}
html body :is(button.secondary,.button.secondary,.view-control-bar button,.atlas-result,.atlas-connection):not(:disabled):not([aria-disabled=true]):hover{
  background-color:var(--kleis-surface-hover);color:var(--kleis-color-interactive);
  border-color:var(--kleis-color-interactive);
}
html body :is(button,.button):not(.graph-record):not(:disabled):not([aria-disabled=true]):active{
  box-shadow:var(--kleis-button-depth-pressed);background-color:var(--kleis-surface-selected);
  color:var(--kleis-color-interactive);border-color:var(--kleis-color-interactive);
}
html body :is(button,.button).danger:not(:disabled):not([aria-disabled=true]){background:var(--kleis-color-danger-text);color:var(--kleis-color-text-inverse);border-color:var(--kleis-color-danger-text)}
html body :is(button,.button).danger:not(:disabled):not([aria-disabled=true]):hover{background:var(--kleis-color-danger-hover);color:var(--kleis-color-text-inverse)}
html body :is(button,.button).danger:not(:disabled):not([aria-disabled=true]):active{background:var(--kleis-color-danger-bg);color:var(--kleis-color-danger-text);border-color:var(--kleis-color-danger-border);box-shadow:none}
html body button[aria-pressed=true]:not(:disabled),html body button[aria-selected=true]:not(:disabled){background:var(--kleis-surface-selected);color:var(--kleis-color-interactive);border-color:var(--kleis-color-interactive)}
html body .inline-record-action{background:transparent;box-shadow:none;border:0}
html body .inline-record-action:not(:disabled):hover,
html body button.inline-record-action:not(:disabled):active{background:var(--kleis-surface-selected);color:var(--kleis-color-interactive);box-shadow:none;border:0}
html body :is(button,.button):not(.graph-record):is(:disabled,[aria-disabled=true]){
  background:var(--kleis-surface-disabled);color:var(--kleis-text-disabled);
  border-color:var(--kleis-color-disabled-border);box-shadow:none;opacity:1;cursor:not-allowed;
}
html body form[aria-busy=true] :is(button[type=submit],button:not([type])):disabled{
  cursor:progress;border-color:var(--kleis-color-interactive);
}
html body :is(input,select,textarea):disabled{
  background:var(--kleis-surface-disabled);color:var(--kleis-text-disabled);
  border-color:var(--kleis-color-disabled-border);opacity:1;cursor:not-allowed;
}
html body :is(input,textarea)[readonly]{background:var(--kleis-surface-inset);color:var(--kleis-color-text);cursor:text}
html body :is(input,select,textarea)[aria-invalid=true]{border-color:var(--kleis-color-danger-border)}
html body :is(button:not(.graph-record),.button,input,select,textarea,summary):focus-visible{
  outline:2px solid var(--kleis-color-focus);outline-offset:3px;
}
/* Content panels and framed contextual controls have different geometry. */
html body :is(.atlas-stage,.atlas-inspector,.atlas-progress){border-radius:var(--kleis-radius-panel)}
html body .atlas-progress p{color:var(--kleis-color-text-inverse)}
html body .atlas-progress{padding:var(--kleis-layout-panel-padding)}
html body .atlas-inspector{padding:var(--kleis-layout-panel-padding)}
html body .atlas-body{gap:var(--kleis-layout-field-gap)}
html body .atlas-controls{gap:var(--kleis-layout-action-gap);align-items:end}
html body .atlas-controls .field-group{gap:var(--kleis-layout-label-gap);flex:1 1 260px}
html body .atlas-view-actions{gap:8px;padding:8px;max-width:100%;min-width:0}
html body :is(.ledger,.inspector,.preview,.atlas-inspector)>:is(h2,h3,h4)+p{
  margin-top:var(--kleis-layout-heading-body-gap);
}
html body :is(.ledger,.inspector,.preview,.atlas-inspector)>p{
  margin-bottom:var(--kleis-layout-paragraph-gap);
}
html body :is(.page-heading,.atlas-heading,.marketplace-masthead){flex-wrap:wrap}
html body .atlas-heading{margin-bottom:var(--kleis-layout-related-gap)}
html body :is(.page-heading,.atlas-heading,.marketplace-masthead)>div{min-width:0;max-width:100%}
html body :is(.workspace-grid,.atlas-body,.marketplace-product-grid,.shop-product-grid)>*{min-width:0}
html body .target-search{align-items:end}
html body .target-search button{flex-shrink:0}
html body .product-preview-launcher .action-row{gap:var(--kleis-layout-action-gap)}
@media(max-width:767px){
  html body :is(.atlas-inspector,.atlas-progress){padding:var(--kleis-layout-panel-padding-small)}
  html body .atlas-controls{gap:var(--kleis-layout-action-gap)}
  html body .atlas-controls .field-group{flex-basis:100%}
  html body .atlas-view-actions{width:100%}
  html body .atlas-view-actions>button{flex:1 1 120px}
  html body .target-search>.field-group{flex-basis:100%}
}
@media(prefers-reduced-motion:reduce){html body :is(button,.button){transition:none}}
@media(forced-colors:active){
  html body :is(button,.button):not(.graph-record){background:ButtonFace;color:ButtonText;border-color:ButtonText;box-shadow:none}
  html body :is(button,.button):not(.graph-record):is(:disabled,[aria-disabled=true]),
  html body :is(input,select,textarea):disabled{background:Canvas;color:GrayText;border-color:GrayText}
  html body :is(button,.button):not(.graph-record):not(:disabled):hover,
  html body :is(button,.button):not(.graph-record):not(:disabled):active{background:Highlight;color:HighlightText;border-color:Highlight}
  html body button[aria-pressed=true]:not(:disabled),html body button[aria-selected=true]:not(:disabled){background:Highlight;color:HighlightText;border-color:Highlight}
  html body .atlas-progress p{color:CanvasText}
  html body :is(input,select,textarea)[readonly]{background:Canvas;color:CanvasText}
  html body :is(input,select,textarea)[aria-invalid=true]{border-color:CanvasText;border-style:dashed}
  html body :is(button:not(.graph-record),.button,input,select,textarea,summary):focus-visible{outline-color:Highlight}
}
