:root {
  --bg: #0f1115; --card: #181b22; --line: #262b36;
  --txt: #e8eaed; --muted: #9aa3b2; --accent: #f0c000; --ok: #34d399; --err: #f87171;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--txt);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.screen { max-width: 640px; margin: 0 auto; padding: 20px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--err); min-height: 1.2em; font-size: .9rem; }

/* Login */
#login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px; width: 100%; max-width: 360px; text-align: center; }
.logo { font-size: 40px; }
.card h1 { font-size: 1.3rem; margin: 8px 0 2px; }
.card p { margin: 0 0 18px; font-size: .9rem; }
input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: #11141a; color: var(--txt); font-size: 1rem; margin-bottom: 12px; }
button { cursor: pointer; border: none; border-radius: 12px; font-size: 1rem; font-weight: 600; }
#loginBtn { width: 100%; padding: 13px; background: var(--accent); color: #111; }

/* App */
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.brand { font-weight: 700; font-size: 1.15rem; }
.status { width: 11px; height: 11px; border-radius: 50%; background: var(--muted); }
.status.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status.ko { background: var(--err); }

.badge-row { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.badge { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; text-align: center; }
.badge span { font-size: 1.6rem; font-weight: 700; display: block; }
.badge small { color: var(--muted); }
.ghost { flex: 1; background: transparent; border: 1px solid var(--line); color: var(--txt); padding: 12px; }
.ghost.on { border-color: var(--ok); color: var(--ok); }

.actions { display: flex; gap: 12px; margin-bottom: 24px; }
.action { flex: 1; text-align: center; text-decoration: none; background: var(--card); border: 1px solid var(--line); color: var(--txt); padding: 16px 10px; border-radius: 14px; font-weight: 600; }
.action:active { background: #1f2330; }

h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.list .from { font-weight: 600; }
.list .subj { color: var(--muted); font-size: .92rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .time { float: right; color: var(--muted); font-size: .78rem; }

/* Bouton réunion par mail */
.list li { position: relative; }
.mini { background: transparent; border: 1px solid var(--line); color: var(--accent); font-size: .8rem; font-weight: 600; padding: 6px 10px; margin-top: 8px; }
.small { font-size: .82rem; }
.ok { color: var(--ok); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal .sheet { background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); width: 100%; max-width: 640px; }
.sheet h3 { margin: 0 0 14px; }
.sheet label { display: block; font-size: .78rem; color: var(--muted); margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .05em; }
.sheet .row { display: flex; gap: 10px; margin-top: 16px; }
.sheet .row button { flex: 1; padding: 13px; }
#mCreate { background: var(--accent); color: #111; }
@media (min-width: 641px) { .modal { align-items: center; } .modal .sheet { border-radius: 18px; } }
