
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --ink: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --line: #e2e8f0;
  --accent: #0f766e;
  --accent-ink: #134e4a;
  --radius: 16px;
  --shadow: 0 2px 8px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.header {
  background: linear-gradient(135deg, #1f4f91 0%, #2f6ebc 55%, #2f6ebc 100%);
  color: white;
  padding: 28px 40px;
}
.header h1 { margin: 0 0 4px; font-size: 24px; font-weight: 700; }
.header p { margin: 0; opacity: .9; font-size: 13px; max-width: 980px; }

.top-tabs {
  display: flex;
  gap: 0;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.top-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--subtle);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 14px 18px 13px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}
.top-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.preflow {
  padding: 24px 24px 8px;
}
.info-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin: 0 auto 18px;
}
.info-block h2 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.info-block p,
.info-block li {
  font-size: 14px;
  color: #1f2937;
}
.info-block ul,
.info-block ol {
  margin: 10px 0 0;
  padding-left: 20px;
}

.metric-grid,
.focus-grid,
.clarify-grid,
.task-grid,
.approach-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.metric-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.focus-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.clarify-grid { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.task-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.approach-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.metric,
.focus-card,
.clarify-card,
.task-card,
.approach-card {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.metric .kicker,
.focus-card .kicker,
.clarify-card .kicker,
.task-card .kicker,
.approach-card .kicker {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.metric .kicker { background: #d1fae5; color: #065f46; }
.focus-card .kicker { background: #dbeafe; color: #1d4ed8; }
.clarify-card .kicker { background: #fef3c7; color: #92400e; }
.task-card .kicker { background: #ede9fe; color: #6d28d9; }
.approach-card .kicker { background: #fee2e2; color: #b91c1c; }

.metric .value {
  margin-top: 10px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--ink);
}
.metric .sub,
.focus-card .sub,
.clarify-card .sub,
.task-card .sub,
.approach-card .sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--subtle);
  line-height: 1.45;
}
.focus-card .name,
.clarify-card .name,
.task-card .name,
.approach-card .name {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.plan-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.plan-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.plan-step .num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #0f766e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.plan-step .name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.plan-step .sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--subtle);
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.reference-card {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.reference-shot {
  display: block;
  background: #eef2f7;
  padding: 12px;
}

.reference-shot:hover {
  text-decoration: none;
}

.reference-shot img {
  width: 100%;
  height: 420px;
  object-fit: contain;
  display: block;
  box-sizing: border-box;
  padding: 14px 0;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}

.reference-body {
  padding: 14px 14px 16px;
}

.reference-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}

.reference-title {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.reference-desc {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--subtle);
}

.reference-section + .reference-section {
  margin-top: 24px;
}

.reference-section-head {
  margin-bottom: 14px;
}

.reference-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #d1fae5;
  color: #065f46;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.reference-section-title {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.reference-section-intro {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--subtle);
}

.flow-note {
  margin: 24px 24px 18px;
  padding: 14px 16px;
  background: #ecfeff;
  border: 1px solid #bae6fd;
  border-radius: 14px;
  color: #0f172a;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.legend .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #edf2f7;
}
.legend .pill .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.flow { padding: 24px 24px 80px; }
.lane {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin: 18px auto;
  padding: 18px 18px 22px 24px;
}
.lane-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.lane-head .stripe {
  width: 6px;
  height: 22px;
  border-radius: 3px;
}
.lane-head h2 {
  margin: 0;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.lane-head .count {
  font-size: 11px;
  color: var(--subtle);
}

.node-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  row-gap: 28px;
}
.connector.wrap-hidden { visibility: hidden; }
.connector {
  flex: 0 0 auto;
  align-self: center;
  width: 28px;
  height: 36px;
  position: relative;
}
.connector::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 7px;
  height: 2px;
  background: #cbd5e0;
  transform: translateY(-50%);
}
.connector::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-left-color: #94a3b8;
  transform: translateY(-50%);
}

.node {
  position: relative;
  flex: 0 0 auto;
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.node:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .1), 0 2px 6px rgba(15, 23, 42, .06);
  border-color: var(--accent);
  text-decoration: none;
}
.node-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  min-height: 74px;
}
.node-num {
  flex: 0 0 auto;
  min-width: 28px;
  height: 24px;
  padding: 0 7px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .04em;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.node-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.node-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.node-body p {
  margin: 0;
  font-size: 12px;
  color: var(--subtle);
  line-height: 1.45;
}
.node-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.chip.strong {
  background: #dbeafe;
  color: #1d4ed8;
}

.lane-drop {
  position: relative;
  height: 42px;
  margin: -4px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}
.lane-drop::before {
  content: '';
  width: 2px;
  height: 100%;
  background: #cbd5e0;
}
.lane-drop::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-top-color: #94a3b8;
}
.lane-drop .drop-label {
  position: absolute;
  left: calc(50% + 12px);
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--subtle);
  white-space: nowrap;
  background: var(--bg);
  padding: 0 6px;
}

.container { max-width: 1240px; margin: 0 auto; padding: 24px 40px 80px; }
.detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  font-size: 13px;
  color: var(--muted);
}
.detail-nav .crumbs a { color: var(--muted); }
.detail-nav .pn { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.detail-nav .pn a { color: var(--accent); }
.detail-nav .wf-cta {
  background: var(--accent);
  color: #fff !important;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
}
.detail-nav .wf-cta:hover {
  background: #134e4a;
  text-decoration: none;
}

.top-level-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: #0f766e;
  color: #fff !important;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .18);
  font-size: 13px;
  font-weight: 700;
}

.top-level-fab:hover {
  background: #134e4a;
  text-decoration: none;
}

.detail {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-top: 10px;
}
.detail h1 { margin: 0 0 8px; font-size: 22px; color: var(--ink); }
.detail h2 {
  margin: 22px 0 6px;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.detail h3 { margin: 18px 0 4px; font-size: 13px; color: var(--ink); }
.detail p, .detail li { font-size: 14px; color: #1f2937; }
.detail ul, .detail ol { padding-left: 20px; }
.detail code {
  background: #edf2f7;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}

.screenshot-wrap {
  position: sticky;
  top: 20px;
  align-self: flex-start;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.screenshot-wrap img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  cursor: zoom-in;
}
.screenshot-wrap .zoom-hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--subtle);
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 16, 28, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  user-select: none;
}
.lightbox .lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 300;
  border: 1px solid rgba(255,255,255,.2);
  cursor: pointer;
}
.lightbox .lb-close:hover { background: rgba(255,255,255,.22); }

@media (max-width: 960px) {
  .detail { grid-template-columns: 1fr; }
  .top-tabs { padding: 0 12px; overflow-x: auto; }
  .top-tab { white-space: nowrap; }
  .header { padding: 24px 20px; }
  .legend { padding: 12px 16px; }
  .preflow { padding: 16px 16px 8px; }
  .flow-note { margin: 16px 16px 0; }
  .flow { padding: 16px 16px 64px; }
  .container { padding: 20px 20px 64px; }
  .detail-nav { flex-direction: column; align-items: flex-start; }
}
