/* Brand primaryColor is TODO(product). Change this neutral accent token when chosen. */
:root {
  --accent: #43565a;
  --bg: #f5f5f1;
  --surface: #ffffff;
  --text: #202b2c;
  --muted: #536467;
  --line: #d6dedb;
  --danger: #b52d37;
  --focus: #17607a;
  color-scheme: light;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
:root[data-theme="dark"] {
  --bg: #151b1d;
  --surface: #20282b;
  --text: #f0f4f2;
  --muted: #b3c2c4;
  --line: #48565a;
  --danger: #ff9ca2;
  --focus: #8ad2ed;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151b1d;
    --surface: #20282b;
    --text: #f0f4f2;
    --muted: #b3c2c4;
    --line: #48565a;
    --danger: #ff9ca2;
    --focus: #8ad2ed;
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button, input, select, textarea {
  font: inherit;
}
button, a, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button, select, input, textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: .48rem .75rem;
}
button:hover, a:hover {
  filter: brightness(.94);
}
button:disabled {
  opacity: .6;
  cursor: default;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
a {
  color: inherit;
}
h1, h2, h3, p {
  margin: 0 0 .7rem;
}
h1 {
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1.18;
  letter-spacing: -.04em;
  font-weight: 600;
}
h2 {
  font-size: 1.05rem;
  line-height: 1.4;
}
h3 {
  font-size: 1rem;
  margin-top: 1.4rem;
}
.eyebrow {
  color: var(--muted);
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 650;
}
.muted {
  color: var(--muted);
  font-size: .88rem;
}
.app-header {
  min-height: 84px;
  padding: 16px 3%;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  gap: .6rem;
  align-items: center;
  font-size: 1.23rem;
  font-weight: 650;
  text-decoration: none;
  letter-spacing: -.03em;
}
.brand-mark {
  font-size: 1.8rem;
}
.app-header nav {
  display: flex;
  gap: 1.7rem;
}
.app-header nav a {
  text-decoration: none;
  padding: .6rem 0;
  color: var(--muted);
}
.app-header nav a[aria-current] {
  border-bottom: 2px solid currentColor;
  color: var(--text);
}
.header-actions {
  margin-left: auto;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.theme-label {
  font-size: .82rem;
}
.theme-label select {
  margin-left: .3rem;
  padding: .35rem;
}
main {
  padding: 2.3rem 3%;
  max-width: 1800px;
  margin: auto;
}
footer {
  padding: 2rem 3%;
  color: var(--muted);
  font-size: .8rem;
  border-top: 1px solid var(--line);
}
.skip-link {
  position: absolute;
  left: -10000px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--surface);
  padding: 1rem;
}
.week-heading {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}
.week-nav {
  display: flex;
  gap: .45rem;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.1rem 0 1.6rem;
}
.stats, .controls {
  display: flex;
  gap: 1.4rem;
  align-items: center;
  flex-wrap: wrap;
}
.stats span {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .9rem;
}
.stats strong {
  font-size: 1.2rem;
}
.controls {
  gap: .7rem;
  font-size: .82rem;
}
.red-dot {
  display: inline-block;
  background: var(--danger);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: .4rem;
  vertical-align: middle;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.4rem;
}
.report {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  margin-bottom: 1.6rem;
}
.report dl {
  display: flex;
  gap: 2rem;
  margin: 0;
}
.report dl > div {
  flex: 1;
}
.report dt {
  font-weight: 650;
  margin-bottom: .5rem;
}
.report dd {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.week-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 1.5rem;
  align-items: start;
}
.grid-help {
  margin: 0 0 .8rem;
  font-size: .78rem;
}
.calendar-scroll {
  overflow: auto;
  max-height: 780px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  min-width: 840px;
  padding: 0 0 1rem 40px;
}
.day {
  min-width: 0;
  border-right: 1px solid var(--line);
}
.day:last-child {
  border: none;
}
.day-heading {
  margin: 0;
  padding: .8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.day-heading span {
  color: var(--muted);
  font-size: .83rem;
  font-weight: 500;
}
.day-heading strong {
  font-size: 1.15rem;
}
.day-track {
  position: relative;
  margin: 0 5px 0 0;
}
.hour-line {
  position: absolute;
  width: calc(100% + 5px);
  border-top: 1px solid var(--line);
  pointer-events: none;
}
.hour-line span {
  display: none;
  position: absolute;
  right: calc(100% + 5px);
  top: -1px;
  color: var(--muted);
  font-size: .72rem;
  background: var(--surface);
}
.day:first-child .hour-line span, .day.dst-day .hour-line span {
  display: block;
}
.day.dst-day .day-track {
  margin-left: 40px;
}
.block {
  position: absolute;
  border: 1px solid #819694;
  border-left-width: 3px;
  border-radius: 5px;
  padding: 5px;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  font-size: .76rem;
  line-height: 1.3;
  color: #233438;
  background: #dfebe5;
  overflow-wrap: anywhere;
}
.block strong, .block span, .block small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.block strong {
  font-size: .8rem;
  font-weight: 600;
}
.block span {
  margin-top: .2rem;
}
.block small {
  font-size: .7rem;
  margin-top: .2rem;
}
.block:focus-visible {
  z-index: 3;
}
.tone-0 {
  background: #dcece5;
  color: #203c32;
}
.tone-1 {
  background: #e4e5f7;
  color: #363957;
}
.tone-2 {
  background: #f5e7cb;
  color: #544021;
}
.tone-3 {
  background: #dcebf5;
  color: #254558;
}
.tone-4 {
  background: #f3e0dc;
  color: #5b3330;
}
.tone-5 {
  background: #e8eacd;
  color: #3f4826;
}
.open-thread {
  border: 2px solid #ad2833;
}
.week-sidebar {
  display: grid;
  gap: 1rem;
  padding-top: 2rem;
}
.big-number {
  font-size: 2.8rem;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -.04em;
}
hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.25rem 0;
}
.project-total {
  display: flex;
  align-items: start;
  gap: 1rem;
  justify-content: space-between;
  margin: .9rem 0;
  font-size: .85rem;
}
.project-total strong {
  white-space: nowrap;
}
.project-total > span {
  overflow-wrap: anywhere;
}
.swatch {
  display: inline-block;
  height: 10px;
  width: 10px;
  border: 1px solid #83918c;
  border-radius: 3px;
  margin-right: .5rem;
}
.bars {
  display: flex;
  gap: 4px;
  padding-top: .5rem;
  margin-bottom: .5rem;
}
.bar-column {
  flex: 1;
  text-align: center;
  min-width: 0;
}
.bar-column > span {
  font-size: .75rem;
  white-space: nowrap;
}
.bar-space {
  height: 110px;
  display: flex;
  align-items: end;
  background: var(--bg);
  margin: .3rem 0;
  border-bottom: 1px solid var(--line);
}
.bar-space i {
  display: block;
  background: var(--accent);
  width: 100%;
  min-height: 1px;
  border-radius: 3px 3px 0 0;
}
.thread-link {
  display: flex;
  width: 100%;
  gap: .4rem;
  flex-direction: column;
  text-align: left;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 1rem 0;
  overflow-wrap: anywhere;
}
.thread-link span {
  font-size: .8rem;
  color: var(--muted);
}
.detail {
  position: fixed;
  margin: 0 0 0 auto;
  inset: 0;
  height: 100dvh;
  max-height: 100dvh;
  width: min(560px, 100%);
  max-width: 100%;
  background: var(--surface);
  color: var(--text);
  padding: 3rem 2rem;
  border: none;
  border-left: 1px solid var(--line);
  overflow: auto;
  overflow-wrap: anywhere;
}
.detail::backdrop {
  background: #13202780;
}
.close {
  float: right;
  margin: -1.5rem -1rem 1rem 1rem;
}
.prose {
  white-space: pre-wrap;
}
li {
  margin-bottom: .5rem;
}
.empty {
  padding: 2.5rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}
.empty p {
  color: var(--muted);
}
.notice {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 1rem 0;
  background: var(--surface);
}
.settings-page {
  max-width: 780px;
  margin: 1rem auto;
}
.settings-page > p {
  margin: 1.3rem 0;
}
.settings-page .card {
  margin: 1.3rem 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}
th, td {
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}
th {
  font-weight: 600;
}
form {
  display: grid;
  gap: 1rem;
}
form label {
  display: grid;
  gap: .5rem;
}
form input {
  width: 100%;
  padding: .7rem;
}
.danger {
  background: #a4212d;
  color: white;
  border-color: #a4212d;
}
.danger-zone {
  border-color: var(--danger);
}
.checkbox {
  display: flex;
  gap: .7rem;
  margin: .7rem 0;
  align-items: center;
}
.checkbox input {
  width: 18px;
  height: 18px;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
}
.actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}
.signin {
  min-height: 65vh;
  max-width: 1000px;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 5rem;
}
.signin h1 {
  font-size: clamp(3rem, 5vw, 4.8rem);
  margin: 1.3rem 0;
}
.signin-intro > p {
  max-width: 330px;
}
.signin-card {
  padding: 2rem;
}
.signin-card h2 {
  font-size: 1.3rem;
  margin-bottom: 1.6rem;
}
.signin-card > .muted {
  margin-top: 1.4rem;
}
.primary {
  background: var(--accent);
  color: white;
  padding: .7rem;
}
@media (max-width: 1150px) {
  .week-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .week-sidebar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding-top: 0;
  }
  .app-header {
    gap: 1.5rem;
  }
  .report {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
}
@media (max-width: 650px) {
  main {
    padding: 1.5rem 1rem;
  }
  .app-header {
    padding: 1rem;
    gap: 1rem;
  }
  .app-header nav {
    order: 3;
    width: 100%;
    gap: 1.5rem;
  }
  .header-actions {
    gap: .5rem;
  }
  .theme-label {
    font-size: 0;
  }
  .theme-label select {
    font-size: .8rem;
  }
  .week-heading {
    align-items: start;
    flex-direction: column;
  }
  .stats {
    gap: .8rem;
  }
  .report dl {
    flex-direction: column;
    gap: 1rem;
  }
  .week-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }
  .signin {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding: 1rem 0;
  }
  .signin h1 {
    font-size: 3.5rem;
  }
  .signin-card {
    padding: 1.5rem;
  }
  .actions {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
  }
}

.calendar-section, .week-sidebar, .week-sidebar .card {
  min-width: 0;
}

.token-value {
  display: block;
  width: 100%;
  margin: .5rem 0 1rem;
  min-height: 5rem;
  resize: vertical;
  overflow-wrap: anywhere;
}
