/* File du jour : charte reprise de l'artefact d'origine (crème / violet, Manrope + Plus Jakarta Sans).
   Mobile d'abord, marges de 16 px, aucun défilement horizontal, mode sombre automatique. */
:root {
  --bg: #fbf8f3; --card: #ffffff; --line: #ece6dc; --ink: #1f2430; --title: #2b2340;
  --muted: #6b6478; --label: #8a7f9c; --chip: #f2ede5; --chip-on: #2b2340; --chip-on-ink: #fbf8f3;
  --rose-a: #e0607e; --rose-b: #b8457e; --teal-a: #1fa58f; --teal-b: #157a72; --blue-a: #3d63d6; --blue-b: #26388f;
  --orange-a: #d9822b; --orange-b: #b4561a;
  --btn: #2b2340; --btn-ink: #ffffff; --ghost: #f2ede5;
  --ok-bg: #e9f6ee; --ok-line: #a9d9b9; --ok-ink: #1d5b33;
  --warn-bg: #fff4e5; --warn-line: #f3c98b; --warn-ink: #7a4a00;
  --hot-bg: #fdecef; --hot-line: #f2b3c1; --hot-ink: #8f2440;
  --f-display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16131b; --card: #201c27; --line: #332d3d; --ink: #e9e5f0; --title: #f4f0fb; --muted: #a9a1b8; --label: #9c92ae;
    --chip: #2a2533; --chip-on: #f4f0fb; --chip-on-ink: #16131b; --btn: #f4f0fb; --btn-ink: #16131b; --ghost: #2a2533;
    --ok-bg: #15301f; --ok-line: #2f6a45; --ok-ink: #a8e2bd; --warn-bg: #3a2a12; --warn-line: #7a5a2a; --warn-ink: #f6d39c;
    --hot-bg: #3a1621; --hot-line: #7a3346; --hot-ink: #f5b6c6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16131b; --card: #201c27; --line: #332d3d; --ink: #e9e5f0; --title: #f4f0fb; --muted: #a9a1b8; --label: #9c92ae;
  --chip: #2a2533; --chip-on: #f4f0fb; --chip-on-ink: #16131b; --btn: #f4f0fb; --btn-ink: #16131b; --ghost: #2a2533;
  --ok-bg: #15301f; --ok-line: #2f6a45; --ok-ink: #a8e2bd; --warn-bg: #3a2a12; --warn-line: #7a5a2a; --warn-ink: #f6d39c;
  --hot-bg: #3a1621; --hot-line: #7a3346; --hot-ink: #f5b6c6;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: max(20px, env(safe-area-inset-top, 0px)); padding-bottom: max(48px, env(safe-area-inset-bottom, 0px));
  overflow-x: hidden; overflow-wrap: anywhere;
}
img, svg { max-width: 100%; }
.wrap { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; width: 100%; }
.wrap > * { min-width: 0; max-width: 100%; }
.head-zone { gap: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--f-display); color: var(--title); margin: 0; text-wrap: balance; }
h1 { font-size: 1.35rem; font-weight: 800; }
h2 { font-size: 1.1rem; font-weight: 800; }
h3 { font-size: 1rem; font-weight: 800; }
.titlebar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.modebadge { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--warn-ink); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 999px; padding: 2px 10px; }
.modebadge:empty { display: none; }

/* Point du jour */
.today { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.today .date { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--label); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { border: 1px solid var(--line); background: var(--chip); border-radius: 12px; padding: 8px 10px; text-align: left; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: 2px; min-height: 64px; min-width: 0; }
.tile .n { font-family: var(--f-display); font-weight: 800; font-size: 1.35rem; color: var(--title); line-height: 1.1; }
.tile .t { font-size: .78rem; color: var(--muted); font-weight: 600; }
.tile.hot { background: var(--hot-bg); border-color: var(--hot-line); }
.tile.hot .n, .tile.hot .t { color: var(--hot-ink); }
.resume { font-size: .9rem; white-space: pre-wrap; border-left: 3px solid var(--line); padding-left: 10px; color: var(--ink); }
.next { font-size: .86rem; color: var(--muted); }
.next:empty { display: none; }

/* Onglets : 6 colonnes, 3 x 2 sur téléphone (pas de défilement horizontal) */
.tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; background: var(--chip); border: 1px solid var(--line); padding: 4px; border-radius: 12px; position: sticky; top: 0; z-index: 2; }
@media (max-width: 560px) { .tabs { grid-template-columns: repeat(3, 1fr); } }
.tab { border: 0; background: transparent; color: var(--ink); border-radius: 9px; padding: 8px 2px; font: 700 .8rem var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; min-height: 40px; min-width: 0; }
.tab[aria-selected="true"] { background: var(--chip-on); color: var(--chip-on-ink); }
.tab .b { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--hot-line); color: var(--hot-ink); font-size: .72rem; margin-left: 4px; }

/* File */
.days { display: flex; gap: 8px; flex-wrap: wrap; }
.day { flex: 0 0 auto; border: 1px solid var(--line); background: var(--chip); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: 600 .85rem var(--f-body); cursor: pointer; }
.day[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); border-color: var(--chip-on); }
.progress { display: flex; flex-direction: column; gap: 6px; }
.bar { height: 10px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-a), var(--teal-b)); width: 0; transition: width .3s; }
.ptxt { font-size: .85rem; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tools a { font-size: .85rem; color: var(--muted); }
.panel { display: flex; flex-direction: column; gap: 12px; }
.cards { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.card.done { opacity: .55; }
.head { padding: 12px 14px; color: #fff; display: flex; flex-direction: column; gap: 2px; }
.head.reve { background: linear-gradient(155deg, var(--rose-a), var(--rose-b)); }
.head.cible { background: linear-gradient(155deg, var(--teal-a), var(--teal-b)); }
.head.offre { background: linear-gradient(155deg, var(--blue-a), var(--blue-b)); }
.head.relance { background: linear-gradient(155deg, var(--orange-a), var(--orange-b)); }
.head .top { display: flex; justify-content: space-between; gap: 8px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .92; flex-wrap: wrap; }
.head h2 { color: #fff; font-size: 1.15rem; font-weight: 800; }
.head .sub { font-weight: 600; font-size: .9rem; opacity: .95; }
.body { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.why { font-size: .92rem; }
.meta { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.meta b { font-weight: 700; color: var(--label); }
details { border: 1px solid var(--line); border-radius: 10px; }
summary { cursor: pointer; padding: 8px 12px; font-weight: 700; font-size: .88rem; color: var(--title); }
.msg { padding: 0 12px 12px; white-space: pre-wrap; font-size: .9rem; }
.msg .obj { font-weight: 700; margin-bottom: 6px; }
.when { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-ink); border-radius: 10px; padding: 8px 10px; font-size: .92rem; font-weight: 700; }
.cvline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: .88rem; }
.cvline a { color: inherit; font-weight: 700; }
.cvline b { font-size: .82rem; }
.cvline.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.cvline.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.champs { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.champs .t { font-weight: 700; font-size: .85rem; color: var(--title); }
.champ { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: .86rem; }
.champ .l { color: var(--muted); font-size: .78rem; }
.champ .v { white-space: pre-wrap; word-break: break-word; }
.champ button { min-height: 36px; padding: 4px 10px; }
.tip { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: 10px; padding: 8px 10px; font-size: .85rem; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.copies { grid-column: 1 / -1; display: grid; gap: 8px; }
.btn { border: 0; border-radius: 10px; padding: 11px 12px; font: 700 .9rem var(--f-body); cursor: pointer; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 0; }
.btn.main { background: var(--btn); color: var(--btn-ink); grid-column: 1 / -1; }
.btn.ghost { background: var(--ghost); color: var(--ink); border: 1px solid var(--line); }
.btn.ok { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid var(--ok-line); }
.btn.no { background: #d64545; color: #ffffff; border: 1px solid #b93636; }
.btn.wide { grid-column: 1 / -1; }
.btn:disabled { opacity: .6; cursor: default; }
.btns3 { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.btn.sm { min-height: 36px; padding: 6px 10px; font-size: .82rem; }
.btn:focus-visible, .day:focus-visible, .tab:focus-visible, .tile:focus-visible, summary:focus-visible, .file:focus-visible, .repitem:focus-visible { outline: 2px solid var(--blue-a); outline-offset: 2px; }
.status { font-size: .82rem; font-weight: 700; color: var(--ok-ink); display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; background: var(--card); border: 1px dashed var(--line); border-radius: 14px; }
.empty .resume { text-align: left; align-self: stretch; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--btn); color: var(--btn-ink); padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: .88rem; z-index: 5; max-width: calc(100vw - 32px); text-align: center; }

/* Relances */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 12px; align-items: start; }
.row > :not(.j) { grid-column: 2; }
.row .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.row .acts .btn { min-height: 38px; padding: 6px 10px; font-size: .82rem; }
.row .j { grid-column: 1; grid-row: 1 / span 4; border-radius: 10px; background: var(--chip); text-align: center; padding: 6px 4px; display: flex; flex-direction: column; justify-content: center; min-height: 58px; }
.row .j b { font-family: var(--f-display); font-size: 1.15rem; color: var(--title); line-height: 1.1; }
.row .j span { font-size: .72rem; color: var(--muted); font-weight: 700; }
.row .j.now { background: var(--hot-bg); }
.row .j.now b, .row .j.now span { color: var(--hot-ink); }
.row .j.soon { background: var(--warn-bg); }
.row .j.soon b, .row .j.soon span { color: var(--warn-ink); }
.row .j.off { background: transparent; border: 1px dashed var(--line); }
.row .who { font-weight: 800; color: var(--title); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.row .who small { font-weight: 600; color: var(--muted); font-size: .8rem; }
.how { font-size: .86rem; }
.info { font-size: .8rem; color: var(--muted); }
.tag { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .04em; border-radius: 999px; padding: 1px 8px; background: var(--chip); color: var(--muted); }
.tag.reve { background: var(--hot-bg); color: var(--hot-ink); }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }
.sec { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--label); margin-top: 6px; }
.legend { font-size: .82rem; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }

/* Appels */
.call { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.call.reve { border-left: 5px solid var(--rose-a); }
.call .top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.call .top b { font-family: var(--f-display); font-size: 1.05rem; color: var(--title); }
.call .tel { font-size: 1.05rem; font-weight: 800; color: var(--title); text-decoration: none; }
.script { background: var(--chip); border-radius: 10px; padding: 10px 12px; font-size: .9rem; display: flex; flex-direction: column; gap: 6px; margin: 0 8px 8px; }
.script ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.script q { font-style: italic; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.call.done { opacity: .6; }

/* Tâches */
.tasks { display: flex; flex-direction: column; gap: 8px; }
.task { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: start; }
.task input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--teal-b); grid-row: span 2; }
.task .tt { font-weight: 700; color: var(--title); }
.task .dd { font-size: .85rem; color: var(--muted); white-space: pre-wrap; }
.task .dd a { color: var(--blue-a); font-weight: 700; }
.task.done .tt { text-decoration: line-through; opacity: .6; }
.task .full { grid-column: 1 / -1; }

/* Documents */
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file { cursor: pointer; font-family: var(--f-body); display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); border-radius: 10px; padding: 8px 12px; font-weight: 700; font-size: .86rem; text-decoration: none; min-height: 40px; max-width: 100%; text-align: left; }
.file.dir { background: var(--chip); border-color: var(--line); color: var(--ink); }
.file.off { background: transparent; border: 1px dashed var(--line); color: var(--muted); cursor: default; font-weight: 600; }
.doc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; }
@media (max-width: 420px) { .doc { grid-template-columns: minmax(0, 1fr); } }
.doc .nm { font-weight: 700; color: var(--title); word-break: break-word; }
.doc .rl { font-size: .8rem; color: var(--muted); }

/* Rapport du jour */
.reptop { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.replist { display: flex; flex-direction: column; gap: 12px; }
.rep { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.rep h3 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rep h3 .n { font-size: .82rem; color: var(--muted); font-weight: 700; font-family: var(--f-body); }
.rep.hot { border-color: var(--hot-line); }
.rep ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.repitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; padding: 6px 8px; border-radius: 8px; background: var(--chip); font-size: .88rem; border: 0; width: 100%; text-align: left; font-family: inherit; color: inherit; cursor: pointer; }
.repitem b { color: var(--title); }
.repitem .r { font-size: .78rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.repitem .r.hot { color: var(--hot-ink); }
.repitem .s { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.repitem a { color: var(--blue-a); font-weight: 700; }
.rep .vide { font-size: .85rem; color: var(--muted); }
.veille { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 6px 8px; border-radius: 8px; background: var(--chip); font-size: .86rem; }
.veille .s { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }

/* Connexion */
.loginform { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 360px; }
.loginform input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-height: 44px; width: 100%; }

/* Barre de clé d'application (mode github) */
.keybar { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: 12px; padding: 10px 12px; }
.keyform { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.keylab { font-weight: 800; font-size: .85rem; flex: 1 1 100%; }
.keyform input { font: inherit; flex: 1 1 180px; min-width: 0; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); min-height: 40px; }
.keyform .btn { flex: 0 0 auto; }
.keyrefus { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.keybar.refus, .keyrefus b { color: var(--hot-ink); }
