/* Cromaia Studio */
:root {
    --accent: #6246a4;
    --accent-hover: #4b347f;
    --ink: #202337;
    --muted: #62677a;
    --line: #e4e1ec;
    --soft: #f7f5fb;
    --bg: #ffffff;
    --radius: 16px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
.design-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.design-shortcuts button { flex: 1 1 120px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.design-shortcuts button[aria-pressed=true] { background: #d4e5d8; color: #182b20; border-color: #4c715b; font-weight: 600; }
.source-label { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.reference-status { padding: 12px; border-radius: 12px; background: #e6ece3; color: #314c3b; font-size: 13px; line-height: 1.5; margin: 0 0 16px; }
.design-examples { margin-top: 8px; }
.upload-filename { display: block; overflow-wrap: anywhere; }
dialog:modal { margin: auto; }
[hidden] { display: none !important; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.5; }
button, select, input, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); font-weight: 400; }

/* Topbar */
.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 10px 24px; background: rgba(255,255,255,.94); backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-weight: 800; letter-spacing: .08em; color: var(--accent); font-size: 15px; }
.brand-app { font-weight: 500; color: var(--muted); }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--ink); }

.segmented { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; }
.segmented button {
    border: 0; background: transparent; padding: 6px 16px; border-radius: 999px;
    cursor: pointer; color: var(--muted); font-weight: 500;
}
.segmented button[aria-selected="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* Layout */
.layout { display: grid; grid-template-columns: 380px 1fr; min-height: calc(100vh - 53px); }
.panel { border-right: 1px solid var(--line); padding: 20px; overflow-y: auto; }
.stage { padding: 24px; background: var(--soft); display: flex; align-items: flex-start; justify-content: center; }

/* Tools */
.tool-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.tool-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.tool-group { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-btn {
    border: 1px solid var(--line); background: var(--bg); border-radius: 999px;
    padding: 5px 12px; cursor: pointer; font-size: 13px;
}
.tool-btn:hover { border-color: #bbb; }
.tool-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tool-desc { color: var(--muted); margin-bottom: 12px; min-height: 21px; }

/* Form */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .options label { font-weight: 500; font-size: 13px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.options .field.full { grid-column: 1 / -1; }
select, input[type=text], input[type=search], textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg);
}
select:focus, input:focus, textarea:focus, .drop:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
textarea { resize: vertical; }
.row-between { display: flex; justify-content: space-between; align-items: center; }

.drop {
    border: 1.5px dashed #cfcfcf; border-radius: var(--radius); min-height: 170px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    background: var(--soft); overflow: hidden; position: relative;
}
.drop:hover, .drop.dragover { border-color: var(--ink); }
.drop img { max-width: 100%; max-height: 260px; object-fit: contain; display: block; }
.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); }
.drop-empty strong { color: var(--ink); }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb, .thumb-add {
    width: 64px; height: 64px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--soft) center/cover no-repeat; position: relative;
}
.thumb-add { cursor: pointer; font-size: 22px; color: var(--muted); border-style: dashed; }
.thumb-remove {
    position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
    border: 0; background: var(--ink); color: #fff; cursor: pointer; font-size: 12px; line-height: 1;
}

.sample-row, .upload-row { display: flex; gap: 12px; align-items: center; }
.sample-thumb { width: 96px; height: 76px; background-size: contain; background-color: #fff; }
.sample-thumb.missing { border-style: dashed; }
.warn { color: #8a5a00; }
.uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.upload-slot { display: flex; flex-direction: column; gap: 6px; }
.upload-slot label { font-weight: 500; font-size: 13px; }
.upload-slot .hint { font-size: 11px; color: var(--muted); line-height: 1.35; }
.upload-slot .thumb { cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 20px; border-style: dashed; }
.upload-slot .thumb.filled { border-style: solid; font-size: 0; }
.uploads.reference-pair { grid-template-columns: 1fr; margin: 8px 0 16px; }
.uploads.reference-pair .upload-row { flex-wrap: wrap; }
.uploads.reference-pair .thumb { width: 100%; height: 180px; border-radius: 14px; background-size: contain; background-repeat: no-repeat; background-position: center; }
.palette { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; max-height: 150px; overflow-y: auto; }
.swatch {
    display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line);
    border-radius: 999px; padding: 2px 8px 2px 3px; background: var(--bg); cursor: pointer; font-size: 11px;
}
.swatch i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); }
details summary { cursor: pointer; font-weight: 500; font-size: 13px; }

.refs { display: flex; flex-direction: column; gap: 8px; }
.ref-item { display: grid; grid-template-columns: 64px 1fr 24px; gap: 8px; align-items: center; }
.ref-item .thumb { cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); text-align: center; }
.ref-item .x { border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--muted); }
.link-btn { border: 0; background: none; color: var(--ink); text-decoration: underline; cursor: pointer; font-size: 13px; }
.link-btn:disabled { color: var(--muted); cursor: default; }

.btn-primary {
    border: 0; border-radius: 8px; padding: 12px; background: var(--accent); color: #fff;
    font-weight: 600; cursor: pointer; font-size: 15px;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { background: #d9d9d9; cursor: not-allowed; }
.btn {
    display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--bg);
    border-radius: 8px; padding: 7px 12px; cursor: pointer; text-decoration: none; font-size: 13px; width: auto;
}
.btn:hover { border-color: #bbb; }
.error { color: #b3261e; background: #fdecea; border-radius: 8px; padding: 8px 10px; }
.password-rules { font-size: 12px; font-weight: 400; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0; padding: 0; color: #625e56; }
.password-rules li::before { content: '○ '; }
.password-rules li[data-valid=true] { color: #2d6341; }
.password-rules li[data-valid=true]::before { content: '✓ '; }

/* Stage */
.stage-empty, .stage-loading { margin-top: 20vh; text-align: center; color: var(--muted); }
.spinner {
    width: 32px; height: 32px; margin: 0 auto 12px; border-radius: 50%;
    border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.result { width: 100%; max-width: 980px; display: flex; flex-direction: column; gap: 14px; }
.design-shooting-link { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.design-shooting-link a { color: #385943; text-underline-offset: 4px; }
.result-references { padding: 16px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); }
.reference-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.reference-heading h3 { font-size: 14px; font-weight: 600; }
.reference-heading span { font-size: 12px; color: var(--muted); }
.reference-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.reference-image { min-width: 0; }
.reference-image button { width: 100%; height: clamp(96px, 13vw, 180px); padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); cursor: zoom-in; }
.reference-image img { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: 8px; }
.reference-image figcaption { margin-top: 6px; font-size: 12px; line-height: 1.5; }
.result-references > p { margin-top: 10px; }
.result-media { background: var(--bg); border-radius: var(--radius); display: flex; justify-content: center; }
.result-media img { max-width: 100%; max-height: 68vh; object-fit: contain; cursor: zoom-in; border-radius: var(--radius); }
.views { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.views a { display: block; border-radius: 6px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
.views img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.result-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.result-bar h2 { font-size: 16px; font-weight: 600; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.prompt p { margin-top: 6px; color: var(--muted); white-space: pre-wrap; font-size: 12px; max-height: 220px; overflow-y: auto; }

/* History */
.history { padding: 28px 24px 60px; border-top: 1px solid var(--line); }
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.history-head h2 { font-size: 18px; }
.history-filters { display: flex; gap: 8px; }
.history-filters input { width: 200px; }
.history-filters select { width: auto; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.h-card { cursor: pointer; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg); text-align: left; padding: 0; }
.h-card:hover { border-color: #bbb; }
.h-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--soft); }
.h-card div { padding: 8px 10px; }
.h-card strong { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-card span { font-size: 11px; color: var(--muted); }
.history-more { margin: 20px auto 0; display: block; }
.empty { color: var(--muted); grid-column: 1 / -1; text-align: center; padding: 30px 0; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 50; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 94vw; max-height: 92vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 14px; right: 20px; border: 0; background: none; color: #fff; font-size: 34px; cursor: pointer; }

/* --- Ronda 2: campañas, lote, medidas, colores, cola, fidelidad, estados, login --- */
.small { font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--soft); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--muted); }
.topnav { display: flex; align-items: center; gap: 14px; }
.user-box { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
.campaign-row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.campaign-row select { flex: 1; }
.batch-badge { position: absolute; top: 8px; right: 8px; background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.dims { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dims label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.dims input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; }
.color-pick { display: flex; gap: 8px; align-items: center; }
.color-pick input { flex: 1; }
.swatch-dot { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); flex: none; background: repeating-linear-gradient(45deg, #fff 0 4px, #eee 4px 8px); }
.palette.tall { max-height: 190px; }
.swatch[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.run-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.run-row select { width: auto; margin-left: 6px; }
.check { display: inline-flex; gap: 6px; align-items: center; }
.queue { width: 100%; max-width: 980px; display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.q-item { width: 88px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 0; cursor: pointer; overflow: hidden; text-align: center; font-size: 10px; }
.q-item .q-img { width: 100%; aspect-ratio: 1; background: var(--soft) center/cover; display: flex; align-items: center; justify-content: center; }
.q-item span { display: block; padding: 3px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.q-item.error .q-img { background: #fdecea; color: #b3261e; font-size: 18px; }
.q-item.active { border-color: var(--ink); }
.spinner.sm { width: 20px; height: 20px; border-width: 2px; margin: 0; }
.stage { flex-direction: column; align-items: center; }
.result-media { gap: 10px; padding: 0; }
.compare-fig { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.compare-fig img { max-width: 100%; max-height: 68vh; object-fit: contain; cursor: zoom-in; border-radius: var(--radius); }
.compare-fig figcaption { font-size: 12px; color: var(--muted); padding: 4px 0; }
.fidelity { border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.fidelity.fiel { background: #e8f5ec; color: #1e6b35; }
.fidelity.revisar { background: #fff4e0; color: #8a5a00; }
.fidelity.diferente { background: #fdecea; color: #b3261e; }
.fidelity ul { margin: 4px 0 0 18px; }
.status-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.status-btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.h-card { position: relative; }
.h-badge { position: absolute; top: 6px; left: 6px; font-size: 11px; background: rgba(255,255,255,.92); border-radius: 999px; padding: 1px 7px; }
.h-badge.fiel { color: #1e6b35; } .h-badge.revisar { color: #8a5a00; } .h-badge.diferente { color: #b3261e; }
.h-status { position: absolute; top: 6px; right: 6px; font-size: 12px; background: rgba(255,255,255,.92); border-radius: 999px; padding: 0 6px; }
.h-card.descartado img { opacity: .45; }
.overlay { position: fixed; inset: 0; background: rgba(20,20,20,.55); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: var(--bg); border-radius: 12px; padding: 24px; width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.login-card input { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }

/* --- Salida web y arrastrar/soltar --- */
.web-block { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.web-block .sample-row { margin: 8px 0; }
.view-toggle { align-self: center; }
.checker { background-color: #fff; background-image:
    linear-gradient(45deg, #e6e6e6 25%, transparent 25%), linear-gradient(-45deg, #e6e6e6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e6e6e6 75%), linear-gradient(-45deg, transparent 75%, #e6e6e6 75%);
    background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.drag-over { outline: 2px dashed var(--ink) !important; outline-offset: 2px; }
#views-web a { color: var(--ink); margin-right: 6px; }

.tip { display: flex; gap: 10px; align-items: center; background: #fff4e0; color: #6b4a00; border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.tip .btn { flex: none; }

/* --- Selección múltiple y descarga --- */
.pick { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; margin: 0; cursor: pointer; z-index: 2; accent-color: var(--ink); }
.h-card .h-badge { top: auto; bottom: 62px; }
.h-card.selected, .q-item.selected { outline: 2px solid var(--ink); outline-offset: -2px; }
.q-item { position: relative; }
.q-item .pick { width: 18px; height: 18px; top: 4px; left: 4px; }
.queue-tools { width: 100%; max-width: 980px; display: flex; gap: 10px; align-items: center; margin: -6px 0 12px; font-size: 12px; }
.select-bar {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40;
    display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center;
    background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px;
    box-shadow: 0 6px 24px rgba(0,0,0,.15); max-width: calc(100vw - 32px); font-size: 13px;
}
.select-bar select { width: auto; margin-left: 6px; }
.select-bar .btn-primary { padding: 8px 16px; font-size: 14px; }
.history { padding-bottom: 110px; }

/* --- Combinaciones --- */
.combis-block .sample-row { margin: 4px 0 8px; }
.combis-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.combis-table { display: flex; flex-direction: column; gap: 10px; }
.combi-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.combi-head { display: flex; gap: 8px; align-items: center; }
.combi-head input[type=text] { font-weight: 600; }
.combi-only { flex: none; padding: 4px 8px; font-size: 11px; }
.combi-row { display: flex; gap: 6px; align-items: center; }
.combi-row input { flex: 1; min-width: 0; }
.combi-cell { position: relative; flex: none; display: flex; align-items: center; }
.combi-cell .x { font-size: 14px; padding: 0 2px; }
.combi-swatch { width: 28px; height: 28px; border: 1px dashed #c8c8c8; border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px;
    background: var(--soft) center/cover no-repeat; }
.combi-swatch.filled { border-style: solid; border-color: var(--ink); }
.combi-grid { display: grid; grid-template-columns: 56px 1fr; gap: 4px 8px; align-items: center; font-size: 12px; }
.combi-grid input { padding: 5px 7px; font-size: 12px; }
.combi-grid .ok { color: #1e6b35; }
.combi-warn { font-size: 11px; color: #8a5a00; }
.combi-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); vertical-align: middle; margin-left: 3px; }

/* Responsive */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .panel { border-right: 0; border-bottom: 1px solid var(--line); }
    .views { grid-template-columns: repeat(3, 1fr); }
    .topbar { padding: 10px 16px; flex-wrap: wrap; }
    .history { padding: 24px 16px 48px; }
    .history-filters { flex-wrap: wrap; width: 100%; }
    .history-filters input { width: 100%; }
    .dims { grid-template-columns: repeat(2, 1fr); }
    .result-media { flex-direction: column; }
    .topnav { gap: 8px; flex-wrap: wrap; }
}

/* Dirección visual y jerarquía de la nueva experiencia */
html { scroll-behavior: smooth; }
body { background: #f8f7fb; }
.topbar { min-height: 76px; padding: 12px clamp(18px, 2.6vw, 42px); box-shadow: 0 2px 18px rgba(43,36,74,.035); }
.brand { align-items: center; gap: 10px; flex: none; }
.brand-symbol { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg,#8067bd,#483171); color: white; font-size: 21px; font-weight: 800; box-shadow: 0 5px 14px rgba(85,60,150,.2); }
.brand-wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.brand-wordmark strong { font-size: 19px; letter-spacing: -.03em; }
.brand-wordmark small { margin-top: 4px; font-size: 9px; font-weight: 800; letter-spacing: .2em; color: var(--accent); }
.topnav { gap: clamp(10px,1.6vw,22px); }
.topnav a, .topnav .link-btn { text-decoration: none; font-weight: 600; color: #4d5268; }
.topnav a:hover, .topnav .link-btn:hover { color: var(--accent); }
.topnav .chip { background: #f1eef9; color: #594483; font-weight: 600; padding: 7px 12px; }
.user-box { padding-left: 12px; border-left: 1px solid var(--line); }
.segmented { border-radius: 12px; background: #f2eff9; }
.segmented button { border-radius: 10px; padding: 8px 14px; font-weight: 650; }
.segmented button[aria-selected="true"] { color: #4b347f; box-shadow: 0 2px 8px rgba(66,45,100,.11); }
.layout { grid-template-columns: minmax(380px,430px) minmax(0,1fr); align-items: stretch; }
.panel { background: #fff; padding: 28px; border-right-color: #eae7f1; }
.workspace-intro { margin-bottom: 24px; }
.eyebrow { display: inline-block; color: #7a619f; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.workspace-intro h1 { margin-top: 7px; font-size: clamp(23px,2vw,29px); letter-spacing: -.045em; line-height: 1.15; }
.workspace-intro p { margin-top: 7px; max-width: 34ch; color: var(--muted); }
.campaign-row { padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: #fbfaff; gap: 8px; }
.campaign-row select { background: transparent; border-color: transparent; font-weight: 600; }
.campaign-row .link-btn { white-space: nowrap; color: var(--accent); text-decoration: none; font-weight: 600; }
.tool-picker-head { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 11px; }
.tool-picker-head > div { display: flex; flex-direction: column; gap: 2px; }
.tool-picker-head strong { font-size: 15px; line-height: 1.2; }
.tool-picker-head small { color: var(--muted); font-size: 12px; }
.step-number { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #ece5f9; color: #573d91; font-size: 12px; font-weight: 800; }
.tool-search-label { display: block; height: 0; overflow: hidden; }
#tool-search { padding: 11px 13px; margin: 2px 0 13px; border-radius: 11px; background: #faf9fc; }
.tool-list { gap: 11px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.tool-group-title { color: #8a8097; font-size: 10px; font-weight: 800; margin-bottom: 7px; }
.tool-group { gap: 7px; }
.tool-btn { padding: 8px 11px; border-radius: 9px; color: #4a4b5e; font-weight: 600; line-height: 1.2; }
.tool-btn:hover { border-color: #b6a7d7; background: #faf7ff; }
.tool-btn[aria-pressed="true"] { background: #6246a4; border-color: #6246a4; color: #fff; }
.form { gap: 17px; }
.tool-desc { margin: -6px 0 2px 36px; min-height: auto; font-size: 13px; }
.field > label, .options label { font-weight: 650; }
input[type=text], input[type=search], input[type=password], textarea, select { border-color: #dedbe7; border-radius: 10px; min-height: 39px; }
.drop { min-height: 188px; border-color: #c7b9e4; border-width: 2px; border-radius: 15px; background: #faf8ff; }
.drop:hover, .drop.dragover { background: #f4efff; border-color: var(--accent); }
.drop-empty strong { font-size: 15px; }
.drop-empty span { max-width: 28ch; text-align: center; font-size: 12px; }
.btn-primary { background: var(--accent); border-radius: 11px; box-shadow: 0 5px 14px rgba(98,70,164,.15); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { background: #d6d0e2; box-shadow: none; }
#generate-btn { padding: 15px; font-size: 15px; }
.btn { border-radius: 9px; font-weight: 600; }
.stage { background: radial-gradient(circle at 75% 16%,#f0ebfa 0,#f8f7fb 44%,#f8f7fb 100%); padding: 28px clamp(20px,3vw,48px); align-items: stretch; }
.stage-heading { display: flex; width: 100%; max-width: 1140px; margin: 0 auto 26px; align-items: end; justify-content: space-between; gap: 20px; }
.stage-heading h2 { margin-top: 3px; font-size: 25px; letter-spacing: -.04em; }
.stage-help { color: var(--muted); font-size: 12px; text-align: right; }
.stage-empty { margin: clamp(42px,10vh,118px) auto 35px; width: min(100%,560px); min-height: 380px; padding: 44px 34px; border: 1px dashed #d2c7e7; background: rgba(255,255,255,.78); border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 18px 45px rgba(46,34,79,.035); }
.stage-empty h3 { color: var(--ink); font-size: 20px; letter-spacing: -.025em; margin: 26px 0 8px; }
.stage-empty p { max-width: 38ch; line-height: 1.6; }
.empty-illustration { width: 158px; height: 118px; position: relative; }
.empty-illustration span { position: absolute; display: block; border-radius: 15px; border: 1px solid #d4cbe7; box-shadow: 0 8px 20px rgba(65,48,100,.08); }
.empty-illustration span:nth-child(1) { width: 74px; height: 85px; left: 10px; top: 21px; background: #e8dcf5; transform: rotate(-13deg); }
.empty-illustration span:nth-child(2) { width: 80px; height: 90px; right: 11px; top: 12px; background: #e9dbca; transform: rotate(12deg); }
.empty-illustration span:nth-child(3) { width: 86px; height: 96px; left: 37px; top: 9px; background: linear-gradient(150deg,#fff 24%,#f5ecdb 25%,#f5ecdb 49%,#ddd0ee 50%,#ddd0ee 70%,#fff 71%); }
.empty-flow { display: flex; gap: 8px; margin-top: 24px; flex-wrap: wrap; justify-content: center; }
.empty-flow span { padding: 7px 10px; border-radius: 999px; background: #f1ecfa; color: #675288; font-size: 11px; font-weight: 700; }
.result { max-width: 1140px; margin: 0 auto; }
.result-media { padding: 16px; border: 1px solid #e9e4f1; box-shadow: 0 9px 28px rgba(45,34,75,.05); }
.history { background: #fff; padding: 42px clamp(20px,3vw,48px) 110px; }
.history-head h2 { font-size: 24px; letter-spacing: -.04em; }
.history-grid { grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 16px; }
.h-card { box-shadow: 0 4px 14px rgba(36,28,58,.04); }
.h-card:hover { border-color: #b9a5d8; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(36,28,58,.08); }
.overlay { background: rgba(24,20,45,.56); backdrop-filter: blur(5px); }
.login-card, .team-card { background: #fff; border-radius: 20px; box-shadow: 0 25px 65px rgba(20,15,45,.18); }
.login-card { max-width: 405px; padding: 34px; gap: 15px; }
.login-symbol { margin-bottom: 7px; width: 45px; height: 45px; }
.login-card h2 { font-size: 24px; line-height: 1.15; letter-spacing: -.04em; }
.login-card label, .team-form label { font-weight: 650; }
.login-card input { padding: 11px 12px; min-height: 43px; }
.team-card { width: min(94vw,620px); max-height: 90vh; overflow: auto; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.team-card h2 { font-size: 24px; letter-spacing: -.035em; }
.icon-btn { border: 0; background: #f3eff9; color: #554576; border-radius: 9px; width: 34px; height: 34px; font-size: 23px; cursor: pointer; }
.team-list { display: flex; flex-direction: column; gap: 8px; }
.team-person { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; }
.team-avatar { display: grid; place-items: center; flex: none; width: 35px; height: 35px; border-radius: 10px; background: #ebe5f7; color: #65499d; font-weight: 800; }
.team-person-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.team-person-info small { color: var(--muted); }
.team-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--line); padding-top: 17px; }
.team-form h3, .team-form .error, .team-form .btn-primary { grid-column: 1/-1; }
.team-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.team-form input, .team-form select { width: 100%; padding: 8px 10px; }
.team-help { grid-column:1/-1; font-size:12px; line-height:1.7; color:var(--muted); margin:10px 0; }
#team-existing-form { margin-top:22px; }
#team-accounts { margin:22px 0; font-size:13px; }
#team-accounts summary { cursor:pointer; padding:10px 0; font-weight:650; }
.team-person-info { overflow-wrap:anywhere; }
.team-confirm { width:min(92vw,480px); max-height:90dvh; overflow:auto; border:1px solid #94aa96; border-radius:24px; padding:28px; background:#f2efe6; color:#18251d; }
.team-confirm::backdrop { background:#101612ce; backdrop-filter:blur(5px); }
.team-confirm form { display:flex; flex-direction:column; gap:18px; }
.team-confirm h2 { font-size:25px; line-height:1.25; }
.team-confirm p { font-size:13px; line-height:1.75; }
.team-confirm label { display:flex; flex-direction:column; gap:8px; font-size:13px; }
.team-confirm input { width:100%; padding:10px; }
.team-confirm-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:12px; }
.team-confirm-actions button { min-height:44px; padding:10px 15px; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #9d80d8; outline-offset: 2px; }
@media (max-width: 1080px) { .topbar { flex-wrap: wrap; } .layout { grid-template-columns: minmax(330px,390px) minmax(0,1fr); } .topnav .chip { display: none; } }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .stage { min-height: 560px; } .stage-heading { margin-bottom: 8px; } .panel { padding: 20px; } }
@media (max-width: 580px) { .topbar { gap: 12px; padding: 12px 16px; } .brand { width: 100%; } .topbar > .segmented { order: 3; width: 100%; justify-content: space-between; } .topnav { flex: 1; justify-content: space-between; } .topnav a:first-of-type { display: none; } .topnav .user-box { padding-left: 6px; } .stage-help { display: none; } .stage-empty { margin-top: 28px; min-height: 340px; padding: 28px 18px; } .team-form { grid-template-columns: 1fr; } .options { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Catálogo privado y revisión por piezas */
.zone-tools{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:16px 0}
.zone-tools label{display:flex;gap:8px;align-items:center}.zone-tools input{width:64px}
.zone-parts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));gap:12px;margin-bottom:24px}
.zone-parts textarea{width:100%;min-height:72px;resize:vertical;box-sizing:border-box;line-height:1.5}
.season-swatch{outline:2px solid #62836c;outline-offset:2px}
#season-picker{max-width:180px}.color-suggestions,.recognized-colors{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}
.color-suggestion,.color-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 8px;border:1px solid var(--line,#ccd0c8);font-size:12px;background:transparent;color:inherit}
.color-suggestion i,.color-chip i{width:14px;height:14px;border-radius:50%;border:1px solid #888;flex:none}
.color-suggestion{cursor:pointer}.color-suggestion:focus-visible{outline:2px solid #5b8068;outline-offset:2px}

/* Auditoría 22/10: confirmaciones y avisos fotográficos. */
.impact-dialog { max-width: 620px; padding: 28px; }
.impact-dialog p { margin: 18px 0; line-height: 1.6; }
.impact-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.canvas-photo-warning { padding: 10px; background: #fff1ce; color: #59451d; font-size: 13px; }

/* Información del piloto accesible también antes de iniciar sesión. */
.login-legal{font-size:12px;line-height:1.7;color:var(--muted,#526056);margin:18px 0 0}.login-legal a{text-decoration:underline;text-underline-offset:3px}
