/* Layout : une colonne sur téléphone, grille de cartes sur tablette et ordinateur. Un seul gros bouton par carte. */
:root {
  --bg: #F6F5F1; --card: #FFFFFF; --ink: #1D1F1C; --muted: #6E726B; --line: #E6E4DD;
  --go: #0F6B5A; --go-ink: #FFFFFF; --go-soft: #E3F1EC;
  --run: #C26A00; --run-soft: #FFF3DF; --done: #2F7D4F; --done-soft: #EAF5EE; --warn: #B5461B; --warn-soft: #FCEBE3;
  --shadow: 0 1px 2px rgba(29,31,28,.06), 0 4px 14px rgba(29,31,28,.05);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #121412; --card: #1C1F1C; --ink: #F0F1EC; --muted: #A1A69E; --line: #2C302C;
  --go: #3FB797; --go-ink: #07211B; --go-soft: #173229;
  --run: #F5A93F; --run-soft: #362812; --done: #66CC8F; --done-soft: #16301F; --warn: #F08C63; --warn-soft: #3A2017;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #121412; --card: #1C1F1C; --ink: #F0F1EC; --muted: #A1A69E; --line: #2C302C;
  --go: #3FB797; --go-ink: #07211B; --go-soft: #173229;
  --run: #F5A93F; --run-soft: #362812; --done: #66CC8F; --done-soft: #16301F; --warn: #F08C63; --warn-soft: #3A2017;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-weight: 500; font-size: 17px; line-height: 1.4; font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--go); outline-offset: 2px; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.wrap { max-width: 1280px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* en-tête */
header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); }
header .wrap { padding-block: 14px 12px; display: grid; gap: 12px; }
.top { display: flex; align-items: center; gap: 12px; }
.title { min-width: 0; flex: 1; }
.title h1 { margin: 0; font-size: clamp(1.3rem, 3.2vw + .6rem, 1.7rem); font-weight: 800; letter-spacing: -.01em; line-height: 1.1; text-wrap: balance; }
.title p { margin: 2px 0 0; color: var(--muted); font-size: .95rem; }
.who { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px 0 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 700; }
.who .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--go); color: var(--go-ink); font-size: .85rem; font-weight: 800; }
.who .av.none { background: var(--line); color: var(--muted); }
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 0 0 auto; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg .sep { flex: 0 0 1px; background: var(--line); margin: 6px 4px; }
.prog { display: flex; align-items: center; gap: 12px; }
.bar { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; transition: width .4s ease; }
.bar .d { background: var(--done); } .bar .r { background: var(--run); }
.prog span { font-weight: 700; white-space: nowrap; font-size: .95rem; }

/* contenu */
main .wrap { padding-block: 8px 64px; display: grid; gap: 28px; }
.alarm { border-radius: 18px; padding: 18px 20px; display: grid; gap: 12px; background: var(--warn); color: #FFFFFF; animation: clignote 1s ease-in-out infinite alternate; }
@keyframes clignote { from { background: var(--warn); } to { background: var(--run); } }
.alarm h2 { margin: 0; color: inherit; font-size: 1.5rem; letter-spacing: 0; text-transform: none; font-weight: 800; }
.alarm .it { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: rgba(255,255,255,.16); border-radius: 14px; padding: 10px 14px; }
.alarm .it b { font-size: 1.2rem; flex: 1; min-width: 180px; } .alarm .it span { font-weight: 700; }
.alarm .vu { height: 52px; padding: 0 22px; border-radius: 12px; border: 0; background: #FFFFFF; color: #1D1F1C; font-weight: 800; font-size: 1.05rem; }
.sonbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--card); border: 2px dashed var(--run); border-radius: 16px; padding: 12px 16px; font-weight: 600; }
.sonbar.on { border-style: solid; border-color: var(--done); color: var(--done); }
@media (prefers-reduced-motion: reduce) { .alarm { animation: none; } }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 16px; padding: 14px 18px; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty b { display: block; color: var(--ink); font-size: 1.2rem; margin-bottom: 6px; }
h2 { margin: 0 0 12px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card { background: var(--card); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; border: 2px solid transparent; min-width: 0; }
.card.run { border-color: var(--run); background: var(--run-soft); }
.card.paused { border-color: var(--line); }
.card.done { background: var(--done-soft); box-shadow: none; }
.card-h { display: flex; gap: 12px; align-items: flex-start; }
.card-h .t { flex: 1; min-width: 0; }
.name { font-size: 1.2rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.big { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.big b { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
.big span { color: var(--muted); font-weight: 600; }
.sub { color: var(--muted); font-size: .92rem; margin-top: 2px; }
.check { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: var(--done); color: var(--card); font-weight: 800; }
.more { align-self: flex-start; background: none; border: 0; padding: 4px 0; color: var(--go); font-weight: 700; font-size: .92rem; }
.ing { margin: 0; padding: 12px 14px; list-style: none; background: var(--bg); border-radius: 12px; display: grid; gap: 4px; font-size: .95rem; }
.timer { font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; color: var(--run); }
.card.paused .timer { color: var(--muted); }
.meta { color: var(--muted); font-size: .92rem; font-weight: 600; }
.card.done .meta { color: var(--done); }
.acts { display: flex; gap: 10px; }
.btn { flex: 1; height: 60px; border-radius: 16px; border: 0; font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn.go { background: var(--go); color: var(--go-ink); }
.btn.stop { background: var(--ink); color: var(--bg); }
.btn.soft { flex: 0 0 auto; padding: 0 20px; background: transparent; border: 2px solid var(--line); color: var(--ink); }
.btn.link { flex: 0 0 auto; height: 40px; padding: 0; background: none; color: var(--muted); font-size: .92rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ico { width: 0; height: 0; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent currentColor; }
.sq { width: 15px; height: 15px; border-radius: 3px; background: currentColor; }

.clock { font-size: 1.5rem; font-weight: 800; color: var(--muted); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { height: 60px; padding: 0 22px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg); font-weight: 700; font-size: 1.15rem; }
.chip.last { border-color: var(--go); background: var(--go-soft); }
.note { width: 100%; height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); padding: 0 14px; font-size: 1rem; }
.sheet .field input.nom { font-size: 1.3rem; height: 56px; }
/* tableau des tâches */
.tbl { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.tbl table { width: 100%; border-collapse: collapse; table-layout: auto; }
.tbl th { text-align: left; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 16px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl .grp td { background: var(--bg); padding: 10px 16px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tbl .grp td span { float: right; letter-spacing: 0; text-transform: none; font-weight: 600; }
.tbl tr.run td { background: var(--run-soft); }
.tbl tr.paused td { background: var(--run-soft); opacity: .85; }
.tbl tr.done td { background: var(--done-soft); }
.tbl tr.run td:first-child { box-shadow: inset 5px 0 0 var(--run); }
.tbl tr.done td:first-child { box-shadow: inset 5px 0 0 var(--done); }
.tn { font-weight: 700; font-size: 1.05rem; }
.tn small { display: block; color: var(--muted); font-weight: 600; font-size: .85rem; margin-top: 2px; }
.qv b { font-size: 1.2rem; font-weight: 800; }
.qv span { color: var(--muted); font-weight: 600; margin-left: 4px; }
.qv small { display: block; color: var(--muted); font-weight: 600; font-size: .85rem; }
.tps { white-space: nowrap; }
.tps .clk { font-size: 1.25rem; font-weight: 800; color: var(--run); }
tr.paused .clk { color: var(--muted); }
.tps small { display: block; color: var(--muted); font-weight: 600; font-size: .82rem; }
tr.done .tps b { color: var(--done); font-weight: 800; font-size: 1.1rem; }
.act { text-align: right; white-space: nowrap; width: 1%; }
.act .in { display: inline-flex; gap: 8px; }
.tb { height: 48px; padding: 0 18px; border-radius: 12px; border: 0; font-weight: 700; font-size: 1rem; display: inline-flex; align-items: center; gap: 8px; }
.tb.go { background: var(--go); color: var(--go-ink); }
.tb.stop { background: var(--ink); color: var(--bg); }
.tb.soft { background: transparent; border: 2px solid var(--line); }
.tb.link { background: none; color: var(--muted); padding: 0 6px; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.tb .ico { border-width: 7px 0 7px 11px; } .tb .sq { width: 12px; height: 12px; }
.ingb { background: none; border: 0; padding: 0; color: var(--go); font-weight: 700; font-size: .85rem; margin-top: 4px; }
.ingl { color: var(--muted); font-size: .88rem; font-weight: 500; margin-top: 6px; line-height: 1.5; }
.col-mag { white-space: nowrap; }
@media (max-width: 760px) {
  .col-mag { display: none; }
  .tbl td, .tbl th { padding-left: 12px; padding-right: 12px; }
  .tb { height: 52px; padding: 0 14px; }
  .tb .lbl { display: none; }
  .tb.go .lbl, .tb.stop .lbl { display: inline; }
  .tb.soft .lbl { display: inline; }
}
@media (max-width: 520px) {
  .tbl thead { display: none; }
  .tbl tr.task { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n q" "t a"; border-bottom: 1px solid var(--line); }
  .tbl tr.task td { border-bottom: 0; padding: 10px 14px; }
  .tbl tr.task td.c-n { grid-area: n; padding-bottom: 2px; }
  .tbl tr.task td.c-q { grid-area: q; padding-bottom: 2px; }
  .tbl tr.task td.c-t { grid-area: t; align-self: center; padding-top: 4px; }
  .tbl tr.task td.c-a { grid-area: a; padding-top: 4px; }
  .tbl tr.grp { display: block; } .tbl tr.grp td { display: block; }
}
.tn small.mag-m { display: none; }
@media (max-width: 760px) { .tn small.mag-m { display: block; } }

/* Une page par journée (tablette et ordinateur) : deux colonnes, tout tient à l'écran sans défiler */
@media (min-width: 900px) {
  header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-block: 10px; }
  header .top { flex: 0 1 auto; }
  header .seg { flex: 1 1 auto; justify-content: flex-end; }
  header .prog { flex: 0 0 230px; order: 3; }
  header .clock { font-size: 1.3rem; }
  .title h1 { font-size: 1.4rem; } .title p { font-size: .88rem; }
  main .wrap.une { padding-block: 4px 12px; gap: 12px; max-width: none; }
}
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.duo .col { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.duo .g { display: flex; justify-content: space-between; align-items: center; height: 30px; padding: 0 14px; background: var(--bg); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); }
.duo .g:first-child { border-top: 0; }
.duo .g span:last-child { letter-spacing: 0; }
.duo .r { display: grid; grid-template-columns: minmax(0, 1fr) 84px 76px 204px; align-items: center; gap: 4px 12px; min-height: var(--rh, 46px); padding: 3px 8px 3px 12px; border-top: 1px solid var(--line); }
.duo .g + .r { border-top: 0; }
.duo .r .n { min-width: 0; font-weight: 700; font-size: 1.02rem; line-height: 1.2; overflow-wrap: anywhere; }
.duo .r .n small { display: block; color: var(--muted); font-weight: 600; font-size: .8rem; white-space: nowrap; }
.duo .r .n .ingb { display: block; margin: 0; font-size: .8rem; }
.duo .r .ingl { grid-column: 1 / -1; margin: 0 0 4px; }
.duo .r .q { text-align: right; white-space: nowrap; font-weight: 800; font-size: 1.1rem; }
.duo .r .q span { color: var(--muted); font-weight: 600; font-size: .8rem; margin-left: 3px; }
.duo .r .t { text-align: right; white-space: nowrap; font-size: .82rem; color: var(--muted); font-weight: 600; line-height: 1.15; }
.duo .r .t .clk { display: block; font-size: 1.15rem; font-weight: 800; color: var(--run); }
.duo .r .t b { display: block; color: var(--done); font-weight: 800; font-size: 1rem; }
.duo .r.run, .duo .r.paused { background: var(--run-soft); box-shadow: inset 5px 0 0 var(--run); }
.duo .r.paused .clk { color: var(--muted); }
.duo .r.done { background: var(--done-soft); box-shadow: inset 5px 0 0 var(--done); }
.duo .r .a { display: flex; gap: 6px; justify-content: flex-end; }
.duo .r .a .tb { flex: 1; justify-content: center; }
.duo .r .a .tb.soft { flex: 0 0 auto; min-width: 64px; padding: 0 10px; justify-content: center; }
.duo .r .a .tb.stop { padding: 0 8px; }
.duo .r .a .tb.link { flex: 0 0 auto; }
.duo .tb { height: calc(var(--rh, 46px) - 8px); min-height: 38px; max-height: 50px; padding: 0 14px; font-size: .95rem; }
.duo .tb.soft { padding: 0 10px; }
.duo .lbc { display: none; }
@media (max-width: 1150px) {
  .duo .r { grid-template-columns: minmax(0, 1fr) 66px 58px 112px; gap: 4px 8px; padding-left: 10px; }
  .duo .r .n { font-size: .95rem; } .duo .r .q { font-size: 1rem; } .duo .r .q span { display: block; margin: 0; font-size: .72rem; line-height: 1; }
  .duo .r .t { font-size: .74rem; } .duo .r .t .clk { font-size: 1.05rem; }
  .duo .lbl { display: none; } .duo .lbc { display: inline; }
  .duo .r .a .tb.soft { flex: 0 0 44px; }
  .duo { gap: 10px; }
}

details.fin > summary { list-style: none; cursor: pointer; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 0 12px; }
details.fin > summary::-webkit-details-marker { display: none; }

/* résumé */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--card); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow); }
.kpi small { color: var(--muted); font-weight: 600; display: block; }
.kpi b { font-size: 1.7rem; font-weight: 800; }
.rows { display: grid; gap: 10px; }
.rowc { background: var(--card); border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; }
.rowc .n { font-weight: 700; }
.rowc .d { font-size: 1.3rem; font-weight: 800; text-align: right; }
.rowc .s { color: var(--muted); font-size: .9rem; }
.rowc .r { color: var(--go); font-weight: 700; font-size: .9rem; text-align: right; }

/* feuille du bas */
.scrim { position: fixed; inset: 0; background: rgba(10,12,10,.45); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; background: var(--card); border-radius: 24px 24px 0 0; padding: 24px max(20px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); display: grid; gap: 16px; }
@media (min-width: 760px) { .scrim { align-items: center; } .sheet { border-radius: 24px; } }
.sheet { grid-template-columns: minmax(0, 1fr); }
.sheet > * { min-width: 0; }
.sheet .btn { width: 100%; flex: none; }
.sheet h3 { margin: 0; font-size: 1.4rem; font-weight: 800; }
.sheet p { margin: 0; color: var(--muted); }
.field { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: 16px; padding: 0 18px; border: 2px solid var(--line); }
.field:focus-within { border-color: var(--go); }
.field input { flex: 1; min-width: 0; height: 68px; border: 0; background: transparent; font-size: 2rem; font-weight: 800; outline: none; }
.field span { color: var(--muted); font-weight: 700; }
.split { display: grid; gap: 10px; }
.split .ln { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; }
.split .ln b { font-size: 1.05rem; } .split .ln small { display: block; color: var(--muted); font-weight: 600; }
.split .ln .ctl { display: flex; align-items: center; gap: 8px; }
.split .ln .ctl button { width: 52px; height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); font-weight: 800; font-size: 1.1rem; }
.split .ln .ctl input { width: 5ch; height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); text-align: center; font-size: 1.4rem; font-weight: 800; }
.choix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choix button { height: 64px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font-weight: 800; font-size: 1.15rem; }
.choix button[aria-pressed="true"] { background: var(--go); border-color: var(--go); color: var(--go-ink); }
.qlab { font-weight: 800; margin: 4px 0 0; }
.pill { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--done-soft); color: var(--done); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.steps { display: flex; gap: 10px; }
.steps button { flex: 1; height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: 1.1rem; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 14px 20px; border-radius: 14px; z-index: 40; font-weight: 600; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
