:root {
    --bg: #000;
    --bg-2: #030303;
    --surface: rgba(4, 4, 4, 0.94);
    --surface-2: rgba(18, 18, 18, 0.86);
    --surface-3: rgba(78, 78, 78, 0.24);
    --text: #f7f7f4;
    --text-dim: #a9a9a4;
    --text-muted: #6d6d68;
    --line: rgba(255, 255, 255, 0.16);
    --line-bright: rgba(255, 255, 255, 0.44);
    --white: #ffffff;
    --black: #000;
    --green: #84e0a6;
    --yellow: #ddd08b;
    --red: #ff7d72;
    --shadow: 0 42px 110px rgba(0, 0, 0, 0.94);
    --soft-shadow: 0 24px 64px rgba(0, 0, 0, 0.76);
    --radius-xl: 34px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --sidebar-w: 84px;
    --font-ui: Inter, "SF Pro Text", "SF Pro Display", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
    --font-display: "SF Pro Display", Inter, "Avenir Next", "Helvetica Neue", Arial, sans-serif;
    --font-hero: "SF Pro Display", Inter, "Avenir Next", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Menlo, monospace;
}

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

html { background: var(--bg); overflow-x: hidden; }

body {
    min-height: 100vh;
    display: flex;
    color: var(--text);
    font-family: var(--font-ui);
    letter-spacing: 0;
    background:
        radial-gradient(circle at 7% 3%, rgba(255, 255, 255, 0.08) 0, rgba(255,255,255,0.018) 14rem, transparent 22rem),
        radial-gradient(circle at 84% -6%, rgba(255, 255, 255, 0.05) 0, transparent 21rem),
        linear-gradient(120deg, #010101 0%, #0b0b0b 42%, #020202 72%, #050505 100%);
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(132deg, transparent 0 35%, rgba(255,255,255,0.038) 35.1% 46%, transparent 46.2%),
        linear-gradient(158deg, transparent 0 61%, rgba(255,255,255,0.026) 61.1% 71%, transparent 71.2%);
    opacity: 1;
}

.ambient {
    position: fixed;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(52px);
    opacity: 0.18;
}

.ambient-a {
    width: 34vw;
    height: 34vw;
    left: -15vw;
    top: 5vh;
    background: rgba(255, 255, 255, 0.09);
}

.ambient-b {
    width: 28vw;
    height: 28vw;
    right: -10vw;
    bottom: 6vh;
    background: rgba(255, 255, 255, 0.06);
}

button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.sidebar {
    position: fixed;
    inset: calc(12px + env(safe-area-inset-top, 0px)) auto 12px 12px;
    z-index: 10;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 22% 5%, rgba(255,255,255,0.12), rgba(255,255,255,0.025) 8rem, transparent 15rem),
        linear-gradient(145deg, rgba(28, 28, 28, 0.82) 0%, rgba(6, 6, 6, 0.94) 58%, rgba(0,0,0,0.98) 100%);
    box-shadow: var(--soft-shadow), inset 0 1px 0 rgba(255,255,255,0.14);
    backdrop-filter: blur(26px) saturate(120%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 2px 2px 16px;
}

.sidebar-brand > div:not(.brand-mark) { display: none; }

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-bright);
    border-radius: 50%;
    background: linear-gradient(145deg, #f7f7f2, #7d7d78);
    color: #030303;
    font-size: 20px;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 18px 40px rgba(0,0,0,0.42);
}

.sidebar-brand h1 {
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
}

.version {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.nav-list {
    list-style: none;
    display: grid;
    gap: 9px;
    margin-top: 8px;
}

.nav-link {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px;
    color: var(--text-dim);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 720;
    letter-spacing: 0;
    transition: transform 150ms ease, color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.nav-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: var(--text);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 16px;
}

.nav-link:hover {
    color: var(--white);
    background: rgba(255,255,255,0.045);
}

.nav-link span:not(.nav-icon) { display: none; }

.nav-link.active {
    color: var(--white);
    background:
        radial-gradient(circle at 18% 25%, rgba(255,255,255,0.24), rgba(255,255,255,0.06) 58%, transparent 78%),
        linear-gradient(145deg, rgba(62,62,62,0.62), rgba(8,8,8,0.88) 76%);
    border-color: var(--line-bright);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

.nav-link.active .nav-icon {
    background: var(--white);
    color: var(--black);
}

.content {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 100vh;
    margin-left: calc(var(--sidebar-w) + 24px);
    padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 52px 0;
}

.topbar {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: calc(var(--sidebar-w) + 24px);
    z-index: 8;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    backdrop-filter: none;
    box-shadow: none;
    pointer-events: none;
}

.topbar h2 {
    display: none;
    font-family: var(--font-hero);
    font-size: 31px;
    font-weight: 800;
    letter-spacing: 0;
}

.topbar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    color: #6f6f69;
    font-size: 11px;
    font-weight: 620;
    border-radius: 999px;
    background: rgba(0,0,0,0.38);
    border: 1px solid rgba(255,255,255,0.045);
    box-shadow: none;
    pointer-events: auto;
}

.status-dot {
    width: 0;
    height: 0;
    display: none;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.04);
}

.status-dot.green { background: var(--green); }
.status-dot.yellow { background: var(--yellow); }
.status-dot.red { background: var(--red); }
.separator { width: 1px; height: 16px; background: rgba(255,255,255,0.14); }
.topbar-status .separator { height: 11px; background: rgba(255,255,255,0.08); }

.status-action {
    min-height: 24px;
    padding: 3px 10px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: var(--white);
    font: inherit;
    font-weight: 760;
    cursor: pointer;
}

.status-action:hover {
    border-color: rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.18);
}

.status-action:disabled {
    cursor: wait;
    color: var(--text-muted);
}

.dashboard-grid,
.indexing-section,
.settings-section,
.search-section {
    padding: 2px 8px 28px 2px;
}

.dashboard-grid,
.indexing-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-section {
    max-width: none;
    display: grid;
    gap: 18px;
}

.card,
.search-card,
.modal,
.root-item {
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at 12% 0%, rgba(255,255,255,0.18) 0, rgba(255,255,255,0.052) 9rem, transparent 17rem),
        linear-gradient(105deg, rgba(255,255,255,0.055) 0 10%, transparent 33%),
        linear-gradient(145deg, rgba(38,38,38,0.58) 0%, rgba(9,9,9,0.9) 46%, rgba(0,0,0,0.96) 100%);
    box-shadow: var(--soft-shadow), inset 0 1px 0 rgba(255,255,255,0.2);
    backdrop-filter: blur(22px) saturate(120%);
}

.root-select-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card {
    padding: 28px;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.card-wide { grid-column: 1 / -1; }

.card h3,
.modal h3 {
    margin-bottom: 14px;
    color: var(--white);
    font-family: var(--font-hero);
    font-size: 18px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0;
}

.section-note,
.text-muted {
    color: #5f5f5a;
    font-size: 13px;
    line-height: 1.45;
}

.section-note { margin: -8px 0 18px; max-width: 760px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stat-grid-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat {
    min-height: 82px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: var(--radius-md);
    background:
        radial-gradient(circle at 8% 0%, rgba(255,255,255,0.12), rgba(255,255,255,0.035) 5rem, transparent 9rem),
        linear-gradient(140deg, rgba(28,28,28,0.62), rgba(4,4,4,0.94) 66%, #000);
}

.stat-label {
    color: #5c5c57;
    font-size: 11px;
    font-weight: 720;
    text-transform: uppercase;
}

.stat-value {
    color: var(--white);
    font-size: clamp(19px, 1.7vw, 30px);
    line-height: 0.95;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.button-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.13);
    background:
        radial-gradient(circle at 24% 0%, rgba(255,255,255,0.13), transparent 4.6rem),
        linear-gradient(145deg, rgba(44,44,44,0.58), rgba(4,4,4,0.88));
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 760;
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.btn:hover:not(.disabled):not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--line-bright);
    background:
        radial-gradient(circle at 24% 0%, rgba(255,255,255,0.18), transparent 4.8rem),
        linear-gradient(145deg, rgba(58,58,58,0.7), rgba(8,8,8,0.84));
}

.btn:disabled,
.btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(145deg, #ffffff, #b6b6b0);
    color: #040404;
    border-color: rgba(255,255,255,0.72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 14px 34px rgba(255,255,255,0.09);
}

.btn-primary:hover:not(.disabled):not(:disabled) {
    background: linear-gradient(145deg, #ffffff, #d4d4d0);
    color: #000;
    border-color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 18px 42px rgba(255,255,255,0.12);
}
.btn-sm { min-height: 31px; padding: 6px 11px; font-size: 12px; }
.btn-danger { color: var(--red); }

.input {
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: var(--radius-md);
    outline: none;
    background: rgba(0,0,0,0.82);
    color: var(--text);
    font-size: 14px;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.input::placeholder { color: #7b7b76; }
.input:focus {
    border-color: rgba(255,255,255,0.46);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.075);
    background: rgba(0,0,0,0.94);
}

select.input {
    appearance: none;
    padding-right: 34px;
    color: var(--text-dim);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23d8d8d3' d='M3.2 5.1 7 8.9l3.8-3.8.8.8L7 10.5 2.4 5.9z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}

.search-hero {
    position: relative;
    min-height: 370px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 22px;
    margin-bottom: 8px;
    padding: clamp(24px, 4vw, 48px);
    overflow: visible;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 70% 26%, rgba(255,255,255,0.17) 0, rgba(255,255,255,0.034) 10rem, transparent 18rem),
        radial-gradient(circle at 18% 8%, rgba(255,255,255,0.08) 0, transparent 13rem),
        linear-gradient(145deg, #141414 0%, #050505 52%, #000 100%);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.18);
}

.search-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    overflow: hidden;
    background:
        linear-gradient(112deg, transparent 0 56%, rgba(255,255,255,0.035) 56.2% 63%, transparent 63.3%),
        radial-gradient(circle at 12% 100%, rgba(255,255,255,0.04), transparent 12rem);
}

.hero-geometry {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}

.hero-geometry span {
    position: absolute;
    display: block;
    border: 1px solid rgba(255,255,255,0.42);
    background: linear-gradient(145deg, rgba(255,255,255,0.25), rgba(255,255,255,0.008) 70%);
    box-shadow: 0 24px 48px rgba(0,0,0,0.38);
    transform: rotate(-22deg);
}

.hero-geometry span:nth-child(1) {
    width: 150px;
    height: 265px;
    right: 19%;
    top: -66px;
}

.hero-geometry span:nth-child(2) {
    width: 315px;
    height: 210px;
    right: -8%;
    top: 92px;
}

.hero-geometry span:nth-child(3) {
    width: 34px;
    height: 250px;
    right: 31%;
    top: 86px;
    background: rgba(255,255,255,0.52);
}

.search-hero-copy,
.search-bar-wrap {
    position: relative;
    z-index: 1;
}

.search-hero-copy {
    max-width: 760px;
}

.search-hero-copy h1 {
    max-width: 700px;
    color: var(--white);
    font-family: var(--font-hero);
    font-size: clamp(44px, 6.4vw, 86px);
    line-height: 0.94;
    font-weight: 800;
    letter-spacing: 0;
}

.search-hero-copy p {
    max-width: 440px;
    margin-top: 14px;
    color: #8f8f89;
    font-size: 15px;
    line-height: 1.35;
    font-family: var(--font-ui);
    font-weight: 560;
}

.search-bar-wrap {
    position: relative;
    max-width: 820px;
    display: flex;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-lg);
    background: rgba(0,0,0,0.84);
    backdrop-filter: blur(16px);
}

.search-clear,
.search-spinner {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
}

.search-clear {
    right: 154px;
    width: 30px;
    height: 30px;
    display: none;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #a9a9a4;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.search-clear.visible,
.search-bar-wrap:focus-within .search-clear { display: grid; }
.search-clear:hover { color: var(--white); border-color: rgba(255,255,255,0.28); }

.search-spinner {
    right: 194px;
    width: 18px;
    height: 18px;
    display: none;
    border: 2px solid rgba(255,255,255,0.18);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 750ms linear infinite;
}

.search-spinner.visible { display: block; }

@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

.search-input {
    flex: 1;
    min-height: 58px;
    border-radius: var(--radius-md);
    border-color: transparent;
    background: transparent;
    font-size: 18px;
    padding-right: 72px;
}

.search-input:focus {
    border-color: transparent;
    box-shadow: none;
    background: transparent;
}

.search-bar-wrap .btn-primary {
    min-width: 132px;
    min-height: 58px;
    border-radius: var(--radius-md);
}

.hero-controls {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: -4px;
}

.show-all-btn {
    background: rgba(0,0,0,0.82);
    border: 1px solid rgba(255,255,255,0.13);
    box-shadow: none;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 400;
    padding: 8px 13px;
    min-height: 40px;
    border-radius: var(--radius-md);
    transition: border-color 140ms ease, color 140ms ease;
}

.show-all-btn:hover:not(.disabled):not(:disabled) {
    background: rgba(0,0,0,0.82);
    border-color: rgba(255,255,255,0.26);
    color: var(--text);
    transform: none;
    box-shadow: none;
}

.input-sm { width: auto; min-width: 150px; min-height: 40px; padding: 8px 13px; font-size: 13px; }
.search-result-count { margin-left: auto; color: var(--text-dim); font-size: 12px; font-weight: 400; }

.ext-filter-wrap { position: relative; }
.ext-filter-btn {
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    min-width: 120px;
    color: var(--text-dim);
}
.ext-filter-btn.has-selection { color: var(--text); font-weight: 600; }
.ext-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 160px;
    margin-top: 4px;
    padding: 6px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(12, 12, 12, 0.96);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.ext-filter-list { max-height: 240px; overflow-y: auto; }
.ext-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 560;
    color: var(--text-muted);
    border-radius: 8px;
    transition: background 120ms ease, color 120ms ease;
}
.ext-filter-item:hover { background: rgba(255,255,255,0.06); color: var(--text-dim); }
.ext-filter-item.checked { color: var(--text); font-weight: 660; }
.ext-filter-item input[type="checkbox"] { accent-color: var(--white); }
.ext-filter-count { margin-left: auto; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.ext-filter-actions {
    border-top: 1px solid var(--line);
    padding: 6px 10px 2px;
    display: flex;
    justify-content: flex-end;
}
.btn-xs { font-size: 11px; padding: 3px 10px; min-height: auto; }

.project-filter-wrap { position: relative; }
.project-filter-btn {
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    min-width: 120px;
    color: var(--text-dim);
}
.project-filter-btn.has-selection { color: var(--text); font-weight: 600; }
.project-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 220px;
    margin-top: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(12, 12, 12, 0.96);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    overflow: hidden;
}
.project-filter-search-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-radius: 0;
    background: transparent;
    font-size: 12px;
    padding: 9px 14px;
    color: var(--text);
    outline: none;
    min-height: auto;
}
.project-filter-search-input::placeholder { color: var(--text-muted); }
.project-filter-list { max-height: 220px; overflow-y: auto; padding: 4px 0; }
.project-filter-item {
    display: block;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 100ms ease, color 100ms ease;
}
.project-filter-item:hover { background: rgba(255,255,255,0.06); color: var(--text-dim); }
.project-filter-item.selected { color: var(--text); font-weight: 560; }

.selection-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    padding: 4px 0;
}

.selection-toolbar #selection-count {
    font-size: 11px;
    font-family: 'DM Mono', var(--font-mono);
    font-weight: 400;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.02em;
    margin-right: 8px;
}

.selection-toolbar .btn,
.selection-toolbar .btn-primary {
    background: none;
    border: none;
    box-shadow: none;
    color: rgba(255,255,255,0.3);
    font-size: 11px;
    font-weight: 400;
    min-height: auto;
    padding: 0;
    border-radius: 0;
    letter-spacing: 0;
    transition: color 120ms ease;
}

.selection-toolbar .btn:hover:not(.disabled):not(:disabled),
.selection-toolbar .btn-primary:hover:not(.disabled):not(:disabled) {
    background: none;
    border: none;
    transform: none;
    box-shadow: none;
    color: rgba(255,255,255,0.7);
}

.selection-toolbar-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.selection-toolbar-dropdown { position: relative; display: inline-block; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 132px;
    z-index: 20;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(0,0,0,0.98);
    backdrop-filter: blur(20px);
    box-shadow: var(--soft-shadow);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}

.dropdown-item:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px;
    gap: 12px;
}

.pagination-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    padding: 4px 0;
    transition: color 140ms ease;
}

.pagination-btn:hover:not(:disabled) { color: rgba(255,255,255,0.85); }
.pagination-btn:disabled { opacity: 0.2; cursor: default; }

.pagination-info {
    color: rgba(255,255,255,0.25);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0;
}

.search-card {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    background: #0a0a0a;
    border-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
    transition: box-shadow 180ms ease;
}

.search-card:hover {
    border-color: transparent;
    box-shadow: none;
}

.search-card.selected {
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.82);
    position: relative;
    z-index: 2;
}

.search-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.42) 40%, rgba(0,0,0,0.72) 100%);
    pointer-events: none;
    z-index: 1;
    transition: opacity 200ms ease;
}

.search-card-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: inherit;
    background: linear-gradient(145deg, #090909, #000 72%);
}

.search-card-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.search-card-thumb .no-thumb {
    color: rgba(255,255,255,0.42);
    font-size: 34px;
}

.search-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 4px 12px 8px;
}

.search-card-title {
    color: rgba(255,255,255,0.55);
    font-family: 'DM Mono', var(--font-mono);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}

.search-card-folder {
    color: rgba(255,255,255,0.44);
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

.search-card-check {
    position: absolute;
    top: 17px;
    left: 17px;
    z-index: 3;
    width: 20px;
    height: 20px;
    font-size: 10px;
    display: grid;
    place-items: center;
    border: 1.5px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    background: rgba(0,0,0,0.28);
    color: transparent;
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 160ms ease, background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.search-card:hover .search-card-check { opacity: 1; }

.search-card.selected .search-card-check {
    opacity: 1;
    background: rgba(255,255,255,0.92);
    color: #000;
    border-color: transparent;
}

.search-empty {
    padding: 30px 16px;
    text-align: center;
}

.progress-bar-label { font-family: var(--font-ui); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.35); }
.progress-bar-wrap { display: flex; align-items: flex-start; gap: 3px; }
.progress-bar {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    width: 100%;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255,255,255,0.4), #fff);
    transition: width 300ms ease;
}

.progress-side {
    min-width: 58px;
    text-align: right;
    margin-right: 4px;
}

.progress-text {
    color: var(--text-dim);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.queue-progress-bars { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.queue-progress-row { display: flex; flex-direction: column; gap: 4px; }
.queue-progress-header { display: flex; align-items: baseline; justify-content: space-between; }
.queue-progress-header .progress-text { font-variant-numeric: tabular-nums; }
.queue-progress-header .progress-failed { font-size: 10px; color: #e55; margin-left: 6px; font-weight: 400; letter-spacing: 0; text-transform: none; }

.progress-elapsed {
    display: block;
    margin-top: 3px;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.processing-files {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}
.current-file-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 12px;
    overflow: hidden;
    animation: fadeInFile 0.2s ease;
}

.current-file-indicator-complete {
    border-color: rgba(123,255,179,0.24);
    background: rgba(123,255,179,0.08);
}

@keyframes fadeInFile {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.current-file-label {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.current-file-name {
    flex: 1 1 auto;
    color: var(--white);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: rtl;
    text-align: left;
}
.current-file-ext {
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.roots-list { display: grid; gap: 10px; }

.root-item {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    padding: 14px;
    border-radius: var(--radius-lg);
    min-width: 0;
    background:
        linear-gradient(120deg, rgba(34,34,34,0.82) 0%, rgba(12,12,12,0.94) 44%, rgba(0,0,0,0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 12px 30px rgba(0,0,0,0.42);
}

.root-item-info { flex: 1; min-width: 0; }
.root-item-topline,
.queue-item-topline {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}
.root-item-name { color: var(--white); font-size: 14px; font-weight: 760; }
.root-item-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 780;
    letter-spacing: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.root-item-path {
    margin-top: 3px;
    color: #8b8b86;
    font-size: 12px;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.folder-size {
    flex: 0 0 auto;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 760;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.root-item-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.settings-form { display: grid; gap: 14px; }
.settings-row { display: grid; gap: 6px; }
.settings-row label,
.model-select-row label {
    color: #5d5d58;
    font-size: 11px;
    font-weight: 760;
    text-transform: uppercase;
}
.settings-row .input { max-width: 440px; }

.model-select-row { display: grid; gap: 6px; margin-bottom: 14px; }
.models-list { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.models-list h4 { margin-bottom: 8px; color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
.model-tag {
    display: inline-flex;
    align-items: center;
    margin: 3px;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    background: rgba(0,0,0,0.76);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(0,0,0,0.86);
    backdrop-filter: blur(18px);
}

.modal {
    width: 500px;
    max-width: 92vw;
    max-height: 84vh;
    overflow-y: auto;
    padding: 26px;
    border-radius: var(--radius-xl);
}

.modal-wide { width: 640px; }
.modal-buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.error-text { margin-top: 8px; color: var(--red); font-size: 13px; }

.modal-detail {
    position: relative;
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    padding: 0;
    overflow: hidden;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    background: rgba(0,0,0,0.9);
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    backdrop-filter: blur(14px);
    transition: border-color 140ms ease, background 140ms ease;
}

.modal-close:hover {
    border-color: rgba(255,255,255,0.32);
    background: rgba(255,255,255,0.1);
}

.detail-layout {
    display: flex;
    height: 100%;
    max-height: none;
}

.detail-media-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #000;
}

.detail-media-shell {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
    background: #000;
}

.detail-media-shell:fullscreen {
    width: 100vw;
    height: 100vh;
    background: #000;
}

.detail-media-shell:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    background: #000;
}

body.media-pseudo-fullscreen {
    overflow: hidden;
}

.detail-media-shell.is-pseudo-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 9999;
    background: #000;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

@supports (padding-top: env(safe-area-inset-top)) {
    .detail-media-shell.is-pseudo-fullscreen {
        top: calc(-1 * env(safe-area-inset-top));
        left: calc(-1 * env(safe-area-inset-left));
        right: calc(-1 * env(safe-area-inset-right));
        bottom: calc(-1 * env(safe-area-inset-bottom));
        width: calc(100vw + env(safe-area-inset-left) + env(safe-area-inset-right));
        height: calc(100dvh + env(safe-area-inset-top) + env(safe-area-inset-bottom));
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }
}

.detail-media {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: contain;
    cursor: grab;
}

.detail-media.is-dragging { cursor: grabbing; }

.detail-media video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    outline: none;
}

.detail-media-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    transform-origin: center center;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
}

.detail-media-video {
    cursor: default;
    touch-action: auto;
}

.detail-media-toolbar {
    position: absolute;
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 58px;
    z-index: 11;
    display: flex;
    gap: 8px;
}

.media-tool-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    background: rgba(0,0,0,0.78);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(14px);
    transition: border-color 140ms ease, background 140ms ease;
}

.media-tool-btn:hover {
    border-color: rgba(255,255,255,0.32);
    background: rgba(255,255,255,0.1);
}

.detail-info {
    width: 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    overflow-y: auto;
    border-left: none;
    background: #000;
}

.detail-info h3 {
    margin: 0 38px 12px 0;
    color: rgba(255,255,255,0.6);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.3;
    font-weight: 400;
    letter-spacing: 0.01em;
    word-break: break-word;
}

.detail-section {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.detail-section-label {
    margin-bottom: 10px;
    color: #60605a;
    font-size: 9px;
    font-weight: 400;
    text-transform: uppercase;
}

.detail-meta,
.detail-segment-caption {
    color: #92928c;
    font-size: 12px;
    line-height: 1.45;
}

.detail-meta {
    display: grid;
    gap: 9px;
}

.detail-meta-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.detail-meta-card-title {
    grid-column: 1 / -1;
    color: #70706a;
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
}

.detail-meta-row {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.detail-meta-label {
    color: #6d6d67;
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
}

.detail-meta-value {
    color: #d7d7d0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.25;
    word-break: break-word;
}

.detail-path {
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.07);
    color: #8f8f87;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.5;
    word-break: break-all;
}

.manual-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 26px;
}

.manual-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--white);
    font-size: 11px;
    font-weight: 720;
}

.manual-tag button {
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.42);
    color: #aaa;
    cursor: pointer;
}

.manual-tag-editor {
    display: flex;
    gap: 8px;
    margin-top: 9px;
}

.manual-tag-editor .input {
    min-height: 34px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.manual-tag-status {
    min-height: 18px;
    margin-top: 6px;
    font-size: 11px;
}

.detail-caption {
    color: #92928c;
    font-size: 12px;
    line-height: 1.5;
}

.detail-feedback,
.detail-actions-row,
.detail-nav { display: flex; gap: 7px; flex-wrap: wrap; }
.detail-actions { display: grid; gap: 4px; margin-top: auto; padding-top: 14px; }
.btn-action { flex: 1 1 46%; white-space: nowrap; }
.detail-nav { align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.07); }
.detail-nav-pos { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.feedback-status { color: var(--green); font-size: 12px; }

.detail-info .btn {
    background: none;
    border: none;
    border-radius: 0;
    color: #6d6d67;
    font-size: 12px;
    font-weight: 400;
    min-height: 28px;
    padding: 4px 0;
    text-align: left;
    transition: color 140ms ease;
}
.detail-info .btn:hover:not(:disabled) {
    background: none;
    border: none;
    transform: none;
    color: rgba(255,255,255,0.75);
}
.detail-info .btn-primary {
    background: none;
    border: none;
    box-shadow: none;
    color: rgba(255,255,255,0.55);
}
.detail-info .btn-primary:hover:not(:disabled) {
    background: none;
    border: none;
    box-shadow: none;
    color: rgba(255,255,255,0.85);
}

.detail-timeline,
.detail-segment-thumbs {
    padding: 10px 14px;
    background: rgba(0,0,0,0.92);
}

.timeline-bar {
    position: relative;
    height: 7px;
    margin-bottom: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
    cursor: pointer;
}

.timeline-fill { height: 100%; width: 0; border-radius: inherit; background: #fff; transition: width 100ms linear; }
.timeline-playhead {
    position: absolute;
    top: -4px;
    left: 0;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    transform: translateX(-50%);
}

.timeline-segments { display: flex; gap: 3px; min-height: 22px; }
.timeline-seg {
    flex: 1;
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(0,0,0,0.72);
    color: #666660;
    font-size: 9px;
    cursor: pointer;
    overflow: hidden;
    transition: background 120ms ease, color 120ms ease;
}
.timeline-seg:hover,
.timeline-seg.active { background: rgba(255,255,255,0.24); color: var(--white); }
.timeline-seg.matched { outline: 1px solid var(--green); }

.detail-segment-thumbs { display: flex; gap: 6px; overflow-x: auto; }
.seg-thumb {
    position: relative;
    width: 88px;
    height: 54px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.82);
    cursor: pointer;
}
.seg-thumb img { width: 100%; height: 100%; object-fit: cover; }
.seg-thumb { transition: border-color 140ms ease; }
.seg-thumb:hover,
.seg-thumb.active { border-color: #fff; }
.seg-thumb.matched { border-color: var(--green); }
.seg-thumb-time {
    position: absolute;
    inset: auto 0 0;
    padding: 2px;
    color: #fff;
    background: rgba(0,0,0,0.65);
    font-size: 9px;
    text-align: center;
}


@media (max-width: 980px) {
    .dashboard-grid,
    .indexing-section { grid-template-columns: 1fr; }
    .stat-grid-wide { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .topbar { align-items: center; flex-direction: row; }
    .search-hero { min-height: 380px; }
}

@media (max-width: 1120px) {
    .modal-detail {
        width: calc(100vw - 18px);
        height: calc(100vh - 18px);
    }

    .detail-layout {
        flex-direction: column;
    }

    .detail-media-col {
        flex: 1 1 58vh;
        min-height: 44vh;
    }

    .detail-info {
        width: 100%;
        min-width: 0;
        max-height: 42vh;
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 720px) {
    body { display: block; }
    .sidebar {
        inset: auto 12px 12px;
        width: auto;
        height: 72px;
        flex-direction: row;
        align-items: center;
        border-radius: var(--radius-lg);
    }
    .sidebar-brand { display: none; }
    .nav-list { width: 100%; grid-template-columns: repeat(3, 1fr); margin: 0; gap: 6px; }
    .nav-link { min-height: 48px; }
    .content {
        margin-left: 0;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 104px;
    }
    .topbar {
        left: 12px;
        right: 12px;
        bottom: 92px;
        margin: 0;
        border-radius: 0;
    }
    .topbar-status { max-width: 100%; overflow-x: auto; }
    .search-hero {
        min-height: 420px;
        border-radius: var(--radius-xl);
    }
    .search-hero-copy h1 { font-size: clamp(42px, 13vw, 66px); }
    .hero-geometry span:nth-child(1) { right: 8%; top: -74px; }
    .hero-geometry span:nth-child(2) { right: -38%; top: 100px; }
    .hero-geometry span:nth-child(3) { right: 30%; top: 116px; }
    .search-bar-wrap,
    .search-filters { flex-direction: column; align-items: stretch; }
    .search-clear { right: 18px; top: 37px; }
    .search-spinner { right: 56px; top: 37px; }
    .search-bar-wrap .btn-primary,
    .input-sm { width: 100%; }
    .show-all-btn { align-self: stretch; margin-top: -8px; }
    .search-result-count { margin-left: 0; }
    .stat-grid,
    .stat-grid-wide { grid-template-columns: 1fr; }
    .detail-media-col { min-height: 40vh; }
    .detail-info { max-height: 45vh; padding: 20px; }
    .detail-meta-card { grid-template-columns: 1fr; }
    .detail-media-toolbar { right: 58px; }
    .root-item { align-items: flex-start; flex-wrap: wrap; }
    .root-item-actions { width: 100%; justify-content: flex-start; }
    .manual-tag-editor { flex-direction: column; }
}

/* ── Index Data in detail modal ── */
.detail-index-data {
    margin-top: 8px;
}
.index-data-group {
    margin-bottom: 12px;
}
.index-data-label {
    font-size: 10px;
    font-weight: 720;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.index-data-desc {
    font-size: 12px;
    color: var(--text);
    line-height: 1.5;
    margin: 0;
}
.index-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.index-tag {
    display: inline-block;
    background: rgba(255,255,255,0.06);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
}
.index-attr-row {
    display: flex;
    gap: 8px;
    font-size: 12px;
    padding: 2px 0;
}
.index-attr-label {
    color: var(--text-muted);
    min-width: 100px;
}
.index-attr-value {
    color: var(--text);
}
.btn-text {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px 0;
    font-size: 12px;
    font-weight: 620;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 120ms ease;
}
.btn-text:hover {
    color: var(--white);
}

/* ── Failed counter ── */
.progress-failed {
    color: var(--red);
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* ── Queue UI ── */
.queue-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.queue-timer-row {
    display: flex;
    gap: 24px;
}

.queue-timer {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.queue-timer-label {
    font-size: 10px;
    font-weight: 720;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.queue-timer-value {
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.queue-list {
    margin-top: 14px;
}

.queue-list-header {
    font-size: 10px;
    font-weight: 720;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    margin-bottom: 4px;
    transition: background 150ms ease, border-color 150ms ease;
}

.queue-item:hover {
    background: var(--surface-3);
}

.queue-item.is-running {
    border-color: var(--green);
    background: rgba(132, 224, 166, 0.06);
}

.queue-item.is-completed {
    opacity: 0.45;
}

.queue-item.is-cancelled {
    opacity: 0.35;
}

.queue-item-drag {
    cursor: grab;
    color: var(--text-muted);
    font-size: 16px;
    padding: 0 2px;
    user-select: none;
}

.queue-item-drag:active {
    cursor: grabbing;
}

.queue-item-info {
    flex: 1;
    min-width: 0;
}

.queue-item-name {
    font-size: 13px;
    font-weight: 660;
    color: var(--text);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-path {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 999px;
}

.queue-item-status.status-pending {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
}

.queue-item-status.status-running {
    color: var(--green);
    background: rgba(132, 224, 166, 0.1);
}

.queue-item-status.status-completed {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
}

.queue-item-status.status-cancelled {
    color: var(--red);
    background: rgba(255, 125, 114, 0.08);
}

.queue-item-progress {
    font-size: 11px;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    min-width: 60px;
    text-align: right;
}

.queue-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity 150ms ease;
}

.queue-item:hover .queue-item-remove {
    opacity: 1;
}

.queue-item-remove:hover {
    color: var(--red);
    background: rgba(255, 125, 114, 0.1);
}

/* Touch devices have no hover — always show the remove button */
@media (hover: none) {
    .queue-item-remove {
        opacity: 0.7;
    }
}

.queue-item.is-dragging {
    opacity: 0.15;
}

/* Floating ghost card that follows the cursor / finger */
.queue-item-ghost {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.92;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px var(--green);
    border-radius: 14px;
    background: var(--surface-2);
    transform: scale(1.02);
}

/* Gap indicators where the card will land */
.queue-item.drop-above {
    border-top: 2px solid var(--green);
    margin-top: 2px;
    padding-top: 6px;
}

.queue-item.drop-below {
    border-bottom: 2px solid var(--green);
    margin-bottom: 2px;
    padding-bottom: 6px;
}
