/* Nodi work surfaces: a compact rail, contextual workspace navigation, and one connected work thread. */
.nw-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  vertical-align: middle;
}

.nw-shell {
  --rail-width: 58px;
  --sidebar-width: 244px;
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 100svh;
  padding-left: calc(var(--rail-width) + var(--sidebar-width));
  color: var(--text);
}
.nw-shell.nw-collapsed {
  --sidebar-width: 0px;
}
.nw-main.main-area {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
}

/* Main-area rail */
.nw-rail {
  position: fixed;
  z-index: 70;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--rail-width);
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 5px;
  border-right: 1px solid var(--border);
  background: var(--surface-1);
}
.nw-logo {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 8px;
}
.nw-logo img {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.nw-rail > button,
.nw-rail-bottom > button {
  position: relative;
  display: flex;
  width: 48px;
  min-height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-xs);
  line-height: 1.15;
  text-align: center;
}
.nw-rail > button:hover,
.nw-rail-bottom > button:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nw-rail > button.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.nw-rail > button.active::before {
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: -5px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}
.nw-rail > button .nw-icon,
.nw-rail-bottom > button .nw-icon {
  width: 17px;
  height: 17px;
}
.nw-rail-bottom {
  display: grid;
  gap: 5px;
  margin-top: auto;
}

/* Contextual sidebar */
.nw-sidebar {
  position: fixed;
  z-index: 60;
  top: 0;
  bottom: 0;
  left: var(--rail-width);
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow: auto;
  padding: 17px 12px 14px;
  border-right: 1px solid var(--border);
  background: var(--surface-1);
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}
.nw-collapsed .nw-sidebar {
  display: none;
}
.nw-sidebar-heading {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 7px 12px;
  border-bottom: 1px solid var(--border);
}
.nw-sidebar-heading strong {
  overflow: hidden;
  color: var(--text);
  font-size: var(--type-body);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nw-sidebar-heading > button {
  display: grid;
  width: 34px;
  min-height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
}
.nw-sidebar-heading > button:hover {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.nw-sidebar > nav {
  flex: 1;
  padding-top: 10px;
}
.nw-nav {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-sm);
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nw-nav:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nw-nav.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nw-nav.active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}
.nw-nav > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nw-sidebar .nw-chip {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}
.nw-section {
  margin-top: 21px;
}
.nw-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 3px 4px;
}
.nw-section-heading > button:first-child {
  display: flex;
  min-height: 30px;
  flex: 1;
  align-items: center;
  gap: 7px;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-xs);
  font-weight: 600;
  text-align: left;
}
.nw-section-heading > button:first-child:hover {
  color: var(--text);
}
.nw-section-heading > button:first-child .nw-icon {
  width: 13px;
  height: 13px;
  transform: rotate(90deg);
  transition: transform var(--micro) var(--ease-out);
}
.nw-section-heading > button[aria-expanded="false"] .nw-icon {
  transform: rotate(0);
}
.nw-section-heading > button:last-child {
  display: grid;
  width: 30px;
  min-height: 30px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
}
.nw-section-heading > button:last-child:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nw-note {
  margin: 6px 0 0;
  padding: 0 8px;
  color: var(--text-muted);
  font-size: var(--type-xs);
  line-height: 1.55;
}
.nw-count {
  display: inline-grid;
  min-width: 22px;
  min-height: 20px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: var(--type-xs);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.sidebar-scrim {
  display: none;
}

/* Topbar and contextual path */
.nw-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 60px;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(18px, 3vw, 38px);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px);
}
.nw-topbar > .nw-sidebar-toggle {
  display: grid;
  width: 36px;
  min-height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
}
.nw-topbar > .nw-sidebar-toggle:hover {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.nw-topbar .nw-workspace {
  display: flex;
  max-width: 220px;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text);
  font-size: var(--type-sm);
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nw-topbar .nw-workspace:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.nw-workspace .nw-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}
.nw-topbar .search-box {
  display: flex;
  width: min(360px, 34vw);
  min-width: 160px;
  height: 40px;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  padding: 0 10px;
  border-color: var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-muted);
}
.nw-topbar .search-box:focus-within {
  border-color: var(--accent);
}
.nw-topbar .search-box > .nw-icon {
  width: 16px;
  height: 16px;
}
.nw-topbar .search-box input {
  width: 100%;
  min-width: 0;
}
.nw-topbar .search-box kbd {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--text-faint);
  font-size: var(--type-xs);
}
.nw-topbar .nw-assistant {
  display: inline-flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--type-sm);
  font-weight: 600;
  white-space: nowrap;
}
.nw-topbar .nw-assistant:hover {
  border-color: var(--accent);
}
.nw-topbar .nw-assistant .nw-icon {
  width: 16px;
  height: 16px;
}
.nw-topbar > .avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--type-sm);
  font-weight: 700;
}
.nw-topbar > .avatar:hover {
  border-color: var(--accent);
}
.nw-breadcrumb {
  min-width: 0;
  padding: 15px clamp(20px, 3vw, 40px) 0;
}
.nw-breadcrumb .nw-icon {
  width: 14px;
  height: 14px;
}
.nw-main .page-content {
  width: 100%;
  max-width: 1560px;
  min-width: 0;
  margin: 0 auto;
  padding: 23px clamp(20px, 3vw, 40px) 64px;
}

/* Route headings, project context, tabs, and list controls */
.nw-page-heading,
.nw-dashboard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 23px;
}
.nw-page-heading > div:last-child,
.nw-dashboard-heading > div:last-child {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}
.nw-project-heading {
  padding: 0 0 18px;
  border-bottom: 1px solid var(--border);
}
.nw-project-title {
  min-width: 0;
}
.nw-project-title h1,
.nw-dashboard-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: var(--type-xl);
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}
.nw-project-title > p,
.nw-dashboard-heading p {
  max-width: 66ch;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: var(--type-body);
  line-height: 1.55;
}
.nw-project-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: var(--type-xs);
  font-variant-numeric: tabular-nums;
}
.nw-project-facts span + span {
  position: relative;
}
.nw-project-facts span + span::before {
  position: absolute;
  top: 50%;
  left: -10px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
  content: "";
  transform: translateY(-50%);
}
.nw-dashboard-heading {
  align-items: center;
  margin-bottom: 28px;
}
.nw-dashboard-heading h1 {
  font-size: clamp(25px, 2.8vw, 32px);
}
.nw-dashboard-heading p {
  text-transform: capitalize;
}
.nw-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text);
  font-size: var(--type-sm);
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}
.nw-chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-3);
}
.nw-chip.primary {
  min-height: 40px;
  padding: 0 15px;
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.nw-chip.primary:hover {
  background: var(--accent-hover);
}
.nw-tabs {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: stretch;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nw-view-tabs {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.nw-view-tabs > .nw-tabs {
  flex: 1;
  border-bottom: 0;
}
.nw-view-picker {
  min-height: 32px;
  flex: 0 0 auto;
  padding-inline: 9px;
  font-size: var(--type-xs);
}
.nw-tabs::-webkit-scrollbar {
  display: none;
}
.nw-tabs > button {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-sm);
  font-weight: 500;
  white-space: nowrap;
}
.nw-tabs > button:hover {
  color: var(--text);
}
.nw-tabs > button.active {
  color: var(--accent);
  font-weight: 600;
}
.nw-tabs > button .nw-icon {
  width: 15px;
  height: 15px;
}
.nw-tabs .nc-tab-indicator {
  height: 2px;
  background: var(--accent);
}
.nw-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 14px 0 16px;
}
.nw-toolbar .nw-chip {
  min-height: 32px;
  padding-inline: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-toolbar .nw-chip:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nw-list-search {
  display: flex;
  width: min(240px, 28vw);
  min-width: 140px;
  height: 40px;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 0 9px;
  border-color: var(--border);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--text-muted);
}
.nw-list-search .nw-icon {
  width: 15px;
  height: 15px;
}
.nw-list-search input {
  width: 100%;
  min-width: 0;
}
.nw-backlog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

/* Dense, readable work rows. Tables own their horizontal scroll region. */
.nw-list {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}
.nw-columns,
.nw-row {
  display: grid;
  min-width: max-content;
  align-items: center;
  gap: 0;
  grid-template-columns: var(--nw-cols);
}
.nw-columns {
  min-height: 36px;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: var(--type-xs);
  font-weight: 600;
}
.nw-columns > span {
  min-width: 0;
  overflow: hidden;
  padding: 0 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nw-columns > .nw-actions {
  display: grid;
  place-items: center;
  padding: 0;
}
.nw-columns > .nw-actions > button,
.nw-actions > button {
  display: grid;
  width: 100%;
  min-height: 36px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
}
.nw-columns > .nw-actions > button:hover,
.nw-actions > button:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nw-gridcell {
  min-width: 0;
  height: 100%;
}
.nw-gridcell > button {
  width: 100%;
}
.nw-group {
  margin-bottom: 15px;
}
.nw-group-head {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 3px 7px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-sm);
  text-align: left;
}
.nw-group-head:hover {
  color: var(--text);
}
.nw-group-head > .nw-icon {
  width: 14px;
  height: 14px;
  transform: rotate(90deg);
  transition: transform var(--micro) var(--ease-out);
}
.nw-group-head[aria-expanded="false"] > .nw-icon {
  transform: rotate(0);
}
.nw-group-head .nw-count {
  margin-left: 2px;
}
.nw-row {
  height: 36px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: var(--type-sm);
}
.nw-table .nw-row {
  height: 40px;
}
.nw-row:hover,
.nw-row:focus-within {
  background: var(--surface-2);
}
.nw-row button {
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: var(--type-sm);
}
.nw-name {
  display: flex;
  min-width: 0;
  height: 100%;
  align-items: center;
  gap: 7px;
  padding-left: calc(9px + var(--depth) * 12px);
}
.nw-name > button:first-of-type {
  flex: 1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nw-quick {
  display: flex;
  flex: 0 0 auto;
  opacity: 0;
}
.nw-row:hover .nw-quick,
.nw-row:focus-within .nw-quick {
  opacity: 1;
}
.nw-quick > button {
  display: grid;
  width: 28px;
  min-height: 28px;
  place-items: center;
  padding: 0;
  border-radius: 6px;
  color: var(--text-muted);
}
.nw-quick > button:hover {
  background: var(--surface-3);
  color: var(--text);
}
.nw-cell {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  padding: 0 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nw-cell > span:not(.avatar):not(.nw-badge):not(.nc-badge) {
  overflow: hidden;
  text-overflow: ellipsis;
}
.nw-cell .avatar {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  font-size: var(--type-xs);
}
.nw-cell .nw-icon {
  width: 14px;
  height: 14px;
}
.nw-row .nw-cell:disabled {
  cursor: default;
  opacity: 1;
}
.nw-badge {
  flex: 0 0 auto;
}
.nw-status-doing {
  color: var(--status-doing);
}
.nw-status-review {
  color: var(--status-review);
}
.nw-status-done {
  color: var(--status-done);
}
.nw-status-blocked,
.overdue {
  color: var(--status-blocked);
}
.nw-priority {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--status-neutral);
  font-size: var(--type-xs);
}
.nw-priority .nw-icon {
  width: 14px;
  height: 14px;
}
.nw-priority-high {
  color: var(--status-review);
}
.nw-priority-urgent {
  color: var(--status-blocked);
}
.nw-priority-low {
  color: var(--status-done);
}
.nw-add {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 4px 9px;
  color: var(--text-muted);
}
.nw-add > span {
  flex: 0 0 auto;
  font-size: 18px;
}
.nw-add input {
  width: 100%;
  min-width: 0;
  flex: 1;
}
.nw-add button {
  min-height: 32px;
  flex: 0 0 auto;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-add button:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nw-add:not(:focus-within) button {
  visibility: hidden;
}
.nw-virtual {
  position: relative;
  contain: layout style;
}
.nw-virtual > .nw-row {
  position: absolute;
  inset-inline: 0;
}
.nw-dense .nw-group {
  margin-bottom: 8px;
}

/* Shared popovers: only direct option buttons are styled here, never shared controls. */
.nw-popover {
  position: fixed;
  z-index: 100;
  width: max-content;
  min-width: 205px;
  max-width: min(360px, calc(100vw - 16px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-1);
  box-shadow: var(--shadow);
  transform-origin: top left;
}
.nw-popover > button {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: var(--type-sm);
  text-align: left;
}
.nw-popover > button:hover,
.nw-popover > button:focus-visible {
  background: var(--surface-3);
}
.nw-popover form {
  display: grid;
  gap: 14px;
  padding: 9px;
}
.nw-popover label {
  display: grid;
  gap: 7px;
  color: var(--text-muted);
  font-size: var(--type-sm);
}

/* Home: next action first, with a visible line connecting focus to the queue. */
.nw-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.8fr);
  align-items: start;
  gap: clamp(30px, 4.5vw, 58px);
}
.nw-personal {
  position: relative;
  min-width: 0;
  padding-left: 25px;
}
.nw-personal::before {
  position: absolute;
  top: 41px;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--border-strong);
  content: "";
}
.nw-home-section-heading {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.nw-home-section-heading::before {
  position: absolute;
  top: 7px;
  left: -30px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  content: "";
}
.nw-home-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-home-section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: var(--type-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.nw-home-count {
  flex: 0 0 auto;
  padding-top: 13px;
  color: var(--text-muted);
  font-size: var(--type-xs);
  font-variant-numeric: tabular-nums;
}
.nw-next-card {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 19px 20px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 11px;
  background: var(--surface-1);
}
.nw-next-card-copy {
  min-width: 0;
}
.nw-next-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-next-card h3 {
  margin: 9px 0 12px;
  font-size: var(--type-lg);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.nw-next-card h3 button {
  max-width: 100%;
  min-height: 40px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
}
.nw-next-card h3 button:hover {
  color: var(--accent);
}
.nw-next-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 17px;
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-next-details > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}
.nw-next-details .nw-icon {
  width: 14px;
  height: 14px;
  color: var(--text-faint);
}
.nw-next-details time {
  color: inherit;
}
.nw-next-assignee {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-next-assignee .avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  font-size: var(--type-xs);
}
.nw-next-open {
  display: inline-flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--type-xs);
  font-weight: 600;
  white-space: nowrap;
}
.nw-next-open:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.nw-next-open .nw-icon {
  width: 14px;
  height: 14px;
}
.nw-personal-queue {
  margin-top: 24px;
}
.nw-queue-heading {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.nw-queue-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: var(--type-sm);
  font-weight: 600;
}
.nw-queue-heading > span {
  color: var(--text-muted);
  font-size: var(--type-xs);
  font-variant-numeric: tabular-nums;
}
.nw-personal .nw-list {
  overflow-x: auto;
}
.nw-personal .nw-columns,
.nw-personal .nw-row {
  grid-template-columns: minmax(180px, 1fr) 150px 145px 36px !important;
}
.nw-personal .nw-header-priority,
.nw-personal .nw-header-status,
.nw-personal .nw-header-comments,
.nw-personal .nw-priority,
.nw-personal .nw-status,
.nw-personal .nw-comments {
  display: none;
}
.nw-personal .nw-columns > .nw-actions {
  grid-column: 4;
}
.nw-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 30px;
  border-top: 1px solid var(--border);
}
.nw-metric {
  display: grid;
  min-width: 0;
  min-height: 84px;
  align-content: center;
  gap: 3px;
  padding: 12px 13px 12px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
}
.nw-metric:nth-child(odd) {
  margin-right: 14px;
  border-right: 1px solid var(--border);
}
.nw-metric:nth-child(even) {
  padding-left: 14px;
}
.nw-metric > span {
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-metric strong {
  color: var(--text);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.nw-metric small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-metric .nw-icon {
  width: 13px;
  height: 13px;
  color: var(--text-faint);
  transition: transform var(--micro) var(--ease-out);
}
.nw-metric:hover small .nw-icon {
  color: var(--accent);
  transform: translate(2px, -2px);
}
.nw-dashboard-aside {
  min-width: 0;
}
.nw-context-section {
  min-width: 0;
  padding: 0 0 19px;
  border-bottom: 1px solid var(--border);
}
.nw-context-section + .nw-context-section {
  padding-top: 19px;
}
.nw-context-section h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: var(--type-sm);
  font-weight: 600;
}
.nw-project-summary,
.nw-goal {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 7px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
}
.nw-project-summary:last-of-type,
.nw-goal:last-of-type {
  border-bottom: 0;
}
.nw-project-summary:hover strong,
.nw-goal:hover > span {
  color: var(--accent);
}
.nw-project-summary strong,
.nw-goal > span {
  overflow: hidden;
  font-size: var(--type-sm);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nw-project-summary small,
.nw-goal small {
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-avatars,
.nw-avatars .nc-avatar-stack {
  display: flex;
  align-items: center;
}
.nw-avatars .avatar {
  width: 23px;
  height: 23px;
  font-size: var(--type-xs);
}
.nw-context-section progress {
  display: block;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 99px;
  appearance: none;
  background: var(--surface-3);
}
.nw-context-section progress::-webkit-progress-bar {
  background: var(--surface-3);
}
.nw-context-section progress::-webkit-progress-value {
  border-radius: 99px;
  background: var(--accent);
}
.nw-context-section progress::-moz-progress-bar {
  border-radius: 99px;
  background: var(--accent);
}
.nw-feed {
  position: relative;
  margin-left: 4px;
  padding: 7px 0 9px 13px;
  border-left: 1px solid var(--border-strong);
}
.nw-feed::before {
  position: absolute;
  top: 12px;
  left: -4px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-1);
  content: "";
}
.nw-feed p {
  margin: 0;
  color: var(--text);
  font-size: var(--type-sm);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.nw-feed small,
.nw-feed time {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: var(--type-xs);
  line-height: 1.45;
}

/* Existing board, calendar, and timeline data stay within their own scroll surfaces. */
.nw-main .board-columns {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  align-items: start;
  gap: 12px;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 1px 12px;
  overscroll-behavior-x: contain;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}
.nw-main .board-column {
  min-width: 0;
  min-height: 240px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-1);
}
.nw-main .board-column.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.nw-main .board-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 2px 11px;
  border-bottom: 1px solid var(--border);
}
.nw-main .board-heading h2 {
  flex: 1;
  margin: 0;
  color: var(--text);
  font-size: var(--type-sm);
  font-weight: 600;
}
.nw-main .board-heading > span:last-child {
  color: var(--text-muted);
  font-size: var(--type-xs);
  font-variant-numeric: tabular-nums;
}
.nw-main .board-cards {
  display: grid;
  gap: 8px;
  padding-top: 9px;
}
.nw-main .board-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: grab;
}
.nw-main .board-card:hover {
  border-color: var(--border-strong);
}
.nw-main .board-card-top,
.nw-main .board-card-bottom {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-main .board-card-top span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nw-main .board-card > strong {
  display: block;
  margin: 8px 0 5px;
  font-size: var(--type-sm);
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.nw-main .board-card > p {
  margin: 0 0 9px;
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-main .board-card-bottom {
  justify-content: space-between;
}
.nw-main .board-add {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--type-xs);
  text-align: left;
}
.nw-main .board-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.nw-main .calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 1px 0 13px;
}
.nw-main .calendar-toolbar h2 {
  margin: 0 7px;
  color: var(--text);
  font-size: var(--type-lg);
  font-weight: 600;
  text-transform: capitalize;
}
.nw-main .calendar-toolbar > button {
  display: inline-grid;
  min-width: 36px;
  min-height: 36px;
  place-items: center;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-1);
  color: var(--text);
  font-size: var(--type-sm);
}
.nw-main .calendar-toolbar > button:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.nw-main .calendar-toolbar .nw-icon {
  width: 15px;
  height: 15px;
}
.nw-main .calendar-grid {
  display: grid;
  max-width: 100%;
  grid-template-columns: repeat(7, minmax(86px, 1fr));
  overflow-x: auto;
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
  border-radius: 8px;
  overscroll-behavior-x: contain;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}
.nw-main .calendar-weekday {
  padding: 8px 5px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-muted);
  font-size: var(--type-xs);
  font-weight: 600;
  text-align: center;
}
.nw-main .calendar-cell {
  min-width: 0;
  min-height: 92px;
  padding: 6px;
  overflow: auto;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}
.nw-main .calendar-cell.outside {
  background: var(--bg);
}
.nw-main .calendar-cell.today {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.nw-main .calendar-day {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-main .calendar-task {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 3px 0;
  padding: 4px 5px;
  overflow: hidden;
  border: 0;
  border-left: 2px solid var(--status-neutral);
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--type-xs);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nw-main .calendar-task.status-doing {
  border-color: var(--status-doing);
}
.nw-main .calendar-task.status-review {
  border-color: var(--status-review);
}
.nw-main .calendar-task.status-done {
  border-color: var(--status-done);
}
.nw-main .more-tasks {
  color: var(--text-muted);
  font-size: var(--type-xs);
}
.nw-gantt {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.nw-gantt > header {
  padding: 10px 0 13px;
  color: var(--text-muted);
  font-size: var(--type-sm);
}
.nw-gantt-row {
  display: grid;
  min-width: 640px;
  min-height: 42px;
  align-items: center;
  grid-template-columns: 210px minmax(420px, 1fr);
  border-bottom: 1px solid var(--border);
}
.nw-gantt-row > button {
  min-width: 0;
  overflow: hidden;
  padding: 0 9px 0 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--type-sm);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nw-gantt-row > div {
  min-width: 0;
  overflow: hidden;
}
.nw-gantt-row > div > button {
  min-width: 4px;
  height: 14px;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
}
.nw-gantt-row > div > button:hover {
  background: var(--accent-hover);
}

/* Existing skeleton entry point and shared motion preferences. */
.nw-boot {
  width: min(100%, 1040px);
  margin: 56px auto;
  padding: 24px;
}
.nw-boot .skeleton-row {
  height: 36px;
  margin-bottom: 8px;
  border-radius: 6px;
  background: var(--surface-2);
}
@media (prefers-reduced-motion: reduce) {
  .nw-shell *,
  .nw-shell *::before,
  .nw-shell *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
:root[data-reduce-motion="true"] .nw-shell *,
:root[data-reduce-motion="true"] .nw-shell *::before,
:root[data-reduce-motion="true"] .nw-shell *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (max-width: 1099px) {
  .nw-shell {
    --sidebar-width: 220px;
  }
  .nw-dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .nw-dashboard-aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 24px;
  }
  .nw-context-section {
    padding-top: 0;
  }
  .nw-context-section + .nw-context-section {
    padding-top: 0;
  }
  .nw-activity-section {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .nw-shell {
    --sidebar-width: 0px;
    padding-left: var(--rail-width);
  }
  .nw-sidebar {
    display: none;
    width: min(286px, calc(100vw - var(--rail-width)));
    box-shadow: var(--shadow);
  }
  .nw-shell.nw-mobile-sidebar .nw-sidebar {
    display: flex;
  }
  .nw-shell.nw-mobile-sidebar .sidebar-scrim {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: block;
    background: color-mix(in srgb, var(--bg) 62%, transparent);
  }
  .nw-topbar {
    min-height: 56px;
    flex-wrap: wrap;
    gap: 7px;
    padding: 7px 10px;
  }
  .nw-topbar > .nw-sidebar-toggle {
    width: 40px;
    min-height: 40px;
  }
  .nw-topbar .nw-workspace {
    max-width: min(190px, calc(100vw - 200px));
    min-height: 40px;
    flex: 1 1 auto;
  }
  .nw-topbar .search-box {
    order: 5;
    width: 100%;
    min-width: 0;
    height: 40px;
    flex: 1 0 100%;
    margin: 0;
  }
  .nw-topbar .nw-assistant {
    width: 40px;
    min-height: 40px;
    justify-content: center;
    padding: 0;
  }
  .nw-topbar .nw-assistant span {
    display: none;
  }
  .nw-topbar > .avatar {
    width: 40px;
    height: 40px;
  }
  .nw-breadcrumb {
    padding: 12px 15px 0;
  }
  .nw-main .page-content {
    padding: 20px 15px 48px;
  }
  .nw-project-heading,
  .nw-dashboard-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 13px;
  }
  .nw-project-heading > div:last-child,
  .nw-dashboard-heading > div:last-child {
    width: 100%;
  }
  .nw-project-heading > div:last-child .nw-chip,
  .nw-dashboard-heading > div:last-child .nw-chip {
    flex: 0 1 auto;
  }
  .nw-project-title h1 {
    font-size: 25px;
  }
  .nw-view-tabs {
    gap: 4px;
  }
  .nw-view-picker {
    min-height: 36px;
    padding-inline: 7px;
  }
  .nw-toolbar {
    gap: 6px;
  }
  .nw-toolbar .nw-chip {
    min-height: 36px;
  }
  .nw-list-search {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    margin-left: 0;
  }
  .nw-dashboard-grid {
    gap: 27px;
  }
  .nw-dashboard-aside {
    display: block;
  }
  .nw-context-section + .nw-context-section {
    padding-top: 16px;
  }
  .nw-activity-section {
    grid-column: auto;
  }
  .nw-next-card {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  .nw-next-open {
    min-height: 40px;
  }
  .nw-personal {
    padding-left: 18px;
  }
  .nw-personal::before {
    top: 36px;
  }
  .nw-home-section-heading::before {
    left: -23px;
  }
  .nw-personal .nw-columns,
  .nw-personal .nw-row {
    grid-template-columns: minmax(130px, 1fr) 110px 36px !important;
  }
  .nw-personal .nw-assignee,
  .nw-personal .nw-header-assignee,
  .nw-personal .nw-priority,
  .nw-personal .nw-header-priority,
  .nw-personal .nw-status,
  .nw-personal .nw-header-status,
  .nw-personal .nw-comments,
  .nw-personal .nw-header-comments {
    display: none;
  }
  .nw-personal .nw-columns > .nw-actions {
    grid-column: 3;
  }
  .nw-personal .nw-row,
  .nw-table .nw-row {
    height: 44px;
  }
  .nw-row {
    height: 44px;
  }
  .nw-quick {
    opacity: 1;
  }
  .nw-gantt-row {
    min-height: 44px;
  }
  .nw-main .board-columns {
    grid-template-columns: repeat(5, minmax(210px, 1fr));
  }
  .nw-main .calendar-toolbar {
    flex-wrap: wrap;
  }
  .nw-main .calendar-grid {
    grid-template-columns: repeat(7, minmax(74px, 1fr));
  }
  .nw-main .calendar-cell {
    min-height: 76px;
    padding: 5px;
  }
}

@media (max-width: 420px) {
  .nw-topbar {
    gap: 5px;
    padding-inline: 8px;
  }
  .nw-topbar .nw-workspace {
    max-width: calc(100vw - 185px);
    padding-inline: 8px;
    font-size: var(--type-xs);
  }
  .nw-topbar .nw-assistant,
  .nw-topbar > .avatar,
  .nw-topbar > .nw-sidebar-toggle {
    width: 36px;
    min-height: 36px;
  }
  .nw-topbar > .avatar {
    height: 36px;
  }
  .nw-topbar .search-box {
    height: 40px;
    min-height: 40px;
  }
  .nw-main .page-content {
    padding: 18px 12px 40px;
  }
  .nw-breadcrumb {
    padding-inline: 12px;
  }
  .nw-view-picker {
    padding-inline: 6px;
  }
  .nw-project-heading > div:last-child .nw-chip,
  .nw-dashboard-heading > div:last-child .nw-chip {
    min-height: 38px;
    padding-inline: 10px;
    font-size: var(--type-xs);
  }
  .nw-dashboard-heading h1 {
    font-size: 25px;
  }
  .nw-personal {
    padding-left: 16px;
  }
  .nw-personal::before {
    left: 0;
  }
  .nw-home-section-heading::before {
    left: -21px;
  }
  .nw-home-count {
    max-width: 112px;
    text-align: right;
  }
  .nw-metric {
    min-height: 80px;
    padding-right: 9px;
  }
  .nw-metric:nth-child(odd) {
    margin-right: 8px;
  }
  .nw-metric:nth-child(even) {
    padding-left: 9px;
  }
  .nw-metric strong {
    font-size: 19px;
  }
  .nw-next-card {
    padding: 14px;
  }
  .nw-next-card h3 {
    font-size: var(--type-md);
  }
  .nw-personal .nw-columns,
  .nw-personal .nw-row {
    grid-template-columns: minmax(115px, 1fr) 95px 34px !important;
  }
}
