:root {
  color-scheme: dark;
  --bg: #08090b; --card: #0f1013; --text: #e9e6df; --muted: #8a8780; --line: #24242a;
  --accent: #c8a96a; --accent-text: #0a0a0a; --warn: #d9925f; --warn-bg: #1b130d;
  --travail: #c8a96a; --perso: #9a8fb8; --sport: #7fa58f; --famille: #bd8590; --pro: #55555c;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 720px; margin: 0 auto; padding: 20px 16px 96px; }
h1 { font: 400 28px/1.2 Georgia, "Times New Roman", serif; margin: 4px 0 2px; }
.monogram {
  width: 36px; height: 36px; margin: 8px auto 20px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--accent); color: var(--accent); font: 17px Georgia, "Times New Roman", serif;
}
h2 { font-size: 12px; margin: 28px 0 8px; color: var(--muted); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 14px; }
nav {
  position: fixed; inset: auto 0 0 0; display: flex; background: var(--bg);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
nav button {
  position: relative; flex: 1; padding: 16px 4px 18px; border: 0; background: none; color: var(--muted); cursor: pointer;
}
nav svg { width: 24px; height: 24px; }
nav button.on { color: var(--accent); }
nav button.on::after {
  content: ""; position: absolute; left: 50%; bottom: 8px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--accent);
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.block { display: flex; align-items: center; gap: 12px; border-left: 4px solid var(--pro); }
.block.travail { border-left-color: var(--travail); }
.block.perso { border-left-color: var(--perso); }
.block.sport { border-left-color: var(--sport); }
.block.famille { border-left-color: var(--famille); }
.block.done .title { text-decoration: line-through; color: var(--muted); }
.block .time { width: 104px; flex: none; font-size: 13px; color: var(--muted); white-space: nowrap; }
input[type=checkbox] { accent-color: var(--accent); }
.block .title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.block input[type=checkbox] { width: 24px; height: 24px; flex: none; }
.warn { background: var(--warn-bg); border-color: var(--warn); color: var(--text); }
textarea, input, select {
  font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; width: 100%;
}
input[type=checkbox] { width: auto; }
button.main, button.ghost {
  font: inherit; padding: 10px 16px; border-radius: 10px; cursor: pointer; margin: 6px 6px 0 0;
}
button.main { background: none; color: var(--accent); border: 1px solid var(--accent); }
button.ghost { background: none; color: var(--text); border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: wait; }
.row { display: grid; gap: 8px; grid-template-columns: 1fr 96px; align-items: center; margin: 8px 0; }
.row3 { display: grid; gap: 8px; grid-template-columns: 1fr 1fr 1fr; align-items: center; margin: 8px 0; }
.taskrow { display: grid; gap: 8px; grid-template-columns: 1fr 84px 36px; align-items: center; margin: 8px 0; }
.iconbtn { border: 1px solid var(--line); background: none; color: var(--text); border-radius: 8px; height: 40px; cursor: pointer; font: inherit; }
.days { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.days label { display: flex; align-items: center; gap: 3px; font-size: 13px; }
.error { color: var(--warn); }
#capture { text-align: center; margin: 16px 0; }
#capture #result, #capture details { text-align: left; }
.mic {
  position: relative; width: 72px; height: 72px; border-radius: 50%; cursor: pointer;
  background: none; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  display: inline-grid; place-items: center;
}
.mic::before {
  content: ""; position: absolute; inset: 9%; border-radius: 50%; border: 1px solid var(--line); pointer-events: none;
}
.mic svg { width: 28px; height: 28px; }
.bigmic { padding-top: 12vh; }
.bigmic .mic { width: 170px; height: 170px; }
.bigmic .mic svg { width: 40px; height: 40px; }
.mic.on { color: var(--warn); border-color: var(--warn); animation: listen 1.8s ease-in-out infinite; }
@keyframes listen { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--warn) 12%, transparent); } }
@media (prefers-reduced-motion: reduce) { .mic.on { animation: none; } }
#micState { margin-top: 14px; }
#capture details.write { text-align: center; margin-top: 10px; }
details.write textarea { margin-top: 8px; text-align: left; }
details.write summary {
  list-style: none; cursor: pointer; color: var(--muted); font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
}
details.write summary::-webkit-details-marker { display: none; }
.pick { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.taskrow.two { grid-template-columns: 1fr 104px; }
.taskrow.two label { display: flex; gap: 4px; align-items: center; }
.projectrow {
  display: flex; justify-content: space-between; gap: 12px; width: 100%; font: inherit; color: var(--text); cursor: pointer; text-align: left;
}
main.wide { max-width: 1180px; }
.calhead { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.calhead h1 { margin: 0 0 0 10px; font-size: 26px; }
.calyear { color: var(--muted); }
.calnav { width: 34px; height: 34px; border: 0; background: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; border-radius: 8px; }
.calnav:hover { color: var(--text); background: var(--card); }
.cal { margin: 12px 0; border-top: 1px solid var(--line); }
.calrow { display: flex; }
.calrow + .calrow { border-top: 1px solid var(--line); }
.calgutter { width: 44px; flex: none; }
.calhour { font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; box-sizing: border-box; transform: translateY(-7px); }
.calhour:first-child { visibility: hidden; }
.caldays, .calcols { flex: 1; min-width: 0; display: grid; }
.calday { padding: 12px 4px; text-align: center; font-size: 14px; color: var(--muted); }
.calchip { display: inline-block; min-width: 22px; padding: 1px 5px; border-radius: 6px; background: var(--accent); color: var(--accent-text); font-weight: 600; }
.allday { margin-top: 4px; padding: 2px 4px; font-size: 11px; color: var(--text); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.calcol {
  position: relative; border-left: 1px solid #18191e;
  background-image: linear-gradient(to bottom, #18191e 1px, transparent 1px);
}
.calnow { position: absolute; left: 0; right: 0; height: 1px; background: var(--accent); pointer-events: none; z-index: 3; }
.ev {
  --bar: var(--pro); --tint: #15161a; --ink: var(--text);
  position: absolute; box-sizing: border-box; display: block; padding: 5px 7px; overflow: hidden;
  border-radius: 6px; font-size: 12.5px; line-height: 15px; font-weight: 600; color: var(--ink);
  background: var(--tint); border: 1px solid color-mix(in srgb, var(--bar) 14%, transparent); border-left: 3px solid var(--bar);
  cursor: default; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.ev.movable { cursor: grab; }
.ev.task { --bar: var(--travail); }
.ev.task.perso { --bar: var(--perso); }
.ev.task.sport { --bar: var(--sport); }
.ev.task.famille { --bar: var(--famille); }
.ev.appointment { --bar: var(--accent); --tint: #221c10; --ink: #e6c98c; }
.ev.pro { --bar: #5b8fd9; --tint: #121a26; --ink: #a9c6ee; }
.ev.routine, .ev.personal { --bar: #d9925f; --tint: #21160f; --ink: #e8b692; }
.ev.done { opacity: .5; }
.ev.done .evtitle { text-decoration: line-through; }
.ev.dragging { z-index: 5; cursor: grabbing; box-shadow: 0 8px 22px rgba(0, 0, 0, .7); border-color: var(--accent); }
.ev.saving { opacity: .6; }
.evcheck { display: inline-block; vertical-align: -3px; width: 15px; height: 15px; margin-right: 5px; color: var(--bar); cursor: pointer; }
.evcheck svg { display: block; }
.evtitle { display: block; overflow-wrap: anywhere; }
.evtitle.clamped { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.evtime { display: none; position: absolute; right: 6px; bottom: 3px; font-size: 10px; color: var(--accent); }
.ev.dragging .evtime { display: block; }
@media (max-width: 719px) {
  .ev { padding: 4px 5px; font-size: 11.5px; line-height: 14px; }
  .evcheck { width: 12px; height: 12px; margin-right: 3px; vertical-align: -2px; }
}
.sheet { position: fixed; left: 16px; right: 16px; bottom: 84px; max-width: 480px; margin: 0 auto; z-index: 10; background: var(--card); }
.tweak { margin-top: 12px; }
