/* Container architecture — compact viewport fit, value labels on tiles */
.arch-section { background: linear-gradient(180deg, #060912 0%, #0c1224 50%, #0a0f1c 100%); color: #e8ecf5; padding: 64px 0 80px; }
.arch-section.arch-fit { padding: 12px 0 16px; }
.arch-section.arch-fit .container { max-width: 1280px; }
.arch-section.arch-fit h2 { font-size: 1.35rem; margin-bottom: 4px; }
.arch-section.arch-fit .eyebrow { margin-bottom: 4px; }
.arch-lead-compact { font-size: .82rem !important; max-width: 100% !important; margin-bottom: 12px !important; line-height: 1.4; }

.arch-section .eyebrow { color: #5b9dff; }
.arch-section h2 { color: #fff; }
.arch-section .lead { color: #9aa8c4; max-width: 72ch; }

.arch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: stretch;
  height: calc(100vh - 220px);
  min-height: 460px;
  max-height: 720px;
}
@media (max-width: 1100px) {
  .arch-layout { grid-template-columns: 1fr; max-height: none; }
}

.arch-diagram {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}

/* ── Swimlane rows ── */
.arch-swimlane {
  position: relative;
  border-radius: 10px;
  padding: 4px 8px 4px 10px;
  margin-bottom: 0;
  border-left: 3px solid transparent;
  transition: box-shadow .35s ease, background .35s ease, border-color .35s ease;
  flex: 1;
  min-height: 0;
}
.arch-swimlane.swimlane-active {
  box-shadow: 0 0 0 1px rgba(91,157,255,.35), 0 8px 32px rgba(0,0,0,.35);
}

.swimlane-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: .5rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .4;
  pointer-events: none;
}

.arch-layer {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}
.arch-layer-label { text-align: right; padding-top: 6px; }
.layer-ico { width: 22px; height: 22px; margin-bottom: 3px; }
.arch-layer-label strong { font-size: .65rem; }
.arch-layer-label small { font-size: .58rem; }

.arch-zone {
  border: 1px solid rgba(255,255,255,.08);
  padding: 4px;
  border-radius: 8px;
  transition: border-color .3s, box-shadow .3s;
}
.arch-swimlane.swimlane-active .arch-zone {
  border-color: rgba(91,157,255,.4);
  box-shadow: 0 0 16px rgba(91,157,255,.1);
}

.arch-tile.channel-interactive { cursor: pointer; }

.arch-tile {
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  padding: 5px 3px;
  font-size: .58rem;
  white-space: normal;
  line-height: 1.15;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.t-name { font-weight: 700; color: #e8ecf5; display: block; transition: opacity .2s; }
.t-val {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 4px 3px;
  font-size: .5rem; font-weight: 600; color: #dce8ff; line-height: 1.25;
  background: rgba(8, 14, 32, .94);
  border-radius: 7px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.arch-tile.highlight .t-val { opacity: 1; }
.arch-tile.highlight .t-name { opacity: 0; }
.arch-tile.highlight.channel .channel-logo { opacity: .15; filter: grayscale(1); }
.arch-tile.channel { padding: 6px 3px; gap: 3px; }
.arch-tile.channel .channel-logo { width: 22px; height: 22px; flex: none; object-fit: contain; }
.arch-tile.channel .t-name { font-size: .56rem; }
.arch-tile.channel .t-val { font-size: .48rem; }
.arch-connector { display: none; }
.arch-hint-compact { margin-top: 8px; padding: 8px 12px; font-size: .72rem; }
.arch-footer-compact { display: none; }

/* Layer-specific swimlane treatments */
.swimlane-channels {
  border-left-color: #5b9dff;
  background: linear-gradient(90deg, rgba(91,157,255,.1) 0%, rgba(91,157,255,.02) 100%);
}
.swimlane-channels .arch-zone { border-color: rgba(91,157,255,.2); }

.swimlane-gateway {
  border-left-color: #2d7cff;
  background:
    repeating-linear-gradient(90deg, rgba(45,124,255,.04) 0, rgba(45,124,255,.04) 1px, transparent 1px, transparent 24px),
    linear-gradient(90deg, rgba(45,124,255,.08) 0%, transparent 100%);
}
.swimlane-gateway .arch-zone {
  border: 1px dashed rgba(45,124,255,.35);
  background: rgba(45,124,255,.04);
}

.swimlane-orchestrator {
  border-left-color: #6d4bff;
  background:
    radial-gradient(ellipse 80% 120% at 50% 50%, rgba(109,75,255,.18) 0%, transparent 70%),
    linear-gradient(90deg, rgba(109,75,255,.12) 0%, rgba(45,124,255,.06) 100%);
}
.swimlane-orchestrator .arch-zone {
  border: 1px solid rgba(109,75,255,.45);
  background: linear-gradient(135deg, rgba(109,75,255,.2), rgba(45,124,255,.12));
  box-shadow: inset 0 0 40px rgba(109,75,255,.08);
}

.swimlane-skills {
  border-left-color: #16c6c2;
  background: linear-gradient(90deg, rgba(22,198,194,.08) 0%, rgba(109,75,255,.04) 50%, rgba(45,124,255,.04) 100%);
}
.swimlane-skills .arch-zone { border-color: rgba(22,198,194,.25); }

.swimlane-data {
  border-left-color: #3b82f6;
  background:
    repeating-linear-gradient(0deg, rgba(59,130,246,.03) 0, rgba(59,130,246,.03) 1px, transparent 1px, transparent 10px),
    linear-gradient(90deg, rgba(59,130,246,.08) 0%, transparent 100%);
}
.swimlane-data .arch-zone {
  border-color: rgba(59,130,246,.28);
  background: rgba(59,130,246,.05);
}

.swimlane-surfaces {
  border-left-color: #2bd07a;
  background: linear-gradient(90deg, rgba(43,208,122,.1) 0%, rgba(43,208,122,.02) 100%);
}
.swimlane-surfaces .arch-zone { border-color: rgba(43,208,122,.28); }

/* Active swimlane glow per layer */
.swimlane-channels.swimlane-active { border-left-color: #5b9dff; background: linear-gradient(90deg, rgba(91,157,255,.18), rgba(91,157,255,.04)); }
.swimlane-gateway.swimlane-active { border-left-color: #2d7cff; background: linear-gradient(90deg, rgba(45,124,255,.16), rgba(45,124,255,.04)); }
.swimlane-orchestrator.swimlane-active { border-left-color: #8b6dff; box-shadow: 0 0 40px rgba(109,75,255,.2), inset 0 0 60px rgba(109,75,255,.06); }
.swimlane-skills.swimlane-active { border-left-color: #16c6c2; }
.swimlane-data.swimlane-active { border-left-color: #60a5fa; }
.swimlane-surfaces.swimlane-active { border-left-color: #2bd07a; }

/* ── Layer grid (shared) ── */
.layer-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  margin-left: auto;
  color: #9ec5ff;
}
.layer-ico svg { display: block; }

.arch-tiles {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: stretch;
  width: 100%;
}

.arch-tile.channel-interactive:hover {
  border-color: rgba(91,157,255,.5);
  background: rgba(91,157,255,.12);
  transform: translateY(-1px);
}
.arch-tile.channel-interactive.active {
  border-color: var(--arch-accent, #25d366);
  background: color-mix(in srgb, var(--arch-accent, #25d366) 18%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--arch-accent, #25d366) 30%, transparent);
}

.arch-tile.channel-static {
  opacity: .55;
  cursor: default;
  filter: grayscale(.15);
}

.arch-tile.highlight {
  border-color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.14);
  box-shadow: 0 0 20px rgba(91,157,255,.25);
  animation: archpulse 1.2s ease infinite;
  z-index: 1;
}
.arch-tile.core { background: rgba(255,255,255,.08); border-color: rgba(180,160,255,.35); }
.arch-tile.sell { border-color: rgba(109,75,255,.45); color: #c4b5ff; }
.arch-tile.support { border-color: rgba(22,198,194,.45); color: #7ee8e5; }
.arch-tile.scale { border-color: rgba(45,124,255,.45); color: #9ec5ff; }
.arch-tile.surface { border-color: rgba(43,208,122,.4); color: #8ef0bc; }

@keyframes archpulse { 0%,100% { box-shadow: 0 0 12px rgba(91,157,255,.15); } 50% { box-shadow: 0 0 28px rgba(91,157,255,.35); } }

/* Vertical flow connectors — hidden in compact viewport fit */
.arch-section.arch-fit .arch-connector { display: none !important; }

.arch-connector {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  min-width: 960px;
  padding: 0 12px;
  align-items: center;
}
.connector-line {
  grid-column: 2;
  height: 14px;
  border-left: 2px solid rgba(91,157,255,.25);
  margin-left: 50%;
  width: 0;
}
.connector-arrow {
  grid-column: 2;
  text-align: center;
  color: #4a5672;
  font-size: .85rem;
  line-height: 1;
  margin-top: -6px;
}

.arch-hint {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(91,157,255,.08);
  border: 1px dashed rgba(91,157,255,.35);
  color: #b8d4ff;
  font-size: .84rem;
}

/* ── Flow panel (sticky sidebar) ── */
.arch-flow-panel {
  background: #0f1528;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}

.arch-flow-main { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.arch-flow-head {
  padding: 16px 20px;
  background: linear-gradient(135deg, #128c7e, #075e54);
  display: flex;
  align-items: center;
  gap: 14px;
}
.arch-flow-head .channel-av {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 6px;
  flex: none;
}
.arch-flow-head .channel-av img { width: 100%; height: 100%; object-fit: contain; }
.arch-flow-head .wa-title { font-weight: 700; font-size: .95rem; }
.arch-flow-head .wa-sub { font-size: .76rem; opacity: .85; }

.arch-flow-body {
  padding: 10px 12px;
  flex: 1;
  min-height: 80px;
  overflow-y: auto;
  background: #0b1419;
}

/* Full-panel offer surface — covers chat until conversation starts */
.arch-offer-surf {
  position: absolute; inset: 0; z-index: 5;
  background: #0b1419;
  display: none; flex-direction: column;
  overflow-y: auto; padding: 10px;
  animation: flowin .35s ease both;
}
.arch-offer-surf.visible { display: flex; }
.arch-offer-surf .aos-img { height: 120px; border-radius: 12px; background-size: cover; background-position: center; margin-bottom: 10px; position: relative; }
.arch-offer-surf .aos-badge { position: absolute; top: 8px; left: 8px; font-size: .62rem; font-weight: 700; padding: .2rem .5rem; border-radius: 999px; background: rgba(37,211,102,.9); color: #fff; }
.arch-offer-surf .aos-title { font-weight: 800; font-size: .92rem; color: #e9edef; margin-bottom: 4px; line-height: 1.25; }
.arch-offer-surf .aos-price { font-weight: 800; font-size: .95rem; color: #25d366; margin-bottom: 8px; }
.arch-offer-surf .aos-price s { color: #8696a0; font-weight: 500; font-size: .78rem; margin-right: 5px; }
.arch-offer-surf .aos-feats { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 5px; }
.arch-offer-surf .aos-feats li { font-size: .72rem; color: #aebac1; display: flex; gap: 6px; line-height: 1.3; }
.arch-offer-surf .aos-feats li::before { content: "✓"; color: #25d366; font-weight: 800; flex: none; }
.arch-offer-surf .aos-promo { font-size: .7rem; padding: 7px 9px; border-radius: 10px; background: rgba(37,211,102,.12); border: 1px dashed rgba(37,211,102,.4); color: #b8f0d0; margin-bottom: 10px; line-height: 1.35; }
.arch-offer-surf .aos-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: auto; }
.arch-offer-surf .aos-btn { border: none; border-radius: 999px; padding: .5rem .4rem; font-weight: 700; font-size: .72rem; cursor: default; font-family: inherit; }
.arch-offer-surf .aos-btn.cart { background: rgba(255,255,255,.1); color: #e9edef; border: 1px solid rgba(255,255,255,.15); }
.arch-offer-surf .aos-btn.checkout { background: #25d366; color: #fff; }
.arch-offer-surf .aos-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: #8696a0; margin-bottom: 8px; font-weight: 700; }
.arch-flow-step.visible { display: block; animation: flowin .35s ease both; }
@keyframes flowin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.arch-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: .82rem; line-height: 1.45; margin-bottom: 8px; white-space: pre-line; }
.arch-msg.user { margin-left: auto; background: var(--arch-user-bg, #005c4b); color: #e9edef; border-bottom-right-radius: 4px; }
.arch-msg.bot { background: #1f2c34; color: #e9edef; border-bottom-left-radius: 4px; }
.arch-msg.system { background: rgba(91,157,255,.15); border: 1px solid rgba(91,157,255,.3); color: #b8d4ff; font-size: .78rem; margin: 10px auto; text-align: center; max-width: 100%; }

.arch-layer-note { font-size: .72rem; color: #7a8aa8; padding: 8px 12px; background: rgba(0,0,0,.25); border-radius: 10px; margin-bottom: 8px; border-left: 3px solid var(--arch-accent, #5b9dff); }

.arch-flow-foot { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; gap: 8px; align-items: center; }
.arch-progress { flex: 1; height: 4px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; }
.arch-progress-bar { height: 100%; border-radius: 999px; width: 0%; transition: width .4s ease; }
.arch-flow-btn { border: none; background: rgba(255,255,255,.1); color: #fff; border-radius: 999px; padding: .45rem .85rem; font-size: .78rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.arch-flow-btn:hover { filter: brightness(1.08); }
.arch-flow-btn.primary { color: #fff; }

.arch-footer-row { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); }
.arch-footer-item { display: flex; align-items: center; gap: 10px; font-size: .84rem; color: #9aa8c4; }

@media (max-width: 900px) {
  .arch-layout { height: auto; max-height: none; }
  .arch-tile { font-size: .55rem; }
}
