.architecture-process {
  --process-cyan: #35d5df;
  --process-cyan-soft: rgba(53, 213, 223, 0.14);
  --process-violet: #a98cff;
  --process-violet-soft: rgba(169, 140, 255, 0.14);
  --process-amber: #f0b94d;
  --process-amber-soft: rgba(240, 185, 77, 0.14);
  --process-green: #5edbb5;
  --process-green-soft: rgba(94, 219, 181, 0.13);
  margin: 2rem 0;
  padding: clamp(1rem, 2.4vw, 1.75rem);
  overflow: hidden;
  border: 1px solid rgba(121, 173, 194, 0.22);
  border-radius: 1.5rem;
  color: #eaf9ff;
  background:
    radial-gradient(circle at 92% 8%, rgba(53, 213, 223, 0.13), transparent 31%),
    radial-gradient(circle at 5% 96%, rgba(169, 140, 255, 0.11), transparent 34%),
    linear-gradient(145deg, #071523 0%, #0a1d2d 54%, #0c2031 100%);
  box-shadow: 0 1.2rem 3rem rgba(4, 21, 32, 0.16);
}

.architecture-process__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.architecture-process__head div {
  min-width: 0;
}

.architecture-process__head span,
.process-node__zone,
.process-step > span,
.process-destination > span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--process-cyan);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.25;
  text-transform: uppercase;
}

.architecture-process__head h3 {
  margin: 0;
  max-width: 36rem;
  color: #fff;
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  line-height: 1.08;
}

.architecture-process__head p {
  max-width: 25rem;
  margin: 0;
  color: #a8c3d1;
  font-size: 0.82rem;
  line-height: 1.55;
  text-align: right;
}

.architecture-process figcaption {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(132, 183, 202, 0.19);
  color: #a8c3d1;
  font-size: 0.78rem;
  line-height: 1.55;
}

.key-custody-map {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) 6rem minmax(0, 1.4fr) 6rem minmax(0, 1.25fr);
  align-items: stretch;
  gap: 0.75rem;
}

.process-node,
.process-output,
.process-step,
.process-destination,
.verification-gate span {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(141, 187, 204, 0.2);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.055);
}

.process-node {
  padding: 1rem;
}

.process-node > strong {
  display: block;
  color: #fff;
  font-size: 1rem;
  line-height: 1.25;
}

.process-node > p,
.process-storage-layer p,
.process-storage-output p,
.process-step p,
.process-destination p {
  margin: 0.45rem 0 0;
  color: #b5ccd7;
  font-size: 0.74rem;
  line-height: 1.5;
}

.process-node--portable {
  border-color: rgba(240, 185, 77, 0.42);
  background: linear-gradient(145deg, var(--process-amber-soft), rgba(255, 255, 255, 0.035));
}

.process-node--browser {
  border-color: rgba(53, 213, 223, 0.48);
  box-shadow: inset 0 0 0 1px rgba(53, 213, 223, 0.08);
}

.process-node--outputs {
  display: grid;
  gap: 0.65rem;
  padding: 0;
  border: 0;
  background: none;
}

.process-output-stack {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.process-output {
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
}

.process-output > span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--process-cyan);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.process-output > strong {
  display: block;
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.3;
}

.process-output > p {
  margin: 0.35rem 0;
  color: #b5ccd7;
  font-size: 0.68rem;
  line-height: 1.4;
}

.process-output > b {
  color: #9dbac7;
  font-size: 0.62rem;
  line-height: 1.35;
}

.process-output--storage {
  border-color: rgba(94, 219, 181, 0.3);
  background: var(--process-green-soft);
}

.process-output--share {
  border-color: rgba(169, 140, 255, 0.3);
  background: var(--process-violet-soft);
}

.process-node--browser > small {
  display: block;
  margin-top: 0.7rem;
  color: #86a8b6;
  font-size: 0.65rem;
  line-height: 1.45;
}

.process-boundary-note {
  display: flex;
  gap: 0.7rem;
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px dashed rgba(53, 213, 223, 0.35);
  border-radius: 0.8rem;
  color: #b6ced8;
  background: rgba(53, 213, 223, 0.06);
  font-size: 0.7rem;
  line-height: 1.45;
}

.process-boundary-note b {
  flex: 0 0 auto;
  color: var(--process-cyan);
}

.process-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 0;
  color: #8caebb;
  font-size: 0.62rem;
  line-height: 1.3;
  text-align: center;
}

.process-connector i {
  position: relative;
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--process-cyan), transparent);
}

.process-connector i::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-top: 1px solid var(--process-cyan);
  border-right: 1px solid var(--process-cyan);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.process-storage-layer,
.process-storage-output {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.8rem;
  background: rgba(53, 213, 223, 0.075);
}

.process-storage-layer--memory {
  background: rgba(169, 140, 255, 0.09);
}

.process-storage-layer b,
.process-storage-output b {
  display: block;
  color: #eefaff;
  font-size: 0.76rem;
  line-height: 1.35;
}

.process-storage-layer ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem 0.8rem;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
}

.process-storage-layer li {
  color: #b9cfda;
  font-size: 0.7rem;
  line-height: 1.35;
}

.process-storage-layer li::before {
  color: var(--process-violet);
  content: "+ ";
}

.process-storage-output {
  margin: 0;
  border: 1px solid rgba(141, 187, 204, 0.17);
  background: rgba(255, 255, 255, 0.05);
}

.process-storage-output--peer {
  border-color: rgba(94, 219, 181, 0.3);
  background: var(--process-green-soft);
}

.process-storage-output--share {
  border-color: rgba(169, 140, 255, 0.3);
  background: var(--process-violet-soft);
}

.process-badge {
  display: inline-flex;
  margin-top: 0.7rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  color: #d8f9ef;
  background: rgba(94, 219, 181, 0.13);
  font-size: 0.64rem;
  line-height: 1.2;
}

.process-badge--danger {
  color: #ffe3aa;
  background: rgba(240, 185, 77, 0.15);
}

.process-note {
  display: block;
  margin-top: 0.65rem;
  color: #88a8b6;
  font-size: 0.67rem;
  font-style: normal;
  line-height: 1.45;
}

.process-step-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.process-zone {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  color: #8db0bf;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.process-zone::after {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(53, 213, 223, 0.45), transparent);
  content: "";
}

.process-step {
  min-height: 10rem;
  padding: 0.9rem;
  overflow: hidden;
}

.process-step::after {
  position: absolute;
  top: 50%;
  right: -0.72rem;
  z-index: 3;
  width: 1.4rem;
  height: 1.4rem;
  border: 1px solid rgba(53, 213, 223, 0.42);
  border-radius: 50%;
  color: var(--process-cyan);
  background: #0a1b2a;
  content: ">";
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.25rem;
  text-align: center;
}

.process-step:nth-child(4n)::after,
.process-step:last-child::after {
  display: none;
}

.process-step > b {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 0.65rem;
  color: #05202c;
  background: var(--process-cyan);
  font-size: 0.7rem;
}

.process-step > strong,
.process-destination > strong {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.3;
}

.process-step--key > b,
.process-step--manifest > b {
  color: #17112d;
  background: var(--process-violet);
}

.process-step--compression > b,
.process-step--coding > b {
  color: #2b1b00;
  background: var(--process-amber);
}

.process-step--network > b {
  color: #05231a;
  background: var(--process-green);
}

.process-destinations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.process-destination-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.process-destination-row > span {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid rgba(94, 219, 181, 0.27);
  border-radius: 0.8rem;
  color: #b6d1da;
  background: var(--process-green-soft);
  font-size: 0.68rem;
  line-height: 1.4;
}

.process-destination-row > span:last-child {
  border-color: rgba(169, 140, 255, 0.28);
  background: var(--process-violet-soft);
}

.process-destination-row b {
  display: block;
  margin-bottom: 0.2rem;
  color: #f3fbff;
}

.process-destination {
  padding: 0.9rem;
  border-color: rgba(94, 219, 181, 0.28);
  background: var(--process-green-soft);
}

.process-destination--control {
  border-color: rgba(169, 140, 255, 0.28);
  background: var(--process-violet-soft);
}

.crypto-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.crypto-role-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.crypto-role-legend span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.65rem;
  border-radius: 0.7rem;
  color: #b8cfda;
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.65rem;
  line-height: 1.35;
}

.crypto-role-legend b { color: #f3fbff; }

.crypto-role-legend i {
  flex: 0 0 auto;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--process-cyan);
}

.crypto-role-legend .is-signature { background: var(--process-violet); }
.crypto-role-legend .is-integrity { background: var(--process-green); }
.crypto-role-legend .is-coding { background: var(--process-amber); }

.crypto-legend span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.65rem;
  border-radius: 0.7rem;
  color: #b8cfda;
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.65rem;
  line-height: 1.35;
}

.crypto-legend b {
  color: #f3fbff;
}

.crypto-legend i {
  flex: 0 0 auto;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--process-cyan);
}

.crypto-legend .is-signing { background: var(--process-violet); }
.crypto-legend .is-integrity { background: var(--process-green); }
.crypto-legend .is-coding { background: var(--process-amber); }

.verification-gate {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.verification-gate span {
  padding: 0.85rem;
  color: #b9d5cb;
  border-color: rgba(94, 219, 181, 0.32);
  background: var(--process-green-soft);
  font-size: 0.72rem;
  line-height: 1.4;
}

.verification-gate b {
  display: block;
  margin-bottom: 0.2rem;
  color: #effff9;
}

.verification-gate .is-failed {
  color: #d7c6a4;
  border-color: rgba(240, 185, 77, 0.3);
  background: var(--process-amber-soft);
}

.security-key-flow__image svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 1100px) {
  .key-custody-map {
    grid-template-columns: 1fr;
  }

  .process-connector {
    min-height: 2.5rem;
  }

  .process-connector i {
    width: 1px;
    height: 1.5rem;
    background: linear-gradient(180deg, transparent, var(--process-cyan), transparent);
  }

  .process-connector i::after {
    top: auto;
    right: 50%;
    bottom: 0;
    transform: translateX(50%) rotate(135deg);
  }
}

@media (max-width: 820px) {
  .architecture-process__head {
    display: block;
  }

  .architecture-process__head p {
    margin-top: 0.65rem;
    text-align: left;
  }

  .process-step-grid,
  .crypto-legend,
  .crypto-role-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-step:nth-child(4n)::after {
    display: block;
  }

  .process-step:nth-child(2n)::after,
  .process-step:last-child::after {
    display: none;
  }
}

@media (max-width: 560px) {
  .architecture-process {
    margin: 1.25rem 0;
    padding: 0.85rem;
    border-radius: 1.05rem;
  }

  .architecture-process__head {
    margin-bottom: 1rem;
  }

  .architecture-process__head h3 {
    font-size: 1.18rem;
  }

  .architecture-process__head p,
  .process-node > p,
  .process-storage-layer p,
  .process-storage-output p,
  .process-step p,
  .process-destination p {
    font-size: 0.7rem;
  }

  .process-step-grid,
  .process-destinations,
  .process-destination-row,
  .crypto-legend,
  .crypto-role-legend,
  .verification-gate,
  .process-storage-layer ul {
    grid-template-columns: 1fr;
  }

  .process-step {
    min-height: 0;
  }

  .process-step::after {
    display: none !important;
  }
}

@media print {
  .architecture-process {
    break-inside: avoid;
    color: #132c3a;
    border-color: #b9ced8;
    background: #f1f7f9;
    box-shadow: none;
  }

  .architecture-process__head h3,
  .process-node > strong,
  .process-step > strong,
  .process-destination > strong,
  .process-storage-layer b,
  .process-storage-output b,
  .crypto-legend b {
    color: #102b3a;
  }

  .architecture-process__head p,
  .architecture-process figcaption,
  .process-node > p,
  .process-storage-layer p,
  .process-storage-output p,
  .process-step p,
  .process-destination p,
  .crypto-legend span {
    color: #4a6573;
  }
}
