:root {
    --bg-top: #f2efe7;
    --bg-bottom: #d8e7e0;
    --text: #1f2a37;
    --muted: #4b5563;
    --card: #ffffff;
    --card-border: #c7d2d9;
    --accent: #0f766e;
    --accent-hover: #115e59;
    --shadow: rgba(31, 42, 55, 0.15);
    --edge: #9db3ad;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    font-family: "DM Sans", "Segoe UI", sans-serif;
    color: var(--text);
    overflow: hidden;
}

body {
    background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.viewport {
    position: relative;
    flex: 1;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
}

.viewport.dragging {
    cursor: grabbing;
}

.world {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.edges {
    position: absolute;
    top: 0;
    left: 0;
    overflow: visible;
    pointer-events: none;
}

.edges path {
    fill: none;
    stroke: var(--edge);
    stroke-width: 2;
}

.nodes {
    position: absolute;
    top: 0;
    left: 0;
}

.node {
    position: absolute;
    width: 200px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 22px -16px var(--shadow);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.node:hover {
    border-color: var(--accent);
    box-shadow: 0 14px 26px -16px var(--shadow);
}

.node.root {
    background: var(--accent);
    border-color: var(--accent-hover);
    color: #fff;
}

.node-hot {
    border-width: 3px;
    border-color: var(--accent);
}

.node-label {
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-path {
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node.root .node-path {
    color: rgba(255, 255, 255, 0.85);
}

.node-stats {
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.node.root .node-stats {
    color: rgba(255, 255, 255, 0.85);
}

.node-more {
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.node.root .node-more {
    color: rgba(255, 255, 255, 0.85);
}

.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--muted);
    max-width: 420px;
    pointer-events: none;
}

.empty-state p {
    margin: 6px 0;
}

.empty-state-hint {
    font-size: 0.9rem;
}

.status-bar {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--muted);
    box-shadow: 0 10px 22px -16px var(--shadow);
}

.status-bar.error {
    color: #b42318;
    border-color: #f0b8b0;
}
