:root {
  --ink: #172033;
  --muted: #637083;
  --faint: #9aa7b8;
  --page: #eef3f7;
  --surface: rgba(255, 255, 255, .78);
  --surface-strong: rgba(255, 255, 255, .92);
  --line: rgba(82, 99, 124, .17);
  --line-strong: rgba(82, 99, 124, .28);
  --accent: #0f8a8a;
  --accent-dark: #0d6f75;
  --accent-soft: rgba(15, 138, 138, .12);
  --success: #138260;
  --warning: #a46514;
  --danger: #b63a4b;
  --hold: #7b8798;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow: 0 18px 44px rgba(31, 45, 68, .1);
  --shadow-panel: 0 24px 70px rgba(31, 45, 68, .17);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 16% 0%, rgba(54, 120, 150, .16), transparent 28rem),
    radial-gradient(circle at 86% 8%, rgba(15, 138, 138, .13), transparent 27rem),
    linear-gradient(145deg, #e8eef5 0%, #f8fafc 46%, #edf4f3 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(23, 32, 51, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 51, .028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.42), transparent 78%);
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }

.ambient-grid,
.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient-grid {
  opacity: .42;
  background:
    linear-gradient(110deg, transparent 0 46%, rgba(255,255,255,.4) 47%, transparent 48% 100%),
    linear-gradient(72deg, transparent 0 62%, rgba(15,138,138,.075) 63%, transparent 64% 100%);
}

.noise-layer {
  opacity: .18;
  background-image:
    radial-gradient(circle at 25% 15%, rgba(255,255,255,.9) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 50%, rgba(23,32,51,.11) 0 1px, transparent 1px);
  background-size: 19px 19px, 29px 29px;
  mix-blend-mode: soft-light;
}

.shell {
  position: relative;
  width: min(1480px, calc(100vw - 18px));
  margin: 0 auto;
  padding: 10px 0 18px;
}

.glass {
  background: linear-gradient(145deg, rgba(255,255,255,.82), rgba(246,250,253,.62));
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.72);
  backdrop-filter: blur(20px) saturate(1.12);
}

.topbar {
  min-height: 78px;
  border-radius: var(--radius-xl);
  padding: 15px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  overflow: hidden;
}

.system-label {
  display: block;
  margin-bottom: 4px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

h1 {
  margin: 0;
  color: #172033;
  font-size: clamp(24px, 2.55vw, 36px);
  font-weight: 850;
  line-height: 1.05;
  text-wrap: balance;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-logo {
  width: auto;
  height: clamp(22px, 2.4vw, 32px);
  object-fit: contain;
  transform: translateY(1px);
  flex: 0 0 auto;
}

.brand-title span {
  min-width: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.status-pill,
.refresh-button {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(82, 99, 124, .16);
  background: rgba(255,255,255,.66);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.status-pill {
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.status-pill.ok {
  color: var(--success);
  background: rgba(232, 248, 240, .8);
}

.status-pill.error {
  color: var(--danger);
  background: rgba(255, 235, 239, .82);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 14%, transparent);
}

.status-pill.loading .status-dot {
  animation: breathe 1.2s ease-in-out infinite;
}

.refresh-button {
  padding: 0 16px;
  color: #20304a;
  font-size: 13px;
  font-weight: 800;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.refresh-button:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.94);
}

.refresh-button:active {
  transform: scale(.985);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 9px 0;
}

.metric {
  min-height: 58px;
  border-radius: var(--radius-lg);
  padding: 11px 13px;
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 10px 24px rgba(31,45,68,.055);
}

.metric::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 26px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  opacity: .42;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.metric strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric small {
  position: absolute;
  top: 11px;
  right: 12px;
  color: rgba(99, 112, 131, .5);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
}

.toolbar {
  border-radius: var(--radius-xl);
  padding: 9px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 180px 180px;
  gap: 9px;
  margin-bottom: 9px;
}

.search-box {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(82,99,124,.15);
}

.search-box span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
}

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

select {
  min-height: 38px;
  border: 1px solid rgba(82,99,124,.15);
  border-radius: var(--radius-md);
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255,255,255,.72);
  font-size: 14px;
  font-weight: 700;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(15, 138, 138, .38);
  outline-offset: 2px;
}

.board {
  border-radius: var(--radius-xl);
  height: calc(100vh - 244px);
  min-height: 480px;
  overflow: auto;
  scrollbar-color: rgba(82,99,124,.45) transparent;
}

.timeline-head,
.gantt-row {
  display: grid;
  grid-template-columns: 320px max-content;
}

.timeline-head {
  position: sticky;
  top: 0;
  z-index: 160;
  isolation: isolate;
  background: linear-gradient(180deg, #f8fcff, #edf5fa);
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 12px 22px rgba(31,45,68,.08);
  backdrop-filter: blur(18px) saturate(1.1);
}

.product-head {
  position: sticky;
  left: 0;
  z-index: 180;
  min-height: 56px;
  padding: 0 16px;
  display: grid;
  align-content: center;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fcff, #eef5fa);
  box-shadow: 16px 0 28px rgba(31,45,68,.08);
}

.product-head span {
  color: #314057;
  font-size: 13px;
  font-weight: 850;
}

.product-head small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
}

.period-head {
  position: relative;
  z-index: 150;
  min-height: 56px;
  display: grid;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fcff, #edf5fa);
  box-shadow: inset 0 -1px 0 rgba(82,99,124,.24);
}

.month-block {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: 28px 28px;
  border-left: 1px solid rgba(82,99,124,.24);
  background: linear-gradient(180deg, #f8fcff, #edf5fa);
  box-shadow:
    inset -1px 0 0 rgba(82,99,124,.16),
    inset 0 -1px 0 rgba(82,99,124,.22);
}

.month-block:nth-child(even) {
  background: linear-gradient(180deg, #f3fafb, #eaf4f6);
}

.month-block.has-current {
  background: linear-gradient(180deg, #eaf8f7, #e3f2f3);
}

.month-title {
  display: grid;
  place-items: center;
  color: #27364d;
  font-size: 13px;
  font-weight: 850;
  background: rgba(255,255,255,.32);
  border-bottom: 1px solid rgba(82,99,124,.2);
}

.month-parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.month-parts span {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  box-shadow:
    inset 1px 0 0 rgba(82,99,124,.13),
    inset 0 -1px 0 rgba(82,99,124,.2);
}

.month-parts span:first-child {
  box-shadow: inset 0 -1px 0 rgba(82,99,124,.2);
}

.month-parts span.is-current {
  color: #0a646b;
  background: rgba(15,138,138,.13);
  box-shadow: inset 0 -2px 0 rgba(15,138,138,.42);
}

.rows {
  min-height: 420px;
  overflow: visible;
}

.gantt-row {
  min-height: 64px;
  border-bottom: 1px solid rgba(82,99,124,.13);
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: background .18s ease, transform .18s ease;
}

.gantt-row:hover { background: rgba(255,255,255,.52); }
.gantt-row:active { transform: scale(.998); }

.product-cell {
  min-width: 0;
  position: sticky;
  left: 0;
  z-index: 12;
  padding: 9px 14px 12px;
  overflow: hidden;
  border-right: 1px solid rgba(82,99,124,.14);
  background: linear-gradient(90deg, var(--accent-soft), rgba(255,255,255,.98) 18%), #fff;
  box-shadow: 16px 0 26px rgba(31,45,68,.065);
}

.gantt-row.heavy .product-cell { background: linear-gradient(90deg, rgba(168,89,20,.15), rgba(255,255,255,.98) 17%), #fff; }
.gantt-row.high .product-cell { background: linear-gradient(90deg, rgba(182,58,75,.09), rgba(255,255,255,.98) 16%), #fff; }
.gantt-row.hot .product-cell { background: linear-gradient(90deg, rgba(164,101,20,.1), rgba(255,255,255,.98) 16%), #fff; }
.gantt-row.done .product-cell { background: linear-gradient(90deg, rgba(19,130,96,.1), rgba(255,255,255,.98) 16%), #fff; }
.gantt-row.paused .product-cell { background: linear-gradient(90deg, rgba(123,135,152,.09), rgba(255,255,255,.98) 16%), #fff; }

.product-title {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.product-title strong {
  min-width: 0;
  color: #172033;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag {
  min-width: 31px;
  min-height: 22px;
  border-radius: 8px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.tag.heavy { color: #8a3f09; background: rgba(255, 224, 178, .9); }
.tag.hot { color: #8f4d0a; background: rgba(250, 231, 203, .82); }
.tag.high { color: var(--danger); background: rgba(255, 235, 239, .82); }
.tag.mid { color: var(--accent-dark); background: var(--accent-soft); }
.tag.low { color: #316e83; background: rgba(49, 110, 131, .1); }
.tag.paused { color: var(--hold); background: rgba(226, 232, 240, .85); }
.tag.done { color: var(--success); background: rgba(231, 247, 239, .88); }

.wait-badge {
  min-height: 21px;
  border-radius: 999px;
  padding: 2px 7px 2px 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--warning);
  background: rgba(255, 243, 219, .78);
  border: 1px solid rgba(164, 101, 20, .16);
  font-size: 11px;
  font-weight: 850;
}

.wait-badge i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: radial-gradient(circle at 42% 34%, #ffe2a0 0 24%, #d99125 58%, #a86212 100%);
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 0 0 3px rgba(217, 145, 37, .12), 0 3px 8px rgba(168, 98, 18, .18);
}

.wait-badge i::after {
  content: "";
  width: 2px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 5px 0 -1px rgba(255,255,255,.96);
}

.product-meta {
  margin-top: 6px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
}

.product-meta span {
  min-width: 0;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(82,99,124,.1);
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-meta b {
  margin-right: 4px;
  color: #344156;
  font-weight: 850;
}

.progress-line {
  position: absolute;
  left: 14px;
  right: 16px;
  bottom: 7px;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(82,99,124,.1);
}

.progress-line span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: var(--accent);
}

.progress-line em { display: none; }

.timeline-cell {
  position: relative;
  min-height: 64px;
  display: grid;
  box-shadow: inset 0 -1px 0 rgba(82,99,124,.13);
}

.timeline-slot {
  border-left: 1px solid rgba(82,99,124,.09);
  border-bottom: 1px solid rgba(82,99,124,.13);
}

.timeline-slot.part-a { background: rgba(255,255,255,.18); }
.timeline-slot.part-b { background: rgba(15,138,138,.018); }
.timeline-slot.part-c {
  background: rgba(23,32,51,.012);
  border-right: 1px solid rgba(82,99,124,.19);
}

.timeline-slot.is-current {
  background:
    linear-gradient(180deg, rgba(15,138,138,.11), rgba(15,138,138,.035)),
    rgba(255,255,255,.2);
  box-shadow:
    inset 1px 0 0 rgba(15,138,138,.18),
    inset -1px 0 0 rgba(15,138,138,.18);
}

.bar {
  position: absolute;
  top: 28px;
  height: 10px;
  z-index: 1;
  border-radius: 999px;
  background:
    linear-gradient(90deg, hsla(var(--row-hue), 70%, 46%, .28), hsla(calc(var(--row-hue) + 18), 76%, 52%, .48)),
    linear-gradient(90deg, rgba(255,255,255,.52), transparent);
  border: 1px solid hsla(var(--row-hue), 62%, 42%, .2);
  box-shadow:
    0 10px 24px hsla(var(--row-hue), 62%, 34%, .14),
    inset 0 1px 0 rgba(255,255,255,.58);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}

.wait-segment {
  position: absolute;
  top: 27px;
  height: 12px;
  z-index: 2;
  border-radius: 999px;
  cursor: help;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .4), transparent 18% 82%, rgba(255, 255, 255, .36)),
    linear-gradient(90deg, rgba(255, 205, 95, .88), rgba(213, 132, 21, .88));
  border: 1px solid rgba(255, 255, 255, .62);
  box-shadow:
    0 8px 18px rgba(196, 119, 19, .18),
    0 0 0 4px rgba(239, 174, 62, .1),
    inset 0 1px 0 rgba(255,255,255,.7);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
}

.wait-segment::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: 20px;
  min-width: 150px;
  max-width: 320px;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  pointer-events: none;
  border-radius: 999px;
  padding: 6px 10px;
  color: #5e3708;
  background: rgba(255, 249, 235, .96);
  border: 1px solid rgba(213, 132, 21, .18);
  box-shadow: 0 14px 34px rgba(76, 48, 12, .16);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .16s ease, transform .16s ease;
}

.wait-segment:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.stage-dot {
  position: absolute;
  top: 21px;
  z-index: 3;
  width: 30px;
  height: 30px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
}

.dot-core {
  position: relative;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.86);
  background: hsl(var(--row-hue), 70%, 42%);
  box-shadow: 0 8px 16px rgba(31,45,68,.18);
}

.stage-dot.mark-done .dot-core {
  background: var(--success);
}

.stage-dot.mark-done .dot-core::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.stage-dot.mark-pending .dot-core {
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,241,214,.92));
  border-color: rgba(244, 171, 72, .82);
  box-shadow:
    0 9px 19px rgba(183, 116, 31, .17),
    0 0 0 5px rgba(244, 171, 72, .1),
    inset 0 1px 0 rgba(255,255,255,.8);
}

.stage-dot.mark-pending .dot-core::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f2b24d, #d97706);
  box-shadow: 0 0 0 3px rgba(242,178,77,.16);
}

.stage-dot.is-key-node {
  z-index: 3;
}

.stage-dot.is-key-node .dot-core {
  width: 21px;
  height: 21px;
  border-width: 2px;
  background: linear-gradient(135deg, #6ee7f9, #1396a5 54%, #0f766e);
  box-shadow:
    0 9px 18px rgba(15, 118, 110, .17),
    0 0 0 5px rgba(20, 184, 166, .1),
    inset 0 1px 0 rgba(255,255,255,.68);
}

.stage-dot.is-key-node.key-ship .dot-core {
  border-radius: 7px;
  background: linear-gradient(135deg, #a7c7ff, #4977e8 58%, #2857c6);
  box-shadow:
    0 9px 18px rgba(55, 92, 190, .17),
    0 0 0 5px rgba(89, 129, 230, .1),
    inset 0 1px 0 rgba(255,255,255,.7);
}

.stage-dot.is-key-node.mark-done .dot-core {
  background: linear-gradient(135deg, #45d7c4, #1096a6 56%, #087a86);
  box-shadow:
    0 9px 18px rgba(20, 125, 128, .17),
    0 0 0 5px rgba(15, 138, 138, .1),
    inset 0 1px 0 rgba(255,255,255,.68);
}

.stage-dot.is-key-node.key-ship.mark-done .dot-core {
  border-radius: 7px;
  background: linear-gradient(135deg, #9bc2ff, #3f74df 58%, #1f5ac9);
  box-shadow:
    0 9px 18px rgba(45, 89, 190, .17),
    0 0 0 5px rgba(80, 126, 224, .1),
    inset 0 1px 0 rgba(255,255,255,.7);
}

.stage-dot.is-wait-node {
  z-index: 4;
}

.stage-dot.is-wait-node .dot-core {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: radial-gradient(circle at 42% 30%, #ffe7a8 0 20%, #f4b338 38%, #d27a10 70%, #9b540b 100%);
  border-color: rgba(255,255,255,.76);
  box-shadow:
    0 8px 18px rgba(155, 84, 11, .23),
    0 0 0 5px rgba(244, 179, 56, .15),
    0 0 19px rgba(244, 179, 56, .34),
    inset 0 1px 0 rgba(255,255,255,.55);
}

.stage-dot.is-wait-node .dot-core::before {
  content: "";
  position: absolute;
  width: 2.6px;
  height: 8.5px;
  border-radius: 999px;
  background: rgba(255,255,255,.95);
  filter: drop-shadow(0 1px 2px rgba(99, 54, 9, .2));
}

.stage-dot.is-wait-node .dot-core::after {
  content: "";
  position: absolute;
  width: 3.5px;
  height: 3.5px;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  transform: translateY(5px);
  box-shadow: 0 0 7px rgba(255,255,255,.48);
}

.stage-dot.is-key-node.mark-paused .dot-core {
  background: linear-gradient(135deg, #8a93a3, #5d6a7c);
}

.stage-dot.mark-paused .dot-core {
  border-radius: 6px;
  background: var(--hold);
  grid-template-columns: repeat(2, auto);
  gap: 3px;
}

.stage-dot.mark-paused .dot-core::before,
.stage-dot.mark-paused .dot-core::after {
  content: "";
  width: 3px;
  height: 9px;
  border-radius: 2px;
  background: #fff;
}

.stage-dot.is-inferred .dot-core {
  opacity: .78;
  outline: 1px dashed rgba(82,99,124,.28);
  outline-offset: 3px;
}

.stage-dot.is-wait-node.is-inferred .dot-core {
  opacity: 1;
  outline-color: rgba(216, 142, 34, .3);
}

.stage-dot small {
  position: absolute;
  top: 27px;
  width: 86px;
  display: none;
  z-index: 3;
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-dot:hover small { display: block; }

.stage-dot.is-key-node:hover small,
.stage-dot.is-key-node .key-label {
  width: auto;
  min-width: 64px;
}

.empty-state {
  min-height: 380px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
}

.detail-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(560px, calc(100vw - 32px));
  border-radius: var(--radius-xl);
  padding: 20px;
  overflow: auto;
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(243,248,252,.8));
  border: 1px solid rgba(255,255,255,.82);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255,255,255,.72);
  backdrop-filter: blur(24px) saturate(1.16);
  transform: translateX(calc(100% + 32px));
  transition: transform .24s ease;
  z-index: 10;
}

.detail-panel.open { transform: translateX(0); }

.close-button {
  position: sticky;
  top: 0;
  margin-left: auto;
  min-height: 34px;
  border: 1px solid rgba(82,99,124,.15);
  border-radius: 999px;
  padding: 0 14px;
  display: block;
  color: var(--ink);
  background: rgba(255,255,255,.74);
  font-weight: 800;
}

.detail-title {
  margin: 12px 0 8px;
  font-size: 28px;
  line-height: 1.14;
  font-weight: 850;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.detail-meta span,
.detail-card,
.stage-item,
.notes {
  border: 1px solid rgba(82,99,124,.13);
  background: rgba(255,255,255,.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.62);
}

.detail-meta span {
  border-radius: 999px;
  padding: 5px 9px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 16px 0;
}

.detail-card {
  border-radius: var(--radius-md);
  padding: 12px;
}

.detail-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}

.stage-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.stage-group-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(82,99,124,.13);
  background: rgba(255,255,255,.52);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.stage-group-card header {
  min-height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(82,99,124,.1);
}

.stage-group-card header strong {
  color: #243148;
  font-size: 13px;
  font-weight: 850;
}

.stage-group-card header span {
  min-width: 42px;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  background: rgba(255,255,255,.7);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.stage-group-card.dev { background: linear-gradient(90deg, rgba(62,113,192,.08), rgba(255,255,255,.52)); }
.stage-group-card.sample { background: linear-gradient(90deg, rgba(15,138,138,.09), rgba(255,255,255,.52)); }
.stage-group-card.bulk { background: linear-gradient(90deg, rgba(217,154,53,.1), rgba(255,255,255,.52)); }
.stage-group-card.sale { background: linear-gradient(90deg, rgba(72,139,86,.09), rgba(255,255,255,.52)); }

.stage-group-items {
  display: grid;
  gap: 7px;
  padding: 8px;
}

.stage-item {
  border-radius: var(--radius-md);
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.stage-item.key-stage {
  border-color: rgba(217, 154, 53, .22);
  background: linear-gradient(90deg, rgba(217,154,53,.09), rgba(255,255,255,.62));
}

.stage-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-item span {
  color: var(--muted);
  font-size: 12px;
}

.state {
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.state.done { color: var(--success); background: rgba(231,247,239,.9); }
.state.planned { color: var(--accent-dark); background: var(--accent-soft); }
.state.pending { color: var(--warning); background: rgba(255,243,219,.88); }
.state.paused { color: var(--hold); background: rgba(226,232,240,.86); }
.state.skipped { color: var(--muted); background: rgba(241,245,249,.88); }
.state.empty { color: var(--muted); background: rgba(248,250,252,.9); }

.notes {
  margin: 16px 0 0;
  border-radius: var(--radius-md);
  padding: 12px;
  line-height: 1.65;
  color: #314057;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.image-grid img,
.image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(82,99,124,.13);
}

.image-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 10px;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 51, .18);
  z-index: 9;
}

@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes breathe {
  0%, 100% { opacity: .55; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 12px, 1480px);
    padding-top: 6px;
  }

  .topbar {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 16px;
  }

  h1 {
    font-size: 24px;
    line-height: 1.08;
  }

  .summary-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .search-box { grid-column: auto; }

  .metric { min-height: 56px; }

  .timeline-head,
  .gantt-row {
    grid-template-columns: 260px max-content;
  }

  .rows {
    min-height: 420px;
  }

  .detail-grid,
  .stage-item {
    grid-template-columns: 1fr;
  }
}
