body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Style global pour tous les boutons */
button {
    font-family: inherit;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: #fff;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

button:hover {
    filter: brightness(1.1);
}

button:active {
    transform: scale(0.98);
}
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #4f46e5, #111827);
    color: #e5e7eb;
}

.auth-container {
    background: rgba(15, 23, 42, 0.92);
    padding: 2rem 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    width: min(90vw, 380px);
    box-sizing: border-box;
}

.auth-container h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.auth-container h2 {
    margin: 0 0 1.5rem;
    font-size: 1rem;
    font-weight: 400;
    color: #9ca3af;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-form label {
    display: block;
    font-size: 0.85rem;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-top: 0.35rem;
    border-radius: 0.5rem;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    box-sizing: border-box;
}

.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.settings-tab {
    flex: 1 1 0;
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
}

.settings-tab-active {
    background: linear-gradient(to right, rgba(59,130,246,0.95), rgba(14,165,233,0.95));
    border-color: rgba(129,140,248,0.9);
}

.settings-section {
    margin-top: 0.5rem;
}

.settings-form input[type="text"],
.settings-form input[type="password"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    box-sizing: border-box;
}

.settings-form textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
}

.settings-form input[type="url"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
}

.settings-wallpaper-group {
    margin-top: 0.75rem;
}

.wallpaper-preview {
    margin-top: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid #4b5563;
    height: 96px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
}

.wallpaper-preview-label {
    position: absolute;
    left: 0.5rem;
    bottom: 0.35rem;
    font-size: 0.7rem;
    color: #e5e7eb;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.wallpaper-gallery {
    margin-top: 0.75rem;
}

.wallpaper-gallery-subsection + .wallpaper-gallery-subsection {
    margin-top: 1rem;
}

.wallpaper-history-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.wallpaper-history-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.wallpaper-history-card .wallpaper-gallery-item {
    margin: 0;
}

.wallpaper-history-remove {
    width: 100%;
    padding: 0.3rem 0.4rem;
    border-radius: 8px;
    border: 1px solid #4b5563;
    background: rgba(15, 23, 42, 0.8);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #f87171;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.wallpaper-history-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.7);
    color: #fecaca;
}

.wallpaper-history-empty {
    grid-column: 1 / -1;
    padding: 0.6rem;
    border-radius: 0.5rem;
    border: 1px dashed #374151;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
}

.wallpaper-history-inputs {
    display: none;
}

.wallpaper-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.wallpaper-gallery-title {
    font-size: 0.8rem;
    color: #9ca3af;
}

.wallpaper-gallery-search {
    flex: 1 1 auto;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
    font-size: 0.75rem;
}

.wallpaper-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.wallpaper-gallery-item {
    border: none;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #020617;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.wallpaper-gallery-item:hover {
    outline: 1px solid #60a5fa;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.5);
    filter: none;
    transform: none;
}

.wallpaper-gallery-thumb {
    display: block;
    height: 72px;
    background-size: cover;
    background-position: center;
}

.wallpaper-gallery-label {
    display: block;
    padding: 0.15rem 0.3rem;
    font-size: 0.7rem;
    color: #e5e7eb;
    text-align: center;
}

.wallpaper-gallery-item.is-selected {
    outline: 2px solid #22c55e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.5);
}

.wallpaper-gallery-hint {
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: #6b7280;
}

/* Boutons de formulaire : pleine largeur et arrondi pilule */
.auth-form button,
.settings-form button {
    width: 100%;
    margin-top: 0.75rem;
    border-radius: 999px;
    font-weight: 600;
}

/* Surcharge pour les boutons de galerie afin d'éviter l'arrondi en pillule */
.auth-form .wallpaper-gallery-item,
.settings-form .wallpaper-gallery-item {
    width: auto;
    margin-top: 0;
    padding: 0;
    border-radius: 8px;
    background: #020617;
}

.auth-error {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: #fecaca;
    font-size: 0.85rem;
}

.sky-window.sky-window-minimized {
    display: none;
}

.auth-success {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
    font-size: 0.85rem;
}

.auth-alt {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #9ca3af;
}

.auth-alt a {
    color: #60a5fa;
}

.settings-container {
    width: 360px;
}

.settings-form select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid #4b5563;
    background: #020617;
    color: #e5e7eb;
}

.desktop-body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    background: var(--sky-desktop-bg, #020617);
    color: var(--sky-text-color, #e5e7eb);
    position: relative;
}

.desktop-theme-light {
    --sky-desktop-bg: #e5e7eb;
    --sky-text-color: #111827;
}

.desktop-wallpaper {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.desktop-wallpaper-default {
    background: var(--sky-wallpaper-default-bg, radial-gradient(circle at top, #1d4ed8, #020617));
}

.desktop-wallpaper-ocean {
    background: radial-gradient(circle at top, #0ea5e9, #0f172a);
}

.desktop-wallpaper-sunset {
    background: radial-gradient(circle at top, #f97316, #1e293b);
}

.desktop-icons {
    position: relative;
    z-index: 1;
    width: 100%;
    height: calc(100vh - 40px);
}

.desktop-windows {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.sky-window {
    position: absolute;
    min-width: 480px;
    max-width: 720px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    background: var(--sky-window-bg, rgba(15,23,42,0.97));
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border: 1px solid var(--sky-window-border, rgba(148,163,184,0.4));
    overflow: hidden;
    pointer-events: auto;
}

.sky-window-active {
    box-shadow: 0 24px 48px rgba(0,0,0,0.8);
    border-color: var(--sky-window-border-active, rgba(129,140,248,0.9));
}

.sky-window-header {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem 0 0.75rem;
    background: var(--sky-window-header-bg, linear-gradient(to right, rgba(15,23,42,0.98), rgba(30,64,175,0.9)));
    border-bottom: 1px solid rgba(148,163,184,0.4);
    cursor: move;
}

.sky-window-header-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sky-window-title {
    font-size: 0.8rem;
}

.sky-window-minimize {
    border: none;
    border-radius: 999px;
    width: 20px;
    height: 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: rgba(148,163,184,0.9);
    color: white;
    cursor: pointer;
}

.sky-window-minimize:hover {
    filter: brightness(1.1);
    transform: none;
}

.sky-window-close {
    border: none;
    border-radius: 999px;
    width: 20px;
    height: 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: rgba(239,68,68,0.9);
    color: white;
    cursor: pointer;
}

.sky-window-close:hover {
    filter: brightness(1.1);
    transform: none;
}

.sky-window-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0.9rem 0.9rem;
    overflow: auto;
    font-size: 0.85rem;
}

.sky-window-body > * {
    max-width: 100%;
    min-width: 0;
}

/* Contenu applicatif embarqué : comportement homogène */
.sky-window-body .auth-body,
.sky-window-body .settings-body,
.sky-window-body body {
    min-height: auto;
    height: 100%;
    margin: 0;
    display: block;
    background: transparent;
    overflow: hidden;
}

.sky-window-body .auth-container,
.sky-window-body .settings-container {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 100%;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.sky-window-mode-tablet .sky-window-body {
    padding: 0.8rem;
}

.sky-window-mode-mobile .sky-window-body {
    padding: 1rem;
}

.sky-window-resizer {
    position: absolute;
    width: 12px;
    height: 12px;
    right: 4px;
    bottom: 4px;
    cursor: se-resize;
    background: transparent;
}

.desktop-icon {
    position: absolute;
    width: 72px;
    text-align: center;
    cursor: default;
    user-select: none;
}

.desktop-icon-image {
    width: 48px;
    height: 48px;
    margin: 0 auto 4px;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #4f46e5, #22d3ee);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.6);
}

.desktop-icon-size-32 .desktop-icon-image {
    width: 32px;
    height: 32px;
}

.desktop-icon-size-64 .desktop-icon-image {
    width: 64px;
    height: 64px;
}

.desktop-icon-label {
    font-size: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.taskbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40px;
    background: var(--sky-taskbar-bg, rgba(15, 23, 42, 0.9));
    border-top: 1px solid var(--sky-taskbar-border, rgba(148, 163, 184, 0.2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.taskbar-left,
.taskbar-center,
.taskbar-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.taskbar-left {
    flex: 0 0 auto;
}

.taskbar-center {
    flex: 1 1 auto;
    justify-content: center;
}

.taskbar-right {
    flex: 0 0 auto;
}

.taskbar-right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.taskbar-windows {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.taskbar-logo {
    font-size: 0.85rem;
    font-weight: 600;
}

.taskbar-nimbo {
    font-size: 0.78rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.6);
    background: rgba(15,23,42,0.9);
    color: #e5e7eb;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.taskbar-nimbo::before {
    content: "☁";
    font-size: 0.85rem;
}

.taskbar-nimbo-idea {
    background: rgba(234,179,8,0.18);
    border-color: rgba(234,179,8,0.9);
    box-shadow: 0 0 0 1px rgba(234,179,8,0.35);
}

.taskbar-start-button {
    border: none;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(to right, rgba(59,130,246,0.95), rgba(14,165,233,0.95));
    color: #f9fafb;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15,23,42,0.6);
}

.taskbar-start-button::before {
    content: "★";
    font-size: 0.8rem;
}

.taskbar-start-button:hover {
    filter: brightness(1.05);
}

.taskbar-clock {
    border: 1px solid rgba(148,163,184,0.5);
    background: rgba(15,23,42,0.9);
    color: #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.2rem 0.55rem;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
    min-width: 92px;
}

.taskbar-clock:hover {
    filter: brightness(1.08);
}

.taskbar-clock-time {
    font-size: 0.85rem;
    font-weight: 600;
}

.taskbar-clock-date-row {
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
    width: 100%;
    align-self: stretch;
}

.taskbar-clock-events {
    font-size: 0.7rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    text-align: left;
}

.taskbar-clock.has-events-today .taskbar-clock-events {
    opacity: 1;
    color: rgba(34,197,94,0.95);
}

.taskbar-clock-date {
    font-size: 0.7rem;
    opacity: 0.9;
    white-space: nowrap;
    flex: 0 0 auto;
}

.taskbar-calendar-panel {
    position: fixed;
    right: 10px;
    bottom: 50px;
    width: 320px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 90px);
    background: var(--sky-menu-bg, rgba(15, 23, 42, 0.98));
    border: 1px solid var(--sky-menu-border, rgba(148,163,184,0.5));
    border-radius: 0.9rem;
    box-shadow: 0 18px 36px rgba(0,0,0,0.7);
    z-index: 5;
    padding: 0.75rem;
    display: none;
    overflow: auto;
    color: var(--sky-text-color, #e5e7eb);
    box-sizing: border-box;
}

.taskbar-calendar-close-mobile {
    display: none;
}

.taskbar-calendar-panel.is-open {
    display: block;
}

.taskbar-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.taskbar-calendar-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.taskbar-calendar-nav {
    width: 30px;
    height: 30px;
    border-radius: 0.6rem;
    border: 1px solid var(--sky-menu-border, rgba(148,163,184,0.5));
    background: var(--sky-window-bg, rgba(15,23,42,0.9));
    color: var(--sky-text-color, #e5e7eb);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.taskbar-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    opacity: 0.9;
}

.taskbar-calendar-weekdays div {
    text-align: center;
}

.taskbar-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
    margin-bottom: 0.65rem;
}

.taskbar-calendar-day {
    border: 1px solid var(--sky-window-border, rgba(148,163,184,0.35));
    background: var(--sky-window-bg, rgba(15,23,42,0.75));
    color: var(--sky-text-color, #e5e7eb);
    border-radius: 0.6rem;
    height: 34px;
    font-size: 0.78rem;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    font-variant-numeric: tabular-nums;
}

.taskbar-calendar-day.is-muted {
    opacity: 0.45;
}

.taskbar-calendar-day.is-today {
    border-color: rgba(59,130,246,0.95);
    box-shadow: 0 0 0 1px rgba(59,130,246,0.35);
}

.taskbar-calendar-day.is-selected {
    background: rgba(37,99,235,0.55);
    border-color: rgba(129,140,248,0.9);
}

.taskbar-calendar-day.has-events::after {
    content: "";
    position: absolute;
    bottom: 4px;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: rgba(34,211,238,0.95);
}

.taskbar-calendar-events-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.taskbar-calendar-events-list {
    max-height: 110px;
    overflow: auto;
    border: 1px solid var(--sky-window-border, rgba(148,163,184,0.25));
    border-radius: 0.75rem;
    padding: 0.35rem;
    margin-bottom: 0.5rem;
}

.taskbar-calendar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.taskbar-calendar-actions .taskbar-calendar-add,
.taskbar-calendar-actions .taskbar-calendar-import-button {
    height: auto;
    min-height: 32px;
    padding: 0.35rem 0.5rem;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
}

.taskbar-calendar-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.taskbar-calendar-modal.is-open {
    display: flex;
}

.taskbar-calendar-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}

.taskbar-calendar-modal-card {
    position: relative;
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow: auto;
    background: var(--sky-menu-bg, rgba(15, 23, 42, 0.98));
    border: 1px solid var(--sky-menu-border, rgba(148,163,184,0.5));
    border-radius: 0.9rem;
    box-shadow: 0 18px 36px rgba(0,0,0,0.75);
    padding: 0.75rem;
    color: var(--sky-text-color, #e5e7eb);
}

.taskbar-calendar-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.taskbar-calendar-modal-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.taskbar-calendar-event {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    padding: 0.2rem 0.25rem;
    border-radius: 0.5rem;
}

.taskbar-calendar-event-meta {
    min-width: 0;
}

.taskbar-calendar-event-note {
    opacity: 0.85;
    font-size: 0.72rem;
    margin-top: 0.15rem;
    overflow-wrap: anywhere;
}

.taskbar-calendar-event-note a {
    color: rgba(96, 165, 250, 0.95);
    text-decoration: underline;
}

.taskbar-calendar-event-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.taskbar-calendar-event-delete {
    width: 24px;
    height: 24px;
    border-radius: 0.6rem;
    border: 1px solid var(--sky-window-border, rgba(148,163,184,0.5));
    background: var(--sky-window-bg, rgba(15,23,42,0.9));
    color: var(--sky-text-color, #e5e7eb);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.taskbar-calendar-event-delete:hover {
    filter: brightness(1.08);
}

.taskbar-calendar-event-time {
    opacity: 0.9;
    white-space: nowrap;
}

.taskbar-calendar-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.taskbar-calendar-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    min-width: 0;
}

.taskbar-calendar-input {
    height: 32px;
    border-radius: 0.65rem;
    border: 1px solid var(--sky-window-border, rgba(148,163,184,0.5));
    background: var(--sky-window-bg, rgba(15,23,42,0.9));
    color: var(--sky-text-color, #e5e7eb);
    padding: 0 0.5rem;
    font-size: 0.78rem;
    outline: none;
    min-width: 0;
}

.taskbar-calendar-textarea {
    height: auto;
    min-height: 64px;
    padding: 0.45rem 0.5rem;
    line-height: 1.3;
    resize: vertical;
}

.taskbar-calendar-add {
    height: 32px;
    border-radius: 0.65rem;
    border: 1px solid rgba(59,130,246,0.75);
    background: rgba(37,99,235,0.9);
    color: #f9fafb;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    width: 100%;
}

.taskbar-calendar-add:hover {
    filter: brightness(1.05);
}

.taskbar-calendar-import {
    margin-top: 0.55rem;
}

.taskbar-calendar-import-button {
    height: 32px;
    border-radius: 0.65rem;
    border: 1px solid var(--sky-window-border, rgba(148,163,184,0.5));
    background: var(--sky-window-bg, rgba(15,23,42,0.9));
    color: var(--sky-text-color, #e5e7eb);
    cursor: pointer;
    font-size: 0.78rem;
    width: 100%;
}

.taskbar-calendar-import-button:hover {
    filter: brightness(1.08);
}

.taskbar-calendar-import-status {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    opacity: 0.9;
    min-height: 1em;
}

.taskbar-calendar-sync {
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(148,163,184,0.22);
}

.taskbar-calendar-sync-sources {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.taskbar-calendar-sync-source {
    border: 1px solid var(--sky-window-border, rgba(148,163,184,0.25));
    background: var(--sky-window-bg, rgba(15,23,42,0.6));
    border-radius: 0.75rem;
    padding: 0.45rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.taskbar-calendar-sync-source-meta {
    min-width: 0;
}

.taskbar-calendar-sync-source-title {
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.taskbar-calendar-sync-source-subtitle {
    font-size: 0.72rem;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 190px;
}

.taskbar-calendar-sync-source-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.taskbar-calendar-sync-add {
    border: 1px solid var(--sky-window-border, rgba(148,163,184,0.22));
    border-radius: 0.75rem;
    padding: 0.5rem;
    margin-bottom: 0.6rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem;
    align-items: start;
}

.taskbar-calendar-sync-add-panel {
    margin-top: 0;
    grid-column: 1 / -1;
    grid-row: 3;
}

.taskbar-calendar-sync-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.taskbar-calendar-sync-label {
    display: block;
    font-size: 0.72rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    grid-column: 1 / -1;
    grid-row: 1;
}

.taskbar-calendar-sync-panel {
    margin-top: 0.35rem;
    display: none;
}

.taskbar-calendar-sync-panel.is-open {
    display: block;
}

.taskbar-calendar-sync-disabled {
    font-size: 0.75rem;
    opacity: 0.85;
    border: 1px solid var(--sky-window-border, rgba(148,163,184,0.25));
    border-radius: 0.75rem;
    padding: 0.5rem;
}

.taskbar-calendar-sync-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.taskbar-calendar-sync-button {
    height: 32px;
    border-radius: 0.65rem;
    border: 1px solid var(--sky-window-border, rgba(148,163,184,0.5));
    background: var(--sky-window-bg, rgba(15,23,42,0.9));
    color: var(--sky-text-color, #e5e7eb);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
}

.taskbar-calendar-sync-button:hover {
    filter: brightness(1.08);
}

.taskbar-calendar-sync-button.taskbar-calendar-sync-primary {
    border-color: rgba(59,130,246,0.75);
    background: rgba(37,99,235,0.9);
    color: #f9fafb;
}

.taskbar-calendar-sync-status {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    opacity: 0.9;
    min-height: 1em;
}

.taskbar-calendar-export-button {
    display: block;
    margin-top: 0.45rem;
    text-decoration: none;
    text-align: center;
    height: 32px;
    line-height: 32px;
    border-radius: 0.65rem;
    border: 1px solid var(--sky-window-border, rgba(148,163,184,0.5));
    background: var(--sky-window-bg, rgba(15,23,42,0.9));
    color: var(--sky-text-color, #e5e7eb);
    font-size: 0.78rem;
    font-weight: 600;
}

.taskbar-calendar-export-button:hover {
    filter: brightness(1.08);
}

.taskbar-window-button {
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.5);
    background: rgba(15,23,42,0.9);
    color: #e5e7eb;
    cursor: pointer;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taskbar-window-button:hover {
    filter: brightness(1.1);
    transform: none;
}

.taskbar-window-button.taskbar-window-active {
    background: rgba(37,99,235,0.9);
    border-color: rgba(129,140,248,0.9);
}

.taskbar-window-button.taskbar-window-minimized {
    opacity: 0.7;
}

.taskbar-link {
    font-size: 0.8rem;
    color: #e5e7eb;
    text-decoration: none;
    margin-right: 0.5rem;
}

.taskbar-link:hover {
    text-decoration: underline;
}

.taskbar-logout {
    font-size: 0.8rem;
    color: #e5e7eb;
    text-decoration: none;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.taskbar-logout:hover {
    background: rgba(148, 163, 184, 0.2);
}

.start-menu {
    position: fixed;
    left: 8px;
    bottom: 48px;
    width: 220px;
    background: var(--sky-menu-bg, rgba(15, 23, 42, 0.98));
    border-radius: 0.75rem;
    box-shadow: 0 18px 36px rgba(0,0,0,0.7);
    border: 1px solid var(--sky-menu-border, rgba(148,163,184,0.5));
    padding: 0.5rem 0;
    z-index: 3;
    display: none;
}

.start-menu.start-menu-open {
    display: block;
}

.start-menu-section {
    padding: 0.25rem 0;
}

.start-menu-section {
    padding: 0.25rem 0;
}

.start-menu-close {
    display: none;
}

.start-menu-section-bottom {
    border-top: 1px solid rgba(55,65,81,0.8);
    margin-top: 0.25rem;
}

.start-menu-item {
    width: 100%;
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: 0;
    background: transparent;
    text-align: left;
    font-size: 0.8rem;
    color: var(--sky-text-color, #e5e7eb);
    cursor: pointer;
    display: block;
}

.start-menu-item:hover {
    background: var(--sky-menu-item-hover-bg, rgba(55,65,81,0.9));
    filter: none;
    transform: none;
}

.start-menu-item.start-menu-skyhome {
    display: none;
}

.start-menu-skyhome-icon {
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.start-menu-logout {
    text-decoration: none;
}

.desktop-context-menu {
    position: fixed;
    min-width: 180px;
    background: var(--sky-menu-bg, rgba(15,23,42,0.98));
    border-radius: 0.5rem;
    border: 1px solid var(--sky-menu-border, rgba(148,163,184,0.5));
    box-shadow: 0 18px 36px rgba(0,0,0,0.7);
    padding: 0.25rem 0;
    z-index: 4;
    display: none;
}

.desktop-context-menu.desktop-context-menu-open {
    display: block;
}

.desktop-context-item {
    width: 100%;
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: 0;
    background: transparent;
    text-align: left;
    font-size: 0.8rem;
    color: var(--sky-text-color, #e5e7eb);
    cursor: pointer;
}

.desktop-context-item:hover {
    background: var(--sky-menu-item-hover-bg, rgba(55,65,81,0.9));
    filter: none;
    transform: none;
}

/* --- Bouton Plein Écran --- */
.fullscreen-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 0.5rem;
    color: var(--sky-text-color, #e5e7eb);
    cursor: pointer;
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity 0.3s ease, background 0.2s ease, transform 0.15s ease;
    opacity: 0.7;
}

.fullscreen-toggle:hover {
    opacity: 1;
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(148, 163, 184, 0.5);
    transform: scale(1.05);
}

.fullscreen-toggle:active {
    transform: scale(0.95);
}

.fullscreen-toggle.fullscreen-toggle-hidden {
    opacity: 0;
    pointer-events: none;
}

.fullscreen-icon {
    position: absolute;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.fullscreen-icon-expand {
    opacity: 1;
    transform: scale(1);
}

.fullscreen-icon-compress {
    opacity: 0;
    transform: scale(0.8);
}

body.fullscreen-active .fullscreen-icon-expand {
    opacity: 0;
    transform: scale(0.8);
}

body.fullscreen-active .fullscreen-icon-compress {
    opacity: 1;
    transform: scale(1);
}

/* --- Mobile / Android Launcher Mode --- */

/* Widget Horloge Mobile (caché par défaut sur Desktop) */
.mobile-clock-widget {
    display: none;
}

@media (max-width: 768px) {
    /* Layout global */
    .desktop-body {
        overflow: hidden; /* Pas de scroll sur le body */
        height: 100vh; /* Viewport height fixe */
        height: 100dvh; /* Dynamic viewport height pour mobile */
        display: flex;
        flex-direction: column;
    }

    .desktop-wallpaper {
        position: fixed; /* Reste fixe en background */
    }

    /* 1. Widget Horloge style Android - Fixe en haut */
    .mobile-clock-widget {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8vh 1rem 2vh;
        color: #fff;
        text-shadow: 0 2px 4px rgba(0,0,0,0.5);
        pointer-events: auto; /* Rendre cliquable */
        cursor: pointer;
        width: 100%;
        flex-shrink: 0; /* Ne pas rétrécir */
        transition: transform 0.2s ease, opacity 0.2s ease;
        z-index: 3;
    }

    .mobile-clock-widget:active {
        transform: scale(0.98);
        opacity: 0.8;
    }

    .mobile-clock-time {
        font-size: 4.5rem;
        font-weight: 200;
        line-height: 1;
        letter-spacing: -2px;
    }

    .mobile-clock-date {
        font-size: 1.1rem;
        margin-top: 0.2rem;
        opacity: 0.9;
        font-weight: 400;
        text-transform: capitalize;
    }

    /* 2. Conteneur de pages horizontales (style Android) */
    .desktop-icons {
        flex: 1;
        overflow-x: auto;
        overflow-y: hidden;
        display: flex;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
        position: relative;
        z-index: 1;
    }
    
    .desktop-icons::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    /* Chaque page d'icônes */
    .desktop-icons-page {
        flex: 0 0 100%;
        width: 100%;
        scroll-snap-align: start;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(5, auto); /* 5 rangées max par page */
        gap: 1.5rem 0.5rem;
        padding: 1rem;
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
        justify-items: center;
        align-content: start;
    }
    
    /* Indicateurs de page (dots) */
    .mobile-page-indicators {
        display: none;
        position: fixed;
        bottom: calc(90px + env(safe-area-inset-bottom, 0px));
        left: 50%;
        transform: translateX(-50%);
        z-index: 10;
        gap: 8px;
        padding: 8px 12px;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 20px;
        backdrop-filter: blur(10px);
    }
    
    .mobile-page-indicators.visible {
        display: flex;
    }
    
    .mobile-page-indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.4);
        transition: all 0.3s ease;
    }
    
    .mobile-page-indicator.active {
        background: rgba(255, 255, 255, 0.9);
        width: 24px;
        border-radius: 4px;
    }

    .desktop-icon {
        position: relative !important; /* Force relative pour la grille */
        top: auto !important;
        left: auto !important;
        width: auto;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .desktop-icon-image {
        width: 52px; /* Taille icône mobile standard */
        height: 52px;
        margin-bottom: 6px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    
    .desktop-icon-label {
        font-size: 0.8rem;
        text-shadow: 0 1px 3px rgba(0,0,0,0.8);
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.2;
    }

    /* 3. Taskbar transformée en Dock flottant */
    .taskbar {
        position: fixed;
        bottom: 1.5rem;
        left: 1.5rem;
        right: 1.5rem;
        width: auto;
        height: auto;
        padding: 0.75rem 1rem;
        background: rgba(15, 23, 42, 0.45); /* Très translucide comme iOS/Android */
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 28px; /* Arrondi dock */
        justify-content: space-around; /* Espacer les éléments */
        box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    }

    body.sky-window-open-mobile .taskbar {
        display: none !important;
    }

    .taskbar-left {
        gap: 0;
        width: 100%;
        justify-content: space-around;
        display: flex;
    }

    /* Cacher l'horloge taskbar et les infos desktop inutiles */
    .taskbar-right, 
    .taskbar-windows,
    .taskbar-logo {
        display: none !important;
    }

    /* Adaptation des boutons du dock */
    .taskbar-start-button,
    .taskbar-nimbo {
        width: 50px;
        height: 50px;
        padding: 0;
        border-radius: 50%; /* Boutons ronds */
        font-size: 0; /* Cacher le texte */
        justify-content: center;
        background: rgba(255,255,255,0.1);
        border: none;
        box-shadow: none;
        margin: 0;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    .taskbar-start-button:active,
    .taskbar-nimbo:active {
        transform: scale(0.9);
    }

    /* Icônes dans les boutons ronds */
    .taskbar-start-button::before {
        content: "⋮⋮⋮"; /* Grille d'apps */
        font-size: 1.8rem;
        line-height: 1;
        letter-spacing: -2px;
        margin-left: -2px;
    }
    
    .taskbar-nimbo::before {
        font-size: 1.8rem;
        margin: 0;
    }
    
    /* Bouton Start (App Drawer) distinctif */
    .taskbar-start-button {
        background: rgba(255, 255, 255, 0.15);
        color: white;
    }

    /* 4. Fenêtres adaptatives */
    .sky-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0;
        border: none;
        display: flex;
        flex-direction: column;
        z-index: 100 !important; /* Au-dessus de tout */
        animation: slideUpWindow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        padding-top: 64px; /* Espace pour le bouton fullscreen (44px + 20px marge) */
    }
    
    @keyframes slideUpWindow {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .sky-window.sky-window-minimized {
        display: none !important;
    }

    .sky-window-header {
        padding: 0 1rem;
        height: 56px; /* Header plus haut pour le tactile */
        background: rgba(15, 23, 42, 0.95);
    }

    .sky-window-title {
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .sky-window-header-buttons {
        gap: 0.5rem;
    }

    .sky-window-minimize {
        display: none; /* Pas de minimisation facile en mode mobile 'focus' */
    }
    
    .sky-window-close {
        width: 36px;
        height: 36px;
        font-size: 1.4rem;
        background: transparent;
        color: #ef4444;
        border: 1px solid rgba(239, 68, 68, 0.3);
    }

    .sky-window-body {
        flex: 1;
        max-height: none;
        padding: 1rem;
        -webkit-overflow-scrolling: touch;
        background: var(--sky-window-bg, #0f172a);
    }

    .sky-window-resizer {
        display: none;
    }

    /* 5. Modales et Menus */
    .start-menu {
        bottom: 0;
        left: 0;
        width: 100%;
        height: 80vh; /* Drawer partiel */
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        display: flex !important; /* Toujours dans le DOM mais caché par transform */
        flex-direction: column;
        border-bottom: none;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    }

    .start-menu.start-menu-open {
        transform: translateY(0);
        display: flex !important;
    }
    
    .start-menu-section.start-menu-section-apps {
        flex: 1;
        overflow-y: auto;
        padding: 0.75rem 1rem 1rem;
        display: block;
    }
    
    .start-menu-item {
        display: block;
        width: 100%;
        text-align: left;
        white-space: normal;
        margin: 0 0 0.65rem;
        background: rgba(255,255,255,0.05);
        border-radius: 12px;
        padding: 0.9rem 0.75rem;
        box-sizing: border-box;
    }
    
    .start-menu-section-bottom {
        padding: 0.75rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
        background: rgba(0,0,0,0.25);
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
        margin-top: auto;
        width: 100%;
        box-sizing: border-box;
    }
    
    .start-menu-section-bottom .start-menu-item {
        display: block;
        text-align: center;
        padding: 0.95rem;
        background: rgba(239, 68, 68, 0.12);
        color: #fca5a5;
        border: 1px solid rgba(239, 68, 68, 0.25);
        margin: 0;
    }
    
    .start-menu-section-bottom .start-menu-item.start-menu-exit {
        background: rgba(148, 163, 184, 0.2);
        border-color: rgba(148, 163, 184, 0.45);
        color: #e2e8f0;
    }

    .start-menu-item.start-menu-skyhome {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.45rem;
        background: rgba(59, 130, 246, 0.2);
        border: 1px solid rgba(59, 130, 246, 0.45);
        color: #bfdbfe;
        border-radius: 12px;
        font-weight: 600;
    }

    .start-menu-skyhome-icon {
        font-size: 0.95rem;
        color: currentColor;
        display: inline-flex;
        align-items: center;
        line-height: 1;
    }

    .taskbar-calendar-panel {
        position: fixed;
        inset: 0; /* Plein écran */
        width: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        z-index: 200;
        display: none;
        flex-direction: column;
        padding: 1rem;
        padding-top: 3rem; /* Espace pour fermer en haut éventuellement */
    }

        .taskbar-calendar-panel.is-open {
            display: flex;
        }

        .taskbar-calendar-close-mobile {
            display: block;
            width: 100%;
            padding: 0.95rem;
            background: rgba(59, 130, 246, 0.15);
            border: 1px solid rgba(59, 130, 246, 0.4);
            color: #93c5fd;
            border-radius: 12px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            margin-top: 0.6rem;
            text-align: center;
            grid-column: 1 / -1;
        }

        .taskbar-calendar-close-mobile:hover {
            background: rgba(59, 130, 246, 0.25);
            filter: brightness(1.05);
        }
        
        /* Login / Settings responsive */
        .auth-container, .settings-container {
            width: 90%;
            max-width: 400px;
            padding: 1.5rem;
        }
    
    /* Login / Settings responsive */
    .auth-container, .settings-container {
        width: 90%;
        max-width: 400px;
        padding: 1.5rem;
    }

    /* Adapter les menus contextuels pour mobile (bottom sheet) */
    .desktop-context-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        min-width: 0;
        max-height: 70vh;
        border-radius: 20px 20px 0 0;
        padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom, 0px));
        z-index: 150;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    }

    .desktop-context-menu.desktop-context-menu-open {
        display: block;
        transform: translateY(0);
    }

    .desktop-context-menu::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .desktop-context-menu.desktop-context-menu-open::before {
        opacity: 1;
        pointer-events: auto;
    }

    .desktop-context-item {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-bottom: 1px solid rgba(55, 65, 81, 0.3);
        background: transparent;
        transition: background 0.15s ease;
    }

    .desktop-context-item:last-child {
        border-bottom: none;
    }

    .desktop-context-item:active {
        background: rgba(55, 65, 81, 0.6);
    }
    
    /* Ajustement des formulaires */
    .settings-form input, 
    .settings-form select,
    .settings-form textarea {
        font-size: 16px; /* Évite le zoom auto sur iOS */
    }
}
