/* ═══════════════════════════════════════════════════════════
   Layout — Header, Sidebar (collapsible), Main Panels
   ═══════════════════════════════════════════════════════════ */

/* ── Header ── */
header {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-mid);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    height: 34px;
}

header h1 {
    font-family: var(--font-sans);
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2.5px;
    user-select: none;
}

#dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-mid);
    transition: all .3s;
    flex-shrink: 0;
}

#dot.run {
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse 1.4s infinite;
}

#dot.ok {
    background: var(--blue);
}

#dot.err {
    background: var(--red);
}

#hst {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

#htopic {
    font-size: var(--fs-xs);
    color: var(--accent-dim);
    max-width: 380px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#hrun {
    font-size: var(--fs-xs);
    color: var(--text-dim);
    font-family: monospace;
}

#htime {
    margin-left: auto;
    font-size: var(--fs-sm);
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

/* ── Main Layout ── */
main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Left Sidebar (collapsible) ── */
.left {
    width: var(--sidebar-w);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-mid);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    transition: width .25s ease, min-width .25s ease;
}

.left.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
    border-right: none;
}

.sidebar-toggle {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 3px;
    z-index: 5;
    transition: all .15s;
}

.sidebar-toggle:hover {
    color: var(--accent);
    background: var(--bg-hover);
}

.left.collapsed .sidebar-toggle {
    position: fixed;
    left: 2px;
    top: 40px;
    right: auto;
}

.stitle {
    font-size: var(--fs-xs);
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-label);
    padding: 6px 10px 2px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Preset Grid (2 columns) ── */
.preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.fg.half {
    padding: 3px 6px 3px 10px;
    border-bottom: 1px solid var(--border-soft);
}

.fg.half:nth-child(odd) {
    border-right: 1px solid var(--border-soft);
}

.fg.half label {
    font-size: var(--fs-xs);
    margin-bottom: 1px;
}

.fg.half select {
    font-size: var(--fs-xs);
    padding: 3px 5px;
}

/* ── Right Content ── */
.right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Tabs ── */
.tabs {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-mid);
    flex-shrink: 0;
    gap: 0;
}

.tab {
    padding: 6px 12px;
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-weight: 500;
    cursor: pointer;
    color: var(--text-dim);
    border-bottom: 2px solid transparent;
    transition: all .15s;
    user-select: none;
    letter-spacing: .3px;
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.on {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Panels ── */
.pn {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-sm) var(--sp-md);
    display: none;
}

.pn.on {
    display: block;
}

/* ── Badge Small ── */
.badge-sm {
    font-size: var(--fs-xs);
    color: var(--accent);
    font-family: var(--font-mono);
}

/* ── Queue List ── */
.queue-list {
    padding: 2px 10px;
    max-height: 120px;
    overflow-y: auto;
}

.qi {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 0;
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-soft);
}

.qi .qi-n {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qi .qi-s {
    font-size: var(--fs-xs);
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qi .qi-rm {
    cursor: pointer;
    color: var(--text-dim);
    font-size: var(--fs-xs);
}

.qi .qi-rm:hover {
    color: var(--red);
}

.qi.done {
    color: var(--green-text);
}

.qi.active {
    color: var(--yellow);
}

.qi.fail {
    color: var(--red);
}