.uml-palette { padding: 18px 16px; border-bottom: 1px solid var(--border); }
.uml-palette h2 { margin: 0 0 5px; font-size: 13px; font-weight: 650; }
.uml-palette p { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.uml-shape-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.uml-shape-grid button { display: flex; align-items: center; gap: 9px; min-height: 49px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-raised); text-align: left; font-size: 11px; line-height: 1.3; }
.uml-shape-grid button:hover, .uml-shape-grid button:focus-visible { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.uml-shape-grid svg, .uml-element-name svg { width: 32px; height: 26px; flex-shrink: 0; fill: var(--accent-soft); stroke: currentColor; stroke-width: 1.5; }
.uml-elements-heading { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px 10px; font-size: 12px; font-weight: 650; color: var(--muted); }
.uml-elements-heading span { font-variant-numeric: tabular-nums; }
.uml-element-name { display: flex; align-items: center; flex: 1; min-width: 0; gap: 8px; padding: 5px 0; text-align: left; font-size: 13px; }
.uml-element-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uml-element-name svg { width: 22px; color: var(--class-dark); fill: var(--class-light); }
.uml-editor .icon-button { flex-shrink: 0; }
.uml-node.node { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.uml-node.node.selected { box-shadow: none; outline: none; }
.uml-node .node-header { position: relative; height: 100%; padding: 16px 30px; border: 0; border-radius: 0; background: transparent; justify-content: center; }
.uml-node .uml-shape { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--class-light); stroke: var(--class-dark); color: var(--class-dark); stroke-width: 1.8; pointer-events: none; }
.uml-node.selected .uml-shape, .uml-node.uml-drop-target .uml-shape { stroke: var(--class-color); stroke-width: 3; }
.uml-node .node-name { z-index: 1; flex: 0 1 auto; max-width: 180px; font-size: 17px; line-height: 22px; font-weight: 500; white-space: normal; overflow-wrap: anywhere; }
.uml-diamond .node-header, .uml-circle .node-header { padding-inline: 20px; }
.uml-diamond .node-name { max-width: 120px; }
.uml-circle .node-name { max-width: 110px; }
.uml-node .node-name.uml-outside-label { position: absolute; left: 8px; right: 8px; top: 113px; }
.uml-initial .node-name.uml-outside-label, .uml-final .node-name.uml-outside-label { top: 63px; }
.uml-fork .node-name.uml-outside-label { top: 38px; }
.uml-port { position: absolute; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; padding: 0; border: 2px solid var(--surface-raised); border-radius: 50%; background: var(--class-color); opacity: 0; pointer-events: none; cursor: crosshair; z-index: 2; }
.uml-port.left { left: -5px; }
.uml-port.right { right: -5px; }
.uml-initial .uml-port, .uml-final .uml-port { top: 26px; }
.uml-fork .uml-port { top: 13px; }
.uml-node:hover .uml-port, .uml-node:focus-within .uml-port, .uml-node.selected .uml-port { opacity: 1; pointer-events: auto; }
.uml-edge { cursor: pointer; pointer-events: stroke; outline: none; }
.uml-edge .uml-edge-hit { fill: none; stroke: transparent; stroke-width: 16; }
.uml-edge:hover > path:first-child, .uml-edge:focus > path:first-child { stroke: var(--accent); stroke-width: 3; }
.uml-edge text { pointer-events: all; }
.uml-preview { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 4; pointer-events: none; }
@media (max-width: 480px) {
  .uml-mode .topbar { height: auto; min-height: 92px; flex-wrap: wrap; gap: 5px 12px; padding-block: 7px; }
  .uml-mode .mode-switch { order: 4; flex: 0 0 100%; justify-content: center; }
  .uml-mode .mode-switch button { white-space: nowrap; overflow-wrap: normal; padding: 6px 10px; }
  .uml-mode .workspace { height: calc(100dvh - 92px); }
  .uml-mode .sidebar-heading h1 { font-size: 15px; }
  .uml-palette { padding: 12px 9px; }
  .uml-shape-grid { gap: 5px; }
  .uml-shape-grid button { flex-direction: column; justify-content: center; gap: 4px; text-align: center; padding: 7px 4px; }
}
