:root {
  color-scheme: light;
  --bg: #f6f7f5;
  --paper: #fff;
  --side: #f0f2ef;
  --ink: #292e2a;
  --muted: #747c75;
  --line: #e1e5e1;
  --green: #32664b;
  --soft: #e8f0e9;
  --warm: #f7f1e5;
  --warm-ink: #795b24;
  --red: #a43934;
  --shadow: #26372b0d;
  font:
    400 14px/1.45 'Segoe UI',
    system-ui,
    sans-serif;
  background: var(--bg);
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
a {
  color: var(--green);
}
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  text-align: center;
  text-decoration: none;
}

.brand {
  display: block;
  padding: 0 11px 34px;
  color: var(--ink);
  font-size: 27px;
  font-weight: 550;
  letter-spacing: -1px;
  text-decoration: none;
}

.brand > span {
  color: var(--green);
}
.brand small {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
}

.tracker-page .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 24px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}
.tracker-page .brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: 17px;
  font-weight: 650;
}

.tracker-page .brand-name {
  color: var(--ink);
  line-height: 1.2;
}
.tracker-page .brand small {
  margin-top: 4px;
}

.primary {
  border-color: var(--green);
  background: var(--green);
  color: white;
}
.quiet {
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.muted,
.subtitle {
  color: var(--muted);
}
.error-text {
  color: var(--red);
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--green);
}

.input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.input:focus-visible {
  outline-offset: 1px;
}
textarea.input {
  min-height: 100px;
  resize: vertical;
}
.field {
  display: grid;
  gap: 5px;
  font-size: 12px;
}
.check {
  display: flex;
  min-height: 34px;
  align-items: flex-start;
  gap: 10px;
}
.check input {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--green);
}
.view-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.view-group legend {
  padding: 0 5px;
  font-size: 13px;
}
.view-group .check {
  min-height: 30px;
  font-size: 12px;
}
.access-form {
  display: grid;
  max-width: 660px;
  gap: 15px;
}
.access-form .primary {
  justify-self: start;
}

.tracker-page {
  height: 100dvh;
  overflow: hidden;
}
.tracker-page [hidden] {
  display: none !important;
}
.tracker-page .app-shell {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-columns: 220px minmax(0, 1fr);
}

.tracker-page .sidebar {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: auto;
  padding: 20px 12px 14px;
  border-right: 1px solid var(--line);
  background: var(--side);
}

.sidebar nav {
  display: grid;
  gap: 3px;
}
.nav-label {
  margin: 21px 10px 6px;
  color: #909791;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.nav-button {
  width: 100%;
  justify-content: flex-start;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
}
.nav-button[aria-current='page'] {
  background: #e4ece5;
  color: var(--green);
  font-weight: 600;
}
.secondary-nav {
  display: grid;
  gap: 2px;
  padding-left: 8px;
}
.profile {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 20px 9px 0;
}
.profile-name {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracker-page .workspace {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: var(--paper);
  container: workspace / inline-size;
}

.topbar {
  display: flex;
  min-height: 50px;
  flex: 0 0 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  font-size: 12px;
}
.topbar-tools,
.topbar #top-actions,
#sync-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}
#sync-controls {
  flex: 0 0 auto;
  gap: 8px;
}
#sync-status {
  width: 112px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
#refresh-view {
  width: 126px;
  flex: 0 0 126px;
  min-height: 36px;
  white-space: nowrap;
}
.topbar a {
  font-size: 12px;
}

.tracker-page #content {
  display: flex;
  width: 100%;
  max-width: 1120px;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  margin: 0 auto;
  overflow: hidden;
  padding: 25px clamp(18px, 3vw, 36px) 0;
}
.tracker-page .heading,
.tracker-page .tabs {
  flex: 0 0 auto;
}
.tracker-page .heading {
  min-height: 66px;
  margin: 0 0 8px;
}
.heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.35px;
  line-height: 1.25;
}
h2 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}
h3 {
  margin: 18px 0 6px;
  font-size: 13px;
  font-weight: 600;
}
.subtitle {
  margin: 5px 0 0;
  font-size: 12px;
}
.tracker-page .view-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0 2px 28px 0;
}
.tracker-page #notice {
  position: fixed;
  z-index: 5;
  top: 60px;
  right: 16px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 4px 14px var(--shadow);
}
.notice {
  padding: 0 24px;
  color: var(--green);
  font-size: 12px;
}
.notice:empty {
  display: none;
}
.notice.error,
.inline-error {
  color: var(--red);
}

.tabs {
  display: flex;
  gap: 21px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 7px;
}
.tabs .button {
  min-height: 38px;
  padding: 0 0 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}
.tabs .selected {
  border-bottom-color: var(--green);
  color: var(--green);
  font-weight: 600;
}
.tab-count {
  color: inherit;
  opacity: 0.7;
  font-size: 11px;
}

.task-list {
  display: block;
}
.task-card {
  border-bottom: 1px solid var(--line);
}
.task-open {
  display: grid;
  width: 100%;
  min-height: 68px;
  grid-template: 'mark copy meta arrow' auto / 18px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 14px;
  padding: 10px 5px;
  border: 0;
  background: transparent;
  text-align: left;
}
.task-open:hover {
  background: #f8faf8;
}
.task-mark {
  grid-area: mark;
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 1px solid #bec8c0;
  border-radius: 50%;
  color: var(--green);
  font-size: 10px;
}
.task-card[data-status='review'] .task-mark,
.task-card[data-status='discussion'] .task-mark {
  border-color: #d9cda8;
  background: #f8f4e9;
}
.task-card[data-status='done'] .task-mark {
  border-color: var(--green);
  background: var(--green);
  color: white;
}
.task-copy {
  display: block;
  min-width: 0;
  grid-area: copy;
}
.task-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.task-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
.task-owner,
.task-question {
  display: block;
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-question {
  color: var(--warm-ink);
}
.task-meta {
  display: flex;
  grid-area: meta;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.task-date {
  color: var(--muted);
}
.task-priority,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--soft);
  color: var(--green);
  font-size: 10px;
}
.muted-chip {
  background: #f0f1ee;
  color: var(--muted);
}
.row-arrow {
  grid-area: arrow;
  color: #9aa19b;
  text-align: right;
}
.task-card button,
.material-link {
  overflow-wrap: anywhere;
}
.empty {
  padding: 28px 5px;
  color: var(--muted);
}
.empty-title {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.empty-copy {
  font-size: 12px;
}
.loading-placeholder {
  padding: 16px 5px;
  color: var(--muted);
}

.people-list {
  display: grid;
}
.person-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) repeat(4, minmax(42px, 0.45fr)) auto;
  align-items: center;
  gap: 8px;
  padding: 13px 5px;
  border-bottom: 1px solid var(--line);
}
.person-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}
.person-identity h2 {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person-caption {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.person-metrics {
  display: contents;
}
.person-stat {
  display: grid;
  gap: 2px;
}
.person-stat strong {
  font-size: 13px;
  font-weight: 600;
}
.person-stat span {
  color: var(--muted);
  font-size: 10px;
}
.person-stat.needs-attention strong {
  color: #8a6a32;
}
.small-button {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 11px;
}

.agenda-list {
  display: grid;
}
.agenda-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 5px;
  border-bottom: 1px solid var(--line);
}
.agenda-index {
  color: #9aa19b;
  font-size: 11px;
}
.agenda-main {
  min-width: 0;
}
.agenda-row h2 {
  margin: 0 0 3px;
  font-size: 13px;
}
.agenda-row p {
  margin: 0;
  font-size: 12px;
}
.agenda-row .question-preview {
  display: -webkit-box;
  overflow: hidden;
  color: var(--warm-ink);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.section {
  margin-top: 20px;
  padding: 0;
}
.section h2 {
  margin-bottom: 8px;
}
.section .task-list .empty {
  padding: 12px 2px;
}
.callout {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 6px;
  background: var(--soft);
  font-size: 12px;
}
.reason {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--warm);
  color: var(--warm-ink);
  font-size: 12px;
  white-space: pre-wrap;
}
.copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
}
.inline-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f9e8e6;
  font-size: 13px;
}

dialog {
  display: none;
  width: min(740px, calc(100% - 28px));
  height: min(790px, calc(100dvh - 28px));
  max-height: calc(100dvh - 28px);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 60px #17231d2b;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog::backdrop {
  background: #18231d75;
}
.dialog-header {
  position: relative;
  flex: 0 0 auto;
  padding: 19px 22px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.dialog-header h2 {
  margin: 5px 46px 0 0;
  font-size: 19px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.dialog-header .quiet {
  position: absolute;
  top: 13px;
  right: 13px;
  min-width: 36px;
  min-height: 36px;
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
}
.dialog-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.dialog-body {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 19px 22px;
}
.dialog-body .lead {
  overflow-wrap: anywhere;
  margin: 0 0 15px;
  font-size: 14px;
  white-space: pre-wrap;
}
.dialog-body .copy {
  font-size: 13px;
  line-height: 1.6;
}
.link-list {
  padding-left: 20px;
}
.link-list li {
  margin: 7px 0;
}
.dialog-materials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--side);
}
.dialog-materials h3 {
  flex: 0 0 100%;
  margin: 0;
}
.dialog-materials .material-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 600;
}
.dialog-materials .material-link[aria-disabled='true'] {
  opacity: 0.6;
}
.material-link {
  overflow-wrap: anywhere;
}
.dialog-footer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.dialog-footer:empty {
  display: none;
}

@container workspace (max-width: 600px) {
  .topbar {
    gap: 7px;
    padding-right: 12px;
    padding-left: 12px;
  }
  .tracker-page .topbar > span {
    display: none;
  }
  .topbar-tools {
    flex: 1;
    justify-content: space-between;
    gap: 7px;
  }
  .topbar #top-actions {
    gap: 6px;
  }
  .tracker-page #top-actions > .chip,
  .tracker-page #top-actions > a {
    display: none;
  }
  #sync-controls {
    gap: 5px;
  }
  #sync-status {
    width: 76px;
  }
  .tracker-page #content {
    padding-right: 14px;
    padding-left: 14px;
  }
  .tracker-page .heading {
    min-height: 58px;
  }
  .tracker-page .tabs {
    gap: 15px;
  }
  .tracker-page .tabs .button {
    font-size: 12px;
  }
  .task-open {
    min-height: 58px;
    grid-template: 'mark copy arrow' auto 'mark meta arrow' auto / 16px minmax(0, 1fr) 14px;
    gap: 2px 10px;
    padding: 9px 2px;
  }
  .task-copy {
    align-self: end;
  }
  .task-meta {
    justify-content: flex-start;
    align-self: start;
    gap: 7px;
    font-size: 10px;
  }
  .task-priority {
    min-height: 19px;
    padding: 2px 6px;
  }
  .person-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 13px 2px;
  }
  .person-identity {
    grid-column: 1;
  }
  .person-metrics {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .person-stat span {
    font-size: 9px;
  }
  .person-row > .button {
    grid-column: 2;
    grid-row: 1;
  }
  .agenda-row {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    padding: 12px 2px;
  }
  .agenda-row > .chip,
  .agenda-row > .small-button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .tracker-page .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .tracker-page .sidebar {
    display: block;
    overflow: hidden;
    padding: 7px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .tracker-page .brand,
  .tracker-page .profile,
  .tracker-page .nav-label {
    display: none;
  }
  .sidebar nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
  }
  .nav-button {
    width: auto;
    min-height: 40px;
    flex: 0 0 auto;
    padding: 7px 10px;
    white-space: nowrap;
  }
  .secondary-nav {
    padding-left: 0;
  }
  .topbar {
    padding: 5px 12px;
  }
  .tracker-page .topbar > span,
  .tracker-page #top-actions .material-link,
  .tracker-page #top-actions .chip {
    display: none;
  }
  .tracker-page .topbar-tools {
    width: 100%;
    justify-content: space-between;
    gap: 7px;
  }
  .topbar #top-actions {
    gap: 6px;
  }
  .tracker-page #sync-status {
    width: min(112px, 27vw);
  }
  .tracker-page #refresh-view {
    padding: 6px 8px;
  }
  .tracker-page #content {
    padding: 17px 14px 0;
  }
  .tracker-page .heading {
    min-height: 58px;
  }
  .tracker-page .tabs {
    gap: 15px;
  }
  .tracker-page .tabs .button {
    font-size: 12px;
  }
  .notice {
    padding: 0 14px;
  }
  .tracker-page #notice {
    top: 54px;
    right: 8px;
  }
  .task-open {
    min-height: 58px;
    grid-template: 'mark copy arrow' auto 'mark meta arrow' auto / 16px minmax(0, 1fr) 14px;
    gap: 2px 10px;
    padding: 9px 2px;
  }
  .task-copy {
    align-self: end;
  }
  .task-meta {
    justify-content: flex-start;
    align-self: start;
    gap: 7px;
    font-size: 10px;
  }
  .task-priority {
    min-height: 19px;
    padding: 2px 6px;
  }
  .row-arrow {
    align-self: center;
  }
  .person-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 13px 2px;
  }
  .person-identity {
    grid-column: 1;
  }
  .person-metrics {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .person-stat span {
    font-size: 9px;
  }
  .person-row > .button {
    grid-column: 2;
    grid-row: 1;
  }
  .agenda-row {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    padding: 12px 2px;
  }
  .agenda-row > .chip,
  .agenda-row > .small-button {
    grid-column: 2;
    justify-self: start;
  }
  dialog {
    width: calc(100% - 14px);
    height: calc(100dvh - 14px);
    max-height: calc(100dvh - 14px);
    border-radius: 8px;
  }
  .dialog-header,
  .dialog-body,
  .dialog-footer {
    padding-right: 16px;
    padding-left: 16px;
  }
  .dialog-footer .button {
    min-height: 42px;
  }
}

@media (max-width: 390px) {
  .topbar {
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }
  #sync-controls {
    gap: 4px;
  }
  .tracker-page #sync-status {
    width: 76px;
  }
  .tracker-page #content {
    padding-right: 11px;
    padding-left: 11px;
  }
  .tracker-page .tabs {
    gap: 12px;
  }
  .task-open {
    column-gap: 7px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  button,
  a {
    transition:
      color 0.14s ease,
      background-color 0.14s ease,
      border-color 0.14s ease;
  }
}
