/* Shared dialog design tokens. Keep graph controls and studio editing tools independent. */
:root {
  --tf-dialog-bg:#192631;
  --tf-dialog-border:#526b7e;
  --tf-dialog-divider:#405565;
  --tf-dialog-radius:10px;
  --tf-dialog-title-size:14px;
  --tf-dialog-action-height:32px;
  --tf-dialog-action-radius:5px;
  --tf-dialog-action-gap:8px;
  --tf-dialog-primary:#8dc7a3;
  --tf-dialog-secondary:#303c48;
  --tf-dialog-danger:#963f45;
}
:is(.tf-library-dialog,.material-studio-dialog,.tf-export-dialog,.asset-detail,.node-appearance-dialog) {
  background:var(--tf-dialog-bg); color:#e8edf2; border:1px solid var(--tf-dialog-border);
  border-radius:var(--tf-dialog-radius); box-shadow:0 24px 70px #000b;
  font:12px/1.45 system-ui,sans-serif;
}
dialog:is(.tf-library-dialog,.asset-detail,.node-appearance-dialog)::backdrop {background:#060b10d9;}
dialog.tf-library-dialog:not([open]) { display:none; }
:is(.tf-library-dialog,.material-studio-dialog,.asset-picker) > header,
.tf-handbook-header {
  display:flex; align-items:center; gap:10px; padding:10px 14px;
  min-height:53px; border-bottom:1px solid var(--tf-dialog-divider);
  font-size:var(--tf-dialog-title-size); font-weight:600; letter-spacing:0;
}
:is(.tf-library-dialog,.material-studio-dialog,.asset-picker) > header > strong,
#tf-node-handbook > header > strong,
:is(.tf-export-dialog,.asset-detail) > :is(h2,h3), .node-appearance-dialog h3 {
  font-size:var(--tf-dialog-title-size); font-weight:600; letter-spacing:0;
  text-transform:none; color:#e8edf2;
}
:is(.tf-export-dialog,.asset-detail) > :is(h2,h3), .node-appearance-dialog h3 {
  margin:0 0 12px; padding:0 0 12px; border-bottom:1px solid var(--tf-dialog-divider);
}
:is(.tf-dialog-actions,.world-studio-footer,.terrain-layout-footer,.tf-export-buttons,.tf-template-actions,.project-settings-form footer,.appearance-actions) {
  display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:var(--tf-dialog-action-gap);
  border-top:1px solid var(--tf-dialog-divider); padding-top:10px;
}
:is(.tf-dialog-actions,.world-studio-footer,.terrain-layout-footer,.tf-export-buttons,.tf-template-actions,.project-settings-form footer,.appearance-actions) > button {
  box-sizing:border-box; min-height:var(--tf-dialog-action-height); height:auto; min-width:84px;
  padding:6px 14px; font:500 12px/18px system-ui,sans-serif; border-radius:var(--tf-dialog-action-radius);
  background:var(--tf-dialog-secondary); color:#e8edf2; border:1px solid #526273; margin:0;
}
:is(.tf-dialog-actions,.world-studio-footer,.terrain-layout-footer,.tf-export-buttons,.tf-template-actions,.appearance-actions) > button.tf-action-primary {
  background:var(--tf-dialog-primary); color:#14271c; border-color:var(--tf-dialog-primary);
}
:is(.tf-dialog-actions,.tf-template-actions) > button.tf-action-danger {background:var(--tf-dialog-danger);color:white;border-color:#b85d63;}
:is(.tf-dialog-actions,.world-studio-footer,.terrain-layout-footer,.tf-export-buttons,.tf-template-actions,.project-settings-form footer,.appearance-actions) > button:hover:not(:disabled) {border-color:#c4e5d1;filter:brightness(1.1);}
:is(.tf-dialog-actions,.world-studio-footer,.terrain-layout-footer,.tf-export-buttons,.tf-template-actions,.project-settings-form footer,.appearance-actions) > button:disabled {opacity:.45;cursor:not-allowed;}
.studio-dialog-actions,.world-studio-footer {padding:10px 14px;}
:is(.terrain-layout-footer,.appearance-actions) > .tf-dialog-auxiliary {margin-right:auto;}
:is(.tf-library-dialog,.asset-picker) > header > button, #tf-node-handbook > header > button {
  box-sizing:border-box; width:32px; height:32px; min-height:32px; padding:0; flex:none;
  font:500 18px/1 system-ui,sans-serif; border-radius:var(--tf-dialog-action-radius);
  background:var(--tf-dialog-secondary); color:#e8edf2; border:1px solid #526273;
}
.asset-picker > header {padding:0 0 10px;}
/* Text fields only: leave range, color, file and compact studio controls intact. */
:is(.tf-template-form,.project-settings-form,.tf-export-field,.pbr-layout,.snapshot-form,.tf-library-tools,.tf-handbook-tools) :is(input:not([type]),input[type=text],input[type=search],input[type=number],select,textarea) {
  min-height:32px; border-radius:5px; font:12px/1.45 system-ui,sans-serif;
}
:is(.tf-template-form,.project-settings-form,.tf-export-dialog,.snapshot-form,.tf-handbook-tools) input[type=checkbox] {width:16px;height:16px;accent-color:var(--accent);flex:none;}
:is(.tf-library-dialog,.material-studio-dialog,.tf-export-dialog,.asset-detail,.node-appearance-dialog,#tf-node-handbook) :is(button,input,select,textarea):focus-visible {outline:2px solid var(--accent);outline-offset:2px;}
#tf-node-handbook > header {letter-spacing:0;}
.pbr-layout > * {min-width:0;}
@media(max-width:680px){.pbr-layout{grid-template-columns:minmax(0,1fr);}}
.world-studio-dialog .world-studio-footer > button {height:auto;min-height:var(--tf-dialog-action-height);padding:6px 14px;}
.library-form-dialog {padding:0;}
