.download-history-section {
    margin-top: 32px;
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.download-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.download-history-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.download-history-header h3 i {
    color: var(--accent);
}

.download-history-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 4px 0;
    outline: none;
    transition: var(--transition);
    overflow-y: auto;
}

.download-history-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.download-history-select option {
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-history-select option:hover,
.download-history-select option:checked {
    background: var(--accent-glow);
    color: var(--accent);
}


:root {
    --bg-primary: #1a1d23;
    --bg-secondary: #22262e;
    --bg-tertiary: #2a2e38;
    --bg-card: #2d3240;
    --bg-hover: #363c4a;
    --bg-input: #1e2128;

    --text-primary: #e8e9eb;
    --text-secondary: #9ca0ab;
    --text-muted: #6b7280;

    --border: #363c4a;
    --border-light: #3d4454;

    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.2s ease;

    --sidebar-width: 240px;
    --header-height: 72px;

    --accent: #4ea1d3;
    --accent-hover: #6bb5e0;
    --accent-glow: rgba(78, 161, 211, 0.25);
}

[data-theme="light"] {
    --bg-primary: #f4f6f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --bg-card: #ffffff;
    --bg-hover: #e2e6ea;
    --bg-input: #ffffff;
    --text-primary: #707070;
    --text-secondary: #5a5e68;
    --text-muted: #8c9099;
    --border: #d1d5db;
    --border-light: #e5e7eb;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[data-fabricant="bambu"] {
    --accent: #009696;
    --accent-hover: #007a7a;
    --accent-glow: rgba(0, 150, 150, 0.25);
}

[data-fabricant="prusa"] {
    --accent: #d35400;
    --accent-hover: #a04000;
    --accent-glow: rgba(211, 84, 0, 0.25);
}

[data-fabricant="voron"] {
    --accent: #ff2a2a;
    --accent-hover: #cc0000;
    --accent-glow: rgba(255, 42, 42, 0.25);
}

[data-fabricant="creality"] {
    --accent: #0056b3;
    --accent-hover: #00408a;
    --accent-glow: rgba(0, 86, 179, 0.25);
}


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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    transition: background 0.2s ease, color 0.2s ease;
}

.hidden {
    display: none !important;
}


.auth-buttons-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 15px;
}

.auth-buttons-row .btn {
    flex: 1;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-block {
    width: 100%;
}

.btn-secondary {
    background: var(--text-secondary);
    color: #fff;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

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

.btn-danger {
    background: var(--danger) !important;
}

.btn-danger:hover {
    background: #ef4444 !important;
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.4);
}


.auth-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-primary);
    background-image: radial-gradient(ellipse at 20% 50%, rgba(78,161,211,0.08) 0%, transparent 50%),
                      radial-gradient(ellipse at 80% 20%, rgba(78,161,211,0.05) 0%, transparent 50%);
    transition: background 0.2s ease;
    position: relative;
}

.auth-container {
    width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo i {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 10px;
    transition: color 0.2s ease;
}

.auth-logo h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 3px;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-panel h2 {
    font-size: 20px;
    margin-bottom: 4px;
    text-align: center;
}

.auth-panel .btn-primary {
    display: flex;
    margin: 0 auto;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
    text-align: center;
}

.auth-links {
    margin-top: 16px;
    text-align: center;
}

.auth-links a {
    color: var(--accent);
    font-size: 13px;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

#confirm-user-question {
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.confirm-user-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.confirm-user-actions .btn {
    flex: 1;
    justify-content: center;
    margin: 0;
}

.auth-lang-selector {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
}

#language-selector-auth {
    min-width: 110px;
    padding: 6px 28px 6px 12px;
    font-size: 13px;
    background: var(--bg-secondary, #1e2129);
    color: var(--text-primary, #e6e6e6);
    border: 1px solid var(--border, #2a2f3a);
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#language-selector-auth:hover,
#language-selector-auth:focus {
    border-color: var(--accent, #4ea1d3);
    box-shadow: 0 0 0 3px rgba(78, 161, 211, 0.15);
    outline: none;
}


.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    z-index: 1;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px 12px 12px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.input-group select {
    padding-left: 12px;
    cursor: pointer;
}

.input-group textarea {
    padding-left: 12px;
    resize: vertical;
    min-height: 80px;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.input-group small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.input-group small a {
    color: var(--accent);
    text-decoration: none;
}

.input-group small a:hover {
    text-decoration: underline;
}

.input-group input[type="password"] {
    padding-right: 40px;
}

.security-question-select {
    width: 100%;
    padding: 12px 26px 12px 38px;
    background-color: var(--bg-input);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 10.5px;
    letter-spacing: -0.1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: var(--transition);
}

.security-question-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.security-question-select:invalid {
    color: var(--text-muted);
}

.security-question-select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}


.app-screen {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-header i {
    font-size: 24px;
    color: var(--accent);
    transition: color 0.2s ease;
}

.sidebar-header span {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    min-height: 0;
}

.sidebar-nav-scroll {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.sidebar-nav-scroll > .nav-btn {
    flex-shrink: 0;
}

.sidebar-nav-separator {
    flex-shrink: 0;
    height: 1px;
    margin: 6px 8px;
    background: var(--border);
}

#reorderable-nav-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: none;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
	text-decoration: none;
}

.nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.nav-btn.active i {
    color: var(--accent);
}

.nav-btn i {
    width: 20px;
    text-align: center;
}

.nav-btn .badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.nav-btn.active .badge {
    background: var(--bg-primary);
    color: var(--accent);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-muted);
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}


.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-shrink: 0;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left h2 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    margin: 0;
}

.header-left h2 i {
    color: var(--accent);
    transition: color 0.2s ease;
}

.header-center {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1000px;
    margin: 0 20px;
    min-width: 300px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 16px;
    width: 100%;
    transition: var(--transition);
    position: relative;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    width: 100%;
    padding: 0;
}

.search-box i {
    color: var(--text-muted);
    transition: color 0.3s;
}

.search-clear-btn {
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition);
}

.search-clear-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.search-box input:not(:placeholder-shown) ~ .search-clear-btn {
    display: flex;
}

.search-box.semantic-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-input);
}

.search-box.semantic-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.search-recent-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 50;
    overflow: hidden;
    animation: recentSearchIn 0.15s ease;
}
/* Animation dédiée : le @keyframes slideUp global décale l'élément de -50 % en X (menu qui partait de la gauche) */
@keyframes recentSearchIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-recent-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.search-recent-dropdown-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.search-recent-dropdown-header button:hover {
    color: var(--danger);
}

.search-recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.search-recent-item i {
    color: var(--text-muted);
    font-size: 12px;
}

.search-recent-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.search-recent-item .search-recent-remove {
    margin-left: auto;
    opacity: 0;
    color: var(--text-muted);
    padding: 2px 4px;
}

.search-recent-item:hover .search-recent-remove {
    opacity: 1;
}

.search-recent-item .search-recent-remove:hover {
    color: var(--danger);
}

.header-right {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    min-width: 0;
}

.header-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 8px;
    cursor: pointer;
}

.view-modes {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 10px;
    cursor: pointer;
    transition: var(--transition);
}

.view-btn:hover {
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--accent-glow);
    color: var(--accent);
}

.thumb-progress {
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-left: 12px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: opacity 0.3s ease;
}

.thumb-progress.hidden {
    display: none !important;
}

.thumb-progress .progress-text-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.thumb-progress .progress-text {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}

.thumb-progress-icon {
    font-size: 11px;
    color: var(--text-muted);
}

.thumb-progress.completed .progress-text-row .thumb-progress-icon {
    color: var(--success);
}

.thumb-progress.completed .progress-text-row .thumb-progress-icon::before {
    content: "\f00c";
}

.thumb-progress .progress-track {
    width: 100%;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    border-radius: 2px;
    will-change: width;
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#sort-select,
.view-modes,
#refresh-files,
#global-logout-btn {
    flex-shrink: 0;
}


.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable; /* réserve la place de la barre de défilement : le contenu ne se décale plus quand elle apparaît (ex. section dépliée dans les Paramètres) */
    min-height: 0;
    background: var(--bg-primary);
    padding: 24px;
    transition: background 0.2s ease;
    position: relative;
}

.main-content.drop-zone-active,
#modal-print-photos .modal-body.drop-zone-active {
    background: color-mix(in srgb, var(--accent, #4f8cff) 6%, var(--bg-primary));
    outline: 2px dashed var(--accent, #4f8cff);
    outline-offset: -8px;
}

.main-content.drop-zone-active::after,
#modal-print-photos .modal-body.drop-zone-active::after {
    content: "\f0ee  Dépose ici pour ajouter";
    font-family: "Font Awesome 6 Free", inherit;
    font-weight: 900;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    color: var(--accent, #4f8cff);
    padding: 20px 32px;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 12px 35px rgba(0,0,0,0.4);
    font-size: 16px;
    pointer-events: none;
    z-index: 500;
}

#modal-print-photos .modal-body.drop-zone-active::after {
    content: "\f03e  Dépose une photo ici";
}

.page {
    display: none;
}

.page.active {
    display: block;
}


.files-grid {
    display: grid;
    gap: 20px;
    transition: all 0.3s ease;
}

.files-grid.gallery {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.files-grid.details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.file-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.files-grid.gallery .file-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25), 0 0 15px var(--accent-glow);
}

.file-card.keyboard-focused {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.slicer-quick-estimate {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 14px;
}

.slicer-quick-estimate-loading {
    font-size: 12.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.slicer-quick-estimate-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-primary);
}

.slicer-quick-estimate-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.slicer-quick-estimate-row span i {
    color: var(--accent);
}

.slicer-quick-estimate-row a {
    margin-left: auto;
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.slicer-quick-estimate-row a:hover {
    text-decoration: underline;
}

.slicer-quick-estimate-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin: 6px 0 0;
}

.repair-diff-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.repair-diff-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    padding: 9px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

.repair-diff-row:last-child {
    border-bottom: none;
}

.repair-diff-row span:first-child {
    color: var(--text-muted);
}

.repair-diff-row span:not(:first-child) {
    text-align: center;
}

.repair-diff-header {
    background: var(--bg-hover);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    font-weight: 700;
}

.repair-diff-row.improved span:last-child {
    color: var(--success, #22c55e);
    font-weight: 600;
}

.repair-diff-row.unchanged span:last-child {
    color: var(--text-secondary);
}

.saved-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.saved-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 8px 6px 14px;
    font-size: 12.5px;
    color: var(--text-secondary);
    cursor: pointer;
}

.saved-filter-chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.saved-filter-chip button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 50%;
}

.saved-filter-chip button:hover {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.12);
}


.file-card--details {
    display: grid !important;
    grid-template-columns: 64px 1fr 180px 220px auto auto !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 0 !important;
    height: 64px;
    max-height: 64px;
    overflow: hidden;
    transition: var(--transition) !important;
}

.file-card--details:hover {
    background: var(--bg-hover) !important;
    border-color: var(--accent) !important;
    box-shadow: inset 3px 0 0 var(--accent) !important;
    transform: none !important;
}

.dv-thumb {
    width: 58px;
    min-height: 58px;
    max-height: 58px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
	margin-top: 2px;
	margin-left: 10px;
}

.dv-thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.dv-thumb .file-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dv-thumb .file-checkbox {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
}

.dv-name {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    justify-content: center;
}

.dv-filename {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dv-path {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dv-path i {
    font-size: 10px;
    flex-shrink: 0;
}

.dv-tags {
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    overflow: hidden;
    min-width: 0;
    border-left: 1px solid var(--border);
}

.dv-tags .file-tag {
    flex-shrink: 0;
}

.dv-tags .file-tags {
    margin-top: 0;
    gap: 5px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.dv-meta {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    border-left: 1px solid var(--border);
    min-width: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
}

.file-card--details:hover .dv-meta {
    opacity: 1;
    visibility: visible;
}

.dv-meta-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
}

.dv-meta-row i {
    width: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 10px;
    flex-shrink: 0;
}

.dv-meta-val {
    overflow: hidden;
    text-overflow: ellipsis;
}

.dv-size {
    padding: 0 16px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    border-left: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 80px;
}

.dv-actions {
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
}

.dv-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.dv-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
    border-color: var(--accent);
}

.dv-btn--star:hover,
.dv-btn--star.favorited {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(251,191,36,0.1);
}

.file-thumb {
    position: relative;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.files-grid.gallery .file-thumb {
    height: 160px;
}

.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block !important;
    transition: transform 0.3s ease;
    border-radius: var(--radius);
}

.files-grid.gallery .file-card:hover .file-thumb img {
    transform: scale(1.1);
}


.file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block !important;
    transition: transform 0.3s ease;
    border-radius: var(--radius);
}

.files-grid.gallery .file-card:hover .file-thumb img {
    transform: scale(1.1);
}

.files-grid.details .file-card:hover .file-thumb img {
    transform: none !important;
}

.file-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    z-index: 1;
    border-radius: var(--radius);
}

.thumb-icon {
    font-size: 56px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.skeleton-thumb {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(100deg, var(--bg-tertiary) 30%, var(--bg-hover) 50%, var(--bg-tertiary) 70%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s ease-in-out infinite;
    border-radius: var(--radius);
}

.skeleton-thumb-icon {
    font-size: 40px;
    color: var(--text-muted);
    opacity: 0.25;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-thumb {
        animation: none;
        background: var(--bg-tertiary);
    }
}

.files-grid.details .thumb-icon {
    font-size: 32px;
}

.files-grid.gallery .file-card:hover .thumb-icon {
    transform: scale(1.15);
}

.files-grid.details .file-card:hover .thumb-icon {
    transform: none !important;
}

.file-ext-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.75);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    transition: var(--transition);
}

.files-grid.gallery .file-card:hover .file-ext-badge {
    opacity: 0;
    pointer-events: none;
}

.file-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.75);
    color: #f87171;
    border: 1px solid rgba(248,113,113,0.5);
    border-radius: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    z-index: 4;
    font-size: 12px;
}

.files-grid.gallery .file-card:hover .file-delete-btn {
    opacity: 1;
}

.file-delete-btn:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.files-grid.details .file-ext-badge {
    display: none;
}

.file-archive-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--accent);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    pointer-events: none;
}

.file-in-archive-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    max-width: calc(100% - 12px);
    background: rgba(0, 0, 0, 0.7);
    color: #f6ad55;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
    pointer-events: none;
}

.file-multiplate-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--accent);
    border-radius: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    z-index: 2;
    pointer-events: none;
}

.dv-thumb .file-multiplate-badge {
    width: 16px;
    height: 16px;
    bottom: 2px;
    right: 2px;
    font-size: 8px;
    border-radius: 3px;
}

.file-new-badge {
    position: absolute;
    top: 6px;
    left: 42px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    border-radius: 6px;
    padding: 0 8px;
    height: 28px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    z-index: 3;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    opacity: 1;
    transform: translateY(0);
    transition: var(--transition);
}
.file-card:hover .file-new-badge {
    opacity: 0;
    transform: translateY(-5px);
}
.file-new-badge--small {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.file-slicer-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-5px);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.file-slicer-btn:hover {
    background: var(--accent);
}

.files-grid.gallery .file-card:hover .file-slicer-btn {
    opacity: 1;
    transform: translateY(0);
}

.files-grid.details .file-slicer-btn {
    display: none !important;
}

.file-action-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 13px 20px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
}

.file-action-row:hover {
    background: var(--bg-hover, rgba(255,255,255,0.05));
    color: var(--accent);
}

.file-action-row:hover .file-action-icon i,
.file-action-row:hover .file-action-arrow {
    color: var(--accent);
}

.file-action-row--danger:hover {
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger, #e63946);
}

.file-action-row--danger:hover .file-action-icon i,
.file-action-row--danger:hover .file-action-arrow {
    color: var(--danger, #e63946);
}

.file-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-tertiary, rgba(255,255,255,0.06));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-action-icon i {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.12s;
}

.file-action-label {
    flex: 1;
}

.file-action-arrow {
    font-size: 11px;
    color: var(--text-muted);
    transition: color 0.12s;
}

.file-decompress-btn {
    position: absolute;
    top: 34px;
    right: 6px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: var(--transition);
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.file-thumb:hover .file-decompress-btn {
    opacity: 1;
    transform: translateY(0);
}

.file-decompress-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.files-grid.details .file-decompress-btn {
    position: static;
    opacity: 1;
    transform: none;
    margin-left: 8px;
}

.file-tag-btn {
    position: absolute;
    top: 6px;
    right: 46px;
    background: rgba(0,0,0,0.6);
    color: var(--text-muted);
    border: none;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.files-grid.gallery .file-card:hover .file-tag-btn {
    opacity: 1;
}

.file-tag-btn:hover {
    color: var(--accent);
    background: rgba(0,0,0,0.8);
}

.file-menu-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0,0,0,0.75);
    color: #e5e7eb;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    z-index: 5;
    font-size: 13px;
}

.files-grid.gallery .file-card:hover .file-menu-btn {
    opacity: 1;
}

.file-menu-btn:hover {
    color: var(--accent);
    background: rgba(0,0,0,0.9);
    border-color: var(--accent);
}

@media (hover: none), (max-width: 860px) {
    .file-menu-btn {
        opacity: 1;
        width: 32px;
        height: 32px;
        font-size: 15px;
    }
}

.file-favorite-btn {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: #6b7280;
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    z-index: 3;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-favorite-btn:hover {
    color: #fbbf24;
    background: rgba(0,0,0,0.85);
    opacity: 1;
}

.file-favorite-btn.favorited {
    color: #fbbf24;
    opacity: 1;
    background: rgba(251, 191, 36, 0.2);
}

.file-card:hover .file-favorite-btn {
    opacity: 0.7;
}

.file-card:hover .file-favorite-btn:hover {
    opacity: 1;
}

.file-info {
    padding: 12px;
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.files-grid.details .file-info {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.files-grid.details .file-name {
    font-size: 13px;
    margin-bottom: 4px;
}

.files-grid.details .file-tags {
    margin-top: 4px;
}

.files-grid.details .btn-primary.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
    white-space: nowrap;
}


.file-metadata-tooltip {
    position: absolute;
    background: linear-gradient(to right, rgba(0,0,0,0.95), rgba(0,0,0,0.9));
    backdrop-filter: blur(8px);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-primary);
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

.files-grid.gallery .file-thumb {
    position: relative;
}

.files-grid.gallery .file-metadata-tooltip {
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid var(--border);
}

.files-grid.gallery .file-card:hover .file-metadata-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.files-grid.details .file-card {
    position: relative;
    overflow: visible;
}

.files-grid.details .file-metadata-tooltip {
    position: static !important;
    transform: none !important;
    display: flex !important;
    opacity: 1 !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 4px 12px;
    min-width: 0;
    max-width: none;
    white-space: nowrap;
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    pointer-events: auto;
    animation: none !important;
}

.files-grid.details .file-card:hover .file-metadata-tooltip {
    display: flex !important;
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

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

@keyframes tooltipFadeInRight {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.meta-row i {
    color: var(--accent);
    width: 18px;
    text-align: center;
    font-size: 13px;
}

.meta-row span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

.meta-row + .meta-row { margin-top: 6px; }
.meta-source-row .meta-val.meta-yes { color: #4ade80; }
.meta-source-row .meta-val.meta-no { color: #f87171; }
/* Source indisponible : la miniature reste visible mais nettement plus sombre */
.file-card.source-offline .file-thumb img,
.file-card.source-offline .dv-thumb img { filter: brightness(.4) grayscale(.5); transition: filter .2s; }
.file-card.source-offline .skeleton-thumb-icon { opacity: .4; }
.file-card.source-offline:hover .file-thumb img,
.file-card.source-offline:hover .dv-thumb img { filter: brightness(.65) grayscale(.35); }


.folder-block {
    grid-column: 1 / -1;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--bg-card);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.folder-block:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow, rgba(78,161,211,0.15));
}

.folder-block--child {
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--bg-secondary);
}

.folder-block-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    background: linear-gradient(90deg, var(--bg-tertiary), var(--bg-card));
    border-bottom: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
}

.folder-block--open .folder-block-header {
    border-bottom-color: var(--border);
}

.folder-block-header:hover {
    background: linear-gradient(90deg, var(--bg-hover, rgba(255,255,255,0.04)), var(--bg-card));
}

.folder-block-previews {
    display: grid;
    grid-template-columns: repeat(2, 36px);
    grid-template-rows: repeat(2, 36px);
    gap: 2px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.folder-preview-thumb {
    width: 36px;
    height: 36px;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.folder-preview-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

.folder-block-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.folder-block-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-block-name i {
    color: var(--accent);
    font-size: 13px;
}

.folder-block-path {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-block-count {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-input);
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    width: fit-content;
}

.folder-block-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.folder-block-chevron {
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.25s ease;
}

.folder-block--open .folder-block-chevron {
    transform: rotate(180deg);
}

.folder-block-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

.folder-block--open .folder-block-content {
    opacity: 1;
}

.folder-block-grid.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
}

.folder-block-grid.details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
}

.folder-block-grid .file-card {
    margin: 0;
}

.folder-block--child .folder-block-header {
    padding: 10px 14px;
}

.folder-block--child .folder-block-previews {
    grid-template-columns: repeat(2, 28px);
    grid-template-rows: repeat(2, 28px);
}

.folder-block--child .folder-preview-thumb {
    width: 28px;
    height: 28px;
}

.folder-block--child .folder-block-name {
    font-size: 13px;
}

.folder-select-btn {
    padding: 5px 12px;
    font-size: 11px;
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.folder-select-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.folder-file-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: none;
    letter-spacing: normal;
}


.tag-group-header {
    grid-column: 1 / -1;
    padding: 14px 16px;
    margin: 20px 0 10px 0;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-group-header i {
    font-size: 18px;
    color: var(--accent);
}

.tag-group-header:hover {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-hover));
    transition: var(--transition);
}


.file-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
}

.file-checkbox:hover {
    background: var(--accent);
    transform: scale(1.1);
}

.file-checkbox i {
    font-size: 20px;
    color: white;
    pointer-events: none;
}

.file-card.selected {
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
    background: var(--accent-glow);
}

.file-card--highlight {
    animation: fileCardHighlight 2.6s ease-out;
    z-index: 2;
}

@keyframes fileCardHighlight {
    0% {
        box-shadow: 0 0 0 3px var(--success), 0 0 24px 4px rgba(52, 211, 153, 0.45);
        transform: scale(1.04);
    }
    15% {
        box-shadow: 0 0 0 3px var(--success), 0 0 24px 4px rgba(52, 211, 153, 0.45);
        transform: scale(1.04);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
        transform: scale(1);
    }
}

.selection-action-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

#selection-count {
    font-weight: 600;
    color: var(--text-primary);
    padding-right: 16px;
    border-right: 1px solid var(--border);
}

#select-all-btn.active {
    background: var(--accent);
    color: white;
}

.folder-selection-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 20px;
    display: none;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

#folder-selection-count {
    font-weight: 600;
    color: var(--text-primary);
    padding-right: 16px;
    border-right: 1px solid var(--border);
}


.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.tag-badge i {
    font-size: 10px;
}

.file-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.file-tag {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: opacity 0.2s ease;
}

.checkbox-label input {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
}

.tag-count {
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 1px 5px;
    border-radius: 8px;
}

.checkbox-label:has(.filter-tag:checked) .tag-count {
    background: var(--accent);
    color: #fff;
}


.filters-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 700px;
}

.filter-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.filter-group h3 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-group {
    display: flex;
    gap: 12px;
}

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

.range-group input {
    width: 70px;
    padding: 5px 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
}

#modal-filters .filter-group h3 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

#modal-filters .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    transition: var(--transition);
}

#modal-filters .checkbox-label:hover {
    color: var(--accent);
}

#modal-filters .checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

#modal-filters .checkbox-label i {
    font-size: 16px;
}

#modal-filters .range-group input {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
}

#modal-filters .range-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.sources-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.settings-spool-row {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
}

.settings-spool-row input:focus {
    outline: none;
    border-color: var(--accent);
}

.settings-spool-row input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}

.settings-spool-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.settings-spool-row input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.settings-spools-list {
    max-height: 296px;
    overflow-y: auto;
    padding-right: 6px;
    margin-right: -6px;
}

@media (max-width: 640px) {
    .settings-spool-row {
        flex-wrap: wrap;
    }
    .settings-spool-row input[type="text"] {
        flex-basis: 100%;
        order: -1;
    }
}

.source-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.source-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 16px;
}

.source-details h4 {
    font-size: 13px;
    font-weight: 500;
}

.source-details p {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}


.source-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.type-card i {
    font-size: 28px;
    color: var(--accent);
    transition: color 0.2s ease;
}

.type-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

.type-card:active {
    transform: translateY(0);
}

.modal-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 18px;
    text-align: center;
}


.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#modal-confirm {
    z-index: 1900;
}


#modal-slicer {
    z-index: 1050;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 480px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-content.small {
    width: 420px;
}

.modal-content.viewer-3d {
    width: 90vw;
    max-width: 1000px;
    height: 80vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 i {
    color: var(--accent);
    transition: color 0.2s ease;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body .input-group {
    margin-bottom: 14px;
}

.modal-body .input-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.modal-body .input-group input,
.modal-body .input-group select {
    padding-left: 12px;
}

/* Champ précédé d'une icône (ex. métadonnées : lien, auteur, licence) : on garde la place de l'icône */
.modal-body .input-group > i + input,
.modal-body .input-group > i + select {
    padding-left: 40px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 6px;
}

#modal-tag-manager .input-group,
#modal-tag-manager .checkbox-label {
    transition: opacity 0.2s ease, max-height 0.2s ease;
}


#download-progress {
    margin: 15px 0;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

#download-progress .progress-track {
    background: var(--bg-input);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
}

#download-progress .progress-bar {
    background: var(--accent);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

#download-result {
    padding: 10px;
    border-radius: var(--radius);
    font-size: 13px;
}

#download-result.toast.success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

#download-result.toast.error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

#download-result i {
    margin-right: 6px;
}


#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: slideIn 0.25s ease;
    min-width: 240px;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.info {
    border-left: 3px solid var(--accent);
}

.toast.warning {
    border-left: 3px solid var(--warning);
}

.toast i {
    font-size: 16px;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--danger);
}

.toast.info i {
    color: var(--accent);
}

.toast.warning i {
    color: var(--warning);
}

.lowstock-toast {
    cursor: pointer;
    max-width: 340px;
    position: relative;
    padding-right: 30px;
    padding-bottom: 13px;
    overflow: hidden;
}

.lowstock-toast:hover {
    background: var(--bg-hover);
}

.toast.warning .lowstock-toast-arrow {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    flex-shrink: 0;
}

.lowstock-toast-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

.lowstock-toast-close:hover {
    color: var(--text-primary);
}

.lowstock-toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--warning);
    transform-origin: left;
    animation-name: lowstock-toast-shrink;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes lowstock-toast-shrink {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.toast-message {
    font-size: 13px;
}

.toast-undo {
    gap: 12px;
}

.toast-undo-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    cursor: pointer;
    transition: var(--transition);
    margin-left: auto;
}

.toast-undo-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.toast-undo-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.confirmation {
    background: var(--bg-secondary);
    border-left: 4px solid var(--warning);
    min-width: 320px;
    max-width: 400px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

.toast.confirmation .toast-message {
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    font-size: 13px;
}

.toast.confirmation .toast-submessage {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.toast.confirmation .toast-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

.toast.confirmation .btn-confirm {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.toast.confirmation .btn-confirm:hover {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

.toast.confirmation .btn-cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.toast.confirmation .btn-cancel:hover {
    background: var(--bg-hover);
}


.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state.small {
    grid-column: auto;
    padding: 20px;
}

.empty-state.illustrated {
    padding: 70px 24px;
}

.empty-state.illustrated .empty-state-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    margin-bottom: 20px;
}

.empty-state.illustrated .empty-state-icon i {
    font-size: 34px;
    margin-bottom: 0;
    opacity: 0.55;
    color: var(--accent);
}

.empty-state.illustrated h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
    text-align: center;
}

.empty-state.illustrated p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 340px;
    text-align: center;
    margin: 0 0 20px;
    line-height: 1.5;
}


.viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.viewer-header h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.viewer-header h3 i {
    color: var(--accent);
    transition: color 0.2s ease;
}

.viewer-controls {
    display: flex;
    gap: 6px;
}

.viewer-canvas {
    flex: 1;
    background: var(--bg-primary);
    position: relative;
    cursor: grab;
}

.viewer-canvas:active {
    cursor: grabbing;
}

.viewer-canvas canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.viewer-canvas-wrapper {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.viewer-plate-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    z-index: 10;
    transition: var(--transition);
}

.viewer-plate-nav-btn:hover {
    background: var(--accent);
}

.viewer-plate-nav-btn--left {
    left: 16px;
}

.viewer-plate-nav-btn--right {
    right: 16px;
}

.viewer-recenter-btn {
    position: absolute;
    left: 16px;
    bottom: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    z-index: 10;
    transition: var(--transition);
}

.viewer-recenter-btn:hover {
    background: var(--accent);
}

.viewer-plate-label {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

.viewer-footer {
    padding: 10px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    text-align: center;
}

@media (max-width: 640px) {
    .modal-content.viewer-3d {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .viewer-header {
        flex-wrap: wrap;
        row-gap: 10px;
        padding: 12px 44px 12px 14px;
        position: relative;
    }

    .viewer-header h3 {
        font-size: 14px;
        flex: 1 1 100%;
    }

    .viewer-header .modal-close {
        position: absolute;
        top: 8px;
        right: 10px;
    }

    .viewer-controls {
        flex-wrap: wrap;
        width: 100%;
        gap: 8px;
    }

    .viewer-controls #viewer-orientation-select {
        flex: 1 1 100%;
        max-width: 100% !important;
    }

    .viewer-controls .viewer-overhang-toggle-row {
        flex: 1 1 auto;
    }

    .viewer-controls .btn-primary {
        flex: 1 1 auto;
        justify-content: center;
    }
}


.backup-option-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s ease;
}

.backup-option-row:hover {
    background: var(--bg-tertiary);
}

.backup-option-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--accent);
    flex-shrink: 0;
    cursor: pointer;
}

.backup-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.backup-option-text span {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.backup-option-text small {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

.integrity-panel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 20px;
}

.integrity-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.integrity-panel-header h3 {
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px 0;
}

.integrity-panel-header h3 i {
    color: var(--accent);
}

.integrity-progress {
    margin-top: 14px;
}

.integrity-progress .progress-track {
    width: 100%;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
}

.integrity-progress-text-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.integrity-summary {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.integrity-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.integrity-stat.ok { color: var(--success); }
.integrity-stat.warn { color: #f59e0b; }
.integrity-stat.danger { color: var(--danger); }

.integrity-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    max-height: 320px;
    overflow-y: auto;
}

.integrity-result-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--danger);
    border-radius: var(--radius);
}

.integrity-result-row.missing {
    border-left-color: var(--text-muted);
}

.integrity-result-row.empty,
.integrity-result-row.corrupted {
    border-left-color: #f59e0b;
}

.integrity-result-row > i {
    color: var(--danger);
    font-size: 15px;
    flex-shrink: 0;
}

.integrity-result-row.missing > i {
    color: var(--text-muted);
}

.integrity-result-row.empty > i,
.integrity-result-row.corrupted > i {
    color: #f59e0b;
}

.integrity-result-info {
    flex: 1;
    min-width: 0;
}

.integrity-result-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.integrity-result-path {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.integrity-result-error {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.integrity-result-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

.integrity-missing-note {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
}

.shortcuts-modal-content {
    max-width: 480px;
}

.shortcuts-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shortcuts-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.shortcuts-section h4 {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shortcuts-section h4 i {
    color: var(--accent);
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

.shortcut-row:first-of-type {
    border-top: none;
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
}

kbd {
    display: inline-block;
    min-width: 20px;
    text-align: center;
    padding: 3px 7px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

.shortcuts-note {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

.modal-about-content {
    max-width: 460px;
    text-align: center;
    overflow: hidden;
}

.about-logo-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.about-logo-section h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.about-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
    padding: 0 10px;
}

.about-section {
    margin-bottom: 20px;
    text-align: left;
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.about-section h4 {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.about-section h4 i {
    color: var(--accent);
    transition: color 0.2s ease;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.tech-tags span {
    background: var(--bg-input);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border-light);
}

.about-legal {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}


.scroll-to-top {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1500;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(78, 161, 211, 0.4);
}


.header-hide {
    display: none !important;
}


.header-library-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.3;
    margin-left: 4px;
}
.header-file-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}
.header-last-update {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


#page-stats, #page-history {
    padding: 24px;
    overflow-y: auto;
}
.stats-page, .history-page { max-width: 900px; margin: 0 auto; }
.stats-header, .history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.stats-header h2, .history-header h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}
.stats-loading {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.history-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.history-filters select,
.history-filters input[type="date"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 12.5px;
    padding: 7px 10px;
}

.history-filters select:focus,
.history-filters input[type="date"]:focus {
    outline: none;
    border-color: var(--accent);
}

.thumb-hover-preview {
    position: fixed;
    z-index: 300;
    width: 240px;
    height: 240px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    padding: 8px;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.thumb-hover-preview.visible {
    opacity: 1;
    transform: scale(1);
}

.thumb-hover-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-tertiary);
}

@media (max-width: 900px) {
    .thumb-hover-preview {
        display: none !important;
    }
}

.stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stats-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
}
.stats-kpi-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.stats-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.stats-kpi-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}
.stats-kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.stats-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 640px) { .stats-panels { grid-template-columns: 1fr; } }
.stats-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}
.stats-panel h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-fmt-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.stat-fmt-ext {
    font-size: 11px;
    font-weight: 700;
    width: 36px;
    flex-shrink: 0;
}
.stat-fmt-bar-wrap {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}
.stat-fmt-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}
.stat-fmt-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

.stat-top-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.stat-top-row:last-child { border-bottom: none; }
.stat-top-rank {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    width: 24px;
    flex-shrink: 0;
}
.stat-top-name {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stat-top-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}


.history-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.history-date-sep {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 16px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.history-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
    position: relative;
}
.history-entry:hover { background: var(--bg-secondary); }
.history-entry-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.history-entry-body { flex: 1; min-width: 0; }
.history-entry-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-entry-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 3px;
    font-size: 11px;
    color: var(--text-muted);
}
.history-entry-meta i { margin-right: 3px; }
.history-entry-ext {
    font-weight: 700;
    font-size: 10px;
}
.history-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
}
.history-entry-time {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.history-entry-del {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: var(--transition);
    flex-shrink: 0;
}
.history-entry:hover .history-entry-del { opacity: 1; }
.history-entry-del:hover { color: var(--danger); background: rgba(248,113,113,0.1); }

.history-entry-view,
.history-entry-reprint {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: var(--transition);
    flex-shrink: 0;
}
.history-entry:hover .history-entry-view,
.history-entry:hover .history-entry-reprint {
    opacity: 1;
}
.history-entry-view:hover {
    color: var(--accent);
    background: var(--accent)1a;
}
.history-entry-reprint:hover {
    color: var(--success, #22c55e);
    background: rgba(34, 197, 94, 0.1);
}

.history-entry-rating {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.history-rating-pending {
    display: flex;
    align-items: center;
    gap: 4px;
}
.history-rate-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 13px;
    transition: var(--transition);
    line-height: 1;
}
.history-rate-success:hover { color: #38c172; border-color: #38c172; background: rgba(56,193,114,0.1); }
.history-rate-fail:hover { color: #e85d75; border-color: #e85d75; background: rgba(232,93,117,0.1); }
.history-rating-badge {
    font-size: 15px;
    padding: 4px 6px;
    cursor: pointer;
    line-height: 1;
}
.history-reason-select {
    font-size: 11.5px;
    padding: 3px 5px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
    max-width: 150px;
}

#page-repair {
    padding: 24px;
}

.repair-header {
    margin-bottom: 24px;
}

.repair-header h2 {
    font-size: 22px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.repair-header p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.repair-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.repair-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.repair-card:hover {
    border-color: var(--warning);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.15);
}

.repair-thumb {
    height: 140px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.repair-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.repair-thumb i {
    font-size: 42px;
    color: var(--text-muted);
    opacity: 0.4;
}

.repair-badge-warn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(251, 191, 36, 0.92);
    color: #111;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.repair-info {
    padding: 12px;
}

.repair-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.repair-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.repair-btn {
    width: 100%;
}

.repair-btn.btn-success {
    background: var(--success) !important;
    color: #fff !important;
}


.converter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}

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

.converter-toolbar-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.converter-toolbar-checkbox {
    justify-content: center;
}

.converter-toolbar-checkbox .checkbox-label {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
}

.converter-search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.converter-search-input {
    flex: 1;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
}

.converter-card {
    position: relative;
}

.converter-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.converter-card-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    cursor: pointer;
}

.converter-card-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}

#repair-empty {
    padding: 60px 20px;
}

#repair-empty i {
    color: var(--success);
    opacity: 1;
    font-size: 56px;
    margin-bottom: 16px;
}

#repair-empty p {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
}


.spoolman-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
}

.spoolman-server-label {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.grid-spoolman {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 20px;
}

.spool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: var(--transition);
}

.spool-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.spool-card.archived {
    opacity: 0.5;
}

.spool-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.spool-color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    flex-shrink: 0;
    margin-top: 2px;
}

.spool-title {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.spool-name {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spool-vendor {
    font-size: 12px;
    color: var(--text-muted);
}

.spool-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(248, 113, 113, 0.15);
    color: var(--danger);
    font-weight: bold;
    white-space: nowrap;
}

.spool-material-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.spool-tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.spool-storage-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.spool-storage-tag i {
    font-size: 10px;
}

.spool-weight-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.spool-progress-track {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.spool-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.spool-location {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}


.grid-printers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
    padding: 20px;
}

.printer-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: transform 0.2s;
}

.printer-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.printer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.printer-header i {
    font-size: 20px;
    color: var(--accent);
}

.printer-name {
    font-weight: 600;
    flex: 1;
}

.printer-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 20px;
    font-weight: bold;
}

.printer-status.connected {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.printer-status.disconnected {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.printer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
}

.printer-card-spools {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.spool-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    font-size: 10.5px;
    color: var(--text-secondary);
    max-width: 130px;
}

.spool-chip-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.25);
    flex-shrink: 0;
}

.spool-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spool-chip-pct {
    color: var(--text-muted);
    flex-shrink: 0;
}

.monitor-modal-content {
    width: 720px;
    max-width: 95vw;
}

.monitor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.monitor-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.monitor-card.full {
    grid-column: 1 / -1;
}

.monitor-card h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.monitor-card h4 i {
    color: var(--accent);
}

.temp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}

.temp-row:last-child {
    border-bottom: none;
}

.temp-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.temp-values {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
}

.temp-current {
    color: var(--accent);
}

.temp-target {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: monospace;
}

.time-big {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: var(--accent);
    margin: 8px 0;
    font-family: monospace;
}

.monitor-progress-bar {
    height: 10px;
    background: var(--bg-input);
    border-radius: 5px;
    overflow: hidden;
    margin: 12px 0;
}

.monitor-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    transition: width 0.8s ease;
    border-radius: 5px;
}

.monitor-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.monitor-status-badge.printing {
    background: rgba(78,161,211,0.15);
    color: var(--accent);
}

.monitor-status-badge.idle {
    background: rgba(52,211,153,0.15);
    color: var(--success);
}

.monitor-status-badge.paused {
    background: rgba(251,191,36,0.15);
    color: var(--warning);
}

.monitor-status-badge.error,
.monitor-status-badge.offline {
    background: rgba(248,113,113,0.15);
    color: var(--danger);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 1.5s infinite;
    display: inline-block;
}


.file-thumb img {
    transition: opacity 0.3s ease;
}

.file-thumb img[src=""],
.file-thumb img:not([src]) {
    opacity: 0.3;
}

.file-thumb {
    min-height: 160px;
    background: var(--bg-tertiary);
}

.thumb-progress.completed .progress-bar {
    background: var(--success);
}


#thumb-progress-bar,
.thumb-progress .progress-bar {
    will-change: width;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000px;
}

.thumb-progress,
.thumb-progress * {
    transition: none !important;
}

.thumb-progress .progress-bar {
    transition: width 0.3s ease-out !important;
}


@media (max-width: 480px) {
    .auth-lang-selector {
        top: 12px;
        right: 12px;
    }

    #language-selector-auth {
        min-width: 90px;
        padding: 5px 24px 5px 10px;
        font-size: 12px;
    }
}


::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.stellio-logo-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-right: 8px;
}

.stellio-nom-logo-img {
    width: 128px;
    height: 128px;
    object-fit: contain;
    margin-right: 8px;
}

.stellio-nom-img {
    width: 128px;
    height: 128px;
    object-fit: contain;
    margin-right: 8px;
}

.nav-drag-handle {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    opacity: 0;
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden;
    flex-shrink: 0;
    cursor: grab;
    transition: opacity 0.15s ease, width 0.15s ease, margin 0.15s ease;
    margin-right: 0;
}

.nav-drag-handle:active {
    cursor: grabbing;
    opacity: 1 !important;
}

.nav-about-spacer {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    /* Zone basse défilante : seulement ~2,5 lignes visibles, la ligne coupée montre qu'on peut faire défiler */
    max-height: calc(8px + 2.5 * 45px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.compatibility-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    margin-top: 6px;
}
.compatibility-indicator.compatible {
    background: rgba(52, 211, 153, 0.1);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.3);
}
.compatibility-indicator.incompatible {
    background: rgba(248, 113, 113, 0.1);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.3);
}
.compatibility-indicator.partial {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}
.nav-toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.nav-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.nav-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 22px;
    cursor: pointer;
    transition: 0.2s ease;
}

.nav-toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: 0.2s ease;
}

.nav-toggle-switch input:checked + .nav-toggle-slider {
    background: var(--accent-glow);
    border-color: var(--accent);
}

.nav-toggle-switch input:checked + .nav-toggle-slider::before {
    transform: translateX(18px);
    background: var(--accent);
}


.settings-grid {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.settings-grid > .settings-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 860px) {
    .settings-grid {
        flex-direction: column;
        align-items: stretch;
        max-width: 700px;
        width: 100%;
        padding: 16px;
    }

    .settings-grid > .settings-col {
        width: 100%;
        align-self: stretch;
    }

    .settings-grid > .settings-col > .accord-section,
    .settings-grid > .settings-col > .settings-undo-banner {
        width: 100%;
    }
}

.accord-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.accord-section:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.accord-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: background 0.15s ease;
    gap: 10px;
    border-radius: var(--radius-lg);
}

.accord-header:hover {
    background: var(--bg-hover);
}

.accord-header > span {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.accord-header i.accord-arrow {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.accord-section.open > .accord-header .accord-arrow {
    transform: rotate(180deg);
}

.accord-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.25s ease;
    padding: 0 16px;
}

.accord-section.open > .accord-body {
    max-height: 800px;
    overflow-y: auto;
    padding: 0 16px 16px;
}

.accord-section.open > .accord-header {
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

#add-source-btn,
#add-remote-instance-btn {
    display: none;
}

.accord-section.open #add-source-btn,
.accord-section.open #add-remote-instance-btn {
    display: inline-flex;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.settings-row:last-of-type {
    border-bottom: none;
}

.settings-row label:not(.nav-toggle-switch) {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
}

.settings-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 7px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    min-width: 160px;
    max-width: 200px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.settings-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.spoolman-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 10px;
    flex: 0 1 220px;
    min-width: 160px;
    transition: border-color 0.2s ease;
}

.spoolman-search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.spoolman-search-box i {
    color: var(--text-muted);
    font-size: 12px;
}

.spoolman-search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    outline: none;
    width: 100%;
    padding: 0;
}

.settings-select-sm {
    min-width: 0;
    max-width: 130px;
    padding: 5px 8px;
    font-size: 11px;
}

.settings-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}


.ollama-guide {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-input);
}

.ollama-guide-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
}

.ollama-guide-toggle:hover {
    background: var(--bg-hover);
}

.ollama-guide-toggle > span {
    flex: 1;
}

.ollama-guide-arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.25s ease;
}

.ollama-guide.open .ollama-guide-arrow {
    transform: rotate(180deg);
}

.ollama-guide-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.25s ease;
    padding: 0 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-top: 0 solid var(--border);
}

.ollama-guide.open .ollama-guide-body {
    max-height: 600px;
    overflow-y: auto;
    padding: 14px;
    border-top-width: 1px;
}

.ollama-guide-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ollama-guide-step-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ollama-guide-step-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ollama-guide-step-content strong {
    font-size: 12.5px;
    color: var(--text-primary);
}

.ollama-guide-step-content p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.ollama-guide-step-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    color: var(--accent);
}

.ollama-guide-step-content .btn {
    align-self: flex-start;
}

.ollama-guide-cmd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
}

.ollama-guide-cmd code {
    background: transparent;
    padding: 0;
    font-size: 12px;
}

.ollama-guide-copy {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: none;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.ollama-guide-copy:hover {
    background: var(--accent);
    color: #fff;
}

.nav-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.nav-toggle-row:last-child { border-bottom: none; }

.nav-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.nav-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

.nav-toggle-row.dragging {
    opacity: 0.4;
}

.nav-toggle-row.drag-over-top {
    border-top: 2px solid var(--accent);
}

.nav-toggle-row.drag-over-bottom {
    border-bottom: 2px solid var(--accent);
}

.account-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
}

.account-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.account-icon-badge {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.account-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.account-badge.connected {
    background: rgba(52,211,153,0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

.account-badge.disconnected {
    background: rgba(107,114,128,0.15);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.tigertag-nav-badge {
    width: 15px;
    height: 15px;
    object-fit: contain;
    margin-left: 6px;
    vertical-align: -2px;
    opacity: 0.9;
}

.tigertag-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(255,140,0,0.10), rgba(255,140,0,0.02));
    border: 1px solid rgba(255,140,0,0.3);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 24px;
}

.tigertag-banner-logo {
    height: 26px;
    width: auto;
    flex-shrink: 0;
    filter: invert(1);
}

[data-theme="light"] .tigertag-banner-logo {
    filter: none;
}

.tigertag-banner-fallback-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255,140,0,0.15);
    color: #ff8c00;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.account-logo-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.tigertag-link-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
}

.tigertag-link-row:hover {
    border-color: rgba(255,140,0,0.4);
    background: rgba(255,140,0,0.06);
}

.tigertag-link-row i {
    width: 18px;
    text-align: center;
    color: #ff8c00;
    flex-shrink: 0;
}

.useful-link-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
}

.useful-link-row:hover {
    border-color: var(--accent);
}

.useful-link-row i:first-child {
    width: 18px;
    text-align: center;
    color: var(--accent);
    flex-shrink: 0;
}

.useful-link-row .useful-link-ext {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
}

.useful-links-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
}

.useful-links-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 1px 7px;
    flex: none;
}

.spool-card[data-detail-key] {
    cursor: pointer;
}

.spool-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.spool-detail-cell {
    background: var(--bg-secondary);
    padding: 9px 12px;
    min-width: 0;
}

.spool-detail-cell.filler {
    background: var(--bg-tertiary);
}

.spool-detail-cell.full {
    grid-column: 1 / -1;
}

.spool-detail-cell-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.spool-detail-cell-value {
    font-size: 13.5px;
    font-weight: 600;
    word-break: break-word;
}

.source-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius);
    padding: 12px 16px;
}

.source-banner-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.source-banner-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-banner-spoolman {
    background: linear-gradient(135deg, rgba(78,161,211,0.10), rgba(78,161,211,0.02));
    border: 1px solid rgba(78,161,211,0.3);
}

.source-banner-spoolman .source-banner-icon {
    background: rgba(78,161,211,0.15);
    color: #4ea1d3;
}

.source-banner-manual {
    background: linear-gradient(135deg, rgba(63,185,80,0.10), rgba(63,185,80,0.02));
    border: 1px solid rgba(63,185,80,0.3);
}

.source-banner-manual .source-banner-icon {
    background: rgba(63,185,80,0.15);
    color: #3fb950;
}

#page-sosprint {
    padding: 24px;
}

.sosprint-header {
    margin-bottom: 24px;
    width: 75%;
    max-width: 1300px;
    min-width: 320px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.sosprint-header h2 {
    font-size: 22px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sosprint-header p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.sosprint-container {
    width: 75%;
    max-width: 1300px;
    min-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.sosprint-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sosprint-material-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

.sosprint-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    user-select: none;
}

.sosprint-radio:hover {
    border-color: var(--accent);
}

.sosprint-radio input[type="radio"] {
    accent-color: var(--accent);
}

.sosprint-radio:has(input:checked) {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.sosprint-form textarea {
    resize: vertical;
    min-height: 90px;
}

.sosprint-result {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 20px;
}

.sosprint-result h3 {
    font-size: 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.sosprint-causes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sosprint-cause-card {
    display: flex;
    gap: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}

.sosprint-cause-rank {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sosprint-cause-content {
    flex: 1;
    min-width: 0;
}

.sosprint-cause-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.sosprint-cause-detail {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.sosprint-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.sosprint-hint i {
    margin-top: 2px;
    color: var(--accent);
}

.sosprint-questions {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sosprint-questions h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.sosprint-questions-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

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

.sosprint-question-item label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

.sosprint-answer-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-primary);
}

.sosprint-answer-input:focus {
    outline: none;
    border-color: var(--accent);
}

.sosprint-questions-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .sosprint-questions-actions {
        flex-direction: column;
    }
}

.sosprint-suspects-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sosprint-suspect {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 12px;
    transition: opacity 0.25s ease, background 0.25s ease;
}

.sosprint-suspect i {
    color: var(--accent);
    font-size: 11px;
}

.sosprint-suspect-eliminated {
    color: var(--text-muted);
    background: transparent;
    border-style: dashed;
    opacity: 0.55;
}

.sosprint-suspect-eliminated i {
    color: #ef4444;
}

.sosprint-suspect-eliminated span {
    text-decoration: line-through;
}

.sosprint-investigation-progress {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sosprint-optional-tag {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Réglages utilisés pour l'impression (S.O.S Print) */
.sosprint-settings {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sosprint-settings-title {
    font-size: 13px;
    color: var(--text-secondary);
}

.sosprint-settings .sosprint-settings-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.sosprint-settings .sosprint-settings-select:focus,
.sosprint-settings-field input:focus,
.sosprint-settings textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.sosprint-settings-hint {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

.sosprint-profile-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.sosprint-profile-card[hidden],
.sosprint-settings-fields[hidden],
.sosprint-settings textarea[hidden] {
    display: none;
}

.sosprint-profile-question {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.sosprint-profile-question i {
    color: var(--accent);
}

.sosprint-choice-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.sosprint-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.sosprint-choice:hover {
    border-color: var(--accent);
}

.sosprint-choice input[type="radio"] {
    flex: none;
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    accent-color: var(--accent);
}

.sosprint-choice.is-selected {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.sosprint-settings textarea {
    width: 100%;
    min-height: 60px;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
}

.sosprint-settings-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sosprint-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.sosprint-settings-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
}

/* Deux lignes réservées pour l'étiquette : tous les champs d'une rangée restent alignés et à la même hauteur */
.sosprint-settings-field label,
.sosprint-settings-notes label {
    display: flex;
    align-items: flex-end;
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
    color: var(--text-secondary);
}

.sosprint-settings-field label {
    min-height: 2.6em;
}

.sosprint-settings-notes label {
    margin-bottom: 4px;
}

.sosprint-settings-field input {
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    padding: 0 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
}

.sosprint-photo-zone {
    margin-top: 6px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-input);
    transition: var(--transition);
    cursor: pointer;
}

.sosprint-photo-zone:hover {
    border-color: var(--accent);
}

.sosprint-photo-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.sosprint-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
}

.sosprint-photo-placeholder i {
    font-size: 22px;
    color: var(--accent);
}

.sosprint-photo-preview {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 10px;
}

.sosprint-photo-preview img {
    max-width: 100%;
    max-height: 240px;
    border-radius: calc(var(--radius-lg) - 4px);
    object-fit: contain;
}

.sosprint-photo-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sosprint-photo-remove:hover {
    background: var(--accent);
}

.sosprint-history-panel {
    width: 75%;
    max-width: 1300px;
    min-width: 320px;
    margin-left: auto;
    margin-right: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

#sosprint-ai-disabled-banner {
    width: 75%;
    max-width: 1300px;
    min-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.sosprint-history-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.sosprint-history-toggle i:first-child {
    color: var(--accent);
    font-size: 13px;
}

.sosprint-history-toggle:hover {
    background: var(--bg-tertiary);
}

.sosprint-history-count {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 12.5px;
}

.sosprint-history-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
    font-size: 12px;
    color: var(--text-secondary);
}

.sosprint-history-chevron.rotated {
    transform: rotate(180deg);
}

.sosprint-history-body {
    border-top: 1px solid var(--border);
    padding: 14px 18px 18px;
}

.sosprint-history-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.sosprint-history-tab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.sosprint-history-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.sosprint-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.sosprint-history-loading,
.sosprint-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 22px 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.sosprint-history-empty i,
.sosprint-history-loading i {
    font-size: 18px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.sosprint-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.sosprint-history-item-main {
    min-width: 0;
    flex: 1;
}

.sosprint-history-item-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sosprint-history-item-meta {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sosprint-history-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
}

.sosprint-history-badge.open {
    color: #4ea1d3;
    background: #4ea1d315;
}

.sosprint-history-badge.resolved {
    color: #22c55e;
    background: #22c55e15;
}

.sosprint-history-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.sosprint-investigation-photo-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sosprint-extra-photo-status {
    font-size: 12px;
    color: #22c55e;
}

.sosprint-resolve-box {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.sosprint-resolve-box label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.sosprint-resolve-box textarea {
    width: 100%;
    resize: vertical;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 10px;
}

.sosprint-resolve-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#sosprint-resolved-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #22c55e15;
    border: 1px solid #22c55e40;
    border-radius: var(--radius);
    color: #22c55e;
    font-size: 13px;
}


.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 18px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background: var(--bg-hover);
}

.mobile-search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: auto;
}

.mobile-search-toggle:hover {
    background: var(--bg-hover);
}

.mobile-search-overlay {
    display: none;
}

.sidebar-overlay {
    display: none;
}

.bottom-nav {
    display: none;
}

@media (max-width: 860px) {
    .mobile-search-toggle {
        display: flex;
    }

    .header-center,
    .header-right {
        display: none !important;
    }

    .mobile-search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1100;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        padding: 16px;
        display: none;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-search-overlay.open {
        display: flex;
    }

    .mobile-search-bar {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-search-bar .search-box {
        flex: 1;
    }

    #mobile-search-close {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        border: none;
        background: var(--bg-hover);
        color: var(--text-primary);
        border-radius: var(--radius);
        font-size: 16px;
        cursor: pointer;
    }

    .mobile-search-hint {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        border-radius: var(--radius);
        font-size: 12px;
        background: var(--accent)15;
        border: 1px solid var(--accent)40;
        color: var(--accent);
    }

    .mobile-search-hint-warning {
        background: #f59e0b15;
        border-color: #f59e0b40;
        color: #f59e0b;
    }

    .mobile-menu-toggle {
        display: none !important;
    }

    .app-screen {
        position: relative;
        overflow: hidden;
        width: 100vw;
        max-width: 100vw;
    }

    .sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        max-height: 78vh;
        width: 100%;
        z-index: 1200;
        border-radius: 18px 18px 0 0;
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .sidebar.mobile-open {
        transform: translateY(0);
    }

    .sidebar-header {
        position: relative;
        flex-shrink: 0;
    }

    .sidebar-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        border-radius: 3px;
        background: var(--border);
    }

    .sidebar-nav {
        overflow-y: auto;
        flex: 1;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .sidebar-overlay.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .desktop-only-nav {
        display: none !important;
    }

    .mobile-hidden-nav {
        display: none !important;
    }

    .app-wrapper {
        width: 100%;
        max-width: 100vw;
        min-width: 0;
        overflow-x: hidden;
    }

    .app-header {
        padding: 0 10px;
        gap: 6px;
        overflow: hidden;
    }

    .header-left {
        flex: 1 1 auto;
        min-width: 0;
    }

    .header-left h2 {
        min-width: 0;
        overflow: hidden;
    }

    .header-left h2 span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        max-width: 100%;
    }

    .main-content {
        padding: 14px;
        padding-bottom: calc(56px + env(safe-area-inset-bottom) + 14px);
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        height: 54px;
        padding: 0 2px env(safe-area-inset-bottom);
        background: var(--bg-secondary);
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .bottom-nav::-webkit-scrollbar {
        display: none;
    }

    .bottom-nav-btn {
        flex: 0 0 auto;
        width: 68px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        background: none;
        border: none;
        color: var(--text-muted);
        padding: 4px 2px;
        font-size: 9px;
        line-height: 1;
        font-family: inherit;
        cursor: pointer;
        border-radius: 10px;
        transition: color 0.15s ease, background 0.15s ease;
    }

    .bottom-nav-btn i,
    .bottom-nav-btn svg {
        font-size: 17px;
        width: 17px;
        height: 17px;
        line-height: 1;
    }

    .bottom-nav-btn:active {
        background: var(--bg-hover);
    }

    .bottom-nav-btn.active {
        color: var(--accent);
    }

    .bottom-nav-scroll-hint {
        position: fixed;
        bottom: 0;
        height: calc(54px + env(safe-area-inset-bottom));
        width: 26px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        color: var(--text-secondary);
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.2s ease;
        z-index: 901;
    }

    .bottom-nav-scroll-hint.visible {
        opacity: 1;
    }

    .bottom-nav-scroll-hint.visible i {
        animation: bottom-nav-hint-nudge-right 1.4s ease-in-out infinite;
    }

    .bottom-nav-scroll-hint--left.visible i {
        animation-name: bottom-nav-hint-nudge-left;
    }

    @keyframes bottom-nav-hint-nudge-right {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(3px); }
    }

    @keyframes bottom-nav-hint-nudge-left {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(-3px); }
    }

    @media (prefers-reduced-motion: reduce) {
        .bottom-nav-scroll-hint.visible i {
            animation: none;
        }
    }

    .bottom-nav-scroll-hint--left {
        left: 0;
        background: linear-gradient(to right, var(--bg-secondary) 45%, transparent);
    }

    .bottom-nav-scroll-hint--right {
        right: 0;
        background: linear-gradient(to left, var(--bg-secondary) 45%, transparent);
    }

    .bottom-nav-btn .badge {
        position: absolute;
        transform: translate(10px, -8px);
        background: var(--danger, #e74c3c);
        color: #fff;
        font-size: 9px;
        min-width: 14px;
        height: 14px;
        line-height: 14px;
        border-radius: 7px;
        padding: 0 3px;
    }

    #toast-container {
        bottom: calc(54px + env(safe-area-inset-bottom) + 10px);
        left: 12px;
        right: 12px;
    }

    .toast {
        min-width: 0;
    }

    .files-grid.gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
}

@media (min-width: 861px) {
    .spoolman-filters-mobile-only {
        display: none !important;
    }
}

@media (max-width: 860px) {
    .ollama-model-row {
        flex-wrap: wrap;
    }

    .ollama-model-row select {
        flex: 1 1 100%;
    }

    .ollama-model-row button {
        flex: 1 1 0;
        white-space: nowrap;
    }

    .modal {
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: 100vw;
        max-height: 88vh;
        border-radius: 18px 18px 0 0;
        margin: 0;
        animation: sheet-slide-up 0.28s cubic-bezier(0.32, 0.72, 0, 1);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-content.small {
        width: 100%;
    }

    .modal-content.viewer-3d {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        animation: none;
    }

    #modal-confirm .modal-content {
        width: 90vw;
        max-width: 360px;
        max-height: none;
        border-radius: var(--radius-lg);
        align-self: center;
        animation: sheet-fade-in 0.15s ease;
    }

    #modal-confirm.modal {
        align-items: center;
    }

    .modal-header {
        position: relative;
        padding-top: 22px;
    }

    .modal-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        border-radius: 3px;
        background: var(--border);
    }

    #modal-confirm .modal-header::before {
        display: none;
    }
}

@keyframes sheet-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes sheet-fade-in {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 480px) {
    .header-left h2 i {
        font-size: 16px;
    }

    .files-grid.gallery {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }

    .main-content {
        padding: 10px;
    }
}

.remote-copy-btn {
    flex-shrink: 0;
    width: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.print-queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 640px;
}

.print-queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    transition: border-color 0.15s ease, opacity 0.15s ease;
}

.print-queue-item.dragging {
    opacity: 0.4;
}

.print-queue-drag-handle {
    color: var(--text-muted);
    cursor: grab;
    flex-shrink: 0;
}

.print-queue-drag-handle:active {
    cursor: grabbing;
}

.print-queue-position {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-hover);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.print-queue-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.print-queue-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.print-queue-thumb i {
    color: var(--text-muted);
    font-size: 16px;
}

.print-queue-info {
    flex: 1;
    min-width: 0;
}

.print-queue-name {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.print-queue-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

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

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.onboarding-checklist {
    background: linear-gradient(135deg, var(--accent)14, var(--bg-card));
    border: 1px solid var(--accent)33;
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 18px;
}

.onboarding-checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.onboarding-checklist-header i.fa-rocket {
    color: var(--accent);
    margin-right: 8px;
}

.onboarding-checklist-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
}

.onboarding-checklist-header button:hover {
    color: var(--text-primary);
}

.onboarding-checklist-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.onboarding-checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-hover);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12.5px;
    color: var(--text-secondary);
    flex: 1;
    min-width: 180px;
    cursor: pointer;
    transition: var(--transition);
}

.onboarding-checklist-item:hover {
    border-color: var(--accent);
}

.onboarding-checklist-item.done {
    color: var(--text-muted);
    text-decoration: line-through;
    cursor: default;
}

.onboarding-checklist-item i {
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.onboarding-checklist-item.done i {
    color: var(--success, #22c55e);
}

.dashboard-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    transition: border-color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.dashboard-widget.dashboard-widget-hidden-flag {
    display: none;
}

.dashboard-widget.dragging {
    opacity: 0.4;
}

.dashboard-widget-drag-handle {
    display: none;
    color: var(--text-muted);
    cursor: grab;
    margin-right: 4px;
    flex-shrink: 0;
}

.dashboard-widget-drag-handle:active {
    cursor: grabbing;
}

.dashboard-widget-hide-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    flex-shrink: 0;
}

.dashboard-widget-hide-btn:hover {
    color: var(--danger);
}

.dashboard-grid.edit-mode .dashboard-widget {
    border-style: dashed;
    border-color: var(--accent)66;
}

.dashboard-grid.edit-mode .dashboard-widget-drag-handle,
.dashboard-grid.edit-mode .dashboard-widget-hide-btn {
    display: inline-flex;
}

.dashboard-grid.edit-mode .dashboard-widget-seeall {
    display: none;
}

.dashboard-hidden-widgets {
    margin-top: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

#dashboard-hidden-widgets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-hidden-widget-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.dashboard-hidden-widget-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.dashboard-stats-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    flex: 1;
}

.dashboard-stat-tile {
    background: var(--bg-hover);
    border-radius: 10px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
}

.dashboard-stat-tile i {
    color: var(--accent);
    font-size: 14px;
    margin-bottom: 2px;
}

.dashboard-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.dashboard-stat-label {
    font-size: 10.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.dashboard-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dashboard-widget-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-widget-header h3 i {
    color: var(--accent);
    font-size: 13px;
}

.dashboard-widget-header a {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
}

.dashboard-widget-header a:hover {
    color: var(--accent);
}

.dashboard-widget-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.dashboard-widget-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--accent);
}

.dashboard-widget-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 8px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px 10px;
}

.dashboard-widget-empty i {
    font-size: 24px;
    opacity: 0.5;
}

.dashboard-widget-empty--ok i {
    color: var(--success, #22c55e);
    opacity: 0.8;
}

.dashboard-widget-empty p {
    font-size: 12px;
    margin: 0;
}

.dashboard-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.dashboard-row:hover {
    background: var(--bg-hover);
}

.dashboard-row-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-hover);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.dashboard-row-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-row-thumb i {
    color: var(--text-muted);
    font-size: 14px;
}

.dashboard-row-body {
    flex: 1;
    min-width: 0;
}

.dashboard-row-title {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-row-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.dashboard-row-meta {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.notif-panel {
    position: absolute;
    top: 100%;
    right: 12px;
    margin-top: 8px;
    width: 340px;
    max-width: calc(100vw - 24px);
    max-height: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.15s ease;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.notif-panel-header button {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}

.notif-panel-header button:hover {
    text-decoration: underline;
}

.notif-panel-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: var(--bg-hover);
}

.notif-item.unread {
    background: var(--accent)0d;
}

.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 18px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.notif-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-hover);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
    margin-left: 8px;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-item-message {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.notif-item-time {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.notif-item-close {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 2px 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.notif-item-close:hover {
    color: var(--danger);
}

.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    pointer-events: none;
}

.tour-spotlight {
    position: fixed;
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
    transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
    pointer-events: none;
    z-index: 1501;
}

.tour-tooltip {
    position: fixed;
    z-index: 1502;
    width: 300px;
    max-width: calc(100vw - 32px);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    padding: 16px;
    pointer-events: auto;
    transition: top 0.25s ease, left 0.25s ease;
}

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

#tour-step-counter {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tour-tooltip-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
}

.tour-tooltip-header button:hover {
    color: var(--text-primary);
}

.tour-tooltip h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.tour-tooltip p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 14px;
}

.tour-tooltip-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.tour-tooltip-footer .btn {
    flex: 1;
}

.mini-printer-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    max-width: 260px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    animation: slideUp 0.2s ease;
}

.mini-printer-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

.mini-printer-widget-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent)22;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.mini-printer-widget-body {
    flex: 1;
    min-width: 100px;
}

.mini-printer-widget-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-printer-widget-pct {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.mini-printer-widget-extra {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-hover);
    border-radius: 999px;
    padding: 2px 6px;
    flex-shrink: 0;
}

.mini-printer-widget-close {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 2px 4px;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 11px;
}

.mini-printer-widget-close:hover {
    color: var(--danger);
}

@media (max-width: 768px) {
    .mini-printer-widget {
        bottom: 76px;
        right: 12px;
        max-width: calc(100vw - 24px);
    }
}

.command-palette-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}

.command-palette {
    width: 560px;
    max-width: calc(100vw - 32px);
    max-height: 60vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.15s ease;
}

.command-palette-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.command-palette-input-wrap i {
    color: var(--text-muted);
}

.command-palette-input-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
}

.command-palette-input-wrap kbd {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.command-palette-results {
    overflow-y: auto;
    padding: 6px;
}

.cmd-palette-section-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 8px 10px 4px;
}

.cmd-palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.cmd-palette-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.cmd-palette-item.selected,
.cmd-palette-item:hover {
    background: var(--accent)18;
    color: var(--text-primary);
}

.cmd-palette-item.selected i,
.cmd-palette-item:hover i {
    color: var(--accent);
}

.cmd-palette-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
    position: relative;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.project-card-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.project-card-thumbs .folder-preview-thumb {
    width: 100%;
    height: 48px;
    border-radius: 4px;
}

.project-card-thumbs .project-thumb-3d {
    cursor: zoom-in;
}

.project-card-thumbs .project-thumb-3d:hover {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.project-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.project-card-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.project-card-header h4 {
    margin: 0;
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.project-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    overflow: hidden;
    margin: 8px 0;
}

.project-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.project-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11.5px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.project-status-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10.5px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    margin-left: auto;
}

.project-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.project-card:hover .project-card-actions {
    opacity: 1;
}

.project-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--border);
}

.project-file-row--done {
    opacity: 0.55;
}

.project-file-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
}

.project-file-thumb--view { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.project-file-thumb--view:hover { box-shadow: 0 0 0 2px var(--accent, #4a9eff); transform: scale(1.06); }

.project-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.project-file-name {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-file-missing {
    font-size: 11px;
    color: var(--danger);
}

.project-file-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.diag-console {
    background: #0d1117;
    color: #c9d1d9;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11.5px;
    line-height: 1.5;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.diag-console-placeholder {
    color: #6e7681;
    font-style: italic;
}

#photo-lightbox-overlay {
    animation: fadeIn 0.2s ease;
}
#photo-lightbox-img {
    transition: transform 0.2s ease;
}
#photo-lightbox-img:hover {
    transform: scale(1.02);
}

.app-header {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-height);
    padding: 8px 12px;
    gap: 8px;
    align-items: center;
}

.header-left {
    flex-shrink: 1;
    min-width: 0;
}

.header-left h2 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.header-left h2 span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-center {
    flex: 1 1 300px;
    min-width: 200px;
    max-width: none;
    margin: 0 8px;
}

.header-right {
    flex-shrink: 1;
    min-width: 0;
    flex-wrap: wrap;
    gap: 6px;
}

@media (max-width: 1200px) and (min-width: 861px) {
    .header-right .view-modes,
    .header-right #refresh-files,
    .header-right #global-logout-btn {
        display: none;
    }
    
    .header-library-info {
        display: none;
    }
}

@media (max-width: 1000px) and (min-width: 861px) {
    .header-center {
        order: 3;
        flex-basis: 100%;
        margin: 4px 0 0 0;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border);
        min-width: 100%;
    }
    
    .header-left h2 span {
        display: none;
    }
    
    .header-left h2 i {
        font-size: 18px;
    }
    
    .header-right {
        justify-content: flex-end;
    }
}

.search-box {
    min-width: 0;
    flex: 1;
}

.search-box input {
    min-width: 0;
}

#sort-select {
    max-width: 140px;
    flex-shrink: 1;
}
@media (max-width: 860px) {
    #startup-settings-section,
    #shortcuts-settings-section,
    #accord-diagnostic,
	#save-data-section,
	#account-security-section,
    #slicer-settings-section {
        display: none !important;
    }
}
:focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: 2px !important;
}

html.high-contrast {
    --border: #ffffff;
    --text-muted: #e2e2e2;
}

html.high-contrast body {
    background: #000 !important;
}

html.high-contrast .file-card,
html.high-contrast .dashboard-widget,
html.high-contrast .modal-content,
html.high-contrast .app-header,
html.high-contrast .sidebar,
html.high-contrast .notif-panel,
html.high-contrast .command-palette,
html.high-contrast .tour-tooltip {
    border-width: 2px !important;
    border-color: #ffffff !important;
}

html.high-contrast .btn,
html.high-contrast input,
html.high-contrast select,
html.high-contrast textarea {
    border-width: 2px !important;
}

html.high-contrast .btn-primary {
    background: var(--accent) !important;
    color: #000 !important;
    font-weight: 700;
}

html.high-contrast a,
html.high-contrast .nav-btn.active {
    text-decoration: underline;
}

html.reduce-motion,
html.reduce-motion * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}

.settings-undo-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: box-shadow 0.2s ease;
}

.settings-undo-banner:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.settings-undo-banner > span {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.settings-undo-banner i.fa-clock-rotate-left {
    color: var(--accent);
    margin-right: 0;
}

.settings-undo-banner .btn {
    flex-shrink: 0;
    font-weight: 600;
}

.presence-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--accent)1f;
    color: var(--accent);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: help;
    flex-shrink: 0;
}

.file-viewed-by-other-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    background: var(--accent);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}


.autobackup-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.autobackup-title i { color: var(--accent); margin-right: 4px; }

.autobackup-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
}

.autobackup-toggle input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
    cursor: pointer;
}

#autobackup-fields .settings-row.autobackup-off { opacity: 0.5; pointer-events: none; }

.autobackup-folder {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.autobackup-folder input {
    flex: 1 1 220px;
    max-width: none;
    cursor: default;
    text-overflow: ellipsis;
}

.autobackup-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.backup-list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    margin-bottom: 8px;
}

.backup-list-main { flex: 1; min-width: 0; }

.backup-list-date { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.backup-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.backup-kind-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--accent);
}

.backup-chip {
    font-size: 10.5px;
    padding: 1px 7px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.backup-list-actions { display: flex; gap: 6px; flex-shrink: 0; }


.fb-tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.fb-tab {
    background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-secondary);
    padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.fb-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.fb-count { background: var(--accent); color: #fff; border-radius: 20px; font-size: 10.5px; padding: 1px 7px; margin-left: 4px; }
.fb-field { margin-bottom: 12px; }
.fb-field label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.fb-counter { font-size: 11px; opacity: 0.8; }
.fb-check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; margin: 8px 0; cursor: pointer; line-height: 1.4; }
.fb-check input { margin-top: 2px; accent-color: var(--accent); }
.fb-banner {
    display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-input); margin-bottom: 12px;
}
.fb-banner i { color: var(--accent); margin-top: 2px; }
.fb-error {
    font-size: 12.5px; color: var(--danger); padding: 8px 10px; border: 1px solid var(--danger);
    border-radius: var(--radius); margin: 8px 0;
}
.fb-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.fb-list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.fb-row {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-input);
    color: var(--text-primary); cursor: pointer; margin-bottom: 8px; font-family: inherit;
}
.fb-row:hover { border-color: var(--accent); }
.fb-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fb-row-unread { border-color: var(--accent); }
.fb-new-reply { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 1px 8px; border-radius: 20px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.fb-gh-btn { flex-shrink: 0; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 15px; }
.fb-gh-btn:hover { color: var(--text-primary); border-color: var(--accent); }
.fb-row-main { flex: 1; min-width: 0; }
.fb-row-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-row-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.fb-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.fb-status { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px; border: 1px solid var(--border); white-space: nowrap; }
.fb-status-sent { color: var(--text-secondary); }
.fb-status-in_progress { color: #f59e0b; border-color: rgba(245,158,11,0.5); }
.fb-status-done { color: #68d391; border-color: rgba(104,211,145,0.5); }
.fb-status-not_planned, .fb-status-closed_by_you, .fb-status-missing { color: var(--text-muted); }
.fb-detail-title { font-size: 15px; font-weight: 700; margin: 10px 0 6px; word-break: break-word; }
.fb-detail-body {
    white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.5; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-input); margin: 10px 0;
}
.fb-reply { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; font-size: 13px; }
.fb-reply.team { border-color: var(--accent); }
.fb-reply-head { font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.fb-reply-body { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.fb-team-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px; background: var(--accent); color: #fff; }


.kofi-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius);
    background: #FF5E5B;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.kofi-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

.viewer-banner {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}
@media (max-width: 860px) {
    .viewer-banner { bottom: 76px; }
}
body.role-viewer .viewer-hide,
body.role-viewer .nav-btn[data-page="settings"] {
    display: none !important;
}

.spool-extra {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.spool-extra:empty { display: none; }
.spool-extra-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13.5px;
    font-weight: 600;
}
.spool-extra-head i { color: var(--accent); }
.spool-extra-head .dry-pill { margin-left: auto; }
.spool-extra-hint {
    margin: 0 0 8px;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--text-muted);
}
.spool-extra-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.spool-extra-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
}
.spool-extra-form.hidden { display: none; }
.spool-extra-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    color: var(--text-muted);
}
.spool-extra-field input,
.spool-extra-field select { width: 100%; }
.spool-extra-form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
}
.spool-extra-details { margin-top: 10px; font-size: 12px; }
.spool-extra-details summary { cursor: pointer; color: var(--text-muted); margin-bottom: 6px; }
.spool-extra-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    margin-top: 4px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
}
.part-row.part-low { border-color: var(--danger); }
.dry-pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.dry-pill-ok { color: #38c172; border-color: rgba(56, 193, 114, 0.5); }
.dry-pill-due { color: var(--danger); border-color: var(--danger); }
.slicer-calib-box {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    border-radius: var(--radius);
    background: var(--bg-input);
    border: 1px solid var(--border);
}
.slicer-calib-box i { color: var(--accent); margin-top: 2px; }

.report-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.report-kpi { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-input); }
.report-kpi-label { font-size: 11px; color: var(--text-muted); }
.report-kpi-value { font-size: 20px; font-weight: 700; margin-top: 2px; }
.report-kpi-note { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.report-table-title { font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.report-table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.report-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); padding: 5px 6px; }
.report-table td { padding: 6px; border-bottom: 1px solid var(--border); }
.report-table th.num, .report-table td.num { text-align: right; white-space: nowrap; }
.model-updates-card { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.model-update-row { flex-wrap: wrap; }

.file-metadata-tooltip .meta-row .meta-label { font-family: inherit; font-size: 11px; }
.file-metadata-tooltip .meta-row .meta-val { margin-left: auto; padding-left: 14px; font-size: 11px; }
.file-metadata-tooltip .meta-yes { color: #68d391; }

.file-metadata-tooltip .meta-no { color: var(--text-muted); }

:root:not([data-theme="light"]) .tigertag-banner-logo { filter: invert(1); }


/* ===== Historique des impressions : mise en page mobile / tactile ===== */
@media (max-width: 768px) {
    .history-entry {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 6px 12px;
        padding: 10px 4px;
    }
    .history-entry-body {
        flex: 1 1 calc(100% - 48px);
        min-width: 0;
    }
    .history-entry-meta {
        flex-wrap: wrap;
        gap: 4px 10px;
    }
    .history-entry-meta > span { white-space: nowrap; }
    .history-entry-time {
        margin-left: 48px;
        align-self: center;
    }
    .history-entry-rating {
        margin-left: auto;
        align-self: center;
    }
}
/* Écrans tactiles : pas de survol, donc les boutons d'action restent visibles */
@media (hover: none) {
    .history-entry-view,
    .history-entry-reprint,
    .history-entry-del { opacity: 1; }
}


/* ===== Popups « ajouter à un projet » : message d'aide / erreur ===== */
.picker-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 8px; }
.picker-error {
    display: none;
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--danger, #ef4444);
    font-size: 12px;
}
.picker-error.visible { display: block; }
.picker-actions { display: flex; gap: 8px; margin-top: 8px; }
.picker-actions .btn { flex: 1; justify-content: center; }


/* ===== Statut « Terminé » des cartes projet ===== */
.project-status-badge--done {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

/* ===== Historique : jours repliables ===== */
.history-date-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--border);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    user-select: none;
}
.history-date-toggle:hover { color: var(--text-primary); }
.history-date-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.history-day-chevron { font-size: 10px; width: 12px; transition: transform 0.15s ease; }
.history-day.collapsed .history-day-chevron { transform: rotate(-90deg); }
.history-day-label { flex: 1; min-width: 0; }
.history-day-count {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}
.history-day-body { display: flex; flex-direction: column; gap: 2px; }
.history-day.collapsed .history-day-body { display: none; }
.history-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0 6px; flex-wrap: wrap; }
.history-pager-center { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.history-pager-label { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.history-pager-info { font-size: 11px; color: var(--text-secondary); }
.history-pager .btn:disabled { opacity: 0.4; cursor: default; }
.restock-row { gap: 8px; }
.restock-row .restock-btn { flex-shrink: 0; white-space: nowrap; }
.source-types-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.source-type-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; }
.source-type-opt:hover { background: var(--bg-tertiary); }
.history-header-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ===== Bilan : fréquence et navigation entre périodes ===== */
.report-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.report-controls-label { font-size: 12.5px; color: var(--text-muted); }
.report-nav { display: flex; align-items: center; gap: 4px; }
.report-period-label { min-width: 140px; text-align: center; font-size: 13px; font-weight: 600; text-transform: capitalize; }
.report-nav .btn:disabled { opacity: 0.35; cursor: default; }

/* ===== Galerie d'impressions : lien vers le fichier ===== */
.gallery-file-link {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
}
.gallery-file-link:hover { background: var(--bg-tertiary); color: var(--accent); }



/* --- v0.7.5 : filtre des projets --- */
.projects-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.projects-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.projects-filter-count { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: rgba(127,127,127,0.22); font-size: 10px; font-weight: 600; text-align: center; }
.projects-filter-btn.active .projects-filter-count { background: rgba(255,255,255,0.25); }

/* --- v0.7.5 : widget galerie du tableau de bord (diaporama) --- */
.dash-gallery { position: relative; }
.dash-gallery-stage { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--bg-card); border: 1px solid var(--border); cursor: pointer; }
.dash-gallery-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s ease; pointer-events: none; }
.dash-gallery-slide.active { opacity: 1; pointer-events: auto; }
.dash-gallery-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-gallery-caption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,0.65)); color: #fff; font-size: 11px; font-weight: 600; }
.dash-gallery-caption-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-gallery-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.dash-gallery-dot.ok { background: #28a745; }
.dash-gallery-dot.fail { background: #dc3545; }
.dash-gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: none; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s ease; }
.dash-gallery-nav.prev { left: 8px; }
.dash-gallery-nav.next { right: 8px; }
.dash-gallery:hover .dash-gallery-nav, .dash-gallery-nav:focus-visible { opacity: 1; }
.dash-gallery-counter { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 10px; background: rgba(0,0,0,0.55); color: #fff; font-size: 10px; font-weight: 600; }
.reduce-motion .dash-gallery-slide { transition: none; }
@media (hover: none) { .dash-gallery-nav { opacity: 1; } }


/* --- v0.7.5 : miniature du fichier en cours dans les cartes imprimante --- */
.printer-card-job { align-items: center; gap: 10px; margin-top: 8px; padding: 6px; border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border); }
.printer-card-job-thumb { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 6px; overflow: hidden; background: var(--bg-input); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.printer-card-job-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.printer-card-job-name { min-width: 0; font-size: 12px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- v0.7.5 : comptes externes dépliables --- */
.account-card[data-collapsible] > .account-card-header { cursor: pointer; user-select: none; gap: 8px; }
.account-card-arrow { margin-left: 8px; font-size: 11px; color: var(--text-muted); transition: transform 0.2s ease; }
.account-card.open .account-card-arrow { transform: rotate(180deg); }
.account-card[data-collapsible] > .account-card-body { display: none; }
.account-card[data-collapsible].open > .account-card-body { display: block; }


/* --- v0.7.6 : hauteur réelle de l'écran (évite que la barre du bas masque le contenu sur téléphone) --- */
body, .app-screen, .auth-screen {
    height: 100vh;
    height: 100dvh;
    height: var(--app-height, 100dvh);
}
@media (max-width: 860px) {
    .main-content { padding-bottom: calc(54px + env(safe-area-inset-bottom) + 28px); }
    body.has-mini-printer .main-content { padding-bottom: calc(54px + env(safe-area-inset-bottom) + 92px); }
    .dashboard-widget { transition: none; }
}

/* --- v0.7.6 : tous les widgets du tableau de bord ont la même taille --- */
:root { --dashboard-widget-height: 320px; }   /* hauteur commune de tous les widgets : une seule valeur à changer */
.dashboard-grid { grid-auto-rows: var(--dashboard-widget-height); }
.dashboard-widget {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    content-visibility: auto;              /* les widgets hors écran ne sont pas dessinés : tableau de bord plus fluide */
    contain-intrinsic-size: auto var(--dashboard-widget-height);
    transition: border-color 0.15s ease, opacity 0.15s ease;
}
.dashboard-widget-body { min-height: 0; overflow-y: auto; overscroll-behavior: auto; }
#dashboard-gallery-body .dash-gallery { flex: 1; min-height: 0; }
#dashboard-gallery-body .dash-gallery-stage { height: 100%; aspect-ratio: auto; }

/* --- v0.7.6 : historique des devis --- */
.quote-history-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.quote-history-main { flex: 1; min-width: 0; }
.quote-history-title { font-size: 13px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-history-sub { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-history-total { font-size: 13px; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.quote-history-actions { display: flex; gap: 4px; flex: 0 0 auto; }

/* Case « À commander » dans le widget de stock faible */
.stock-order-check { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--text-secondary); cursor:pointer; white-space:nowrap; flex-shrink:0; user-select:none; }
.stock-order-check input { accent-color: var(--accent); cursor:pointer; }

/* Zone principale : focalisée par programme (défilement sans clic), sans cadre visible */
.main-content:focus,
.main-content:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Widget caméras : masqué tant qu'aucune impression n'est en cours */
.dashboard-widget.dashboard-widget-auto-hidden { display: none; }
.dashboard-widget.dashboard-widget-auto-hidden.has-content { display: flex; }
.dashboard-grid.edit-mode .dashboard-widget.dashboard-widget-auto-hidden { display: flex; }
.dashboard-camera-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.dashboard-camera-tile { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16 / 9; cursor: pointer; border: 1px solid var(--border); }
.dashboard-camera-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dashboard-camera-tile .dashboard-camera-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.dashboard-camera-tile .dashboard-camera-caption span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-camera-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-muted); font-size: 12px; }

/* Fenêtre « détails du fichier » (appui long sur une miniature) */
.file-info-layout { display: flex; gap: 18px; align-items: flex-start; }
.file-info-thumb { flex: 0 0 52%; max-width: 560px; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: #2a2e38; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.file-info-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.file-info-table { flex: 1; min-width: 0; width: 100%; border-collapse: collapse; font-size: 13px; }
.file-info-table th { text-align: left; font-weight: 500; color: var(--text-secondary); padding: 7px 10px 7px 0; white-space: nowrap; vertical-align: top; }
.file-info-table td { padding: 7px 0; color: var(--text-primary); border-bottom: 1px solid var(--border); word-break: break-word; }
.file-info-table tr:last-child td, .file-info-table tr:last-child th { border-bottom: none; }
.file-info-table th { border-bottom: 1px solid var(--border); }
.file-info-table tr.file-info-total td, .file-info-table tr.file-info-total th { font-weight: 700; color: var(--text-primary); }
@media (max-width: 640px) { .file-info-layout { flex-direction: column; } .file-info-thumb { flex: none; width: 100%; max-width: none; } }
.file-info-controls { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-bottom: 12px; align-items: flex-end; }
.file-info-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); min-width: 0; }
.file-info-controls select, .file-info-controls input[type=number] { padding: 7px 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 13px; max-width: 100%; }
.file-info-controls select { min-width: 220px; }
.file-info-scale { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.file-info-scale input { width: 84px; }


/* Inventaires (Spoolman / manuel / TigerTag) : sections repliables comme les sections des paramètres */
.inv-section .source-banner, .inv-section .tigertag-banner { cursor: pointer; }
.inv-toggle {
    flex: 0 0 auto; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--text-muted); cursor: pointer;
}
.inv-toggle:hover { color: var(--text-primary); border-color: var(--accent, var(--border)); }
.inv-toggle i { transition: transform .2s ease; }
.inv-section.inv-collapsed .inv-toggle i { transform: rotate(-90deg); }
.inv-section.inv-collapsed > :not(.source-banner):not(.tigertag-banner) { display: none !important; }
@media (prefers-reduced-motion: reduce) { .inv-toggle i { transition: none; } }


/* Rapport d'impression partageable */
.print-report-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; z-index: 100000; padding: 16px; }
.print-report-modal { background: var(--bg-secondary, #1e2129); border: 1px solid var(--border-color, rgba(255,255,255,.1)); border-radius: 16px; padding: 20px; width: min(920px, 100%); max-height: 94vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.print-report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.print-report-head h3 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.print-report-close { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.print-report-close:hover { background: rgba(255,255,255,.08); color: var(--text-primary); }
.print-report-preview { display: flex; align-items: center; justify-content: center; min-height: 120px; background: rgba(0,0,0,.25); border-radius: 12px; overflow: hidden; }
.print-report-canvas { width: 100%; height: auto; display: block; }
.print-report-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.print-report-opt { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary, var(--text-muted)); cursor: pointer; }


/* Mode atelier */
.workshop-overlay { position: fixed; inset: 0; z-index: 99990; background: #0b0e13; color: #fff; display: flex; flex-direction: column; padding: 18px 20px 24px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ws-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.ws-title { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-count { font-size: 15px; font-weight: 500; color: #8b95a8; margin-left: 6px; }
.ws-clock { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.ws-btn { width: 52px; height: 52px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: #1a1f2a; color: #fff; font-size: 20px; cursor: pointer; flex-shrink: 0; }
.ws-btn:active { transform: scale(.96); background: #232a38; }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-content: start; }
.ws-tile { background: #151a23; border: 2px solid #232a38; border-radius: 22px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-height: 210px; }
.ws-tile.ws-printing { border-color: var(--accent, #4ea1d3); }
.ws-tile.ws-paused { border-color: #f5a623; }
.ws-tile.ws-error { border-color: #e85d75; }
.ws-tile.ws-offline { opacity: .5; }
.ws-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ws-name { font-size: 22px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-pill { font-size: 14px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: #232a38; color: #cbd5e1; white-space: nowrap; }
.ws-printing .ws-pill { background: rgba(78,161,211,.2); color: var(--accent, #4ea1d3); }
.ws-paused .ws-pill { background: rgba(245,166,35,.2); color: #f5a623; }
.ws-tile.ws-idle .ws-pill { background: rgba(56,193,114,.18); color: #38c172; }
.ws-error .ws-pill { background: rgba(232,93,117,.2); color: #e85d75; }
.ws-main { display: flex; align-items: center; gap: 16px; }
.ws-thumb { width: 96px; height: 96px; object-fit: contain; border-radius: 14px; background: #1e2330; flex-shrink: 0; }
.ws-prog { flex: 1; min-width: 0; }
.ws-pct { font-size: 68px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ws-pct small { font-size: 28px; font-weight: 600; color: #8b95a8; margin-left: 2px; }
.ws-rem { font-size: 22px; color: #cbd5e1; margin-top: 6px; }
.ws-bar { height: 14px; background: #232a38; border-radius: 8px; overflow: hidden; }
.ws-bar > div { height: 100%; background: var(--accent, #4ea1d3); border-radius: 8px; transition: width .6s ease; }
.ws-paused .ws-bar > div { background: #f5a623; }
.ws-file { font-size: 16px; color: #8b95a8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-ico { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 64px; color: #38c172; }
.ws-error .ws-ico { color: #e85d75; }
.ws-offline .ws-ico { color: #64748b; }
.ws-temps { display: flex; gap: 20px; font-size: 18px; color: #cbd5e1; margin-top: auto; }
.ws-empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: #8b95a8; font-size: 18px; }
.ws-empty i { font-size: 42px; display: block; margin-bottom: 12px; }
@media (max-width: 640px) {
    .ws-grid { grid-template-columns: 1fr; }
    .ws-clock { font-size: 22px; }
    .ws-title { font-size: 17px; }
    .ws-count { display: none; }
    .ws-btn { width: 46px; height: 46px; }
    .ws-pct { font-size: 56px; }
}

@media (max-width: 480px) { .ws-clock { display: none; } }


/* Timelapses */
.tl-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
.tl-player video { width: 100%; max-height: 52vh; background: #000; border-radius: 12px; display: block; }
.tl-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tl-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; }
.tl-item { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-color, rgba(255,255,255,.1)); cursor: pointer; }
.tl-item:hover { background: rgba(255,255,255,.05); }
.tl-item.active { border-color: var(--accent); background: rgba(78,161,211,.12); }
.tl-item-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.tl-settings { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.tl-rec { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 10px; color: #e85d75; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: #e85d75; animation: tlpulse 1.2s infinite; }
@keyframes tlpulse { 50% { opacity: .3; } }
.tl-warn { background: rgba(245,166,35,.12); border: 1px solid rgba(245,166,35,.35); color: #f6ad55; padding: 8px 12px; border-radius: 10px; font-size: 12px; margin-bottom: 10px; }
@media (max-width: 720px) { .tl-layout { grid-template-columns: 1fr; } }

/* Liens d'état */
.sl-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-color, rgba(255,255,255,.1)); border-radius: 10px; margin-bottom: 6px; }
.sl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sl-info span { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-create { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sl-create input[type="text"] { flex: 1; min-width: 160px; }

.print-report-modal input[type="text"], .print-report-modal input[type="number"] { background: var(--bg-input, #14171d); color: var(--text-primary, #e6e6e6); border: 1px solid var(--border, rgba(255,255,255,.14)); border-radius: 8px; padding: 8px 10px; font-size: 13px; }

/* Collections intelligentes (bibliothèque) */
.smart-collections{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}
.smart-collections:empty{display:none}
.sc-chip{display:inline-flex;align-items:center;gap:7px;padding:6px 12px;border-radius:999px;border:1px solid var(--border,#2a2f3a);background:var(--bg-card,transparent);color:var(--text-main,inherit);font-size:12.5px;cursor:pointer;transition:border-color .15s,background .15s}
.sc-chip:hover{border-color:var(--accent,#6c8cff)}
.sc-chip.active{background:var(--accent,#6c8cff);border-color:var(--accent,#6c8cff);color:#fff}
.sc-chip .sc-count{opacity:.7;font-variant-numeric:tabular-nums;font-size:11.5px}
.sc-chip.sc-saved{border-style:dashed}

/* Aperçu PDF d'un devis */
.quote-pdf-modal{width:min(920px,96vw);max-width:none;height:92vh;display:flex;flex-direction:column}
.quote-pdf-body{flex:1;padding:0;min-height:0}
.quote-pdf-frame{width:100%;height:100%;border:0;background:#fff;border-radius:0 0 8px 8px}
.quote-pdf-hint{font-size:11.5px;color:var(--text-muted);padding:6px 14px;text-align:center}

/* Entités MQTT / Home Assistant */
.mqtt-ent-modal{max-width:620px}
.mqtt-ent-head{display:flex;justify-content:space-between;font-size:12.5px;color:var(--text-muted)}
.mqtt-ent-printer{border:1px solid var(--border,#2a2f3a);border-radius:10px;padding:12px;margin-bottom:12px}
.mqtt-ent-ptitle{font-weight:600;margin-bottom:8px}
.mqtt-ent-table{width:100%;border-collapse:collapse;font-size:13px}
.mqtt-ent-table td{padding:5px 0;border-top:1px solid var(--border,#2a2f3a);vertical-align:top}
.mqtt-ent-table td small{display:block;color:var(--text-muted);font-size:10.5px;font-family:monospace}
.mqtt-ent-val{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.mqtt-ent-topics{display:flex;flex-direction:column;gap:3px;margin-top:8px}
.mqtt-ent-topics code{font-size:11px;color:var(--text-muted);word-break:break-all}

/* Devis : modification, facture, remise */
.quote-form-modal{max-width:560px}
.quote-form-body{padding:4px 2px 0}
.quote-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px 12px}
.quote-form-grid .qf-wide{grid-column:1 / -1}
.quote-form-sum{display:flex;flex-direction:column;gap:4px;margin-top:12px;padding:10px 12px;border:1px solid var(--border,#2a2f3a);border-radius:10px;font-size:13px}
.quote-form-sum > div{display:flex;justify-content:space-between}
.quote-form-sum .qf-total{font-size:15px;font-weight:700;border-top:1px solid var(--border,#2a2f3a);padding-top:6px;margin-top:2px}
.quote-form-foot{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.quote-type-badge{display:inline-block;font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;padding:1px 7px;border-radius:999px;background:var(--accent,#6c8cff);color:#fff;vertical-align:middle}
@media (max-width:560px){.quote-form-grid{grid-template-columns:1fr}}

/* Gestion commerciale : statuts, menu d'actions, relances */
.quote-status{font-size:11px;font-weight:600;padding:3px 8px;border-radius:999px;border:1px solid var(--border,#2a2f3a);background:var(--bg-input,transparent);color:var(--text-secondary,#9aa3b2);max-width:120px;flex:0 0 auto}
select.quote-status{cursor:pointer;appearance:auto}
.quote-status.st-paid,.quote-status.st-accepted{color:#2fbf71;border-color:#2fbf71}
.quote-status.st-sent{color:#4d8dff;border-color:#4d8dff}
.quote-status.st-overdue,.quote-status.st-refused{color:#e5484d;border-color:#e5484d}
.quote-history-row{flex-wrap:wrap;gap:8px}
.quote-history-actions{display:flex;gap:2px;flex-wrap:nowrap}
.quote-row-menu{position:fixed;z-index:10050;min-width:210px;background:var(--bg-card,#1b1f2a);border:1px solid var(--border,#2a2f3a);border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.35);padding:4px;display:flex;flex-direction:column}
.quote-row-menu button{display:flex;align-items:center;gap:10px;padding:9px 12px;background:none;border:0;border-radius:8px;color:var(--text-primary,#e8ecf3);font-size:13px;text-align:left;cursor:pointer}
.quote-row-menu button:hover{background:var(--bg-hover,rgba(255,255,255,.07))}
.quote-row-menu button i{width:16px;text-align:center;color:var(--text-secondary,#9aa3b2)}
.quote-overdue-banner{display:flex;align-items:center;gap:8px;margin-bottom:8px;padding:8px 10px;border-radius:8px;background:rgba(229,72,77,.12);color:#e5484d;font-size:12.5px;font-weight:600;cursor:pointer}
.quote-unpaid-line{margin-top:8px;font-size:12px;color:var(--text-secondary,#9aa3b2);text-align:right}
#modal-quote-history .modal-content{max-width:760px;width:94vw}
#modal-clients .modal-content{max-width:620px;width:94vw}

/* Atelier : file de commandes */
#modal-orders .modal-content { max-width: 980px; width: 96vw; }
.order-new { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.order-row { display: flex; gap: 8px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border, rgba(128,128,128,.25)); flex-wrap: wrap; }
.order-row.order-closed { opacity: .55; }
.order-main { flex: 1 1 200px; min-width: 160px; }
.order-qty { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 44px; text-align: center; }
.order-printer { width: 150px; }
.order-due { width: 140px; }
.order-due.order-late { border-color: var(--danger, #e5484d); color: var(--danger, #e5484d); }
.order-bar { height: 4px; border-radius: 2px; background: rgba(128,128,128,.25); margin-top: 6px; overflow: hidden; }
.order-bar span { display: block; height: 100%; background: var(--accent, #4ea1d3); }
.maint-eta { font-size: 11px; color: var(--text-muted); }
.maint-eta.soon { color: var(--warning, #d9a400); }
.order-margin { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.order-margin .margin-pos { color: #38c172; }
.order-margin .margin-neg { color: var(--danger, #e5484d); }

/* Fonctions commerciales désactivées */
body.commercial-off .commercial-only { display: none !important; }

/* Archive G-code d'un projet */
.gcode-archive { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.gcode-archive-title { font-size: 14px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.gcode-archive-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; line-height: 1.5; }
.gcode-item { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.gcode-item-head { display: flex; align-items: center; gap: 8px; }
.gcode-item-head > i { color: var(--accent); }
.gcode-item-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcode-item-size { font-size: 11px; color: var(--text-muted); }
.gcode-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.gcode-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--accent-glow); color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.gcode-notes { width: 100%; box-sizing: border-box; margin-top: 6px; resize: vertical; font-size: 12px; background: var(--bg-secondary, transparent); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-family: inherit; }

/* Imprimante hors ligne */
.printer-card { cursor: pointer; }
.printer-card.is-offline { cursor: default; }
.printer-card.is-offline:hover { transform: none; }
.printer-card.is-offline .printer-action-live { display: none; }
.printer-card-camera.is-offline { background: var(--bg-input) !important; pointer-events: none; }
.printer-offline-logo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 90px; height: 90px; border-radius: 14px; background: rgba(229, 231, 235, 0.92); color: #374151; font-size: 11px; font-weight: 600; opacity: 0.85; }
.printer-card.is-offline:hover { border-color: var(--border); }

.thumb-pause-btn { margin-left: auto; background: transparent; border: 1px solid var(--border); color: var(--text-secondary); border-radius: 6px; width: 24px; height: 22px; padding: 0; font-size: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.thumb-pause-btn:hover { color: var(--text-primary); border-color: var(--accent); }
.thumb-progress.completed .thumb-pause-btn { display: none; }
.thumb-progress.paused .progress-bar { background: #f59e0b; }


/* Recherche par photo */
.photo-search-btn { display:flex; align-items:center; justify-content:center; flex-shrink:0; background:transparent; border:none; color:var(--text-muted); cursor:pointer; padding:4px 6px; border-radius:50%; transition:var(--transition); }
.photo-search-btn:hover { color:var(--accent); background:var(--bg-hover); }
.photo-drop { border:2px dashed var(--border-color, #3a4254); border-radius:14px; padding:22px 14px; text-align:center; cursor:pointer; color:var(--text-muted); transition:var(--transition); }
.photo-drop:hover, .photo-drop.drag { border-color:var(--accent); color:var(--text-primary); }
.photo-drop img { max-width:100%; max-height:200px; border-radius:10px; display:block; margin:0 auto; }
.photo-index-bar { height:8px; background:var(--bg-hover); border-radius:6px; overflow:hidden; }
.photo-index-bar span { display:block; height:100%; background:var(--accent); transition:width .4s; }


/* À propos : partenariat TigerTag */
.about-partner { display:flex; align-items:center; gap:14px; text-align:left; margin-bottom:12px; }
.about-partner-logo { width:52px; height:52px; flex-shrink:0; padding:0; border-radius:0; background:none; border:0; object-fit:contain; }
:root:not([data-theme="light"]) .about-partner-logo { filter: invert(1); }
.about-partner-links { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
.about-link-btn { display:flex; align-items:center; justify-content:center; gap:8px; padding:9px 12px; border-radius:10px; background:var(--bg-input); border:1px solid var(--border-light); color:var(--text-secondary, var(--text-muted)); font-size:13px; font-weight:500; text-decoration:none; transition:var(--transition, all .2s); }
.about-link-btn i { color:var(--accent); }
.about-link-btn:hover { border-color:var(--accent); color:var(--text-primary); background:var(--bg-hover); transform:translateY(-1px); }


/* Page Réparation : en-tête, outils, cartes */
.repair-hero { display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap; margin-bottom:22px; padding:20px 22px; border-radius:var(--radius-lg); background:linear-gradient(135deg, var(--bg-card), var(--bg-tertiary)); border:1px solid var(--border); }
.repair-hero-text h2 { margin:0 0 6px; font-size:22px; display:flex; align-items:center; gap:10px; }
.repair-hero-text h2 i { color:var(--accent); }
.repair-hero-text p { margin:0; color:var(--text-muted); font-size:14px; }
.repair-stats { display:flex; gap:12px; }
.repair-stat { display:flex; flex-direction:column; align-items:center; min-width:96px; padding:10px 16px; border-radius:12px; background:var(--bg-input); border:1px solid var(--border-light); }
.repair-stat strong { font-size:22px; line-height:1.2; }
.repair-stat span { font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; }
.repair-stat.warn strong { color:var(--warning); }
.repair-tools { display:grid; grid-template-columns:repeat(auto-fit, minmax(340px, 1fr)); gap:16px; margin-bottom:26px; align-items:stretch; }
.repair-tools .integrity-panel { margin-bottom:0; }
.repair-tools .integrity-panel-header { flex-wrap:nowrap; align-items:center; }
.repair-tool-icon { width:42px; height:42px; flex-shrink:0; display:flex; align-items:center; justify-content:center; border-radius:12px; background:rgba(78,161,211,.15); color:var(--accent); font-size:18px; }
.repair-tool-text { flex:1; min-width:0; }
.repair-tool-text h3 { margin:0 0 4px; font-size:15px; }
.repair-tool-text .settings-hint { margin:0; }
.repair-tools .integrity-panel-header .btn { flex-shrink:0; }
.repair-analyze-status { margin-top:12px; font-size:13px; display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; }
.repair-analyze-count { color:var(--text-secondary); font-weight:600; }
.repair-analyze-limit { color:var(--text-muted); font-size:12px; }
.repair-analyze-ok { color:var(--success,#22c55e); font-weight:600; }
.repair-section-title { display:flex; align-items:center; gap:8px; font-size:15px; margin:0 0 14px; }
.repair-section-title i { color:var(--warning); }
.repair-section-count { color:var(--text-muted); font-weight:500; }
.repair-card { display:flex; flex-direction:column; }
.repair-info { display:flex; flex-direction:column; flex:1; }
.repair-meta { display:flex; align-items:center; justify-content:space-between; }
.repair-ext { padding:1px 7px; border-radius:5px; background:var(--bg-input); border:1px solid var(--border-light); font-weight:600; letter-spacing:.04em; }
.repair-btn { margin-top:auto; }
@media (max-width:640px) { .repair-tools .integrity-panel-header { flex-wrap:wrap; } .repair-stats { width:100%; } .repair-stat { flex:1; } }


/* Popup Filtres : grille équilibrée 3 colonnes, cartes de même hauteur par ligne */
#modal-filters .modal-content.small { width: min(1000px, 94vw); max-width: 94vw; }
#modal-filters .modal-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
#modal-filters .modal-body > .filter-group { margin: 0 !important; display: flex; flex-direction: column; min-width: 0; }
#modal-filters .modal-body > .filter-group > h3 { margin-top: 0; }
#modal-filters .modal-body > .filter-group .settings-hint, #modal-filters .modal-body > .filter-group .filter-hint { margin-top: auto; padding-top: 8px; }
#modal-filters .modal-body > :nth-child(1) { grid-column: 1 / -1; }
#modal-filters .modal-body > :nth-child(1) .saved-filters-list:empty { display: none; }
#modal-filters .modal-body > :nth-child(8) { grid-column: 1 / -1; }
#modal-filters #filter-tags-modal { display: flex; flex-wrap: wrap; gap: 6px 22px; }
#modal-filters #filter-tags-modal > * { margin: 0 !important; }
#modal-filters .modal-body > :nth-child(2) { display: flex; }
#modal-filters .modal-body > :nth-child(9) { grid-column: 1 / -1; margin: 2px 0 0 !important; display: flex; justify-content: flex-end; gap: 10px; }
#modal-filters .modal-body > :nth-child(9) .btn { flex: 0 0 auto !important; min-width: 170px; }
#modal-filters .saved-filters-list { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 900px) { #modal-filters .modal-body { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { #modal-filters .modal-body { grid-template-columns: 1fr; } #modal-filters .modal-body > :nth-child(n) { grid-column: auto; } #modal-filters .modal-body > :nth-child(1), #modal-filters .modal-body > :nth-child(8), #modal-filters .modal-body > :nth-child(9) { grid-column: 1; } }
#modal-filters .modal-body > :nth-child(2) { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; align-content: start; }
#modal-filters .modal-body > :nth-child(2) > h3 { grid-column: 1 / -1; }
#modal-filters .modal-body { gap: 12px; }
#modal-filters .modal-body > .filter-group { padding: 14px 16px; }
#modal-filters .modal-body > :nth-child(8) { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
#modal-filters .modal-body > :nth-child(8) > h3 { margin: 0 8px 0 0; }
#modal-filters .modal-body > :nth-child(8) #manage-tags-modal-btn { margin: 0 0 0 auto !important; width: auto; }
.repair-tools .integrity-panel { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; }

/* Bandeau de la démo publique */
#demo-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 12px; font-size: 13px; background: var(--accent); color: #fff; text-align: center; }
#demo-banner a { color: #fff; font-weight: 600; text-decoration: underline; white-space: nowrap; }
body.has-demo-banner { padding-top: 32px; }


/* --- v0.9.6 : téléphone, les éléments flottants du bas ne se chevauchent plus ---
   Avant : la pastille « Mode invité », le widget d'impression en cours et le bouton « retour en haut » étaient tous
   posés au même endroit, au-dessus de la barre du bas, et se recouvraient. Ils sont maintenant empilés :
   barre du bas → pastille invité → widget d'impression → bouton « retour en haut ». */
@media (max-width: 860px) {
    :root { --bottom-nav-h: calc(54px + env(safe-area-inset-bottom)); }

    .viewer-banner { left: 12px; bottom: calc(var(--bottom-nav-h) + 8px); }

    .mini-printer-widget {
        right: 12px;
        left: auto;
        bottom: calc(var(--bottom-nav-h) + 10px);
        max-width: calc(100vw - 24px);
    }
    body.role-viewer .mini-printer-widget { bottom: calc(var(--bottom-nav-h) + 46px); }

    .scroll-to-top {
        right: 12px;
        width: 44px;
        height: 44px;
        bottom: calc(var(--bottom-nav-h) + 14px);
    }
    body.has-mini-printer .scroll-to-top { bottom: calc(var(--bottom-nav-h) + 72px); }
    body.role-viewer .scroll-to-top { bottom: calc(var(--bottom-nav-h) + 52px); }
    body.role-viewer.has-mini-printer .scroll-to-top { bottom: calc(var(--bottom-nav-h) + 108px); }

    /* de la place en bas de page pour que le dernier contenu ne passe pas sous ces éléments */
    body.role-viewer .main-content { padding-bottom: calc(var(--bottom-nav-h) + 28px + 36px); }
    body.role-viewer.has-mini-printer .main-content { padding-bottom: calc(var(--bottom-nav-h) + 92px + 36px); }
}
