/* =============================================================================
   TOOLS PAGE — extends css/style.css. Same visual language: deep green #334532,
   gold #c78808, near-black #090600, mono type, square corners, wide tracking.
   Requires assets/bootstrap/css/bootstrap.min.css (grid) + css/animate.css.
   ============================================================================= */

/* Author display rules must never beat the hidden attribute */
[hidden] {
    display: none !important;
}

.tools-header {
    background: #090600;
}

.tools-hero {
    padding: 160px 0 120px 0;
}

.tools-hero h1 {
    font-size: 5vw;
    letter-spacing: 2vw;
    line-height: 6vw;
}

.tools-intro {
    background: #090600;
    padding: 0 0 60px 0;
}

.tools-intro p {
    color: #8c9398; /* 6.5:1 on #090600 */
}

.tools-jumplist {
    margin-top: 30px;
}

.tools-jumplist a {
    display: inline-block;
    margin: 6px 10px;
    padding: 10px 18px;
    color: #c78808; /* 6.7:1 on #090600 */
    border: solid 1px #c78808;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
}

.tools-jumplist a:hover,
.tools-jumplist a:focus {
    background: #c78808;
    color: #334532;
}

/* ---------- Tool sections ---------- */
.tool-section {
    padding: 80px 0;
    background: #f3f5f8;
}

.tool-section.color-bg {
    background: #334532;
}

.tool-section p {
    color: #696e74; /* 4.77:1 on #f3f5f8 */
}

.tool-inner {
    width: 75vw;
    max-width: 1400px;
    margin: 0 auto;
}

.tool-title {
    text-transform: uppercase;
    letter-spacing: 5px;
    font-size: 28px;
    color: #353535 !important;
}

.tool-title::after {
    margin: 20px 0;
}

.tool-title span {
    color: #334532;
}

.color-bg .tool-title {
    color: #fff !important;
}

.color-bg .tool-title span {
    color: #c78808;
}

.tool-desc {
    max-width: 60em;
}

.tool-credit {
    display: block;
    margin-top: 0.6em;
    font-size: 0.82em;
    opacity: 0.72;
}

/* ---------- Controls ---------- */
.tool-controls {
    margin: 30px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.control-group label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: bold;
    color: #545454; /* 7:1 on #f3f5f8 */
}

.color-bg .control-group label {
    color: #d8d5c8;
}

.control-group output {
    color: #8f6105; /* darkened gold: 5:1 on #f3f5f8 */
    margin-left: 6px;
}

.color-bg .control-group output {
    color: #e0a83c; /* lightened gold: 4.9:1 on #334532 */
}

.control-group input[type="text"],
.control-group input[type="number"],
.control-group select {
    padding: 10px 12px;
    border: 1px solid #334532;
    background: #fff;
    color: #353535;
    border-radius: 0;
    font-family: inherit;
}

.control-group input[type="file"] {
    max-width: 260px;
}

input[type="range"] {
    accent-color: #c78808;
    width: 200px;
}

/* slider + exact-value number input pairing */
.num-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.num-range input[type="range"] {
    flex: 1 1 120px;
    min-width: 100px;
}

.num-range input[type="number"] {
    width: 84px;
    flex: 0 0 auto;
}

/* inline checkbox label (e.g. point-cloud background removal) */
.check-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 13px !important;
    font-weight: normal !important;
    cursor: pointer;
}

.check-inline input {
    accent-color: #c78808;
    width: 16px;
    height: 16px;
}

.tool-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #274531;
    color: #fff;
    border: 1px solid #274531;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.4s;
    border-radius: 0;
}

.tool-btn:hover:not(:disabled),
.tool-btn:focus:not(:disabled) {
    background: #c78808;
    border-color: #c78808;
    color: #334532;
}

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

.tool-btn-quiet {
    background: transparent;
    color: #545454;
    border: 1px solid #545454;
    padding: 12px 16px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.tool-btn-quiet:hover {
    border-color: #c78808;
    color: #8f6105;
}

.tool-status {
    font-size: 13px;
    color: #545454;
}

.color-bg .tool-status {
    color: #d8d5c8;
}

.tool-hint {
    font-size: 12px;
    text-align: center;
    color: #5f6368; /* 5.6:1 on #f3f5f8 — no opacity tricks */
}

.color-bg .tool-hint,
.tool-stage .tool-hint {
    color: inherit;
}

.tool-stage .tool-hint {
    color: #5f6368;
}

/* ---------- Stages / canvases ---------- */
.tool-stage {
    margin-top: 20px;
}

#pc-canvas,
#ls-canvas {
    width: 100%;
    height: 60vh;
    display: block;
    background: #090600;
    touch-action: none;
}

/* ---------- Dropzones ---------- */
.dropzone {
    border: 1px dashed #334532;
    padding: 28px 34px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 280px;
}

.color-bg .dropzone {
    border-color: #d8d5c8;
}

.dropzone:hover,
.dropzone:focus,
.dropzone.dragover {
    border-color: #c78808;
    background: rgba(199, 136, 8, 0.08);
}

.dropzone p {
    margin: 0 !important;
    text-align: center;
}

/* ---------- Background remover ---------- */
.bg-stage {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.bg-pane {
    flex: 1 1 320px;
    margin: 0;
}

.bg-pane figcaption {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: #d8d5c8;
}

.bg-pane img {
    max-width: 100%;
    height: auto;
    display: block;
    background:
        repeating-conic-gradient(#cfcfcf 0% 25%, #ffffff 0% 50%) 0 0 / 20px 20px; /* checkerboard shows transparency */
}

/* ---------- LumiSpace ---------- */
.ls-workspace {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

.ls-stage {
    position: sticky;
    top: 16px;
}

.ls-panels {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ls-panel {
    border: 1px solid #334532 !important;
    padding: 16px;
    margin: 0;
    background: #fff;
}

.ls-panel legend {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: bold;
    color: #334532;
    padding: 0 8px;
    width: auto;
    border: none;
}

.ls-panel label {
    display: block;
    font-size: 12px;
    color: #545454;
    margin-bottom: 8px;
}

.ls-panel input[type="range"] {
    width: 100%;
    cursor: ew-resize;
}

/* Multiple local adjustment masks */
.ls-canvas-wrap {
    position: relative;
}

#ls-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ls-mask-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ls-mask-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ls-mask-chip {
    border: 1px solid #334532;
    background: #fff;
    color: #334532;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ls-mask-chip:hover {
    border-color: #c78808;
}

.ls-mask-chip[aria-selected="true"] {
    background: #c78808;
    border-color: #c78808;
    color: #fff;
}

.ls-mask-delete {
    margin-top: 4px;
    color: #a50e0e !important;
    border-color: #a50e0e !important;
}

.ls-mask-delete:hover {
    background: rgba(165, 14, 14, 0.08) !important;
}

#ls-curves {
    width: 100%;
    background: #090600;
    cursor: crosshair;
    touch-action: none;
}

/* ---------- Palette ---------- */
.pal-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 7px;
}

/* swatches are ALWAYS full colour — no hover reveal */
.pal-swatch {
    aspect-ratio: 1;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.pal-swatch:hover,
.pal-swatch:focus-within {
    transform: scale(1.04);
    z-index: 10;
    box-shadow: 0 14px 24px rgba(8, 6, 0, 0.35);
}

/* the harmony-base swatch gets a visible ring */
.pal-swatch.selected {
    outline: 3px solid #c78808;
    outline-offset: 2px;
    z-index: 5;
}

.pal-copy {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    padding: 2px 3px;
    cursor: pointer;
    opacity: 0.85;
}

.pal-copy:hover {
    opacity: 1;
    color: #e0a83c;
}

.pal-swatch-cap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    padding: 6px 8px;
    background: rgba(9, 6, 0, 0.65); /* readable over any swatch colour */
}

.pal-swatch-cap input {
    background: transparent;
    border: none;
    color: #fff;
    font-family: "Noto Sans Mono", monospace;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    width: 8ch;
    padding: 0;
    cursor: text;
    user-select: text;
}

.pal-share {
    color: #e0a83c;
    font-size: 11px;
    font-weight: bold;
}

.pal-subhead {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 13px;
    margin: 28px 0 12px;
    color: #353535;
}

.color-bg .pal-subhead {
    color: #d8d5c8;
}

.pal-legend {
    font-size: 13px;
    max-width: 70em;
}

.color-bg .pal-legend {
    color: #d8d5c8;
}

.color-bg .pal-legend strong {
    color: #fff;
}

img#pal-img {
    max-width: 40vw;
    max-height: 40vh;
}

.pal-harmony-row {
    display: flex;
    gap: 7px;
    margin-bottom: 8px;
    align-items: center;
}

.pal-harmony-row > span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 130px;
}

.color-bg .pal-harmony-row > span {
    color: #d8d5c8;
}

.pal-chip {
    width: 44px;
    height: 44px;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.15);
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease;
}

.pal-chip:hover,
.pal-chip:focus {
    transform: scale(1.12);
}

.pal-matrix-wrap {
    overflow-x: auto;
}

.pal-matrix-wrap table {
    border-collapse: collapse;
    font-size: 11px;
    background: #fff;   /* explicit — the section behind it is dark green */
    color: #353535;
    user-select: text;
}

.pal-matrix-wrap th,
.pal-matrix-wrap td {
    border: 1px solid #cbcbcb;
    padding: 5px 8px;
    text-align: center;
    white-space: nowrap;
}

.pal-matrix-wrap thead th,
.pal-matrix-wrap tbody th {
    width: 34px;
    height: 14px;
    min-width: 34px;
    padding: 0;
}

.pal-matrix-wrap .pal-corner {
    background: #fff;
    color: #5f6368;
    font-size: 10px;
    width: auto;
    padding: 5px 8px;
}

.pal-matrix-wrap .pal-pass { background: #e6f4ea; color: #137333; }
.pal-matrix-wrap .pal-mid  { background: #fef7e0; color: #7a5d00; }
.pal-matrix-wrap .pal-fail { background: #fce8e6; color: #a50e0e; }
.pal-matrix-wrap .pal-diag { color: #9aa0a6; }

/* ---------- Batch processor ---------- */
#batch-progress {
    width: 100%;
    height: 8px;
    accent-color: #c78808;
}

.batch-queue,
.batch-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.batch-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px dashed #cbcbcb;
}

.batch-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    background: #090600;
    flex: 0 0 auto;
}

.batch-meta {
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
}

.batch-name {
    font-size: 13px;
    font-weight: bold;
    color: #353535;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-dims {
    font-size: 12px;
    color: #5f6368;
}

.batch-cropstate {
    font-size: 12px;
    color: #0e6039;
    font-weight: bold;
}

.batch-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.batch-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed #cbcbcb;
    font-size: 13px;
}

.batch-list .batch-name {
    flex: 1 1 220px;
    font-weight: normal;
}

.batch-list .batch-saved {
    color: #0e6039;
    font-weight: bold;
}

/* ---------- Visual crop editor ---------- */
.crop-editor {
    margin: 20px 0;
    padding: 16px;
    border: 1px solid #334532;
    background: #fff;
}

.crop-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.crop-name {
    font-weight: bold;
    font-size: 13px;
    color: #353535;
    margin-right: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 40%;
}

.crop-toolbar label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: bold;
    color: #545454;
}

.crop-toolbar select {
    padding: 8px 10px;
    border: 1px solid #334532;
    background: #fff;
    color: #353535;
    border-radius: 0;
    font-family: inherit;
}

.crop-stage {
    overflow: auto;
    text-align: center;
    background: #090600;
    padding: 4px;
}

#crop-canvas {
    touch-action: none;
    cursor: crosshair;
    max-width: none;
}

.crop-editor .tool-hint {
    margin: 10px 0 0;
}

/* ---------- Ad slots (CLS-reserved placeholders) ---------- */
.ad-slot {
    width: 75vw;
    max-width: 1400px;
    margin: 40px auto;
    min-height: 100px;
    text-align: center;
}

.ad-slot-horizontal {
    min-height: 120px;
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 991px) {
    .tool-inner,
    .ad-slot {
        width: 92vw;
    }

    .tools-hero {
        padding: 120px 0 80px 0;
    }

    .ls-workspace {
        grid-template-columns: 1fr;
    }

    .ls-stage {
        position: static;
    }

    .tools-hero h1 {
        font-size: 10vw;
        line-height: 12vw;
        text-align: center;
    }

    .tools-hero h3 {
        text-align: center;
        letter-spacing: 6px;
        font-size: 13px;
    }
}

@media screen and (max-width: 767px) {
    .tool-section {
        padding: 56px 0;
    }

    .tool-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .control-group {
        min-width: 0;
    }

    .control-group input[type="file"] {
        max-width: 100%;
    }

    input[type="range"] {
        width: 100%;
    }

    .dropzone {
        min-width: 0;
        padding: 22px 16px;
    }

    #pc-canvas,
    #ls-canvas {
        height: 52vh;
    }

    .tools-hero h1 {
        letter-spacing: 3vw;
    }

    .tool-btn {
        width: 100%;
        text-align: center;
    }

    .batch-actions .tool-btn,
    .crop-toolbar .tool-btn,
    .batch-list .tool-btn {
        width: auto;
    }

    .batch-item {
        flex-wrap: wrap;
    }

    .crop-name {
        max-width: 100%;
        flex-basis: 100%;
    }

    .pal-swatches {
        grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    }

    .pal-harmony-row > span {
        min-width: 0;
        flex: 0 0 96px;
        font-size: 11px;
    }
}


/* =============================================================================
   PHASE 2 (2026) — Layout cohesion, clearer interaction points, Lucida loader.
   Appended last so equal-specificity rules here win over the base above.
   ============================================================================= */

/* ---------- Sticky tool navigation ---------- */
.tools-nav {
    position: sticky;
    top: 0;
    z-index: 5000;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(9, 6, 0, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(199, 136, 8, 0.35);
}

.tools-nav a {
    display: inline-block;
    padding: 8px 14px;
    color: #c78808;
    border: 1px solid rgba(199, 136, 8, 0.55);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: background 0.2s ease, color 0.2s ease;
}

.tools-nav a:hover,
.tools-nav a:focus {
    background: #c78808;
    color: #090600;
    border-bottom: 1px solid rgba(199, 136, 8, 0.55);
}

/* When the site menu overlay opens, it must sit ABOVE the sticky tools bar
   (menu-wrap is z-index 999, the menu button 1000) */
body.show-menu .tools-nav {
    z-index: 998;
}

/* ---------- Tool cards: one consistent container per tool ---------- */
.tool-card {
    background: #fff;
    border: 1px solid #334532;
    padding: 24px 28px;
    margin: 26px 0;
    box-shadow: 0 18px 34px rgba(8, 6, 0, 0.14);
}

.color-bg .tool-card {
    border-color: #090600;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
}

.tool-card .tool-controls {
    margin: 14px 0 0;
    align-items: stretch;
}

.control-group {
    justify-content: flex-start;
}

/* Controls now sit on white cards even inside dark sections —
   re-assert readable colours that the section context overrides. */
.tool-card .control-group label,
.tool-card .check-inline,
.tool-card .tool-status,
.tool-card .dropzone p,
.tool-card p {
    color: #545454;
}

.tool-card .control-group output {
    color: #8f6105;
}

.tool-card .step-head {
    color: #274531 !important;
}

.control-group-grow {
    flex: 1 1 300px;
}

.control-group-grow .dropzone {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ---------- Numbered step headings ---------- */
.step-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #274531;
}

.tool-card > .step-head {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed #cbcbcb;
}

.tool-card > .step-head:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    background: #c78808;
    color: #090600;
    font-size: 13px;
    border-radius: 50%;
}

/* ---------- Friendlier dropzones ---------- */
.dropzone {
    border-width: 2px;
    gap: 6px;
}

.dropzone-icon {
    display: block;
    font-size: 30px;
    color: #c78808;
    margin-bottom: 6px;
    text-align: center;
}

.dropzone p {
    font-size: 14px;
}

/* ---------- Stages read as part of the same unit ---------- */
.tool-stage {
    border: 1px solid rgba(51, 69, 50, 0.35);
    background: #fff;
    padding: 14px;
}

.color-bg .tool-stage {
    border-color: rgba(216, 213, 200, 0.4);
    background: rgba(9, 6, 0, 0.25);
}

.tool-stage .tool-hint {
    margin-bottom: 0;
}

/* LumiSpace panels keep their own white cards — remove double chrome there */
.ls-workspace .tool-stage {
    padding: 0;
    border: none;
    background: transparent;
}

/* ---------- Lucida storage note (background remover) ---------- */
.lucida-storage-note {
    margin: 18px 0 0;
    padding: 12px 16px;
    border: 1px dashed #334532;
    background: rgba(199, 136, 8, 0.07);
    font-size: 13px;
    line-height: 1.6;
    color: #545454;
}

.lucida-storage-note .fa {
    color: #8f6105;
    margin-right: 6px;
}

.lucida-storage-note code {
    background: #f0eee6;
    color: #274531;
    padding: 1px 5px;
    font-size: 12px;
}

.lucida-storage-note .tool-btn-quiet {
    margin-left: 8px;
    padding: 6px 12px;
    font-size: 11px;
    vertical-align: middle;
}

/* ---------- Lucida download panel (docked, non-blocking) ---------- */
.lucida-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90000;
    width: min(400px, calc(100vw - 40px));
    background: #090600;
    border: 1px solid #c78808;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.5);
    color: #f3f5f8;
    padding: 18px 20px 16px;
    transform: translateY(24px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.lucida-panel.lp-visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.lp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.lp-title {
    margin: 0;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #c78808;
}

.lp-min {
    background: transparent;
    border: none;
    color: #8c9398;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

.lp-min:hover,
.lp-min:focus-visible {
    color: #c78808;
    outline: none;
}

/* Pixel-grid animation: 60 cells light up in order as bytes arrive,
   with the leading cell pulsing — playful but on-brand (square, gold, mono). */
.lp-pixels {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: 3px;
    margin: 12px 0 10px;
}

.lp-pixel {
    aspect-ratio: 1;
    background: rgba(243, 245, 248, 0.12);
    transition: background 0.25s ease;
}

.lp-pixel.lp-on {
    background: #c78808;
}

.lp-pixel.lp-lead {
    animation: lp-pulse 0.7s ease-in-out infinite;
}

@keyframes lp-pulse {
    0%, 100% { background: #c78808; }
    50% { background: #f3f5f8; }
}

/* Compiling state: cells chase instead of filling */
.lucida-panel.lp-compiling .lp-pixel {
    animation: lp-chase 1.2s linear infinite;
}

.lucida-panel.lp-compiling .lp-pixel:nth-child(3n)   { animation-delay: 0.15s; }
.lucida-panel.lp-compiling .lp-pixel:nth-child(3n+1) { animation-delay: 0.3s; }

@keyframes lp-chase {
    0%, 100% { background: rgba(243, 245, 248, 0.12); }
    50% { background: #c78808; }
}

.lp-bar {
    height: 6px;
    background: rgba(243, 245, 248, 0.15);
    overflow: hidden;
}

.lp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8f6105, #c78808);
    transition: width 0.3s ease;
}

.lp-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #e0a83c;
}

.lp-msg {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.55;
    color: #b9bfc5;
}

.lp-where {
    margin: 10px 0 0;
    padding-top: 10px;
    border-top: 1px dashed rgba(199, 136, 8, 0.4);
    font-size: 11.5px;
    line-height: 1.6;
    color: #8c9398;
}

.lp-where strong { color: #d8d5c8; }

/* Ready state: brief green flash of the pixels */
.lucida-panel.lp-ready .lp-pixel { background: #3f7d54; }
.lucida-panel.lp-ready .lp-title { color: #6fc78e; }

/* Minimised: shrink to a chip the user can re-open */
.lucida-panel.lp-mini .lp-body { display: none; }

/* ---------- Point Cloud card: even columns, full-width tuning grid ---------- */
#tool-pointcloud .tool-controls .control-group {
    flex: 1 1 260px;
}

#tool-pointcloud .control-group.sliders {
    flex: 2 1 520px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px 32px;
}

.slider-pair {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-pair input[type="range"] {
    width: 100%;
}

#tool-pointcloud .control-group input[type="file"] {
    max-width: 100%;
}

/* A status line that sits directly in a card spans the full card width */
.tool-card > .tool-status {
    display: block;
    margin: 14px 0 0;
}

/* ---------- Point Cloud: matching pickers for all three sources ---------- */
.dropzone-sm {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 22px 20px;
}

#tool-pointcloud .control-group {
    display: flex;
    flex-direction: column;
}

#tool-pointcloud .control-group.sliders {
    display: grid; /* keep the slider grid */
}

#tool-pointcloud .control-group > .dropzone,
#tool-pointcloud .control-group > .pc-text-card {
    flex: 1 1 auto; /* all three source cards fill equal height */
}

.pc-text-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 22px 20px;
    border: 2px dashed #334532;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.pc-text-card:focus-within {
    border-color: #c78808;
    background: rgba(199, 136, 8, 0.08);
}

.pc-text-card input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.pc-text-card .tool-btn {
    width: 100%;
    text-align: center;
}

/* ---------- Small-screen tweaks for the new chrome ---------- */
@media screen and (max-width: 767px) {
    .tool-card {
        padding: 18px 16px;
    }

    .tools-nav a {
        padding: 7px 10px;
        font-size: 10px;
    }

    .lucida-panel {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .lp-pixel,
    .lucida-panel.lp-compiling .lp-pixel {
        animation: none;
    }
}
