:root {
  --blue-bg: #e0f0ff; --blue-fg: #003366; --blue-line: #2563eb;
  --pink-bg: #ffe0f0; --pink-fg: #660033; --pink-line: #db2777;
  --gray: #64748b; --line: #e2e8f0; --bg: #f8fafc; --card: #fff;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "Segoe UI", Roboto, "Hiragino Sans", sans-serif;
  background: var(--bg); color: #0f172a;
}
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }
.link-btn { background: none; border: none; color: var(--gray); text-decoration: underline; font-size: 13px; }

/* Login */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--card); padding: 36px; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.08); width: 340px; text-align: center; }
.login-box h1 { margin: 0 0 4px; font-size: 22px; }
.login-box .sub { margin: 0 0 24px; color: var(--gray); }
.who { display: flex; flex-direction: column; gap: 10px; }
.who-btn { padding: 14px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px; font-weight: 600; }
.who-btn:hover { border-color: var(--blue-line); }
#login-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
#login-form input { padding: 12px; border: 2px solid var(--line); border-radius: 10px; font-size: 15px; }
#login-form button[type=submit] { padding: 12px; border: none; border-radius: 10px; background: var(--blue-line); color: #fff; font-size: 15px; font-weight: 600; }
.error { color: #dc2626; font-size: 13px; min-height: 16px; margin: 4px 0 0; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: var(--card); border-bottom: 1px solid var(--line); }
.title { font-weight: 700; }
.title .range { color: var(--gray); font-weight: 400; font-size: 13px; margin-left: 8px; }
.user-info { display: flex; align-items: center; gap: 12px; }
.badge { padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge.stephane { background: var(--blue-bg); color: var(--blue-fg); }
.badge.haruka { background: var(--pink-bg); color: var(--pink-fg); }

/* Board */
.board { padding: 16px; max-width: 1100px; margin: 0 auto; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; background: #f1f5f9; border-bottom: 1px solid var(--line); }
.day-head .date { font-weight: 700; }
.day-head .dow { color: var(--gray); font-weight: 400; font-size: 13px; margin-left: 6px; }
.day-note { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.grid-head { display: grid; grid-template-columns: 70px 1fr 1fr; background: #fafcff; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--gray); }
.grid-head > div { padding: 6px 10px; }
.grid-head > div + div { border-left: 1px solid var(--line); }
.slot-row { display: grid; grid-template-columns: 70px 1fr 1fr; border-top: 1px solid var(--line); }
.slot-row:first-child { border-top: none; }
.slot-label { padding: 10px; font-weight: 700; color: var(--gray); background: #fafcff; display: flex; align-items: center; }
.cell { padding: 8px 10px; border-left: 1px solid var(--line); min-height: 46px; }
.cell .add { opacity: 0; border: 1px dashed var(--line); background: #fff; color: var(--gray); border-radius: 8px; padding: 3px 10px; font-size: 12px; transition: opacity .15s; }
.cell:hover .add { opacity: 1; }

/* Entrées */
.entry { position: relative; margin-bottom: 6px; padding: 6px 26px 6px 9px; border-radius: 6px; font-size: 14px; line-height: 1.35; word-break: break-word; }
.entry-stephane { background: var(--blue-bg); color: var(--blue-fg); border-left: 3px solid var(--blue-line); }
.entry-haruka { background: var(--pink-bg); color: var(--pink-fg); border-left: 3px solid var(--pink-line); }
.entry a { color: inherit; font-weight: 600; }
.entry .who-tag { display: block; font-size: 10px; opacity: .6; margin-bottom: 1px; text-transform: uppercase; letter-spacing: .04em; }
.entry .del { position: absolute; top: 3px; right: 4px; opacity: 0; border: none; background: rgba(0,0,0,.08); color: #000; border-radius: 6px; width: 20px; height: 20px; font-size: 12px; line-height: 1; }
.entry:hover .del { opacity: .7; }
.entry .del:hover { opacity: 1; background: #dc2626; color: #fff; }

/* Média */
.thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; cursor: zoom-in; vertical-align: middle; transition: transform .15s; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.thumb:hover { transform: scale(2.4); position: relative; z-index: 20; }
audio { height: 32px; max-width: 100%; vertical-align: middle; }
.voice-line { display: flex; align-items: center; gap: 8px; }
.transcript { font-style: italic; opacity: .85; }

/* Modale */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-card { background: #fff; padding: 20px; border-radius: 14px; width: 420px; max-width: 92vw; }
.modal-card h3 { margin: 0 0 12px; }
.modal-card textarea { width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 10px; font-size: 14px; font-family: inherit; resize: vertical; }
.modal-tools { display: flex; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.file-btn { border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font-size: 13px; background: #f8fafc; }
.rec-btn { border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font-size: 13px; background: #f8fafc; }
.rec-btn.recording { background: #dc2626; color: #fff; border-color: #dc2626; }
.file-label { font-size: 12px; color: var(--gray); }
.rec-status { font-size: 13px; color: var(--gray); min-height: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; align-items: center; margin-top: 6px; }
#modal-save { border: none; background: var(--blue-line); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 600; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 200; cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

@media (max-width: 640px) {
  .slot-row, .grid-head { grid-template-columns: 52px 1fr 1fr; }
  .thumb:hover { transform: scale(1.8); }
}
