:root {
  color-scheme: light;
  --paper: #fffefa;
  --side: #f3f2ec;
  --ink: #29362e;
  --soft: #626e64;
  --line: #dce2d6;
  --green: #355e47;
  --on-green: #fffefa;
  --wash: #e8eee3;
  --red: #a23e2d;
  --red-bg: #fbede7;
  --sage: #e6eddf;
  --lilac: #ece7f3;
  --sand: #f3e8d7;
  --blue: #e2edf4;
  --rose: #f5e6e9;
  --label-width: 210px;
  font:
    14px/1.5 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  background: var(--paper);
  color: var(--ink);
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #202321;
  --side: #272b28;
  --ink: #ecf0e9;
  --soft: #b0bdb3;
  --line: #455047;
  --green: #afd1b7;
  --on-green: #203c29;
  --wash: #324334;
  --red: #ffb4a0;
  --red-bg: #4b312b;
  --sage: #354735;
  --lilac: #494053;
  --sand: #534632;
  --blue: #304750;
  --rose: #553b43;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.public-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 28px;
  font-size: 13px;
}
.public-links a {
  color: var(--green);
  text-underline-offset: 3px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  line-height: 1.3;
  text-decoration: none;
  color: inherit;
}
button:hover,
.button:hover {
  background: var(--side);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:active {
  transform: translateY(1px);
}
.primary {
  background: var(--green) !important;
  color: var(--on-green) !important;
  border-color: var(--green) !important;
}
.flat {
  border-color: transparent;
}
.danger {
  color: var(--red);
}
.icon {
  width: 38px;
  padding: 8px;
  flex-shrink: 0;
}
.ph {
  font-size: 19px;
  flex-shrink: 0;
}
a {
  color: var(--green);
  text-underline-offset: 3px;
}
input,
select,
textarea {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  max-width: 100%;
  min-width: 0;
}
textarea {
  resize: vertical;
  min-height: 86px;
}
input[type='checkbox'] {
  accent-color: var(--green);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
input::placeholder,
textarea::placeholder {
  color: var(--soft);
}
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: -0.8px;
  font-weight: 600;
}
h2 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.4px;
  font-weight: 600;
}
h3 {
  font-size: 14px;
  font-weight: 600;
}
small,
.muted {
  color: var(--soft);
  font-size: 12px;
}
.muted.large {
  font-size: 14px;
}
.skip {
  position: fixed;
  top: -100px;
  left: 15px;
  z-index: 100;
  background: var(--paper);
  padding: 12px;
}
.skip:focus {
  top: 10px;
}
.app {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 100dvh;
}
.nav {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 28px 15px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: auto;
}
.brand {
  font-size: 20px;
  letter-spacing: -0.6px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}
.brand-mark {
  display: block;
  flex-shrink: 0;
  border-radius: 8px;
  width: 30px;
  height: 30px;
}
.nav nav {
  display: grid;
  gap: 4px;
}
.nav button {
  border: 0;
  justify-content: flex-start;
  padding: 10px 12px;
  font-size: 14px;
}
.nav button[aria-current='page'],
.mobile-nav button[aria-current='page'] {
  background: var(--wash);
  color: var(--green);
  font-weight: 600;
}
.workspace-nav {
  display: grid;
  gap: 2px;
}
.workspace-nav p {
  padding: 0 12px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--soft);
}
.workspace-nav button {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.workspace-nav button[aria-pressed='true'] {
  background: var(--wash);
}
.nav-footer {
  margin-top: auto;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 30px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  min-height: 68px;
}
.topbar select {
  font-weight: 500;
  border: 0;
  padding-left: 0;
  width: min(230px, 40vw);
}
.actions,
.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topbar .actions {
  flex-wrap: nowrap;
}
.sync {
  font-size: 11px;
  color: var(--soft);
}
.sync.error {
  color: var(--red);
}
.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.content.has-detail {
  grid-template-columns: minmax(0, 1fr) 355px;
}
.page {
  padding: 32px;
  min-width: 0;
  max-width: 1500px;
  width: 100%;
  margin: auto;
  align-self: start;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}
.page-head p {
  margin-top: 8px;
}
.stack {
  display: grid;
  gap: 16px;
}
.section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.section h2,
.section h3 {
  margin-bottom: 12px;
}
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.empty {
  padding: 36px 16px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  margin-top: 16px;
  max-width: 700px;
}
.empty .ph {
  font-size: 28px;
  color: var(--soft);
  display: block;
  margin-bottom: 13px;
}
.empty h2 {
  font-size: 20px;
  margin-bottom: 8px;
}
.empty p {
  color: var(--soft);
  max-width: 450px;
  margin-bottom: 18px;
  font-size: 14px;
}
.empty p:last-child {
  margin-bottom: 0;
}
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tabs button {
  border: 0;
  padding: 9px 12px;
  color: var(--soft);
}
.tabs button[aria-pressed='true'] {
  background: var(--wash);
  color: var(--green);
  font-weight: 600;
}
.filters {
  background: var(--side);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 18px;
}
.filters summary {
  cursor: pointer;
  min-height: 24px;
  font-size: 12px;
  font-weight: 500;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--soft);
  min-width: 0;
}
.field > * {
  color: var(--ink);
  width: 100%;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0;
}
.wide {
  grid-column: 1/-1;
}
.check-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  font-size: 13px;
}
.saved-views {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
  margin-bottom: 16px;
}
.saved-views .field {
  flex: 1 1 180px;
  max-width: 340px;
  min-width: 0;
  margin: 0;
}
.saved-view-context {
  flex-basis: 100%;
  margin: 0;
  overflow-wrap: anywhere;
}
.draft-tools,
.triage-control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--soft);
  margin: 8px 0 12px;
}
.draft-tools small {
  flex: 1 1 160px;
}
.process-task {
  min-height: 44px;
}
.draft-row {
  flex-wrap: wrap;
}
.draft-row .body {
  min-width: 0;
  overflow-wrap: anywhere;
}
.search-count {
  font-size: 12px;
  margin-top: 12px;
}
.task-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.task-row.selected {
  background: var(--wash);
  border-radius: 7px;
  padding-left: 6px;
  padding-right: 6px;
}
.task-check {
  width: 36px;
  min-height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.task-open {
  border: 0;
  background: none !important;
  padding: 0;
  text-align: left;
  display: block;
  min-width: 0;
  justify-content: flex-start;
}
.task-name {
  font-size: 14px;
  font-weight: 500;
  display: block;
  overflow-wrap: anywhere;
}
.task-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 11px;
  color: var(--soft);
  margin-top: 5px;
}
.task-aside {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.tag,
.priority {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--side);
  color: var(--ink);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.tag.sage {
  background: var(--sage);
}
.tag.lilac {
  background: var(--lilac);
}
.tag.sand {
  background: var(--sand);
}
.tag.blue {
  background: var(--blue);
}
.tag.rose {
  background: var(--rose);
}
.priority.high {
  background: var(--sand);
}
.priority.urgent {
  background: var(--red-bg);
  color: var(--red);
}
.late {
  color: var(--red);
}
.done .task-name {
  text-decoration: line-through;
  color: var(--soft);
}
.subtasks {
  margin-left: 44px;
  border-bottom: 1px solid var(--line);
}
summary {
  cursor: pointer;
}
.subtasks > summary {
  font-size: 12px;
  color: var(--soft);
  padding: 10px 0;
}
.subtasks .task-row {
  border: 0;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  color: var(--soft);
  font-size: 12px;
}
.detail {
  border-left: 1px solid var(--line);
  padding: 24px;
  min-width: 0;
  background: var(--paper);
}
.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.detail h2 {
  overflow-wrap: anywhere;
  font-size: 22px;
  margin-bottom: 12px;
}
.detail .tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.detail .tabs button {
  font-size: 12px;
  padding: 9px 3px;
}
.detail .section {
  padding: 16px 0;
}
.detail textarea {
  min-height: 100px;
}
.detail .fields {
  gap: 12px;
}
.note {
  background: var(--side);
  padding: 12px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--soft);
}
.error-box {
  background: var(--red-bg);
  color: var(--red);
  padding: 12px;
  border-radius: 7px;
  font-size: 13px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.form-error {
  color: var(--red);
  font-size: 13px;
}
.row-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 15px;
  justify-content: space-between;
}
.row-card .body {
  min-width: 0;
  flex: 1;
}
.row-card h2 {
  font-size: 17px;
  overflow-wrap: anywhere;
}
.row-card p {
  margin-top: 6px;
}
.workspace-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--tone);
  font-size: 18px;
}
.personal-card {
  background: var(--blue);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}
.personal-card .row-card {
  padding: 0;
  border: 0;
}
.personal-card .tag {
  background: var(--paper);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: inset 0 0 0 1px #71807655;
  display: inline-block;
  flex-shrink: 0;
}
.project-summary {
  padding: 20px;
  background: var(--side);
  border-radius: 10px;
  margin-bottom: 20px;
}
.project-summary h2 {
  margin: 12px 0 8px;
}
.project-summary .actions {
  margin-top: 18px;
}
.prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.document-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.document-row > .ph {
  font-size: 25px;
  color: var(--soft);
}
.document-row .body {
  flex: 1;
  min-width: 0;
}
.document-row a {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.document-row small {
  display: block;
  margin-top: 5px;
}
.event-row {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: 9px;
  background: var(--tone, var(--side));
  margin-top: 10px;
  align-items: flex-start;
}
.event-time {
  font-size: 12px;
  min-width: 65px;
  font-variant-numeric: tabular-nums;
}
.event-row .body {
  min-width: 0;
  flex: 1;
}
.event-row h3 {
  overflow-wrap: anywhere;
}
.event-row p {
  font-size: 12px;
  margin-top: 4px;
}
.event-row button.title {
  border: 0;
  padding: 0;
  display: block;
  text-align: left;
  font-weight: 500;
}
.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(250px, 1fr);
  gap: 30px;
}
.today-tabs {
  display: none;
}
.calendar-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.week-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  min-width: 910px;
}
.week-day {
  min-height: 350px;
  padding: 10px;
  border-right: 1px solid var(--line);
}
.week-day h3 {
  position: sticky;
  top: 0;
  background: var(--paper);
  padding: 8px 0;
  font-size: 12px;
}
.week-day.today {
  background: var(--wash);
}
.week-day.today h3 {
  background: var(--wash);
}
.week-day .event-row {
  padding: 8px;
  display: block;
  font-size: 12px;
}
.week-day .event-row .event-time {
  margin-bottom: 6px;
}
.timeline-scroll {
  max-height: 65dvh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overscroll-behavior: contain;
  position: relative;
  margin-top: 16px;
}
.gantt {
  position: relative;
  isolation: isolate;
  width: max-content;
  font-size: 12px;
}
.g-row {
  display: flex;
  height: 58px;
  border-bottom: 1px solid var(--line);
}
.g-label {
  position: sticky;
  left: 0;
  z-index: 4;
  width: var(--label-width);
  flex: none;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  padding: 10px 12px;
  justify-content: flex-start;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  display: block;
}
.g-label:hover {
  background: var(--side);
}
.g-label.indent {
  padding-left: 26px;
}
.g-label.group {
  font-weight: 600;
  background: var(--side);
}
.g-label small {
  display: block;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-header {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 44px;
}
.g-header .g-label,
.g-header .g-track {
  background: var(--side);
}
.g-track {
  position: relative;
  flex: none;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: var(--day-width) 100%;
}
.date-tick {
  position: absolute;
  top: 12px;
  font-size: 10px;
  color: var(--soft);
  white-space: nowrap;
  padding-left: 5px;
}
.g-now {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--green);
  opacity: 0.45;
  pointer-events: none;
}
.g-bar {
  position: absolute;
  top: 7px;
  min-height: 24px;
  height: 24px;
  border: 1px solid #60755744;
  background: var(--tone);
  border-radius: 5px;
  overflow: hidden;
  white-space: nowrap;
  padding: 2px 7px;
  text-align: left;
  font-size: 11px;
  display: block;
  cursor: grab;
  color: var(--ink);
  touch-action: pan-y;
}
.g-bar.project {
  height: 12px;
  min-height: 12px;
  top: 13px;
  border-radius: 3px;
  cursor: default;
}
.g-bar.done {
  opacity: 0.55;
}
.resize {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
}
.resize.start {
  left: 0;
}
.resize.end {
  right: 0;
}
.g-deadline {
  position: absolute;
  top: 30px;
  min-height: 24px;
  height: 24px;
  min-width: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 20px;
  transform: translateX(-50%);
  background: transparent;
  color: var(--green);
}
.g-deadline.late {
  color: var(--red);
}
.g-note {
  position: sticky;
  left: 10px;
  font-size: 11px;
  color: var(--soft);
  display: inline-block;
  padding: 17px 12px;
}
.legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--soft);
  margin-top: 12px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 16px;
  height: 7px;
  background: var(--sage);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 24px;
}
.search-box input {
  width: 100%;
}
.settings-section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  max-width: 750px;
}
.settings-section h2 {
  margin-bottom: 9px;
}
.settings-section p {
  margin-bottom: 14px;
}
.settings-section .actions {
  margin-top: 14px;
}
.account {
  padding: 13px;
  background: var(--side);
  margin-top: 10px;
  border-radius: 7px;
}
.mobile-nav,
.mobile-more {
  display: none;
}
.loading,
.login {
  max-width: 620px;
  margin: 10vh auto;
  padding: 24px;
}
.login .brand {
  padding: 0;
  margin-bottom: 45px;
}
.login h1 {
  font-size: 38px;
  margin-bottom: 18px;
}
.login p {
  color: var(--soft);
  margin-bottom: 24px;
}
.skeleton {
  height: 20px;
  margin-top: 20px;
  background: var(--side);
  border-radius: 5px;
}
.skeleton:last-child {
  width: 65%;
}
dialog {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px;
  max-width: 550px;
  width: calc(100% - 32px);
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #15291e55;
}
dialog .dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
dialog .dialog-head h2 {
  font-size: 22px;
}
dialog .actions {
  justify-content: flex-end;
  margin-top: 22px;
}
dialog form > .note {
  margin-top: 15px;
}
#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: 9px;
  max-width: calc(100% - 30px);
  font-size: 13px;
  box-shadow: 0 4px 20px #20352722;
}
#toast:empty {
  display: none;
}
#toast button {
  color: inherit;
  border-color: currentColor;
  margin-left: 12px;
}
.help-text {
  margin: 8px 0 15px;
}
.nowrap {
  white-space: nowrap;
}
@media (min-width: 1600px) {
  .page {
    padding: 40px 48px;
  }
  .content.has-detail {
    grid-template-columns: minmax(0, 1fr) 390px;
  }
}
@media (max-width: 1150px) {
  .app {
    grid-template-columns: 172px minmax(0, 1fr);
  }
  .nav {
    padding: 25px 10px;
  }
  .content.has-detail {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .page {
    padding: 26px 22px;
  }
  .today-grid {
    grid-template-columns: 1fr;
  }
  .detail {
    padding: 20px;
  }
  .sync {
    display: none;
  }
}
@media (max-width: 900px) {
  .content.has-detail > .page {
    display: none;
  }
  .content.has-detail {
    grid-template-columns: 1fr;
  }
  .detail {
    border: 0;
    max-width: 650px;
    width: 100%;
    margin: auto;
    padding: 28px;
  }
  .detail .tabs {
    margin-bottom: 20px;
  }
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  :root {
    font-size: 14px;
    --label-width: 140px;
  }
  .app {
    display: block;
  }
  .nav {
    display: none;
  }
  .topbar {
    padding: 8px 12px;
    gap: 4px;
    min-height: 62px;
  }
  .topbar select {
    font-size: 15px;
    width: auto;
    max-width: calc(100vw - 125px);
    flex: 1;
  }
  .topbar .actions {
    gap: 2px;
  }
  .topbar .add-label,
  .topbar .search-label {
    display: none;
  }
  .topbar .primary {
    width: 44px;
    padding: 10px;
  }
  .topbar .icon {
    width: 44px;
  }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0 8px 7px;
    border-bottom: 1px solid var(--line);
    gap: 2px;
  }
  .mobile-nav button {
    border: 0;
    min-height: 44px;
    font-size: 12px;
    padding: 8px 2px;
    gap: 5px;
  }
  .mobile-nav .ph {
    font-size: 17px;
  }
  .mobile-more {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--side);
    padding: 10px 12px;
    gap: 5px;
    border-bottom: 1px solid var(--line);
  }
  .mobile-more button {
    justify-content: flex-start;
    border: 0;
  }
  .page {
    padding: 22px 14px;
  }
  .page-head {
    margin-bottom: 20px;
    gap: 10px;
  }
  .page-head p {
    font-size: 12px;
  }
  h1 {
    font-size: 25px;
  }
  .page-head > .button,
  .page-head > button {
    font-size: 12px;
    padding: 8px;
  }
  .page-head .primary .ph {
    display: none;
  }
  button,
  .button,
  select,
  input:not([type='checkbox']),
  summary {
    min-height: 44px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  input[type='checkbox'] {
    width: 20px;
    height: 20px;
  }
  .task-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0 6px;
    padding: 10px 0;
  }
  .task-check {
    width: 44px;
    min-height: 44px;
    grid-row: 1/3;
  }
  .task-open {
    min-height: 44px;
  }
  .task-name {
    font-size: 15px;
  }
  .task-meta {
    font-size: 12px;
  }
  .tag,
  .priority {
    font-size: 12px;
  }
  .task-aside {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 5px;
    font-size: 12px;
    gap: 9px;
  }
  .task-aside .status {
    display: none;
  }
  .subtasks {
    margin-left: 50px;
  }
  .subtasks summary {
    padding: 12px 0;
  }
  .subtasks .task-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }
  .subtasks .task-check {
    width: 32px;
  }
  .tabs {
    gap: 0;
  }
  .tabs button {
    font-size: 12px;
    padding: 8px;
  }
  .filters {
    padding: 8px 12px;
  }
  .filters summary {
    padding: 10px 0;
  }
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
  .fields {
    gap: 12px;
  }
  .detail {
    padding: 16px 14px;
  }
  .detail h2 {
    font-size: 23px;
  }
  .detail-top {
    margin-bottom: 8px;
  }
  .detail .tabs button {
    min-height: 44px;
  }
  .detail .fields {
    margin-top: 12px;
  }
  .detail .notes summary {
    padding: 12px 0;
    font-size: 13px;
  }
  .detail .notes textarea {
    margin-bottom: 12px;
  }
  .today-tabs {
    display: flex;
  }
  .today-grid {
    display: block;
  }
  .today-grid > [data-hidden='true'] {
    display: none;
  }
  .section-label {
    font-size: 12px;
  }
  .empty {
    padding: 25px 16px;
  }
  .empty h2 {
    font-size: 19px;
  }
  .row-card {
    gap: 10px;
    flex-wrap: wrap;
  }
  .row-card .actions {
    margin-left: auto;
  }
  .workspace-badge {
    width: 34px;
    height: 34px;
  }
  .personal-card {
    padding: 16px;
  }
  .event-row {
    gap: 12px;
    padding: 13px;
  }
  .event-time {
    min-width: 55px;
  }
  .document-row {
    gap: 9px;
  }
  .document-row .ph {
    font-size: 21px;
  }
  .document-row small {
    font-size: 12px;
  }
  .calendar-tools .controls {
    gap: 4px;
  }
  .timeline-scroll {
    max-height: 62dvh;
  }
  .g-label {
    padding: 8px;
    font-size: 12px;
  }
  .g-label.indent {
    padding-left: 16px;
  }
  .g-bar {
    min-height: 24px;
  }
  .g-deadline {
    min-height: 24px;
  }
  .g-label small {
    font-size: 11px;
  }
  .legend {
    font-size: 11px;
    gap: 10px;
  }
  .settings-section {
    padding: 18px 0;
  }
  .settings-section h2 {
    font-size: 19px;
  }
  dialog {
    padding: 18px;
    max-height: 92dvh;
    width: calc(100% - 20px);
  }
  dialog .fields {
    gap: 12px;
  }
  #toast {
    bottom: 14px;
  }
  .login {
    margin: 5vh auto;
  }
  .login h1 {
    font-size: 30px;
  }
  .search-box {
    gap: 5px;
  }
  .project-summary {
    padding: 16px;
  }
  .pager {
    font-size: 11px;
  }
  .week-day .event-row button {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
  button:active {
    transform: none;
  }
}

.date-tick {
  top: 5px;
  text-align: center;
  padding: 0;
  line-height: 1.4;
  overflow: hidden;
}
.date-tick small {
  display: block;
  font-size: 9px;
}
.g-note {
  left: calc(var(--label-width) + 8px);
}

.page-head > div {
  min-width: 0;
}
.page-head > button {
  flex-shrink: 0;
  white-space: nowrap;
}
.date-tick {
  font-size: 11px;
}
.date-tick small {
  font-size: 10px;
}
.mobile-sync {
  display: none;
}
@media (max-width: 640px) {
  .mobile-sync:not([hidden]) {
    display: block;
    font-size: 12px;
    padding: 8px 14px;
    margin: 0;
    border-radius: 0;
  }
}

/* Workspace selection is a labeled control, distinct from the page title. */
.workspace-switch {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  width: 250px;
}
.workspace-switch-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--soft);
}
.workspace-switch-control {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: var(--side);
  border-radius: 8px;
  padding: 0 10px;
  min-height: 42px;
}
.workspace-switch-control:focus-within {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.topbar .workspace-switch select {
  appearance: none;
  -webkit-appearance: none;
  flex: 1;
  width: 100%;
  max-width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  padding: 8px 0;
  min-width: 0;
  cursor: pointer;
  font-weight: 600;
}
.workspace-switch-control > .ph {
  color: var(--soft);
  font-size: 17px;
  pointer-events: none;
}
.field small {
  font-size: 11px;
  line-height: 1.45;
  color: var(--soft);
}
.ownership-note {
  line-height: 1.45;
}

/* A fixed-size row model allows large plans to render only their visible rows. */
.timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.timeline-toolbar .tabs {
  margin: 0;
  background: var(--side);
  border-radius: 8px;
  padding: 3px;
}
.timeline-toolbar .controls {
  align-items: end;
}
.timeline-toolbar .field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.timeline-toolbar .field select {
  width: 105px;
}
.timeline-filters .filter-grid {
  grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 1fr) minmax(125px, 1fr) auto;
  align-items: end;
}
.timeline-scroll {
  --label-width: 246px;
  max-height: 62dvh;
  min-height: 180px;
  scrollbar-gutter: stable;
  overflow-anchor: none;
  background: var(--paper);
  margin-top: 12px;
}
.timeline-scroll .gantt {
  width: calc(var(--label-width) + var(--axis-width));
}
.timeline-scroll .g-row {
  height: 52px;
  min-height: 52px;
}
.timeline-scroll .g-track {
  min-height: 0;
  background-size: var(--day-width) 100%;
}
.timeline-scroll .g-label {
  display: flex;
  padding: 0 8px;
  gap: 4px;
  align-items: center;
  min-height: 0;
  font-size: 12px;
  white-space: normal;
  background: var(--paper);
}
.timeline-scroll .g-label.indent {
  padding-left: 20px;
}
.timeline-scroll .g-label.child {
  padding-left: 36px;
}
.g-name {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  text-align: left;
  justify-content: flex-start;
  border: 0;
  padding: 4px 0;
  min-height: 44px;
  background: transparent !important;
}
.g-name > span {
  min-width: 0;
  overflow: hidden;
}
.g-name strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-name small {
  display: block;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}
.g-name .ph {
  font-size: 13px;
}
.g-row-action {
  flex: none;
  border: 0;
  padding: 4px;
  min-width: 32px;
  min-height: 44px;
  gap: 0;
  font-size: 11px;
}
.g-row-action .ph {
  font-size: 15px;
}
.workspace-row .g-label,
.workspace-row .g-track {
  background: var(--side);
}
.workspace-row strong {
  font-weight: 650;
}
.summary-row .g-label {
  border-left: 3px solid var(--tone);
  padding-left: 7px;
}
.summary-row .g-name strong {
  font-weight: 600;
}
.timeline-scroll .g-header {
  height: 64px;
  min-height: 64px;
}
.timeline-scroll .g-header .g-track {
  position: relative;
  background: var(--side);
}
.timeline-scroll .header-label {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  padding: 10px 12px;
  background: var(--side);
}
.header-label strong {
  font-size: 12px;
}
.header-label small {
  font-size: 11px;
}
.month-bands {
  height: 30px;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.month-bands > span {
  position: absolute;
  top: 0;
  height: 30px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.month-bands b {
  position: sticky;
  left: calc(var(--label-width) + 10px);
  font-weight: 600;
  white-space: nowrap;
}
.day-bands {
  height: 34px;
  position: relative;
}
.timeline-scroll .date-tick {
  top: 0;
  height: 34px;
  line-height: 34px;
  font-size: 11px;
  border-right: 1px solid var(--line);
}
.date-tick.weekend {
  background: var(--wash);
}
.date-tick.is-today {
  background: var(--green);
  color: var(--on-green);
  font-weight: 650;
}
.timeline-scroll .g-bar {
  height: 24px;
  min-height: 24px;
  top: 5px;
  padding: 2px 10px;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
}
.timeline-scroll .g-bar.project {
  top: 13px;
  height: 10px;
  min-height: 10px;
}
.bar-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-scroll .g-deadline {
  top: 28px;
  min-height: 22px;
  height: 22px;
  width: 28px;
}
.g-spacer {
  width: 100%;
  background: var(--paper);
}
.timeline-scroll .g-note {
  position: sticky;
  left: calc(var(--label-width) + 10px);
  padding: 16px 10px;
  line-height: 20px;
  font-size: 11px;
  white-space: nowrap;
}
.timeline-scroll .g-find {
  padding: 8px;
  margin-top: 5px;
  border: 0;
  min-height: 38px;
  height: 38px;
  color: var(--soft);
}
.timeline-help {
  max-width: 720px;
  line-height: 1.5;
}
@media (max-width: 1100px) {
  .timeline-filters .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .topbar {
    padding: 8px 12px;
    align-items: center;
  }
  .workspace-switch {
    flex: 1;
    width: auto;
    max-width: calc(100% - 96px);
  }
  .workspace-switch-label {
    font-size: 10px;
  }
  .workspace-switch-control {
    gap: 6px;
    padding: 0 8px;
    min-height: 44px;
  }
  .topbar .workspace-switch select {
    font-size: 15px;
  }
  .workspace-switch-control > .ph:first-child {
    display: none;
  }
  .timeline-toolbar {
    gap: 8px;
    align-items: flex-start;
  }
  .timeline-toolbar .controls {
    width: 100%;
    justify-content: space-between;
    gap: 5px;
  }
  .timeline-toolbar .field {
    font-size: 0;
    gap: 0;
  }
  .timeline-toolbar .field select {
    font-size: 14px;
    width: 100px;
  }
  .timeline-toolbar button {
    font-size: 12px;
  }
  .timeline-filters .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
  .timeline-filters .filter-grid > .field:first-child {
    grid-column: 1/-1;
  }
  .timeline-filters .actions {
    grid-column: 1/-1;
  }
  .timeline-scroll {
    --label-width: 150px;
    max-height: 55dvh;
    scrollbar-gutter: auto;
  }
  .timeline-scroll .g-label {
    padding-left: 6px;
    padding-right: 4px;
  }
  .timeline-scroll .g-label.indent {
    padding-left: 12px;
  }
  .timeline-scroll .g-label.child {
    padding-left: 22px;
  }
  .g-name {
    gap: 3px;
  }
  .g-name strong {
    font-size: 12px;
  }
  .g-name small {
    font-size: 11px;
  }
  .g-row-action {
    min-width: 26px;
    padding: 2px;
  }
  .timeline-scroll .header-label {
    padding-left: 10px;
  }
  .timeline-scroll .g-note {
    font-size: 11px;
  }
  .timeline-help {
    font-size: 12px;
  }
  .field small {
    font-size: 12px;
  }
}
.month-bands > span {
  overflow: visible;
}
.month-bands b {
  display: inline-block;
}
.mobile-collapse {
  display: none;
}
@media (max-width: 640px) {
  .timeline-page .page-head p {
    display: none;
  }
  .timeline-page .page-head {
    margin-bottom: 14px;
    align-items: center;
  }
  .timeline-toolbar {
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
  }
  .timeline-toolbar .tabs {
    flex: none;
    padding: 2px;
  }
  .timeline-toolbar .tabs button {
    padding: 7px;
  }
  .timeline-toolbar .controls {
    width: auto;
    gap: 4px;
    flex-wrap: nowrap;
  }
  .timeline-toolbar .controls > button {
    padding: 7px;
  }
  .timeline-toolbar .field select {
    width: 90px;
  }
  .timeline-toolbar [data-action='timeline-collapse'] {
    display: none;
  }
  .mobile-collapse {
    display: inline-flex;
  }
  .timeline-scroll {
    max-height: max(240px, calc(100dvh - 420px));
  }
  .g-name strong {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.15;
  }
  .timeline-help {
    display: none;
  }
  .timeline-page .legend {
    gap: 6px 12px;
  }
}
@media (max-width: 640px) {
  .g-row-action {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Daily-work polish: quiet rows, explicit context, and compact capture. */
button,
.button,
summary {
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}
.task-row {
  padding-block: 12px;
}
.task-row:hover {
  background: color-mix(in srgb, var(--side) 65%, transparent);
}
.task-check input {
  border-radius: 5px;
  accent-color: var(--green);
}
.task-project {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 30ch;
}
.task-aside time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.due-today {
  color: var(--green);
  font-weight: 600;
}
.task-status {
  font-size: 11px;
  color: var(--soft);
}
.task-status::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  background: currentColor;
  border-radius: 50%;
  vertical-align: middle;
}
.quick-capture {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 9px;
  margin: 14px 0;
  overflow: hidden;
}
.quick-capture:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}
.capture-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 0 12px;
}
.capture-line > .ph {
  color: var(--green);
}
.capture-line input {
  flex: 1;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 2px;
  min-height: 38px;
}
.capture-line input:focus-visible {
  outline: none;
  box-shadow: none;
}
.capture-submit {
  width: 36px;
  padding: 0;
  background: var(--wash);
  border-color: transparent;
  color: var(--green);
  flex-shrink: 0;
}
.capture-context {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 3px 39px;
  color: var(--soft);
  font-size: 11px;
}
.capture-context > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.capture-context button {
  font-size: 11px;
  padding: 4px 6px;
  min-height: 30px;
  flex-shrink: 0;
}
.quick-capture .form-error:empty {
  display: none;
}
.quick-capture .form-error:not(:empty) {
  margin: 8px 12px 12px;
}
.list-caption {
  color: var(--soft);
  font-size: 12px;
  margin: 18px 0 4px;
}
.task-filters {
  background: transparent;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0 0 8px;
  margin-bottom: 0;
}
.task-filters summary {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 6px 0;
}
.task-filters summary::after {
  content: '+';
  margin-left: 8px;
  font-size: 16px;
}
.task-filters[open] summary::after {
  content: '−';
}
.task-filters summary::-webkit-details-marker {
  display: none;
}
.task-filters .filter-grid {
  margin-bottom: 8px;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.filter-chip {
  font-size: 12px;
  background: var(--wash);
  border-color: transparent;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.filter-chip .ph {
  font-size: 14px;
}
.filter-chips > .flat {
  font-size: 12px;
}
.attention-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}
.attention-tabs button {
  border: 0;
  border-radius: 5px 5px 0 0;
  font-size: 12px;
  color: var(--soft);
  padding: 10px;
  min-height: 44px;
  gap: 6px;
}
.attention-tabs button[aria-pressed='true'] {
  color: var(--green);
  box-shadow: inset 0 -2px var(--green);
  font-weight: 600;
}
.attention-tabs .has-overdue {
  color: var(--red);
}
.count {
  font-variant-numeric: tabular-nums;
  background: var(--side);
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}
.attention-tabs .has-overdue .count {
  background: var(--red-bg);
}
.detail-save {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  bottom: 0;
  padding: 14px 0;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  z-index: 2;
}
.detail-save > span {
  font-size: 11px;
  color: var(--soft);
}
.project-overview {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.project-facts {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--soft);
  font-size: 12px;
}
.project-facts > button {
  margin-left: auto;
}
.project-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--soft);
}
.project-progress progress {
  height: 5px;
  width: 120px;
  max-width: 35%;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--line);
}
progress::-webkit-progress-bar {
  background: var(--line);
}
progress::-webkit-progress-value {
  background: var(--green);
  border-radius: 3px;
}
progress::-moz-progress-bar {
  background: var(--green);
}
.project-notes h2 {
  margin: 20px 0 12px;
}
.project-notes > .prose {
  margin-bottom: 20px;
  max-width: 65ch;
}
.project-manage {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--soft);
}
.project-manage > summary {
  font-size: 12px;
}
.project-manage button {
  margin-top: 10px;
}
@media (max-width: 640px) {
  .attention-tabs {
    gap: 0;
    justify-content: space-between;
  }
  .attention-tabs button {
    font-size: 11px;
    gap: 4px;
    padding: 8px 5px;
  }
  .attention-tabs .count {
    min-width: 17px;
    padding-inline: 3px;
  }
  .quick-capture {
    margin-block: 12px;
  }
  .capture-line input {
    min-height: 44px;
    font-size: 16px;
  }
  .capture-submit {
    width: 44px;
    min-height: 44px;
  }
  .capture-context {
    padding-left: 12px;
  }
  .capture-context button {
    min-height: 44px;
    font-size: 12px;
  }
  .capture-context > span {
    font-size: 12px;
  }
  .task-filters {
    padding-bottom: 0;
  }
  .task-filters summary {
    padding-block: 8px;
  }
  .task-status {
    font-size: 12px;
  }
  .list-caption {
    margin-top: 12px;
  }
  .project-overview {
    margin-bottom: 16px;
    padding-bottom: 16px;
  }
  .project-facts {
    gap: 6px 10px;
  }
  .project-facts > button {
    margin-left: 0;
  }
  .project-tabs button {
    padding-inline: 8px;
  }
  .detail-save {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  button,
  .button,
  summary {
    transition: none;
  }
}
.project-card h2 > button {
  font-size: 18px;
  font-weight: 600;
  padding-left: 0;
}
.project-card .project-progress {
  margin-top: 10px;
}
.project-card .project-progress progress {
  width: 160px;
}
@media (max-width: 640px) {
  .capture-context {
    min-height: 28px;
    padding-bottom: 6px;
  }
  .capture-context button {
    display: none;
  }
  .quick-capture:focus-within .capture-context button {
    display: inline-flex;
  }
  .quick-capture:focus-within .capture-context {
    padding-bottom: 3px;
  }
}
@media (max-width: 640px) {
  .page:has(.today-grid) {
    position: relative;
  }
  .page:has(.today-grid) .page-head {
    padding-right: 130px;
    margin-bottom: 18px;
  }
  .page:has(.today-grid) .today-tabs {
    position: absolute;
    top: 20px;
    right: 14px;
    margin: 0;
  }
  .today-grid .task-row {
    padding-block: 10px;
  }
  .today-grid details.section {
    padding-block: 12px;
  }
  .attention-tabs button {
    font-size: 12px;
  }
}

/* Calendar: due-date tasks and reserved time share dates, not event semantics. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.calendar-toolbar,
.calendar-nav,
.calendar-layers,
.calendar-range {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.calendar-toolbar {
  margin-bottom: 20px;
}
.calendar-toolbar .tabs {
  margin: 0;
  padding: 3px;
  border-radius: 8px;
  background: var(--side);
}
.calendar-nav {
  gap: 12px;
}
.calendar-jump input {
  font-size: 13px;
  min-height: 38px;
}
.calendar-range {
  margin: 0 0 14px;
}
.calendar-range h2 {
  font-size: 18px;
  letter-spacing: -0.3px;
}
.calendar-range h2 span,
.calendar-range > span {
  font-size: 12px;
  color: var(--soft);
  font-weight: 400;
}
.calendar-range h2 span {
  margin-left: 5px;
}
.calendar-layers {
  margin-bottom: 14px;
  align-items: start;
}
.calendar-layers [aria-pressed='true'] {
  background: var(--wash);
  border-color: transparent;
  color: var(--green);
}
.calendar-options {
  position: relative;
  margin-left: auto;
}
.calendar-options > summary,
.timeline-jump > summary,
.timeline-guide > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  cursor: pointer;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  list-style: none;
}
.calendar-options > summary::-webkit-details-marker,
.timeline-jump > summary::-webkit-details-marker,
.timeline-guide > summary::-webkit-details-marker {
  display: none;
}
.calendar-options[open] > summary {
  background: var(--side);
}
.calendar-options-body {
  position: absolute;
  z-index: 8;
  right: 0;
  width: min(330px, calc(100vw - 28px));
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 12%, transparent);
}
.calendar-options-body p {
  font-size: 12px;
  margin-top: 12px;
}
.calendar-options-body .actions {
  margin-top: 10px;
}
.calendar-scroll {
  max-height: 62dvh;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 9px;
  scrollbar-gutter: stable;
  overflow-anchor: none;
}
.agenda-day {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}
.agenda-day:last-child {
  border-bottom: 0;
}
.calendar-date-heading {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}
.calendar-date-heading > span:last-child {
  display: grid;
  gap: 1px;
  color: var(--soft);
}
.calendar-date-heading small {
  font-weight: 400;
  font-size: 10px;
}
.calendar-day-number {
  font-size: 25px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.agenda-day > .calendar-date-heading {
  position: sticky;
  top: 0;
  align-self: start;
  padding: 20px 10px;
  background: var(--paper);
}
.today > .calendar-date-heading .calendar-day-number {
  color: var(--green);
}
.agenda-day-items {
  padding: 4px 18px 16px 8px;
  min-width: 0;
}
.calendar-item-group {
  padding-top: 12px;
  min-width: 0;
}
.calendar-item-group > h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 8px;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0;
  color: var(--soft);
}
.calendar-item-group > h3 .ph {
  font-size: 14px;
}
.calendar-item-group > h3 > span {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.calendar-task {
  display: flex;
  align-items: start;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 7px 0;
}
.calendar-task:last-child {
  border-bottom: 0;
}
.calendar-task .task-check {
  width: 32px;
  flex: none;
}
.calendar-task-open {
  display: block;
  flex: 1;
  min-width: 0;
  padding: 5px 0;
  border: 0;
  text-align: left;
}
.calendar-task-open:hover {
  background: var(--side);
}
.calendar-task-open small {
  display: block;
  font-size: 11px;
  color: var(--soft);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-task-open .priority {
  display: inline-block;
  margin-top: 5px;
}
.calendar-task .task-name {
  font-size: 14px;
}
.calendar-more {
  font-size: 11px;
  color: var(--green);
  margin-top: 4px;
  min-height: 40px;
  width: 100%;
  justify-content: flex-start;
  padding-inline: 4px;
}
.calendar-scroll .event-row {
  margin: 0 0 8px;
  padding: 10px;
  border: 0;
  border-left: 3px solid var(--tone);
  border-radius: 0 6px 6px 0;
  background: var(--side);
}
.calendar-scroll .event-time {
  font-size: 12px;
  min-width: 66px;
  font-variant-numeric: tabular-nums;
}
.calendar-scroll .event-row .body {
  min-width: 0;
}
.calendar-scroll .event-row .title,
.calendar-scroll .event-row a {
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.calendar-scroll .event-row p {
  font-size: 11px;
  line-height: 1.4;
  color: var(--soft);
}
.calendar-scroll .event-row p.late {
  color: var(--red);
}
.calendar-scroll .week-grid {
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  min-width: 980px;
  align-items: stretch;
}
.calendar-scroll .week-day {
  padding: 0 10px 12px;
  min-height: 360px;
  background: var(--paper);
}
.calendar-scroll .week-day:last-child {
  border-right: 0;
}
.week-day > .calendar-date-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 14px 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.week-day.today > .calendar-date-heading {
  box-shadow: inset 0 -2px var(--green);
}
.week-day .calendar-day-number {
  font-size: 22px;
}
.week-day .calendar-item-group > h3 {
  position: static;
  background: none;
  padding: 6px 0;
}
.week-day .calendar-task .task-check {
  width: 24px;
  min-height: 34px;
}
.week-day .calendar-task .task-name {
  font-size: 12px;
}
.week-day .calendar-task-open small {
  font-size: 10px;
}
.week-day .calendar-task-open {
  padding-top: 8px;
}
.week-day .event-row {
  padding: 8px;
}
.week-day .event-row .event-time {
  margin-bottom: 5px;
}
.calendar-day-empty {
  color: var(--soft);
  font-size: 12px;
  padding: 18px 0;
}
.calendar-note {
  display: flex;
  gap: 6px;
  align-items: start;
  font-size: 12px;
  color: var(--soft);
  margin-top: 12px;
}
.calendar-note .ph {
  font-size: 16px;
}
.calendar-selected-heading {
  font-size: 14px;
  padding: 12px 0 4px;
}

/* Timeline: align navigation with Calendar and keep the chart visually quiet. */
.timeline-toolbar {
  margin-bottom: 10px;
}
.timeline-navigation {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
#timeline-visible-range {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--soft);
}
.timeline-jump {
  margin-left: auto;
  position: relative;
}
.timeline-jump .field {
  position: absolute;
  z-index: 8;
  right: 0;
  width: 210px;
  background: var(--paper);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.timeline-filters {
  background: transparent;
  border-radius: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
  margin: 0;
}
.timeline-filters > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  list-style: none;
}
.timeline-filters > summary::after {
  content: '+';
  margin-left: auto;
  padding-right: 8px;
  font-size: 16px;
}
.timeline-filters[open] > summary::after {
  content: '−';
}
.timeline-filters > summary::-webkit-details-marker {
  display: none;
}
.timeline-filters .filter-grid {
  grid-template-columns: minmax(170px, 1.5fr) repeat(3, minmax(120px, 1fr));
  padding-bottom: 12px;
}
.timeline-filters .actions {
  grid-column: 1/-1;
}
.timeline-scroll .g-track {
  background-size: var(--grid-step) 100%;
  background-image: linear-gradient(
    to right,
    color-mix(in srgb, var(--line) 65%, transparent) 1px,
    transparent 1px
  );
}
.timeline-scroll .g-row:not(.g-header):hover .g-track {
  background-color: color-mix(in srgb, var(--wash) 30%, transparent);
}
.timeline-scroll .g-row:hover .g-label {
  background-color: var(--side);
}
.timeline-scroll .workspace-row .g-track {
  background-image: none;
}
.timeline-scroll .g-name strong {
  font-size: 13px;
}
.timeline-scroll .g-bar {
  border-radius: 4px;
}
.timeline-scroll .g-bar.project {
  background: var(--tone);
  opacity: 0.85;
  border-radius: 2px;
}
.timeline-scroll .deadline-only .g-deadline {
  top: 12px;
}
.timeline-scroll .g-deadline {
  font-size: 17px;
}
.timeline-scroll .g-now {
  opacity: 0.65;
  width: 1px;
}
.timeline-footer {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.timeline-footer .legend {
  margin: 0;
  min-height: 38px;
  align-items: center;
}
.today-legend::before {
  content: '';
  width: 1px;
  height: 14px;
  display: inline-block;
  background: var(--green);
  margin-right: 6px;
  vertical-align: middle;
}
.timeline-guide {
  font-size: 12px;
  color: var(--soft);
  max-width: 380px;
}
.timeline-guide > p {
  padding: 8px;
  line-height: 1.6;
}
@media (max-width: 1100px) {
  .timeline-filters .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .calendar-page .page-head {
    margin-bottom: 14px;
    align-items: center;
  }
  .calendar-page .page-head p {
    display: none;
  }
  .calendar-toolbar {
    gap: 10px;
    margin-bottom: 12px;
  }
  .calendar-nav {
    display: contents;
  }
  .calendar-toolbar .calendar-jump {
    width: 100%;
  }
  .calendar-jump input {
    width: 100%;
    font-size: 16px;
  }
  .calendar-range {
    gap: 4px;
    margin-bottom: 10px;
  }
  .calendar-range h2 {
    font-size: 16px;
  }
  .calendar-range > span {
    display: none;
  }
  .calendar-layers {
    gap: 5px;
    margin-bottom: 10px;
  }
  .calendar-layers .controls {
    gap: 4px;
  }
  .calendar-layers .controls button {
    font-size: 12px;
    padding: 7px;
  }
  .calendar-options > summary {
    min-height: 44px;
    padding: 7px 4px;
  }
  .calendar-options > summary .ph {
    font-size: 16px;
  }
  .calendar-scroll {
    max-height: max(250px, calc(100dvh - 430px));
    scrollbar-gutter: auto;
  }
  .calendar-agenda .agenda-day {
    grid-template-columns: 58px minmax(0, 1fr);
  }
  .agenda-day > .calendar-date-heading {
    flex-direction: column;
    gap: 2px;
    align-items: center;
    padding: 18px 5px;
  }
  .agenda-day > .calendar-date-heading > span:last-child {
    text-align: center;
  }
  .agenda-day-items {
    padding: 3px 10px 12px 0;
  }
  .calendar-task .task-check {
    width: 32px;
    min-height: 44px;
  }
  .calendar-task-open {
    min-height: 44px;
  }
  .calendar-task-open small {
    font-size: 12px;
  }
  .calendar-task .task-name {
    font-size: 14px;
    line-height: 1.4;
  }
  .calendar-more {
    font-size: 12px;
    min-height: 44px;
  }
  .calendar-scroll .event-row {
    display: block;
  }
  .calendar-scroll .event-time {
    margin-bottom: 4px;
  }
  .calendar-scroll .event-time br {
    display: none;
  }
  .calendar-scroll .event-time .muted::before {
    content: ' – ';
  }
  .calendar-scroll .event-row .title {
    min-height: 44px;
    font-size: 14px;
  }
  .calendar-scroll .event-row p {
    font-size: 12px;
  }
  .week-date-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin: 0 -8px 10px;
    gap: 0;
  }
  .week-date-strip button {
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0;
    min-width: 0;
    min-height: 72px;
  }
  .week-date-strip span {
    font-size: 11px;
    color: var(--soft);
  }
  .week-date-strip strong {
    font-size: 17px;
    font-weight: 500;
  }
  .week-date-strip small {
    color: var(--soft);
    font-size: 10px;
  }
  .week-date-strip [aria-pressed='true'] {
    background: var(--green);
    color: var(--on-green);
  }
  .week-date-strip [aria-pressed='true'] span,
  .week-date-strip [aria-pressed='true'] small {
    color: var(--on-green);
  }
  .week-date-strip [aria-current='date']:not([aria-pressed='true']) {
    box-shadow: inset 0 -2px var(--green);
  }
  .calendar-selected-day {
    padding: 0 12px 12px;
    max-height: max(220px, calc(100dvh - 500px));
  }
  .calendar-selected-day .calendar-task .task-check {
    width: 44px;
  }
  .calendar-note {
    font-size: 11px;
  }
  .timeline-toolbar {
    justify-content: space-between;
    margin-bottom: 8px;
  }
  .timeline-toolbar .controls {
    align-items: center;
  }
  .timeline-toolbar [data-action='timeline-fit'] {
    width: 44px;
    height: 44px;
    padding: 0;
  }
  .timeline-toolbar [data-action='timeline-fit'] span {
    display: none;
  }
  .timeline-navigation {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
  }
  .timeline-navigation .controls {
    gap: 3px;
  }
  #timeline-visible-range {
    order: 3;
    width: 100%;
    font-size: 12px;
  }
  .timeline-jump > summary {
    min-height: 44px;
  }
  .timeline-filters > summary {
    min-height: 44px;
  }
  .timeline-filters .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
  .timeline-filters .filter-grid > .field:first-child {
    grid-column: 1/-1;
  }
  .timeline-scroll {
    max-height: max(240px, calc(100dvh - 490px));
  }
  .timeline-scroll .g-name strong {
    font-size: 12px;
  }
  .timeline-footer {
    gap: 0;
  }
  .timeline-footer .legend {
    font-size: 11px;
    gap: 10px;
  }
  .timeline-guide {
    margin-left: auto;
  }
  .timeline-guide > summary {
    min-height: 44px;
    padding-right: 0;
  }
}
@media (min-width: 900px) {
  .agenda-day-items {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
  .agenda-day-items > :only-child {
    grid-column: 1/-1;
  }
}
.timeline-scroll .g-track {
  background-position-x: var(--grid-offset);
  background-image: linear-gradient(
    to right,
    color-mix(in srgb, var(--line) var(--grid-opacity), transparent) 1px,
    transparent 1px
  );
}
.timeline-scroll .date-tick.with-weekday {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  gap: 2px;
  padding: 0;
}
.date-tick.with-weekday small {
  font-size: 9px;
}
.date-tick.with-weekday b {
  font-size: 12px;
  font-weight: 500;
}
.mobile-calendar-jump {
  display: none;
}
@media (max-width: 640px) {
  .desktop-calendar-jump {
    display: none;
  }
  .mobile-calendar-jump {
    display: flex;
    margin-bottom: 10px;
  }
  .calendar-page {
    padding-bottom: 14px;
  }
}
@media (max-width: 640px) {
  .calendar-task .task-check {
    width: 44px;
  }
  .calendar-scroll .event-row a {
    display: block;
    min-height: 44px;
  }
  .timeline-scroll .g-deadline {
    min-height: 44px;
    height: 44px;
    width: 44px;
    top: 8px;
  }
  .timeline-scroll .deadline-only .g-deadline {
    top: 4px;
  }
}

/* Daily planning and shared-resource controls use the same quiet, flat surfaces. */
.planning-tabs {
  margin-bottom: 20px;
}
.plan-toolbar,
.plan-actions,
.selection-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.plan-toolbar {
  justify-content: space-between;
  margin-bottom: 18px;
}
.plan-toolbar .field {
  width: 180px;
}
.plan-capacity {
  padding: 18px 0;
  margin-bottom: 14px;
  border-block: 1px solid var(--line);
}
.plan-capacity p {
  margin: 8px 0;
}
.planned-task {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.planned-task .task-row {
  border: 0;
}
.plan-actions {
  padding-left: 44px;
}
.selection-bar {
  margin: 12px 0;
}
.review-section {
  margin: 26px 0;
}
.review-section h2 {
  margin-bottom: 12px;
}
.review-project {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.review-project p {
  margin: 6px 0 12px;
}
.weekday-picker,
.source-choice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin: 14px 0;
  min-width: 0;
}
.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.source-choice legend {
  overflow-wrap: anywhere;
}
.sheet-actions {
  display: grid;
  gap: 10px;
}
.task-picker {
  max-height: 45dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.task-picker .check-field {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.task-picker span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.task-picker small {
  display: block;
  color: var(--soft);
  margin-top: 4px;
}
.task-picker [hidden] {
  display: none;
}
.dialog-body > .note {
  margin-block: 16px;
}
.document-row .body {
  min-width: 0;
}
.document-row small {
  overflow-wrap: anywhere;
}

.resource-backlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.resource-backlinks button {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
}
.source-health {
  margin: 16px 0;
  overflow-wrap: anywhere;
}
.task-aside {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.task-aside > [data-action='task-actions'] {
  order: 2;
}

.update-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.inline-estimate {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.inline-estimate input {
  width: 80px;
  min-height: 44px;
}
.day-appointments {
  margin-top: 32px;
}
.day-appointments h2 {
  margin-bottom: 16px;
}
.review-focus {
  max-width: 720px;
  padding: 24px 0;
}
.review-focus h2 {
  margin: 16px 0;
  overflow-wrap: anywhere;
}
.review-focus p {
  margin: 12px 0;
}
.review-progress {
  width: 100%;
  height: 8px;
}
.review-decisions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}
.review-decisions button {
  min-height: 48px;
  white-space: normal;
}
.recovery-field {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.recovery-field > input {
  flex: 0 0 20px;
}
.recovery-field span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.recovery-field > span > span {
  display: block;
  white-space: pre-wrap;
  margin-top: 6px;
}
.trash-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.dialog-body {
  scroll-padding-block: 16px;
}
.dialog-body :is(input, textarea, select, button) {
  scroll-margin-block: 16px;
}
