:root {
  --ink: #17202B;
  --chalk: #EAF0EE;
  --paper: #F7FAF9;
  --signal: #0E9AA0;
  --marigold: #F0AE2E;
  --tomato: #E0483A;
  --plum: #5B4B8A;
  --muted: #5E6B78;
  --line: #CBD6D3;
  --page: #D5DEDB;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 16px/1.45 var(--body);
  min-height: 100vh;
}
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { display: block; font: 800 20px/1 var(--display); letter-spacing: -0.01em; }
.brand span { font-size: 13px; color: var(--muted); }
.clock { display: flex; align-items: center; gap: 10px; }
#clock-date { font: 700 16px var(--display); margin-right: 4px; }
.clock button {
  border: 0; border-radius: 999px; padding: 7px 16px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 14px;
}
.clock button.quiet { background: transparent; color: var(--muted); border: 1.5px solid var(--line); }

.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px;
  padding: 0 24px 20px; max-width: 1280px; margin: 0 auto;
}

/* ---------- the smart display ---------- */
.device {
  background: var(--ink);
  border-radius: 28px;
  padding: 16px;
  box-shadow: 0 18px 0 -8px #0d131a, 0 30px 40px -24px rgba(23, 32, 43, .55);
}
.screen {
  position: relative;
  aspect-ratio: 16 / 9.4;
  background: var(--chalk);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr) 6px;
}
.notice {
  margin: 12px 18px 0; padding: 6px 12px; border-radius: 8px;
  font-weight: 700; font-size: 14px; color: #fff; background: var(--signal);
  justify-self: start;
}
.notice.behind { background: var(--tomato); }
.card { padding: 14px 22px 4px; overflow: hidden; min-height: 0; }
.said { margin: 0; font-size: 17px; color: var(--ink); max-width: 62ch; }
.said.lead { font: 600 25px/1.28 var(--display); letter-spacing: -0.01em; max-width: 34ch; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; }
.card-head h1 { margin: 0; font: 800 30px/1 var(--display); }
.big-min { font: 700 20px var(--display); color: var(--muted); }
.today-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.today-list li {
  display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 12px;
  background: var(--paper); border-left: 6px solid var(--c); border-radius: 6px; padding: 7px 12px;
}
.today-list .tick {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--c);
  display: grid; place-items: center; font-size: 13px; color: #fff; font-weight: 700;
}
.today-list li.done .tick { background: var(--c); }
.today-list li.done .name { text-decoration: line-through; color: var(--muted); }
.today-list .name { font: 700 18px var(--display); }
.today-list .len { font-weight: 700; }
.today-list .due { color: var(--muted); font-size: 14px; }
.today-list .empty { border-left-color: var(--line); color: var(--muted); }

/* the week strip: the memorable part */
.week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  padding: 10px 18px 10px; min-height: 150px;
}
.day { display: grid; grid-template-rows: 1fr auto; min-height: 0; }
.col { position: relative; display: flex; align-items: flex-end; border-bottom: 2px solid var(--ink); }
.cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  border-top: 2px dashed var(--line);
}
.stack { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column-reverse; gap: 2px; }
.blk {
  background: var(--c); border-radius: 4px 4px 2px 2px; color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center; overflow: hidden;
  transition: height .45s ease;
}
.blk.done { background: repeating-linear-gradient(135deg, var(--c) 0 6px, color-mix(in srgb, var(--c) 70%, #fff) 6px 12px); }
.blk.missed { background: transparent; border: 2px dashed var(--tomato); color: var(--tomato); }
.blk.focus { box-shadow: 0 0 0 3px var(--ink); }
.flag {
  position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px;
  border-radius: 4px; border-bottom: 3px solid var(--c); text-align: center; line-height: 1.2;
  width: max-content; max-width: 96%; z-index: 2;
}
.flag + .flag { top: 40px; }
.lbl { text-align: center; padding-top: 4px; font-size: 13px; color: var(--muted); line-height: 1.2; }
.lbl b { color: var(--ink); }
.lbl i { display: block; font-style: normal; font-size: 11px; color: var(--plum); }
.day.is-today .lbl { background: var(--marigold); color: var(--ink); border-radius: 0 0 6px 6px; }
.day.past { opacity: .75; }

.voicebar { background: var(--ink); opacity: .15; }
.voicebar.talking {
  opacity: 1;
  background: linear-gradient(90deg, var(--signal), #7FD8D3, var(--signal));
  background-size: 200% 100%; animation: talk 1.2s linear infinite;
}
@keyframes talk { to { background-position: -200% 0; } }

.trace { margin-top: 18px; }
h2 { font: 700 15px var(--display); margin: 0 0 6px; color: var(--muted); }
.trace ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.trace li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.trace code {
  font: 700 12.5px ui-monospace, Consolas, monospace; background: var(--ink); color: #9FE3DF;
  padding: 2px 7px; border-radius: 4px; white-space: nowrap;
}
.trace .empty { color: var(--muted); }

/* ---------- conversation ---------- */
.talk {
  background: var(--paper); border-radius: 18px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; min-height: 0; max-height: calc(100vh - 80px);
}
.chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.msg { margin: 0; padding: 8px 12px; border-radius: 14px; max-width: 90%; font-size: 15px; }
.msg.you { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.msg.buddy { align-self: flex-start; background: var(--chalk); border-bottom-left-radius: 4px; border-left: 3px solid var(--signal); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 11px; font-size: 13px; color: var(--ink); text-align: left;
}
.chip:hover { border-color: var(--signal); }
.ask { display: flex; gap: 6px; }
.ask input {
  flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 14px; font: inherit;
}
.ask #send { border: 0; border-radius: 999px; background: var(--signal); color: #fff; font-weight: 700; padding: 0 16px; }
.mic { border: 0; border-radius: 50%; width: 42px; height: 42px; background: var(--chalk); color: var(--ink); display: grid; place-items: center; flex: none; }
.mic.on { background: var(--signal); color: #fff; }
.mic:disabled { opacity: .4; cursor: default; }
.memory ul { margin: 0; padding-left: 18px; font-size: 14px; }
.memory li { margin: 2px 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 0 16px 16px; }
  .top { padding: 10px 16px; flex-wrap: wrap; }
  .talk { max-height: none; }
  .device { padding: 10px; border-radius: 20px; }
  .screen { aspect-ratio: auto; min-height: 460px; }
  .said.lead { font-size: 20px; }
  .week { gap: 4px; padding: 6px 10px 10px; min-height: 190px; }
  .flag { font-size: 9px; padding: 1px 4px; }
  .blk span { display: none; }
  .today-list li { grid-template-columns: 22px 1fr auto; }
  .today-list .due { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .blk { transition: none; }
  .voicebar.talking { animation: none; }
}

/* fixed rows, so a hidden notice never shifts the screen */
.notice { grid-row: 1; }
.card { grid-row: 2; }
.week { grid-row: 3; }
.voicebar { grid-row: 4; }
