:root {
    /* Paleta sobria y monocroma con un único acento discreto. */
    --primary: #4f46e5;
    --primary-hover: #3730a3;
    --primary-soft: #f2f2f7;
    /* --gradient se conserva por compatibilidad, pero ahora es un color plano
       (tinta) para un aspecto más elegante y menos "startup". */
    --gradient: #1c1c22;
    --ink: #1c1c22;
    --bg: #fbfbfd;
    --surface: #ffffff;
    --border: #ececef;
    --text: #1c1c22;
    --text-secondary: #6b7280;
    --text-muted: #a1a1aa;
    --success: #16a34a;
    --warning: #d97706;
    --error: #dc2626;
    --radius: 12px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(24, 24, 27, 0.04);
    --shadow-hover: 0 6px 20px -12px rgba(24, 24, 27, 0.22);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- Header ---------- */
.header {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1320px;
    margin: 0 auto;
}

.logo {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    flex: 1;
}

.header-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    transition: all 0.15s;
}

.header-link {
    color: var(--text);
}

.header-link:hover {
    background: var(--primary-soft);
    border-color: var(--text-muted);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.status-dot.inactive {
    background: var(--text-muted);
}

/* ---------- Layout ---------- */
.main-content {
    display: flex;
    flex: 1;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
}

.sidebar {
    width: 230px;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 67px;
    height: calc(100vh - 67px);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.18s;
    text-align: left;
}

.nav-item:hover {
    background: var(--surface);
    color: var(--text);
}

.nav-item.active {
    background: var(--ink);
    color: white;
    box-shadow: var(--shadow);
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
}

.toggle-label input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-label input:checked + .toggle-slider {
    background: var(--success);
}

.toggle-label input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.content-area {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
    min-width: 0;
}

.view {
    display: none;
    animation: fade-in 0.25s ease;
}

.view.active {
    display: block;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.view h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
}

.view-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 640px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 8px 0 2px;
}

.section-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.empty-note {
    color: var(--text-muted);
    font-size: 14px;
}

/* ---------- Period selector ---------- */
.period-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.period-selector label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.period-selector select,
.filter-group input,
.filter-group select {
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.period-selector select:focus,
.filter-group input:focus,
.filter-group select:focus,
#chat-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ---------- Stat cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    transition: transform 0.18s, box-shadow 0.18s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.18s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    text-transform: capitalize;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-top: 6px;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ---------- Índices compuestos ---------- */
.indices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.index-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.index-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.index-name {
    font-size: 14px;
    font-weight: 600;
}

.index-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.index-bar {
    height: 8px;
    background: #eef1f6;
    border-radius: 999px;
    overflow: hidden;
}

.index-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.index-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ---------- Dual grid ---------- */
.dual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* ---------- Chart containers ---------- */
.chart-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.dual-grid .chart-container {
    margin-bottom: 0;
}

.chart-container h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
}

.chart-placeholder {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---------- Mini stats (multitarea / visual) ---------- */
.mini-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mini-stat {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.mini-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.mini-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 2px;
}

.mini-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---------- Hourly chart ---------- */
.hourly-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 180px;
    padding-top: 8px;
}

.hour-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
}

.hour-bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.hour-bar {
    width: 70%;
    min-height: 2px;
    background: var(--gradient);
    border-radius: 4px 4px 0 0;
    transition: height 0.4s ease, filter 0.15s;
}

.hour-col:hover .hour-bar {
    filter: brightness(1.1);
}

.hour-label {
    font-size: 10px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- Timeline (actividad × ánimo) ---------- */
.timeline-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 200px;
    padding-top: 8px;
    overflow-x: auto;
}

.tl-col {
    flex: 1 0 34px;
    min-width: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
}

.tl-emoji { font-size: 16px; line-height: 1; }

.tl-bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.tl-bar {
    width: 70%;
    min-height: 2px;
    background: var(--gradient, var(--primary));
    border-radius: 4px 4px 0 0;
    transition: height 0.4s ease, filter 0.15s;
}

.tl-col:hover .tl-bar { filter: brightness(1.1); }

.tl-label {
    font-size: 10px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- Tiempo por asignatura ---------- */
.subject-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.subject-name {
    flex: 0 0 34%;
    max-width: 34%;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subject-bar-wrap {
    flex: 1;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
    height: 14px;
}

.subject-bar {
    height: 100%;
    background: var(--gradient, var(--primary));
    border-radius: 6px;
    transition: width 0.4s ease;
}

.subject-time {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* ---------- Navigation sequences ---------- */
.nav-sequences {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-seq-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
}

.nav-from, .nav-to {
    font-weight: 600;
    color: var(--text);
}

.nav-arrow {
    color: var(--primary);
    font-weight: 700;
}

.nav-count {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Tables ---------- */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 13px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

td {
    font-size: 14px;
}

tbody tr {
    transition: background 0.12s;
}

tbody tr:hover {
    background: var(--primary-soft);
}

tr:last-child td {
    border-bottom: none;
}

/* ---------- Query / chat ---------- */
.query-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-group input,
.filter-group select {
    min-width: 180px;
}

.chat-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chat-messages {
    min-height: 300px;
    max-height: 420px;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 16px;
    display: flex;
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
}

.message.user .message-content {
    background: var(--gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.system .message-content,
.message.assistant .message-content {
    background: var(--bg);
    border-bottom-left-radius: 4px;
}

.message.system ul {
    margin-top: 12px;
    padding-left: 20px;
}

.message.system li {
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.message-meta {
    margin-top: 8px;
}

.llm-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-soft);
    padding: 2px 8px;
    border-radius: 999px;
}

.chat-input-container {
    display: flex;
    border-top: 1px solid var(--border);
    padding: 16px;
    gap: 12px;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

#send-btn {
    padding: 12px 24px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
}

#send-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* ---------- Factsheet / LLM ---------- */
.factsheet-panel,
.llm-response {
    margin-top: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.factsheet-panel.hidden,
.llm-response.hidden {
    display: none;
}

.factsheet-panel h3,
.llm-response h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
}

#factsheet-content {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    overflow-x: auto;
    max-height: 320px;
    white-space: pre-wrap;
    line-height: 1.5;
}

.factsheet-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

.btn-primary {
    padding: 10px 20px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s;
}

.btn-primary:hover { filter: brightness(1.05); }

.btn-secondary {
    padding: 10px 20px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-secondary:hover { background: var(--bg); }

.btn-danger {
    width: 100%;
    margin-top: 12px;
    padding: 9px 14px;
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-danger:hover { background: #dc2626; color: #fff; }

.reset-data-status {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted, #64748b);
    min-height: 1em;
}

.llm-content {
    font-size: 14px;
    line-height: 1.8;
}

/* ---------- Validation ---------- */
.validation-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.validation-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.validation-section h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary);
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.question-item {
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.question-item p {
    font-size: 14px;
    margin-bottom: 12px;
}

.question-item input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.validation-results {
    margin-top: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.validation-results.hidden {
    display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .sidebar {
        display: none;
    }
    .content-area {
        padding: 20px;
    }
}

/* Vista de perfil aprendido (solo lectura) */
.profile-display {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    max-width: 720px;
    margin-top: 20px;
}
.profile-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.profile-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}
.profile-value {
    font-size: 15px;
    color: var(--text);
}
.profile-empty {
    grid-column: 1 / -1;
    color: var(--text-secondary);
    font-size: 14px;
}
@media (max-width: 640px) {
    .profile-display { grid-template-columns: 1fr; }
}

/* Pestaña de cámara biométrica */
.camera-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    margin-top: 20px;
    align-items: start;
}
.camera-preview video {
    width: 100%;
    max-width: 360px;
    border-radius: var(--radius-sm);
    background: #000;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transform: scaleX(-1); /* efecto espejo */
}
.camera-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.camera-status {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}
.camera-readout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.biometric-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.biometric-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}
.biometric-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}
.camera-summary {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}
.camera-summary p { margin: 4px 0; }
@media (max-width: 760px) {
    .camera-layout { grid-template-columns: 1fr; }
}

/* Histórico de biometría */
.camera-history { margin-top: 24px; }
.history-table {
    width: 100%;
    max-width: 640px;
    border-collapse: collapse;
    font-size: 14px;
}
.history-table th, .history-table td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.history-table th {
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* --- Vista de consumo (Amazon) --- */
.amazon-h {
    margin: 26px 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.amazon-h:first-child { margin-top: 4px; }

.amazon-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
@media (max-width: 720px) {
    .amazon-cols { grid-template-columns: 1fr; }
}

.mini-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.mini-table th,
.mini-table td {
    padding: 9px 14px;
    font-size: 13px;
}
.mini-table th {
    background: var(--bg);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 11px;
    color: var(--text-secondary);
}

/* ============================================================
   REDISEÑO 2026-08-07 — dashboard orientado al usuario final
   ============================================================ */

/* Iconos del menú lateral */
.nav-item svg { flex: 0 0 auto; }

/* --- Datos destacados (Inicio) --- */
.highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.highlight-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
}
.highlight-card .hl-value {
    font-size: 30px;
    font-weight: 720;
    letter-spacing: -0.02em;
    color: var(--text);
    text-transform: capitalize;
    line-height: 1.15;
}
.highlight-card .hl-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}
.highlight-card.focus {
    background: var(--ink);
    border-color: var(--ink);
}
.highlight-card.focus .hl-value { color: #fff; }
.highlight-card.focus .hl-label { color: rgba(255,255,255,0.7); }

/* --- Paneles genéricos --- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.panel h3 {
    font-size: 16px;
    font-weight: 680;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}
.panel-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}
.panel-hint:last-child { margin-bottom: 0; }
.empty-panel { text-align: center; padding: 40px 24px; }
.empty-panel p { margin-bottom: 6px; }

/* --- Interés actual (current_focus) --- */
.focus-panel { }
.focus-headline {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 4px 0 16px;
    color: var(--text);
}
.focus-headline strong { font-weight: 720; }
.focus-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.focus-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.focus-item-title {
    font-size: 13px;
    font-weight: 550;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.focus-item-meta { font-size: 12px; color: var(--text-secondary); text-transform: capitalize; }

.when-line {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 15px;
    color: var(--text);
    box-shadow: var(--shadow);
}

/* --- Chips (términos / marcas) --- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 6px 13px;
    background: var(--primary-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--text);
}

/* --- Gráfica de barras horizontal (intereses) --- */
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 14px; }
.bar-name {
    flex: 0 0 34%;
    max-width: 34%;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bar-track {
    flex: 1;
    height: 22px;
    background: var(--bg);
    border-radius: 999px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: var(--ink);
    border-radius: 999px;
    transition: width 0.5s ease;
}

/* --- Rasgos de compra ("cómo compras") --- */
.trait-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.trait-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.trait-icon { color: var(--text); display: inline-flex; margin-top: 2px; }
.trait-title { font-size: 15px; font-weight: 620; }
.trait-desc { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

/* --- Cámara: activación destacada --- */
.camera-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 8px 0 22px;
}
.btn-camera-big {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    font-size: 16px;
    font-weight: 620;
    color: #fff;
    background: var(--ink);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--shadow-hover);
    transition: transform 0.12s, opacity 0.15s;
}
.btn-camera-big:hover { transform: translateY(-1px); }
.btn-camera-big:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* --- Privacidad --- */
.privacy-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.privacy-card.danger { border-color: #f1c9c9; }
.privacy-text h3 { font-size: 16px; font-weight: 660; margin-bottom: 4px; }
.privacy-text p { font-size: 13.5px; color: var(--text-secondary); max-width: 52ch; }
@media (max-width: 620px) {
    .privacy-card { flex-direction: column; align-items: flex-start; }
}
