/* Écran mural — conçu pour 1280×800 (Lenovo Tab M10 FHD Plus). Tout est en rem, mis à l'échelle par app.js. */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: #08090c; color: #eceef3;
  font-family: Inter, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font-family: inherit; color: inherit; background: none; border: 0; outline: 0; cursor: pointer; }
input { font-family: inherit; -webkit-user-select: text; user-select: text; }
svg { width: 100%; height: 100%; display: block; }
.muted { color: #8b90a0; }
.small { font-size: .8rem; }
.label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #8b90a0; }
.hidden { display: none !important; }
.grow { flex: 1; }

/* ================= grille principale ================= */
#app { height: 100%; padding: .75rem; display: flex; flex-direction: column; }
#top { flex: 430; min-height: 0; display: flex; }
#bottom { flex: 334; min-height: 0; display: flex; margin-top: .75rem; }
.card { background: #12141a; border-radius: 1.5rem; padding: 1.15rem 1.25rem; position: relative; overflow: hidden; min-width: 0; }
.ctitle { display: flex; align-items: center; font-size: 1rem; font-weight: 600; color: #c9cdd8; margin-bottom: .6rem; flex-shrink: 0; }

/* ---------- colonne gauche ---------- */
#left { width: 26rem; display: flex; flex-direction: column; margin-right: .75rem; flex-shrink: 0; }
#clockCard { display: flex; align-items: center; padding: 1.1rem 1.1rem 1rem 1.5rem; flex-shrink: 0; }
#clockBox { flex: 1; min-width: 0; }
#clock { font-size: 4.25rem; font-weight: 200; letter-spacing: -.03em; line-height: 1; }
#date { margin-top: .5rem; color: #8b90a0; font-size: .95rem; white-space: nowrap; }
#wMini { display: flex; flex-direction: column; align-items: center; padding: .3rem .5rem; border-radius: .8rem; }
.wrow { display: flex; align-items: center; }
#wIcon { display: block; width: 2.1rem; height: 2.1rem; margin-right: .35rem; color: #ffcf6e; }
#wTemp { font-size: 1.9rem; font-weight: 300; }
#wMinMax { font-size: .75rem; color: #8b90a0; margin-top: .1rem; }
.vsep { width: 1px; height: 4rem; background: #262a34; margin: 0 .7rem 0 .4rem; }
#glass { position: relative; width: 4rem; padding: .5rem 0 .45rem; border-radius: 1rem; background: #1b1e26;
  display: flex; flex-direction: column; align-items: center; }
#glass svg { width: 1.9rem; height: 2.4rem; }
#glassTxt { margin-top: .3rem; font-size: .75rem; font-weight: 600; color: #8b90a0; white-space: nowrap; }
#glass.due #glassTxt { color: #6cb4ff; }
#glass.done #glassTxt { color: #4fd1a5; }
#glass.paused { opacity: .55; }
#glass.due:after { content: ""; position: absolute; left: -3px; top: -3px; right: -3px; bottom: -3px; border-radius: 1.15rem;
  border: 2px solid #6cb4ff; opacity: 0; animation: halo 2.4s ease-in-out infinite; pointer-events: none; }
#glass.due #water { animation: wave 1.6s linear infinite; }
@keyframes halo { 50% { opacity: .55; } }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-20px); } }

/* ---------- tâches ---------- */
#tasksCard { flex: 1; margin-top: .75rem; display: flex; flex-direction: column; padding: 1rem 1.25rem .75rem; }
#tasksCard .ctitle { margin-bottom: .25rem; }
.linkbtn { font-size: 1rem; font-weight: 600; color: #c9cdd8; padding: .3rem 0; }
#tasksCount { margin-left: .5rem; font-weight: 400; font-size: .9rem; }
#tasksDone { margin-left: .4rem; font-weight: 400; }
.sqbtn { margin-left: auto; width: 2.75rem; height: 2.75rem; border-radius: .75rem; background: #1b1e26; padding: .75rem; }
#tasksBox { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.task { width: 100%; min-height: 2.75rem; display: flex; align-items: center; text-align: left; font-size: 1rem; }
.task .box { width: 1.65rem; height: 1.65rem; border-radius: 50%; border: 2px solid #3a3f4d; flex-shrink: 0; margin-right: .9rem;
  display: flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s; }
.task .box svg { width: .9rem; height: .9rem; color: #08090c; opacity: 0; }
.task .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #eceef3; transition: color .2s; }
.task.done .box { background: #4fd1a5; border-color: #4fd1a5; }
.task.done .box svg { opacity: 1; }
.task.done .txt { color: #8b90a0; text-decoration: line-through; }
.task.leaving { opacity: 0; transition: opacity .35s .35s; }
#tasksFade { position: absolute; left: 0; right: 0; bottom: 0; height: 6rem; display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(180deg, rgba(18,20,26,0) 0%, rgba(18,20,26,.85) 55%, #12141a 100%); pointer-events: none; }
#tasksMore { pointer-events: auto; min-height: 2.5rem; padding: 0 1rem; border-radius: 1.25rem; background: #1b1e26; color: #c9cdd8;
  font-size: .875rem; font-weight: 500; display: flex; align-items: center; }
#tasksMore svg { width: .9rem; height: .9rem; margin-left: .4rem; }
.empty { color: #5b6070; font-size: .9rem; line-height: 1.5; padding: .5rem 0; }

/* ---------- musique ---------- */
#music { flex: 1; display: flex; align-items: center; padding: 1.5rem; transition: background 1s; }
#artBox { position: relative; height: 100%; max-height: 18.75rem; width: 18.75rem; max-width: 42%; border-radius: 1rem; overflow: hidden;
  flex-shrink: 0; background: #1b1e26; box-shadow: 0 .8rem 2.5rem rgba(0,0,0,.45); }
#art { width: 100%; height: 100%; object-fit: cover; display: block; }
#artPh { position: absolute; left: 0; top: 0; right: 0; bottom: 0; padding: 30%; color: #3a3f4d; background: linear-gradient(135deg, #222634, #15171e); }
#mInfo { position: relative; flex: 1; min-width: 0; padding-left: 1.75rem; }
#mTitle { font-size: 1.875rem; font-weight: 600; margin-top: .5rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mArtist { font-size: 1.125rem; margin-top: .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mBar { height: .3rem; background: rgba(255,255,255,.12); border-radius: .2rem; margin-top: 1.6rem; overflow: hidden; }
#mFill { height: 100%; width: 0; background: #eceef3; border-radius: .2rem; }
#mTimes { display: flex; justify-content: space-between; margin-top: .4rem; }
#mCtrl { display: flex; align-items: center; justify-content: space-between; margin: 1rem 0 .7rem; }
.ibtn { width: 3.4rem; height: 3.4rem; padding: .85rem; border-radius: 50%; color: #eceef3; }
.ibtn.big { width: 4.75rem; height: 4.75rem; padding: 1.3rem; background: #eceef3; color: #08090c; }
.ibtn.big svg path { fill: currentColor; }
.ibtn.sm { width: 2.8rem; height: 2.8rem; padding: .75rem; color: #8b90a0; }
.ibtn.sm.on { color: #4fd1a5; }
.sm-spacer { width: 2.8rem; }
.ibtn:active, .tile:active, .tpre button:active, #appsBtn:active, .aptile:active, #glass:active { transform: scale(.93); }

/* ---------- curseurs ---------- */
.vrow { display: flex; align-items: center; }
.vic { width: 2.4rem; height: 2.4rem; padding: .45rem; color: #8b90a0; flex-shrink: 0; }
.btnic.on { color: #ff6b6b; }
.vtxt { width: 2.6rem; text-align: right; }
.slider { flex: 1; height: 2.4rem; position: relative; margin-left: .3rem; }
.slider:before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: .45rem; margin-top: -.225rem; background: rgba(255,255,255,.12); border-radius: .3rem; }
.slider .fill { position: absolute; left: 0; top: 50%; height: .45rem; margin-top: -.225rem; width: 0; background: #eceef3; border-radius: .3rem; }
.slider .fill:after { content: ""; position: absolute; right: -.7rem; top: 50%; width: 1.4rem; height: 1.4rem; margin-top: -.7rem; border-radius: 50%; background: #fff; box-shadow: 0 .1rem .4rem rgba(0,0,0,.4); }
.slider.off { opacity: .35; }

/* ---------- bas ---------- */
#lightsCard { width: 29.4rem; flex-shrink: 0; margin-right: .75rem; display: flex; flex-direction: column; }
#pcCard { flex: 1; margin-right: .75rem; display: flex; flex-direction: column; }
#timer { width: 16.9rem; flex-shrink: 0; text-align: center; }
#lights { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; align-content: stretch; margin: -.3rem; }
.light { padding: .3rem; }
.light .in { position: relative; height: 100%; border-radius: 1rem; background: #1b1e26; overflow: hidden; padding: .85rem .95rem; }
.light .lvl { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(255,207,110,.16); }
.light i { position: relative; display: block; width: 1.7rem; height: 1.7rem; color: #5b6070; }
.light .nm { position: relative; display: block; font-size: .95rem; font-weight: 500; margin-top: .45rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.light .st { position: relative; display: block; font-size: .8rem; color: #8b90a0; margin-top: .1rem; }
.light.on .in { background: #2a2620; }
.light.on i { color: #ffcf6e; }
.light.err .st { color: #ff6b6b; }

.dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: #ff6b6b; margin: 0 .45rem 0 .5rem; flex-shrink: 0; }
.dot.ok { background: #4fd1a5; }
#appsBtn { display: flex; align-items: center; margin-top: .6rem; padding: .8rem 1rem; border-radius: 1rem; background: #7c9cff; color: #08090c; text-align: left; flex-shrink: 0; }
#appsBtn b { font-size: 1.05rem; font-weight: 600; margin-left: .85rem; }
#appsHint { margin-left: auto; font-size: .8rem; color: #1e2540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: .8rem; }
.g4 { width: 1.75rem; height: 1.75rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-content: space-between; flex-shrink: 0; }
.g4 i { width: .75rem; height: .75rem; border-radius: .25rem; background: #08090c; }
.pcbtns { display: flex; margin: .6rem -.25rem 0; }
.pcbtns:empty { display: none; }
.tile { flex: 1; margin: 0 .25rem; padding: .65rem .2rem .55rem; border-radius: .9rem; background: #1b1e26; font-size: .75rem; color: #aab0bf; transition: background .2s; min-width: 0; }
.tile i { display: block; width: 1.45rem; height: 1.45rem; margin: 0 auto .3rem; color: #eceef3; }
.tile span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.on { background: #3a1d22; color: #ff9a9a; }
.tile.on i { color: #ff6b6b; }
.tile.confirm { background: #ff6b6b; color: #08090c; }
.tile.confirm i { color: #08090c; }
#pcCard.offline .vrow, #pcCard.offline .pcbtns { opacity: .35; }

#tLabel { justify-content: center; }
#tTime { font-size: 3.25rem; font-weight: 200; letter-spacing: .02em; margin: .4rem 0 1rem; }
.tpre { display: flex; justify-content: center; }
.tpre button { flex: 1; margin: 0 .15rem; min-height: 2.75rem; border-radius: .7rem; background: #1b1e26; font-size: .85rem; color: #c9cdd8; }
.tpre .focus { flex: 1.6; color: #ff8f6b; }
.tctl { display: flex; justify-content: center; align-items: center; margin-top: 1rem; }
.tctl .ibtn { margin: 0 .4rem; }
.tctl .ibtn.big { width: 4rem; height: 4rem; padding: 1.05rem; }
#timer.focus #tLabel, #timer.focus #tTime { color: #ff8f6b; }
#timer.break #tLabel, #timer.break #tTime { color: #4fd1a5; }
#timer.ring { animation: ring 1s infinite; }
@keyframes ring { 50% { background: #3a2a1d; } }

/* ================= fenêtres ================= */
.overlay { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(8,9,12,.72); z-index: 20;
  display: flex; align-items: center; justify-content: center; animation: fadein .18s ease-out; }
.overlay.full { background: #08090c; padding: .75rem; align-items: stretch; }
@keyframes fadein { from { opacity: 0; } }
.sheet { width: 37.5rem; max-height: 44rem; height: auto; background: #12141a; border-radius: 1.75rem; padding: 1.6rem 1.75rem 1.4rem;
  display: flex; flex-direction: column; box-shadow: 0 2rem 5rem rgba(0,0,0,.6); }
.sheet.wide { width: 51rem; height: 45rem; }
.sheet.small { width: 28rem; }
#tasksSheetIn { height: 44rem; }
.shead { display: flex; align-items: center; margin-bottom: 1rem; flex-shrink: 0; }
.stitle { font-size: 1.6rem; font-weight: 600; }
#tsCount { margin-left: .6rem; font-size: 1rem; }
.xbtn { margin-left: auto; width: 3rem; height: 3rem; border-radius: 50%; background: #1b1e26; padding: .9rem; flex-shrink: 0; }
.xbtn.big { width: 3.25rem; height: 3.25rem; margin-left: 1rem; }
.sbody { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sbody .task { min-height: 3.4rem; border-bottom: 1px solid #1f222b; font-size: 1.06rem; }
.sbody .task .txt { white-space: normal; }
.shdr { display: flex; align-items: center; font-size: .875rem; font-weight: 600; color: #8b90a0; margin: 1.1rem 0 .2rem; }
.shdr button { margin-left: auto; font-size: .85rem; color: #ff8f8f; min-height: 2.5rem; padding: 0 .4rem; font-weight: 500; }
.addrow { display: flex; margin-top: 1rem; flex-shrink: 0; }
.addrow input { flex: 1; height: 3.25rem; padding: 0 1rem; border-radius: .9rem; border: 1px solid #2a2d38; background: #08090c; color: #eceef3; font-size: 1.06rem; }
.addbtn { width: 3.25rem; height: 3.25rem; border-radius: 50%; background: #7c9cff; color: #08090c; padding: .9rem; margin-left: .6rem; flex-shrink: 0; }
.sfoot { display: flex; align-items: center; justify-content: flex-end; margin-top: 1.2rem; flex-shrink: 0; }
.btn { min-height: 3rem; padding: 0 1.4rem; border-radius: .9rem; background: #1b1e26; font-size: 1rem; margin-left: .6rem; }
.btn.primary { background: #7c9cff; color: #08090c; font-weight: 600; }
.btn.danger { background: transparent; color: #ff8f8f; margin-left: 0; padding-left: 0; }
.btn.danger-fill { background: #ff6b6b; color: #08090c; font-weight: 600; }
.seg { display: flex; padding: .3rem; border-radius: 1rem; background: #08090c; margin-left: auto; }
.seg button { min-height: 2.75rem; padding: 0 1.3rem; border-radius: .75rem; font-size: .95rem; font-weight: 500; color: #aab0bf; }
.seg button.on { background: #eceef3; color: #08090c; }
.fld { display: block; font-size: .875rem; color: #8b90a0; margin-bottom: 1.1rem; }
.fld input { display: block; width: 100%; height: 3.25rem; margin-top: .5rem; padding: 0 1rem; border-radius: .9rem; border: 1px solid #2a2d38; background: #08090c; color: #eceef3; font-size: 1.06rem; }
.pills { display: flex; margin-top: .5rem; }
.pills button { min-height: 2.75rem; padding: 0 1.15rem; border-radius: .75rem; background: #1b1e26; color: #c9cdd8; font-size: .95rem; margin-right: .5rem; }
.pills button.on { background: #eceef3; color: #08090c; font-weight: 500; }

/* liste des applis du PC */
#addPcList { display: flex; flex-wrap: wrap; margin: .6rem -.3rem 0; }
.pcapp { width: 50%; padding: .3rem; }
.pcapp .in { display: flex; align-items: center; padding: .7rem .85rem; border-radius: 1rem; background: #1b1e26; }
.pcapp .nm { flex: 1; min-width: 0; margin: 0 .8rem; font-size: .95rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw { position: relative; width: 3.25rem; height: 1.9rem; border-radius: 1rem; background: #3a3f4d; flex-shrink: 0; transition: background .2s; }
.sw:after { content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #fff; transition: left .2s; }
.sw.on { background: #4fd1a5; }
.sw.on:after { left: 1.55rem; }
.ico { width: 2.75rem; height: 2.75rem; border-radius: .75rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700; color: #fff; overflow: hidden; }
.ico img { width: 78%; height: 78%; object-fit: contain; }

/* lanceur */
.panel { flex: 1; background: #12141a; border-radius: 1.75rem; padding: 2rem 2.5rem 1.4rem; display: flex; flex-direction: column; }
.phead { display: flex; align-items: center; margin-bottom: 1.75rem; flex-shrink: 0; }
.ptitle { font-size: 2.1rem; font-weight: 600; letter-spacing: -.02em; }
.psub { display: flex; align-items: center; margin-top: .25rem; font-size: .875rem; color: #8b90a0; }
.psub .dot { margin-left: 0; }
#apGrid { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-wrap: wrap; align-content: flex-start; margin: 0 -.5rem; }
.aptile { width: 14.2857%; padding: 0 .5rem 1.75rem; display: flex; flex-direction: column; align-items: center; }
.aptile .ico { width: 6.5rem; height: 6.5rem; border-radius: 1.6rem; font-size: 2.6rem; position: relative; overflow: visible; box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.35); }
.aptile .ico img { width: 62%; height: 62%; }
.aptile .ico.img { background: #1f222b; }
.aptile .gl { position: absolute; right: -.35rem; bottom: -.35rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: #12141a; padding: .4rem; color: #c9cdd8; }
.aptile .nm { margin-top: .75rem; font-size: .95rem; font-weight: 500; color: #c9cdd8; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aptile.add .ico { background: none; border: 2px dashed #3a3f4d; box-shadow: none; color: #8b90a0; padding: 2rem; }
.aptile.add .nm { color: #8b90a0; }
.pfoot { font-size: .8rem; color: #8b90a0; text-align: center; flex-shrink: 0; }

/* météo détaillée */
.wbig { display: flex; align-items: center; margin-right: 1.1rem; }
.wbig i { display: block; width: 3.5rem; height: 3.5rem; color: #ffcf6e; margin-right: .6rem; }
.wbig span { font-size: 3rem; font-weight: 300; }
.wmeta { font-size: .95rem; color: #8b90a0; line-height: 1.9; }
.wmeta b { color: #eceef3; font-weight: 500; }
.wmeta span { display: inline-block; margin-right: 1.4rem; white-space: nowrap; }
.whours { display: flex; margin-top: 1.2rem; }
.whours div { flex: 1; text-align: center; font-size: .85rem; color: #8b90a0; }
.whours i { display: block; width: 1.8rem; height: 1.8rem; margin: .45rem auto; color: #c9cdd8; }
.whours b { color: #eceef3; font-weight: 500; font-size: 1rem; }

/* divers */
#toast { position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%); display: flex; align-items: center; background: #262a34;
  padding: .75rem 1.25rem; border-radius: 1rem; font-size: 1rem; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40;
  box-shadow: 0 .75rem 2.5rem rgba(0,0,0,.5); max-width: 90%; white-space: nowrap; }
#toast.show { opacity: 1; pointer-events: auto; }
#toastAct { margin-left: 1rem; color: #7c9cff; font-weight: 600; font-size: 1rem; min-height: 2.5rem; }
#toastAct:empty { display: none; }
#offline { position: fixed; top: .9rem; left: 50%; transform: translateX(-50%); background: #3a1d22; color: #ff9a9a; padding: .5rem 1rem; border-radius: .7rem; font-size: .85rem; z-index: 30; }
#login { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(8,9,12,.92); display: flex; align-items: center; justify-content: center; z-index: 50; }
#login input { width: 100%; height: 3.25rem; margin: 1rem 0; padding: 0 1rem; border-radius: .9rem; border: 1px solid #2a2d38; background: #08090c; color: #fff; font-size: 1.1rem; }
#login .btn { margin: 0; }

/* tablette tenue en portrait : on empile */
body.portrait #app { overflow-y: auto; display: block; }
body.portrait #top, body.portrait #bottom { display: block; }
body.portrait #left, body.portrait #lightsCard, body.portrait #timer { width: auto; margin-right: 0; }
body.portrait .card { margin-bottom: .75rem; }
body.portrait #tasksCard { height: 20rem; }
body.portrait #music { height: 20rem; }
body.portrait #pcCard { margin-right: 0; }
body.portrait #lights { height: 14rem; }
