/* ============================================================
   Feeds & SFTP page — template builder, terminal, scheduler
============================================================ */

:root {
  --fds: #4E7D5B;        /* forest green for feeds */
  --fds-tint: color-mix(in srgb, #4E7D5B 14%, transparent);
}

/* shared subnav */
.subnav {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 65px;
  z-index: 40;
}
.subnav-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px var(--pad-x);
  overflow-x: auto;
}
.subnav-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.subnav-inner a {
  text-decoration: none;
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
  padding: 4px 0;
}
.subnav-inner a:hover { color: var(--ink); }
.subnav-inner a.active {
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 2px;
}

.kicker.fds { background: var(--fds-tint); border-color: rgba(78,125,91,0.4); color: #93BFA1; }
.kicker .dot.fds { background: var(--fds); box-shadow: 0 0 0 3px rgba(78,125,91,0.22); }
.hero-fds .display { font-size: clamp(54px, 8.6vw, 112px); line-height: 0.94; }

/* ============================================================
   HERO PEEK — template builder + delivery terminal
============================================================ */
.fb-split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg-card);
}
@media (max-width: 860px){ .fb-split { grid-template-columns: 1fr; } }

.fb-build { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.fb-h {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.fb-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}
.fb-src, .fb-dst {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fb-src { background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); }
.fb-dst { background: var(--fds-tint); border: 1px solid rgba(78,125,91,0.35); color: var(--fds); }
.fb-fn {
  font-family: var(--f-mono);
  font-size: 9.5px;
  padding: 4px 7px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--fds) 16%, transparent);
  color: var(--fds);
  white-space: nowrap;
}
.fb-formats { display: flex; gap: 7px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
.fb-fmt {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 5px 11px;
  border-radius: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
}
.fb-fmt.on { background: var(--fds-tint); border-color: rgba(78,125,91,0.35); color: var(--fds); font-weight: 500; }

.fb-term {
  background: #101210;
  border-left: 1px solid var(--line);
  padding: 18px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  line-height: 1.85;
  color: rgba(255,255,255,0.55);
  overflow-x: auto;
}
@media (max-width: 860px){ .fb-term { border-left: none; border-top: 1px solid var(--line); } }
.fb-term .tl-dots { display: flex; gap: 6px; margin-bottom: 12px; }
.fb-term .tl-dots i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
}
.fb-term .cmd { color: rgba(255,255,255,0.85); }
.fb-term .dim2 { color: rgba(255,255,255,0.35); }
.fb-term .okc { color: #6ED27A; }
.fb-term .w { color: rgba(255,255,255,0.85); }
.fb-term .cursor {
  display: inline-block;
  width: 7px; height: 13px;
  background: rgba(255,255,255,0.6);
  vertical-align: middle;
  animation: curBlink 1.1s steps(1) infinite;
}
@keyframes curBlink { 50% { opacity: 0; } }

/* ============================================================
   STAT STRIP
============================================================ */
.fds-trust { padding: 50px 0 30px; }
.trust-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 4vw, 60px);
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
@media (max-width: 720px){ .trust-stats { grid-template-columns: 1fr 1fr; gap: 30px; } }
.ts { display: flex; flex-direction: column; gap: 6px; }
.ts b {
  font-weight: 500;
  font-size: clamp(34px, 4.2vw, 52px);
  letter-spacing: -0.035em;
  line-height: 1;
}
.ts span { font-size: 13.5px; color: var(--muted); }

/* ============================================================
   TEMPLATE BUILDER VISUAL (two-col section)
============================================================ */
.tpl-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.tpl-card .fb-row { grid-template-columns: 1fr auto 1fr; }
.tpl-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* ============================================================
   FORMATS GRID
============================================================ */
.fmt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 980px){ .fmt-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px){ .fmt-grid { grid-template-columns: 1fr; } }
.fmt-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.fmt-badge {
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--fds-tint);
  color: var(--fds);
  border: 1px solid rgba(78,125,91,0.3);
}
.fmt-card p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.fmt-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 6px; }
.fmt-chip {
  font-family: var(--f-mono);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--muted);
}

/* ============================================================
   SCHEDULER (dark)
============================================================ */
.sched-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  position: relative;
}
.sched-card::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.012) 0 2px, transparent 2px 6px);
  pointer-events: none;
}
.sc-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--line-light);
  position: relative;
}
.sc-name { font-family: var(--f-mono); font-size: 12px; color: rgba(255,255,255,0.85); }
.sc-conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #6ED27A;
}
.sc-conn i {
  width: 7px; height: 7px;
  background: #6ED27A;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(110,210,122,0.20);
  animation: pulse 1.4s ease-in-out infinite;
}
.sc-row {
  display: grid;
  grid-template-columns: 110px 1.4fr 1.4fr auto;
  gap: 14px;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  position: relative;
}
.cd.feed { background: #4A4A45; border-color: #4A4A45; }
.cd.feed::before { content: "≡"; color: #fff; font-weight: 700; font-size: 10px; position: absolute; inset: 0; display: grid; place-items: center; }
.sc-row:last-child { border-bottom: none; }
.sc-row.warn { background: rgba(180,122,18,0.06); }
.sc-row.dim { color: rgba(255,255,255,0.45); border-style: dashed; }
.sc-time { color: rgba(255,255,255,0.65); }
.sc-feed { display: inline-flex; align-items: center; gap: 8px; }
.sc-tgt { color: rgba(255,255,255,0.55); }
@media (max-width: 720px){
  .sc-row { grid-template-columns: 1fr auto; gap: 6px; padding: 10px 14px; }
  .sc-row .sc-tgt { display: none; }
}

/* ============================================================
   SFTP DELIVERY LOG VISUAL
============================================================ */
.dlv-card {
  width: 100%;
  max-width: 460px;
  background: #101210;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 16px 18px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  line-height: 2;
  color: rgba(255,255,255,0.55);
  overflow-x: auto;
}
.dlv-card .t { color: rgba(255,255,255,0.35); }
.dlv-card .verb { color: rgba(255,255,255,0.75); }
.dlv-card .w { color: rgba(255,255,255,0.9); }
.dlv-card .okc { color: #6ED27A; }
.dlv-rcpt {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,0.12);
  color: #6ED27A;
}

/* ============================================================
   OPS GRID (delta + health)
============================================================ */
.ops-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 860px){ .ops-grid { grid-template-columns: 1fr; } }
.ops-card { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.ops-card h4 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.018em; }
.ops-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.55; }

.delta-meter { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.dm-top {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
}
.dm-top .mono { color: var(--fds); }
.dm-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(var(--ink-rgb),0.08);
  overflow: hidden;
}
.dm-bar > span { display: block; height: 100%; width: 2.6%; min-width: 8px; background: var(--fds); border-radius: 3px; }
.dm-note { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }

.run-rows { display: flex; flex-direction: column; margin-top: auto; }
.run-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12px;
}
.run-row:last-child { border-bottom: none; }
.run-row .mono { font-size: 11px; color: var(--muted); }
.run-row .retry { color: var(--warn); font-family: var(--f-mono); font-size: 10.5px; }

/* light tick variant */
.tick.light li { color: rgba(255,255,255,0.78); }
.tick.light li::before { background: var(--bg-card); }
.tick.light li::after { border-color: var(--ink); }

/* ============================================================
   COMPARE
============================================================ */
.compare-table { padding: 0; overflow: hidden; }
.cmp-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.cmp-row:last-child { border-bottom: none; }
.cmp-row > span { display: inline-flex; align-items: center; gap: 8px; }
.cmp-row .hl {
  background: rgba(var(--ink-rgb),0.04);
  margin: -16px 0;
  padding: 16px 14px;
  font-weight: 500;
}
.cmp-row.cmp-head {
  background: var(--bg-soft);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 24px;
}
.cmp-row.cmp-head .hl {
  background: var(--ink);
  color: var(--bg);
  margin: -14px 0;
  padding: 14px 14px;
}
.cmp-row .dim { color: var(--muted-2); }
.cmp-row .dim.partial { color: var(--warn); }
.cmp-row .dt { width: 9px; height: 9px; }
.cmp-foot {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  margin: 32px auto 0;
  max-width: 720px;
}
@media (max-width: 720px){
  .cmp-row { grid-template-columns: 1.4fr 1fr 1fr 1fr; padding: 12px 14px; font-size: 12.5px; }
  .cmp-row.cmp-head { padding: 12px 14px; }
  .cmp-row .hl { padding: 12px 8px; margin: -12px 0; }
}

.foot-cols a.on { color: #fff; }

/* ── White mode (html[data-theme="light"]) overrides ── */
html[data-theme="light"] {
  --fds-tint: #E7EFE9;
}
html[data-theme="light"] .kicker.fds {
  border-color: rgba(78,125,91,0.25);
  color: #2C5238;
}
html[data-theme="light"] .fb-term,
html[data-theme="light"] .dlv-card { background: #16181A; }
