/* ===================== Système : écran verrouillé, centre de contrôle, barre d'état ===================== */

/* Fond sombre : libellés des icônes en blanc */
#phone.wp-dark .app-icon span { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.45); }
#phone.wp-dark .fold-btn { color: #fff; }

/* Batterie : niveau réel, éclair en charge */
.battery span { transition: width .4s, background .4s; }
.battery.charging::before {
  content: ""; position: absolute; inset: -2px 6px; z-index: 1;
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 2 4 14h6l-1 8 9-12h-6z'/%3E%3C/svg%3E") center/contain no-repeat;
  filter: drop-shadow(0 0 1px rgba(0,0,0,.5));
}
#sbPlane svg { height: 13px; width: 13px; }
.sb-hot { position: absolute; top: 0; right: 0; width: 120px; height: 50px; z-index: 52; cursor: pointer; }
#phone.unfolded .sb-hot { width: 160px; }

/* ---------- Écran verrouillé ---------- */
.lock { position: absolute; inset: 0; z-index: 48; overflow: hidden; color: #fff; }
.lock::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,0) 35%, rgba(0,0,0,.25)); pointer-events: none; }
.lock.hidden { display: none; }
.lock-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 64px 18px 30px; transition: transform .38s cubic-bezier(.2,.8,.2,1), opacity .38s; touch-action: none; user-select: none; }
.lock.unlocking .lock-inner { transform: translateY(-110%) !important; opacity: 0 !important; }
.lock-top { text-align: center; margin-top: 6px; }
.lock-padlock svg { width: 18px; height: 18px; fill: currentColor; opacity: .9; }
.lock-date { font-size: 19px; font-weight: 600; text-transform: capitalize; margin-top: 6px; opacity: .95; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.lock-time { letter-spacing: -2px; margin-top: 2px; text-shadow: 0 2px 18px rgba(0,0,0,.25); font-variant-numeric: tabular-nums; }
.lock-notifs { width: 100%; max-width: 380px; margin-top: auto; display: flex; flex-direction: column; gap: 8px; max-height: 46%; overflow: hidden; }
.lock-notif { display: flex; gap: 10px; padding: 11px 12px; border-radius: 20px; background: rgba(245,245,247,.55); color: #111;
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); cursor: pointer; animation: lnIn .35s ease; }
html.dark .lock-notif { background: rgba(40,40,44,.55); color: #fff; }
.lock-notif .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.lock-notif .ic svg { width: 22px; fill: #fff; }
.ln-main { min-width: 0; flex: 1; }
.ln-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.ln-top span { opacity: .6; font-size: 12px; }
.ln-body { font-size: 14px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes lnIn { from { transform: translateY(16px) scale(.96); opacity: 0; } }
.lock-bottom { width: 100%; display: grid; grid-template-columns: 50px 1fr 50px; align-items: center; gap: 10px; margin-top: 18px; padding: 0 22px; }
.lock-btn { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: rgba(30,30,34,.38);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.lock-btn svg { width: 22px; height: 22px; fill: #fff; }
.lock-btn.on { background: #fff; }
.lock-btn.on svg { fill: #111; }
.lock-hint { text-align: center; font-size: 12px; font-weight: 600; opacity: .85; text-shadow: 0 1px 6px rgba(0,0,0,.3); animation: hint 2.4s ease-in-out infinite; }
@keyframes hint { 50% { transform: translateY(-4px); opacity: .55; } }
.lock.pin .lock-notifs, .lock.pin .lock-bottom { display: none; }
.lock-pin { margin-top: 26px; text-align: center; }
.lock-pin.hidden { display: none; }
.lp-title { font-size: 18px; font-weight: 500; margin-bottom: 14px; }
.lp-dots { display: flex; gap: 18px; justify-content: center; margin-bottom: 26px; }
.lp-dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #fff; transition: background .15s; }
.lp-dots i.on { background: #fff; }
.lp-keys { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px 22px; }
.lp-keys button { width: 76px; height: 76px; border-radius: 50%; font-size: 32px; font-weight: 400; color: #fff;
  background: rgba(255,255,255,.18); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.lp-keys button:active { background: rgba(255,255,255,.45); }
.lp-keys button.ghost { background: none; pointer-events: none; }
.lp-keys button[data-k="⌫"] { background: none; font-size: 24px; }
.lock-pin.shake { animation: shake .42s; }
@keyframes shake { 20%, 60% { transform: translateX(-12px); } 40%, 80% { transform: translateX(12px); } }
#phone.locked .panes, #phone.locked .toasts { visibility: hidden; }
#phone.locked .home-indicator { background: #fff; }

/* ---------- Centre de contrôle ---------- */
.cc { position: absolute; inset: 0; z-index: 60; background: rgba(0,0,0,0); transition: background .25s; }
.cc.open { background: rgba(0,0,0,.28); }
.cc-panel { position: absolute; top: 56px; right: 14px; width: 300px; padding: 14px; border-radius: 28px; color: #fff;
  background: rgba(40,40,46,.62); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6);
  transform: translateY(-14px) scale(.96); transform-origin: top right; opacity: 0; transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.cc.open .cc-panel { transform: none; opacity: 1; }
.cc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cc-tile { aspect-ratio: 1; border-radius: 20px; background: rgba(255,255,255,.14); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; font-size: 11px; font-weight: 600; text-align: center; padding: 6px; }
.cc-tile svg { width: 26px; height: 26px; fill: currentColor; }
.cc-tile.on { background: var(--on, #fff); color: #111; }
.cc-tile.on svg { fill: #111; }
.cc-bat { cursor: default; }
.cc-bat-ring { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#34c759 calc(var(--p) * 1%), rgba(255,255,255,.18) 0); }
.cc-bat-ring b { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: rgba(40,40,46,.95); }
.cc-slider { margin-top: 12px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 20px; background: rgba(255,255,255,.14); }
.cc-slider span svg { width: 20px; height: 20px; fill: #fff; }
.cc-slider input { flex: 1; accent-color: #fff; }
.cc-slider em { font-style: normal; font-size: 12px; opacity: .7; }

/* ---------- Widgets de l'accueil (météo + calendrier) ---------- */
.widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.unfolded-span .widgets { grid-template-columns: repeat(4, 1fr); }
.wdg { border-radius: 22px; padding: 12px 14px; min-height: 150px; cursor: pointer; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.wdg-label { position: absolute; left: 0; right: 0; bottom: -20px; text-align: center; font-size: 12px; }
.wdg-weather { color: #fff; background: linear-gradient(170deg, var(--w1, #4a90e2), var(--w2, #2b5fa8)); box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.wdg-weather .ww-zone { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wdg-weather .ww-temp { font-size: 40px; font-weight: 300; line-height: 1.05; }
.wdg-weather .ww-ic svg { width: 20px; height: 20px; fill: #fff; margin-top: auto; }
.wdg-weather .ww-cond { font-size: 12px; font-weight: 600; margin-top: auto; }
.wdg-weather .ww-hl { font-size: 12px; font-weight: 600; opacity: .9; }
.wdg-cal { background: rgba(255,255,255,.78); color: #1c1c1e; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 6px 18px rgba(0,0,0,.1); padding: 10px 12px; }
html.dark .wdg-cal, #phone.wp-dark .wdg-cal { background: rgba(28,28,30,.72); color: #fff; }
.wc-month { font-size: 10px; font-weight: 700; color: #ff3b30; text-transform: uppercase; text-align: center; }
.wc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; font-size: 9px; text-align: center; margin-top: 4px; font-variant-numeric: tabular-nums; }
.wc-grid b { font-weight: 700; opacity: .5; }
.wc-grid span.today { background: #ff3b30; color: #fff; border-radius: 50%; font-weight: 700; }
.wdg-wrap { position: relative; margin-bottom: 18px; }
.wdg-wrap .wdg-label { position: static; margin-top: 5px; font-weight: 500; color: #1c1c1e; }
#phone.wp-dark .wdg-wrap .wdg-label { color: #fff; }

/* ---------- Météo ---------- */
.wx-app { background: linear-gradient(180deg, var(--w1, #4a90e2), var(--w2, #2b5fa8)) !important; }
.wx { min-height: 100%; color: #fff; padding: 20px 18px 30px; }
.wx-head { text-align: center; }
.wx-zone { font-size: 28px; font-weight: 500; }
.wx-street { font-size: 13px; opacity: .8; }
.wx-temp { font-size: 96px; font-weight: 200; line-height: 1; margin: 4px 0 2px; }
.wx-cond { font-size: 19px; font-weight: 500; }
.wx-hl { font-size: 17px; font-weight: 500; opacity: .95; }
.wx-card { margin-top: 18px; border-radius: 18px; background: rgba(255,255,255,.14); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 12px 14px; }
.wx-card h5 { margin: 0 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; opacity: .7; letter-spacing: .03em; border-bottom: 1px solid rgba(255,255,255,.2); padding-bottom: 8px; }
.wx-hours { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 4px; }
.wx-hours::-webkit-scrollbar { display: none; }
.wx-h { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; flex-shrink: 0; }
.wx-h svg, .wx-d svg { width: 22px; height: 22px; fill: #fff; }
.wx-d { display: grid; grid-template-columns: 70px 30px 36px 1fr 36px; align-items: center; gap: 8px; padding: 8px 0; font-size: 16px; font-weight: 500; border-top: 1px solid rgba(255,255,255,.14); }
.wx-d:first-of-type { border-top: 0; }
.wx-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.2); position: relative; }
.wx-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #8fd3fe, #ffd60a, #ff9f0a); }
.wx-lo { opacity: .6; text-align: right; }
.wx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wx-grid .wx-card { margin-top: 0; }
.wx-big { font-size: 30px; font-weight: 400; }
.unfolded-span .wx { padding-left: 60px; padding-right: 60px; }

/* ---------- Réglages : écran verrouillé ---------- */
.lock-preview { margin: 4px auto 10px; width: 150px; height: 230px; border-radius: 26px; display: flex; flex-direction: column; align-items: center; padding-top: 26px; color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.2); background-size: cover !important; }
.lock-preview .lpv-date { font-size: 9px; font-weight: 600; text-transform: capitalize; }
.lock-preview .lpv-time { transform: scale(.42); transform-origin: top center; white-space: nowrap; }
.font-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px 0; }
.font-picker button { padding: 8px 0; border-radius: 12px; background: var(--fill, rgba(120,120,128,.12)); font-size: 22px; color: var(--text); }
.font-picker button.on { outline: 2px solid var(--accent, #0a84ff); }
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 0; }
.color-picker button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(0,0,0,.08); }
.color-picker button.on { outline: 2px solid var(--accent, #0a84ff); outline-offset: 2px; }
.wall-picker div.wp-photo { display: grid; place-items: center; background: var(--fill, rgba(120,120,128,.16)) !important; }
.wall-picker div.wp-photo svg { width: 26px; fill: var(--text); opacity: .7; }
