:root {
  color-scheme: light;
  --ink: #172a2d;
  --muted: #687a7b;
  --line: #dfe6e2;
  --paper: #f4f5f0;
  --surface: #ffffff;
  --sidebar: #173b3e;
  --sidebar-deep: #102d30;
  --teal: #2f7d78;
  --teal-bright: #4da59e;
  --teal-soft: #e3f0ed;
  --coral: #e76f51;
  --coral-soft: #fbe8e1;
  --gold: #d9a441;
  --gold-soft: #fbf1d8;
  --indigo: #6269bd;
  --indigo-soft: #e9eafa;
  --danger: #b94b4b;
  --shadow: 0 18px 50px rgba(27, 58, 58, 0.08);
  --shadow-small: 0 8px 24px rgba(27, 58, 58, 0.07);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --sidebar-width: 244px;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* Unified controller */
.control-toolbar {
  margin-bottom: 22px;
}

.control-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.controller-kpi {
  min-height: 128px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, #fff, #f4f7f5);
  box-shadow: var(--shadow-small);
}

.controller-kpi strong,
.controller-kpi span,
.controller-kpi small {
  display: block;
}

.controller-kpi strong {
  margin-bottom: 9px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 3vw, 2.55rem);
  line-height: 1;
}

.controller-kpi span {
  color: var(--ink);
  font-weight: 750;
}

.controller-kpi small {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.controller-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.hierarchy-panel,
.decision-panel,
.critical-panel,
.sprint-panel {
  margin-bottom: 18px;
}

.hierarchy-tree,
.hierarchy-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.portfolio-tree + .portfolio-tree {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.portfolio-head,
.hierarchy-node-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.portfolio-head {
  justify-content: space-between;
  margin-bottom: 8px;
}

.portfolio-head h3 {
  margin: 5px 0 0;
}

.portfolio-next,
.node-copy p,
.hierarchy-task p,
.sprint-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.hierarchy-project,
.hierarchy-node,
.hierarchy-task {
  position: relative;
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid #e3e9e5;
  border-radius: 13px;
  background: #fbfcfb;
}

.hierarchy-project > ul,
.hierarchy-node > ul {
  margin: 9px 0 0 20px;
  padding-left: 13px;
  border-left: 1px solid #d7e0dc;
}

.hierarchy-task {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: #fff;
}

.hierarchy-task.is-blocked {
  border-color: #efb7a9;
  background: #fff8f5;
}

.tree-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.hierarchy-task small,
.node-copy small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.blocker-text {
  color: #b24d36 !important;
}

.node-kind {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf2ef;
  color: #547068;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.node-copy {
  min-width: 0;
  flex: 1;
}

.hierarchy-progress {
  display: flex;
  min-width: 116px;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.hierarchy-progress i {
  display: block;
  width: 66px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebe7;
}

.hierarchy-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #77a89d);
}

.hierarchy-progress strong {
  min-width: 36px;
  font-size: 0.78rem;
  text-align: right;
}

.gate-chip,
.gate-status {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.gate-pending,
.gate-row-pending .gate-status {
  background: #fff0cc;
  color: #885f12;
}

.gate-go,
.gate-row-go .gate-status {
  background: #dcefe5;
  color: #246349;
}

.gate-no_go,
.gate-row-no_go .gate-status {
  background: #ffe0d8;
  color: #a23f2b;
}

.gate-list {
  display: grid;
  gap: 9px;
}

.gate-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.gate-row time {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 0.7rem;
}

.gate-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.gate-indicator {
  width: 8px;
  height: 30px;
  border-radius: 999px;
  background: #d7a23b;
}

.gate-row-go .gate-indicator { background: #5c9e77; }
.gate-row-no_go .gate-indicator { background: #de6a50; }

.critical-path {
  display: flex;
  gap: 9px;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 5px;
}

.critical-step {
  display: flex;
  flex: 1 0 160px;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcfb;
}

.critical-step > span {
  display: grid;
  flex: 0 0 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.critical-step small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.critical-arrow {
  align-self: center;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.sprint-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 13px;
}

.sprint-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfb;
}

.sprint-card-head,
.sprint-stat-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.sprint-card-head span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sprint-card-head h3 {
  margin: 3px 0 0;
}

.sprint-card-head > strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.sprint-stat-row {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}

.sprint-stat-row b {
  color: var(--ink);
}

.burndown-chart {
  width: 100%;
  height: 90px;
  margin-top: 13px;
  overflow: visible;
}

.burndown-chart polyline {
  fill: none;
  stroke: var(--teal);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.history-note {
  color: var(--muted);
  font-size: 0.75rem;
}

@media (max-width: 1100px) {
  .control-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controller-layout { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .control-hero-grid { grid-template-columns: 1fr; }
  .hierarchy-node-row { align-items: flex-start; flex-wrap: wrap; }
  .hierarchy-progress { width: 100%; justify-content: flex-start; }
  .critical-path { flex-direction: column; }
  .critical-step { flex-basis: auto; }
  .critical-arrow { transform: rotate(90deg); }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% 0, rgba(231, 111, 81, 0.05), transparent 32rem),
    var(--paper);
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(47, 125, 120, 0.28);
  outline-offset: 2px;
}

svg {
  fill: currentColor;
}

code,
pre {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

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

.is-hidden {
  display: none !important;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 18px 18px;
  color: #dce9e6;
  background:
    radial-gradient(circle at 15% 7%, rgba(77, 165, 158, 0.2), transparent 13rem),
    linear-gradient(180deg, var(--sidebar), var(--sidebar-deep));
  box-shadow: 8px 0 30px rgba(19, 52, 54, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 30px;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.brand-mark span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: #6ec8c0;
}

.brand-mark span:first-child {
  top: 8px;
  left: 8px;
}

.brand-mark span:nth-child(2) {
  top: 8px;
  right: 8px;
  background: #f19b80;
}

.brand-mark span:last-child {
  right: 8px;
  bottom: 8px;
  width: 18px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.01em;
}

.brand > div:last-child span {
  margin-top: 2px;
  color: #90aba9;
  font-size: 12px;
}

.main-nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 45px;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  color: #abc0be;
  text-align: left;
  border: 0;
  border-radius: 12px;
  background: transparent;
  transition: 160ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 3px 0 #71c8c0;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item span {
  font-size: 14px;
  font-weight: 600;
}

.nav-item em {
  min-width: 25px;
  padding: 2px 7px;
  color: #cae1de;
  font-size: 11px;
  font-style: normal;
  text-align: center;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d9a441;
  box-shadow: 0 0 0 4px rgba(217, 164, 65, 0.12);
}

.status-dot.is-online {
  background: #6ed0a5;
  box-shadow: 0 0 0 4px rgba(110, 208, 165, 0.12);
}

.sidebar-spacer {
  flex: 1;
}

.agent-mini-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.agent-mini-head {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
}

.pulse {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: #67c9a0;
  box-shadow: 0 0 0 5px rgba(103, 201, 160, 0.12);
}

.agent-mini-card p {
  margin: 10px 0 12px;
  color: #9bb4b1;
  font-size: 12px;
  line-height: 1.5;
}

.text-button {
  padding: 0;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  background: none;
}

.text-button:hover {
  color: var(--coral);
}

.agent-mini-card .text-button {
  color: #8ed5cf;
  font-weight: 600;
}

.sidebar-footer {
  display: flex;
  justify-content: space-between;
  padding: 17px 5px 0;
  color: #779794;
  font-size: 11px;
}

.sidebar-footer strong {
  color: #9eb9b6;
}

.main-content {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 0 38px 64px;
  overflow-wrap: anywhere;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  background: rgba(244, 245, 240, 0.92);
  backdrop-filter: blur(16px);
}

.title-block h1,
.title-block p,
.view-toolbar h2,
.view-toolbar p,
.section-heading h2,
.section-heading p,
.panel-heading h2,
.panel-heading p,
.hero-copy h2,
.hero-copy p,
.agents-hero h2,
.agents-hero p {
  margin: 0;
}

.eyebrow,
.section-kicker {
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.title-block h1 {
  margin-top: 4px;
  font-size: clamp(22px, 2vw, 29px);
  font-weight: 720;
  letter-spacing: -0.035em;
}

.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.search-box {
  display: flex;
  min-width: 0;
  width: min(250px, 20vw);
  height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  transition: 150ms ease;
}

.search-box:focus-within {
  width: min(310px, 24vw);
  border-color: rgba(47, 125, 120, 0.5);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 125, 120, 0.08);
}

.search-box svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #78908e;
}

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

.search-box input::placeholder {
  color: #8ca09e;
}

.search-box kbd {
  padding: 2px 5px;
  color: #889795;
  font-size: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f8f5;
}

.project-filter-wrap select {
  height: 42px;
  max-width: 175px;
  padding: 0 30px 0 12px;
  color: #47605f;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 12px;
  transition: 150ms ease;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: var(--teal);
  box-shadow: 0 8px 20px rgba(47, 125, 120, 0.2);
}

.button-primary:hover {
  background: #256c68;
}

.button-ghost {
  color: #49615f;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.button-ghost:hover {
  border-color: #c3d2ce;
  background: #fff;
}

.button-light {
  min-height: 40px;
  color: #173b3e;
  background: #fff;
}

.button-link {
  min-height: 40px;
  padding-inline: 6px;
  color: #bfe4df;
  background: transparent;
}

.button-danger {
  color: var(--danger);
  border-color: #edcccc;
  background: #fff5f5;
}

.loading-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  z-index: 30;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal-bright), var(--coral));
  opacity: 0;
  transition: opacity 160ms ease;
}

.loading-bar.is-loading {
  width: calc(100% - var(--sidebar-width));
  opacity: 1;
  animation: loading 1s ease-in-out infinite;
  transform-origin: left;
}

@keyframes loading {
  0% { transform: scaleX(0.05); }
  55% { transform: scaleX(0.72); }
  100% { transform: scaleX(1); }
}

.view {
  display: none;
  animation: view-in 220ms ease;
}

.view.is-active {
  display: block;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.overview-hero {
  position: relative;
  display: grid;
  min-height: 230px;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 28px;
  overflow: hidden;
  padding: 36px 45px;
  color: #fff;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 92% 20%, rgba(97, 206, 195, 0.28), transparent 15rem),
    linear-gradient(120deg, #173d40 0%, #225c5d 70%, #2d7771 100%);
  box-shadow: 0 22px 55px rgba(29, 82, 81, 0.18);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.hero-copy .section-kicker {
  color: #83d4cd;
}

.hero-copy h2 {
  margin-top: 7px;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 680;
  letter-spacing: -0.045em;
}

.hero-copy > p:not(.section-kicker) {
  max-width: 570px;
  margin-top: 12px;
  color: #bed5d2;
  font-size: 14px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}

.progress-orbit {
  position: relative;
  z-index: 2;
  display: grid;
  width: 144px;
  height: 144px;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  background: conic-gradient(#76d1c9 var(--progress), rgba(255, 255, 255, 0.13) 0);
  box-shadow: 0 0 0 14px rgba(255, 255, 255, 0.025);
}

.progress-orbit::before {
  position: absolute;
  inset: 8px;
  content: "";
  border-radius: inherit;
  background: #24595a;
}

.progress-orbit > div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.progress-orbit strong,
.progress-orbit span {
  display: block;
}

.progress-orbit strong {
  font-size: 31px;
  letter-spacing: -0.05em;
}

.progress-orbit span {
  margin-top: 1px;
  color: #a9cac6;
  font-size: 11px;
}

.hero-grid {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 290px;
  height: 290px;
  opacity: 0.16;
  background-image: linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px);
  background-size: 28px 28px;
  transform: rotate(8deg);
  mask-image: radial-gradient(circle, #000, transparent 70%);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stat-card {
  display: grid;
  min-height: 108px;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 18px;
  border: 1px solid rgba(216, 226, 222, 0.8);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-small);
}

.stat-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--teal);
  border-radius: 13px;
  background: var(--teal-soft);
}

.stat-icon svg {
  width: 21px;
  height: 21px;
}

.stat-card > div:nth-child(2) span,
.stat-card > div:nth-child(2) strong {
  display: block;
}

.stat-card > div:nth-child(2) span {
  color: var(--muted);
  font-size: 12px;
}

.stat-card > div:nth-child(2) strong {
  margin-top: 2px;
  font-size: 27px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-card em {
  grid-column: 2;
  margin-top: -13px;
  color: #92a09e;
  font-size: 10px;
  font-style: normal;
}

.stat-card-progress .stat-icon {
  color: var(--indigo);
  background: var(--indigo-soft);
}

.stat-card-review .stat-icon {
  color: #a57625;
  background: var(--gold-soft);
}

.stat-card-overdue .stat-icon {
  color: var(--coral);
  background: var(--coral-soft);
}

.section-heading,
.panel-heading,
.view-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading {
  margin: 34px 0 14px;
}

.section-heading h2,
.panel-heading h2,
.view-toolbar h2 {
  margin-top: 4px;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  position: relative;
  min-height: 205px;
  overflow: hidden;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-small);
  transition: 160ms ease;
}

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

.project-card::after {
  position: absolute;
  top: -52px;
  right: -58px;
  width: 128px;
  height: 128px;
  content: "";
  border-radius: 50%;
  background: color-mix(in srgb, var(--project-color) 8%, transparent);
}

.project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-symbol {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  border-radius: 12px;
  background: var(--project-color);
  box-shadow: 0 7px 16px color-mix(in srgb, var(--project-color) 24%, transparent);
}

.icon-button,
.project-menu-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #7b8c8a;
  font-size: 23px;
  border: 0;
  border-radius: 9px;
  background: transparent;
}

.project-menu-button:hover,
.icon-button:hover {
  color: var(--ink);
  background: #f0f4f1;
}

.project-card h3 {
  margin: 16px 0 4px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.project-card .project-meta {
  color: var(--muted);
  font-size: 11px;
}

.project-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 19px;
  color: #637775;
  font-size: 11px;
}

.project-progress-row strong {
  color: var(--ink);
  font-size: 12px;
}

.progress-track {
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #eaf0ec;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--project-color);
}

.project-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  padding-top: 14px;
  color: #738582;
  font-size: 11px;
  border-top: 1px solid #edf1ee;
}

.mini-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mini-state::before {
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: var(--project-color);
}

.overview-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px;
  margin-top: 28px;
}

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.panel-badge {
  min-width: 28px;
  padding: 4px 9px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  border-radius: 99px;
  background: var(--teal-soft);
}

.panel-badge-warm {
  color: #a36434;
  background: var(--coral-soft);
}

.compact-task-list,
.control-list {
  display: grid;
  gap: 3px;
  margin-top: 15px;
}

.compact-task,
.control-item {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px solid #edf1ee;
  cursor: pointer;
}

.compact-task {
  grid-template-columns: 10px minmax(0, 1fr) auto;
}

.compact-task > div,
.control-item > div {
  min-width: 0;
}

.compact-task:last-child,
.control-item:last-child {
  border-bottom: 0;
}

.compact-task:hover,
.control-item:hover {
  border-radius: 11px;
  background: #f7f9f6;
}

.project-pin {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--project-color);
}

.compact-task strong,
.compact-task span,
.control-item strong,
.control-item span {
  display: block;
}

.compact-task strong,
.control-item strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-task span,
.control-item span {
  margin-top: 3px;
  color: #7b8e8b;
  font-size: 10px;
}

.task-date {
  padding: 4px 8px;
  color: #6b7e7c;
  font-size: 10px;
  border-radius: 8px;
  background: #f0f4f1;
}

.task-date.is-overdue {
  color: var(--danger);
  background: #fff0f0;
}

.control-item {
  grid-template-columns: 32px minmax(0, 1fr);
}

.control-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #a1712d;
  border-radius: 10px;
  background: var(--gold-soft);
}

.control-icon.risk {
  color: var(--coral);
  background: var(--coral-soft);
}

.empty-state {
  display: grid;
  min-height: 130px;
  place-items: center;
  padding: 22px;
  color: #849592;
  font-size: 13px;
  text-align: center;
  border: 1px dashed #d4ded9;
  border-radius: 14px;
  background: #fafbf9;
}

.view-toolbar {
  align-items: end;
  padding: 12px 0 20px;
}

.view-toolbar > p {
  max-width: 420px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.kanban-board {
  display: grid;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 13px;
  min-height: calc(100vh - 175px);
  overflow-x: auto;
  padding-bottom: 18px;
  scrollbar-color: #b9c7c3 transparent;
  overscroll-behavior-x: contain;
}

.board-status-control.field {
  display: none;
}

.kanban-column {
  min-width: 260px;
  padding: 10px;
  border: 1px solid #e1e7e3;
  border-radius: 17px;
  background: rgba(235, 239, 235, 0.72);
  transition: 150ms ease;
}

.kanban-column.is-drag-over {
  border-color: var(--teal-bright);
  background: rgba(227, 240, 237, 0.95);
  box-shadow: inset 0 0 0 2px rgba(77, 165, 158, 0.12);
}

.kanban-column-head {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 2px 5px 10px;
}

.kanban-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--column-color);
}

.kanban-title strong {
  font-size: 12px;
  letter-spacing: 0.01em;
}

.column-count {
  min-width: 24px;
  padding: 3px 7px;
  color: #6f817e;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.8);
}

.kanban-cards {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 120px;
}

.task-card {
  position: relative;
  min-width: 0;
  padding: 14px;
  border: 1px solid #e2e8e4;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(29, 65, 64, 0.045);
  cursor: grab;
  transition: 150ms ease;
}

.task-card:hover {
  border-color: #cbd8d3;
  box-shadow: 0 9px 22px rgba(29, 65, 64, 0.08);
  transform: translateY(-1px);
}

.task-card:focus-visible {
  outline: 3px solid rgba(47, 125, 120, 0.28);
  outline-offset: 2px;
}

.task-card.is-dragging {
  opacity: 0.45;
  transform: rotate(1deg);
}

.task-card.is-moving {
  opacity: 0.62;
  cursor: wait;
}

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

.task-kind,
.priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 7px;
  text-transform: uppercase;
}

.task-kind {
  color: #617572;
  background: #f0f4f1;
}

.task-kind.risk {
  color: var(--coral);
  background: var(--coral-soft);
}

.task-kind.milestone {
  color: #9a6a22;
  background: var(--gold-soft);
}

.priority-pill {
  padding-inline: 5px;
  color: #788986;
  background: transparent;
}

.priority-pill.high {
  color: #ad6228;
}

.priority-pill.critical {
  color: var(--danger);
}

.task-card h3 {
  margin: 11px 0 5px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -0.01em;
}

.task-card-project {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #758784;
  font-size: 10px;
}

.task-card-project::before {
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: var(--project-color);
}

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

.task-tags span {
  padding: 3px 6px;
  color: #768784;
  font-size: 9px;
  border-radius: 6px;
  background: #f3f6f3;
}

.task-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  color: #7b8c89;
  font-size: 9px;
  border-top: 1px solid #eef2ef;
}

.task-move-button {
  padding: 4px 7px;
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
  border: 1px solid #d5e1dd;
  border-radius: 8px;
  background: #f7faf8;
}

.task-move-button:hover {
  border-color: #a9c7c0;
  background: var(--teal-soft);
}

.task-move-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.assignee-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--project-color);
}

.kanban-empty {
  display: grid;
  min-height: 100px;
  padding: 16px;
  place-items: center;
  color: #95a4a1;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  border: 1px dashed #d5dfda;
  border-radius: 11px;
}

.timeline-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 15px;
}

.timeline-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.timeline-summary-card strong,
.timeline-summary-card span {
  display: block;
}

.timeline-summary-card strong {
  font-size: 19px;
}

.timeline-summary-card span {
  color: var(--muted);
  font-size: 11px;
}

.timeline-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-small);
}

.timeline-head,
.timeline-row {
  display: grid;
  grid-template-columns: minmax(250px, 30%) minmax(0, 1fr);
}

.timeline-task-name {
  min-width: 0;
}

.timeline-head {
  color: #6f817e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: #f8faf7;
}

.timeline-head > div,
.timeline-row > div {
  padding: 14px 17px;
}

.timeline-row {
  align-items: center;
  border-bottom: 1px solid #edf1ee;
  cursor: pointer;
}

.timeline-row:last-child {
  border-bottom: 0;
}

.timeline-row:hover {
  background: #fafbf9;
}

.timeline-task-name strong,
.timeline-task-name span {
  display: block;
}

.timeline-task-name strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-task-name span {
  margin-top: 4px;
  color: #82918f;
  font-size: 9px;
}

.timeline-track-wrap {
  position: relative;
  height: 40px;
  overflow: hidden;
  border-left: 1px solid #edf1ee;
  background-image: linear-gradient(90deg, #eef2ef 1px, transparent 1px);
  background-size: 14.285% 100%;
}

.timeline-bar {
  position: absolute;
  top: 10px;
  min-width: 10px;
  height: 20px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--project-color);
  box-shadow: 0 3px 8px color-mix(in srgb, var(--project-color) 25%, transparent);
}

.timeline-bar::after {
  display: block;
  width: var(--bar-progress);
  height: 100%;
  content: "";
  background: rgba(255, 255, 255, 0.23);
}

.timeline-scale {
  display: flex;
  justify-content: space-between;
}

.activity-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-small);
}

.activity-list {
  padding: 8px 24px;
}

.activity-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 16px 2px;
  border-bottom: 1px solid #edf1ee;
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-symbol {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  border-radius: 11px;
  background: var(--teal-soft);
}

.activity-symbol.agent {
  color: var(--indigo);
  background: var(--indigo-soft);
}

.activity-content strong,
.activity-content span {
  display: block;
}

.activity-content strong {
  font-size: 12px;
}

.activity-content span {
  margin-top: 4px;
  color: #7c8d8a;
  font-size: 10px;
}

.activity-time {
  color: #8b9997;
  font-size: 10px;
  white-space: nowrap;
}

.agents-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px;
  padding: 34px 38px;
  color: #fff;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 85% 10%, rgba(231, 111, 81, 0.2), transparent 17rem),
    linear-gradient(120deg, #253a4b, #264f56);
  box-shadow: var(--shadow);
}

.agents-hero .section-kicker {
  color: #8cd3cc;
}

.agents-hero h2 {
  margin-top: 6px;
  font-size: clamp(25px, 3vw, 36px);
  letter-spacing: -0.04em;
}

.agents-hero > div:first-child > p:last-child {
  max-width: 680px;
  margin-top: 13px;
  color: #bdd1d2;
  font-size: 13px;
  line-height: 1.65;
}

.agents-hero code {
  color: #fff;
}

.api-status-card {
  display: grid;
  min-width: 210px;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.075);
}

.api-status-card small,
.api-status-card strong {
  display: block;
}

.api-status-card small {
  color: #9dbabd;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.api-status-card strong {
  margin-top: 3px;
  font-size: 14px;
}

.api-status-card code {
  grid-column: 1 / -1;
  padding-top: 12px;
  color: #93c7c5;
  font-size: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.agent-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.command-panel-wide {
  grid-column: 1 / -1;
}

.command-panel pre {
  min-height: 86px;
  margin: 16px 0 10px;
  overflow-x: auto;
  padding: 15px;
  color: #d7e6e3;
  font-size: 10px;
  line-height: 1.65;
  border-radius: 12px;
  background: #193436;
  scrollbar-color: #547776 transparent;
}

.command-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.copy-button {
  padding: 6px 9px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  border: 1px solid #d5e1dd;
  border-radius: 8px;
  background: #f7faf8;
}

.agent-activity-panel {
  margin-top: 16px;
}

.agent-events {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.agent-event {
  padding: 13px;
  border: 1px solid #e4eae6;
  border-radius: 12px;
  background: #fafbf9;
}

.agent-event strong,
.agent-event span,
.agent-event time {
  display: block;
}

.agent-event strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-event span {
  margin-top: 5px;
  color: #687c79;
  font-size: 10px;
}

.agent-event time {
  margin-top: 9px;
  color: #93a19f;
  font-size: 9px;
}

.modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  padding: 0;
  color: var(--ink);
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(11, 38, 40, 0.28);
}

.modal::backdrop {
  background: rgba(16, 44, 46, 0.5);
  backdrop-filter: blur(4px);
}

.modal-small {
  width: min(600px, calc(100vw - 32px));
}

.task-move-modal {
  width: min(430px, calc(100vw - 32px));
}

.task-move-description {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.task-move-options {
  display: grid;
  gap: 8px;
}

.task-move-option {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
}

.modal form,
.modal-content {
  padding: 25px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.modal-head > div {
  min-width: 0;
}

.modal-head .icon-button {
  flex: 0 0 auto;
}

.modal-head h2 {
  margin: 4px 0 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 6px;
}

.field-wide {
  grid-column: 1 / -1;
}

.task-editor-grid {
  gap: 20px;
}

.form-section {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.form-section > legend {
  padding: 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.form-section > .form-grid {
  margin-top: 2px;
}

.field > span {
  color: #5f7471;
  font-size: 11px;
  font-weight: 700;
}

.field-hint {
  margin: -2px 0 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(47, 125, 120, 0.07);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.dispatch-pill {
  margin-right: auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(47, 125, 120, 0.1);
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid #dbe3df;
  border-radius: 10px;
  outline: 0;
  background: #fbfcfa;
  transition: 140ms ease;
}

.field input,
.field select,
.field textarea {
  min-width: 0;
  max-width: 100%;
}

.field textarea {
  resize: vertical;
  line-height: 1.5;
}

.field select[multiple] {
  min-height: 132px;
  padding: 6px;
}

.field select[multiple] option {
  padding: 7px 8px;
  border-radius: 6px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(47, 125, 120, 0.6);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 125, 120, 0.08);
}

.field input[type="color"] {
  padding: 5px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #edf1ee;
}

.action-spacer {
  flex: 1;
}

.conflict-message {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.conflict-actions {
  align-items: stretch;
}

.conflict-actions .button {
  flex: 1;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: grid;
  gap: 8px;
}

.auth-pending .app-shell,
.auth-required .app-shell {
  visibility: hidden;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(89, 151, 139, 0.24), transparent 34%),
    linear-gradient(145deg, #102f32, #173f42 55%, #0d292c);
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: min(100%, 460px);
  min-width: 0;
  margin-block: auto;
  overflow-wrap: anywhere;
  padding: clamp(28px, 6vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: rgba(250, 248, 242, 0.98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.auth-brand {
  margin-bottom: 40px;
  color: #173b3e;
}

.auth-brand strong {
  color: var(--ink);
}

.auth-card h1 {
  margin: 8px 0 12px;
  color: #173b3e;
  font-size: clamp(1.8rem, 5vw, 2.45rem);
  line-height: 1.08;
}

.auth-description {
  margin: 0 0 26px;
  color: #64716f;
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form .button {
  width: 100%;
  min-height: 48px;
  justify-content: center;
}

.auth-error {
  min-height: 1.4em;
  margin: 0;
  color: #b34f45;
  font-size: 0.9rem;
}

.toast {
  min-width: 260px;
  max-width: 390px;
  padding: 13px 16px;
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  border-radius: 11px;
  background: #183d3f;
  box-shadow: 0 12px 32px rgba(18, 53, 54, 0.2);
  animation: toast-in 180ms ease;
}

.toast.error {
  background: #8f3d3d;
}

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

@media (max-width: 1280px) {
  :root { --sidebar-width: 214px; }
  .main-content { padding-inline: 27px; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .search-box { width: 210px; }
  .project-filter-wrap select { max-width: 145px; }
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-events { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 76px; }
  .sidebar { padding: 20px 11px 14px; }
  .sidebar .brand { justify-content: center; padding-inline: 0; }
  .sidebar .brand > div:last-child,
  .nav-item span,
  .nav-item em,
  .agent-mini-card,
  .sidebar-footer { display: none; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; }
  .nav-item.is-active { box-shadow: inset 0 -3px #71c8c0; }
  .nav-item .status-dot { position: absolute; top: 9px; right: 11px; }
  .overview-bottom-grid,
  .agent-guide-grid { grid-template-columns: 1fr; }
  .overview-hero { padding: 30px; }
  .projects-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .topbar-actions { max-width: 54%; }
  .search-box { width: 100%; }
  .search-box:focus-within { width: 100%; }
  .agents-hero { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  :root { --sidebar-width: 0px; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .sidebar {
    inset: auto 0 0;
    z-index: 50;
    width: 100%;
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 6px max(5px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left));
    background: rgba(16, 45, 48, 0.97);
    backdrop-filter: blur(15px);
  }
  .sidebar .brand,
  .sidebar-spacer { display: none; }
  .main-nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; height: 100%; }
  .nav-item { min-width: 0; min-height: 52px; gap: 3px; align-content: center; border-radius: 10px; text-align: center; }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-item span { display: block; font-size: 10px; line-height: 1.2; }
  .nav-item .status-dot { top: 5px; right: 6px; width: 5px; height: 5px; }
  .nav-item.is-active { box-shadow: inset 0 -2px #71c8c0; }
  .main-content { margin-left: 0; padding: 0 max(12px, env(safe-area-inset-right)) 24px max(12px, env(safe-area-inset-left)); }
  .topbar { position: static; min-height: 0; flex-wrap: wrap; gap: 12px; padding: 16px 0; }
  .title-block { width: 100%; }
  .topbar-actions { display: grid; width: 100%; max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 8px; }
  .search-box { grid-column: 1 / -1; height: 44px; }
  .search-box kbd { display: none; }
  .topbar-actions .button { min-width: 0; padding: 6px 8px; font-size: 12px; }
  .button svg { flex: 0 0 17px; }
  .project-filter-wrap { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .project-filter-wrap select { width: 100%; max-width: none; height: 44px; }
  .overview-hero { min-height: 0; grid-template-columns: minmax(0, 1fr); padding: 24px; }
  .progress-orbit { position: absolute; right: 20px; bottom: 20px; width: 90px; height: 90px; }
  .progress-orbit strong { font-size: 21px; }
  .progress-orbit span { font-size: 8px; }
  .hero-copy { padding-bottom: 80px; }
  .hero-actions { align-items: stretch; flex-wrap: wrap; gap: 8px; }
  .hero-actions .button { width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat-card { min-height: 92px; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 10px; }
  .stat-icon { width: 28px; height: 28px; }
  .stat-icon svg { width: 18px; height: 18px; }
  .stat-card > div:nth-child(2) span { font-size: 10px; }
  .stat-card > div:nth-child(2) strong { font-size: 22px; }
  .stat-card em { display: none; }
  .section-heading { margin-top: 27px; }
  .section-heading, .panel-heading { flex-wrap: wrap; gap: 10px; }
  .panel { padding: 16px; }
  .overview-bottom-grid { margin-top: 18px; }
  .view-toolbar { align-items: start; }
  .view-toolbar > p { display: none; }
  #view-board .view-toolbar { display: none; }
  .board-status-control.field { display: grid; margin-bottom: 12px; }
  .kanban-board { grid-template-columns: minmax(0, 1fr); min-height: 0; overflow: visible; }
  .kanban-column { display: none; min-width: 0; }
  .kanban-column.is-mobile-selected { display: block; }
  .kanban-title strong { font-size: 14px; }
  .task-card { padding: 16px; cursor: pointer; }
  .task-card h3 { font-size: 15px; line-height: 1.45; }
  .task-card-project, .task-card-foot { font-size: 12px; }
  .task-kind, .priority-pill, .task-tags span { font-size: 10px; }
  .kanban-empty { font-size: 13px; }
  .task-move-button { min-height: 44px; padding: 8px 12px; font-size: 12px; }
  .hierarchy-project, .hierarchy-node { padding: 10px 8px; }
  .hierarchy-project > ul, .hierarchy-node > ul { margin-left: 0; padding-left: 5px; }
  .hierarchy-node.depth-3 { padding-inline: 0; border-inline: 0; }
  .hierarchy-node.depth-3 > ul { padding-left: 0; border-left: 0; }
  .hierarchy-task { grid-template-columns: 8px minmax(0, 1fr); gap: 8px; padding: 10px 8px; }
  .hierarchy-task .hierarchy-progress { grid-column: 2; min-width: 0; }
  .node-copy { flex-basis: 100%; }
  .portfolio-head, .sprint-card-head, .sprint-stat-row { flex-wrap: wrap; }
  .gate-row { grid-template-columns: 8px minmax(0, 1fr); }
  .gate-status { grid-column: 2; justify-self: start; }
  .timeline-summary { grid-template-columns: 1fr; }
  .timeline-head, .timeline-row { grid-template-columns: minmax(0, 1fr); }
  .timeline-head > div:first-child { display: none; }
  .timeline-head > div, .timeline-row > div { padding: 12px; }
  .timeline-task-name strong { white-space: normal; font-size: 14px; line-height: 1.45; }
  .timeline-task-name span { font-size: 11px; line-height: 1.5; }
  .timeline-row .timeline-track-wrap { height: 36px; margin: 0 12px 12px; padding: 0; border-radius: 6px; }
  .activity-list { padding-inline: 13px; }
  .activity-item { grid-template-columns: 34px minmax(0, 1fr); }
  .activity-time { grid-column: 2; }
  .agents-hero { padding: 27px 24px; }
  .api-status-card { min-width: 0; }
  .agent-events { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .field input, .field select, .field textarea, .search-box input, .project-filter-wrap select { font-size: 16px; }
  .field > span { font-size: 12px; }
  .button, .icon-button, .copy-button, .project-menu-button, .text-button { min-height: 44px; }
  .icon-button, .project-menu-button { min-width: 44px; }
  .modal { width: calc(100% - 16px); max-width: 600px; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; scroll-padding-block: 16px 132px; }
  .task-move-modal { max-width: 430px; }
  .modal form, .modal-content { padding: 16px; }
  .form-section { padding: 12px; }
  .modal-head { gap: 10px; }
  .modal-head h2 { font-size: 20px; }
  .modal-actions { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-inline: -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; }
  .modal-actions .action-spacer { display: none; }
  .modal-actions .button { min-width: 0; padding: 10px; }
  .modal-actions .button-primary { grid-column: 1 / -1; grid-row: 1; }
  .conflict-actions .button { grid-column: 1 / -1; }
  .toast-region { right: 12px; left: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .auth-gate { padding: 16px; place-items: start center; }
  .auth-card { padding: 24px; }
  .auth-brand { margin-bottom: 20px; }
}

@media (hover: none) and (pointer: coarse) {
  .task-move-button { min-height: 44px; padding: 8px 12px; font-size: 12px; }
  .task-move-option { min-height: 48px; }
}

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