/* ===== WorkLeaf · Demo Flow stylesheet ===== */
/* Inherits tokens from styles.css */

/* ---------- Phase navigator ---------- */
.demo-shell { max-width: 1320px; margin: 0 auto; padding: 0 32px; position: relative; z-index: 1; }
@media (max-width: 720px) { .demo-shell { padding: 0 20px; } }

.demo-hero {
  position: relative;
  padding: 80px 0 60px;
}
.demo-hero .kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px; color: var(--red-bright);
  letter-spacing: 0.14em; text-transform: uppercase;
}
.demo-hero .kicker::before {
  content: ""; width: 22px; height: 1px; background: var(--red);
}
.demo-hero h1 {
  margin-top: 22px;
  font-size: clamp(38px, 4.6vw, 64px);
  letter-spacing: -0.035em;
  line-height: 1.04;
  font-weight: 500;
  max-width: 940px;
  text-wrap: balance;
}
.demo-hero h1 .italic {
  font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--silver);
}
.demo-hero p.lede {
  margin-top: 22px;
  font-size: 17px; color: var(--ink-mid);
  max-width: 660px; text-wrap: pretty;
}
.demo-hero-meta {
  margin-top: 32px;
  display: grid; grid-template-columns: repeat(4, max-content); gap: 28px 40px;
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-low);
}
.demo-hero-meta b {
  display: block;
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 500;
  text-transform: none; letter-spacing: -0.005em;
  color: var(--ink);
  margin-top: 4px;
}
.demo-hero-meta b .r { color: var(--red-bright); }
@media (max-width: 720px) {
  .demo-hero-meta { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}

.phase-nav {
  position: sticky;
  top: 68px;
  z-index: 40;
  background: linear-gradient(180deg, rgba(6, 13, 28, 0.92), rgba(6, 13, 28, 0.75));
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.phase-nav-inner {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: stretch;
  position: relative;
}
.phase-step {
  position: relative;
  padding: 16px 12px 18px;
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer;
  transition: color 0.25s var(--ease-soft);
  border-right: 1px solid var(--line);
  text-align: left;
  background: transparent;
  color: var(--ink-mid);
}
.phase-step:last-child { border-right: 0; }
.phase-step:hover { color: var(--ink); }
.phase-step .n {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-low);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.phase-step .t {
  font-size: 13px; font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.phase-step.active .n { color: var(--red-bright); }
.phase-step.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--red-bright);
  box-shadow: 0 0 14px var(--red-glow);
}
@media (max-width: 920px) {
  .phase-nav-inner {
    grid-template-columns: none;
    display: flex; overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .phase-step { min-width: 180px; scroll-snap-align: start; }
}

  /* Mobile: phase rail + tab bar become dropdowns */
  .phase-select, .tab-select { display: none; }
  @media (max-width: 720px) {
    .phase-nav-inner { display: none !important; }
    .phase-nav .demo-shell { padding-top: 10px; padding-bottom: 10px; }
    .phase-select {
      display: block;
      width: 100%;
      appearance: none;
      background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
      border: 1px solid var(--line-strong);
      border-radius: 10px;
      padding: 12px 38px 12px 14px;
      font: inherit;
      font-size: 14px;
      font-weight: 500;
      color: var(--ink);
      letter-spacing: -0.005em;
      background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%23ef2b34' stroke-width='1.6' fill='none'/></svg>");
      background-repeat: no-repeat;
      background-position: right 14px center;
    }
    .phase-select option { background: #0d1830; color: var(--ink); }

    .tabs-bar { display: none !important; }
    .tab-select {
      display: block;
      width: calc(100% - 28px);
      margin: 14px 14px 0;
      appearance: none;
      background: linear-gradient(180deg, rgba(239,43,52,0.10), rgba(13,24,48,0.4));
      border: 1px solid rgba(239,43,52,0.35);
      border-radius: 10px;
      padding: 12px 38px 12px 14px;
      font: inherit;
      font-size: 14px;
      font-weight: 500;
      color: var(--ink);
      background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%23ef2b34' stroke-width='1.6' fill='none'/></svg>");
      background-repeat: no-repeat;
      background-position: right 14px center;
    }
    .tab-select option { background: #0d1830; color: var(--ink); }
  }
  padding: 96px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 160px;
  margin-top: 80px;
}
@media (max-width: 720px) { .phase-block { padding: 44px 0; margin-top: 40px; } }
.phase-head {
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
  margin-bottom: 36px;
}
.phase-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(239, 43, 52, 0.35);
  background: linear-gradient(180deg, rgba(239,43,52,0.12), rgba(216,35,42,0.02));
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #ffd2d3;
  letter-spacing: 0.12em; text-transform: uppercase;
  white-space: nowrap;
}
.phase-tag .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--red-bright); box-shadow: 0 0 10px var(--red-glow); }
.phase-block h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  letter-spacing: -0.025em;
  line-height: 1.06;
  font-weight: 500;
}
.phase-block h2 .italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--silver); }
.phase-sub {
  width: 100%;
  margin-top: 4px;
  font-size: 15.5px; color: var(--ink-mid);
  max-width: 720px;
  text-wrap: pretty;
}

/* ---------- Zone cards (clean 2x2 grid) ---------- */
.zone-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 920px) { .zone-cards { grid-template-columns: 1fr; } }

.zone-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(0,0,0,0));
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.zone-card .zc-h {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: center;
  gap: 12px;
}
.zone-card .zc-badge {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--red-bright), var(--red-deep));
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 600; font-size: 12px;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px -6px var(--red-glow);
}
.zone-card .zc-t .zc-name {
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink);
}
.zone-card .zc-t .zc-addr {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-low); letter-spacing: 0.04em;
  margin-top: 2px;
}
.zone-card .zc-pri {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-mid);
}
.zone-card .zc-pri.pri-a {
  color: #ffd2d3;
  border-color: rgba(239,43,52,0.4);
  background: rgba(239,43,52,0.10);
}
.zone-card .zc-pri.pri-b {
  color: #b6d1ff;
  border-color: rgba(155,180,230,0.3);
  background: rgba(155,180,230,0.08);
}
.zone-card .zc-edit {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  color: var(--ink-mid);
  display: grid; place-items: center;
  transition: background 0.2s, color 0.2s;
}
.zone-card .zc-edit:hover { background: rgba(239,43,52,0.12); color: var(--red-bright); border-color: rgba(239,43,52,0.3); }
.zone-card .zc-edit svg { width: 14px; height: 14px; }

.zone-card .zc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-low);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.zone-card .zc-stats b {
  display: block;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin-bottom: 2px;
  text-transform: none;
}

.zone-card .zc-bars { display: flex; flex-direction: column; gap: 6px; }
.zone-card .zc-bar {
  display: grid;
  grid-template-columns: 56px 1fr 36px;
  gap: 10px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-mid);
}
.zone-card .zc-bar .lbl { color: var(--ink-low); text-transform: uppercase; letter-spacing: 0.06em; }
.zone-card .zc-bar i {
  display: block;
  height: 6px;
  background: linear-gradient(90deg, var(--red-deep), var(--red-bright));
  border-radius: 999px;
  position: relative;
}
.zone-card .zc-bar i::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
}
.zone-card .zc-bar .v { text-align: right; color: var(--ink); }

/* ---------- Editable banner inside tab frame ---------- */
.edit-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(13,24,48,0.5), rgba(7,14,33,0.4));
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-mid);
}
.edit-banner svg { width: 14px; height: 14px; color: var(--red-bright); flex-shrink: 0; }
.edit-banner b { font-weight: 500; color: var(--ink); }
.edit-banner .edit-shortcut {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-low);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.edit-banner .edit-shortcut kbd {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink);
  margin: 0 2px;
}
@media (max-width: 720px) { .edit-banner { font-size: 11px; padding: 9px 14px; } .edit-banner .edit-shortcut { display: none; } }

/* Add edit icon column for data table rows on hover */
.data-table tbody tr { position: relative; }
.data-table tbody td:last-child { position: relative; }
.ai-act {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(239,43,52,0.14), rgba(239,43,52,0.04));
  color: #ffd2d3;
  border: 1px solid rgba(239,43,52,0.4);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
}
.ai-act:hover { background: linear-gradient(180deg, rgba(239,43,52,0.22), rgba(239,43,52,0.08)); transform: translateY(-1px); }
.ai-act svg { width: 11px; height: 11px; }
.ai-act.ghost {
  background: rgba(255,255,255,0.04);
  color: var(--ink-mid);
  border-color: var(--line-strong);
}
.ai-act.ghost:hover { color: var(--ink); }
.ai-act.upload {
  background: rgba(255,184,107,0.10);
  color: #ffb86b;
  border-color: rgba(255,184,107,0.35);
}
.ai-act.upload:hover { background: rgba(255,184,107,0.18); }

.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Documents tab — grouped doc panels ---------- */
.docs-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}
.docs-actions .docs-total {
  font-size: 14px; color: var(--ink);
  letter-spacing: -0.005em;
}
.docs-actions .docs-total b { font-weight: 500; }
.docs-actions .right { display: inline-flex; gap: 8px; }

.docgroup {
  margin-bottom: 18px;
  border-radius: 10px;
  overflow: hidden;
}
.docgroup .gh {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(239,43,52,0.10), rgba(239,43,52,0.02));
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10.5px;
  color: #ffd2d3;
  letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid rgba(239,43,52,0.25);
  border-radius: 10px 10px 0 0;
}
.docgroup.uploaded .gh { background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0)); color: var(--ink-mid); border-color: var(--line-strong); }
.docgroup.ai .gh { background: linear-gradient(180deg, rgba(33,88,180,0.12), rgba(33,88,180,0.02)); color: #b6d1ff; border-color: rgba(155,180,230,0.25); }
.docgroup .gh .ct {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  padding: 2px 7px;
}
.docgroup .gh .right { margin-left: auto; display: inline-flex; gap: 6px; }
.docrow {
  display: grid;
  grid-template-columns: 36px 1fr auto auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(13, 24, 48, 0.4);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.docrow:last-child { border-radius: 0 0 10px 10px; }
.docrow .ficon {
  width: 30px; height: 36px;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015));
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 9px;
  color: var(--ink-mid);
}
.docrow.ai .ficon { background: linear-gradient(180deg, var(--red-bright), var(--red-deep)); border-color: transparent; color: #fff; }
.docrow .name { color: var(--ink); font-size: 13px; }
.docrow .name .sub { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-low); margin-top: 2px; }
.docrow .size { font-family: var(--font-mono); font-size: 11px; color: var(--ink-mid); }
.docrow .when { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-low); }
.docrow .pill { font-family: var(--font-mono); font-size: 9.5px; padding: 2px 7px; border-radius: 4px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--ink-mid); text-transform: uppercase; letter-spacing: 0.06em; }
.docrow .pill.ok { color: #6fdc8c; border-color: rgba(111,220,140,0.3); background: rgba(111,220,140,0.08); }
.docrow .pill.draft { color: #ffd2d3; border-color: rgba(239,43,52,0.35); background: rgba(239,43,52,0.10); }
@media (max-width: 720px) {
  .docrow { grid-template-columns: 36px 1fr; }
  .docrow .size, .docrow .when, .docrow .pill:not(:first-of-type), .docrow .ai-act { display: none; }
}

/* ---------- Phase navigation between sections ---------- */
.phase-pager {
  display: none;
}
.phase-pager .pp-prev, .phase-pager .pp-next {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(13,24,48,0.5), rgba(7,14,33,0.5));
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s var(--ease-out), border-color 0.2s, background 0.2s;
  min-width: 240px;
  max-width: 360px;
}
.phase-pager a:hover { transform: translateY(-2px); border-color: rgba(239,43,52,0.35); }
.phase-pager .pp-prev { text-align: left; }
.phase-pager .pp-next {
  flex-direction: row-reverse;
  text-align: right;
  background: linear-gradient(180deg, rgba(239,43,52,0.12), rgba(13,24,48,0.5));
  border-color: rgba(239,43,52,0.35);
}
.phase-pager .pp-next:hover { background: linear-gradient(180deg, rgba(239,43,52,0.2), rgba(13,24,48,0.5)); }
.phase-pager .arrow {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  flex-shrink: 0;
  color: var(--ink);
}
.phase-pager .pp-next .arrow { background: linear-gradient(180deg, var(--red-bright), var(--red-deep)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -6px var(--red-glow); }
.phase-pager .pp-meta {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1;
}
.phase-pager .pp-meta .l {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-low); letter-spacing: 0.1em; text-transform: uppercase;
}
.phase-pager .pp-meta .t {
  font-size: 14px; font-weight: 500; letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.phase-pager .pp-placeholder { visibility: hidden; }
@media (max-width: 720px) {
  .phase-pager { flex-direction: column; gap: 10px; }
  .phase-pager .pp-prev, .phase-pager .pp-next { width: 100%; max-width: none; }
}

/* ---------- Generic frame card ---------- */
.frame {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(13, 24, 48, 0.5), rgba(7, 14, 33, 0.5));
  box-shadow: 0 30px 70px -30px rgba(0,0,0,0.7);
  overflow: hidden;
}
.frame-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8,16,36,0.7), transparent);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mid);
}
.frame-bar .left { display: inline-flex; align-items: center; gap: 8px; }
.frame-bar .crumb {
  padding: 3px 8px; border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  font-size: 10.5px;
}
.frame-bar .live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: #6fdc8c;
}
.frame-bar .live::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: #6fdc8c; box-shadow: 0 0 10px #6fdc8c;
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot { 50% { opacity: 0.35; } }

/* ---------- Phase 1 · Intake ---------- */
.intake-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
}
@media (max-width: 920px) { .intake-grid { grid-template-columns: 1fr; } }

.drop {
  position: relative;
  padding: 36px;
  min-height: 380px;
  border: 1.5px dashed rgba(239, 43, 52, 0.35);
  border-radius: 18px;
  background:
    radial-gradient(500px 300px at 50% 0%, rgba(239,43,52,0.10), transparent 60%),
    linear-gradient(180deg, #0b1530, #060d1c);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
}
.drop-glow {
  position: absolute; inset: -1px;
  background: radial-gradient(400px 200px at 50% 50%, rgba(239,43,52,0.12), transparent 60%);
  pointer-events: none;
  animation: drop-pulse 4s ease-in-out infinite;
}
@keyframes drop-pulse { 50% { opacity: 0.5; } }

.drop .icon {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--red-bright), var(--red-deep));
  display: grid; place-items: center;
  margin-bottom: 18px;
  box-shadow: 0 20px 50px -10px var(--red-glow);
  z-index: 2;
}
.drop .icon svg { width: 36px; height: 36px; color: #fff; }
.drop h3 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  z-index: 2;
}
.drop p {
  margin-top: 8px;
  font-size: 13.5px; color: var(--ink-mid);
  z-index: 2;
}
.drop .file-pill {
  margin-top: 24px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  z-index: 2;
}
.drop .file-pill .file-icon {
  width: 24px; height: 24px; border-radius: 5px;
  background: linear-gradient(180deg, var(--red-bright), var(--red-deep));
  color: #fff;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700; letter-spacing: 0.04em;
}
.drop .progress {
  width: 100%;
  height: 4px; margin-top: 18px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  max-width: 320px;
  z-index: 2;
}
.drop .progress i {
  display: block; height: 100%; width: 64%;
  background: linear-gradient(90deg, var(--red-deep), var(--red-bright));
  border-radius: 999px;
  animation: drop-bar 2.4s ease-in-out infinite;
}
@keyframes drop-bar {
  0% { width: 8%; }
  60% { width: 88%; }
  100% { width: 8%; }
}

.meta-card { padding: 22px; position: relative; }
.meta-card h4 {
  font-size: 13px; letter-spacing: -0.005em;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
  transition: opacity 0.5s var(--ease-soft);
}
.meta-card h4 .badge {
  font-family: var(--font-mono); font-size: 9.5px;
  background: rgba(111,220,140,0.12);
  color: #6fdc8c;
  border: 1px solid rgba(111,220,140,0.3);
  padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.meta-card .meta-rows { transition: opacity 0.6s var(--ease-soft); }
.meta-card.scanning h4,
.meta-card.scanning .meta-rows { opacity: 0; pointer-events: none; }
.meta-card.revealed h4,
.meta-card.revealed .meta-rows { opacity: 1; }

/* Scan overlay */
.scan-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px;
  background:
    radial-gradient(400px 220px at 50% 50%, rgba(239,43,52,0.08), transparent 65%),
    linear-gradient(180deg, rgba(13,24,48,0.85), rgba(7,14,33,0.85));
  border-radius: 18px;
  z-index: 4;
  opacity: 1;
  transition: opacity 0.6s var(--ease-soft), visibility 0.6s;
}
.meta-card.revealed .scan-overlay {
  opacity: 0;
  visibility: hidden;
}
.scan-spinner {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: var(--red-bright);
  border-right-color: var(--red-bright);
  animation: spin-fast 0.9s linear infinite;
  position: relative;
}
.scan-spinner::after {
  content: "";
  position: absolute; inset: 8px;
  border-radius: 50%;
  border: 1px dashed rgba(239,43,52,0.4);
  animation: spin-slow 2.4s linear infinite reverse;
}
@keyframes spin-fast { to { transform: rotate(360deg); } }
@keyframes spin-slow { to { transform: rotate(360deg); } }

.scan-msg {
  text-align: center;
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.005em;
  display: flex; flex-direction: column; gap: 6px;
  align-items: center;
}
.scan-msg .scan-page {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mid);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.scan-msg .scan-page b { color: var(--red-bright); font-weight: 500; animation: page-tick 0.18s steps(1) infinite; }
@keyframes page-tick { 50% { color: #ffb86b; } }

.scan-progress {
  width: 70%;
  max-width: 240px;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}
.scan-progress > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red-deep), var(--red-bright));
  border-radius: 999px;
  animation: scan-fill 3.5s var(--ease-out) forwards;
}
@keyframes scan-fill { from { width: 0%; } to { width: 100%; } }

.scan-steps {
  display: flex; gap: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.scan-steps .ss {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--ink-low);
}
.scan-steps .ss.done { color: #6fdc8c; border-color: rgba(111,220,140,0.3); background: rgba(111,220,140,0.08); }
.scan-steps .ss.run { color: var(--red-bright); border-color: rgba(239,43,52,0.4); background: rgba(239,43,52,0.10); animation: ss-pulse 1.4s ease-in-out infinite; }
@keyframes ss-pulse { 50% { background: rgba(239,43,52,0.20); } }
.meta-rows { display: grid; gap: 1px; background: var(--line); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.meta-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: center;
  background: rgba(13, 24, 48, 0.55);
  padding: 11px 14px;
  font-size: 13px;
}
.meta-row .k {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-low);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.meta-row .v { color: var(--ink); font-weight: 500; letter-spacing: -0.005em; }
.meta-row .v .red { color: var(--red-bright); }
.meta-row .v .mono { font-family: var(--font-mono); font-size: 12px; }

/* ---------- Phase 2 · Pipeline (deep) ---------- */
.pipeline-deep {
  display: grid; gap: 12px;
}
.pstep {
  display: grid;
  grid-template-columns: 60px minmax(220px, 1.1fr) minmax(0, 1.8fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 24, 48, 0.4), rgba(7, 14, 33, 0.4));
  transition: border-color 0.4s var(--ease-soft), background 0.4s var(--ease-soft);
}
.pstep.done { border-color: rgba(111, 220, 140, 0.2); }
.pstep.run {
  border-color: rgba(239, 43, 52, 0.4);
  background: linear-gradient(180deg, rgba(239,43,52,0.08), rgba(13,24,48,0.4));
  box-shadow: 0 14px 30px -14px var(--red-glow);
}
.pstep .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-low);
  letter-spacing: 0.1em;
}
.pstep .name { display: flex; flex-direction: column; gap: 2px; }
.pstep .name .t { font-size: 14.5px; font-weight: 500; letter-spacing: -0.005em; color: var(--ink); }
.pstep .name .d { font-size: 12px; color: var(--ink-mid); }
.pstep .detail {
  display: flex; flex-direction: column; gap: 6px;
}
.pstep .detail .insight {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-mid);
}
.pstep .detail .insight .key { color: var(--ink); font-weight: 500; }
.pstep .detail .insight .red { color: var(--red-bright); }
.pstep .detail .bar {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}
.pstep .detail .bar > i {
  display: block; height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red-deep), var(--red-bright));
  border-radius: 999px;
  transition: width 0.6s var(--ease-soft);
}
.pstep.done .detail .bar > i { width: 100% !important; background: linear-gradient(90deg, #4eb96f, #6fdc8c); }
.pstep .status {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--ink-low);
  letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
}
.pstep.done .status { color: #6fdc8c; border-color: rgba(111,220,140,0.3); background: rgba(111,220,140,0.08); }
.pstep.run  .status { color: var(--red-bright); border-color: rgba(239,43,52,0.4); background: rgba(239,43,52,0.1); }
@media (max-width: 720px) {
  .pstep { grid-template-columns: 1fr; gap: 10px; padding: 14px; }
  .pstep .num { display: none; }
}

.pipeline-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 22px;
  padding: 20px 22px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(239,43,52,0.06), rgba(7,14,33,0.4));
  border: 1px solid rgba(239,43,52,0.18);
}
.pipeline-totals .ti {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-low);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.pipeline-totals .ti b {
  font-family: var(--font-sans);
  font-size: 18px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none;
}
.pipeline-totals .ti b .red { color: var(--red-bright); }
@media (max-width: 720px) { .pipeline-totals { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Phase 3 · Tender tabs ---------- */
.tabs-wrap { padding: 0; }

/* Sticky AI pipeline mini-strip inside tab frame */
.ai-mini {
  position: sticky;
  top: 134px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(8,16,36,0.95), rgba(8,16,36,0.85));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-low);
  letter-spacing: 0.06em; text-transform: uppercase;
  overflow-x: auto;
  white-space: nowrap;
}
.ai-mini .lbl {
  color: var(--ink-mid);
  margin-right: 6px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 9.5px;
}
.ai-mini .lbl::before {
  content: ""; width: 5px; height: 5px; border-radius: 999px;
  background: #6fdc8c; box-shadow: 0 0 6px #6fdc8c;
}
.ai-mini .mstep {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--ink-mid);
  font-size: 9.5px;
}
.ai-mini .mstep .dot {
  width: 10px; height: 10px; border-radius: 999px;
  border: 1.5px solid var(--ink-low);
  display: grid; place-items: center;
  background: transparent;
}
.ai-mini .mstep.done .dot {
  border-color: #6fdc8c;
  background: rgba(111,220,140,0.18);
  position: relative;
}
.ai-mini .mstep.done .dot::after {
  content: "✓";
  color: #6fdc8c;
  font-size: 7px;
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1;
}
.ai-mini .mstep.done { color: var(--ink); }
.ai-mini .mlink {
  width: 12px; height: 1px;
  background: linear-gradient(90deg, var(--line-strong), var(--line));
  flex-shrink: 0;
}

.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 12px 12px 0;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8,16,36,0.7), transparent);
}
.tab-btn {
  padding: 8px 11px;
  font-size: 12px;
  color: var(--ink-mid);
  letter-spacing: -0.005em;
  border-radius: 8px 8px 0 0;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s, background 0.2s;
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab-btn svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.7; }
.tab-btn:hover svg { opacity: 1; }
.tab-btn:hover { color: var(--ink); background: rgba(255,255,255,0.025); }
.tab-btn.active {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(239,43,52,0.10), rgba(13,24,48,0.0));
  border-color: rgba(239,43,52,0.3);
}
.tab-btn.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: var(--red-bright);
}
.tab-btn .cnt {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 8px;
  color: var(--ink-low);
}
.tab-btn.active .cnt { background: rgba(239,43,52,0.18); color: #ffd2d3; }

.tab-panels { padding: 24px; min-height: 460px; }
.tab-panel { display: none; animation: panel-in 0.45s var(--ease-out); }
.tab-panel.active { display: block; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* common pieces inside panels */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 720px) { .kv-grid { grid-template-columns: repeat(2, 1fr); } }
.kv {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.kv .l {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-low); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.kv .v { font-size: 18px; color: var(--ink); font-weight: 500; letter-spacing: -0.01em; }
.kv .v .red { color: var(--red-bright); }
.kv .v .sm { font-size: 12px; color: var(--ink-mid); margin-left: 4px; }

.data-table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-size: 12.5px;
}
.data-table thead th {
  text-align: left;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-low);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
}
.data-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: top;
}
.data-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.data-table tbody td.m { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-mid); }
.data-table .right { text-align: right; }
.data-table .pill {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 9.5px;
  padding: 2px 7px; border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--ink-mid);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.data-table .pill.ok { color: #6fdc8c; border-color: rgba(111,220,140,0.3); background: rgba(111,220,140,0.08); }
.data-table .pill.warn { color: #ffb86b; border-color: rgba(255,184,107,0.3); background: rgba(255,184,107,0.08); }
.data-table .pill.crit { color: var(--red-bright); border-color: rgba(239,43,52,0.4); background: rgba(239,43,52,0.10); }

/* panel header */
.panel-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.panel-h h4 {
  font-size: 18px; letter-spacing: -0.015em; font-weight: 500;
}
.panel-h h4 .italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--silver); }
.panel-h .ai-source {
  display: inline-flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-low);
}
.panel-h .ai-source .b {
  background: rgba(239,43,52,0.14);
  color: #ffd2d3;
  border: 1px solid rgba(239,43,52,0.35);
  padding: 2px 6px; border-radius: 3px;
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}

/* Summary / overview panel */
.summary-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}
@media (max-width: 920px) { .summary-grid { grid-template-columns: 1fr; } }
.summary-text p {
  font-size: 14px; line-height: 1.6;
  color: var(--ink-mid);
  margin-bottom: 12px;
}
.summary-text p strong { color: var(--ink); font-weight: 500; }
.summary-side {
  padding: 18px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(239,43,52,0.04), transparent);
  border: 1px solid rgba(239,43,52,0.15);
}
.summary-side h5 {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--red-bright);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 10px;
}
.summary-side ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.summary-side li {
  display: grid; grid-template-columns: 16px 1fr; gap: 8px;
  font-size: 12.5px; color: var(--ink-mid); align-items: baseline;
}
.summary-side li::before { content: "●"; color: var(--red-bright); font-size: 9px; }

/* Checklist */
.checklist-section h5 {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-low); letter-spacing: 0.1em; text-transform: uppercase;
  margin: 18px 0 8px;
}
.checklist-section:first-child h5 { margin-top: 0; }
.check-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
  margin-bottom: 6px;
  font-size: 13px;
}
.check-item.ok .check { background: linear-gradient(180deg, #6fdc8c, #3aa863); }
.check-item.run .check { background: linear-gradient(180deg, #ffd28a, #d99644); }
.check-item .check {
  width: 16px; height: 16px; border-radius: 5px;
  background: rgba(255,255,255,0.08);
  display: grid; place-items: center;
  font-size: 10px; color: #060d1c;
}
.check-item .ttl { color: var(--ink); }
.check-item .due { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-low); }

/* Risk cards */
.risk-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 720px) { .risk-grid { grid-template-columns: 1fr; } }
.risk-card {
  position: relative;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
}
.risk-card.high { border-color: rgba(239,43,52,0.35); background: linear-gradient(180deg, rgba(239,43,52,0.08), rgba(0,0,0,0)); }
.risk-card.med  { border-color: rgba(255,184,107,0.3); background: linear-gradient(180deg, rgba(255,184,107,0.06), rgba(0,0,0,0)); }
.risk-card .h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.risk-card .h .lbl { font-size: 14px; font-weight: 500; letter-spacing: -0.005em; }
.risk-card .h .score {
  font-family: var(--font-mono); font-size: 10px;
  padding: 2px 7px; border-radius: 4px;
}
.risk-card.high .h .score { background: rgba(239,43,52,0.18); color: var(--red-bright); border: 1px solid rgba(239,43,52,0.4); }
.risk-card.med .h .score  { background: rgba(255,184,107,0.15); color: #ffb86b; border: 1px solid rgba(255,184,107,0.4); }
.risk-card.low .h .score  { background: rgba(111,220,140,0.12); color: #6fdc8c; border: 1px solid rgba(111,220,140,0.3); }
.risk-card .d { font-size: 12px; color: var(--ink-mid); line-height: 1.45; }
.risk-card .m {
  margin-top: 10px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-low);
}

/* Plan / Gantt */
.gantt {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(0,0,0,0));
  overflow: hidden;
}
.gantt-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-low);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.gantt-days {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  border-left: 1px solid var(--line);
}
.gantt-days span {
  padding: 8px 6px;
  text-align: center;
  border-right: 1px solid var(--line);
  font-size: 9.5px;
}
.gantt-days span:last-child { border-right: 0; }
.gantt-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-top: 1px solid var(--line);
}
.gantt-row .lbl {
  padding: 12px 14px;
  font-size: 12.5px; color: var(--ink);
  display: flex; flex-direction: column; gap: 2px;
}
.gantt-row .lbl .sub { font-family: var(--font-mono); font-size: 10px; color: var(--ink-low); text-transform: uppercase; letter-spacing: 0.06em; }
.gantt-track {
  position: relative;
  border-left: 1px solid var(--line);
  padding: 12px 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(100%/18 - 1px), var(--line) calc(100%/18 - 1px) calc(100%/18));
}
.gbar {
  position: absolute;
  height: 18px;
  border-radius: 4px;
  top: 50%; transform: translateY(-50%);
  background: linear-gradient(180deg, var(--red-bright), var(--red-deep));
  box-shadow: 0 4px 14px -4px var(--red-glow);
  display: flex; align-items: center;
  padding: 0 8px;
  font-family: var(--font-mono); font-size: 10px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
}
.gbar.alt { background: linear-gradient(180deg, #4f6fae, #2c4781); box-shadow: 0 4px 14px -4px rgba(47, 82, 158, 0.4); }
.gbar.ghost { background: linear-gradient(180deg, rgba(155,180,230,0.4), rgba(155,180,230,0.15)); color: #c9d6ea; }

/* Zones (mini map) */
.zones-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}
@media (max-width: 920px) { .zones-grid { grid-template-columns: 1fr; } }
.zone-map {
  position: relative;
  height: 360px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background:
    radial-gradient(400px 250px at 50% 50%, rgba(33,88,180,0.12), transparent 60%),
    linear-gradient(180deg, #0a1426, #060d1c);
  overflow: hidden;
}
.zone-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.zone-pin {
  position: absolute;
  background: linear-gradient(180deg, rgba(239,43,52,0.18), rgba(216,35,42,0.06));
  border: 1px solid rgba(239,43,52,0.45);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 0 0 4px rgba(239,43,52,0.05);
}
.zone-pin .l { font-size: 9.5px; color: var(--ink-low); }
.zone-list { display: grid; gap: 8px; align-self: start; }
.zone-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
  font-size: 13px;
}
.zone-row .b {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--red-bright);
  background: rgba(239,43,52,0.10); border: 1px solid rgba(239,43,52,0.3);
  border-radius: 5px;
  display: grid; place-items: center;
  height: 22px; width: 22px;
}
.zone-row .area { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-low); }

/* Work orders + materials + resources tables */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 720px) { .cards-grid { grid-template-columns: 1fr; } }
.wo-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(0,0,0,0));
}
.wo-card .h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.wo-card .h .t {
  display: flex; flex-direction: column; gap: 2px;
}
.wo-card .h .t .lbl { font-size: 14px; font-weight: 500; letter-spacing: -0.005em; }
.wo-card .h .t .sub { font-family: var(--font-mono); font-size: 10px; color: var(--ink-low); text-transform: uppercase; letter-spacing: 0.06em; }
.wo-card .meta {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-mid);
}
.wo-card .meta .k { color: var(--ink-low); margin-right: 4px; }
.wo-card .items {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-mid);
}
.wo-card .items b { color: var(--ink); font-weight: 500; }

.cat-section { margin-top: 18px; }
.cat-section:first-child { margin-top: 0; }
.cat-section h5 {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--red-bright);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 8px;
}
.cat-section h5 .ct {
  font-family: var(--font-mono); color: var(--ink-low); font-size: 10px;
}

/* ---------- Phase 4 · Convert wizard ---------- */
.won-banner {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px;
  border-radius: 14px;
  border: 1px solid rgba(111,220,140,0.3);
  background: linear-gradient(180deg, rgba(111,220,140,0.08), rgba(0,0,0,0));
  margin-bottom: 24px;
}
.won-banner .seal {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #6fdc8c, #2a8a4c);
  display: grid; place-items: center;
  color: #021c0d;
  box-shadow: 0 0 0 6px rgba(111,220,140,0.1);
}
.won-banner .seal svg { width: 28px; height: 28px; }
.won-banner h4 { font-size: 18px; letter-spacing: -0.01em; font-weight: 500; }
.won-banner p { font-size: 13px; color: var(--ink-mid); margin-top: 2px; }
.won-banner .cta {
  margin-left: auto;
  padding: 9px 16px;
  background: linear-gradient(180deg, var(--red-bright), var(--red-deep));
  color: #fff;
  border-radius: 999px;
  font-size: 12.5px;
  font-family: var(--font-sans);
  font-weight: 500;
  border: 0;
  box-shadow: 0 10px 30px -10px var(--red-glow);
  white-space: nowrap;
}

.wizard {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 920px) { .wizard { grid-template-columns: 1fr; } }
.wstep {
  position: relative;
  padding: 22px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(13,24,48,0.5), rgba(7,14,33,0.5));
}
.wstep .n {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--red-bright);
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 12px;
}
.wstep h5 {
  font-size: 15.5px; letter-spacing: -0.005em; font-weight: 500;
  margin-bottom: 10px;
}
.wstep p { font-size: 12.5px; color: var(--ink-mid); margin-bottom: 14px; }
.wstep .field {
  display: grid; grid-template-columns: 86px 1fr;
  gap: 6px 14px; align-items: baseline;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.wstep .field:last-child { border-bottom: 0; }
.wstep .field .k { font-family: var(--font-mono); font-size: 10px; color: var(--ink-low); text-transform: uppercase; letter-spacing: 0.06em; }
.wstep .field .v { color: var(--ink); font-weight: 500; letter-spacing: -0.005em; }
.wstep .field .v .red { color: var(--red-bright); }
.wstep::after {
  content: "→";
  position: absolute;
  right: -22px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); color: var(--ink-low);
  font-size: 14px;
  pointer-events: none;
}
.wstep:last-child::after { display: none; }
@media (max-width: 920px) {
  .wstep::after { display: none; }
}

/* ---------- Phase 5 · Schedule ---------- */
.sched-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.crew-board {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13,24,48,0.4), rgba(0,0,0,0));
  overflow: hidden;
}
.cb-h {
  display: grid;
  grid-template-columns: 180px 1fr;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-low);
}
.cb-h .days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--line);
}
.cb-h .days span { padding: 10px 6px; text-align: center; border-right: 1px solid var(--line); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.cb-h .days span:last-child { border-right: 0; }
.cb-h .days span.weekend { background: rgba(255,255,255,0.02); color: var(--ink-low); }
.cb-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  border-bottom: 1px solid var(--line);
}
.cb-row:last-child { border-bottom: 0; }
.cb-row .lane {
  padding: 14px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.cb-row .lane .nm { font-size: 13px; font-weight: 500; }
.cb-row .lane .sub { font-family: var(--font-mono); font-size: 10px; color: var(--ink-low); text-transform: uppercase; letter-spacing: 0.06em; }
.cb-row .cells {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(100%/7 - 1px), var(--line) calc(100%/7 - 1px) calc(100%/7));
  border-left: 1px solid var(--line);
}
.cb-row .cells span.weekend { background: rgba(255,255,255,0.015); }
.assign {
  position: absolute;
  height: 26px;
  border-radius: 5px;
  top: 50%; transform: translateY(-50%);
  background: linear-gradient(180deg, var(--red-bright), var(--red-deep));
  color: #fff;
  font-family: var(--font-mono); font-size: 10px;
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px;
  box-shadow: 0 4px 14px -4px var(--red-glow);
  white-space: nowrap;
  overflow: hidden;
}
.assign.b { background: linear-gradient(180deg, #4f6fae, #2c4781); box-shadow: 0 4px 14px -4px rgba(47, 82, 158, 0.4); }
.assign.warn {
  background: linear-gradient(180deg, #d99644, #ad6a23);
  animation: warn-blink 1.8s ease-in-out infinite;
}
@keyframes warn-blink { 50% { box-shadow: 0 0 0 4px rgba(255,184,107,0.18); } }

.conflict {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,184,107,0.08), transparent);
  border: 1px solid rgba(255,184,107,0.25);
}
.conflict .icn {
  width: 24px; height: 24px; border-radius: 999px;
  background: rgba(255,184,107,0.18);
  color: #ffb86b;
  display: grid; place-items: center;
  font-size: 14px;
}
.conflict .msg { font-size: 13px; color: var(--ink); }
.conflict .msg b { font-weight: 500; color: var(--ink); }
.conflict .resolve {
  padding: 6px 12px;
  font-size: 11.5px;
  color: var(--ink);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-sans);
}

/* ---------- Phase 6 · Dispatch (map + mobile) ---------- */
.dispatch-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
}
@media (max-width: 920px) { .dispatch-grid { grid-template-columns: 1fr; } }

.dm-stage {
  position: relative;
  height: 520px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(600px 400px at 30% 30%, rgba(33,88,180,0.18), transparent 60%),
    linear-gradient(180deg, #0a1426, #060d1c);
  overflow: hidden;
}
.dm-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Legend over the site plan */
.dm-legend {
  position: absolute;
  top: 50%; left: 18px;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(18,32,60,0.92), rgba(10,20,40,0.88));
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-mid);
  text-transform: uppercase; letter-spacing: 0.06em;
  white-space: nowrap;
  box-shadow: 0 14px 30px -14px rgba(0,0,0,0.7);
}
.dm-legend span { display: inline-flex; align-items: center; gap: 8px; }
.dm-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.dm-legend .sw.red { background: rgba(239,43,52,0.55); border: 1px solid rgba(239,43,52,0.7); }
.dm-legend .sw.amber { background: rgba(255,184,107,0.4); border: 1px dashed rgba(255,184,107,0.7); }
.dm-legend .sw.orange { background: transparent; position: relative; }
.dm-legend .sw.orange::after { content: ""; position: absolute; left: 1px; bottom: 0; border-style: solid; border-width: 0 5px 11px 5px; border-color: transparent transparent #ffb86b transparent; }
.dm-legend .sw.crew { background: #ef2b34; border-radius: 999px; box-shadow: 0 0 6px rgba(239,43,52,0.4); }

@media (max-width: 920px) {
  .dm-legend { position: static; transform: none; flex-direction: row; flex-wrap: wrap; margin: 12px 18px; }
}
.dm-pin { position: absolute; width: 14px; height: 14px; border-radius: 999px; background: var(--red-bright); box-shadow: 0 0 0 4px rgba(239,43,52,0.16), 0 0 16px var(--red-glow); }
.dm-pin::after {
  content: ""; position: absolute; inset: -8px; border-radius: 999px;
  border: 1px solid var(--red-bright); opacity: 0;
  animation: ping 2.4s ease-out infinite;
}
.dm-pin.green { background: #6fdc8c; box-shadow: 0 0 0 4px rgba(111,220,140,0.16), 0 0 14px #6fdc8c; }
.dm-pin.green::after { border-color: #6fdc8c; }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.8; } 100% { transform: scale(2.6); opacity: 0; } }

.dm-badge {
  position: absolute;
  background: linear-gradient(180deg, rgba(18,32,60,0.95), rgba(10,20,40,0.9));
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 11px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink);
  display: flex; gap: 8px; align-items: center;
  white-space: nowrap;
  box-shadow: 0 14px 30px -14px rgba(0,0,0,0.7);
}
.dm-badge .t { color: var(--ink-low); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; }
.dm-badge .v { color: var(--ink); }
.dm-badge .v.red { color: var(--red-bright); }
.dm-badge .v.up  { color: #6fdc8c; }

.phone-frame {
  display: grid; place-items: center;
}
.phn {
  width: 260px; height: 540px;
  border-radius: 36px;
  background: linear-gradient(180deg, #1c2540, #0a1426);
  padding: 9px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 50px 80px -30px rgba(0,0,0,0.7);
}
.phn-scr {
  background: linear-gradient(180deg, #060d1c, #050a18);
  border-radius: 28px;
  height: 100%; padding: 16px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.phn-stt { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--ink-mid); margin-bottom: 10px; }
.phn-push {
  background: linear-gradient(180deg, rgba(239,43,52,0.18), rgba(239,43,52,0.04));
  border: 1px solid rgba(239,43,52,0.4);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  position: relative;
}
.phn-push::before {
  content: "WL · WorkLeaf · now";
  font-family: var(--font-mono);
  font-size: 9px;
  color: #ffd2d3;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 6px;
}
.phn-push .ttl { font-size: 13px; font-weight: 500; }
.phn-push .msg { font-size: 11.5px; color: var(--ink-mid); margin-top: 3px; line-height: 1.4; }
.phn-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  margin-bottom: 9px;
}
.phn-card .row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.phn-card .ttl { font-size: 12px; font-weight: 500; }
.phn-card .tag { font-family: var(--font-mono); font-size: 9px; padding: 2px 6px; border-radius: 3px; }
.phn-card .tag.go { color: var(--red-bright); border: 1px solid rgba(239,43,52,0.3); }
.phn-card .tag.q { color: var(--ink-low); border: 1px solid var(--line); }
.phn-card .meta { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-low); }
.phn-tabs {
  margin-top: auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.phn-tabs span {
  text-align: center; font-family: var(--font-mono); font-size: 9px;
  color: var(--ink-low); text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 0;
}
.phn-tabs span.act { color: var(--red-bright); }

/* ---------- Phase 7 · Close & invoice ---------- */
.close-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 920px) { .close-grid { grid-template-columns: 1fr; } }
.report-card {
  padding: 22px;
}
.report-card h4 {
  font-size: 16px; letter-spacing: -0.01em; font-weight: 500;
  margin-bottom: 6px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.report-card .by { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-low); text-transform: uppercase; letter-spacing: 0.08em; }
.report-card .field {
  display: grid; grid-template-columns: 110px 1fr;
  gap: 8px 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.report-card .field:last-of-type { border-bottom: 0; }
.report-card .field .k { font-family: var(--font-mono); font-size: 10px; color: var(--ink-low); text-transform: uppercase; letter-spacing: 0.06em; }
.report-card .field .v { color: var(--ink); }
.report-card .ai-blob {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(239,43,52,0.08), rgba(0,0,0,0));
  border: 1px solid rgba(239,43,52,0.25);
  font-size: 13px; color: var(--ink); line-height: 1.55;
}
.report-card .ai-blob::before {
  content: "AI client report draft";
  display: block;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--red-bright); letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.invoice {
  position: relative;
  padding: 22px;
}
.invoice .ih {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.invoice .ih h4 { font-size: 18px; letter-spacing: -0.015em; font-weight: 500; }
.invoice .ih .draft-pill {
  font-family: var(--font-mono); font-size: 10px;
  padding: 3px 8px; border-radius: 4px;
  background: rgba(239,43,52,0.12); color: #ffd2d3;
  border: 1px solid rgba(239,43,52,0.35);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.invoice .meta-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-mid);
  margin-bottom: 16px;
}
.invoice .meta-row .b { color: var(--ink); display: block; font-family: var(--font-sans); font-size: 13px; font-weight: 500; margin-top: 2px; letter-spacing: -0.005em; }
.invoice table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.invoice table th, .invoice table td { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left; }
.invoice table th { font-family: var(--font-mono); font-size: 10px; color: var(--ink-low); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.invoice table td.right, .invoice table th.right { text-align: right; }
.invoice .totals {
  margin-top: 12px;
  display: grid; grid-template-columns: 1fr auto; gap: 6px 28px;
  font-size: 13px;
  align-items: baseline;
}
.invoice .totals .k { color: var(--ink-mid); text-align: right; font-family: var(--font-mono); font-size: 11px; }
.invoice .totals .v { color: var(--ink); font-family: var(--font-mono); font-size: 12.5px; text-align: right; }
.invoice .totals .grand { font-size: 18px; color: var(--ink); font-weight: 500; letter-spacing: -0.01em; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; font-family: var(--font-sans); }
.invoice .grand-l { font-size: 11px; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }

/* ---------- Final CTA & footer reuse ---------- */
.demo-end {
  padding: 100px 0;
  text-align: center;
  border-top: 1px solid var(--line);
}
.demo-end h2 {
  font-size: clamp(34px, 4vw, 56px);
  letter-spacing: -0.03em; font-weight: 500;
  line-height: 1.05;
}
.demo-end h2 .italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--silver); }
.demo-end p {
  margin-top: 18px;
  font-size: 16px; color: var(--ink-mid);
  max-width: 540px; margin-left: auto; margin-right: auto;
}
.demo-end .ctas {
  margin-top: 32px;
  display: inline-flex; gap: 12px; flex-wrap: wrap;
}

/* ================= MOBILE CLEANUP (≤ 720px) ================= */
@media (max-width: 720px) {
  /* Hero meta + demo timings */
  .demo-hero { padding: 56px 0 36px; }
  .phase-head { gap: 10px; margin-bottom: 24px; }

  /* Tab frame — contain horizontal scroll inside each panel, never the page */
  .tab-panels { padding: 16px 14px; min-height: 0; }
  .tab-panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Tables stay readable but scroll within their panel */
  .data-table { min-width: 540px; font-size: 11.5px; }
  .data-table thead th, .data-table tbody td { padding: 8px 10px; }

  /* Force the inline-styled kv-grids (5/6 cols) down to 2 cols */
  .tab-panel .kv-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }

  /* Sticky AI mini-pipeline strip — let it scroll horizontally, smaller */
  .ai-mini { top: 56px; gap: 3px; padding: 7px 12px; scrollbar-width: none; -ms-overflow-style: none; }
  .ai-mini::-webkit-scrollbar { display: none; height: 0; }
  .ai-mini .mstep { font-size: 9px; }
  .ai-mini .mstep .dot { width: 9px; height: 9px; }

  /* Gantt + crew board scroll inside their own frame */
  .gantt, .crew-board { min-width: 600px; }
  .phase-block .frame:not(.tabs-wrap) { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Pipeline-deep step rows */
  .pstep .detail { gap: 4px; }

  /* Phase nav rail — tighter chips */
  .phase-step { min-width: 150px; padding: 12px 12px 14px; }
  .phase-step .t { font-size: 12px; }

  /* Frame bars / docrows */
  .frame-bar { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
  .docs-actions { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* Drop / intake */
  .drop { padding: 24px; min-height: 300px; }
  .drop .file-pill { font-size: 10.5px; flex-wrap: wrap; }

  /* Zone + dispatch maps shorter */
  .zone-map { height: 280px; }
  .dm-stage { height: 380px; }

  /* Won banner stacks */
  .won-banner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .won-banner .cta { margin-left: 0; width: 100%; }

  /* Panel headers wrap their action buttons */
  .panel-h { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* Phase prev/next pagers — hidden on mobile (dropdown nav covers it) */
  .phase-pager { display: none; }

  /* Invoice + report cards */
  .invoice, .report-card { padding: 18px; }
  .invoice table { font-size: 11.5px; }
  .invoice table th, .invoice table td { padding: 7px 4px; }
  .invoice table td.right, .invoice table th.right { white-space: nowrap; }
  .invoice table td:first-child, .invoice table th:first-child { padding-left: 0; }

  /* Dispatch site plan — keep only opposite-corner badges so they never collide */
  .dm-badge { font-size: 9px; padding: 6px 9px; gap: 6px; }
  .dm-badge .t { font-size: 8px; }
  .dm-badge-hide-m { display: none; }
}

/* Custom thin scrollbar for the in-panel scroll regions */
@media (max-width: 720px) {
  .tab-panel::-webkit-scrollbar, .phase-block .frame:not(.tabs-wrap)::-webkit-scrollbar { height: 5px; }
  .tab-panel::-webkit-scrollbar-thumb, .phase-block .frame:not(.tabs-wrap)::-webkit-scrollbar-thumb { background: rgba(239,43,52,0.4); border-radius: 999px; }
  .tab-panel::-webkit-scrollbar-track, .phase-block .frame:not(.tabs-wrap)::-webkit-scrollbar-track { background: transparent; }
}
