:root {
  --ink: #f2f5f3;
  --muted: #858d89;
  --paper: #010302;
  --card: rgba(8, 13, 11, .54);
  --card-strong: rgba(13, 19, 16, .66);
  --line: rgba(226, 255, 242, .13);
  --line-strong: rgba(226, 255, 242, .24);
  --green: #20e786;
  --green-dark: #12bd69;
  --lime: #20e786;
  --red: #ff5c68;
  --amber: #f7a942;
  --soft-shadow: 0 28px 90px rgba(0, 0, 0, .5);
}

* {
  scrollbar-color: #2c3330 #080a09;
}

html,
body {
  min-height: 100%;
  background-color: var(--paper);
}

body {
  background-image: url("../img/theme/dashboard-depth-v3.jpg");
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -.01em;
}

a,
button,
input,
select,
textarea {
  transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: inherit;
  font-weight: 620;
  letter-spacing: -.035em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  color: #707873;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .15em;
}

.app-authenticated .site-header {
  position: fixed;
  z-index: 80;
  top: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  width: 178px;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 17px;
  overflow: hidden;
  padding: 22px 12px 14px;
  border: 1px solid rgba(226, 255, 242, .18);
  border-radius: 19px;
  background: rgba(6, 11, 9, .55);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset -1px 0 0 rgba(32, 231, 134, .05), var(--soft-shadow);
  backdrop-filter: blur(30px) saturate(1.25);
}

.brand {
  display: grid;
  gap: 0;
  padding: 0 10px 4px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.05em;
  text-decoration: none;
}

.brand small {
  margin: 0;
  color: #69706d;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .11em;
}

.sidebar-user {
  order: 3;
  display: grid;
  gap: 2px;
  margin-top: auto;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(21, 29, 25, .46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(18px);
}

.sidebar-user__name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user small {
  color: var(--muted);
  font-size: 9px;
}

.app-authenticated .site-header nav {
  order: 2;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  overflow-y: auto;
  padding-right: 2px;
}

.app-authenticated .site-header nav a,
.app-authenticated .site-header .link-button {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #858c88;
  font-size: 11px;
  font-weight: 620;
  text-align: left;
  text-decoration: none;
}

.app-authenticated .site-header nav img,
.app-authenticated .site-header .link-button img {
  width: 15px;
  height: 15px;
  opacity: .72;
  filter: invert(1);
}

.app-authenticated .site-header nav a:hover,
.app-authenticated .site-header .link-button:hover {
  border-color: var(--line);
  background: rgba(31, 43, 37, .55);
  color: var(--ink);
}

.app-authenticated .site-header nav a.is-active {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(39, 54, 47, .55);
  color: #fff;
  box-shadow: inset 18px 0 32px rgba(32, 231, 134, .08);
}

.app-authenticated .site-header nav a.is-active img {
  opacity: 1;
}

.app-authenticated .site-header nav form {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.app-authenticated .page-shell {
  width: auto;
  /* The sidebar already reserves the left edge; let desktop content use the
     remaining viewport instead of leaving a fixed-width strip on wide screens. */
  max-width: none;
  margin: 0 22px 80px 218px;
  padding-top: 18px;
  perspective: 1600px;
}

.app-guest .site-header {
  min-height: 72px;
  padding: 18px max(24px, calc((100vw - 1120px) / 2));
  background: transparent;
  color: var(--ink);
}

.app-guest .page-shell {
  margin-top: 10px;
}

.dashboard-topbar {
  display: grid;
  grid-template-columns: minmax(210px, .75fr) minmax(320px, 1.1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 4px 2px 14px;
}

.dashboard-title h1 {
  margin: 3px 0 0;
  font-size: 28px;
  line-height: 1.05;
}

.dashboard-search {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 4px 5px 4px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(7, 12, 10, .46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 50px rgba(0, 0, 0, .2);
  backdrop-filter: blur(22px) saturate(1.2);
}

.dashboard-search img {
  width: 15px;
  opacity: .62;
  filter: invert(1);
}

.dashboard-search input {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
}

.dashboard-search input:focus {
  outline: 0;
  background: transparent;
}

.dashboard-search button {
  min-height: 28px;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(36, 46, 41, .58);
  color: #aab0ad;
  font-size: 10px;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.create-task-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(16, 23, 20, .52);
  color: var(--ink);
  font-size: 11px;
  font-weight: 720;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 45px rgba(0, 0, 0, .18);
  backdrop-filter: blur(20px);
}

.icon-button {
  width: 38px;
}

.icon-button img,
.create-task-button img {
  width: 15px;
  filter: invert(1);
}

.create-task-button {
  padding: 8px 13px;
}

.icon-button:hover,
.create-task-button:hover {
  border-color: var(--line-strong);
  background: rgba(32, 44, 38, .66);
  transform: translateY(-1px);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 10px;
}

.metric-card {
  position: relative;
  display: grid;
  min-height: 108px;
  align-content: space-between;
  gap: 3px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(226, 255, 242, .16);
  border-radius: 15px;
  background: rgba(9, 15, 12, .44);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .11), inset 0 -1px 0 rgba(32, 231, 134, .025), 0 24px 55px rgba(0, 0, 0, .28);
  backdrop-filter: blur(24px) saturate(1.22);
  text-decoration: none;
}

.metric-card:hover {
  border-color: rgba(32, 231, 134, .28);
  background: rgba(21, 33, 27, .6);
  transform: translateY(-4px) translateZ(18px);
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-size: 10px;
}

.metric-card strong {
  font-size: 31px;
  font-weight: 520;
  line-height: 1;
  letter-spacing: -.06em;
}

.metric-card b {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #636a66;
  font-size: 8px;
}

.metric-complete strong,
.metric-complete small {
  color: var(--green);
}

.metric-alert strong,
.metric-alert small {
  color: var(--red);
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: 205px minmax(320px, 1fr) 238px;
  grid-template-rows: minmax(380px, auto) auto;
  gap: 10px;
  min-width: 0;
  perspective: 1500px;
}

.task-board,
.task-visual,
.task-detail-card,
.task-timeline {
  min-width: 0;
  border: 1px solid rgba(226, 255, 242, .15);
  border-radius: 16px;
  background: rgba(6, 11, 9, .48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 0 36px rgba(255, 255, 255, .012), var(--soft-shadow);
  backdrop-filter: blur(26px) saturate(1.2);
}

.task-board {
  padding: 15px;
}

.workspace-heading,
.timeline-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.workspace-heading h2,
.timeline-top h2 {
  margin: 2px 0 0;
  font-size: 15px;
}

.workspace-heading > a,
.timeline-top > a {
  color: #858c88;
  font-size: 9px;
  text-decoration: none;
}

.workspace-heading > img {
  width: 14px;
  opacity: .5;
  filter: invert(1);
}

.board-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 13px 0 8px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(2, 5, 4, .45);
  backdrop-filter: blur(16px);
}

.board-tabs a {
  padding: 6px 5px;
  border-radius: 6px;
  color: #707773;
  font-size: 9px;
  text-align: center;
  text-decoration: none;
}

.board-tabs a.is-active {
  background: rgba(38, 51, 45, .58);
  color: #dfe4e1;
}

.board-list {
  display: grid;
  gap: 5px;
}

.board-task {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(17, 25, 21, .38);
  color: var(--ink);
  text-decoration: none;
}

.board-task:hover,
.board-task.is-selected {
  border-color: rgba(32, 231, 134, .22);
  background: rgba(25, 43, 34, .58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 14px 34px rgba(0, 0, 0, .2);
}

.task-status-dot {
  width: 5px;
  height: 5px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(32, 231, 134, .75);
}

.board-task.is-overdue .task-status-dot {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 92, 104, .62);
}

.board-task strong,
.board-task small,
.board-empty strong,
.board-empty small {
  display: block;
}

.board-task strong {
  overflow: hidden;
  font-size: 10px;
  font-weight: 660;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-task small,
.board-empty small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.board-empty {
  padding: 20px 9px;
  color: #bbc1be;
}

.task-visual {
  position: relative;
  display: grid;
  min-height: 380px;
  align-items: center;
  overflow: hidden;
  background: rgba(1, 4, 3, .18);
  backdrop-filter: blur(14px) saturate(1.35);
}

.task-visual::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .6);
  content: "";
  pointer-events: none;
}

.flow-controls {
  position: absolute;
  z-index: 60;
  top: 13px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flow-controls button {
  display: grid;
  width: 27px;
  min-height: 27px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 30, 25, .48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 28px rgba(0, 0, 0, .26);
  backdrop-filter: blur(16px);
}

.flow-controls button:hover {
  border-color: rgba(32, 231, 134, .34);
  background: rgba(33, 52, 42, .66);
}

.flow-controls img {
  width: 13px;
  opacity: .72;
  filter: invert(1);
}

.flow-controls > span {
  min-width: 38px;
  color: #6e7571;
  font-size: 8px;
  text-align: center;
}

.flow-controls strong {
  color: var(--green);
  font-size: 10px;
}

.flow-carousel {
  position: absolute;
  z-index: 10;
  inset: 52px 0 8px;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.flow-carousel:active {
  cursor: grabbing;
}

.flow-stage {
  position: absolute;
  inset: 0 0 24px;
  overflow: visible;
  perspective: 920px;
  pointer-events: none;
  transform-style: preserve-3d;
}

.flow-card {
  --flow-hue: 0deg;
  --flow-glow: rgba(32, 231, 134, .34);
  position: absolute;
  top: 50%;
  left: 50%;
  width: 142px;
  height: 242px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: var(--flow-opacity, 0);
  pointer-events: auto;
  transform: var(--flow-transform, translate3d(-50%, -50%, 0));
  transform-style: preserve-3d;
  cursor: pointer;
  transition: transform .76s cubic-bezier(.16, .82, .22, 1), opacity .5s ease, filter .5s ease;
  will-change: transform, opacity;
}

.flow-card.risk-warning {
  --flow-hue: 285deg;
  --flow-glow: rgba(255, 205, 70, .42);
}

.flow-card.risk-overdue {
  --flow-hue: 210deg;
  --flow-glow: rgba(255, 73, 87, .46);
}

.flow-card.risk-closed {
  --flow-glow: rgba(201, 211, 207, .28);
}

.flow-card.is-hover-target:not(.is-active) {
  filter: brightness(1.18) saturate(1.12);
}

.flow-stage.is-dragging .flow-card {
  transition: none;
}

.flow-card__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: opacity .34s ease;
}

.flow-card__gray {
  opacity: 0;
  filter: brightness(.74) contrast(1.18) saturate(.56) drop-shadow(0 20px 28px rgba(0, 0, 0, .34));
}

.flow-card__green {
  opacity: .62;
  filter: hue-rotate(var(--flow-hue)) brightness(.78) saturate(1.06) drop-shadow(0 0 12px var(--flow-glow)) drop-shadow(0 20px 28px rgba(0, 0, 0, .34));
}

.flow-card__front {
  opacity: 0;
  filter: hue-rotate(var(--flow-hue)) brightness(.92) saturate(1.08) drop-shadow(0 0 18px var(--flow-glow)) drop-shadow(0 24px 32px rgba(0, 0, 0, .4));
}

.flow-card.risk-closed .flow-card__gray {
  opacity: .62;
}

.flow-card.risk-closed .flow-card__green,
.flow-card.is-active.risk-closed .flow-card__green {
  opacity: 0;
}

.flow-card.is-active .flow-card__gray,
.flow-card.is-active .flow-card__green {
  opacity: 0;
}

.flow-card.is-active .flow-card__front {
  opacity: .96;
  animation: flow-active-float 2.8s ease-in-out infinite;
  filter: hue-rotate(var(--flow-hue)) brightness(.96) saturate(1.12) drop-shadow(0 0 23px var(--flow-glow)) drop-shadow(0 24px 32px rgba(0, 0, 0, .4));
}

.flow-card.is-active.risk-closed .flow-card__front {
  filter: grayscale(1) brightness(.82) contrast(1.08) drop-shadow(0 0 18px rgba(201, 211, 207, .25)) drop-shadow(0 24px 32px rgba(0, 0, 0, .4));
}

.flow-card__content {
  position: absolute;
  z-index: 2;
  top: 24%;
  right: 18%;
  bottom: 18%;
  left: 19%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: rgba(236, 242, 239, .42);
  text-align: left;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .72);
  opacity: .28;
  pointer-events: none;
  transition: color .34s ease, opacity .34s ease, transform .34s ease;
}

.flow-card__status,
.flow-card__due {
  font-size: 7px;
  letter-spacing: .04em;
}

.flow-card__status b {
  color: #f5fff9;
  font-weight: 720;
}

.flow-card__content strong {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 9px;
  font-size: 10px;
  font-weight: 680;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.flow-card__content small {
  margin-top: 5px;
  font-size: 7px;
}

.flow-card__due {
  margin-top: auto;
  white-space: nowrap;
}

.flow-card.is-active .flow-card__content {
  color: rgba(238, 255, 247, .9);
  opacity: 1;
  animation: flow-active-float 2.8s ease-in-out infinite;
}

.flow-card:focus-visible {
  outline: 0;
}

.flow-card:focus-visible .flow-card__image {
  filter: drop-shadow(0 0 12px var(--flow-glow));
}

.flow-pagination {
  position: absolute;
  z-index: 20;
  right: 14px;
  bottom: 13px;
  display: flex;
  gap: 5px;
}

.flow-pagination button {
  --dot-color: #35ca83;
  width: 5px;
  min-height: 5px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--dot-color);
}

.flow-pagination button.risk-warning {
  --dot-color: #dcae28;
}

.flow-pagination button.risk-overdue {
  --dot-color: #e54855;
}

.flow-pagination button.risk-closed {
  --dot-color: #6e7773;
}

.flow-pagination button.is-active {
  width: 15px;
  border-radius: 5px;
  box-shadow: 0 0 9px var(--dot-color);
}

.flow-risk {
  font-weight: 680;
}

.flow-risk--normal {
  color: #45e69a;
}

.flow-risk--warning {
  color: #f1c84b;
}

.flow-risk--overdue {
  color: #ff6571;
}

.flow-risk--closed {
  color: #9aa39f;
}

.flow-hint {
  position: absolute;
  z-index: 20;
  right: 14px;
  bottom: 22px;
  margin: 0 0 7px;
  color: #555c58;
  font-size: 7px;
}

@keyframes flow-active-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.visual-copy {
  position: absolute;
  z-index: 60;
  top: 16px;
  left: 17px;
}

.visual-copy h2 {
  margin: 3px 0 1px;
  font-size: 15px;
}

.visual-copy span {
  color: #616864;
  font-size: 8px;
}

.visual-progress-card {
  position: absolute;
  z-index: 60;
  bottom: 17px;
  left: 17px;
  display: grid;
  gap: 3px;
  width: 140px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  background: rgba(16, 26, 21, .48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 20px 44px rgba(0, 0, 0, .42);
  backdrop-filter: blur(26px) saturate(1.25);
  pointer-events: none;
}

.flow-empty {
  display: grid;
  gap: 7px;
  place-self: center;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.flow-empty strong {
  color: var(--ink);
  font-size: 15px;
}

.flow-empty a {
  color: var(--green);
  text-decoration: none;
}

.visual-progress-card span,
.visual-progress-card small {
  color: #8b928e;
  font-size: 8px;
}

.visual-progress-card strong {
  color: var(--green);
  font-size: 18px;
  font-weight: 560;
}

.task-detail-card {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 16px;
}

.task-code {
  margin: 18px 0 7px;
  color: #737a76;
  font-size: 8px;
  letter-spacing: .1em;
}

.task-detail-card h3 {
  margin: 0;
  font-size: 15px;
}

.task-description {
  margin: 8px 0 14px;
  color: #858d89;
  font-size: 9px;
  line-height: 1.7;
}

.task-detail-card {
  transition: opacity .18s ease, transform .18s ease, border-color .18s ease;
}

.task-detail-card.is-updating {
  border-color: rgba(32, 231, 134, .26);
  opacity: .78;
  transform: translateZ(10px);
}

.task-facts {
  display: grid;
  gap: 0;
  margin: 0;
}

.task-facts > div {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.task-facts dt {
  color: #666d69;
  font-size: 9px;
}

.task-facts dd {
  margin: 0;
  color: #c9cecb;
  font-size: 9px;
  font-weight: 650;
  text-align: right;
}

.status-live,
.status-urgent {
  color: var(--green);
}

.status-urgent {
  color: var(--red);
}

.acceptance-note {
  margin: 13px 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(20, 30, 25, .38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(18px);
}

.acceptance-note p:last-child {
  margin: 5px 0 0;
  color: #939a96;
  font-size: 8px;
  line-height: 1.65;
}

.detail-primary {
  display: block;
  margin-top: auto;
  padding: 10px 12px;
  border: 1px solid rgba(32, 231, 134, .32);
  border-radius: 10px;
  background: rgba(32, 231, 134, .1);
  color: var(--green);
  font-size: 10px;
  font-weight: 720;
  text-align: center;
  text-decoration: none;
}

.detail-primary:hover {
  background: rgba(32, 231, 134, .18);
}

.detail-empty p {
  color: var(--muted);
  font-size: 10px;
}

.task-timeline {
  grid-column: 1 / span 2;
  padding: 14px 16px 16px;
}

.timeline-axis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin: 10px 0 4px 73px;
  color: #535a56;
  font-size: 7px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin-top: 5px;
}

.timeline-row > small {
  color: #727975;
  font-size: 8px;
}

.timeline-bar {
  display: block;
  min-height: 17px;
  padding: 3px 10px;
  border-radius: 5px;
  color: #dfe4e1;
  font-size: 7px;
  text-decoration: none;
}

.timeline-green {
  width: 62%;
  margin-left: 26%;
  background: rgba(8, 122, 69, .72);
  box-shadow: 0 0 18px rgba(32, 231, 134, .16);
}

.timeline-gray {
  width: 48%;
  margin-left: 44%;
  background: rgba(67, 78, 72, .58);
}

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

.feature-card {
  min-height: 116px;
  padding: 16px;
  border: 1px solid rgba(226, 255, 242, .14);
  border-radius: 14px;
  background: rgba(7, 12, 10, .42);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 24px 55px rgba(0, 0, 0, .24);
  backdrop-filter: blur(24px) saturate(1.18);
  text-decoration: none;
}

.feature-card:hover {
  border-color: rgba(32, 231, 134, .24);
  background: rgba(21, 34, 28, .58);
  transform: translateY(-4px) translateZ(16px);
}

.feature-card span {
  color: #707773;
  font-size: 9px;
}

.feature-card h2 {
  margin: 16px 0 5px;
  font-size: 16px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.panel,
.auth-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), var(--soft-shadow);
  backdrop-filter: blur(28px) saturate(1.2);
}

.team-panel {
  margin-top: 10px;
}

.team-panel table {
  margin-top: 14px;
}

.page-heading {
  padding: 17px 2px 5px;
}

.page-heading h1,
.hero h1,
.auth-card h1 {
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 620;
}

.hero {
  border-bottom-color: var(--line);
}

.hero p:last-child {
  color: var(--muted);
}

input,
select,
textarea {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(3, 7, 5, .6);
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 112px;
}

input::placeholder,
textarea::placeholder {
  color: #5f6662;
}

input:hover,
select:hover,
textarea:hover,
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(32, 231, 134, .42);
  background: rgba(11, 20, 16, .72);
}

button,
.button-link {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
}

.primary {
  background: var(--green);
  color: #041008;
}

.primary:hover {
  background: #4af09b;
  transform: translateY(-1px);
}

.quiet,
.secondary-button {
  border: 1px solid var(--line);
  background: #141716;
  color: var(--ink);
}

.secondary,
.actions a,
.text-link,
.section-heading > a {
  color: var(--green);
}

.counter,
.pill {
  padding: 5px 9px;
  border: 1px solid rgba(32, 231, 134, .16);
  border-radius: 999px;
  background: rgba(32, 231, 134, .09);
  color: var(--green);
  font-size: 10px;
}

.pill.disabled,
.status-draft,
.attention-pending,
.attention-returned {
  background: rgba(255, 92, 104, .1);
  color: var(--red);
}

.task-row,
.table-wrap,
.note-box,
.result-preview,
.decision-box,
.handling-box,
.supplement-preview,
.business-data,
.scope-note,
.candidate-controls,
.report-item,
.weekly-item,
.report-summary-grid > div,
.weekly-summary-grid > div {
  border-color: var(--line);
  background: #0d100f;
  color: var(--ink);
}

.task-row:hover,
.compact-list > a:hover,
.search-results > a:hover,
.recurring-template-row:hover {
  background: #131715;
}

.task-meta,
.task-row small,
.compact-list span,
.report-row small,
.weekly-report-row small,
.report-item small,
.weekly-item small {
  color: var(--muted);
}

table {
  color: var(--ink);
}

th {
  background: #121514;
  color: #8b928e;
}

th,
td,
.details div,
.compact-list > a,
.search-results > a {
  border-bottom-color: var(--line);
}

.table-wrap {
  border-radius: 14px;
}

.message {
  border: 1px solid rgba(32, 231, 134, .18);
  border-radius: 11px;
  background: rgba(32, 231, 134, .08);
  color: #c8f5da;
}

.auth-card {
  margin-top: 3vh;
}

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 1180px) {
  .dashboard-workspace {
    grid-template-columns: 190px minmax(300px, 1fr) 220px;
  }

  .app-authenticated .page-shell {
    margin-right: 16px;
  }
}

@media (max-width: 1020px) {
  .dashboard-topbar {
    grid-template-columns: 1fr auto;
  }

  .dashboard-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .dashboard-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .task-detail-card {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .task-timeline {
    grid-column: 1 / -1;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-authenticated .site-header {
    position: sticky;
    top: 0;
    right: auto;
    bottom: auto;
    left: auto;
    display: flex;
    width: 100%;
    min-height: 66px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: rgba(7, 9, 8, .94);
    backdrop-filter: blur(22px);
  }

  .brand {
    padding: 0;
  }

  .sidebar-user {
    order: initial;
    margin: 0;
    padding: 7px 10px;
    text-align: right;
  }

  .app-authenticated .site-header nav {
    display: none;
  }

  .app-authenticated .page-shell {
    width: min(100% - 26px, 1120px);
    margin: 0 auto 34px;
    padding-top: 14px;
    perspective: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 100;
    right: 9px;
    bottom: max(9px, env(safe-area-inset-bottom));
    left: 9px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    overflow: hidden;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: rgba(13, 16, 15, .96);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .38);
    backdrop-filter: blur(22px);
  }

  .mobile-bottom-nav a {
    display: grid;
    min-height: 46px;
    place-items: center;
    gap: 1px;
    padding: 6px 2px;
    border-radius: 10px;
    color: #7c837f;
    font-size: 9px;
    font-weight: 650;
    text-align: center;
    text-decoration: none;
  }

  .mobile-bottom-nav img {
    width: 16px;
    opacity: .72;
    filter: invert(1);
  }

  .mobile-bottom-nav span {
    display: grid;
    place-items: center;
  }

  .mobile-bottom-nav a.is-active {
    background: #1a1f1c;
    color: var(--green);
  }

  body.app-authenticated {
    padding-bottom: 78px;
  }

  /* Lift the interactive workspace above the fixed compact navigation. */
  .dashboard-workspace {
    position: relative;
    z-index: 110;
  }

  .task-visual {
    z-index: 110;
  }
}

@media (max-width: 700px) {
  body {
    background-attachment: scroll;
  }

  .dashboard-topbar {
    gap: 12px;
  }

  .dashboard-title h1 {
    font-size: 25px;
  }

  .dashboard-actions .icon-button {
    display: none;
  }

  .create-task-button {
    padding: 8px 10px;
  }

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

  .metric-card {
    min-height: 100px;
    padding: 14px;
  }

  .dashboard-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .task-board,
  .task-visual,
  .task-detail-card,
  .task-timeline {
    grid-column: 1;
    grid-row: auto;
  }

  .task-board {
    order: 2;
  }

  .task-visual {
    order: 1;
    min-height: 370px;
  }

  .flow-card {
    width: 134px;
    height: 228px;
  }

  .flow-carousel {
    top: 52px;
  }

  .flow-hint {
    display: none;
  }

  .task-detail-card {
    order: 3;
  }

  .task-timeline {
    order: 4;
  }

  .timeline-axis {
    margin-left: 57px;
  }

  .timeline-row {
    grid-template-columns: 47px minmax(0, 1fr);
  }

  .quick-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .feature-card {
    min-height: 108px;
    padding: 14px;
  }

  .panel,
  .auth-card {
    padding: 18px;
  }

  .page-heading h1,
  .hero h1,
  .auth-card h1 {
    font-size: 32px;
  }
}

@media (max-width: 420px) {
  .app-authenticated .page-shell {
    width: min(100% - 18px, 1120px);
  }

  .create-task-button {
    font-size: 10px;
  }

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

  .mobile-bottom-nav a {
    font-size: 8px;
  }
}

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

  .flow-card.is-active .flow-card__front {
    animation: none;
  }
}
