/* Free text nodes: typography first, frame optional. */
#node-layer .node.text{
  min-height:0;
  overflow:visible;
  border:0;
  border-radius:var(--text-radius,6px);
  background:transparent;
  box-shadow:none;
  color:var(--text);
  content-visibility:visible;
  contain:none;
}
#node-layer .node.text::before{
  content:"";
  position:absolute;
  z-index:0;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  opacity:var(--text-frame-opacity,.9);
}
#node-layer .node.text.text-frame-soft::before{
  border:1px solid color-mix(in srgb,var(--text-frame-color,var(--node-color)) 18%,var(--line));
  background:color-mix(in srgb,var(--text-frame-color,var(--node-color)) 12%,var(--panel));
}
#node-layer .node.text.text-frame-solid::before{
  background:var(--text-frame-color,var(--node-color));
  box-shadow:0 10px 24px color-mix(in srgb,var(--text-frame-color,var(--node-color)) 19%,transparent);
}
#node-layer .node.text.text-frame-outline::before{
  border:1.5px solid var(--text-frame-color,var(--node-color));
  background:transparent;
}
#node-layer .node.text .text-content{
  position:relative;
  z-index:1;
  width:100%;
  min-height:40px;
  padding:var(--text-padding,14px);
  overflow:visible;
  color:var(--text-color,inherit);
  font-size:var(--text-font-size,18px);
  font-weight:var(--text-weight,500);
  line-height:1.5;
  letter-spacing:-.01em;
  text-align:var(--text-align,left);
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  user-select:none;
  cursor:grab;
}
#node-layer .node.text:active .text-content,
#node-layer .node.text.is-moving .text-content{cursor:grabbing}
#node-layer .node.text-preset-heading .text-content{
  display:grid;
  align-content:center;
  min-height:var(--text-min-height,130px);
  line-height:1.16;
  letter-spacing:-.035em;
  white-space:nowrap;
  overflow-wrap:normal;
}
#node-layer .node.text:not(.text-frame-none) .text-content{min-height:var(--text-min-height,40px)}
#node-layer .node.text-preset-label .text-content{line-height:1.25;letter-spacing:.035em}
#node-layer .node.text-frame-none .text-content{padding:0}
#node-layer .node.text.text-frame-solid .text-content{color:var(--text-color,#fff);text-shadow:0 1px 1px #0002}
#node-layer .node.text .text-category-badge{
  position:absolute;
  z-index:5;
  top:-28px;
  right:8px;
  display:block;
  max-width:120px;
  overflow:hidden;
  padding:5px 10px;
  border:1px solid #ffffffb8;
  border-radius:999px;
  background:#17151b;
  box-shadow:0 6px 15px #17151b2b;
  color:#fff;
  font-size:11px;
  font-weight:700;
  line-height:1;
  letter-spacing:.01em;
  text-overflow:ellipsis;
  white-space:nowrap;
  pointer-events:none;
}
#node-layer .node.text.selected{
  outline:1.5px dashed color-mix(in srgb,var(--node-color) 82%,#fff);
  outline-offset:4px;
  box-shadow:none;
}
#node-layer .node.text.editing{
  outline-style:solid;
  outline-offset:3px;
}
#node-layer .node.text .text-content[contenteditable="true"]{
  outline:0;
  background:transparent;
  box-shadow:none;
  cursor:text;
  user-select:text;
}
body[data-theme="morning"] #node-layer .node.text{color:#322d3a}
body[data-theme="paper"] #node-layer .node.text{color:#3b3023}
body[data-theme="blueprint"] #node-layer .node.text{color:#e8f5ff}

.text-style-body{display:grid;gap:11px}
.text-control-label{color:var(--muted);font-size:10px;font-weight:760}
.text-preset-options,.text-frame-options{
  display:grid;
  gap:6px;
}
.text-preset-options{grid-template-columns:repeat(3,minmax(0,1fr))}
.text-frame-options{grid-template-columns:repeat(4,minmax(0,1fr))}
.text-preset-options button,.text-frame-options button{
  min-height:34px;
  padding:0 7px;
  border:1px solid var(--line);
  border-radius:5px;
  background:color-mix(in srgb,var(--panel2) 70%,transparent);
  color:var(--muted);
  font-size:10px;
  font-weight:700;
  cursor:pointer;
}
.text-preset-options button:hover,.text-frame-options button:hover{
  border-color:color-mix(in srgb,var(--accent) 52%,var(--line));
  color:var(--text);
}
.text-preset-options button[aria-pressed="true"],.text-frame-options button[aria-pressed="true"]{
  border-color:var(--accent);
  background:color-mix(in srgb,var(--accent) 14%,var(--panel));
  color:var(--text);
  box-shadow:inset 0 -2px var(--accent);
}
.text-category-control{
  display:grid;
  gap:9px;
  padding:11px 12px;
  border:1px solid color-mix(in srgb,var(--line) 78%,transparent);
  border-radius:9px;
  background:color-mix(in srgb,var(--panel2) 42%,transparent);
}
.text-category-control[hidden]{display:none!important}
.text-node-category-control{margin-top:12px}
.text-category-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.text-category-head>span{display:grid;gap:3px;min-width:0}
.text-category-head strong{color:var(--text);font-size:10px;font-weight:760}
.text-category-head small{color:var(--muted);font-size:8px}
.text-category-toggle{
  display:flex!important;
  align-items:center;
  gap:7px!important;
  min-width:max-content;
  min-height:30px;
  margin:0!important;
  padding:0 10px!important;
  border:1px solid var(--line)!important;
  border-radius:999px;
  background:transparent!important;
  color:var(--muted);
  font-size:9px;
  font-weight:700;
  cursor:pointer;
}
.text-category-toggle:hover,.text-category-toggle:has(input:checked){border-color:var(--accent)!important;background:color-mix(in srgb,var(--accent) 12%,var(--panel))!important;color:var(--text)}
.text-category-toggle input{
  appearance:none;
  width:14px!important;
  height:14px!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:1.5px solid color-mix(in srgb,var(--muted) 72%,var(--line))!important;
  border-radius:4px!important;
  background:transparent!important;
  box-shadow:none!important;
}
.text-category-toggle input:checked{border-color:var(--accent)!important;background:var(--accent)!important;box-shadow:inset 0 0 0 3px var(--panel)!important}
.text-category-control>label{display:grid;gap:6px;color:var(--muted);font-size:9px;font-weight:700}
.text-category-control>label[hidden]{display:none!important}
.text-category-control>#text-label-value-row input{
  width:100%;
  height:36px;
  margin:0!important;
  padding:0 11px!important;
  border:1px solid color-mix(in srgb,var(--line) 80%,transparent)!important;
  border-radius:7px!important;
  background:color-mix(in srgb,var(--panel) 82%,transparent)!important;
  color:var(--text)!important;
  font-size:11px!important;
}
.inspector #node-info-section .person-file-name[hidden]{display:none!important}
.text-control-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.text-color-controls{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.text-color-controls>label{
  display:grid;
  gap:7px;
  margin:0!important;
  padding:9px;
  border:1px solid color-mix(in srgb,var(--line) 78%,transparent);
  border-radius:6px;
  background:color-mix(in srgb,var(--panel2) 58%,transparent);
  color:var(--muted);
  font-size:9px;
}
.text-color-field{display:grid;grid-template-columns:34px minmax(0,1fr);gap:6px}
.text-color-field input[type="color"]{
  width:34px!important;
  height:32px!important;
  margin:0!important;
  padding:3px!important;
  border-radius:5px!important;
  cursor:pointer;
}
.text-color-field input[type="text"]{
  width:100%;
  min-width:0;
  height:32px!important;
  margin:0!important;
  padding:5px 7px!important;
  font:650 9px/1 ui-monospace,SFMono-Regular,Consolas,monospace!important;
  text-transform:uppercase;
}
.text-default-swatches{display:flex;align-items:center;gap:7px}
.text-default-swatches button{
  position:relative;
  width:25px;
  height:25px;
  padding:0;
  border:1px solid color-mix(in srgb,var(--line) 75%,#fff);
  border-radius:50%;
  background:var(--text-swatch);
  cursor:pointer;
  transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease;
}
.text-default-swatches button[data-text-color-swatch="#111111"],
.text-default-swatches button[data-text-frame-color-swatch="#111111"]{--text-swatch:#111}
.text-default-swatches button[data-text-color-swatch="#ffffff"],
.text-default-swatches button[data-text-frame-color-swatch="#ffffff"]{--text-swatch:#fff}
.text-default-swatches button:hover{transform:translateY(-1px);border-color:var(--accent)}
.text-default-swatches button[aria-pressed="true"]{
  border-color:var(--accent);
  box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 22%,transparent);
}
.text-default-swatches button[aria-pressed="true"]::after{
  content:"";
  position:absolute;
  inset:6px;
  border:2px solid var(--accent);
  border-radius:50%;
}
.text-control-grid label{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:7px;
  min-width:0;
  margin:0!important;
  padding:9px;
  border:1px solid color-mix(in srgb,var(--line) 78%,transparent);
  border-radius:6px;
  background:color-mix(in srgb,var(--panel2) 58%,transparent);
  color:var(--muted);
  font-size:9px;
}
.text-control-grid input[type="range"]{grid-column:1/-1;width:100%;margin:0!important}
.text-control-grid select{grid-column:1/-1;width:100%;height:32px;margin:0!important;padding:5px 8px!important}
.text-control-grid output{color:var(--text);font-size:9px;font-variant-numeric:tabular-nums}

/* Refined inspector hierarchy: segmented decisions, color workbench, gapless controls. */
.text-style-section .text-style-body{
  display:grid;
  gap:14px;
  font-family:Geist,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}
.text-style-section .text-control-label{
  display:flex;
  align-items:center;
  gap:8px;
  margin:2px 1px -5px;
  color:color-mix(in srgb,var(--text) 60%,var(--muted));
  font-size:9px;
  font-weight:760;
  letter-spacing:.06em;
}
.text-style-section .text-control-label::after{
  content:"";
  height:1px;
  flex:1;
  background:color-mix(in srgb,var(--line) 68%,transparent);
}
.text-style-section :is(.text-preset-options,.text-frame-options){
  gap:3px;
  padding:3px;
  overflow:hidden;
  border:1px solid color-mix(in srgb,var(--line) 78%,transparent);
  border-radius:9px;
  background:color-mix(in srgb,var(--panel2) 52%,transparent);
  box-shadow:inset 0 1px color-mix(in srgb,#fff 7%,transparent);
}
.text-style-section :is(.text-preset-options,.text-frame-options) button{
  min-height:39px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--muted);
  font-size:10px;
  font-weight:690;
  transition:background .18s ease,color .18s ease,box-shadow .18s ease,transform .18s ease;
}
.text-style-section :is(.text-preset-options,.text-frame-options) button:hover{
  transform:translateY(-1px);
  background:color-mix(in srgb,var(--accent) 7%,var(--panel));
  color:var(--text);
}
.text-style-section :is(.text-preset-options,.text-frame-options) button[aria-pressed="true"]{
  border:0;
  background:color-mix(in srgb,var(--accent) 14%,var(--panel));
  color:var(--text);
  box-shadow:0 3px 9px #00000012,inset 0 0 0 1px color-mix(in srgb,var(--accent) 50%,transparent);
}
.text-style-section .text-color-controls{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0;
  overflow:hidden;
  border:1px solid color-mix(in srgb,var(--line) 78%,transparent);
  border-radius:10px;
  background:color-mix(in srgb,var(--panel2) 42%,transparent);
}
.text-style-section .text-color-controls>label{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  min-width:0;
  margin:0!important;
  padding:13px;
  border:0;
  border-radius:0;
  background:transparent;
  color:color-mix(in srgb,var(--text) 62%,var(--muted));
  font-size:9px;
  font-weight:720;
}
.text-style-section .text-color-controls>label+label{
  border-left:1px solid color-mix(in srgb,var(--line) 70%,transparent);
}
.text-style-section .text-color-field{
  grid-column:1/-1;
  display:grid;
  grid-template-columns:38px minmax(0,1fr);
  gap:7px;
}
.text-style-section .text-color-field input[type="color"]{
  width:38px!important;
  height:38px!important;
  padding:4px!important;
  border-color:color-mix(in srgb,var(--line) 78%,transparent)!important;
  border-radius:7px!important;
  background:var(--panel)!important;
}
.text-style-section .text-color-field input[type="text"]{
  height:38px!important;
  padding-inline:10px!important;
  border-radius:7px!important;
  background:color-mix(in srgb,var(--panel) 82%,transparent)!important;
  font-size:10px!important;
}
.text-style-section .text-default-swatches{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
}
.text-style-section .text-default-swatches button{width:22px;height:22px}
.text-style-section .text-default-swatches button[aria-pressed="true"]::after{inset:5px;border-width:1.5px}
.text-style-section .text-control-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0;
  overflow:hidden;
  border:1px solid color-mix(in srgb,var(--line) 78%,transparent);
  border-radius:10px;
  background:color-mix(in srgb,var(--panel2) 42%,transparent);
}
.text-style-section .text-control-grid label{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-content:start;
  align-items:center;
  gap:10px;
  min-height:88px;
  margin:0!important;
  padding:13px;
  border:0;
  border-radius:0;
  background:transparent;
  color:color-mix(in srgb,var(--text) 62%,var(--muted));
  font-size:9px;
  font-weight:700;
}
.text-style-section .text-control-grid label:nth-child(odd){border-right:1px solid color-mix(in srgb,var(--line) 70%,transparent)}
.text-style-section .text-control-grid label:nth-child(-n+4){border-bottom:1px solid color-mix(in srgb,var(--line) 70%,transparent)}
.text-style-section .text-control-grid output{
  color:var(--text);
  font:700 9px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
}
.text-style-section .text-control-grid input[type="range"]{
  grid-column:1/-1;
  width:100%;
  min-height:18px;
  height:18px;
  margin:7px 0 0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  accent-color:var(--accent);
}
.text-style-section .text-control-grid select{
  grid-column:1/-1;
  width:100%;
  height:38px;
  margin:2px 0 0!important;
  padding:0 10px!important;
  border:1px solid color-mix(in srgb,var(--line) 80%,transparent)!important;
  border-radius:7px!important;
  background:color-mix(in srgb,var(--panel) 82%,transparent)!important;
  color:var(--text);
  font-size:11px;
}
.text-style-section .text-size-controls label{
  min-height:76px;
  border-bottom:0;
}
.text-style-section .text-size-controls label:first-child{border-right:1px solid color-mix(in srgb,var(--line) 70%,transparent)}
.text-style-section .text-size-controls label:nth-child(2){border-right:0}
.text-style-section .text-size-input{
  grid-column:1/-1;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:7px;
  height:38px;
  padding:0 10px;
  border:1px solid color-mix(in srgb,var(--line) 80%,transparent);
  border-radius:7px;
  background:color-mix(in srgb,var(--panel) 82%,transparent);
}
.text-style-section .text-size-input input{
  width:100%!important;
  height:34px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--text)!important;
  font:700 11px/1 ui-monospace,SFMono-Regular,Consolas,monospace!important;
}
.text-style-section .text-size-input em{color:var(--muted);font:600 9px/1 ui-sans-serif,system-ui,sans-serif;font-style:normal}
body[data-theme="morning"] .text-style-section :is(.text-preset-options,.text-frame-options),
body[data-theme="morning"] .text-style-section :is(.text-color-controls,.text-control-grid){
  background:#ffffff73;
  border-color:#dcd6e5;
}
body[data-theme="morning"] .text-style-section :is(.text-preset-options,.text-frame-options) button[aria-pressed="true"]{
  background:#fff;
  color:#4e426b;
  box-shadow:0 4px 12px #594a6a15,inset 0 -2px var(--accent);
}
.text-style-section .text-edit-group{display:grid;gap:12px;min-width:0}
.text-style-section .text-edit-group+.text-edit-group{
  margin-top:4px;
  padding-top:18px;
  border-top:1px solid color-mix(in srgb,var(--line) 78%,transparent);
}
.text-style-section .text-edit-group-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  min-height:24px;
}
.text-style-section .text-edit-group-head strong{color:var(--text);font-size:13px;font-weight:800;letter-spacing:-.015em}
.text-style-section .text-edit-group-head small{color:var(--muted);font-size:9px;font-weight:560}
.text-style-section .text-frame-settings{display:grid;gap:12px}
.text-style-section .text-frame-settings[hidden]{display:none!important}
.text-style-section .text-frame-empty-hint{
  margin:0;
  padding:12px 13px;
  border:1px dashed color-mix(in srgb,var(--line) 82%,transparent);
  border-radius:8px;
  background:color-mix(in srgb,var(--panel2) 32%,transparent);
  color:var(--muted);
  font-size:9px;
  line-height:1.55;
}
.text-style-section .text-frame-empty-hint[hidden]{display:none!important}
.text-style-section .text-color-single{grid-template-columns:minmax(0,1fr)}
.text-style-section .text-color-single>label+label{border-left:0}
.text-style-section :is(.text-typography-controls,.text-frame-controls) label{
  border-right:0;
  border-bottom:0;
}
.text-style-section :is(.text-typography-controls,.text-frame-controls) label:first-child{
  grid-column:1/-1;
  min-height:82px;
  border-right:0;
  border-bottom:1px solid color-mix(in srgb,var(--line) 70%,transparent);
}
.text-style-section :is(.text-typography-controls,.text-frame-controls) label:nth-child(2){
  border-right:1px solid color-mix(in srgb,var(--line) 70%,transparent);
  border-bottom:0;
}
.text-style-section :is(.text-typography-controls,.text-frame-controls) label:nth-child(3){border-right:0;border-bottom:0}
.text-style-section .text-frame-controls label:first-child{
  grid-column:auto;
  min-height:88px;
  border-right:1px solid color-mix(in srgb,var(--line) 70%,transparent);
  border-bottom:0;
}
.text-style-section .text-frame-controls label:nth-child(2){border-right:0}
body[data-theme="morning"] .text-style-section .text-edit-group+.text-edit-group{border-top-color:#dcd6e5}
body[data-theme="morning"] .text-style-section .text-frame-empty-hint{background:#ffffff52;border-color:#d8d2e1}
