/* Shoprail app shell. Original demo UI. */
:root {
  --ink: #141916;
  --ink-soft: #4a5650;
  --paper: #eef2ec;
  --mist: #f6f8f5;
  --panel: #ffffff;
  --spruce: #24563c;
  --spruce-soft: #d7e8dc;
  --amber: #b8893a;
  --amber-soft: #f3e6cb;
  --rose: #9b3d45;
  --rose-soft: #f5d9dc;
  --paper-deep: #dfe6dc;
  --line: rgba(20, 25, 22, 0.1);
  --shadow: 0 12px 40px rgba(20, 25, 22, 0.1);
  --font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar-w: 220px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--mist);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

h1, h2, h3, h4,
button,
.tabs button,
.btn-page,
.sidebar-brand,
.topbar h1,
.capacity-chart-inner h3,
.modal-head h2,
.detail-block h3,
.project-title-row h1,
.section-card-head h3,
.stage-head {
  font-family: var(--font-display);
}

button, input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100%;
}

/* Sidebar */
.sidebar {
  background: var(--ink);
  color: #e8eee9;
  padding: 1.25rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
  color: inherit;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-close {
  display: none;
}

.sidebar-logo {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  flex-shrink: 0;
}

.sidebar-label {
  margin: 0 0.5rem 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.45;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  overflow-y: auto;
}

.side-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.92rem;
  opacity: 0.72;
  transition: background 0.2s, opacity 0.2s;
}

.side-nav button:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}

.side-nav button.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

.sidebar-foot {
  padding: 0.75rem 0.5rem 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.sidebar-foot a {
  color: rgba(232, 238, 233, 0.7);
  text-decoration: none;
}

.sidebar-foot a:hover {
  color: #fff;
}

.demo-pill {
  display: inline-flex;
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(184, 137, 58, 0.25);
  color: #f0d9a8;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Main */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.35rem 1.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 248, 245, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-toggle {
  display: none;
  appearance: none;
  flex-shrink: 0;
  border: none;
  background: transparent;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  padding: 0.55rem;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.2s var(--ease);
}

.sidebar-toggle:hover {
  background: rgba(20, 25, 22, 0.06);
}

.sidebar-toggle-icon {
  display: block;
  width: 100%;
  height: 100%;
}

.topbar-head {
  flex: 1;
  min-width: 0;
}

.sidebar-overlay {
  display: none;
}

.topbar h1 {
  margin: 0;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}

.view-sub {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.search input {
  width: min(280px, 40vw);
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search input:focus {
  border-color: var(--spruce);
  box-shadow: 0 0 0 3px rgba(36, 86, 60, 0.15);
}

.view-root {
  padding: 1.25rem 1.75rem 2.5rem;
  animation: fadeUp 0.35s var(--ease);
}

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

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.tabs button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  min-height: 2.25rem;
}

.tabs button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.city-sub {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.box-split {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.75rem;
}

/* Mobile job cards (shown under 900px) */
.job-list {
  display: none;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}

.mobile-tip {
  display: none;
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--spruce);
}

.job-list-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  box-shadow: 0 2px 10px rgba(20, 25, 22, 0.04);
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}

.job-list-card:active {
  transform: scale(0.985);
}

.job-list-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.15rem;
}

.job-list-id {
  font-weight: 700;
  font-size: 0.95rem;
}

.job-list-address {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.job-list-meta {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.job-list-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  width: 100%;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.job-list-card.task-card {
  cursor: default;
}

.job-list-card.task-card:active {
  transform: none;
}

.desktop-table {
  display: block;
}

.table-scroll-hint {
  display: none;
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

@media (max-width: 900px) {
  .table-scroll-hint {
    display: none;
  }
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  font-weight: 600;
  background: var(--paper);
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

tbody tr:hover {
  background: rgba(36, 86, 60, 0.04);
}

.mono {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-status {
  background: var(--spruce-soft);
  color: var(--spruce);
}

.badge-expedite {
  background: var(--amber-soft);
  color: #7a5a18;
}

.badge-delivery {
  background: #e4eaf0;
  color: #34506a;
}

.qty {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--ink-soft);
}

/* Capacity bars */
.cap-row {
  display: grid;
  grid-template-columns: 110px 1fr 48px;
  gap: 0.75rem;
  align-items: center;
  margin: 0.35rem 0;
}

.cap-bar {
  height: 8px;
  background: var(--paper);
  border-radius: 999px;
  overflow: hidden;
}

.cap-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--spruce);
  transition: width 0.6s var(--ease);
}

.cap-fill.warn {
  background: var(--amber);
}

.cap-fill.hot {
  background: var(--rose);
}

.cap-sub {
  margin: -0.15rem 0 0.65rem;
  padding-left: calc(110px + 0.75rem);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.capacity-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.25rem;
}

.capacity-chart-inner {
  padding: 1.1rem 1.25rem;
}

.capacity-chart-inner h3 {
  margin: 0 0 0.25rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.capacity-chart-inner .block-note {
  margin: 0 0 1rem;
}

.cap-total {
  font-size: 0.8rem;
}

/* Toggle chips for processing */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink-soft);
}

.chip.done {
  background: var(--spruce-soft);
  color: var(--spruce);
}

/* Logistics stages */
.stage-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stage {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 220px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stage-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stage-count {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--ink);
  color: #fff;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.stage-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.job-card {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: var(--mist);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}

.job-card:hover {
  border-color: var(--spruce);
  transform: translateY(-1px);
}

.job-card h4 {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.job-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

/* Project detail modal */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(12, 18, 14, 0.45);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-root[hidden] {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  animation: fadeUp 0.35s var(--ease);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}

.modal-head h2 {
  margin: 0;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.modal-meta {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.modal-close {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--mist);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.modal-body {
  padding: 1.25rem 1.5rem 1.75rem;
}

.rail-wrap {
  position: relative;
}

.scroll-edge {
  position: relative;
}

.scroll-edge-fade {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.25rem;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.scroll-edge-fade-left {
  left: 0;
  background: linear-gradient(90deg, var(--mist) 35%, transparent);
}

.scroll-edge-fade-right {
  right: 0;
  background: linear-gradient(270deg, var(--mist) 35%, transparent);
}

.scroll-edge-fade-right::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.35rem;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: translateY(-50%) rotate(-45deg);
  opacity: 0.7;
}

.scroll-edge-fade-left::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0.35rem;
  width: 0.45rem;
  height: 0.45rem;
  border-left: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: translateY(-50%) rotate(45deg);
  opacity: 0.7;
}

.tabs-scroll .scroll-edge-fade-left {
  background: linear-gradient(90deg, var(--mist) 45%, transparent);
}

.tabs-scroll .scroll-edge-fade-right {
  background: linear-gradient(270deg, var(--mist) 45%, transparent);
}

.rail-scroll .scroll-edge-fade-left {
  background: linear-gradient(90deg, var(--mist) 40%, transparent);
}

.rail-scroll .scroll-edge-fade-right {
  background: linear-gradient(270deg, var(--mist) 40%, transparent);
}

.rail-now {
  display: none;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin: 0.65rem 0 0.65rem;
  padding: 0.75rem 0.9rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(20, 25, 22, 0.04);
}

.rail-now-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--spruce);
}

.rail-now strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.rail-now-date {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.rail-now-meta {
  width: 100%;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.rail-hint {
  display: none;
}

.rail {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0.35rem 0.5rem 1.25rem;
  margin-bottom: 0.5rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.rail::-webkit-scrollbar {
  display: none;
}

.rail-step {
  flex: 1 0 76px;
  min-width: 76px;
  text-align: center;
  position: relative;
  padding-top: 1.5rem;
}

.rail-step::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--paper-deep, #dfe6dc);
}

.rail-step:first-child::before { left: 50%; }
.rail-step:last-child::before { right: 50%; }

.rail-dot {
  position: absolute;
  top: 0.15rem;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c5d0c8;
  border: 2px solid #fff;
  z-index: 1;
  box-shadow: 0 0 0 1px #c5d0c8;
}

.rail-step.done .rail-dot {
  background: var(--spruce);
  box-shadow: 0 0 0 1px var(--spruce);
}

.rail-step.done::before {
  background: var(--spruce);
}

.rail-step.current .rail-dot {
  background: var(--amber);
  box-shadow: 0 0 0 1px var(--amber), 0 0 0 5px rgba(184, 137, 58, 0.25);
  animation: pulse 1.6s ease infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--amber), 0 0 0 5px rgba(184, 137, 58, 0.2); }
  50% { box-shadow: 0 0 0 1px var(--amber), 0 0 0 8px rgba(184, 137, 58, 0.08); }
}

.rail-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.2;
  padding: 0 0.15rem;
  word-break: break-word;
}

.rail-step.current .rail-label {
  color: var(--ink);
}

.rail-date {
  display: block;
  font-size: 0.62rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
  font-variant-numeric: tabular-nums;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.detail-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: var(--mist);
}

.detail-block h3 {
  margin: 0 0 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1rem;
  font-size: 0.85rem;
}

.kv dt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.kv dd {
  margin: 0.1rem 0 0;
  font-weight: 600;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid #aab5ae;
  flex-shrink: 0;
}

.check.on {
  background: var(--spruce);
  border-color: var(--spruce);
  box-shadow: inset 0 0 0 2px #fff;
}

/* Project detail page */
.project-topbar {
  flex-wrap: wrap;
}

.project-topbar .project-topbar-inner {
  flex: 1;
  min-width: 0;
}

.project-main .topbar {
  align-items: stretch;
}

.project-topbar-inner {
  width: 100%;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 0.85rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--spruce);
}

.project-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  margin-bottom: 0.25rem;
}

.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.project-sub {
  margin: 0.15rem 0 0;
  line-height: 1.4;
}

.project-customer {
  color: var(--ink-soft);
  font-weight: 500;
}

.project-title-row h1 {
  margin: 0;
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.project-root {
  padding-top: 0.5rem;
}

.project-tabs {
  margin-bottom: 1.25rem;
  flex-wrap: nowrap;
}

.split-cards {
  display: none;
  flex-direction: column;
  gap: 0.55rem;
}

.split-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.85rem 0.95rem;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.split-card strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.split-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.split-card-stats em {
  display: block;
  font-style: normal;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.kv-compact {
  gap: 0.55rem 1rem;
}

.kv > div {
  min-width: 0;
}

.sections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.section-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem 1.15rem;
  background: var(--mist);
}

.section-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.section-card-head h3 {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.section-kv {
  margin-bottom: 0.85rem;
}

.section-kv dd {
  font-weight: 500;
  font-size: 0.82rem;
}

.section-qty {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.section-qty strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.detail-grid-wide {
  grid-template-columns: repeat(2, 1fr);
}

.detail-block-wide {
  grid-column: 1 / -1;
}

.block-note {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.note-item {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

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

.note-meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.note-item p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ink-soft);
}

.btn-page {
  display: inline-flex;
  margin-top: 1rem;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.btn-page:hover {
  background: var(--spruce);
}

.side-nav-static {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.side-nav-static a {
  color: inherit;
  text-decoration: none;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.92rem;
  opacity: 0.72;
  transition: background 0.2s, opacity 0.2s;
}

.side-nav-static a:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}

.side-nav-static a:first-child {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

tbody tr[data-id] {
  cursor: pointer;
}

tbody tr[data-id]:hover td:first-child {
  color: var(--spruce);
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(12, 18, 14, 0.45);
  }

  .sidebar-overlay[hidden] {
    display: none;
  }

  body.nav-open {
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 70;
    width: min(280px, 88vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.3s var(--ease);
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: grid;
    place-items: center;
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
  }

  .side-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    overflow-y: auto;
  }

  .side-nav button,
  .side-nav-static a {
    min-height: 2.75rem;
    font-size: 0.95rem;
  }

  .sidebar-foot {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    margin-top: auto;
  }

  .sidebar-toggle {
    display: block;
  }

  .table-scroll-hint {
    display: none;
  }

  .rail-hint {
    display: none;
  }

  .rail-now {
    display: flex;
  }

  .scroll-edge-fade {
    display: block;
  }

  .scroll-edge.can-scroll-left .scroll-edge-fade-left,
  .scroll-edge.can-scroll-right .scroll-edge-fade-right {
    opacity: 1;
  }

  .mobile-tip {
    display: block;
  }

  .job-list,
  .split-cards {
    display: flex;
  }

  .desktop-table {
    display: none !important;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(246, 248, 245, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    padding-top: max(0.65rem, env(safe-area-inset-top));
  }

  .project-topbar {
    gap: 0.35rem;
  }

  .project-topbar .sidebar-toggle {
    align-self: flex-start;
    margin-top: 0.15rem;
  }

  .back-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
  }

  .project-title-row {
    align-items: flex-start;
    gap: 0.45rem 0.55rem;
  }

  .project-title-row h1 {
    font-size: 1.35rem;
    line-height: 1.15;
  }

  .project-badges {
    margin-top: 0.15rem;
  }

  .view-sub.project-sub {
    font-size: 0.88rem;
    margin-bottom: 0;
  }

  .rail-scroll {
    margin: 0 -0.85rem;
  }

  .rail {
    margin-bottom: 0.15rem;
    padding: 0.35rem 0.85rem 1rem;
  }

  .rail-label {
    font-size: 0.7rem;
  }

  .rail-date {
    font-size: 0.68rem;
  }

  .topbar-actions {
    width: 100%;
  }

  .search input {
    width: 100%;
    min-height: 2.75rem;
    font-size: 1rem;
    border-radius: 12px;
  }

  .view-root {
    padding: 0.75rem 0.85rem calc(1.75rem + env(safe-area-inset-bottom));
  }

  .detail-block {
    padding: 0.95rem 1rem;
  }

  .detail-block h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .tabs-scroll {
    margin: 0 -0.85rem 0.85rem;
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(246, 248, 245, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }

  .tabs,
  .project-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.4rem;
    margin: 0;
    padding: 0.35rem 0.85rem 0.55rem;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar,
  .project-tabs::-webkit-scrollbar {
    display: none;
  }

  .tabs button {
    flex: 0 0 auto;
    min-height: 2.75rem;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
  }

  .project-tabs {
    position: static;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    margin-bottom: 0;
  }

  .capacity-layout {
    grid-template-columns: 1fr;
  }

  .stage-cols {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .job-card {
    min-height: 3.5rem;
    padding: 0.9rem 1rem;
  }

  .detail-grid,
  .detail-grid-wide {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

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

  .kv {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .kv > div {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: baseline;
    column-gap: 0.75rem;
  }

  .kv dt {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .kv dd {
    margin: 0;
    text-align: right;
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .kv-compact > div {
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--line);
  }

  .kv-compact > div:last-child {
    padding-bottom: 0;
    border-bottom: none;
  }
}

@media (max-width: 640px) {
  .topbar h1,
  .project-title-row h1 {
    font-size: 1.28rem;
  }

  .view-sub {
    font-size: 0.86rem;
  }

  .project-topbar {
    position: relative;
  }

  .rail-step {
    flex: 0 0 78px;
    min-width: 78px;
  }

  .rail-label {
    font-size: 0.68rem;
  }

  .rail-now strong {
    font-size: 1.12rem;
  }

  .cap-row {
    grid-template-columns: 72px 1fr 40px;
    gap: 0.5rem;
  }

  .cap-sub {
    padding-left: calc(72px + 0.5rem);
  }

  .detail-block {
    padding: 0.9rem;
    border-radius: 12px;
  }

  .btn-page {
    width: 100%;
    justify-content: center;
    min-height: 2.85rem;
  }

  .sidebar-toggle,
  .sidebar-close {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
}
