/* ============================================================
   Materia OS — Lanceur d'applications + Réglages rapides
   ============================================================ */

/* --- Lanceur --- */
#launcher {
  position: fixed;
  bottom: 88px;
  left: 50%;
  z-index: 8500;
  width: min(640px, 94vw);
  max-height: min(660px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--surface-container) 88%, transparent);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  box-shadow: var(--shadow-5);
  border: 1px solid var(--outline-variant);
  transform: translateX(-50%) translateY(24px) scale(.96);
  transform-origin: bottom center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-m) var(--ease), transform var(--dur-m) var(--ease);
}
#launcher.open {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

.ln-head {
  padding: 22px 26px 6px;
}
.ln-greet { font-size: 21px; font-weight: 350; }
.ln-greet b { font-weight: 650; color: var(--primary); }
.ln-sub { font-size: 13px; color: var(--on-surface-variant); margin-top: 2px; text-transform: capitalize; }

.ln-search-wrap { padding: 14px 22px 6px; }
#ln-search { width: 100%; background: var(--surface-container-high); }

.ln-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 14px 20px 22px;
  align-content: start;
}
.ln-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 14px 6px 12px;
  border-radius: var(--r-m);
  transition: background var(--dur-s) var(--ease);
}
.ln-tile:hover { background: color-mix(in srgb, var(--on-surface) 6%, transparent); }
.ln-tile.hl { background: var(--secondary-container); }
.ln-glyph {
  width: 56px;
  height: 56px;
  border-radius: var(--r-m);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, var(--primary-container));
  color: var(--fg, var(--on-primary-container));
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-s) var(--ease), border-radius var(--dur-m) var(--ease);
}
.ln-tile:hover .ln-glyph { transform: scale(1.08); border-radius: var(--r-l); }
.ln-tile:active .ln-glyph { transform: scale(.94); }
.ln-glyph .material-symbols-rounded { font-size: 30px; }
.ln-label { font-size: 12.5px; font-weight: 550; color: var(--on-surface); }
.ln-cat {
  grid-column: 1 / -1;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--primary);
  padding: 12px 8px 2px;
}
.ln-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--on-surface-variant);
  padding: 30px 0;
  font-size: 13.5px;
}

/* --- Réglages rapides --- */
#quicksettings {
  position: fixed;
  bottom: 88px;
  right: 16px;
  z-index: 8500;
  width: 380px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--surface-container) 90%, transparent);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  box-shadow: var(--shadow-5);
  border: 1px solid var(--outline-variant);
  padding: 20px;
  transform: translateY(20px) scale(.96);
  transform-origin: bottom right;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-m) var(--ease), transform var(--dur-m) var(--ease);
}
#quicksettings.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.qs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.qs-date { font-size: 14px; font-weight: 600; text-transform: capitalize; }

.qs-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.qs-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-l);
  background: var(--surface-container-high);
  color: var(--on-surface);
  text-align: left;
  transition: background var(--dur-m) var(--ease), color var(--dur-m) var(--ease),
              border-radius var(--dur-m) var(--ease);
  overflow: hidden;
}
.qs-tile .material-symbols-rounded { font-size: 22px; flex: none; }
.qs-tile .qs-label { font-size: 13px; font-weight: 600; line-height: 1.25; }
.qs-tile .qs-state { font-size: 11.5px; opacity: .75; font-weight: 450; }
.qs-tile.on {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--r-full);
}

.qs-section {
  margin-top: 18px;
}
.qs-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  margin-bottom: 10px;
}
.qs-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px;
}
.qs-slider-row .material-symbols-rounded { font-size: 21px; color: var(--on-surface-variant); flex: none; }

/* Pastilles d'accent */
.qs-accents { display: flex; gap: 10px; flex-wrap: wrap; }
.accent-chip {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: hsl(var(--h) 55% 55%);
  position: relative;
  transition: transform var(--dur-s) var(--ease), border-radius var(--dur-m) var(--ease);
}
.accent-chip:hover { transform: scale(1.12); }
.accent-chip.sel { border-radius: var(--r-s); }
.accent-chip.sel::after {
  content: "check";
  font-family: "Material Symbols Rounded";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}

/* Choix de fond d'écran */
.qs-walls { display: flex; gap: 10px; }
.wall-chip {
  flex: 1;
  height: 58px;
  border-radius: var(--r-m);
  border: 2px solid transparent;
  overflow: hidden;
  position: relative;
  transition: transform var(--dur-s) var(--ease);
  font-size: 11px;
  font-weight: 600;
  color: var(--on-surface);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
}
.wall-chip:hover { transform: scale(1.04); }
.wall-chip.sel { border-color: var(--primary); }
.wall-chip .wp {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.wall-chip .wp.aurora {
  background:
    radial-gradient(at 25% 25%, hsl(var(--hue) 70% 72%) 0, transparent 60%),
    radial-gradient(at 80% 80%, hsl(calc(var(--hue) + 60) 60% 70%) 0, transparent 60%),
    var(--surface-dim);
}
.wall-chip .wp.mesh {
  background:
    radial-gradient(at 20% 20%, hsl(var(--hue) 65% 75%) 0, transparent 55%),
    radial-gradient(at 80% 15%, hsl(calc(var(--hue) + 70) 60% 76%) 0, transparent 50%),
    radial-gradient(at 75% 85%, hsl(calc(var(--hue) - 50) 55% 72%) 0, transparent 55%),
    var(--surface-dim);
}
.wall-chip .wp.minimal {
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-dim) 100%);
}
.wall-chip .wp.custom { background-size: cover; background-position: center; }
