@import url("guide-card-shape.css");

.diagram-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 670;
  line-height: 1.34;
}
.g-art .material-mark {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  opacity: .75;
}
.archive-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, .62fr) minmax(0, .86fr);
  align-items: start;
  gap: clamp(15px, 3cqi, 28px);
}
.archive-flow > div { min-width: 0; }
.archive-flow .diagram-title {
  margin: 0 0 12px;
  font-size: var(--guide-figure-title);
}
.compact-map .archive-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 15px;
  padding-block: 10px;
  border-block-start: 1px solid var(--rule);
  max-width: 300px;
}
.archive-fields li, .archive-flow p {
  color: var(--g-muted);
  font-size: 15px;
}
.archive-flow p { padding-block-start: 10px; border-block-start: 1px solid var(--rule); }
.archive-connector {
  display: grid;
  align-self: center;
  gap: 7px;
  color: var(--g-muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}
.archive-arrow {
  display: block;
  position: relative;
  height: 12px;
  margin-inline: 10px;
  color: var(--guide-wire);
}
.archive-arrow::before, .archive-arrow::after,
.guide-flow-link::before, .guide-flow-link::after {
  content: "";
  position: absolute;
}
.archive-arrow::before, .guide-flow-link::before {
  inset: calc(50% - .5px) 0 auto;
  border-block-start: 1px solid currentColor;
}
.archive-arrow::after, .guide-flow-link::after {
  inset: calc(50% - 3px) 0 auto auto;
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 1px 1px 0 0;
  transform: rotate(45deg);
}
@container handbook-diagram (max-width: 570px) {
  .archive-flow { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .archive-connector {
    grid-template-areas: ". arrow label";
    grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr);
    align-items: center;
    text-align: start;
    gap: 9px;
  }
  .archive-connector span:first-child { grid-area: label; }
  .archive-arrow {
    grid-area: arrow;
    width: 12px;
    height: 31px;
    margin: 0;
  }
  .archive-arrow::before, .guide-flow-link::before {
    inset: 0 auto 0 50%;
    border: 0;
    border-inline-start: 1px solid currentColor;
  }
  .archive-arrow::after, .guide-flow-link::after {
    inset: auto auto 0 calc(50% - 2.5px);
    transform: rotate(135deg);
  }
}

.guide-card-flow {
  --card-gap: clamp(41px, 6cqi, 58px);
  --arrow-breathing-room: 9px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--card-gap);
}
.guide-card-flow > li { position: relative; display: flex; min-width: 0; }
.guide-flow-step {
  width: 100%;
  padding: 17px clamp(12px, 2cqi, 21px);
  border: 1px solid #d9ded6;
  border-radius: var(--guide-card-content-radius);
  background: #e9ebe6;
}
.guide-flow-step h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--guide-figure-title);
  line-height: 1.4;
  font-weight: 670;
  letter-spacing: -.02em;
}
.g-art .guide-flow-step :is(.guide-brand, .material-mark) {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
}
.guide-flow-step p {
  margin: 7px 0 0 32px;
  color: var(--g-muted);
  font-size: 15px;
  line-height: 1.45;
}
.guide-flow-link {
  position: absolute;
  top: 50%;
  left: calc(100% + var(--arrow-breathing-room));
  width: calc(var(--card-gap) - 2 * var(--arrow-breathing-room));
  height: 16px;
  color: var(--guide-wire);
  transform: translateY(-50%);
}
.guide-flow-link i {
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #58ab68;
  box-shadow: 0 0 5px #5da96d;
  opacity: 0;
  transform: translate(-50%, -50%);
}
@container handbook-diagram (max-width: 655px) {
  .guide-card-flow { --card-gap: 37px; grid-template-columns: minmax(0, 1fr); }
  .guide-flow-link {
    top: calc(100% + var(--arrow-breathing-room));
    left: 50%;
    width: 16px;
    height: calc(var(--card-gap) - 2 * var(--arrow-breathing-room));
    transform: translateX(-50%);
  }
  .guide-flow-link::before {
    inset: 0 auto 0 50%;
    border: 0;
    border-inline-start: 1px solid currentColor;
  }
  .guide-flow-link::after {
    inset: auto auto 0 calc(50% - 2.5px);
    transform: rotate(135deg);
  }
  .guide-flow-link i { left: 50%; top: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .chatgpt-flow[data-flow-active] > li:nth-child(1) { --arrival: 0ms; }
  .chatgpt-flow[data-flow-active] > li:nth-child(2) { --arrival: 600ms; }
  .chatgpt-flow[data-flow-active] > li:nth-child(3) { --arrival: 1200ms; }
  .chatgpt-flow[data-flow-active] .guide-flow-step { animation: guide-arrival 560ms ease-out var(--arrival) both; }
  .chatgpt-flow[data-flow-active] .guide-flow-link i { animation: guide-signal-x 420ms ease-in-out calc(var(--arrival) + 190ms) both; }
  @container handbook-diagram (max-width: 655px) {
    .chatgpt-flow[data-flow-active] .guide-flow-link i { animation-name: guide-signal-y; }
  }
}
@keyframes guide-arrival {
  0%, 100% { background: #e9ebe6; border-color: #d9ded6; }
  31% { background: #e0ebdf; border-color: #91a996; }
}
@keyframes guide-signal-x {
  0% { left: 0; opacity: 0; }
  18%, 82% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@keyframes guide-signal-y {
  0% { top: 0; opacity: 0; }
  18%, 82% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.document-row {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  align-items: first baseline;
  gap: 10px clamp(22px, 4cqi, 46px);
  padding-block: 16px;
  border-block-end: 1px solid var(--rule);
}
.document-row:first-child { padding-block-start: 0; }
.document-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3px 14px;
  margin-block-end: 14px;
  color: var(--g-muted);
  font-size: 13px;
  font-weight: 640;
  letter-spacing: .035em;
}
.document-text .g-doc-title { margin-block-end: 5px; font-size: 15px; }
.document-text p { color: var(--copy); font-size: 15px; line-height: 1.55; }
.document-text .g-doc-hl { color: #223e34; font-weight: 650; }
.document-text :is(.g-doc-why, .g-doc-archive) {
  margin-block-start: 5px;
  color: var(--g-muted);
  font-size: 14px;
}
.document-row .document-note {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  color: var(--g-muted);
  font-size: 14px;
  line-height: 1.55;
}
.document-note > span:first-child { color: var(--g-lime-hi); font-weight: 700; }
@container handbook-article (max-width: 590px) {
  .document-row { grid-template-columns: minmax(0, 1fr); }
}
@media (forced-colors: active) {
  .guide-flow-link, .archive-arrow { color: CanvasText; }
}

.decision-flow .guide-flow-step { border: 0; }
.decision-flow .guide-flow-step .map-mark {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  margin: 0;
}
.decision-flow .map-diff {
  margin: 8px 0 0 32px;
  padding: 0;
  border: 0;
}
:is(#diagram-extend, #diagram-service) :is(.map-note, figcaption) {
  justify-content: center;
  text-align: center;
}
#diagram-extend .map-note { margin-block-start: 5px; }
#diagram-extend figcaption { text-wrap: balance; }
#diagram-extend .guide-brand--buzz { width: 21px; height: 21px; flex-basis: 21px; }
@container handbook-diagram (max-width: 570px) {
  :is(#diagram-extend, #diagram-service) .map-network { justify-items: center; }
  :is(#diagram-extend, #diagram-service) .map-branches {
    width: min(100%, 175px);
    margin-inline: 0;
  }
}

/* Keep the worked examples legible against a dark surface. Only the changed or extracted record is emphasized. */
.dark-card-flow .guide-flow-step {
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: clamp(24px, 4cqi, 36px);
  min-height: 154px;
  padding: clamp(17px, 2.75cqi, 26px);
  border: 0;
  /* 2026-12-02: a little depth to sit closer to the guide's dark cards — soft face gradient,
     a faint top light and lower reflection, and a slightly deeper shadow. */
  background:
    radial-gradient(ellipse at 28% -28%, rgb(255 255 255 / .06), transparent 64%),
    radial-gradient(ellipse at 56% 126%, rgb(255 255 255 / .075), transparent 56%),
    #1c1c1c;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), inset 0 -1px 0 rgb(226 230 224 / .15), 0 14px 26px -14px rgb(0 0 0 / .5), 0 3px 8px -4px rgb(0 0 0 / .32);
}
.extraction-flow > li:nth-child(2) .guide-flow-step {
  border: 1px solid transparent;
  padding: calc(clamp(17px, 2.75cqi, 26px) - 1px);
  background:
    radial-gradient(ellipse at 28% -28%, rgb(255 255 255 / .06), transparent 64%) padding-box,
    radial-gradient(ellipse at 56% 126%, rgb(255 255 255 / .075), transparent 56%) padding-box,
    linear-gradient(#1c1c1c, #1c1c1c) padding-box,
    linear-gradient(138deg, #a48a61, #685b53 39%, #776486 69%, #9a8fb0) border-box;
}
.g-art .dark-card-flow .material-mark {
  width: 25px;
  height: 25px;
  margin: 0;
  filter: invert(1);
  opacity: .87;
}
.dark-card-flow h3 {
  display: block;
  color: #f3f5f0;
  font-size: var(--guide-step-title);
  letter-spacing: -.025em;
  line-height: 1.35;
}
.dark-card-flow .guide-flow-step p {
  margin: 7px 0 0;
  color: #c0c7c0;
  font-size: 14px;
  line-height: 1.48;
}
.dark-card-flow .dark-card-copy .map-diff { margin: 8px 0 0; }
.dark-card-flow .map-diff ins {
  color: #85ce91;
  font-size: clamp(20px, 2.5cqi, 24px);
  font-weight: 680;
  letter-spacing: -.026em;
  line-height: 1.3;
}
.dark-card-flow .map-diff del { color: #b5beb7; font-size: 14px; }
#diagram-efficient .map-tags {
  justify-content: center;
  gap: 5px clamp(14px, 4cqi, 30px);
  margin-block-start: 8px;
}
#diagram-efficient figcaption { justify-content: center; text-align: center; text-wrap: balance; }
@container handbook-diagram (max-width: 655px) {
  .dark-card-flow .guide-flow-step { min-height: 120px; }
}
@media (forced-colors: active) {
  .dark-card-flow .guide-flow-step { outline: 1px solid CanvasText; }
  .dark-card-flow .material-mark { filter: none; }
}

.memory-change-band {
  scroll-margin-top: calc(var(--header-height) + 18px);
  padding: clamp(24px, 4cqi, 40px) clamp(16px, 3cqi, 32px);
  background: #252825;
  color: #f3f5f0;
}
.memory-change-band > h2 {
  font-size: calc(clamp(25px, 2.2vw, 33px) - var(--guide-point));
}
.memory-change-band .g-art {
  --guide-wire: #b1c4b6;
  --g-muted: #c5cec6;
  margin: clamp(16px, 2.7cqi, 26px) 0 0;
}
.memory-change-band .compact-map { padding-block: 0; }
.memory-change-band p.map-note { margin-block-start: 3px; }
.memory-change-band figcaption { margin-block-start: 11px; }
.memory-change-band .decision-flow .guide-flow-step {
  background: #ebeee9;
  box-shadow: none;
}
.memory-change-band .decision-flow h3 { color: #202823; }
.memory-change-band .decision-flow .guide-flow-step p { color: #46534a; }
.memory-change-band .decision-flow ins { color: #245e3a; }
.memory-change-band .decision-flow del { color: #5a635b; }
.memory-change-band .decision-flow .material-mark { filter: none; opacity: .81; }
