:root {
  color-scheme: dark;
  font-family: Verdana, Geneva, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111315;
  color: #e6e8e7;
  font-size: 16px;
  --muted: #9ba3a2;
  --accent: #b4df9f;
  --tag: #65ed88;
  --mention: #62b7ff;
  --line: #282d2e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body { margin: 0; height: 100dvh; display: grid; grid-template-rows: 72px minmax(0, 1fr) 40px; }
button, a, textarea { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, .stream:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
header { display: flex; align-items: center; justify-content: space-between; padding: 0 36px; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.account { border: 0; border-radius: 6px; padding: 7px 9px; color: var(--muted); background: transparent; font-size: 12px; }
.account:hover { color: #e6eee8; background: #202526; }
.wordmark { font-size: 25px; font-weight: 750; letter-spacing: -1.3px; color: #d6dcd7; text-decoration: none; }
.wordmark span { color: var(--accent); margin-left: 3px; }
.quiet { background: none; border: 0; color: var(--muted); width: 44px; height: 44px; }
kbd { font: 15px ui-monospace, monospace; border: 1px solid #404747; border-radius: 6px; padding: 4px 9px; }
main {
  width: calc(100% - 40px);
  margin: 0 auto;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: max(16px, calc(50% - 100px)) 144px minmax(0, 1fr);
  gap: 24px;
  transition: grid-template-rows 380ms cubic-bezier(.22, .68, .25, 1);
}
body.expanded main { grid-template-rows: 16px 144px minmax(0, 1fr); }
.composer {
  width: min(820px, 100%);
  justify-self: center;
  position: relative;
  z-index: 5;
  background: #202526;
  border: 1px solid #4c5b4e;
  border-radius: 16px;
  padding: 21px 24px 14px;
  box-shadow: 0 18px 48px #0005;
  display: flex;
  flex-direction: column;
}
.composer:focus-within { border-color: #829f73; }
textarea { display: block; background: transparent; color: #eef2ee; border: 0; resize: none; outline: none; width: 100%; flex: 1; min-height: 0; margin: 0 0 8px; padding: 0; font: inherit; font-size: 19px; line-height: 1.5; }
textarea::placeholder { color: #a1aaa4; }
#planning-picker, #mention-picker { position: absolute; top: calc(100% + 8px); left: 18px; right: 18px; z-index: 10; isolation: isolate; max-height: min(420px, 55vh); overflow: auto; padding: 8px; border: 1px solid #617564; border-radius: 10px; background-color: #171b1c; opacity: 1; box-shadow: 0 20px 48px #000, 0 0 0 1px #111; }
.planning-picker-heading { padding: 7px 9px 9px; color: var(--muted); font-size: 12px; }
.planning-option { display: flex; justify-content: space-between; gap: 16px; width: 100%; padding: 9px; border: 0; border-radius: 6px; color: #e2e9e4; background: transparent; text-align: left; }
.planning-option small { color: var(--muted); }
.planning-option.selected, .planning-option:hover { background: #2b382d; }
.planning-date { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; padding: 9px; border-top: 1px solid var(--line); color: #d7dfd9; font-size: 14px; }
.planning-date input { color-scheme: dark; max-width: 170px; border: 1px solid #48554b; border-radius: 5px; padding: 5px; color: #e2e9e4; background: #202526; }
.input-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
#submit { background: var(--accent); border: 0; border-radius: 8px; color: #1b2d18; width: 40px; height: 32px; font-size: 21px; flex-shrink: 0; }
button:disabled { opacity: .4; cursor: wait; }
.stream { width: 100%; justify-self: center; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #3a4240 transparent; padding: 6px 8px 24px; }
.stream-heading, #commands, .list-view { width: min(640px, 100%); margin-inline: auto; }
.week-view { width: min(720px, 100%); margin-inline: auto; }
.week-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 2px 0 20px; padding: 0 0 12px; border-bottom: 1px solid #3a423d; }
.week-header h2 { margin: 0; color: #d5ddd7; font-size: 15px; font-weight: 500; }
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-nav button { min-height: 30px; padding: 2px 8px; border: 0; border-radius: 5px; color: #b4bdb7; background: transparent; font-size: 13px; }
.week-nav button:hover:not(:disabled) { background: #242b27; color: #e6eee8; }
.week-nav button:disabled { cursor: default; }
.week-view .day-group + .day-group { margin-top: 20px; }
.week-view .day-group h2 { margin-top: 0; }
.week-view .empty { padding: 8px 0 12px; }
.day-browser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 640px) minmax(0, 1fr); gap: clamp(32px, 5vw, 88px); align-items: start; }
.day-browser .current-day { grid-column: 2; grid-row: 1; margin-top: 0; min-width: 0; position: relative; z-index: 2; }
.day-browser .previous-day { grid-column: 1; grid-row: 1; width: min(100%, 280px); justify-self: end; min-width: 0; margin-top: 0; color: #9ca69e; }
.side-day .entry p { font-size: 14px; line-height: 1.55; }
.side-day .entry { grid-template-columns: 14px minmax(0, 1fr); gap: 6px; padding-block: 6px; }
.side-day .entry time { display: none; }
.side-day .token { color: var(--tag); }
.side-day .token.mention { color: var(--mention); }
.side-day .rapid-marker { font-size: 15px; }
.side-day h2 { font-size: 12px; color: #949e98; }
.preview-open { background: none; border: 0; padding: 0 0 12px; color: var(--muted); font-size: 12px; }
.day-nav { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.day-nav button { background: transparent; border: 0; color: #b4bdb7; font-size: 13px; min-width: 28px; min-height: 28px; padding: 0 4px; }
.day-nav button:disabled { cursor: default; }
.current-day h2 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.entry.chosen { background: #354b36; border-radius: 8px; box-shadow: inset 0 0 0 2px #b4df9f, inset 6px 0 #b4df9f; color: #f5fff1; }
.entry.chosen p { color: #f5fff1; }
.entry.chosen .rapid-marker { color: #e1ffd3; }
.entry:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.entry.completed p { color: var(--muted); text-decoration: line-through; text-decoration-color: #657168; }
.entry.archived:not(.chosen) { opacity: .62; }
.entry.shared { border-left: 2px solid #47789d; }
button.rapid-marker { background: none; border: 0; padding: 0; min-height: 26px; }
button.rapid-marker:disabled { opacity: 1; cursor: default; }
.stream-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 10px; }
h1 { font-size: 14px; font-weight: 400; color: var(--muted); margin: 0; }
#count { font-size: 12px; color: var(--muted); }
.empty { padding: 24px 0; color: var(--muted); font-size: 14px; }
.day-group + .day-group { margin-top: 28px; }
.day-group h2 { margin: 8px 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 500; color: #b4bdb7; }
.entry { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 10px 12px; }
.session-divider { border: 0; border-top: 1px solid #39423c; margin: 22px 12px; }
.side-day .session-divider { margin: 16px 4px; border-color: #343c37; }
.rapid-marker { grid-column: 1; color: var(--muted); font: 18px/1.5 ui-monospace, monospace; }
.entry time { grid-column: 3; color: #909a94; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry p { grid-column: 2; margin: 0; font-size: 17px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-owner { grid-column: 2; color: #79bcea; font-size: 11px; }
.adopt-entry { grid-column: 2; justify-self: start; border: 0; padding: 2px 0; color: var(--muted); background: transparent; font-size: 11px; }
.adopt-entry:hover { color: #dfe9e2; text-decoration: underline; }
.restore-entry { grid-column: 2; justify-self: start; color: var(--muted); font-size: 12px; }
.token { font: inherit; font-weight: 750; color: var(--tag); background: none; padding: 0; border: 0; }
.token.mention { color: var(--mention); }
.token:hover { text-decoration: underline; }
footer { display: flex; justify-content: center; align-items: center; padding: 0 20px; font-size: 12px; color: var(--muted); }
#status { overflow-wrap: anywhere; }
#status.error { color: #ffb3a7; padding: 10px 0; }
body:has(#status.error) { grid-template-rows: 72px minmax(0, 1fr) auto; }
.command { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: #d5ddd7; padding: 15px 8px; font-size: 14px; }
.command span { color: var(--muted); }
.command.selected { background: #222c23; border-radius: 5px; }
.command code { color: var(--accent); font-size: 14px; }
.help-note { color: var(--muted); font-size: 14px; line-height: 1.8; padding: 12px 8px; list-style: none; }
@media (max-width: 600px) {
  header { padding: 0 20px; }
  main { width: calc(100% - 32px); gap: 18px; }
  .composer { padding: 18px 18px 12px; }
  .stream { width: 100%; padding-inline: 4px; }
  .command { gap: 12px; flex-wrap: wrap; }
  .week-header { align-items: flex-start; flex-direction: column; gap: 8px; }
}
@media (max-width: 1100px) {
  .day-browser { grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr) minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 600px) {
  .day-browser { grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 16px; }
  .side-day .entry { display: block; }
  .side-day .rapid-marker { display: none; }
  .side-day .entry p { font-size: 12px; }
  .current-day h2 { align-items: flex-start; flex-direction: column; gap: 4px; }
  .current-day .entry { grid-template-columns: 14px minmax(0, 1fr); gap: 6px; }
  .current-day .entry time { grid-column: 2; font-size: 12px; }
}
@media (max-height: 540px) {
  body { height: auto; min-height: 100dvh; }
  main, body.expanded main { grid-template-rows: 0px 144px minmax(160px, 1fr); gap: 12px; }
  .stream { max-height: 60dvh; }
}
@media (prefers-reduced-motion: reduce) {
  main { transition: none; }
}

.day-browser > .day-group { transform-origin: left top; }
.day-browser .side-day { width: min(100%, 240px); min-width: 0; margin-top: 72px; opacity: .56; position: relative; z-index: 1; }
.day-browser .next-day { grid-column: 3; grid-row: 1; justify-self: start; }
.day-browser .side-day:focus-within { opacity: 1; }
.side-day .entry { padding-inline: 4px; }
.day-browser .side-day { filter: brightness(1); transition: opacity 900ms ease, filter 900ms ease, visibility 0s; }
body.side-days-revealing .day-browser .side-day { transition: none; }
body.side-days-hidden .day-browser .side-day {
  opacity: 0;
  filter: brightness(0);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 900ms ease, filter 900ms ease, visibility 0s 900ms;
}
@media (prefers-reduced-motion: reduce) {
  .day-browser .side-day, body.side-days-hidden .day-browser .side-day { transition: none; }
}
@media (max-width: 600px) {
  .day-browser .side-day { margin-top: 48px; }
  .side-day h2 { overflow-wrap: anywhere; }
  .side-day .empty, .preview-open { font-size: 12px; overflow-wrap: anywhere; }
}

#reply-context { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; color: var(--accent); font-size: 13px; }
#reply-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
#reply-audience { display: flex; flex-wrap: wrap; gap: 5px; }
#reply-audience button { border: 1px solid #456176; border-radius: 999px; padding: 2px 6px; color: #9ed1f5; background: #1b2932; font-size: 11px; }
#cancel-reply { border: 0; background: transparent; color: var(--muted); font-size: 20px; }

.entry.thread-reply { margin-left: calc(var(--thread-depth) * 18px); border-left: 2px solid #4a5e4e; }
.side-day .entry.thread-reply { margin-left: calc(var(--thread-depth) * 8px); }
@media (max-width: 600px) {
  .entry.thread-reply { margin-left: calc(var(--thread-depth) * 8px); }
}

.entry.archive-pending { background: #512e26; box-shadow: inset 0 0 0 2px #ffb08d, inset 6px 0 #ffb08d; border-radius: 8px; }
.archive-warning { grid-column: 1 / -1; color: #ffd2bc; font-size: 14px; font-weight: 600; }

.review-view { padding-top: 18px; }
.review-view .entry { padding: 22px 18px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.review-actions button { border: 1px solid #465447; border-radius: 7px; background: #202922; color: #dce8d8; padding: 10px 14px; font-size: 14px; }
.review-actions button:first-child { border-color: var(--accent); }
.review-finished { font-size: 18px; line-height: 1.6; margin: 20px 0; }

.type-heading { margin: 24px 12px 8px; color: #b9c5bc; font-size: 13px; font-weight: 600; }
.day-group h2 + .type-heading { margin-top: 16px; }
.side-day .type-heading { margin: 18px 4px 6px; font-size: 12px; }

#active-state { width: min(640px, 100%); margin: 0 auto 16px; display: flex; flex-wrap: wrap; gap: 6px 18px; color: #bfd4b5; font-size: 12px; line-height: 1.6; }
.command code { white-space: nowrap; }
#active-state button { font: inherit; color: inherit; background: transparent; border: 0; border-radius: 4px; padding: 0; text-align: left; }
#active-state button:hover { color: #e6f3df; text-decoration: underline; text-underline-offset: 3px; }

.composer.searching { background: #1c272e; border-color: #719fbd; }
.composer.searching:focus-within { border-color: #8ccaff; }
.composer.searching textarea { padding-left: 34px; }
.composer.searching #submit { background: #8ccaff; color: #142a3a; }
#search-icon { position: absolute; top: 25px; left: 24px; width: 22px; height: 22px; fill: none; stroke: #8ccaff; stroke-width: 1.8; stroke-linecap: round; }
@media (max-width: 600px) { #search-icon { top: 22px; left: 18px; } }

.reply-indicator { display: inline-block; margin-left: 10px; font-size: 12px; font-weight: 600; color: #bfd4b5; white-space: nowrap; vertical-align: baseline; }
.recurring-indicator { display: inline-block; margin-left: 9px; color: #9fc88e; font-size: 13px; font-weight: 700; }

.planning-section + .planning-section { margin-top: 30px; }
.planning-section > h2 { margin: 8px 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: #b4bdb7; font-size: 13px; font-weight: 500; }
.planning-upcoming { display: flex; justify-content: space-between; gap: 18px; padding: 10px 8px; color: #dce3de; }
.planning-upcoming time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.schedule { padding: 13px 8px; border-bottom: 1px solid var(--line); }
.schedule p { margin: 0 0 6px; }
.schedule small { color: var(--muted); }
.schedule.paused, .schedule.ended { opacity: .65; }
.schedule-actions { display: flex; gap: 9px; margin-top: 10px; }
.schedule-actions button { border: 1px solid #465447; border-radius: 6px; padding: 6px 9px; color: #dce8d8; background: #202922; font-size: 12px; }

.day-heading-label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.day-task-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.day-task-status.has-open-tasks { color: #f0c57e; }
.day-task-status.tasks-settled { color: #b4df9f; }
.day-task-status.no-tasks { color: var(--muted); font-weight: 400; }
.backup-details { margin-bottom: 12px; padding: 12px; border: 1px solid #715f40; border-radius: 8px; color: #f0d3a3; font-size: 14px; line-height: 1.5; }
.backup-details p { margin: 0 0 10px; }
.backup-details button { color: #182716; background: var(--accent); border: 0; padding: 8px 12px; border-radius: 6px; }
