/* Inter — UI font del Studio Design System (@fcl/design-system). */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== COLOR VARIABLES — @fcl/design-system tokens =====
 * Default = DARK (DS dark mode). Light vía [data-theme="light"] (DS light mode).
 * Los soft/glow se derivan del acento con color-mix → un solo lugar por acento. */
:root {
    /* superficies — DS dark */
    --bg-primary: #0a0a0a;        /* DS --background */
    --bg-secondary: #171717;      /* DS --card */
    --bg-tertiary: #262626;       /* DS --secondary (controles/campos) */
    --bg-card: #1a1a1a;           /* DS --muted (insets) */
    --bg-hover: #2e2e2e;          /* DS --secondary-hover (hover de controles) */
    --bg-active: #3a3a3a;         /* DS --secondary-active */

    /* inputs — DS: dark usa --input al 30% (bg-input/30), translúcido sobre la card */
    --input: #262626;             /* DS --input (dark) — borde de campos */
    --input-bg: color-mix(in srgb, var(--input) 30%, transparent);

    /* outline buttons — DS variante `outline` (dark) */
    --outline-bg: var(--input-bg);                                          /* dark:bg-input/30 */
    --outline-hover-bg: color-mix(in srgb, var(--input) 50%, transparent);  /* dark:hover:bg-input/50 */
    --outline-hover-fg: var(--text-primary);                                /* texto sin cambio */

    /* acento marca — DS dark primary (Electric Seafoam) */
    --accent-primary: #02ffd1;    /* DS --primary (dark) */
    --accent-hover: #2fe0cb;      /* DS --primary-hover (dark) */
    --accent-active: #55f3db;     /* DS --primary-active (dark) */
    --accent-foreground: #04004e; /* DS --accent-foreground: texto legible SOBRE el acento */
    --accent-hover-bg: color-mix(in srgb, var(--accent-primary) 10%, transparent);
    --accent-soft:     color-mix(in srgb, var(--accent-primary) 12%, transparent);
    --focus-ring:      color-mix(in srgb, var(--accent-primary) 50%, transparent); /* DS ring/50 */

    /* texto — DS dark */
    --text-primary: #e5e5e5;      /* DS --foreground */
    --text-secondary: #a3a3a3;    /* DS --muted-foreground */
    --text-tertiary: #6b6b6b;

    /* bordes */
    --border-color: #262626;      /* DS --border (dark) */
    --border-strong: #3a3a3a;     /* DS --border-strong (énfasis/hover) */
    --border-accent: var(--accent-primary);

    /* semánticos */
    --success: #c4df43;           /* DS --success (lime) */
    --warning: #ff9f26;           /* DS --warning */
    --danger:  #dc2626;           /* DS --destructive (dark) */

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);

    --toast-bg: #171717;
    --toast-text: #e5e5e5;
}

/* ===== LIGHT (DS light mode) ===== */
[data-theme="light"] {
    --bg-primary: #f7f7f7;        /* DS --surface-2 / --muted */
    --bg-secondary: #ffffff;      /* DS --card */
    --bg-tertiary: #f7f7f7;       /* DS --input-background */
    --bg-card: #f7f7f7;
    --bg-hover: #eef2f7;
    --bg-active: #e3ecf7;
    --bg-hover-light: #eef2f7;

    --input: #eaf3fe;             /* DS --input (light) — borde de campos */
    --input-bg: #f7f7f7;          /* DS --input-background (light) */

    /* outline buttons — DS variante `outline` (light) */
    --outline-bg: #ffffff;        /* DS outline: bg-background */
    --outline-hover-bg: #02ffd1;  /* DS outline: hover:bg-accent (seafoam) */
    --outline-hover-fg: #04004e;  /* DS --accent-foreground */

    --accent-primary: #041cff;    /* DS --primary (light, azul eléctrico) */
    --accent-hover: #1506c9;      /* DS --primary-hover */
    --accent-active: #080197;     /* DS --primary-active */
    --accent-foreground: #ffffff; /* blanco sobre azul */

    --text-primary: #0d0d0d;      /* DS --foreground (light) */
    --text-secondary: #5b5b66;    /* DS muted-foreground suavizado para jerarquía */
    --text-tertiary: #9a9aa3;

    --border-color: #eaf3fe;      /* DS --border (light) */
    --border-strong: #cbe3ff;     /* DS --border-strong (énfasis/hover) */

    /* semánticos oscurecidos para contraste AA sobre blanco
     * (lime/amber/pink DS son fills con texto oscuro, no texto) */
    --success: #6f8c00;
    --warning: #b45e00;
    --danger:  #c0356b;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);

    --toast-bg: #ffffff;
    --toast-text: #0d0d0d;
}

/* ===== ACENTOS ALTERNATIVOS (paleta DS) =====
 * El slot "cyan" = marca (sin override: usa seafoam en dark / azul en light). */

/* Pink — DS pink */
[data-accent="pink"] {
    --accent-primary: #ec80a5;
    --accent-hover: #e06b96;
    --accent-active: #d65a8c;
    --accent-foreground: #440d27;   /* DS --destructive-foreground */
    --border-accent: #ec80a5;
}
[data-theme="light"][data-accent="pink"] {
    --accent-primary: #c0357e;
    --accent-hover: #a82d6d;
    --accent-active: #8f255c;
    --accent-foreground: #ffffff;
    --border-accent: #c0357e;
}

/* Green — DS lime */
[data-accent="green"] {
    --accent-primary: #c4df43;
    --accent-hover: #b6d233;
    --accent-active: #a7c322;
    --accent-foreground: #2e3a09;   /* DS --success-foreground */
    --border-accent: #c4df43;
}
[data-theme="light"][data-accent="green"] {
    --accent-primary: #5f7a00;
    --accent-hover: #4f6600;
    --accent-active: #3f5200;
    --accent-foreground: #ffffff;
    --border-accent: #5f7a00;
}

/* ===== BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

body, html {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0 0 30px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
}

body > section:not(.toast-container),
body > div:not(.toast-container) {
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: auto !important;
    max-width: none !important;
    padding: 0 !important;
}

.toast {
    background: var(--toast-bg);
    color: var(--toast-text);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
    min-width: 280px;
    max-width: 400px;
    animation: slideDown 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.success { border-color: var(--success); }
.toast.success .toast-icon { color: var(--success); }
.toast.warning { border-color: var(--warning); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.error { border-color: var(--danger); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info { border-color: var(--accent-primary); }
.toast.info .toast-icon { color: var(--accent-primary); }

.toast-icon {
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

@keyframes slideDown {
    from { transform: translateY(-100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-100px); opacity: 0; }
}

/* ===== HEADER ===== */
.header-settings {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);   /* DS card: bg-card + border */
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 12px;
    padding: 8px;
    background: var(--bg-card);
    border-radius: 8px;
}

.header-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker {
    display: flex;
    gap: 8px;
}

.color-thumbnail {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.color-thumbnail:hover { transform: scale(1.1); }
.color-thumbnail.active { border: 3px solid var(--text-primary); }
.color-thumbnail.cyan { background: #02ffd1; }
.color-thumbnail.pink { background: #ec80a5; }
.color-thumbnail.green { background: #c4df43; }

.header-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.theme-toggle {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}
.theme-toggle:hover { border-color: var(--accent-primary); }
.theme-toggle svg {
    width: 16px;
    height: 16px;
    color: var(--text-primary);
    transition: transform 0.3s ease;
}
.theme-toggle:active svg { transform: rotate(180deg); }

/* ===== PROGRESS ===== */
.progress-section {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-stats {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-stats span {
    color: var(--accent-primary);
    font-weight: 700;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--success));
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 0;
}

.progress-percentage {
    text-align: right;
    font-size: 20px;
    font-weight: 900;
    color: var(--accent-primary);
    font-family: "findreplace", sans-serif;
    font-style: normal;
}

/* ===== STATUS COUNTERS ===== */
.status-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 8px;
}

.status-container .status-item {
    flex: 1 1 calc(50% - 6px);
    min-width: 70px;
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 8px;
    background: transparent;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}
.status-item:hover {
    border-color: color-mix(in srgb, var(--accent-primary) 35%, transparent);
    background: var(--accent-soft);
}
.status-item:active { border-color: var(--accent-primary); }

.status-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

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

.status-label {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.15;
    text-align: left;
    max-width: 64px;
}

.status-count {
    font-size: 54px;
    font-weight: 900;
    line-height: 0.85;
    color: var(--accent-primary);
    font-family: "findreplace", sans-serif;
    font-style: normal;
}

/* ===== MARK BUTTONS ===== */
.mark-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}

.mark-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.mark-button:hover { border-color: var(--accent-primary); }

.mark-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== CLEAR BUTTONS ===== */
.clear-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 6px;
}

.clear-button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.clear-button:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.clear-button.clear-danger:hover { border-color: var(--danger); color: var(--danger); }

.refresh-button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}
.refresh-button:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.refresh-button svg { transition: transform 0.3s ease; }
.refresh-button.spinning svg { animation: spin 0.8s linear infinite; color: var(--accent-primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SECTIONS ===== */
.section-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);   /* DS card: bg-card + border */
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: visible;
    padding: 8px 8px 0 8px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

/* ===== HOVER (patrón DS: la card es superficie estática) =====
 * El DS no repinta superficies en hover; la afordancia es el BORDE (--border-strong),
 * nunca el fondo → sin "parcheo" en secciones densas. */
.section-card:not(:has(.section-content.show)):hover {
    border-color: var(--border-strong);
}
.section-card:has(.section-toggle:hover) {
    border-color: var(--border-strong);
}

.section-toggle {
    width: 100%;
    margin: 0 0 8px 0;
    background: transparent;
    border: none;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 8px;
}

.section-icon {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.toggle-arrow {
    width: 14px;
    height: 14px;
    margin-left: auto;
    transition: transform 0.2s ease;
    color: var(--accent-primary);
    flex-shrink: 0;
}
.section-toggle.open .toggle-arrow { transform: rotate(180deg); }

.section-content {
    background: var(--bg-secondary);
    width: 100%;
    overflow: visible;
    transition: background 0.25s ease;
}
.section-inner {
    padding: 0 8px 16px 8px;
    transition: background 0.25s ease;
}

/* ===== ACTION BUTTON ===== */
.action-button {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}
.action-button:hover { border-color: var(--accent-primary); }

/* ===== CONTENT DISPLAY ===== */
.content-display {
    min-height: 80px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.placeholder-text {
    color: var(--text-tertiary);
    font-size: 12px;
    text-align: center;
    margin: 16px 0;
}

/* ===== CONTENT ITEMS (Notes, Audit, Comments) ===== */
.content-item {
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}
.content-item:last-child { margin-bottom: 0; }

.content-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.content-item-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-primary);
    color: var(--accent-foreground);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}
.content-item-badge.warning {
    background: var(--warning);
    color: #1a1a1a;
}

.content-item-nav {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}
.content-item-nav:hover {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: var(--accent-foreground);
}

.content-item-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    word-wrap: break-word;
}

.note-text {
    white-space: pre-wrap;
}

.content-item-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.content-item-action {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}
.content-item-action:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.notes-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.notes-toolbar-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.notes-toolbar-button:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ===== COMMENT STYLES ===== */
.comment-slide-group {
    margin-bottom: 12px;
}
.comment-slide-group:last-child { margin-bottom: 0; }

.comment-slide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.comment-item {
    padding: 8px 10px;
    background: var(--bg-card);
    border-left: 3px solid var(--accent-primary);
    border-radius: 0 6px 6px 0;
    margin-bottom: 6px;
}
.comment-item:last-child { margin-bottom: 0; }

.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-primary);
}

.comment-date {
    font-size: 10px;
    color: var(--text-tertiary);
}

.comment-text {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.comment-item--resolved {
    opacity: 0.55;
    border-left-color: var(--success);
}
.comment-item--resolved .comment-text {
    color: var(--text-tertiary);
}

.comment-resolved-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: var(--success);
    padding: 2px 7px;
    border-radius: 8px;
    line-height: 1.3;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* ===== AUDIT STYLES ===== */
.audit-success {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    color: var(--success);
    font-size: 13px;
    font-weight: 500;
}

.audit-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--warning);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.audit-icon {
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.audit-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.audit-section {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.audit-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.audit-section-header {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 6px;
    padding: 0 4px;
}

.audit-master-group {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
}
.audit-master-group:last-child { margin-bottom: 0; }

.audit-master-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.audit-master-count {
    font-weight: 400;
    color: var(--text-tertiary);
    font-size: 11px;
}

.audit-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.audit-slide-chip {
    min-width: 26px;
    height: 24px;
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.audit-slide-chip:hover {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: var(--accent-foreground);
}

/* ===== REPORT STYLES ===== */
.text-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--input);          /* DS: border-input */
    background: var(--input-bg);             /* DS: bg-input/30 (dark) / input-background (light) */
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    margin-bottom: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.text-input:focus {
    outline: none;
    border-color: var(--accent-primary);     /* DS: focus-visible:border-ring */
    box-shadow: 0 0 0 3px var(--focus-ring);  /* DS: ring-ring/50 ring-[3px] */
}
.text-input::placeholder {
    color: var(--text-tertiary);
}

.report-preview {
    min-height: 120px;
    margin-bottom: 10px;
}

.report-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    white-space: pre;
}

/* ===== GENERIC BUTTONS ===== */
button {
    cursor: pointer;
    font-family: inherit;
    outline: none;
}
button:active { transform: scale(0.98); }

/* ===== OUTLINE BUTTONS — DS variante `outline` (paridad con DeckDesigner) =====
 * base → borde --input + fondo sutil (--outline-bg) + texto --foreground
 * hover → dark: relleno neutro más opaco (input/50) · light: relleno acento seafoam
 * [data-theme] (siempre en <body>) impone el hover sobre las reglas previas. */
.action-button, .notes-toolbar-button, .theme-toggle,
.mark-button, .clear-button, .refresh-button {
    background-color: var(--outline-bg);
    border: 1px solid var(--input);
    color: var(--text-primary);
}

[data-theme] .action-button:hover,
[data-theme] .notes-toolbar-button:hover,
[data-theme] .theme-toggle:hover,
[data-theme] .mark-button:hover,
[data-theme] .clear-button:not(.clear-danger):hover,
[data-theme] .refresh-button:hover {
    background-color: var(--outline-hover-bg);
    border-color: var(--input);
    color: var(--outline-hover-fg);
}

/* ===== SCROLLBAR ===== */
.content-display::-webkit-scrollbar { width: 6px; }
.content-display::-webkit-scrollbar-track { background: var(--bg-secondary); }
.content-display::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.content-display::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

/* ===== SIGNATURE ===== */
.Signage {
    text-align: center;
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 16px;
    padding: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
    body > section:not(.toast-container),
    body > div:not(.toast-container) {
        max-width: calc(100% - 32px);
        padding-left: 16px;
        padding-right: 16px;
    }
}