:root {
    --bg: #1a1a2e;
    --panel: #16213e;
    --accent: #0f3460;
    --accent-hover: #1a3a6e;
    --text: #e0e0e0;
    --text-dim: #ccc;
    --text-muted: #888;
    --link: #a0c4ff;
    --border: #0f3460;
    --border-dim: #333;
    --separator: #555;
    --font:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
        sans-serif;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
}

#breadcrumb-bar {
    height: 32px;
    background: var(--panel);
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 13px;
    gap: 2px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
}

#crumbs {
    display: flex;
    align-items: center;
    gap: 2px;
    overflow: hidden;
    min-width: 0;

    & span {
        cursor: pointer;
        padding: 2px 6px;
        border-radius: 3px;
        color: var(--link);

        &:hover {
            background: var(--accent);
        }
        &.separator {
            cursor: default;
            color: var(--separator);
            padding: 0 1px;
            &:hover {
                background: none;
            }
        }
        &.current {
            color: var(--text);
            cursor: default;
            &:hover {
                background: none;
            }
        }
    }
}

#status {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--text-dim);
    font-size: 12px;
    padding: 0 8px;
}

#toolbar {
    height: 28px;
    background: var(--panel);
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 11px;
    gap: 6px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    user-select: none;

    & label {
        color: var(--text-muted);
    }

    & select,
    & input {
        background: var(--accent);
        color: var(--text);
        border: 1px solid var(--border-dim);
        border-radius: 3px;
        font-size: 11px;
        padding: 1px 4px;
        height: 20px;
    }

    & input[type="text"] {
        width: 90px;
    }
    & input[type="number"] {
        width: 60px;
    }

    & button {
        background: var(--accent);
        color: var(--link);
        border: 1px solid var(--border-dim);
        border-radius: 3px;
        padding: 1px 8px;
        cursor: pointer;
        font-size: 11px;
        height: 20px;
        &:hover {
            background: var(--accent-hover);
        }
    }
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 6px;
    border-right: 1px solid var(--border-dim);

    &:last-of-type {
        border-right: none;
        padding-right: 0;
    }
}

.hidden {
    display: none !important;
}

.action-button {
    background: var(--accent);
    color: var(--link);
    border: 1px solid var(--border-dim);
    border-radius: 3px;
    padding: 1px 10px;
    cursor: pointer;
    font-size: 12px;
    height: 20px;
    &:hover {
        background: var(--accent-hover);
    }
}

canvas {
    display: block;
}

/* Picker */

#picker {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px 24px;
    overflow-y: auto;
}

.picker-header {
    text-align: center;
    margin-bottom: 32px;

    & h1 {
        font-size: 28px;
        font-weight: 600;
        color: var(--text);
        margin-bottom: 8px;
    }
    & p {
        font-size: 14px;
        color: var(--text-muted);
    }
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 900px;
}

.picker-loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 32px;
    font-size: 14px;
}

.volume-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;

    &:hover {
        border-color: var(--link);
        background: var(--accent);
    }
}

.volume-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.volume-path {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    word-break: break-all;
}

.volume-bar {
    height: 6px;
    background: var(--accent);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.volume-bar-fill {
    height: 100%;
    background: var(--link);
    border-radius: 3px;
    min-width: 2px;
}

.volume-sizes {
    font-size: 12px;
    color: var(--text-dim);
}

.volume-fs {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.picker-refresh {
    margin-top: 20px;
    background: var(--accent);
    color: var(--link);
    border: 1px solid var(--border-dim);
    border-radius: 5px;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 13px;

    &:hover {
        background: var(--accent-hover);
    }
}

#path-bar {
    height: 24px;
    background: var(--panel);
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 12px;
    gap: 8px;
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
}

#path-text {
    color: var(--link);
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

#path-size {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--text-dim);
}

#tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 20;
    background: rgba(15, 15, 30, 0.94);
    border: 1px solid var(--border-dim);
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.5;
    display: none;
    max-width: 350px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);

    & .tip-name {
        font-weight: 600;
        color: #fff;
        font-size: 13px;
        margin-bottom: 2px;
    }
    & .tip-size {
        color: var(--link);
    }
    & .tip-percent {
        color: var(--text-dim);
    }
    & .tip-mtime {
        color: #999;
    }
}
