/* ==========================================================================
   Miko : système de design v4
   Références : la finesse de Linear, le calme de Things, la lecture de Superhuman,
   l'agenda de Notion Calendar, la palette de commandes de Raycast.
   Mise en page : barre latérale fixe + barre du haut translucide + contenu centré ;
   sur téléphone, barre d'onglets au pouce avec bouton « + » central.
   ========================================================================== */
@font-face {
  font-family: "Bricolage";
  src: url("/static/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #f5f6f9;
  --side-bg: #eef0f5;
  --panel: #ffffff;
  --panel-2: #fafbfd;
  --sunken: #eceff5;
  --hover: rgba(15, 19, 36, 0.045);
  --ink: #0f1324;
  --ink-2: #4a5170;
  --ink-3: #636a87;
  --line: rgba(15, 19, 36, 0.08);
  --line-2: rgba(15, 19, 36, 0.14);
  --accent: #4560f0;
  --accent-ink: #3550e6;
  --accent-soft: rgba(79, 107, 255, 0.1);
  --on-accent: #ffffff;
  --ai: linear-gradient(120deg, #4f6bff 0%, #8b5cf6 55%, #e46ad6 100%);
  --ai-soft: linear-gradient(120deg, rgba(79, 107, 255, 0.08), rgba(139, 92, 246, 0.07) 55%, rgba(228, 106, 214, 0.06));
  --green: #0a7559;
  --green-soft: rgba(14, 159, 122, 0.1);
  --amber: #b9740a;
  --amber-soft: rgba(224, 150, 43, 0.13);
  --red: #c42f35;
  --red-soft: rgba(229, 72, 77, 0.1);
  --rule: rgba(79, 107, 255, 0.14);
  --margin: rgba(229, 72, 77, 0.32);
  --shadow-1: 0 1px 2px rgba(15, 19, 36, 0.05);
  --shadow-2: 0 1px 2px rgba(15, 19, 36, 0.04), 0 6px 16px -4px rgba(15, 19, 36, 0.07);
  --shadow-pop: 0 28px 70px -16px rgba(15, 19, 36, 0.3), 0 0 0 1px rgba(15, 19, 36, 0.06);
  --display: "Bricolage", ui-sans-serif, system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --side: 248px;
  --top: 56px;
  --hour: 56px;
  --q: calc(var(--hour) / 4);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c14; --side-bg: #0d1019; --panel: #11141e; --panel-2: #141826; --sunken: #0c0f17;
    --hover: rgba(255, 255, 255, 0.05);
    --ink: #eceef6; --ink-2: #a9afc8; --ink-3: #8188a6;
    --line: rgba(255, 255, 255, 0.07); --line-2: rgba(255, 255, 255, 0.12);
    --accent: #7b8cff; --accent-ink: #a8b4ff; --accent-soft: rgba(123, 140, 255, 0.14); --on-accent: #0a0c14;
    --ai-soft: linear-gradient(120deg, rgba(123, 140, 255, 0.12), rgba(139, 92, 246, 0.1) 55%, rgba(228, 106, 214, 0.08));
    --green: #3fd0aa; --green-soft: rgba(63, 208, 170, 0.12);
    --amber: #f0b45c; --amber-soft: rgba(240, 180, 92, 0.12);
    --red: #ff7a80; --red-soft: rgba(255, 122, 128, 0.12);
    --rule: rgba(123, 140, 255, 0.12); --margin: rgba(255, 122, 128, 0.28);
    --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
    --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --shadow-pop: 0 30px 80px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0c14; --side-bg: #0d1019; --panel: #11141e; --panel-2: #141826; --sunken: #0c0f17;
  --hover: rgba(255, 255, 255, 0.05);
  --ink: #eceef6; --ink-2: #a9afc8; --ink-3: #8188a6;
  --line: rgba(255, 255, 255, 0.07); --line-2: rgba(255, 255, 255, 0.12);
  --accent: #7b8cff; --accent-ink: #a8b4ff; --accent-soft: rgba(123, 140, 255, 0.14); --on-accent: #0a0c14;
  --ai-soft: linear-gradient(120deg, rgba(123, 140, 255, 0.12), rgba(139, 92, 246, 0.1) 55%, rgba(228, 106, 214, 0.08));
  --green: #3fd0aa; --green-soft: rgba(63, 208, 170, 0.12);
  --amber: #f0b45c; --amber-soft: rgba(240, 180, 92, 0.12);
  --red: #ff7a80; --red-soft: rgba(255, 122, 128, 0.12);
  --rule: rgba(123, 140, 255, 0.12); --margin: rgba(255, 122, 128, 0.28);
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 30px 80px -20px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
h2 { font-size: 0.98rem; font-weight: 650; }
p { margin: 0; }
kbd { font: 600 0.7rem/1 var(--text); padding: 3px 5px; min-width: 18px; text-align: center; border-radius: 5px; color: var(--ink-3);
  border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--panel); display: inline-block; }
code { font-size: 0.86em; background: var(--sunken); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
.empty { color: var(--ink-3); }
.hint { font-size: 0.84rem; color: var(--ink-3); }
.warn { font-size: 0.86rem; color: var(--amber); background: var(--amber-soft); padding: 8px 12px; border-radius: var(--r-sm); margin: 0 0 16px; }
.demo-banner { display: inline-flex; margin: 0 0 18px; padding: 6px 12px; border-radius: 999px; font-size: 0.8rem; background: var(--green-soft); color: var(--green); }

/* ---------- boutons ---------- */
.primary, .button, .soft { display: inline-flex; align-items: center; gap: 8px; justify-content: center; border-radius: 10px;
  font: 600 0.88rem/1 var(--text); padding: 9px 14px; transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.12s; white-space: nowrap; }
.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 1px 2px rgba(15, 19, 36, 0.15); }
.primary:hover { filter: brightness(1.07); text-decoration: none; }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.primary kbd { background: transparent; border-color: currentColor; color: inherit; opacity: 0.65; }
.button { background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); }
.button:hover { background: var(--panel-2); border-color: var(--ink-3); text-decoration: none; }
.button:disabled { opacity: 0.6; }
.soft { background: var(--accent-soft); color: var(--accent-ink); }
.soft:hover { filter: brightness(0.97); text-decoration: none; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--ink-3); transition: background 0.12s, color 0.12s; }
.icon-btn:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.send { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--on-accent); flex: none; }
.send:disabled { opacity: 0.4; }
.send .ico { width: 17px; height: 17px; stroke-width: 2.2; }
.link-soft { font-size: 0.82rem; font-weight: 550; color: var(--ink-3); }
.link-soft:hover { color: var(--accent-ink); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 0.85rem; font-weight: 550; box-shadow: var(--shadow-1); }
.pill .ico { width: 15px; height: 15px; color: var(--ink-3); }
.pill:hover { text-decoration: none; border-color: var(--line-2); color: var(--ink); }
.pill-alert { color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); background: var(--red-soft); }
.pill-alert .ico { color: var(--red); }
.count { font: 600 0.74rem/1.6 var(--text); color: var(--ink-3); background: var(--sunken); border-radius: 999px; padding: 0 8px; }
.tag { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--sunken); color: var(--ink-2); }
.tag-hot { background: var(--accent-soft); color: var(--accent-ink); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font: 700 0.68rem/18px var(--text); text-align: center; }
.num { font: 600 0.74rem var(--text); color: var(--ink-3); }

/* ---------- coque : barre latérale ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 14px 10px 12px;
  background: var(--side-bg); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; color: var(--ink); font: 750 1.18rem var(--display); letter-spacing: -0.03em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.side-search { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border-radius: 9px; color: var(--ink-3);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-1); font-size: 0.88rem; margin-bottom: 8px; }
.side-search kbd { margin-left: auto; }
.side-search:hover { color: var(--ink-2); border-color: var(--line-2); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 550; font-size: 0.92rem; }
.nav-item .ico { color: var(--ink-3); }
.nav-item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-item.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.nav-item.on .ico { color: var(--accent); }
.nav-item .badge, .nav-item .num { margin-left: auto; }
.side-section { margin-top: 18px; display: flex; flex-direction: column; gap: 1px; }
.side-label { font-size: 0.75rem; font-weight: 600; color: var(--ink-3); padding: 0 10px 6px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); font-size: 0.88rem; }
.side-link span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.pdot { width: 8px; height: 8px; border-radius: 3px; flex: none; background: var(--ink-3); opacity: 0.6; }
.pdot.hot { background: var(--accent); opacity: 1; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.side-new { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; font-weight: 600; font-size: 0.9rem;
  color: var(--on-accent); background: var(--accent); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 2px 6px -2px rgba(79, 107, 255, 0.5); }
.side-new kbd { margin-left: auto; background: transparent; color: inherit; border-color: currentColor; opacity: 0.6; }
.side-new:hover { filter: brightness(1.07); }
.me { display: flex; align-items: center; gap: 6px; padding: 6px 4px 0 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.me-avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ai); color: #fff; font: 700 0.8rem var(--display); }
.me-name { font-weight: 600; font-size: 0.9rem; margin-right: auto; }
.me form { display: contents; }

/* ---------- coque : barre du haut ---------- */
.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 15; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 clamp(16px, 2.6vw, 32px);
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px);
  border-bottom: 1px solid var(--line); }
.tb-brand, .tb-mobile { display: none; }
.tb-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1; }
.tb-h { font: 650 0.98rem var(--text); white-space: nowrap; margin: 0; letter-spacing: normal; }
.tb-sub { font-size: 0.85rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-actions { display: flex; align-items: center; gap: 8px; }
.tb-actions form { display: contents; }
.ask-miko { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; border-radius: 10px; font: 600 0.86rem var(--text);
  color: var(--ink); background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--ai) border-box; border: 1px solid transparent; box-shadow: var(--shadow-1); }
.ask-miko .ico { color: #8b5cf6; }
.ask-miko kbd { margin-left: 2px; }
.ask-miko:hover { box-shadow: var(--shadow-2); }
.ask-miko[aria-expanded="true"] { background: linear-gradient(var(--accent-soft), var(--accent-soft)) padding-box, var(--ai) border-box; }
.main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px clamp(16px, 3.4vw, 44px) 88px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 7px; font-size: 0.86rem; color: var(--ink-3); align-items: center; }
.crumbs a { color: var(--ink-2); }

/* ---------- cartes ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-2); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.band { margin-top: 32px; }
.band-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.band-head h2 { font-size: 1.05rem; }

/* ---------- aujourd'hui ---------- */
.hero { padding: 6px 0 20px; }
.hero-date { color: var(--ink-3); font-weight: 550; font-size: 0.92rem; margin-bottom: 4px; }
.hello { font-size: clamp(2rem, 3.6vw, 2.75rem); font-weight: 720; letter-spacing: -0.045em; line-height: 1.05; }
.glance { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Le brief de Miko : la pièce maîtresse, avec son contour en dégradé */
.brief { position: relative; border-radius: var(--r-xl); padding: 18px 22px 18px; border: 1px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--ai) border-box; box-shadow: var(--shadow-2); overflow: hidden; }
.brief::before { content: ""; position: absolute; inset: 0; background: var(--ai-soft); pointer-events: none; }
.brief > * { position: relative; }
.brief-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.brief-head h2 { font-size: 1rem; }
.brief-src { font-size: 0.78rem; color: var(--ink-3); margin-left: 2px; }
.brief-head .icon-btn { margin-left: auto; }
.brief-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.brief-lines li { position: relative; padding-left: 18px; font-size: 1.02rem; line-height: 1.5; }
.brief-lines li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--ai); }
.brief-lines .skel { height: 14px; border-radius: 7px; margin: 5px 0; padding: 0; width: 92%;
  background: linear-gradient(90deg, var(--sunken) 0%, var(--line-2) 40%, var(--sunken) 80%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.brief-lines .skel::before { display: none; }
.brief-lines .skel.short { width: 58%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }
.brief-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.miko-orb { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--ai); color: #fff; flex: none;
  box-shadow: 0 2px 8px -2px rgba(139, 92, 246, 0.55); }
.miko-orb .ico { width: 15px; height: 15px; stroke-width: 2; }
.miko-orb.big { width: 46px; height: 46px; border-radius: 14px; }
.miko-orb.big .ico { width: 24px; height: 24px; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ev { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: start; padding: 8px 8px 8px 0; border-radius: 10px; }
.ev-time { font: 650 0.86rem/1.25 var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.ev-time small { display: block; font-weight: 450; font-size: 0.74rem; color: var(--ink-3); margin-top: 2px; }
.ev-body { position: relative; padding-left: 12px; display: grid; gap: 2px; min-width: 0; }
.ev-body::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px; border-radius: 3px; background: var(--c, var(--accent)); }
.ev-title { font-weight: 600; font-size: 0.93rem; overflow-wrap: anywhere; }
.ev-place { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; color: var(--ink-3); }
.ev-place .ico { width: 13px; height: 13px; }
.ev.past .ev-time, .ev.past .ev-title { color: var(--ink-3); font-weight: 500; }
.ev.past .ev-body::before { opacity: 0.4; }
.ev.live { background: color-mix(in srgb, var(--c, var(--accent)) 10%, transparent); }
.now-mark { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: var(--red); font: 650 0.72rem var(--text); }
.now-mark::after { content: ""; flex: 1; height: 1.5px; border-radius: 2px; background: var(--red); }
.now-mark span { width: 52px; text-align: right; }
.tomorrow { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.tomorrow h3 { font: 600 0.78rem var(--text); color: var(--ink-3); margin-bottom: 4px; letter-spacing: 0; }
.tomorrow .ev { padding-top: 5px; padding-bottom: 5px; opacity: 0.85; }

.priorities { list-style: none; margin: 0 0 12px; padding: 0; }
.priorities li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.tick { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; transform: translateY(3px); }
.quick-capture { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--sunken); border: 1px solid transparent; transition: border-color 0.12s, background 0.12s; }
.quick-capture > .ico { color: var(--ink-3); align-self: center; }
.quick-capture:focus-within { background: var(--panel); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.quick-capture textarea { flex: 1; border: 0; outline: none; resize: none; background: none; color: var(--ink); font: 0.93rem/1.5 var(--text); padding: 6px 0; max-height: 160px; }
.quick-capture textarea::placeholder { color: var(--ink-3); }

.mini-mails { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mini-mails a { display: flex; gap: 10px; align-items: flex-start; padding: 8px; margin: 0 -8px; border-radius: 10px; color: var(--ink); }
.mini-mails a:hover { background: var(--hover); text-decoration: none; }
.mm-text { display: grid; min-width: 0; }
.mm-from { font-weight: 600; font-size: 0.9rem; }
.mm-sum { font-size: 0.84rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.foot-note { margin-top: 10px; font-size: 0.82rem; color: var(--ink-3); }

.projects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.project { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 16px 18px; border-radius: var(--r-lg); background: var(--panel);
  border: 1px solid var(--line); box-shadow: var(--shadow-2); color: var(--ink); transition: border-color 0.15s, transform 0.15s var(--ease), box-shadow 0.15s; }
.project:hover { text-decoration: none; border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.project-top { display: flex; align-items: center; gap: 10px; }
.project-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.project-title { font: 680 1.04rem/1.3 var(--display); letter-spacing: -0.015em; }
.project-next { font-size: 0.86rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.next-label { font-weight: 650; color: var(--ink-3); margin-right: 6px; }
.project-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px 10px; white-space: nowrap; padding-top: 6px; font-size: 0.78rem; color: var(--ink-3); }
.due { margin-left: auto; }
.ring { --p: 0%; width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--accent) var(--p), var(--sunken) 0); }
.ring span { width: 26px; height: 26px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font: 700 0.66rem var(--text); color: var(--ink-2); }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li.empty { padding: 6px 0; }
.rows a { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -8px; border-radius: 9px; color: var(--ink); }
.rows a > .ico { color: var(--ink-3); width: 16px; height: 16px; }
.rows a:hover { background: var(--hover); text-decoration: none; }
.row-title { font-weight: 520; font-size: 0.92rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.row-meta { font-size: 0.78rem; color: var(--ink-3); white-space: nowrap; flex: none; }
.domains { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.domain { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 0.86rem; font-weight: 550; }
.domain:hover { color: var(--ink); border-color: var(--line-2); text-decoration: none; }

/* ---------- agenda ---------- */
.week-nav { display: flex; align-items: center; gap: 4px; }
.seg { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 8px; font: 600 0.84rem var(--text); color: var(--ink-2); }
.seg:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.seg-on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.agenda-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.cal-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--ink); font: 600 0.82rem var(--text); cursor: pointer; transition: opacity 0.15s, background 0.15s; }
.cal-toggle:hover { background: var(--hover); }
.cal-toggle .dot { width: 10px; height: 10px; border-radius: 50%; }
.cal-toggle[aria-pressed="false"] { color: var(--ink-3); opacity: 0.6; }
.cal-toggle[aria-pressed="false"] .dot { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.agenda-keys { margin: 0; font-size: 0.78rem; }
.agenda-keys kbd { font: 600 0.72rem var(--text); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--panel); }
.dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--k, var(--accent))); display: inline-block; flex: none; }
.week { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden; }
.week-headrow, .week-allday, .week-body { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.week-headrow, .week-allday { overflow-y: hidden; scrollbar-gutter: stable; }
.week-scroll { max-height: max(420px, calc(100dvh - var(--top) - 210px)); overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior: contain; }
.week-headrow { border-bottom: 1px solid var(--line); background: var(--panel); }
.dayhead { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 0; color: var(--ink-3); }
.dayhead:hover { text-decoration: none; background: var(--hover); }
.dayname { font-size: 0.78rem; font-weight: 600; text-transform: capitalize; }
.daynum { font: 650 0.95rem/1 var(--text); color: var(--ink); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; }
.dayhead.is-today .daynum { background: var(--red); color: #fff; }
.dayhead.is-today .dayname { color: var(--red); }
.week-allday { border-bottom: 1px solid var(--line); min-height: 32px; }
.week-allday .gutter span { font-size: 0.66rem; color: var(--ink-3); display: block; text-align: right; padding: 9px 8px 0 0; }
.allday-cell { border-left: 1px solid var(--line); padding: 4px; display: grid; gap: 3px; align-content: start; min-width: 0; }
.chip-ev { font: 600 0.74rem/1.3 var(--text); padding: 3px 8px; border-radius: 5px; border: 0; text-align: left; cursor: pointer; color: var(--on, #fff);
  background: var(--c, var(--accent)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-body .gutter { position: relative; }
.hour { position: absolute; right: 8px; transform: translateY(-50%); font-size: 0.68rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hour.t-0 { display: none; }
.daycol { position: relative; border-left: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour)); }
.daycol.is-today { background-color: color-mix(in srgb, var(--accent) 3.5%, transparent); }
.block { position: absolute; margin: 1px 2px 0 3px; padding: 4px 7px; border-radius: 6px; overflow: hidden; border: 0; text-align: left; cursor: pointer;
  color: var(--on, #fff); background: var(--c, var(--accent)); box-shadow: 0 0 0 1px var(--panel);
  font: 0.74rem/1.25 var(--text); display: flex; flex-direction: column; gap: 1px; transition: filter 0.12s, box-shadow 0.12s; }
.block:hover, .block:focus-visible { filter: brightness(1.06); box-shadow: 0 0 0 1px var(--panel), var(--shadow-2); z-index: 3; }
.block:focus-visible, .chip-ev:focus-visible, .ev-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.block.past, .chip-ev.past { opacity: 0.55; }
.block-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
.block-time, .block-place { opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block.short { flex-direction: row; gap: 6px; padding-top: 1px; padding-bottom: 1px; white-space: nowrap; }
.block.short .block-place { display: none; }
.block.short .block-title { flex: none; max-width: 100%; }
.ev:has(> .ev-row) { display: block; }
.ev-row { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: start; width: 100%; cursor: pointer; border-radius: 8px; }
.ev-dialog { width: min(400px, calc(100vw - 32px)); padding: 18px 20px 16px; border: 0; border-radius: var(--r-xl); background: var(--panel); color: var(--ink); box-shadow: var(--shadow-pop); }
.ev-dialog::backdrop { background: rgba(10, 12, 20, 0.35); }
.ev-d-head { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.ev-d-swatch { width: 14px; height: 14px; border-radius: 4px; margin-top: 6px; background: var(--c, var(--accent)); }
.ev-d-head h2 { font: 650 1.1rem/1.35 var(--text); margin: 0; overflow-wrap: anywhere; }
.ev-dialog p { margin: 8px 0 0 26px; color: var(--ink-2); font-size: 0.9rem; display: flex; gap: 8px; align-items: flex-start; }
.ev-dialog p .ico { width: 15px; height: 15px; flex: none; margin-top: 2px; margin-left: -23px; color: var(--ink-3); }
.ev-dialog p[hidden] { display: none; }
.now-line { position: absolute; left: -1px; right: 0; height: 2px; background: var(--red); z-index: 2; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.daystrip, .daylist { display: none; }
.agenda-foot, .mails-foot { margin-top: 14px; }
.setup { max-width: 640px; }
.setup h2 { font-size: 1.25rem; margin-bottom: 8px; }
.setup p { margin-bottom: 8px; color: var(--ink-2); }
.steps { padding-left: 1.3em; display: grid; gap: 8px; margin: 12px 0; }

/* ---------- mails : liste + volet de lecture ---------- */
.cat-important { --k: var(--red); }
.cat-a_traiter { --k: var(--amber); }
.cat-info { --k: var(--accent); }
.cat-promo { --k: var(--ink-3); }
.brief-mails { margin-bottom: 18px; }
.brief-mails .brief-lines li { font-size: 0.96rem; }
.mailview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.seg-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--sunken); margin-bottom: 14px; }
.seg-tabs .seg span { color: var(--ink-3); font-weight: 600; }
.seg-tabs .dot { background: var(--k); }
.mail-group { margin-bottom: 18px; scroll-margin-top: calc(var(--top) + 12px); }
.group-title { display: flex; align-items: center; gap: 8px; font: 650 0.82rem var(--text); color: var(--ink-2); margin: 0 0 8px 4px; letter-spacing: 0; }
.group-title .dot { background: var(--k); }
.mail-list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden; }
.mail + .mail { border-top: 1px solid var(--line); }
.mail-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; width: 100%; text-align: left; padding: 12px 14px; position: relative; transition: background 0.1s; }
.mail-row:hover { background: var(--hover); }
.mail-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--k); opacity: 0; transition: opacity 0.12s; }
.mail.is-selected .mail-row { background: var(--accent-soft); }
.mail.is-selected .mail-summary { color: var(--ink-2); }
.mail.is-selected .mail-row::before { opacity: 1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 0.86rem var(--display); flex: none;
  background: color-mix(in srgb, var(--k, var(--accent)) 16%, var(--panel)); color: var(--ink); }
.mail-main { min-width: 0; display: grid; gap: 1px; }
.mail-top { display: flex; justify-content: space-between; gap: 12px; }
.mail-from { font-weight: 650; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-time { font-size: 0.76rem; color: var(--ink-3); flex: none; font-variant-numeric: tabular-nums; }
.mail-subject { font-weight: 520; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-summary { font-size: 0.84rem; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.todo { display: inline-flex; align-items: center; gap: 5px; width: fit-content; font-size: 0.76rem; font-weight: 600; padding: 2px 8px 2px 6px; margin-top: 5px;
  border-radius: 6px; background: color-mix(in srgb, var(--k, var(--accent)) 13%, var(--panel)); color: var(--ink); }
.todo .ico { width: 13px; height: 13px; stroke-width: 2.2; }
.mail-detail { display: none; }
.reader { position: sticky; top: calc(var(--top) + 16px); min-height: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); padding: 24px 26px; max-height: calc(100vh - var(--top) - 32px); overflow-y: auto; }
.reader-empty { height: 100%; min-height: 360px; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; color: var(--ink-3); }
.reader-empty .ico { width: 32px; height: 32px; stroke-width: 1.3; }
.rd-subject { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; margin-bottom: 14px; }
.rd-from { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.rd-from > span:nth-child(2) { display: grid; min-width: 0; margin-right: auto; }
.rd-from small { color: var(--ink-3); font-size: 0.8rem; overflow-wrap: anywhere; }
.rd-miko { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); background: var(--ai-soft); border: 1px solid var(--line); margin-bottom: 16px; }
.rd-miko p { margin: 0 0 4px; }
.rd-miko .todo { margin-top: 4px; }
.rd-excerpt { color: var(--ink-2); font-size: 0.92rem; line-height: 1.65; white-space: pre-wrap; padding: 0 2px; }
.rd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

/* ---------- coffre et notes ---------- */
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  margin-bottom: 22px; color: var(--ink-3); box-shadow: var(--shadow-1); max-width: 720px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; border: 0; outline: none; background: none; color: var(--ink); font: 0.98rem var(--text); padding: 11px 0; min-width: 0; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.group { scroll-margin-top: calc(var(--top) + 12px); }
.more { font-size: 0.82rem; color: var(--ink-3); margin-top: 8px; }
.result-count { color: var(--ink-3); margin: -8px 0 12px; }
.results { list-style: none; padding: 0; margin: 0; max-width: 760px; display: grid; gap: 8px; }
.results a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 12px 16px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.results a:hover { text-decoration: none; border-color: var(--line-2); }
.results .row-title { white-space: normal; }
.snippet { grid-column: 1 / -1; font-size: 0.86rem; color: var(--ink-3); }
.narrow { max-width: 760px; margin: 0 auto; }
.note-title { font-size: clamp(1.9rem, 3.4vw, 2.5rem); font-weight: 740; letter-spacing: -0.04em; line-height: 1.08; margin: 6px 0 18px; }
.props { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 20px; margin: 0 0 28px; padding: 14px 16px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 0.86rem; }
.props dt { color: var(--ink-3); font-size: 0.74rem; }
.props dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.prose { max-width: 68ch; font-size: 1rem; line-height: 1.7; }
.prose h1 { font-size: 1.6rem; margin: 1.6em 0 0.5em; }
.prose h2 { font-size: 1.25rem; margin: 1.8em 0 0.5em; }
.prose h3 { font-size: 1.05rem; margin: 1.5em 0 0.4em; }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote { margin: 0 0 1em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 3px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.9rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 7px 10px 7px 0; text-align: left; vertical-align: top; }
.prose blockquote { padding: 2px 0 2px 16px; border-left: 3px solid var(--line-2); color: var(--ink-2); }
.prose blockquote.callout { color: var(--ink); border-left-color: var(--accent); background: var(--accent-soft); border-radius: 0 12px 12px 0; padding: 12px 16px; }
.prose blockquote.callout[data-callout="focus"] { border-left-color: var(--amber); background: var(--amber-soft); }
.prose blockquote.callout[data-callout="tip"] { border-left-color: var(--green); background: var(--green-soft); }
.prose blockquote.callout[data-callout="info"] { border-left-color: var(--ink-3); background: var(--panel-2); }
.prose blockquote.callout > :last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; margin: 0 0 6px; }
.prose li.task { list-style: none; margin-left: -1.4em; display: flex; gap: 10px; align-items: baseline; }
.prose li.task::before { content: ""; flex: none; width: 15px; height: 15px; border: 1.5px solid var(--ink-3); border-radius: 50%; transform: translateY(2px); }
.prose li.task[data-done="1"] { color: var(--ink-3); text-decoration: line-through; }
.prose li.task[data-done="1"]::before { background: var(--accent); border-color: var(--accent); }
.prose mark { background: rgba(255, 214, 0, 0.35); color: inherit; padding: 0 2px; border-radius: 3px; }
.base-hint { font-size: 0.86rem; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 14px; }
.note-foot { margin-top: 40px; font-size: 0.8rem; color: var(--ink-3); }
.flash { padding: 11px 16px; border-radius: 12px; margin: 0 0 18px; }
.flash-error { background: var(--red-soft); color: var(--red); }

/* ---------- Miko : page et panneau ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.chip span { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 0.82rem; color: var(--ink-2); background: var(--panel); transition: all 0.12s; }
.chip-sensitive span { border-style: dashed; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chat { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - var(--top) - 116px); }
.chat-hero { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 18px 0 22px; }
.chat-title { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 720; letter-spacing: -0.035em; }
.context { border: 0; padding: 0; margin: 0 0 16px; }
.context legend { font-size: 0.84rem; color: var(--ink-3); margin-bottom: 8px; padding: 0; }
.context .hint { margin-top: 8px; }
.suggestions { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 4px 0 18px; }
.suggestions button, .quick button { text-align: left; padding: 11px 14px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line);
  font-weight: 600; font-size: 0.87rem; box-shadow: var(--shadow-1); transition: border-color 0.12s, color 0.12s; }
.suggestions button:hover, .quick button:hover { border-color: var(--accent); color: var(--accent-ink); }
.messages { list-style: none; margin: 0 0 18px; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 88%; overflow-wrap: anywhere; line-height: 1.55; font-size: 0.95rem; }
.msg.new { animation: rise 0.22s var(--ease); }
.msg-user { align-self: flex-end; background: var(--accent); color: var(--on-accent); padding: 9px 14px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; }
.msg-miko { align-self: flex-start; position: relative; padding: 0 0 0 36px; }
.msg-miko::before { content: ""; position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 8px; background: var(--ai); }
.msg-miko::after { content: ""; position: absolute; left: 7px; top: 8px; width: 10px; height: 10px; background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.msg-miko p { margin: 0 0 0.6em; }
.msg-miko p:last-child, .msg-miko ul:last-child, .msg-miko ol:last-child { margin-bottom: 0; }
.msg-miko ul, .msg-miko ol { margin: 0 0 0.6em; padding-left: 1.2em; }
.msg-miko li { margin: 2px 0; }
.msg-miko code { font-size: 0.85em; }
.msg-miko .md-h { display: block; font-weight: 700; margin: 0.4em 0 0.2em; }
.msg.intro { color: var(--ink-2); }
.msg.pending { color: var(--ink-3); }
.msg.pending .dots-anim { display: inline-flex; gap: 4px; }
.dots-anim i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.dots-anim i:nth-child(2) { animation-delay: 0.2s; }
.dots-anim i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.msg-error { align-self: flex-start; background: var(--red-soft); color: var(--red); padding: 9px 14px; border-radius: 12px; }
.composer { position: sticky; bottom: 18px; display: flex; gap: 8px; align-items: flex-end; padding: 8px 8px 8px 16px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-pop); }
.composer:focus-within { border-color: var(--accent); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; background: none; color: var(--ink); font: 0.97rem/1.5 var(--text); padding: 6px 0; max-height: 180px; }
.composer textarea::placeholder { color: var(--ink-3); }
.model { font-size: 0.74rem; color: var(--ink-3); margin: 10px 4px 0; text-align: center; }

.miko-panel { position: fixed; z-index: 40; right: 14px; top: calc(var(--top) + 10px); bottom: 14px; width: min(420px, calc(100vw - 28px));
  display: flex; flex-direction: column; background: var(--panel); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); overflow: hidden;
  animation: slide-in 0.26s var(--ease); }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px) scale(0.99); } to { opacity: 1; transform: none; } }
.miko-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.miko-name { display: flex; align-items: center; gap: 9px; font: 700 1.02rem var(--display); }
.miko-name small { font: 600 0.7rem var(--text); color: var(--ink-3); background: var(--sunken); padding: 2px 7px; border-radius: 999px; }
.miko-tools { display: flex; gap: 2px; }
.miko-ctx { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.miko-ctx .chip span { padding: 3px 10px; font-size: 0.78rem; }
.miko-panel .messages { flex: 1; overflow-y: auto; padding: 16px 16px 8px; margin: 0; }
.miko-panel .msg { max-width: 94%; font-size: 0.92rem; }
.quick { display: flex; gap: 6px; padding: 0 14px 10px; flex-wrap: wrap; }
.quick button { padding: 6px 10px; font-size: 0.8rem; border-radius: 999px; box-shadow: none; }
.miko-panel .composer { position: static; margin: 0 12px 12px; box-shadow: none; border-radius: 14px; }
body.miko-open .workspace { transition: padding 0.2s var(--ease); }

/* ---------- connexion ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login-wrap::before { content: ""; position: absolute; width: 640px; height: 640px; border-radius: 50%; background: var(--ai); opacity: 0.16; filter: blur(110px); top: -220px; left: 50%; transform: translateX(-50%); }
.login { position: relative; width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 34px 30px; box-shadow: var(--shadow-pop); }
.login-mark { border-radius: 14px; }
.login h1 { font-size: 2.2rem; margin: 16px 0 2px; letter-spacing: -0.045em; }
.login-sub { color: var(--ink-3); margin: 0 0 24px; }
.login-form label { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: 6px; }
.login-form input { width: 100%; font: 1rem var(--text); padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); margin-bottom: 14px; }
.login-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login .primary { width: 100%; padding: 11px; }
.field-error { color: var(--red); font-size: 0.88rem; margin: -6px 0 14px; }

/* ---------- fenêtres : note et recherche ---------- */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(8, 10, 20, 0.42); backdrop-filter: blur(4px); }
dialog[open] { animation: pop 0.2s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.985); } to { opacity: 1; transform: none; } }
.sheet { width: min(620px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow-pop); }
.capture { position: relative; padding: 16px 20px 16px 58px; }
.capture::before { content: ""; position: absolute; top: 0; bottom: 0; left: 40px; width: 1px; background: var(--margin); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h2 { font: 600 0.9rem var(--text); color: var(--ink-3); letter-spacing: 0; }
.capture textarea { display: block; width: 100%; min-height: 144px; resize: none; border: 0; outline: none; padding: 0; margin: 0; color: var(--ink); caret-color: var(--accent);
  font: 500 1.35rem/36px var(--display); letter-spacing: -0.012em;
  background: repeating-linear-gradient(to bottom, transparent 0 35px, var(--rule) 35px 36px); background-attachment: local; }
.capture textarea::placeholder { color: var(--ink-3); }
.capture-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.palette { width: min(640px, calc(100vw - 32px)); margin-top: 12vh; padding: 0; border: 0; border-radius: 18px; background: var(--panel); box-shadow: var(--shadow-pop); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.palette-input .ico { width: 20px; height: 20px; }
.palette-input input { flex: 1; border: 0; outline: none; background: none; color: var(--ink); font: 1.05rem var(--text); min-width: 0; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 58vh); overflow-y: auto; }
.palette-list .sep { font-size: 0.72rem; color: var(--ink-3); padding: 10px 12px 4px; font-weight: 600; }
.palette-list a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--ink); font-size: 0.93rem; }
.palette-list a:hover, .palette-list a[aria-selected="true"] { background: var(--accent-soft); text-decoration: none; }
.palette-list a[aria-selected="true"] .ico { color: var(--accent-ink); }
.palette-list .p-meta { margin-left: auto; font-size: 0.76rem; color: var(--ink-3); white-space: nowrap; }
.palette-list .ico { color: var(--ink-3); }
.palette-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--ink-3); }
.palette-foot kbd { margin-right: 3px; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-pop); font-weight: 550; font-size: 0.9rem;
  max-width: calc(100vw - 32px); animation: rise 0.25s var(--ease); }
.toast a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.toast-ok .ico { color: var(--green); }
.toast-error { background: var(--red); color: #fff; }
.tabbar { display: none; }

/* ---------- largeurs moyennes ---------- */
@media (max-width: 1180px) {
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 > :last-child { grid-column: 1 / -1; }
  .mailview { grid-template-columns: minmax(0, 1fr); }
  .reader { display: none; }
  .mail.is-open .mail-detail { display: block; padding: 4px 16px 18px 60px; animation: rise 0.2s var(--ease); }
  .mail.is-open .mail-detail .rd-subject, .mail.is-open .mail-detail .rd-from { display: none; }
}
@media (min-width: 1281px) {
  body.miko-open .workspace { padding-right: 434px; }
  body.miko-open .topbar { margin-right: -434px; }
}
@media (min-width: 1181px) {
  body.miko-open .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.miko-open .grid3 > :last-child { grid-column: 1 / -1; }
}

/* ---------- téléphone ---------- */
@media (max-width: 860px) {
  .app { display: block; }
  .sidebar { display: none; }
  .topbar { top: env(safe-area-inset-top, 0px); padding: 0 max(12px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); gap: 10px; }
  .tb-brand { display: inline-flex; }
  .tb-brand img { border-radius: 7px; }
  .tb-mobile { display: inline-grid; }
  .tb-sub { display: none; }
  .ask-miko { display: none; }
  .tb-actions .button span { display: none; }
  .tb-actions .button { padding: 8px; }
  .main { padding: 16px max(16px, env(safe-area-inset-right)) calc(100px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .hello { font-size: 2rem; }
  .brief { padding: 16px; }
  .brief-lines li { font-size: 0.97rem; }
  .grid3, .grid2 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .grid3 > :last-child { grid-column: auto; }
  .card { padding: 16px; }
  .projects { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .groups { grid-template-columns: minmax(0, 1fr); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--panel) 86%, transparent); backdrop-filter: saturate(1.5) blur(18px); -webkit-backdrop-filter: saturate(1.5) blur(18px);
    border-top: 1px solid var(--line); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0; color: var(--ink-3); font-size: 0.66rem; font-weight: 600; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a .ico { width: 23px; height: 23px; }
  .tabbar a.on { color: var(--accent-ink); }
  .tabbar .badge { position: absolute; top: 0; left: calc(50% + 5px); }
  .tab-fab { justify-self: center; width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; background: var(--ai); color: #fff;
    box-shadow: 0 8px 20px -6px rgba(139, 92, 246, 0.6); transform: translateY(-6px); }
  .tab-fab .ico { width: 26px; height: 26px; stroke-width: 2.2; }
  .week { display: none; }
  .daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; position: sticky; top: calc(var(--top) + env(safe-area-inset-top, 0px)); z-index: 5;
    background: var(--bg); padding: 8px 0 10px; margin: -4px 0 6px; }
  .daystrip a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; color: var(--ink-3); font-size: 0.7rem; font-weight: 600; }
  .daystrip a:hover { text-decoration: none; }
  .daystrip strong { font: 650 1rem/1.2 var(--text); color: var(--ink); }
  .daystrip a.is-today { background: var(--red); color: #fff; }
  .daystrip a.is-today strong { color: var(--panel); }
  .dots { display: flex; gap: 3px; height: 5px; font-style: normal; }
  .dots b { width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--accent)); }
  .daystrip a.is-today .dots b { background: #fff; }
  .daylist { display: grid; gap: 12px; }
  .day-section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 14px 8px; scroll-margin-top: calc(var(--top) + 80px); box-shadow: var(--shadow-1); }
  .day-section h2 { font-size: 0.98rem; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .day-section.is-today { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
  .today-badge { font: 650 0.7rem var(--text); color: var(--red); background: var(--red-soft); padding: 2px 8px; border-radius: 999px; }
  .mail.is-open .mail-detail { padding: 2px 14px 16px 14px; }
  .rd-actions .primary, .rd-actions .button { flex: 1; }
  .chat { min-height: 0; }
  .chat-hero { padding: 6px 0 14px; }
  .page-miko .main { padding-bottom: calc(200px + env(safe-area-inset-bottom)); }
  .page-miko .context .hint { display: none; }
  .composer { position: fixed; z-index: 25; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .sheet { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .capture { padding-left: 46px; }
  .capture::before { left: 30px; }
  .palette { margin-top: 12px; }
  .palette-foot { display: none; }
  .miko-panel { inset: auto 0 0 0; width: 100%; height: 86vh; border-radius: 22px 22px 0 0; top: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ---------- classes générées : placement dans la grille de l'agenda et anneaux de progression (sans style en ligne) ---------- */
.t-0{top:calc(0*var(--q))} .t-1{top:calc(1*var(--q))} .t-2{top:calc(2*var(--q))} .t-3{top:calc(3*var(--q))} .t-4{top:calc(4*var(--q))} .t-5{top:calc(5*var(--q))} .t-6{top:calc(6*var(--q))} .t-7{top:calc(7*var(--q))} .t-8{top:calc(8*var(--q))} .t-9{top:calc(9*var(--q))} .t-10{top:calc(10*var(--q))} .t-11{top:calc(11*var(--q))} .t-12{top:calc(12*var(--q))} .t-13{top:calc(13*var(--q))} .t-14{top:calc(14*var(--q))} .t-15{top:calc(15*var(--q))} .t-16{top:calc(16*var(--q))} .t-17{top:calc(17*var(--q))} .t-18{top:calc(18*var(--q))} .t-19{top:calc(19*var(--q))} .t-20{top:calc(20*var(--q))} .t-21{top:calc(21*var(--q))} .t-22{top:calc(22*var(--q))} .t-23{top:calc(23*var(--q))} .t-24{top:calc(24*var(--q))} .t-25{top:calc(25*var(--q))} .t-26{top:calc(26*var(--q))} .t-27{top:calc(27*var(--q))} .t-28{top:calc(28*var(--q))} .t-29{top:calc(29*var(--q))} .t-30{top:calc(30*var(--q))} .t-31{top:calc(31*var(--q))} .t-32{top:calc(32*var(--q))} .t-33{top:calc(33*var(--q))} .t-34{top:calc(34*var(--q))} .t-35{top:calc(35*var(--q))} .t-36{top:calc(36*var(--q))} .t-37{top:calc(37*var(--q))} .t-38{top:calc(38*var(--q))} .t-39{top:calc(39*var(--q))} .t-40{top:calc(40*var(--q))} .t-41{top:calc(41*var(--q))} .t-42{top:calc(42*var(--q))} .t-43{top:calc(43*var(--q))} .t-44{top:calc(44*var(--q))} .t-45{top:calc(45*var(--q))} .t-46{top:calc(46*var(--q))} .t-47{top:calc(47*var(--q))} .t-48{top:calc(48*var(--q))} .t-49{top:calc(49*var(--q))} .t-50{top:calc(50*var(--q))} .t-51{top:calc(51*var(--q))} .t-52{top:calc(52*var(--q))} .t-53{top:calc(53*var(--q))} .t-54{top:calc(54*var(--q))} .t-55{top:calc(55*var(--q))} .t-56{top:calc(56*var(--q))} .t-57{top:calc(57*var(--q))} .t-58{top:calc(58*var(--q))} .t-59{top:calc(59*var(--q))} .t-60{top:calc(60*var(--q))} .t-61{top:calc(61*var(--q))} .t-62{top:calc(62*var(--q))} .t-63{top:calc(63*var(--q))} .t-64{top:calc(64*var(--q))} .t-65{top:calc(65*var(--q))} .t-66{top:calc(66*var(--q))} .t-67{top:calc(67*var(--q))} .t-68{top:calc(68*var(--q))} .t-69{top:calc(69*var(--q))} .t-70{top:calc(70*var(--q))} .t-71{top:calc(71*var(--q))} .t-72{top:calc(72*var(--q))} .t-73{top:calc(73*var(--q))} .t-74{top:calc(74*var(--q))} .t-75{top:calc(75*var(--q))} .t-76{top:calc(76*var(--q))} .t-77{top:calc(77*var(--q))} .t-78{top:calc(78*var(--q))} .t-79{top:calc(79*var(--q))} .t-80{top:calc(80*var(--q))} .t-81{top:calc(81*var(--q))} .t-82{top:calc(82*var(--q))} .t-83{top:calc(83*var(--q))} .t-84{top:calc(84*var(--q))} .t-85{top:calc(85*var(--q))} .t-86{top:calc(86*var(--q))} .t-87{top:calc(87*var(--q))} .t-88{top:calc(88*var(--q))} .t-89{top:calc(89*var(--q))} .t-90{top:calc(90*var(--q))} .t-91{top:calc(91*var(--q))} .t-92{top:calc(92*var(--q))} .t-93{top:calc(93*var(--q))} .t-94{top:calc(94*var(--q))} .t-95{top:calc(95*var(--q))} .t-96{top:calc(96*var(--q))}
.h-1{height:calc(1*var(--q) - 2px)} .h-2{height:calc(2*var(--q) - 2px)} .h-3{height:calc(3*var(--q) - 2px)} .h-4{height:calc(4*var(--q) - 2px)} .h-5{height:calc(5*var(--q) - 2px)} .h-6{height:calc(6*var(--q) - 2px)} .h-7{height:calc(7*var(--q) - 2px)} .h-8{height:calc(8*var(--q) - 2px)} .h-9{height:calc(9*var(--q) - 2px)} .h-10{height:calc(10*var(--q) - 2px)} .h-11{height:calc(11*var(--q) - 2px)} .h-12{height:calc(12*var(--q) - 2px)} .h-13{height:calc(13*var(--q) - 2px)} .h-14{height:calc(14*var(--q) - 2px)} .h-15{height:calc(15*var(--q) - 2px)} .h-16{height:calc(16*var(--q) - 2px)} .h-17{height:calc(17*var(--q) - 2px)} .h-18{height:calc(18*var(--q) - 2px)} .h-19{height:calc(19*var(--q) - 2px)} .h-20{height:calc(20*var(--q) - 2px)} .h-21{height:calc(21*var(--q) - 2px)} .h-22{height:calc(22*var(--q) - 2px)} .h-23{height:calc(23*var(--q) - 2px)} .h-24{height:calc(24*var(--q) - 2px)} .h-25{height:calc(25*var(--q) - 2px)} .h-26{height:calc(26*var(--q) - 2px)} .h-27{height:calc(27*var(--q) - 2px)} .h-28{height:calc(28*var(--q) - 2px)} .h-29{height:calc(29*var(--q) - 2px)} .h-30{height:calc(30*var(--q) - 2px)} .h-31{height:calc(31*var(--q) - 2px)} .h-32{height:calc(32*var(--q) - 2px)} .h-33{height:calc(33*var(--q) - 2px)} .h-34{height:calc(34*var(--q) - 2px)} .h-35{height:calc(35*var(--q) - 2px)} .h-36{height:calc(36*var(--q) - 2px)} .h-37{height:calc(37*var(--q) - 2px)} .h-38{height:calc(38*var(--q) - 2px)} .h-39{height:calc(39*var(--q) - 2px)} .h-40{height:calc(40*var(--q) - 2px)} .h-41{height:calc(41*var(--q) - 2px)} .h-42{height:calc(42*var(--q) - 2px)} .h-43{height:calc(43*var(--q) - 2px)} .h-44{height:calc(44*var(--q) - 2px)} .h-45{height:calc(45*var(--q) - 2px)} .h-46{height:calc(46*var(--q) - 2px)} .h-47{height:calc(47*var(--q) - 2px)} .h-48{height:calc(48*var(--q) - 2px)} .h-49{height:calc(49*var(--q) - 2px)} .h-50{height:calc(50*var(--q) - 2px)} .h-51{height:calc(51*var(--q) - 2px)} .h-52{height:calc(52*var(--q) - 2px)} .h-53{height:calc(53*var(--q) - 2px)} .h-54{height:calc(54*var(--q) - 2px)} .h-55{height:calc(55*var(--q) - 2px)} .h-56{height:calc(56*var(--q) - 2px)} .h-57{height:calc(57*var(--q) - 2px)} .h-58{height:calc(58*var(--q) - 2px)} .h-59{height:calc(59*var(--q) - 2px)} .h-60{height:calc(60*var(--q) - 2px)} .h-61{height:calc(61*var(--q) - 2px)} .h-62{height:calc(62*var(--q) - 2px)} .h-63{height:calc(63*var(--q) - 2px)} .h-64{height:calc(64*var(--q) - 2px)} .h-65{height:calc(65*var(--q) - 2px)} .h-66{height:calc(66*var(--q) - 2px)} .h-67{height:calc(67*var(--q) - 2px)} .h-68{height:calc(68*var(--q) - 2px)} .h-69{height:calc(69*var(--q) - 2px)} .h-70{height:calc(70*var(--q) - 2px)} .h-71{height:calc(71*var(--q) - 2px)} .h-72{height:calc(72*var(--q) - 2px)} .h-73{height:calc(73*var(--q) - 2px)} .h-74{height:calc(74*var(--q) - 2px)} .h-75{height:calc(75*var(--q) - 2px)} .h-76{height:calc(76*var(--q) - 2px)} .h-77{height:calc(77*var(--q) - 2px)} .h-78{height:calc(78*var(--q) - 2px)} .h-79{height:calc(79*var(--q) - 2px)} .h-80{height:calc(80*var(--q) - 2px)} .h-81{height:calc(81*var(--q) - 2px)} .h-82{height:calc(82*var(--q) - 2px)} .h-83{height:calc(83*var(--q) - 2px)} .h-84{height:calc(84*var(--q) - 2px)} .h-85{height:calc(85*var(--q) - 2px)} .h-86{height:calc(86*var(--q) - 2px)} .h-87{height:calc(87*var(--q) - 2px)} .h-88{height:calc(88*var(--q) - 2px)} .h-89{height:calc(89*var(--q) - 2px)} .h-90{height:calc(90*var(--q) - 2px)} .h-91{height:calc(91*var(--q) - 2px)} .h-92{height:calc(92*var(--q) - 2px)} .h-93{height:calc(93*var(--q) - 2px)} .h-94{height:calc(94*var(--q) - 2px)} .h-95{height:calc(95*var(--q) - 2px)} .h-96{height:calc(96*var(--q) - 2px)}
.lane-0-1{left:calc(0*100%/1);width:calc(100%/1 - 6px)}
.lane-0-2{left:calc(0*100%/2);width:calc(100%/2 - 6px)}
.lane-1-2{left:calc(1*100%/2);width:calc(100%/2 - 6px)}
.lane-0-3{left:calc(0*100%/3);width:calc(100%/3 - 6px)}
.lane-1-3{left:calc(1*100%/3);width:calc(100%/3 - 6px)}
.lane-2-3{left:calc(2*100%/3);width:calc(100%/3 - 6px)}
.lane-0-4{left:calc(0*100%/4);width:calc(100%/4 - 6px)}
.lane-1-4{left:calc(1*100%/4);width:calc(100%/4 - 6px)}
.lane-2-4{left:calc(2*100%/4);width:calc(100%/4 - 6px)}
.lane-3-4{left:calc(3*100%/4);width:calc(100%/4 - 6px)}
.sp-2-2{width:calc(100% - 6px)} .sp-2-3{width:calc(2*100%/3 - 6px)} .sp-3-3{width:calc(100% - 6px)}
.sp-2-4{width:calc(2*100%/4 - 6px)} .sp-3-4{width:calc(3*100%/4 - 6px)} .sp-4-4{width:calc(100% - 6px)}
.hours-1{height:calc(1*var(--hour))} .hours-2{height:calc(2*var(--hour))} .hours-3{height:calc(3*var(--hour))} .hours-4{height:calc(4*var(--hour))} .hours-5{height:calc(5*var(--hour))} .hours-6{height:calc(6*var(--hour))} .hours-7{height:calc(7*var(--hour))} .hours-8{height:calc(8*var(--hour))} .hours-9{height:calc(9*var(--hour))} .hours-10{height:calc(10*var(--hour))} .hours-11{height:calc(11*var(--hour))} .hours-12{height:calc(12*var(--hour))} .hours-13{height:calc(13*var(--hour))} .hours-14{height:calc(14*var(--hour))} .hours-15{height:calc(15*var(--hour))} .hours-16{height:calc(16*var(--hour))} .hours-17{height:calc(17*var(--hour))} .hours-18{height:calc(18*var(--hour))} .hours-19{height:calc(19*var(--hour))} .hours-20{height:calc(20*var(--hour))} .hours-21{height:calc(21*var(--hour))} .hours-22{height:calc(22*var(--hour))} .hours-23{height:calc(23*var(--hour))} .hours-24{height:calc(24*var(--hour))}
.p-0{--p:0%} .p-5{--p:5%} .p-10{--p:10%} .p-15{--p:15%} .p-20{--p:20%} .p-25{--p:25%} .p-30{--p:30%} .p-35{--p:35%} .p-40{--p:40%} .p-45{--p:45%} .p-50{--p:50%} .p-55{--p:55%} .p-60{--p:60%} .p-65{--p:65%} .p-70{--p:70%} .p-75{--p:75%} .p-80{--p:80%} .p-85{--p:85%} .p-90{--p:90%} .p-95{--p:95%} .p-100{--p:100%}
