/* MESHORA — feuille de style commune (jetons : docs/DESIGN.md §3–5) */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

:root {
  --bg: #FFFFFF; --bg-2: #F6F7F9; --text: #2A2E35; --text-2: #5A616C;
  --accent: #3566C8; --ok: #2F7A5B; --note: #8A5A12; --err: #A8433A; --line: #E3E6EB;
  --radius: 14px; --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171C; --bg-2: #1D2128; --text: #E8EBF0; --text-2: #A9B0BB;
    --accent: #8DB0F5; --ok: #7CC4A2; --note: #E2B66B; --err: #E39A92; --line: #2C313A;
  }
}
:root[data-theme="dark"] {
  --bg: #14171C; --bg-2: #1D2128; --text: #E8EBF0; --text-2: #A9B0BB;
  --accent: #8DB0F5; --ok: #7CC4A2; --note: #E2B66B; --err: #E39A92; --line: #2C313A;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1rem/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
}
a { color: var(--accent); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

header.site { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 600; letter-spacing: .12em; }
.brand img { width: 32px; height: 32px; }
nav.site { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-weight: 500; }
nav.site a { color: var(--text-2); text-decoration: none; }
nav.site a:hover { color: var(--text); }
nav.site a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); }
.lang { font-size: .9rem; color: var(--text-2); }

.hero { padding: 48px 0 32px; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.15; margin: 0 0 12px; font-weight: 600; }
.muted { color: var(--text-2); }
.hero p { font-size: 1.15rem; color: var(--text-2); max-width: 60ch; margin: 0; }
.hero .kicker { font-size: .95rem; letter-spacing: .04em; color: var(--accent); margin: 0 0 10px; font-weight: 500; }

.cta-row { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; align-items: center; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 0.95rem; font-weight: 500; line-height: 1.2;
  padding: 10px 18px; border-radius: var(--radius); text-decoration: none;
  cursor: pointer; border: 1px solid transparent; transition: all 180ms var(--ease);
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #FFFFFF; }
:root[data-theme="dark"] .btn-primary, @media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { color: #14171C; }
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-2); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { background: var(--line); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }
.btn-share { background: transparent; color: var(--text-2); border-color: var(--line); }
.btn-share:hover { color: var(--text); border-color: var(--text-2); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2, .card h3 { margin: 0 0 6px; font-size: 1.1rem; font-weight: 600; }
.card p { margin: 0; color: var(--text-2); }
.card.featured { border-color: var(--accent); }

section { padding: 16px 0 24px; }
section > h2 { font-size: 1.4rem; font-weight: 600; margin: 0 0 8px; }

.status { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-2); flex-shrink: 0; }
td .status { align-items: baseline; }
.dot.ok { background: var(--ok); } 
.dot.note { background: var(--note); }
.dot.err { background: var(--err); }

.notice { border-left: 3px solid var(--accent); padding: 12px 16px; background: var(--bg-2); border-radius: 0 var(--radius) var(--radius) 0; }
.notice.warning { border-left-color: var(--note); }

table.platforms { width: 100%; border-collapse: collapse; }
table.platforms th, table.platforms td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.platforms th { font-weight: 500; color: var(--text-2); font-size: .9rem; }

footer.site { padding: 32px 0 48px; color: var(--text-2); font-size: .9rem; border-top: 1px solid var(--line); margin-top: 40px; }

.orbit { animation: spin 24s linear infinite; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .orbit { animation: none; } }

/* Toast Notification */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--text); color: var(--bg); padding: 10px 20px; border-radius: 30px;
  font-size: 0.9rem; font-weight: 500; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none; transition: all 250ms var(--ease); z-index: 1000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Application Web & Prototype (/app) --- */
.app-shell { max-width: 600px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); border-inline: 1px solid var(--line); }
.app-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.sim-banner { background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 6px 16px; font-size: 0.8rem; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; }

.app-content { flex: 1; padding: 16px; overflow-y: auto; }

.nav-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: var(--bg-2); }
.tab-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px;
  background: transparent; border: none; color: var(--text-2); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: color 150ms var(--ease);
}
.tab-btn svg { width: 20px; height: 20px; fill: currentColor; }
.tab-btn.active { color: var(--accent); }

/* Chat view */
.chat-stream { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; min-height: 220px; }
.msg-bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 0.92rem;
  background: var(--bg-2); border: 1px solid var(--line); align-self: flex-start;
}
.msg-bubble.me { align-self: flex-end; background: var(--accent); color: #FFFFFF; border-color: transparent; }
:root[data-theme="dark"] .msg-bubble.me, @media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .msg-bubble.me { color: #14171C; }
}
.msg-meta { font-size: 0.72rem; opacity: 0.8; margin-top: 4px; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }

.chat-input-row { display: flex; gap: 8px; margin-top: 8px; }
.chat-input {
  flex: 1; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-family: inherit; font-size: 0.95rem;
}
.chat-input:focus { outline: 2px solid var(--accent); }

/* Diagnostic Dialog / Drawer */
.dialog-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none;
  align-items: center; justify-content: center; z-index: 999; padding: 16px;
}
.dialog-overlay.open { display: flex; }
.dialog-box {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  max-width: 500px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 24px;
}
.dialog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

@media (max-width: 600px) {
  header.site { flex-direction: column; align-items: flex-start; gap: 10px; }
  table.platforms th:nth-child(3), table.platforms td:nth-child(3) { font-size: .85rem; }
  .app-shell { border-inline: none; }
}
