/* Mémos — même direction artistique que l'outil réservations (couleurs, Fraunces + Inter, composants). */
:root {
  --bg: #f6f3ee; --panel: #ffffff; --panel-2: #faf8f4; --ink: #1b1714; --muted: #7d7368; --line: #e8e1d6;
  --gold: #b8925a; --gold-soft: #f5ecdd; --accent: #1b1714;
  --blue: #3563c9; --blue-soft: #e8eefb; --green: #2f8a57; --green-soft: #e3f3e9;
  --amber: #b87514; --amber-soft: #fbf0dc; --red: #c2412d; --red-soft: #fbe8e4; --violet: #7a4fc4; --violet-soft: #efe8fb;
  --grey-soft: #eeebe6;
  --radius: 14px; --shadow: 0 1px 2px rgba(27,23,20,.05), 0 8px 24px -16px rgba(27,23,20,.25);
  --sans: "Inter", system-ui, -apple-system, sans-serif; --serif: "Fraunces", Georgia, serif;
  --tabs: calc(58px + env(safe-area-inset-bottom));
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141210; --panel: #1d1a17; --panel-2: #23201c; --ink: #f1ebe2; --muted: #a39887; --line: #34302a;
    --gold-soft: #3a2f20; --blue-soft: #1f2a40; --green-soft: #1b3326; --amber-soft: #3b2c14; --red-soft: #3d1f19;
    --violet-soft: #2c2240; --grey-soft: #2a2622; --accent: #e9d9bd;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -16px rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--sans); background: var(--bg); color: var(--ink); overscroll-behavior-y: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- structure ---------- */
.top { position: sticky; top: 0; z-index: 5; background: #000; color: #e9e1d4; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px; }
.top .brand { font-family: var(--serif); letter-spacing: .25em; font-size: 16px; }
.top .brand b { color: var(--gold); font-weight: 500; }
.top button { background: none; border: 0; color: #cbbfae; font-size: 20px; padding: 4px 6px; cursor: pointer; }
.page { padding: 20px 16px calc(var(--tabs) + 90px); max-width: 720px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-head h1 { font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.15; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; height: var(--tabs); padding-bottom: env(safe-area-inset-bottom); background: var(--panel);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; }
.tabs a .ic { font-size: 20px; line-height: 1.1; filter: grayscale(1); opacity: .7; }
.tabs a.on { color: var(--ink); }
.tabs a.on .ic { filter: none; opacity: 1; }
.tabs a .count { position: absolute; top: 5px; left: calc(50% + 8px); background: var(--gold); color: #15120f; border-radius: 999px; font-size: 10px; font-weight: 700; padding: 0 6px; min-width: 17px; text-align: center; }
.fab { position: fixed; right: 18px; bottom: calc(var(--tabs) + 16px); z-index: 6; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--gold); color: #15120f;
  font-size: 30px; line-height: 1; box-shadow: 0 6px 20px -6px rgba(0,0,0,.5); cursor: pointer; }

/* ---------- composants ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); padding: 9px 14px; border-radius: 10px; cursor: pointer; text-decoration: none; white-space: nowrap; font-weight: 500; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #15120f; }
.btn.danger { color: var(--red); border-color: var(--red-soft); }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.subtle { background: transparent; border-color: transparent; color: var(--muted); }
.btn[disabled] { opacity: .5; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty { color: var(--muted); padding: 34px 18px; text-align: center; }
.empty .big { font-family: var(--serif); font-size: 20px; color: var(--ink); margin-bottom: 4px; }
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--grey-soft); color: var(--muted); }
.n-a_faire { background: var(--blue-soft); color: var(--blue); }
.n-rappel { background: var(--amber-soft); color: var(--amber); }
.n-a_deleguer { background: var(--violet-soft); color: var(--violet); }
.n-idee { background: var(--gold-soft); color: var(--gold); }
.n-info { background: var(--grey-soft); color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.due { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.due.today { color: var(--amber); } .due.late { color: var(--red); }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; border: 0; background: none; padding: 6px 13px; border-radius: 999px; cursor: pointer; color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.seg .on { background: var(--accent); color: var(--bg); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font-size: 16px; font-weight: 400; width: 100%; min-width: 0; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- fiches ---------- */
.group { margin: 22px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; }
.group:first-child { margin-top: 4px; }
.fiches { display: flex; flex-direction: column; gap: 10px; }
.swipe { position: relative; border-radius: var(--radius); overflow: hidden; }
.swipe .under { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-weight: 700; color: #fff; border-radius: var(--radius); }
.swipe .under.keep { background: var(--green); } .swipe .under.drop { background: var(--red); justify-content: flex-end; }
.fiche { position: relative; padding: 13px 14px; display: flex; gap: 11px; align-items: flex-start; touch-action: pan-y; cursor: pointer; }
.fiche .check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); margin-top: 1px; padding: 0; cursor: pointer; color: transparent; font-size: 14px; line-height: 1; }
.fiche.done .check { background: var(--green); border-color: var(--green); color: #fff; }
.fiche.done .t { text-decoration: line-through; color: var(--muted); }
.fiche .body { flex: 1; min-width: 0; }
.fiche .t { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.fiche .x { color: var(--muted); font-size: 13.5px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.fiche .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.fiche .acts { display: flex; gap: 8px; margin-top: 11px; }
.fiche .acts .btn { flex: 1; }
.wait { padding: 13px 14px; border-style: dashed; }
.wait .x { white-space: pre-line; font-size: 14px; margin-top: 4px; }
.wait audio, .sheet audio { width: 100%; margin-top: 8px; height: 40px; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: sp 1s linear infinite; vertical-align: -1px; margin-right: 6px; }
@keyframes sp { to { transform: rotate(360deg); } }
.links { display: flex; gap: 16px; justify-content: center; margin-top: 26px; font-size: 13px; }
.links a { color: var(--muted); }

/* ---------- feuille du bas ---------- */
.veil { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: min(720px, 100%); max-height: 92vh; overflow: auto; background: var(--bg); border-radius: 18px 18px 0 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet .grab { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 2px auto 4px; }
.sheet h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.sheet .foot { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet .foot .btn { flex: 1; }
.sheet details { font-size: 13.5px; color: var(--muted); }
.sheet details p { white-space: pre-line; margin-top: 6px; }
.sheet .box { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sheet .box h3 { font-size: 15px; font-weight: 600; }
.sheet code { display: block; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; word-break: break-all; user-select: all; -webkit-user-select: all; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs) + 14px); z-index: 30; background: var(--accent); color: var(--bg); padding: 10px 16px; border-radius: 12px;
  box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; max-width: calc(100vw - 100px); font-size: 14px; }
.toast button { background: none; border: 0; color: var(--gold); font-weight: 700; padding: 0; cursor: pointer; }
.searchbox input { width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 16px; }
