:root {
    --green-950: #102f23;
    --green-900: #173f2f;
    --green-800: #20543d;
    --green-700: #2d6b50;
    --green-600: #2f865b;
    --green-500: #42a675;
    --green-100: #e5f1e9;
    --green-50: #f3f8f4;
    --grape-700: #69526f;
    --grape-100: #f0eaf2;
    --sand-100: #f3eee5;
    --ink-950: #17211b;
    --ink-800: #2b352f;
    --ink-600: #657069;
    --ink-500: #7b857f;
    --line: #dce4de;
    --line-soft: #edf1ee;
    --surface: #ffffff;
    --surface-2: #f8faf8;
    --page: #f4f6f4;
    --danger: #c53b45;
    --warning: #a66a0a;
    --shadow-sm: 0 3px 12px rgba(21, 55, 38, .055);
    --shadow-md: 0 16px 40px rgba(21, 55, 38, .095);
    --radius: 18px;
    --sidebar-w: 260px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--page);
    color: var(--ink-950);
    font-family: "Manrope", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(33,163,102,.2); outline-offset: 2px; }
.oculto { display: none !important; }

/* =============== APP SHELL =============== */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    background: linear-gradient(180deg, #102f23 0%, #133728 100%);
    color: #fff;
    border-right: 1px solid rgba(255,255,255,.08);
}
.brand-block { display: flex; align-items: center; gap: 12px; padding: 4px 8px 24px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: rgba(255,255,255,.11); color: #d9f4e3; }
.brand-mark svg { width: 23px; height: 23px; }
.brand-block strong { display: block; font-size: 1.02rem; letter-spacing: -.01em; }
.brand-block span { display: block; margin-top: 2px; color: rgba(255,255,255,.58); font-size: .78rem; }
.app-nav { display: grid; gap: 6px; }
.nav-item-app {
    width: 100%; min-height: 46px; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px;
    padding: 11px 12px; border: 0; border-radius: 12px; background: transparent; color: rgba(255,255,255,.68); text-align: left; cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item-app:hover { color: #fff; background: rgba(255,255,255,.075); }
.nav-item-app.activo { color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 3px 0 0 #56c985; }
.nav-item-app svg { width: 19px; height: 19px; }
.nav-item-app span:not(.nav-badge) { font-size: .9rem; font-weight: 600; }
.nav-badge { min-width: 40px; padding: 3px 7px; border-radius: 999px; background: rgba(255,255,255,.1); color: #dff6e7; text-align: center; font-size: .7rem; font-weight: 700; }
.sidebar-status { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(255,255,255,.05); }
.sidebar-status strong { display: block; font-size: .79rem; }
.sidebar-status span { display: block; margin-top: 2px; color: rgba(255,255,255,.5); font-size: .7rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #48c97b; box-shadow: 0 0 0 5px rgba(72,201,123,.12); flex: 0 0 auto; }

.app-main { grid-column: 2; min-width: 0; }
.app-topbar {
    position: sticky; top: 0; z-index: 45;
    min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 18px clamp(22px, 3vw, 42px); background: rgba(255,255,255,.95); backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line-soft);
}
.topbar-kicker { margin: 0 0 3px; color: var(--green-700); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.app-topbar h1 { margin: 0; font-size: clamp(1.35rem, 2vw, 1.85rem); font-weight: 800; letter-spacing: -.035em; }
.app-topbar p:last-child { margin: 4px 0 0; color: var(--ink-600); font-size: .82rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.model-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-600); font-size: .76rem; font-weight: 700; }
.model-pill .status-dot { width: 7px; height: 7px; box-shadow: none; }
.top-new { display: inline-flex; align-items: center; gap: 7px; }
.top-new svg { width: 16px; height: 16px; }
.app-content { width: 100%; max-width: 1540px; margin: 0 auto; padding: clamp(22px, 3vw, 38px); }
.app-view { display: none; animation: view-in .2s ease; }
.app-view.activo { display: block; }
@keyframes view-in { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* =============== SHARED COMPONENTS =============== */
.app-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: clamp(20px, 2.2vw, 28px); }
.app-card h2, .app-card h3 { margin: 0; color: var(--ink-950); font-weight: 800; letter-spacing: -.025em; }
.app-card h2 { font-size: clamp(1.18rem, 1.7vw, 1.48rem); }
.app-card h3 { font-size: 1.05rem; }
.app-card p { color: var(--ink-600); line-height: 1.55; }
.section-eyebrow { display: inline-block; margin-bottom: 7px; color: var(--green-700); font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .095em; }
.section-eyebrow.light { color: #c4ebd2; }
.card-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.card-head-row.compact p { margin-bottom: 0; }
.card-head-row p { max-width: 720px; margin: 6px 0 0; font-size: .86rem; }
.step-chip, .feature-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; background: var(--green-50); color: var(--green-700); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.step-chip span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--green-700); color: white; }
.feature-badge svg { width: 15px; height: 15px; }
.btn { border-radius: 10px; font-weight: 600; }
.btn-success { background: var(--green-600); border-color: var(--green-600); }
.btn-success:hover, .btn-success:focus { background: #126f45; border-color: #126f45; }
.btn-outline-success { color: var(--green-700); border-color: #68ad84; }
.btn-outline-success:hover { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.btn svg { width: 17px; height: 17px; margin-right: 5px; vertical-align: -3px; }
.soft-alert { border-color: #cfe8d8; background: #f3faf5; color: #285f3d; }
.app-alert { border-radius: 13px; box-shadow: var(--shadow-sm); }
.metric-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e9efeb; }
.metric-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-600), #57b97c); transition: width .45s ease; }
.metric-track.large { height: 10px; }

/* =============== CLASSIFIER =============== */
.postest-mini { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 14px; border: 1px solid #cae7d5; border-radius: 14px; background: #f4fbf6; }
.postest-mini > div { display: flex; align-items: center; gap: 11px; }
.postest-mini-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #dff3e6; color: var(--green-700); }
.postest-mini-icon svg { width: 18px; height: 18px; }
.postest-mini strong, .postest-mini span { display: block; }
.postest-mini strong { font-size: .82rem; }
.postest-mini div > div > span { color: var(--ink-600); font-size: .72rem; }
.classify-layout { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr); gap: 22px; align-items: start; }
.workspace-column { display: grid; gap: 18px; min-width: 0; }
.result-column { position: sticky; top: 116px; min-width: 0; }
.capture-card { min-height: 330px; }
.photo-guide-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 24px 0; }
.photo-guide-grid > div { min-height: 72px; display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-2); color: var(--ink-600); font-size: .73rem; font-weight: 600; }
.photo-guide-grid svg { width: 19px; height: 19px; color: var(--green-700); }
.research-note { display: flex; gap: 10px; margin-bottom: 18px; padding: 12px 13px; border: 1px solid #d4eadb; border-radius: 12px; background: var(--green-50); color: var(--ink-600); }
.research-note > svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; color: var(--green-700); }
.research-note strong, .research-note span { display: block; }
.research-note strong { color: var(--green-800); font-size: .79rem; }
.research-note span { margin-top: 2px; font-size: .72rem; }
.primary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-tile { min-height: 88px; display: grid; grid-template-columns: 44px 1fr 18px; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink-950); text-align: left; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.action-tile:hover { transform: translateY(-2px); border-color: #a8cfb7; box-shadow: var(--shadow-md); }
.action-tile.action-primary { border-color: #b5d9c2; background: linear-gradient(145deg, #f4fbf6, #fff); }
.action-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--green-100); color: var(--green-700); }
.action-icon svg { width: 21px; height: 21px; }
.action-tile strong, .action-tile small { display: block; }
.action-tile strong { font-size: .86rem; }
.action-tile small { margin-top: 2px; color: var(--ink-500); font-size: .68rem; }
.action-arrow { width: 16px; height: 16px; color: #8b958e; }
.camera-frame, .cropper-shell { position: relative; width: 100%; overflow: hidden; border-radius: 15px; background: #0b100d; }
.camera-frame { margin: 20px 0; min-height: 360px; display: grid; place-items: center; }
#videoCamara { display: block; width: 100%; max-height: 620px; object-fit: contain; }
.camera-reticle { position: absolute; inset: 10%; border: 1px dashed rgba(255,255,255,.45); border-radius: 18px; pointer-events: none; }
.cropper-shell { min-height: 430px; max-height: 68vh; margin: 20px 0 16px; }
#imagenCropper { display: block; max-width: 100%; }
.live-timer { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 999px; background: #edf8f1; color: var(--green-800); font-size: .74rem; font-weight: 800; white-space: nowrap; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(33,163,102,.25);} 50% { box-shadow: 0 0 0 6px rgba(33,163,102,0);} }
.toolbar-row, .editor-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.editor-toolbar { padding-top: 4px; }
.tool-group { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-classify { min-width: 160px; }
.empty-result { min-height: 480px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; background: linear-gradient(180deg,#fff,#f9fbfa); }
.empty-visual { width: 84px; height: 84px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid #dceae1; border-radius: 24px; background: var(--green-50); color: var(--green-700); }
.empty-visual svg { width: 40px; height: 40px; }
.empty-result h3 { font-size: 1.2rem; }
.empty-result p { max-width: 360px; margin: 8px auto 18px; font-size: .84rem; }
.mini-specs { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.mini-specs span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-600); font-size: .67rem; background: #fff; }
.result-card { padding: 0; overflow: hidden; }
.result-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; padding: 25px; background: linear-gradient(145deg,#fff,#f7fbf8); border-bottom: 1px solid var(--line-soft); }
.result-top h2 { margin-top: 2px; color: var(--green-800); font-size: clamp(2rem, 4vw, 3rem); text-transform: uppercase; }
.result-confidence { margin: 5px 0 0 !important; color: var(--ink-600); font-size: .82rem; }
.result-confidence strong { color: var(--ink-950); }
.record-pill { display: inline-flex; margin: 12px 0 0 !important; padding: 5px 9px; border-radius: 999px; background: var(--green-100); color: var(--green-800) !important; font-size: .72rem; }
.result-image { width: 118px; height: 118px; flex: 0 0 auto; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); }
.result-image img { width: 100%; height: 100%; object-fit: cover; }
.probability-panel { padding: 22px 25px 8px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.panel-title-row h3 { font-size: .93rem; }
.panel-title-row > span { color: var(--ink-500); font-size: .65rem; text-transform: uppercase; letter-spacing: .07em; }
.prob-row { margin-bottom: 16px; }
.prob-row > div:first-child { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 6px; font-size: .77rem; }
.prob-row strong { color: var(--ink-800); }
.time-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 10px 25px 20px; }
.time-card { min-height: 82px; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 9px; align-items: center; padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-2); }
.time-card > svg { grid-row: 1 / 3; width: 20px; height: 20px; color: var(--green-700); }
.time-card span { color: var(--ink-500); font-size: .67rem; }
.time-card strong { font-size: .9rem; }
.time-card-primary { border-color: #cde6d6; background: #f0f8f3; }
.clinical-note { display: flex; gap: 9px; margin: 0 25px 18px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-600); font-size: .7rem; line-height: 1.45; }
.clinical-note svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--green-700); }
.result-card > .soft-alert { margin: 0 25px 14px; }
.result-new { display: flex; align-items: center; justify-content: center; width: calc(100% - 50px); margin: 0 25px 25px; }

/* =============== POSTEST =============== */
.research-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(300px,.45fr); gap: 20px; align-items: stretch; }
.switch-pro { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.switch-pro .form-check-input { width: 2.5rem; height: 1.3rem; margin: 0; cursor: pointer; }
.postest-controls { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.postest-input-row { display: grid; grid-template-columns: minmax(220px,.45fr) minmax(0,1fr); gap: 16px; align-items: stretch; }
.progress-card { padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.progress-card > div:first-child { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 10px; color: var(--ink-600); font-size: .75rem; }
.progress-card strong { color: var(--green-800); }
.progress-card p { margin: 8px 0 0; font-size: .7rem; }
.stat-grid { display: grid; gap: 9px; margin-top: 16px; }
.stat-grid.five { grid-template-columns: repeat(5,minmax(0,1fr)); }
.stat-grid.four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.stat-grid > div { min-height: 85px; display: grid; grid-template-columns: 25px 1fr; grid-template-rows: auto auto; column-gap: 7px; align-items: center; padding: 11px; border: 1px solid var(--line-soft); border-radius: 12px; background: #fbfcfb; }
.stat-grid > div > svg { grid-row: 1 / 3; width: 18px; height: 18px; color: var(--green-700); }
.stat-grid span { color: var(--ink-500); font-size: .64rem; }
.stat-grid strong { font-size: .82rem; }
.stat-grid .featured { border-color: #cce6d5; background: #f0f8f3; }
.postest-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.postest-off-state { display: flex; align-items: center; gap: 12px; margin-top: 21px; padding: 14px; border: 1px dashed #cdd9d1; border-radius: 13px; background: var(--surface-2); }
.empty-icon-small { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: var(--green-100); color: var(--green-700); }
.empty-icon-small svg { width: 19px; height: 19px; }
.postest-off-state strong, .postest-off-state span { display: block; }
.postest-off-state strong { font-size: .8rem; }
.postest-off-state span { margin-top: 3px; color: var(--ink-600); font-size: .7rem; }
.methodology-card { background: linear-gradient(160deg,#173f2b,#1e5739); color: #fff; border: 0; }
.methodology-card .section-eyebrow { color: #bfe8cd; }
.methodology-card h3 { color: #fff; font-size: 1.12rem; }
.method-list { display: grid; gap: 13px; margin-top: 20px; }
.method-list > div { display: flex; gap: 10px; align-items: flex-start; }
.method-list > div > span { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: rgba(255,255,255,.1); color: #dff4e7; font-size: .64rem; font-weight: 800; }
.method-list strong, .method-list small { display: block; }
.method-list strong { color: #fff; font-size: .76rem; }
.method-list small { margin-top: 2px; color: rgba(255,255,255,.62); font-size: .66rem; line-height: 1.4; }
.history-card { margin-top: 20px; }
.history-table-wrap { position: relative; margin-top: 16px; border: 1px solid var(--line-soft); border-radius: 13px; overflow: hidden; }
.history-table-wrap .table { font-size: .74rem; }
.history-table-wrap thead th { padding: 11px 13px; background: var(--surface-2); color: var(--ink-600); border-bottom-color: var(--line); font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; }
.history-table-wrap tbody td { padding: 11px 13px; border-bottom-color: var(--line-soft); }
.history-empty { padding: 28px; text-align: center; color: var(--ink-500); font-size: .76rem; }
.class-chip { display: inline-block; padding: 4px 7px; border-radius: 999px; background: var(--green-100); color: var(--green-800); font-size: .67rem; font-weight: 700; text-transform: capitalize; }

/* =============== BATCH =============== */
.batch-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(280px,.55fr); gap: 20px; align-items: start; }
.batch-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 300px; margin-top: 22px; padding: 28px; border: 1.5px dashed #b8cfbf; border-radius: 16px; background: linear-gradient(180deg,#fbfdfb,#f5faf7); text-align: center; }
.batch-icon { width: 65px; height: 65px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 18px; background: var(--green-100); color: var(--green-700); }
.batch-icon svg { width: 30px; height: 30px; }
.batch-dropzone h3 { font-size: 1rem; }
.batch-dropzone p { max-width: 520px; margin: 7px auto 18px; font-size: .78rem; }
.batch-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.batch-summary { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.batch-progress { margin-top: 13px; }
.batch-current { margin: 8px 0 0 !important; color: var(--ink-500) !important; font-size: .7rem; }
.batch-help h3 { margin-bottom: 8px; }
.batch-help > p { font-size: .8rem; }
.info-stack { display: grid; gap: 11px; margin-top: 20px; }
.info-stack > div { display: flex; gap: 10px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 11px; background: var(--surface-2); }
.info-stack svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--green-700); }
.info-stack strong, .info-stack small { display: block; }
.info-stack strong { font-size: .75rem; }
.info-stack small { margin-top: 2px; color: var(--ink-500); font-size: .65rem; line-height: 1.4; }

/* =============== MODEL =============== */
.model-hero { min-height: 210px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(28px,4vw,48px); border-radius: 22px; background: linear-gradient(130deg,#153b28,#246544); color: #fff; box-shadow: var(--shadow-md); }
.model-hero h2 { margin: 0; max-width: 680px; color: #fff; font-size: clamp(1.7rem,3vw,2.6rem); font-weight: 800; letter-spacing: -.04em; }
.model-hero p { max-width: 650px; margin: 10px 0 0; color: rgba(255,255,255,.66); }
.model-icon { width: 110px; height: 110px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 28px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); }
.model-icon svg { width: 54px; height: 54px; color: #c8eed5; }
.model-metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin: 18px 0; }
.metric-big { min-height: 128px; display: flex; flex-direction: column; justify-content: center; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.metric-big span { color: var(--ink-500); font-size: .7rem; }
.metric-big strong { margin-top: 4px; color: var(--green-800); font-size: clamp(1.55rem,2.3vw,2.05rem); letter-spacing: -.035em; }
.metric-big small { margin-top: 5px; color: var(--ink-500); font-size: .66rem; }
.model-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.definition-list { margin-top: 18px; }
.definition-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: .75rem; }
.definition-list > div:last-child { border-bottom: 0; }
.definition-list span { color: var(--ink-500); }
.definition-list strong { max-width: 60%; text-align: right; color: var(--ink-800); }
.muted-copy { margin-top: 10px; font-size: .8rem; }
.metric-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.metric-tags span { padding: 6px 9px; border-radius: 999px; background: var(--green-50); color: var(--green-800); font-size: .7rem; font-weight: 700; }
.model-note { display: flex; gap: 10px; padding: 12px; border: 1px solid #d5e7db; border-radius: 12px; background: #f4faf6; color: var(--ink-600); font-size: .7rem; line-height: 1.45; }
.model-note svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--green-700); }

/* =============== PROCESSING OVERLAY =============== */
.processing-overlay { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 20px; background: rgba(12,27,18,.54); backdrop-filter: blur(8px); }
.processing-dialog { width: min(390px,100%); padding: 30px 28px; border: 1px solid rgba(255,255,255,.55); border-radius: 24px; background: rgba(255,255,255,.97); text-align: center; box-shadow: 0 30px 90px rgba(0,0,0,.26); animation: dialog-in .22s ease; }
@keyframes dialog-in { from { opacity:0; transform: translateY(8px) scale(.98);} to { opacity:1; transform:none;} }
.scanner-animation { position: relative; width: 92px; height: 92px; display: grid; place-items: center; margin: 0 auto 16px; overflow: hidden; border: 1px solid #d6e9dd; border-radius: 24px; background: linear-gradient(145deg,#f2faf5,#e6f5ec); color: var(--green-700); }
.scanner-animation > svg { width: 43px; height: 43px; }
.scan-beam { position: absolute; left: 8px; right: 8px; height: 2px; background: #31b36b; box-shadow: 0 0 10px rgba(49,179,107,.65); animation: scan 1s infinite ease-in-out; }
@keyframes scan { 0% { top: 14px; opacity:.2;} 50% { opacity:1;} 100% { top: 76px; opacity:.2;} }
.processing-label { color: var(--green-700); font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.processing-dialog h2 { margin: 6px 0 6px; font-size: 1.35rem; font-weight: 800; }
.processing-dialog p { margin: 0; color: var(--ink-600); font-size: .78rem; line-height: 1.5; }
.processing-bar { height: 5px; margin-top: 21px; overflow: hidden; border-radius: 999px; background: #e7eee9; }
.processing-bar span { display: block; width: 34%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--green-600),#70c992); animation: loading 1s infinite ease-in-out; }
@keyframes loading { 0% { transform: translateX(-120%);} 100% { transform: translateX(390%);} }

/* =============== MOBILE NAV =============== */
.mobile-bottom-nav { display: none; }

/* =============== RESPONSIVE =============== */
@media (max-width: 1180px) {
    .classify-layout { grid-template-columns: 1fr; }
    .result-column { position: static; }
    .empty-result { min-height: 300px; }
    .research-grid, .batch-layout { grid-template-columns: 1fr; }
    .stat-grid.five { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .model-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
    :root { --sidebar-w: 0px; }
    body { padding-bottom: 74px; }
    .app-shell { display: block; }
    .app-sidebar { display: none; }
    .app-main { min-width: 0; }
    .app-topbar { min-height: 80px; padding: 14px 18px; }
    .topbar-actions .model-pill { display: none; }
    .app-content { padding: 18px; }
    .mobile-bottom-nav { position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 80; display: grid; grid-template-columns: repeat(4,1fr); padding: 6px; border: 1px solid rgba(22,57,38,.12); border-radius: 18px; background: rgba(255,255,255,.96); backdrop-filter: blur(18px); box-shadow: 0 16px 40px rgba(22,57,38,.16); }
    .mobile-bottom-nav button { min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 13px; background: transparent; color: var(--ink-500); font-size: .62rem; font-weight: 700; }
    .mobile-bottom-nav button.activo { background: var(--green-50); color: var(--green-800); }
    .mobile-bottom-nav svg { width: 19px; height: 19px; }
    .photo-guide-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .model-detail-grid { grid-template-columns: 1fr; }
    .stat-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 650px) {
    .app-topbar { align-items: flex-start; }
    .app-topbar p:last-child, .topbar-kicker { display: none; }
    .top-new { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border-radius: 11px; font-size: 0; }
    .top-new svg { margin: 0; }
    .app-content { padding: 13px; }
    .app-card { padding: 18px; border-radius: 15px; }
    .card-head-row { flex-direction: column; }
    .primary-actions { grid-template-columns: 1fr; }
    .action-tile { min-height: 78px; }
    .cropper-shell { min-height: 310px; max-height: 58vh; }
    .camera-frame { min-height: 280px; }
    .toolbar-row, .editor-toolbar { align-items: stretch; flex-direction: column; }
    .tool-group, .actions-right { width: 100%; }
    .tool-group .btn { flex: 1; }
    .actions-right .btn { width: 100%; }
    .result-top { padding: 20px; }
    .result-image { width: 94px; height: 94px; }
    .probability-panel { padding: 18px 20px 5px; }
    .time-metrics { grid-template-columns: 1fr; padding: 9px 20px 18px; }
    .clinical-note, .result-card > .soft-alert { margin-left: 20px; margin-right: 20px; }
    .result-new { width: calc(100% - 40px); margin-left: 20px; margin-right: 20px; }
    .postest-input-row { grid-template-columns: 1fr; }
    .stat-grid.five, .stat-grid.four { grid-template-columns: 1fr 1fr; }
    .model-metric-grid { grid-template-columns: 1fr; }
    .model-hero { min-height: 0; padding: 26px 22px; }
    .model-icon { display: none; }
    .definition-list > div { flex-direction: column; gap: 4px; }
    .definition-list strong { max-width: 100%; text-align: left; }
    .postest-mini { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 420px) {
    .photo-guide-grid { grid-template-columns: 1fr 1fr; }
    .photo-guide-grid > div { min-height: 66px; }
    .stat-grid.five, .stat-grid.four { grid-template-columns: 1fr; }
    .result-top { flex-direction: column-reverse; }
    .result-image { width: 100%; height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Error pages kept compatible */
.contenido-error { max-width: 700px; margin: 0 auto; padding: 80px 20px; }
.codigo-error { margin-bottom: 5px; color: var(--green-700); font-size: 4rem; font-weight: 800; line-height: 1; }


/* =============== PRESENTATION / FINAL PRODUCT =============== */
.final-mode .research-only { display: none !important; }
.final-mode .mobile-bottom-nav { grid-template-columns: repeat(3, 1fr); }

.solution-strip {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid #d9e6dc;
    border-radius: 15px;
    background: rgba(255,255,255,.82);
    box-shadow: var(--shadow-sm);
}
.solution-strip-icon {
    width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: 12px; background: var(--green-100); color: var(--green-700);
}
.solution-strip-icon svg { width: 20px; height: 20px; }
.solution-strip strong { display: block; font-size: .82rem; letter-spacing: -.01em; }
.solution-strip > div:nth-child(2) > span { display: block; margin-top: 3px; color: var(--ink-600); font-size: .72rem; line-height: 1.45; }
.solution-strip-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.solution-strip-tags span { padding: 5px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--ink-600); font-size: .64rem; font-weight: 700; }

.app-topbar h1 { font-weight: 700; letter-spacing: -.03em; }
.app-card h2, .app-card h3 { font-weight: 700; }
.nav-item-app.activo { box-shadow: inset 3px 0 0 #67d293; }
.btn-success { box-shadow: 0 4px 12px rgba(47,134,91,.14); }
.action-tile strong { font-weight: 700; }

.model-hero-refined {
    background:
        radial-gradient(circle at 86% 22%, rgba(240,234,242,.14), transparent 24%),
        linear-gradient(125deg, #143b2b 0%, #245f45 68%, #5f4a65 145%);
}
.hero-tech-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hero-tech-pills span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.82); font-size: .7rem; font-weight: 700; }
.hero-tech-pills svg { width: 15px; height: 15px; }

.process-card { margin: 18px 0; }
.tech-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 9px; margin-top: 22px; }
.tech-flow > div { min-height: 116px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 13px 10px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface-2); text-align: center; }
.flow-icon { width: 37px; height: 37px; display: grid; place-items: center; margin-bottom: 3px; border-radius: 11px; background: var(--green-100); color: var(--green-700); }
.flow-icon svg { width: 19px; height: 19px; }
.tech-flow strong { font-size: .74rem; }
.tech-flow small { color: var(--ink-500); font-size: .62rem; line-height: 1.35; }
.flow-arrow { width: 18px; color: #aab7ae; }

.model-metric-grid.five-up { grid-template-columns: repeat(5,minmax(0,1fr)); }
.metric-big.accent { border-color: #dfd1e2; background: linear-gradient(160deg,#fff,#faf6fb); }
.metric-big.accent strong { color: var(--grape-700); }

.weight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 18px 0 12px; }
.weight-grid > div { padding: 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-2); text-align: center; }
.weight-grid span, .weight-grid strong { display: block; }
.weight-grid span { color: var(--ink-500); font-size: .68rem; }
.weight-grid strong { margin-top: 4px; color: var(--green-800); font-size: 1.1rem; }
.formula-box { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 14px; margin-bottom: 12px; border-radius: 12px; background: var(--grape-100); color: var(--grape-700); }
.formula-box span { font-size: .7rem; font-weight: 700; }
.formula-box strong { font-size: .95rem; }
.neutral-note { background: #f8faf8; border-color: var(--line); }

.training-grid { margin-top: 18px; }
.training-steps { display: grid; gap: 10px; margin-top: 18px; }
.training-steps > div { display: flex; gap: 11px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.training-steps > div:last-child { border-bottom: 0; }
.training-steps > div > span { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--green-100); color: var(--green-800); font-size: .65rem; font-weight: 800; }
.training-steps strong, .training-steps small { display: block; }
.training-steps strong { font-size: .77rem; }
.training-steps small { margin-top: 3px; color: var(--ink-500); font-size: .68rem; line-height: 1.45; }
.augmentation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 18px 0; }
.augmentation-grid div { display: flex; align-items: center; gap: 9px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-2); color: var(--ink-800); font-size: .7rem; font-weight: 700; }
.augmentation-grid svg { width: 18px; height: 18px; color: var(--green-700); }

.evaluation-card { margin-top: 18px; }
.grape-badge { background: var(--grape-100); color: var(--grape-700); }
.evaluation-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 20px; }
.evaluation-grid > div { padding: 16px; border: 1px solid var(--line-soft); border-radius: 13px; background: var(--surface-2); }
.evaluation-grid span, .evaluation-grid strong, .evaluation-grid small { display: block; }
.evaluation-grid span { color: var(--ink-500); font-size: .68rem; }
.evaluation-grid strong { margin-top: 4px; color: var(--green-800); font-size: 1.35rem; letter-spacing: -.03em; }
.evaluation-grid small { margin-top: 3px; color: var(--ink-500); font-size: .62rem; line-height: 1.35; }
.matrix-card { display: grid; grid-template-columns: minmax(240px,.7fr) minmax(420px,1.3fr); gap: 25px; align-items: center; margin-top: 16px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.matrix-table-wrap { overflow-x: auto; }
.matrix-table { width: 100%; border-collapse: separate; border-spacing: 6px; font-size: .7rem; }
.matrix-table th, .matrix-table td { padding: 10px; border-radius: 9px; background: var(--surface-2); text-align: center; }
.matrix-table thead th { color: var(--ink-500); font-weight: 700; }
.matrix-table tbody th { color: var(--ink-600); text-align: left; font-weight: 700; }
.matrix-table td { border: 1px solid var(--line-soft); font-weight: 700; }
.matrix-table .matrix-hit { background: var(--green-100); color: var(--green-900); border-color: #cfe3d6; }

.architecture-card { margin-top: 18px; }
.architecture-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 10px; align-items: center; margin: 20px 0 16px; }
.architecture-flow > div { display: flex; align-items: center; gap: 11px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 13px; background: var(--surface-2); }
.architecture-flow > div > svg { width: 24px; height: 24px; flex: 0 0 auto; color: var(--green-700); }
.architecture-flow > svg { width: 18px; color: #9eaaa2; }
.architecture-flow strong, .architecture-flow small { display: block; }
.architecture-flow strong { font-size: .75rem; }
.architecture-flow small { margin-top: 2px; color: var(--ink-500); font-size: .65rem; }

@media (max-width: 1180px) {
    .model-metric-grid.five-up { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .tech-flow { grid-template-columns: 1fr 1fr 1fr; }
    .tech-flow .flow-arrow { display: none; }
    .evaluation-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 900px) {
    .solution-strip { grid-template-columns: 40px 1fr; }
    .solution-strip-tags { grid-column: 2; justify-content: flex-start; }
    .matrix-card { grid-template-columns: 1fr; }
    .architecture-flow { grid-template-columns: 1fr; }
    .architecture-flow > svg { display: none; }
}

@media (max-width: 650px) {
    .solution-strip { grid-template-columns: 34px 1fr; padding: 11px 12px; }
    .solution-strip-icon { width: 34px; height: 34px; }
    .solution-strip-tags { grid-column: 1 / -1; }
    .solution-strip-tags span:nth-child(n+3) { display: none; }
    .model-metric-grid.five-up { grid-template-columns: 1fr; }
    .tech-flow { grid-template-columns: 1fr; }
    .weight-grid, .augmentation-grid, .evaluation-grid { grid-template-columns: 1fr; }
    .model-hero-refined h2 { font-size: 1.65rem; }
}

.final-mode .time-metrics { grid-template-columns: 1fr; }
#barraMildiu { background: linear-gradient(90deg, #35664f, #5a9477); }
#barraOidio { background: linear-gradient(90deg, #67506d, #93759a); }
#barraSana { background: linear-gradient(90deg, #27875a, #62bd86); }
.result-card[data-clase="sana"] #resultadoClase { color: #1d6a46; }
.result-card[data-clase="oidio"] #resultadoClase { color: var(--grape-700); }
.result-card[data-clase="mildiu"] #resultadoClase { color: #7b5a2c; }
