:root {
  color-scheme: light;
  --canvas: #fafafa;
  --canvas-warm: #f7f6f4;
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --surface-blue: #e8f2fc;
  --surface-green: #e8f5ee;
  --surface-red: #fbedec;
  --ink: #1d1d1f;
  --ink-soft: #333338;
  --muted: #6e6e73;
  --muted-soft: #96969c;
  --blue: #0066cc;
  --blue-hover: #0071e3;
  --green: #187a4b;
  --red: #b94743;
  --line: #e5e5e7;
  --line-strong: #d7d7da;
  --shadow-soft: 0 12px 32px rgba(29, 29, 31, 0.06), 0 2px 6px rgba(29, 29, 31, 0.04);
  --shadow-float: 0 20px 46px rgba(29, 29, 31, 0.13), 0 3px 10px rgba(29, 29, 31, 0.06);
  --radius-card: 22px;
  --radius-control: 14px;
  --radius-pill: 999px;
  --sidebar-width: 220px;
  --inspector-width: 300px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0b0b0c;
  --canvas-warm: #111113;
  --surface: #1c1c1e;
  --surface-soft: #242426;
  --surface-blue: #163048;
  --surface-green: #163927;
  --surface-red: #421f20;
  --ink: #f5f5f7;
  --ink-soft: #e5e5e7;
  --muted: #aeaeb2;
  --muted-soft: #8e8e93;
  --blue: #66b2ff;
  --blue-hover: #83c2ff;
  --green: #63d697;
  --red: #ff857e;
  --line: #3a3a3c;
  --line-strong: #4a4a4d;
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.16);
  --shadow-float: 0 22px 50px rgba(0, 0, 0, 0.42), 0 3px 10px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 32%, transparent);
  outline-offset: 2px;
}

::selection {
  color: var(--ink);
  background: color-mix(in srgb, var(--blue) 22%, transparent);
}

.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;
}

.app-shell {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 76px;
  padding: 14px clamp(18px, 3vw, 42px);
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 11px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 5px solid var(--blue);
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-28deg);
}

.brand-mark span {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 9px;
  height: 9px;
  background: var(--blue);
  border-radius: 50%;
}

.topbar-context {
  display: grid;
  gap: 1px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.topbar-context strong {
  font-size: 14px;
  font-weight: 650;
}

.topbar-kicker,
.sidebar-heading,
.breadcrumb,
.inspector-kicker,
.modal-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-button,
.quiet-button,
.primary-button,
.sidebar-add,
.sync-status,
.view-tab,
.filter-chip,
.inspector-button,
.modal-button,
.order-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  color: var(--ink-soft);
  background: transparent;
  border-radius: var(--radius-pill);
  transition: transform 140ms ease-out, background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out, box-shadow 160ms ease-out;
}

.icon-button:active,
.quiet-button:active,
.primary-button:active,
.sidebar-add:active,
.sync-status:active,
.view-tab:active,
.filter-chip:active,
.inspector-button:active,
.modal-button:active,
.order-button:active {
  transform: scale(0.96);
}

.icon-button {
  width: 42px;
  padding: 0;
  color: var(--muted);
  background: var(--surface-soft);
}

.icon-button:hover {
  color: var(--ink);
  background: var(--line);
}

.icon-button-small {
  width: 30px;
  min-height: 30px;
  font-size: 15px;
}

.primary-button {
  min-height: 44px;
  padding: 0 17px;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  background: var(--blue);
  box-shadow: 0 5px 12px color-mix(in srgb, var(--blue) 24%, transparent);
}

.primary-button:hover {
  background: var(--blue-hover);
  box-shadow: 0 8px 17px color-mix(in srgb, var(--blue) 30%, transparent);
}

.quiet-button {
  min-height: 38px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.quiet-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.sync-status {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.sync-status:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.sync-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 13%, transparent);
}

.sync-status.is-api .sync-dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 13%, transparent);
}

.workspace {
  width: 100%;
  margin: 0 auto;
  padding: 16px clamp(14px, 1.4vw, 24px) 40px;
}

.epic-sidebar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 30px;
}

.epic-list {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.epic-list::-webkit-scrollbar { display: none; }

.epic-item {
  position: relative;
  display: grid;
  gap: 4px;
  flex: 0 0 auto;
  width: auto;
  min-width: 148px;
  max-width: 260px;
  padding: 8px 12px;
  color: var(--muted);
  text-align: start;
  background: transparent;
  border-radius: 16px;
  transition: background-color 160ms ease-out, color 160ms ease-out, transform 140ms ease-out;
}

.epic-item::before {
  position: absolute;
  inset: auto 12px 0;
  height: 2px;
  width: auto;
  content: "";
  background: transparent;
  border-radius: var(--radius-pill);
}

.epic-item:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.epic-item:active {
  transform: scale(0.98);
}

.epic-item.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.epic-item.is-active::before {
  width: auto;
  background: var(--blue);
}

.epic-item-title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epic-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-soft);
  font-size: 12px;
}

.epic-item-meta strong {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.sidebar-add {
  flex: 0 0 auto;
  width: 34px;
  min-height: 34px;
  margin: 0;
  padding: 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 650;
}

.sidebar-add span { display: none; }

.sidebar-add:hover {
  background: var(--surface-blue);
}

.sidebar-note {
  display: flex;
  gap: 8px;
  margin-top: 30px;
  padding-top: 20px;
  color: var(--muted-soft);
  font-size: 12px;
  line-height: 1.45;
  border-top: 1px solid var(--line);
}

.sidebar-note i {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--blue);
}

.sidebar-note p {
  margin: 0;
}

.board-column {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
  min-width: 0;
}

.board-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.board-heading-copy {
  min-width: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.03em;
  text-transform: none;
}

.breadcrumb i {
  color: var(--blue);
  font-size: 15px;
}

.heading-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 620px;
  margin-bottom: 0;
  overflow-wrap: break-word;
  font-size: clamp(30px, 3.6vw, 48px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
  text-wrap: balance;
}

.progress-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--surface-blue);
  border-radius: var(--radius-pill);
}

.board-heading-copy > p {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  text-wrap: pretty;
}

.board-heading-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
}

.view-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-soft);
  border-radius: 13px;
}

.view-tab {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  border-radius: 10px;
}

.view-tab:hover {
  color: var(--ink);
}

.view-tab.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(29, 29, 31, 0.09);
}

.mobile-epic-picker {
  display: none;
}

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  margin-top: 0;
  padding: 4px 0;
  border-bottom: 0;
}

.tag-filters {
  display: none;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tag-filters::-webkit-scrollbar,
.task-rail::-webkit-scrollbar,
.kanban-board::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--line);
}

.filter-chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.filter-chip.is-active {
  color: var(--blue);
  background: var(--surface-blue);
  border-color: color-mix(in srgb, var(--blue) 22%, transparent);
}

.search-box {
  display: flex;
  align-items: center;
  flex: 0 0 190px;
  gap: 8px;
  height: 36px;
  padding: 0 9px 0 11px;
  color: var(--muted-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}

.search-box:focus-within {
  border-color: color-mix(in srgb, var(--blue) 60%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 13%, transparent);
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  font-size: 13px;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box input::placeholder {
  color: var(--muted-soft);
}

.search-box kbd {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--muted-soft);
  font-size: 11px;
  background: var(--surface-soft);
  border-radius: 6px;
}

.view-root {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 8px;
  container-name: task-view;
  container-type: inline-size;
}

@media (min-width: 941px) {
  .board-column.is-map-view.has-inspector .view-root {
    padding-right: calc(var(--inspector-width) + 16px);
  }

  .board-column.is-map-view .inspector {
    right: 0;
  }
}

.map-shell,
.kanban-shell {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  color: var(--ink);
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.chain-controls {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.chain-scope-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 3px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.chain-scope-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  border-radius: 9px;
}

.chain-scope-tab span {
  color: var(--muted-soft);
  font-size: 10px;
}

.chain-scope-tab.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 5px rgba(29, 29, 31, 0.09);
}

.chain-state-list {
  display: flex;
  flex: 1 1 auto;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.chain-state-list::-webkit-scrollbar { display: none; }

.chain-state {
  display: grid;
  grid-template-columns: minmax(132px, 1fr) auto;
  flex: 0 0 auto;
  min-width: 220px;
  max-width: 310px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.chain-select {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 10px;
  color: inherit;
  text-align: left;
}

.chain-select > span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chain-state strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-state small {
  padding-left: 20px;
  color: var(--muted-soft);
  font-size: 10px;
}

.chain-state.is-working {
  color: var(--blue);
  background: var(--surface-blue);
  border-color: color-mix(in srgb, var(--blue) 25%, var(--line));
}

.chain-state.is-selected {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.chain-select:hover { background: color-mix(in srgb, var(--blue) 7%, transparent); }

.chain-kind-toggle {
  min-width: 68px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
  background: color-mix(in srgb, var(--canvas) 55%, transparent);
  border-left: 1px solid var(--line);
}

.chain-kind-toggle:hover {
  color: var(--blue);
  background: var(--surface-blue);
}

.chain-state-empty { align-self: center; color: var(--muted); font-size: 12px; }

.graph-shell::backdrop {
  background: color-mix(in srgb, var(--canvas) 54%, rgba(0, 0, 0, 0.42));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.graph-fullscreen-control {
  display: none;
}

.graph-shell.is-fullscreen {
  position: fixed;
  inset: 0;
  display: flex;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  overscroll-behavior: contain;
}

.graph-shell.is-fullscreen .graph-stage {
  min-height: 0;
  flex: 1 1 auto;
  margin-top: 0;
}

.graph-shell.is-fullscreen .mind-map-graph {
  min-height: 0;
  touch-action: none;
  overscroll-behavior: contain;
}

.graph-shell.is-fullscreen .graph-open-fullscreen {
  display: none;
}

.graph-shell.is-fullscreen .graph-fullscreen-control {
  display: inline-flex;
}

body.has-fullscreen-map {
  overflow: hidden;
}

.graph-map-actions {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.graph-control {
  position: relative;
  justify-content: center;
  width: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: color 140ms ease-out, border-color 140ms ease-out, transform 140ms ease-out;
}

.graph-control::after {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  max-width: min(340px, calc(100vw - 48px));
  padding: 7px 9px;
  color: var(--surface);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  content: attr(data-tooltip);
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 140ms ease-out, transform 140ms ease-out;
}

.graph-control:hover::after,
.graph-control:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.graph-control:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.graph-add-note {
  color: #75600a;
  background: #f6df79;
  border-color: #d4b94d;
}

.graph-control:active,
.graph-selection-bar button:active {
  transform: scale(0.96);
}

.graph-stage {
  position: relative;
  min-height: max(680px, calc(100dvh - 204px));
  margin-top: 0;
  overflow: hidden;
}

.mind-map-graph {
  position: absolute;
  inset: 0;
  min-height: max(680px, calc(100dvh - 204px));
  background-color: var(--surface);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--muted-soft) 28%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  outline: 0;
}

.mind-map-graph.is-note-hover canvas { cursor: grab; }
.mind-map-graph.is-dragging-note canvas { cursor: grabbing; }

.graph-reassign-hint {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid color-mix(in srgb, var(--blue) 36%, var(--line));
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 140ms ease-out, transform 140ms ease-out;
}

.graph-shell.is-reassigning .graph-reassign-hint {
  opacity: 1;
  transform: translate(-50%, 0);
}

.graph-selection-bar {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: calc(100% - 36px);
  min-height: 62px;
  padding: 9px 10px 9px 15px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.graph-selection-bar[hidden] {
  display: none;
}

.graph-selection-bar > div {
  display: grid;
  gap: 2px;
  min-width: 160px;
  max-width: 280px;
  margin-right: 4px;
}

.graph-selection-bar span {
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.graph-selection-bar strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-selection-bar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  background: var(--surface-soft);
  border-radius: 11px;
  transition: color 140ms ease-out, background-color 140ms ease-out, transform 140ms ease-out;
}

.graph-selection-bar button:hover {
  color: var(--blue);
  background: var(--surface-blue);
}

.graph-selection-bar button:disabled {
  opacity: 0.38;
  pointer-events: none;
}

.mind-map-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 30px;
  padding: 30px 22px 28px;
}

.root-column {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 12px;
}

.root-column::after {
  position: absolute;
  top: 80px;
  right: -30px;
  width: 30px;
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.epic-node {
  position: relative;
  width: 100%;
  padding: 19px;
  background: var(--surface-blue);
  border: 1px solid color-mix(in srgb, var(--blue) 20%, transparent);
  border-radius: var(--radius-card);
  box-shadow: 0 9px 24px color-mix(in srgb, var(--blue) 9%, transparent);
}

.epic-node::after {
  position: absolute;
  top: 68px;
  right: -42px;
  width: 43px;
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.node-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.epic-node h2 {
  margin: 14px 0 7px;
  font-size: 20px;
  letter-spacing: -0.03em;
  line-height: 1.12;
  text-wrap: balance;
}

.epic-node p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-wrap: pretty;
}

.epic-node-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 22px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 11px;
  border-top: 1px solid color-mix(in srgb, var(--blue) 18%, transparent);
}

.epic-node-foot strong {
  color: var(--blue);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.branches-column {
  position: relative;
  display: grid;
  gap: 26px;
  min-width: 0;
}

.branch-row {
  position: relative;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  align-items: start;
}

.branch-row::before {
  position: absolute;
  top: 47px;
  left: -43px;
  width: 43px;
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.branch-row::after {
  position: absolute;
  top: 47px;
  left: -44px;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--blue);
  border-radius: 50%;
  transform: translateY(-3px);
}

.branch-info {
  position: relative;
  z-index: 1;
  padding: 13px 10px 12px 0;
}

.branch-info::after {
  position: absolute;
  top: 47px;
  right: -14px;
  width: 14px;
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.branch-name {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
}

.branch-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted-soft);
  font-size: 11px;
}

.task-rail {
  display: flex;
  align-items: stretch;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: clamp(10px, 10vw, 116px);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.rail-node {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  scroll-snap-align: center;
}

.rail-node:first-child {
  padding-left: clamp(8px, 3vw, 38px);
}

.rail-node:last-child {
  padding-right: clamp(8px, 3vw, 38px);
}

.task-connector {
  position: relative;
  flex: 0 0 42px;
  height: 1px;
  background: var(--line-strong);
}

.task-connector::after {
  position: absolute;
  top: -3px;
  right: -1px;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--line-strong);
  border-radius: 50%;
}

.task-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 clamp(250px, 22vw, 302px);
  min-height: 204px;
  padding: 17px;
  color: var(--ink);
  text-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 20px rgba(29, 29, 31, 0.055);
  scroll-snap-align: center;
  transition: transform 170ms ease-out, border-color 170ms ease-out, box-shadow 170ms ease-out, opacity 170ms ease-out;
}

.task-card:hover {
  border-color: color-mix(in srgb, var(--blue) 35%, var(--line));
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.task-card:active {
  transform: scale(0.96);
}

.task-card.is-current {
  flex-basis: clamp(290px, 26vw, 350px);
  min-height: 226px;
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--blue) 11%, transparent);
}

.task-card.is-done {
  opacity: 0.82;
}

.task-card.is-done .task-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.task-card.is-blocked {
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
}

.task-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.task-state i {
  color: var(--muted-soft);
  font-size: 17px;
}

.task-state.is-current {
  color: var(--blue);
}

.task-state.is-current i {
  color: var(--blue);
}

.task-state.is-done {
  color: var(--green);
}

.task-state.is-done i {
  color: var(--green);
}

.task-state.is-blocked {
  color: var(--red);
}

.task-state.is-blocked i {
  color: var(--red);
}

.task-date {
  color: var(--muted-soft);
  font-size: 11px;
  white-space: nowrap;
}

.current-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 16px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}

.task-title {
  margin: 12px 0 7px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-wrap: balance;
}

.task-card:not(.is-current) .task-title {
  margin-top: 22px;
}

.task-description {
  display: -webkit-box;
  min-height: 39px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-wrap: pretty;
}

.task-card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  min-height: 31px;
  margin-top: auto;
  padding-top: 14px;
}

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  background: var(--surface-soft);
  border-radius: 7px;
}

.tag.is-blue {
  color: var(--blue);
  background: var(--surface-blue);
}

.task-estimate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  color: var(--muted-soft);
  font-size: 11px;
}

.add-node {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  margin-left: 20px;
  place-items: center;
  color: var(--blue);
  background: var(--surface-blue);
  border: 1px dashed color-mix(in srgb, var(--blue) 40%, transparent);
  border-radius: 50%;
  transition: transform 140ms ease-out, background-color 160ms ease-out;
}

.add-node:hover {
  background: color-mix(in srgb, var(--blue) 18%, var(--surface));
  transform: scale(1.05);
}

.branch-empty {
  display: flex;
  align-items: center;
  min-height: 126px;
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
}

.map-empty {
  display: grid;
  min-height: 280px;
  padding: 32px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.map-empty-inner {
  max-width: 320px;
}

.map-empty i {
  color: var(--blue);
  font-size: 31px;
}

.map-empty h2 {
  margin: 14px 0 6px;
  font-size: 18px;
}

.map-empty p {
  margin: 0;
  font-size: 13px;
}

.kanban-shell {
  padding: 22px;
}

.kanban-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 0 2px 20px;
}

.kanban-topline strong {
  font-size: 14px;
}

.kanban-topline p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.kanban-topline span {
  color: var(--muted-soft);
  font-size: 11px;
}

.kanban-board {
  display: grid;
  grid-auto-columns: minmax(290px, 1fr);
  grid-auto-flow: column;
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.kanban-column {
  min-width: 0;
  padding: 13px;
  background: color-mix(in srgb, var(--canvas) 60%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: background-color 160ms ease-out, border-color 160ms ease-out;
}

.kanban-column.is-dragover {
  background: var(--surface-blue);
  border-color: color-mix(in srgb, var(--blue) 46%, var(--line));
}

.kanban-column.is-drop-blocked {
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
  cursor: not-allowed;
}

.kanban-column-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 12px;
}

.kanban-column-heading > div {
  min-width: 0;
}

.kanban-column-heading strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.kanban-column-heading small {
  display: block;
  margin-top: 4px;
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 600;
}

.kanban-count {
  display: grid;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  background: var(--surface-soft);
  border-radius: var(--radius-pill);
}

.kanban-column-tasks {
  display: grid;
  gap: 9px;
  min-height: 180px;
  padding-bottom: 9px;
}

.kanban-task-slot {
  position: relative;
  transition: opacity 140ms ease-out, transform 140ms ease-out;
}

.kanban-task-slot.is-dragging {
  opacity: 0.42;
}

.kanban-task-slot.is-drop-before::before,
.kanban-column-tasks.is-drop-at-end::after {
  content: "";
  position: absolute;
  right: 8px;
  left: 8px;
  height: 2px;
  background: var(--blue);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 15%, transparent);
}

.kanban-task-slot.is-drop-before::before {
  top: -5px;
}

.kanban-column-tasks.is-drop-at-end {
  position: relative;
}

.kanban-column-tasks.is-drop-at-end::after {
  bottom: 0;
}

.kanban-column .task-card {
  min-height: 0;
  padding: 14px;
  border-radius: 17px;
}

.kanban-column .task-card .task-title {
  margin-top: 17px;
  font-size: 15px;
}

.kanban-column .task-card.is-current {
  flex-basis: auto;
  min-height: 0;
}

.kanban-column .task-card.is-current .current-mark {
  margin-top: 10px;
}

.kanban-column .task-card.is-current .task-title {
  margin-top: 7px;
}

.kanban-column .task-card[draggable="true"] {
  cursor: grab;
}

.kanban-column .task-card[draggable="true"]:active {
  cursor: grab;
  transform: none;
}

.kanban-task-slot.is-dragging .task-card {
  cursor: grabbing;
}

.kanban-add-task {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  transition: transform 140ms ease-out, background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
}

.kanban-add-task:hover {
  color: var(--blue);
  background: var(--surface-blue);
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
}

.kanban-add-task:active {
  transform: scale(0.96);
}

.inspector-card {
  padding: 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.inspector {
  position: absolute;
  top: 52px;
  right: 16px;
  z-index: 7;
  width: min(var(--inspector-width), calc(100% - 32px));
  max-height: calc(100dvh - 226px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.board-column:not(.is-map-view) .inspector {
  position: static;
  grid-column: 1 / -1;
  width: min(100%, 620px);
  max-height: none;
  margin-top: 18px;
  overflow: visible;
}

.inspector-empty {
  padding: 22px 19px;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
}

.inspector-empty i {
  color: var(--blue);
  font-size: 24px;
}

.inspector-empty h2 {
  margin: 15px 0 7px;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.inspector-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inspector-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.inspector-heading h2 {
  margin: 10px 0 0;
  font-size: 20px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
}

.inspector-heading .icon-button {
  flex: 0 0 auto;
}

.inspector-meta {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.inspector-meta span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.inspector-meta i {
  color: var(--blue);
}

.inspector-description {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  text-wrap: pretty;
}

.inspector-result {
  margin-top: 15px;
  padding: 12px 13px;
  background: var(--surface-soft);
  border-radius: 13px;
}

.inspector-result > span {
  color: var(--muted-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inspector-result > p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.inspector-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
}

.inspector-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}

.inspector-button {
  min-height: 38px;
  padding: 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-blue);
}

.inspector-button:hover {
  background: color-mix(in srgb, var(--blue) 18%, var(--surface));
}

.inspector-button.is-secondary {
  color: var(--muted);
  background: var(--surface-soft);
}

.inspector-button.is-secondary:hover {
  color: var(--ink);
  background: var(--line);
}

.inspector-section {
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.inspector-section h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dependency-list {
  display: grid;
  gap: 7px;
}

.dependency-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dependency-item i {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--green);
}

.dependency-empty {
  color: var(--muted-soft);
  font-size: 12px;
}

.order-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.order-button {
  min-width: 36px;
  min-height: 34px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 10px;
}

.order-button:hover {
  color: var(--ink);
  background: var(--line);
}

.order-caption {
  color: var(--muted-soft);
  font-size: 11px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(29, 29, 31, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 160ms ease-out;
}

.modal-panel {
  width: min(100%, 580px);
  max-height: min(760px, calc(100dvh - 40px));
  overflow-y: auto;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-float);
  animation: modal-in 190ms cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-backdrop { cursor: default; }
.auth-panel { width: min(100%, 430px); }
.auth-error { margin: 0; color: var(--red); font-size: 13px; font-weight: 600; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.modal-header h2 {
  margin: 7px 0 0;
  font-size: 25px;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.modal-header p {
  max-width: 390px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-wrap: pretty;
}

.modal-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label,
.form-field legend {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
}

.note-modal { width: min(100%, 520px); }
.note-modal .form-field textarea { min-height: 150px; }

.note-color-field {
  padding: 0;
  border: 0;
}

.note-color-field legend {
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.note-color-options {
  display: flex;
  gap: 10px;
}

.note-color-option {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  cursor: pointer;
  place-items: center;
}

.note-color-option input {
  position: absolute;
  opacity: 0;
}

.note-color-option > span[aria-hidden="true"] {
  width: 34px;
  height: 34px;
  background: #f6df79;
  border: 1px solid #d4b94d;
  border-radius: 9px;
  box-shadow: 0 4px 10px rgba(29, 29, 31, 0.12);
  transition: transform 140ms ease-out, box-shadow 140ms ease-out;
}

.note-color-option.is-pink > span[aria-hidden="true"] { background: #f3c4cf; border-color: #d995a6; }
.note-color-option.is-blue > span[aria-hidden="true"] { background: #bfe0f4; border-color: #82b9d8; }
.note-color-option.is-green > span[aria-hidden="true"] { background: #c9e7bd; border-color: #91c47d; }
.note-color-option input:checked + span {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--blue), 0 5px 12px rgba(29, 29, 31, 0.16);
  transform: scale(0.96);
}

.note-color-option:active > span[aria-hidden="true"] { transform: scale(0.96); }

.form-field select {
  font-size: 14px;
}

.form-field textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.5;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  background: var(--surface);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 13%, transparent);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.result-field {
  padding: 14px;
  background: var(--surface-green);
  border-radius: 26px;
}

.result-field label {
  color: var(--green);
}

.result-field textarea {
  background: color-mix(in srgb, var(--surface) 76%, var(--surface-green));
}

.task-relation-details {
  display: grid;
  gap: 10px;
}

.task-relation-details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  background: var(--surface-soft);
  border-radius: 14px;
  transition: transform 140ms ease-out, background-color 160ms ease-out, color 160ms ease-out;
}

.task-relation-details > summary::-webkit-details-marker {
  display: none;
}

.task-relation-details > summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 32%, transparent);
  outline-offset: 2px;
}

.task-relation-details > summary:hover,
.task-relation-details[open] > summary {
  color: var(--ink-soft);
  background: var(--line);
}

.task-relation-details > summary:active {
  transform: scale(0.96);
}

.task-relation-details > summary small {
  margin-left: auto;
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 600;
}

.task-relation-details > summary > i:last-child {
  transition: transform 160ms ease-out;
}

.task-relation-details[open] > summary > i:last-child {
  transform: rotate(180deg);
}

.relation-editor {
  display: grid;
  gap: 11px;
  margin-top: 10px;
  padding: 14px;
  background: var(--surface-blue);
  border-radius: 16px;
}

.relation-editor-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.relation-editor > p {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.dependency-picker {
  display: grid;
  gap: 7px;
  max-height: 142px;
  overflow-y: auto;
  padding: 10px;
  background: var(--surface-soft);
  border-radius: 12px;
}

.dependency-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dependency-option input {
  width: 16px;
  min-height: 16px;
  margin-top: 1px;
  accent-color: var(--blue);
}

.form-hint {
  margin: -2px 0 0;
  color: var(--muted-soft);
  font-size: 11px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.modal-footer .danger-button {
  margin-right: auto;
  color: var(--red);
  background: var(--surface-red);
}

.modal-button {
  min-height: 40px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
}

.modal-button.is-primary {
  color: #fff;
  background: var(--blue);
}

.modal-button.is-primary:hover {
  background: var(--blue-hover);
}

.modal-button.is-secondary {
  color: var(--muted);
  background: var(--surface-soft);
}

.modal-button.is-secondary:hover {
  color: var(--ink);
  background: var(--line);
}

.connection-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  background: var(--surface-blue);
  border-radius: 13px;
}

.connection-note i {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--blue);
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100% - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  color: var(--ink);
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-float);
  animation: toast-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast i {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 17px;
}

.loading-state {
  display: grid;
  gap: 12px;
}

.skeleton {
  height: 90px;
  background: linear-gradient(90deg, var(--surface-soft), color-mix(in srgb, var(--surface-soft) 65%, var(--surface)), var(--surface-soft));
  background-size: 240% 100%;
  border-radius: 20px;
  animation: shimmer 1.7s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -40% 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 1260px) {
  .inspector { --inspector-width: 280px; }
}

@media (max-width: 940px) {
  .topbar {
    gap: 18px;
  }

  .workspace {
    display: block;
    width: 100%;
    padding-top: 14px;
  }

  .board-column { display: block; }

  .chain-controls { display: grid; }

  .chain-state-list { width: 100%; }

  .board-toolbar { margin-top: 10px; }

  .epic-sidebar {
    display: none;
  }

  .inspector {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 22px;
    overflow: visible;
  }

  .mobile-epic-picker {
    display: block;
  }

  .mobile-epic-picker select {
    min-height: 34px;
    max-width: 152px;
    padding: 0 9px;
    color: var(--ink);
    font-size: 12px;
    background: var(--surface-soft);
    border: 0;
    border-radius: 10px;
  }

  .mind-map-layout {
    grid-template-columns: 185px minmax(0, 1fr);
    gap: 22px;
  }
}

@container task-view (max-width: 780px) {
  .mind-map-layout {
    display: block;
    padding: 26px 20px 24px;
  }

  .root-column {
    display: block;
    padding: 0 0 22px;
  }

  .root-column::after,
  .epic-node::after {
    display: none;
  }

  .epic-node {
    width: min(100%, 360px);
  }

  .branches-column {
    gap: 24px;
  }

  .branch-row {
    display: block;
  }

  .branch-row::before,
  .branch-row::after,
  .branch-info::after {
    display: none;
  }

  .branch-info {
    padding: 0 0 10px 4px;
  }

  .task-rail {
    margin-inline: -20px;
    scroll-padding-inline: 20px;
  }

  .rail-node:first-child {
    padding-left: 20px;
  }

  .rail-node:last-child {
    padding-right: 20px;
  }
}

@media (max-width: 700px) {
  .topbar {
    min-height: 68px;
    padding: 11px 14px;
  }

  .brand {
    font-size: 20px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-width: 4px;
  }

  .topbar-context {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
  }

  .sync-status {
    padding: 0 5px;
  }

  .sync-status #sync-label {
    display: none;
  }

  .desktop-only {
    display: none;
  }

  .primary-button {
    width: 42px;
    padding: 0;
  }

  .primary-button span {
    display: none;
  }

  .workspace {
    padding: 24px 14px 46px;
  }

  .board-heading {
    display: grid;
    align-items: start;
    gap: 18px;
  }

  .board-heading-actions {
    justify-content: space-between;
  }

  .view-tab {
    padding: 0 9px;
  }

  .board-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding-top: 3px;
  }

  .search-box {
    flex-basis: auto;
    width: 100%;
  }

  .map-shell,
  .kanban-shell {
    border-radius: 22px;
  }

  .graph-map-actions {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .graph-stage,
  .mind-map-graph {
    min-height: 560px;
  }

  .graph-selection-bar {
    right: 10px;
    bottom: 10px;
    left: 10px;
    align-items: stretch;
    flex-wrap: wrap;
    max-width: calc(100% - 20px);
    padding: 10px;
  }

  .graph-selection-bar > div {
    flex: 1 0 100%;
    max-width: none;
  }

  .graph-selection-bar button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .mind-map-layout {
    display: block;
    padding: 22px 14px 20px;
  }

  .root-column {
    display: block;
    padding: 0 0 18px;
  }

  .root-column::after,
  .epic-node::after {
    display: none;
  }

  .epic-node {
    width: 100%;
  }

  .branches-column {
    gap: 24px;
  }

  .branch-row {
    display: block;
  }

  .branch-row::before,
  .branch-row::after,
  .branch-info::after {
    display: none;
  }

  .branch-info {
    padding: 0 0 10px 4px;
  }

  .task-rail {
    margin-inline: -14px;
    scroll-padding-inline: 14px;
  }

  .rail-node:first-child {
    padding-left: 14px;
  }

  .rail-node:last-child {
    padding-right: 14px;
  }

  .task-card {
    flex-basis: min(78vw, 310px);
  }

  .task-card.is-current {
    flex-basis: min(84vw, 340px);
  }

  .task-connector {
    flex-basis: 26px;
  }

  .kanban-shell {
    padding: 17px;
  }

  .kanban-topline {
    display: grid;
    gap: 8px;
    padding-bottom: 16px;
  }

  .kanban-board {
    grid-auto-columns: minmax(270px, 84vw);
    margin-inline: -2px;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100dvh - 20px);
    padding: 19px;
    border-radius: 22px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    flex-wrap: wrap;
  }

  .modal-footer .danger-button {
    width: 100%;
    margin-right: 0;
  }
}
