/* Ma semaine et Ma progression : cadre de l'accueil (audit.css + home.css), composants repris du prototype
   validé (v13). États d'une action : gris (à faire) → ambre (en cours) → vert (faite). Graphiques repris du
   tableau de bord VISION : corail, période en cours en corail clair, objectif en pointillés. */
:root {
  --todo: #7d7468; --todo-soft: #ece6da; --doing: #b77600; --doing-soft: #fcebc4; --done: #23845f; --done-soft: #d9efe4;
  --blue: #2f5aa8; --blue-soft: #eaf0fa; --coral-soft: #fbe6ec;
  --chart: #e8527d; --chart-now: #ff8a6b; --chart-ref: #0e3d34; --chart-grid: #eadfce; --chart-text: #756b5e; --toggle: #efe6d7;
}
#week-main { display: grid; gap: 12px; align-content: start; }
#screen { display: grid; gap: 12px; min-width: 0; }
.week-loading { color: var(--muted); font-size: 12px; }
.week-error { margin: 0; padding: 12px 14px; border-radius: 12px; background: #fde9e4; color: var(--danger); font-size: 12px; font-weight: 700; }
.saved-state { color: var(--muted); font-size: 11px; font-weight: 700; }

.week-hero { padding: 22px; }
.week-hero h1 { font-size: clamp(24px, 4vw, 30px); }
.blk { display: grid; gap: 8px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.blk-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.blk-head b { color: var(--green); font-size: 14px; }
.blk-head small { color: var(--muted); font-size: 11px; }
.space-title { display: grid; gap: 1px; }
.space-title small { color: var(--muted); font-size: 11px; font-weight: 600; }
.eyebrow-coral { color: var(--coral-end); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.view-title { margin: 0; color: var(--green); font-size: 21px; letter-spacing: -.02em; text-wrap: balance; }
.lead { margin: 0; color: var(--ink-soft); font-size: 12.5px; line-height: 1.5; }
.empty { margin: 0; color: var(--muted); font-size: 12px; }
.warn { margin: 0; color: #8a6516; font-size: 11.5px; }
.sub { padding-top: 6px; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.lnk { justify-self: start; padding: 0; border: 0; background: none; color: var(--green); font-size: 12px; font-weight: 800; text-align: left; text-decoration: none; cursor: pointer; }
.lnk.muted { color: var(--muted); }
.lnk.center { justify-self: center; }
.lnk.end { justify-self: end; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btns.split { justify-content: space-between; }
.full { width: 100%; }
.coral { background: linear-gradient(135deg, var(--coral-start), var(--coral-end)); }
.primary-action[disabled] { opacity: .45; cursor: default; }

.invite { display: grid; gap: 7px; padding: 15px; border: 1px solid rgba(232,82,125,.3); border-radius: 16px; background: var(--coral-soft); }
.invite b { color: var(--coral-end); font-size: 14px; }
.invite p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.invite.plan { border-color: rgba(63,168,142,.4); background: var(--green-soft); }
.invite.plan b { color: var(--green); }
.invite .primary-action { justify-self: start; }

.pride { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; counter-reset: p; }
.pride li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; font-size: 13px; counter-increment: p; overflow-wrap: anywhere; }
.pride li::before { content: counter(p); display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--gold-soft); color: #8a6516; font-size: 11px; font-weight: 800; }

.act { display: grid; grid-template-columns: 22px 1fr auto; gap: 9px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); }
.act:first-child { border-top: 0; }
.check { display: grid; width: 20px; height: 20px; place-items: center; padding: 0; border: 1.5px solid var(--todo); border-radius: 6px; background: transparent; color: #fff; font-size: 12px; font-weight: 900; cursor: pointer; }
.check.doing { border-color: var(--doing); background: linear-gradient(90deg, var(--doing) 50%, transparent 50%); }
.check.done { border-color: var(--done); background: var(--done); }
.check.dropped { border-color: var(--line); color: var(--muted); }
.act .t { display: grid; gap: 3px; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); font-size: 13px; text-align: left; cursor: pointer; }
.act .t > span { font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.act.isdone .t > span { color: var(--muted); text-decoration: line-through; }
.meta { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { padding: 1px 8px; border-radius: 99px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.c-ws { background: var(--green-soft); color: var(--green); }
.c-perso { border: 1px solid var(--line); color: var(--muted); }
.c-late { background: var(--gold-soft); color: #8a6516; }
.c-coach { background: var(--blue-soft); color: var(--blue); }
.s-todo { background: var(--todo-soft); color: var(--todo); }
.s-doing { background: var(--doing-soft); color: var(--doing); }
.s-done { background: var(--done-soft); color: var(--done); }
.mini { padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--green); font-size: 10.5px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.chev { color: var(--muted); font-weight: 800; }

.field { display: grid; gap: 5px; }
.field > label, .field > span { color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.field small { color: var(--muted); font-size: 11px; font-weight: 500; }
.week-input, .week-select, .week-textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font-size: 13px; }
.week-textarea { min-height: 64px; resize: vertical; }
.addrow { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.seg { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 99px; }
.seg button { flex: 1; padding: 8px 4px; border: 0; background: var(--panel); color: var(--ink-soft); font-size: 11px; font-weight: 800; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--green); color: #fff; }
.seg button[data-tone="todo"][aria-pressed="true"] { background: var(--todo); }
.seg button[data-tone="doing"][aria-pressed="true"] { background: var(--doing); }
.seg button[data-tone="done"][aria-pressed="true"] { background: var(--done); }
.seg button[data-tone="dropped"][aria-pressed="true"] { background: var(--line); color: var(--ink-soft); }
.dirty { margin: 0; color: var(--doing); font-size: 11.5px; font-weight: 700; }
.savebar { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 0 4px; background: var(--cream); border-top: 1px solid var(--line); }
.note-coach { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid rgba(47,90,168,.3); border-radius: 12px; background: var(--blue-soft); font-size: 12px; }
.note-coach b { color: var(--blue); font-size: 11px; }
.explain { margin: 0; color: var(--ink-soft); font-size: 12px; white-space: pre-line; }

.steps { display: flex; gap: 5px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--coral-end); }
.pick { display: grid; grid-template-columns: 20px 1fr; gap: 9px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.pick:first-child { border-top: 0; }
.pick input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--mint); }
.pick span { display: grid; gap: 3px; }
.numgrid { display: grid; gap: 10px; }
.numgrid .field { grid-template-columns: 1fr 90px; align-items: center; }
.numgrid label { display: grid; gap: 1px; }
.numgrid .auto { color: var(--green); font-weight: 800; text-align: center; }

.hab { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.hab:first-child { border-top: 0; }
.hab .t { display: grid; gap: 3px; min-width: 0; }
.hab .t > span { font-weight: 650; line-height: 1.35; }
.ctr { display: flex; align-items: center; gap: 6px; }
.ctr button.round { display: grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--green); font-size: 15px; font-weight: 900; cursor: pointer; }
.ctr b { min-width: 46px; padding: 3px 8px; border-radius: 99px; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.h-done { background: var(--done-soft); color: var(--done); }
.h-part { background: var(--doing-soft); color: var(--doing); }
.h-none { background: var(--todo-soft); color: var(--todo); }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.kpi { display: grid; gap: 1px; min-width: 0; padding: 9px; border-radius: 12px; background: var(--cream); }
.kpi b { color: var(--green); font-size: 20px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi b em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 700; }
.kpi span { color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.25; }
.kpi small { font-size: 10px; font-weight: 800; }
.up { color: var(--done); } .down { color: var(--coral-end); } .flat { color: var(--muted); }
.fam { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: center; }
.fam > span { color: var(--muted); font-size: 9.5px; font-weight: 800; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }

/* Ma progression : onglets, bandeau, graphiques, semaines */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; justify-self: start; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--toggle); }
.tabs button { padding: 8px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--chart-text); font-size: 12px; font-weight: 800; cursor: pointer; }
.tabs button[aria-selected="true"], .tabs button.active { background: var(--panel); color: var(--green); box-shadow: 0 2px 8px rgba(14,61,52,.07); }
.week-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.week-strip > div { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.week-strip span, .week-strip small { display: block; color: var(--chart-text); font-size: 10px; }
.week-strip span { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.week-strip strong { display: block; margin: 4px 0; color: var(--green); font-size: 23px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.week-strip em { color: var(--muted); font-size: 14px; font-style: normal; }
.chartbox { display: grid; gap: 8px; min-width: 0; padding: 14px 14px 8px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); }
.chart-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 10px; }
.chart-heading strong { display: block; font-size: 14px; }
.chart-heading span { display: block; color: var(--chart-text); font-size: 11.5px; }
.chart-current { padding: 5px 9px; border-radius: 20px; background: var(--done-soft); color: var(--done) !important; font-weight: 700; white-space: nowrap; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .gl { stroke: var(--chart-grid); }
.chart .ax { fill: var(--chart-text); font-size: 11px; }
.chart .val { fill: var(--ink); font-size: 11px; font-weight: 800; }
.chart .b-val { fill: var(--chart); } .chart .b-now { fill: var(--chart-now); } .chart .b-ref { fill: var(--chart-ref); opacity: .28; }
.chart .ln { fill: none; stroke: var(--chart); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln-ref { fill: none; stroke: var(--chart-ref); stroke-width: 2; stroke-dasharray: 7 6; }
.chart .dot { fill: var(--chart); stroke: var(--panel); stroke-width: 3; } .chart .dot-now { fill: var(--chart-now); stroke: var(--panel); stroke-width: 3; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; color: var(--chart-text); font-size: 11px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; }
.wk { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.wk:first-child { padding-top: 0; border-top: 0; }
.wk-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.wk-head b { color: var(--green); font-size: 13px; }
.wk-head small { color: var(--muted); font-size: 11.5px; }
.wk-item { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; font-size: 12.5px; }
.wk-item .chip { min-width: 64px; text-align: center; }
.wk-item.dropped > span:last-child { color: var(--muted); text-decoration: line-through; }
.hm { overflow-x: auto; }
.hm table { min-width: 540px; border-collapse: separate; border-spacing: 4px; font-size: 12px; }
.hm th { padding: 2px 4px; color: var(--muted); font-size: 10px; text-align: center; }
.hm th:first-child, .hm td:first-child { text-align: left; }
.hm td { padding: 0; text-align: center; }
.hm td:first-child { min-width: 150px; padding-right: 8px; font-weight: 650; }
.hm td small { display: block; color: var(--muted); font-size: 10.5px; font-weight: 500; }
.cell { display: grid; height: 30px; place-items: center; border-radius: 8px; font-size: 10.5px; font-weight: 800; }
.cell.h-done { background: var(--done); color: #fff; }
.cell.h-off { border: 1px dashed var(--line); background: transparent; }
details.blk summary { color: var(--green); font-size: 13px; font-weight: 800; cursor: pointer; }

@media (max-width: 640px) {
  .week-strip { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (prefers-reduced-motion: no-preference) { #screen > * { animation: week-in .18s ease-out; } @keyframes week-in { from { opacity: .4; transform: translateY(4px); } } }
a.primary-action, a.secondary-action, a.mini, .lnk { text-decoration: none; }
.hab, .act { font-size: 13px; }
.chart .ax { font-size: 12.5px; } .chart .val { font-size: 12.5px; }
/* Grille des habitudes : 8 semaines tiennent dans la largeur d'un téléphone. */
.hm table { width: 100%; min-width: 0; table-layout: fixed; border-spacing: 3px; }
.hm th:first-child, .hm td:first-child { width: 34%; min-width: 0; }
.hm th { font-size: 9.5px; line-height: 1.2; }
.cell { height: 28px; font-size: 9.5px; }
.hm td:first-child { font-size: 12px; }

/* Proposition d'action du coach, côté client */
.proposal { display: grid; gap: 7px; padding: 14px; border: 1px solid rgba(47,90,168,.35); border-radius: 16px; background: var(--blue-soft); }
.proposal b { color: var(--blue); font-size: 12px; } .proposal span { font-weight: 700; } .proposal p { margin: 0; color: var(--ink-soft); font-size: 12px; }
/* Mode coach (fiche client) : la page en lecture, sans le cadre de l'application */
.coach-mode { padding: 0; background: transparent; }
.coach-mode .app-shell { width: 100%; min-height: 0; border-radius: 0; box-shadow: none; background: transparent; }
.coach-mode .topbar, .coach-mode .bottom-nav { display: none; }
.coach-mode main { padding: 0; }
.coach-mode .check, .coach-mode .act .t, .coach-mode .ctr button, .coach-mode .mini { pointer-events: none; }
.coach-mode .ctr a.mini, .coach-mode .act .chev, .coach-mode [data-now] { display: none; }
.coach-mode .ctr button.round { display: none; }

/* Business : l'essentiel du projet (audit et workshops), synthèse puis détail dépliable. */
.biz-card.off { opacity: .65; }
.biz-state { padding: 3px 10px; border-radius: 999px; background: var(--line); color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.biz-state.ok { background: var(--green-soft); color: var(--green); }
.biz-state.doing { background: var(--gold-soft, #fbf1d8); color: #8a6516; }
.biz-items { display: grid; gap: 10px; margin: 0; }
.biz-items div { display: grid; gap: 2px; }
.biz-items dt { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.biz-items dd { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.biz-more { margin-top: 2px; }
.biz-more > summary { color: var(--green); font-size: 12px; font-weight: 800; cursor: pointer; }
.biz-more[open] > summary { margin-bottom: 10px; }
