@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/inter-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/inter-600.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/jbmono-400.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/jbmono-700.woff2') format('woff2');
}

:root {
    --bg-app: #0f1115;
    --bg-sidebar: #161b22;
    --bg-panel: #1c2128;
    --border: #30363d;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --danger: #f85149;
    --success: #3fb950;
    --bed-bg: #0d1117;
    --grid-color: #21262d;
    /* Fallback outline colour, used only when an element has no resolvable
       stroke or fill. Per-layer colours are preserved; see
       normalizeArtworkColors(). */
    --artwork-stroke: #e6edf3;
    --job-bounds: #ff2d95;  /* fluo pink - where the object sits on the bed */
    
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-sans);
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
}

.app-container {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    height: 100vh;
}

/* SIDEBARS COMMON */
aside {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 10;
}

h1, h2, h3 { margin: 0; font-weight: 600; }
h3 { font-size: 12px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; letter-spacing: 0.5px; }

/* LEFT SIDEBAR */
.sidebar-left { 
    border-left: none; 
    gap: 24px; 
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.sidebar-left::-webkit-scrollbar {
    width: 6px;
}
.sidebar-left::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-left::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
.sidebar-left::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.logo-area {
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.logo-area h1 { font-family: var(--font-mono); font-size: 20px; color: var(--text-main); }
.logo-area h1 span { color: var(--accent); }
.version { font-size: 10px; background: var(--border); padding: 2px 6px; border-radius: 4px; color: var(--text-muted); }

.control-group { background: var(--bg-panel); padding: 15px; border-radius: 8px; border: 1px solid var(--border); }
.setting-item { margin-bottom: 12px; }
.setting-item:last-child { margin-bottom: 0; }
.setting-item label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-muted); }

.input-with-unit {
    display: flex;
    align-items: center;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 8px;
}
.input-with-unit input {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 8px 0;
    width: 100%;
    font-family: var(--font-mono);
}
.input-with-unit span { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

.info-display {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 13px;
}

.material-row{
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 8px;
}
.select{
    width: 100%;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    padding: 8px 10px;
    font-family: var(--font-sans);
    outline: none;
}
.select:focus{ border-color: var(--accent); }
.material-actions{ margin-top: 8px; }
.btn-secondary{
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
.btn-secondary:hover:not(:disabled){ border-color: var(--accent); color: var(--accent); }
.btn-secondary:disabled{ opacity: 0.5; cursor: not-allowed; }
.hint{
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
}

.origin-picker{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.origin-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
    font-family: var(--font-mono);
    color: var(--text-muted);
}
.origin-opt-wide { grid-column: span 2; }
.origin-opt input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}
.origin-opt:has(input:checked) {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.15) inset;
}
.origin-opt:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.file-drop-area {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.file-drop-area:hover, .file-drop-area.dragover {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.05);
}
.drop-content { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-muted); }

.stats-panel {
    background: var(--bg-panel);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.stat-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.highlight-time { color: var(--success); font-weight: bold; font-family: var(--font-mono); }

.action-area { margin-top: auto; }
.btn-primary {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; background: var(--border); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.support-area{
    margin-top: 10px;
    text-align: center;
    display: flex;
    gap: 8px;
    justify-content: center;
}
.donate-link{
    display: inline-block;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 8px 10px;
    border-radius: 999px;
    transition: all 0.15s;
}
.donate-link:hover{
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.06);
}

/* Mode switch (Vector / Raster) */
.mode-switch{
    display: flex;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
}
.mode-btn{
    flex: 1;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}
.mode-btn:hover:not(:disabled){
    color: var(--text-main);
    border-color: var(--border);
}
.mode-btn.active{
    background: var(--bg-app);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.15) inset;
}
.mode-btn:disabled{
    opacity: 0.5;
    cursor: not-allowed;
}

/* Raster mode layout */
.app-container.mode-raster{
    grid-template-columns: 280px 1fr;
}
.app-container.mode-raster .sidebar-right{
    display: none;
}
.app-container.mode-raster .vector-only{
    display: none !important;
}
.app-container.mode-raster .raster-only{
    display: block !important;
}

/* Modal */
.modal-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.66);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}
.modal{
    width: min(740px, 95vw);
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.6);
    overflow: hidden;
}
.modal-header{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.modal-header h2{
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-main);
}
.modal-close{
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}
.modal-close:hover{ color: var(--accent); border-color: var(--accent); }
.modal-body{
    padding: 16px;
    color: var(--text-main);
    line-height: 1.45;
}
.modal-body p{ margin: 0 0 10px; color: var(--text-main); }
.modal-body ul{ margin: 0 0 10px 18px; color: var(--text-main); }
.modal-note{ color: var(--text-muted); font-size: 12px; }
.modal-actions{
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}

/* MAIN WORKSPACE */
.workspace-area {
    background: #000;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.raster-panel{
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bed-bg);
    border-left: 1px solid var(--border);
}
.raster-panel iframe{
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-app);
}

.canvas-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

/* Simulate the physical machine bed */
.machine-bed {
    width: 500px; /* Base pixels, scaled by JS */
    height: 285px;
    background: var(--bed-bg);
    border: 1px solid var(--border);
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    /* Grid Pattern */
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: -1px -1px;
    transition: transform 0.1s ease-out;
    transform-origin: center center;
}

.origin-marker {
    position: absolute;
    width: 10px;
    height: 10px;
    left: 0;
    bottom: 0;
    border-left: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    z-index: 100;
}

.origin-marker.origin-bottom-left { left: 0; bottom: 0; top: auto; right: auto; transform: none; }
.origin-marker.origin-bottom-right { right: 0; bottom: 0; left: auto; top: auto; transform: scaleX(-1); }
.origin-marker.origin-top-left { left: 0; top: 0; bottom: auto; right: auto; transform: scaleY(-1); }
.origin-marker.origin-top-right { right: 0; top: 0; left: auto; bottom: auto; transform: scale(-1); }
.origin-marker.origin-center { left: 50%; top: 50%; bottom: auto; right: auto; transform: translate(-50%, -50%); border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
.origin-marker.origin-custom { border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }

.custom-origin-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through for now, unless we add drag */
}
.svg-layer svg {
    overflow: visible;
    vector-effect: non-scaling-stroke;
}

.workspace-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: var(--bg-panel);
    padding: 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
}
.workspace-controls button {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 4px 8px;
}
.workspace-controls button:hover { color: var(--accent); }
.workspace-controls button:disabled { opacity: 0.35; cursor: default; }
.workspace-controls button:disabled:hover { color: var(--text-main); }
.workspace-controls button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.control-divider {
    width: 1px;
    align-self: stretch;
    background: var(--border);
    margin: 0 2px;
}

.toggle-btn {
    font-family: var(--font-sans);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px !important;
}
.toggle-btn.active { color: var(--accent); background: rgba(88, 166, 255, 0.12); }

/* TOOLPATH PREVIEW OVERLAY */
.toolpath-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.toolpath-layer svg { overflow: visible; }

/* Strokes are scaled with the bed, so non-scaling-stroke keeps hairlines
   hairline-thin at any zoom instead of ballooning with the transform. */
.toolpath-cuts line,
.toolpath-rapids line {
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
}
.toolpath-cuts line {
    stroke: var(--accent);
    stroke-width: 1.5;
}
.toolpath-rapids line {
    stroke: var(--text-muted);
    stroke-width: 0.75;
    stroke-dasharray: 3 3;
    opacity: 0.55;
}

.toolpath-stat span:last-child { font-family: var(--font-mono); }

.btn-primary.is-busy,
.btn-secondary.is-busy { opacity: 0.6; cursor: progress; }

/* RIGHT SIDEBAR - JOBS */
.sidebar-right { border-left: 1px solid var(--border); border-right: none; padding: 0; }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border); }
.sidebar-header h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }

.jobs-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.job-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.job-card:hover { border-color: var(--text-muted); }
.job-card.disabled { opacity: 0.5; }

.job-header {
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-bottom: 1px solid transparent;
}
.job-card.expanded .job-header { border-bottom-color: var(--border); }

.job-title { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.color-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); }

.job-controls { display: flex; gap: 8px; }
.toggle-job { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0; }
.toggle-job:hover { color: var(--text-main); }

.job-order{
    display: flex;
    gap: 6px;
    align-items: center;
}
.job-move{
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 2px 6px;
    cursor: pointer;
    line-height: 1;
    font-size: 12px;
}
.job-move:hover{
    border-color: var(--accent);
    color: var(--accent);
}

.job-body { padding: 12px; display: none; }
.job-card.expanded .job-body { display: block; }

/* Sliders */
.slider-group { margin-bottom: 12px; }
.slider-header { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 11px; color: var(--text-muted); }
.slider-header span:last-child { font-family: var(--font-mono); color: var(--accent); }

input[type=range] {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    appearance: none;
    outline: none;
}
input[type=range]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--text-main);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--bg-panel);
}
input[type=range]::-webkit-slider-thumb:hover { background: var(--accent); }

.empty-state { text-align: center; color: var(--text-muted); padding-top: 40px; }

/* FOCUS-VISIBLE (keyboard-focus ring) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.file-drop-area:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}
input[type=range]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}
.select:focus-visible {
    border-color: var(--accent);
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
    .machine-bed {
        transition: none;
    }
}

/* RESPONSIVE BREAKPOINTS */

/* Below ~1100px: narrow the right jobs sidebar so the workspace keeps room to breathe. */
@media (max-width: 1100px) {
    .app-container {
        grid-template-columns: 240px 1fr 240px;
    }
    .app-container.mode-raster {
        grid-template-columns: 240px 1fr;
    }
}

/* Below ~820px: stack into a single column with normal page scrolling. */
@media (max-width: 820px) {
    html, body {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .app-container {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100dvh;
    }
    .app-container.mode-raster {
        display: flex;
        flex-direction: column;
    }

    aside {
        border: none;
        border-bottom: 1px solid var(--border);
        max-height: none;
    }
    .sidebar-left {
        overflow-y: visible;
        order: 1;
    }

    .workspace-area {
        order: 2;
        min-height: 60vh;
        overflow: visible;
    }
    .canvas-container {
        padding: 20px;
    }

    .sidebar-right {
        order: 3;
        border-bottom: none;
    }
    .jobs-container {
        overflow-y: visible;
    }

    /* Touch targets: enlarge job move buttons and origin tiles */
    .job-move {
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
    }
    .origin-opt {
        min-height: 44px;
        padding: 10px 0;
    }
    .toggle-job {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}


/* ============================================================
   U2 - ZOOM / PAN
   ============================================================ */

.canvas-container {
    /* Pan is a transform on the bed, not a scroll, so the container must clip
       rather than grow scrollbars when the bed is dragged outside it. */
    overflow: hidden;
    position: relative;
    cursor: grab;
    touch-action: none;
}
.canvas-container.is-panning { cursor: grabbing; }

.machine-bed {
    /* Transform origin must be the top-left corner: the zoom-to-cursor maths
       in app.js assumes screen = origin + translate + scale * bedPoint. With
       the default 50% 50% the scale term would be measured from the centre. */
    transform-origin: 0 0;
    will-change: transform;
}

.zoom-level {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    min-width: 42px;
    text-align: center;
    user-select: none;
}

/* ============================================================
   U3 - REAL ERROR AND LOADING UI (replaces alert() / TODO stubs)
   ============================================================ */

.error-banner {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(640px, calc(100% - 32px));
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #2d1618;
    border: 1px solid var(--danger);
    border-radius: 6px;
    color: #ffd7d5;
    font-size: 13px;
    line-height: 1.5;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.error-banner[hidden] { display: none; }
.error-banner-icon { color: var(--danger); flex-shrink: 0; }
.error-banner-text { flex: 1; }
.error-banner-close {
    background: transparent;
    border: none;
    color: #ffd7d5;
    cursor: pointer;
    padding: 0 2px;
    font-size: 13px;
    flex-shrink: 0;
}
.error-banner-close:hover { color: #fff; }

.loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(15, 17, 21, 0.72);
    z-index: 150;
}
.loading-overlay[hidden] { display: none; }
.loading-text { font-size: 13px; color: var(--text-muted); }

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 2.4s; }
}

/* ============================================================
   U4 - DRAG TO PLACE
   ============================================================ */

.svg-layer.is-draggable {
    /* Normally pointer-events:none so drags fall through to the pan handler.
       Enabled only when a job is loaded, so the job itself can be grabbed. */
    pointer-events: auto;
    cursor: move;
}
.svg-layer.is-dragging { opacity: 0.75; }

.drag-hint {
    position: absolute;
    left: 50%;
    /* Sits above .workspace-controls (bottom: 20px, ~36px tall). */
    bottom: 68px;
    transform: translateX(-50%);
    padding: 3px 10px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    pointer-events: none;
    z-index: 120;
}
.drag-hint[hidden] { display: none; }


/* ============================================================
   IMPORTED ARTWORK + JOB BOUNDS
   ============================================================ */

/* Imported artwork is drawn as outlines - the laser cuts the outline, not the
   fill. Stroke COLOUR is deliberately not set here: it is assigned per element
   in normalizeArtworkColors() so each layer keeps its own colour, with only
   too-dark colours lifted for contrast against the bed. */
.svg-layer .user-svg,
.svg-layer .user-svg * {
    fill: none !important;
    stroke-width: 1px !important;
    vector-effect: non-scaling-stroke;
}

.job-bounds rect {
    fill: none;
    stroke: var(--job-bounds);
    stroke-width: 1px;
    stroke-dasharray: 5 4;
    opacity: 0.9;
    vector-effect: non-scaling-stroke;
}

.job-bounds-corner {
    fill: none;
    stroke: var(--job-bounds);
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}


/* Loaded-file row: shows what is open and allows removing it. Without this
   there was no way to unload a file short of reloading the page. */
.loaded-file {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
}
.loaded-file[hidden] { display: none; }
.loaded-file-name {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.loaded-file-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    flex-shrink: 0;
}
.loaded-file-remove:hover { color: var(--danger); }
.loaded-file-remove:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
