.app-context{margin-left:.35rem;padding-left:.8rem;border-left:1px solid color-mix(in srgb,var(--color-text-on-dark) 38%,transparent);color:var(--color-highlight);font-weight:700}
.account-menu a{padding:.72rem 1rem;color:var(--color-text);border-radius:8px;text-decoration:none}
.custom-tree-page{display:grid;gap:.8rem;width:calc(100% - 1rem);margin:0 auto;padding:.85rem 0 2rem;color:var(--color-text-on-dark)}
.custom-tree-header{display:flex;flex-wrap:wrap;gap:1rem;align-items:end;justify-content:space-between}
.custom-tree-header h1{max-width:none;margin:.15rem 0;font-size:clamp(1.8rem,4vw,3rem)}
.custom-tree-header p{margin-bottom:0}
.custom-tree-breadcrumb{display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:.65rem;font-size:.86rem}
.custom-tree-breadcrumb a{color:var(--color-text-on-dark)}
.custom-tree-header-actions{display:grid;grid-template-columns:1fr;gap:.45rem;align-items:stretch}
.custom-tree-header-actions .button{text-align:center}
.save-state{min-width:110px;padding:.45rem .65rem;border:1px solid color-mix(in srgb,var(--color-text-on-dark) 35%,transparent);border-radius:999px;text-align:center;font-size:.78rem}
.save-state[data-state="saved"]{border-color:var(--color-success)}.save-state[data-state="dirty"]{border-color:var(--color-warning)}.save-state[data-state="error"]{border-color:var(--color-error)}
.tree-library,.custom-tree-toolbar{display:grid;grid-template-columns:1fr;gap:.45rem;align-items:stretch;padding:.75rem;border:1px solid var(--color-border);border-radius:12px;color:var(--color-text);background:color-mix(in srgb,var(--color-surface) 96%,transparent);box-shadow:var(--shadow)}
.tree-library h2,.custom-tree-toolbar h2{margin:0;color:var(--color-primary);font:800 .72rem Arial,sans-serif;letter-spacing:.09em;text-transform:uppercase}
.tree-library label{display:grid;min-width:0;gap:.25rem;font-size:.75rem;font-weight:800;text-transform:uppercase}
.tree-library .button,.custom-tree-toolbar .button,.custom-tree-toolbar .import-button{width:100%;text-align:center}
.tree-library select,.form select,.form textarea{width:100%;padding:.7rem;border:1px solid var(--color-border);border-radius:7px;color:var(--color-text);background:var(--color-surface)}
.currency-filter{display:flex;gap:.25rem;padding:.25rem;border-radius:9px;background:var(--color-surface-muted)}
.currency-filter button{padding:.45rem .7rem;color:var(--color-text);border:0;background:transparent}
.currency-filter button.active{color:var(--color-text-on-dark);background:var(--color-primary)}
.custom-zoom-controls{display:grid;grid-template-columns:auto 1fr auto;gap:.3rem}.custom-zoom-controls button,.custom-zoom-controls output{min-width:0;padding:.45rem .5rem;border:1px solid var(--color-border);border-radius:8px;color:var(--color-text);background:var(--color-surface);font:800 .75rem Arial,sans-serif;text-align:center}.custom-zoom-controls button:last-child{grid-column:1 / -1}
.custom-tree-toolbar .active{color:var(--color-text-on-dark);background:var(--color-highlight)}
.custom-tree-toolbar hr{width:100%;margin:.15rem 0;border:0;border-top:1px solid var(--color-border)}
.import-button{position:relative;overflow:hidden;cursor:pointer}
.import-button input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.editor-message{min-height:1.4rem;margin:0;padding:.6rem .7rem;color:var(--color-text);border-left:4px solid var(--color-highlight);border-radius:7px;background:color-mix(in srgb,var(--color-surface) 92%,transparent);font-size:.78rem;line-height:1.4}
.editor-message.error{border-color:var(--color-error);color:var(--color-error)}
.custom-tree-workspace{display:grid;grid-template-columns:290px minmax(0,1fr);min-height:1122px;gap:.75rem;align-items:start}
.editor-sidebar{position:sticky;top:88px;display:grid;min-width:0;gap:.65rem;align-content:start}
.selection-panel{min-width:0;padding:1rem;color:var(--color-text);border:1px solid var(--color-border);border-radius:12px;background:var(--color-surface);box-shadow:var(--shadow)}
.selection-panel h2,.selection-panel h3{overflow-wrap:anywhere}.selection-panel p{overflow-wrap:anywhere;line-height:1.45}.selection-panel hr{border:0;border-top:1px solid var(--color-border)}
.selection-hint{color:var(--color-secondary);font-size:.78rem}.currency-chip{display:inline-block;padding:.15rem .4rem;border-radius:999px;color:var(--color-text-on-dark);font:800 .7rem Arial,sans-serif}.currency-chip.sp{background:var(--color-primary)}.currency-chip.ep{background:var(--color-secondary);color:var(--color-text)}
.custom-tree-viewport{position:relative;width:100%;height:1122px;max-width:100%;overflow:hidden;border:1px solid var(--color-border);border-radius:12px;background:color-mix(in srgb,var(--color-surface-muted) 82%,var(--color-background-dark));box-shadow:var(--shadow);cursor:grab;touch-action:none}.custom-tree-viewport.is-panning{cursor:grabbing;user-select:none}
.custom-tree-board{position:absolute;width:1800px;height:1100px;overflow:hidden;background:radial-gradient(circle at center,color-mix(in srgb,var(--color-primary) 7%,var(--color-surface)) 0,var(--color-surface) 72%);transform-origin:0 0;text-rendering:optimizeLegibility}
.custom-tree-edges,.custom-tree-nodes{position:absolute;inset:0;width:1800px;height:1100px}
.custom-tree-edges{z-index:1;overflow:visible;shape-rendering:geometricPrecision}.custom-tree-nodes{z-index:2;pointer-events:none}
.custom-tree-edge{fill:none;stroke-width:3;stroke-linecap:round;pointer-events:none}.custom-tree-edge.currency-sp{stroke:var(--color-primary)}.custom-tree-edge.currency-ep{stroke:var(--color-secondary)}.custom-tree-edge.selected{stroke:var(--color-warning);stroke-width:6}
.custom-tree-edge-hit{fill:none;stroke:transparent;stroke-width:18;pointer-events:stroke;cursor:pointer}
.custom-tree-ring{fill:none;stroke:color-mix(in srgb,var(--color-primary) 28%,transparent);stroke-width:1.5;stroke-dasharray:7 8;pointer-events:none}.custom-tree-center circle{fill:var(--color-primary);stroke:var(--color-highlight);stroke-width:3}.custom-tree-center text{fill:var(--color-text-on-dark);font:900 12px Arial,sans-serif;letter-spacing:1px;pointer-events:none}
.custom-skill-node{position:absolute;display:grid;width:184px;min-height:88px;place-content:center;gap:.4rem;padding:.65rem .75rem;transform:translate(-50%,-50%);pointer-events:auto;user-select:none;color:var(--color-text);border:2px solid var(--color-primary);border-radius:13px;background:var(--color-surface);box-shadow:0 5px 16px color-mix(in srgb,var(--color-border) 25%,transparent);text-align:center;cursor:pointer}
.custom-skill-node:hover,.custom-skill-node:focus-visible,.custom-skill-node:active{z-index:30;transform:translate(-50%,-50%)}
.custom-skill-node.currency-ep{border-color:var(--color-secondary)}.custom-skill-node.selected{outline:4px solid var(--color-warning);outline-offset:3px}.custom-skill-node.link-source{outline:4px solid var(--color-success);outline-offset:3px}
.custom-skill-node strong{overflow-wrap:anywhere;font-size:.9rem;line-height:1.12}.custom-node-cost{width:max-content;margin:auto;padding:.12rem .4rem;border:1px solid currentColor;border-radius:999px;font:800 .7rem Arial,sans-serif}
.custom-node-tooltip{position:absolute;z-index:50;top:calc(100% + .45rem);left:0;display:grid;width:310px;gap:.5rem;padding:.7rem;visibility:hidden;opacity:0;color:var(--color-text);border:1px solid var(--color-border);border-radius:9px;background:var(--color-surface);box-shadow:var(--shadow);font-size:.78rem;font-weight:400;line-height:1.4;text-align:left;pointer-events:none;transform:translateY(-3px);transition:opacity .12s ease,transform .12s ease,visibility .12s ease}
.custom-skill-node:hover .custom-node-tooltip,.custom-skill-node:focus-visible .custom-node-tooltip{visibility:visible;opacity:1;transform:translateY(0)}
.custom-node-effects{display:grid;gap:.25rem;padding-top:.45rem;border-top:1px solid var(--color-border)}.custom-node-effects b{color:var(--color-primary);font:800 .68rem Arial,sans-serif;text-transform:uppercase}.custom-node-effects span{padding-left:.45rem;border-left:2px solid var(--color-highlight)}
.custom-tree-empty{position:absolute;z-index:3;top:48%;left:50%;max-width:420px;transform:translate(-50%,-50%);color:var(--color-secondary);text-align:center}.custom-tree-empty[hidden]{display:none}
.share-fields{display:grid;gap:.55rem;margin:0;padding:1rem;border:1px solid var(--color-border);border-radius:8px}.share-fields label{display:grid;grid-template-columns:auto 1fr;gap:.55rem;align-items:center;margin:0}.share-fields input{width:auto}
@media(max-width:900px){.custom-tree-workspace{grid-template-columns:1fr}.editor-sidebar{position:static;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.custom-tree-header-actions,.editor-message,.selection-panel{grid-column:1 / -1}.custom-tree-header{align-items:flex-start}.custom-tree-viewport{height:1122px}}
@media(max-width:620px){.app-context{display:none}.custom-tree-page{width:calc(100% - .5rem)}.editor-sidebar{grid-template-columns:1fr}.custom-tree-header-actions,.editor-message,.selection-panel{grid-column:auto}.custom-tree-header-actions>*{text-align:center}}
@media(prefers-reduced-motion:reduce){.custom-skill-node,.custom-node-tooltip{transition:none}}
