/* Domain relationship components and strategic-section contracts. */
/* Đồng bộ width với header/footer .wrap (--max:1480px) */
.section>.wrap,.v9-guide-toc>.wrap,.assurance-proof-strip>.wrap{width:min(calc(100% - 80px),var(--max));max-width:none;margin-inline:auto;padding-inline:0;min-width:0}
/* Section head: title + mô tả xếp dọc (không 2 cột cạnh nhau) */
.section-head,
.assurance-section-head,
.structure-section-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:10px!important;
  align-items:start!important;
  justify-content:initial;
  max-width:none;
  width:100%;
  margin-bottom:28px;
}
.section-heading{min-width:0;max-width:none;width:100%}.section-heading h2{margin-top:10px;max-width:none}.section-summary{min-width:0;max-width:none;width:100%}.section-summary p{max-width:none;margin:0}
.section p{line-height:1.7}
/* Đoạn văn trong .wrap dùng hết bề ngang — tránh max-width ch hẹp để trống UI */
.section-content>p,
.section .wrap>p,
.section>.wrap>p.v11-notice,
.section>.wrap>p.lead{
  max-width:none;
  width:100%;
}
/* Tránh đoạn văn / bảng / block dính sát nhau (foundation reset margin:0) */
.section .wrap>p,
.section-content>p,
.v10-reading-section .wrap>p,
.v9-section p,
.v8-section p,
.v11-section p{
  margin-bottom:1.1em;
}
.section .wrap>p:last-child,
.section-content>p:last-child{
  margin-bottom:0;
}
.section .wrap>.v9-table-region,
.section .wrap>.depth-table-scroll,
.section .wrap>.depth-visual,
.section .wrap>.structure-register,
.section .wrap>.assurance-table,
.section .wrap>table{
  margin-block:22px;
}
.section-content{min-width:0}
.depth-section{padding-block:64px;border-top:1px solid #213747}.depth-section p{color:#b7cbd7;font-size:16px}.depth-section h3{font-size:16px;line-height:1.4}
.depth-table-scroll{max-width:100%;overflow:auto;border:1px solid #294556;border-radius:16px;scrollbar-color:#457b93 #0b1925}.depth-table{width:100%;border-collapse:collapse;text-align:left;font-size:16px;line-height:1.6}.depth-table th{color:#8cdef5;background:#102939;padding:16px;vertical-align:top;font-size:14px}.depth-table td{padding:16px;border-top:1px solid #254254;color:#c8d9e2;vertical-align:top}.depth-table th:first-child,.depth-table td:first-child{min-width:130px;color:#eef9ff}.depth-table td{overflow-wrap:anywhere}.depth-table-scroll:focus-visible{outline:2px solid #6ce7d0;outline-offset:4px}
.depth-visual{margin:0;padding:28px;background:linear-gradient(135deg,#102638,#091a25);border:1px solid #315368;border-radius:18px;min-width:0;overflow:hidden}.depth-visual figcaption{margin-bottom:24px;color:#62e1cd;font-size:14px;font-weight:700;text-transform:uppercase;letter-spacing:.06em}.depth-node{position:relative;padding:20px;border:1px solid #36576a;background:#0e2433;border-radius:12px;min-width:0}.depth-node b{display:block;color:#ecf9ff;font-size:16px;line-height:1.4}.depth-node p{margin:8px 0 0;font-size:14px;color:#a9c7d6;line-height:1.6}.depth-icon{width:28px;height:28px;margin-bottom:10px;filter:brightness(0) saturate(100%) invert(84%) sepia(25%) saturate(1109%) hue-rotate(149deg);display:block}.depth-root{position:relative;z-index:1;max-width:600px;margin:0 auto;text-align:center;padding:20px;border:1px solid #5edcc3;border-radius:12px;background:#12372f;color:#c6ffef;font-size:16px;font-weight:700}.depth-root .depth-icon{margin-inline:auto}
/* Stem từ root xuống rail ngang */
.depth-root:after{content:"";position:absolute;left:50%;bottom:0;transform:translate(-50%,100%);width:1px;height:var(--depth-rail,20px);background:#609fb5;z-index:0}
.depth-branches{
  --depth-gap:18px;
  --depth-rail:20px;
  --depth-line:#609fb5;
  position:relative;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:var(--depth-gap);
  padding-top:calc(var(--depth-rail) * 2);
  margin-top:0;
}
/* Line ngang: nối đúng tâm cột đầu ↔ cuối (có tính gap) */
.depth-branches:before{
  content:"";
  position:absolute;
  top:var(--depth-rail);
  left:calc((100% - 3 * var(--depth-gap)) / 8);
  right:calc((100% - 3 * var(--depth-gap)) / 8);
  height:1px;
  background:var(--depth-line);
  z-index:0;
}
/* Line dọc: từ rail xuống đúng mép trên card — không xuyên vào thẻ */
.depth-branches .depth-node:before{
  content:"";
  position:absolute;
  left:50%;
  top:calc(-1 * var(--depth-rail));
  transform:translateX(-50%);
  width:1px;
  height:var(--depth-rail);
  background:var(--depth-line);
  z-index:0;
  pointer-events:none;
}
.depth-branches .depth-node{z-index:1}
.depth-branches.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.depth-branches.two:before{
  left:calc((100% - var(--depth-gap)) / 4);
  right:calc((100% - var(--depth-gap)) / 4);
}.depth-output{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:26px;padding-top:25px;border-top:1px solid #355568}.depth-stack{display:grid;gap:12px}.depth-stack .depth-node{display:grid;grid-template-columns:32px 220px 1fr;align-items:center;gap:18px;border-left:4px solid #67d9c4}.depth-stack .depth-icon,.depth-stack p{margin:0}.depth-handoff{display:grid;grid-template-columns:1fr 1fr;gap:26px}.depth-handoff>div{padding:18px;border:1px dashed #46738b;border-radius:12px;display:grid;gap:14px}.depth-handoff>div+div{border-color:#66cbb5}.depth-lane-label{font-size:14px;color:#82dff4;font-weight:700}.depth-state{display:grid;gap:14px}.depth-state>div{padding:20px;border:1px solid #456477;border-left:4px solid #6ce4cd;border-radius:10px;background:#0e2433}.depth-state b{color:#a5f4df}.depth-state span{margin:0 16px;color:#77c8df}.depth-state p{margin-bottom:0}.depth-state>div:last-child{border-left-color:#93aff6}
.depth-sequence{list-style:none;margin:0;padding:0;display:grid;gap:0}.depth-sequence li{position:relative;display:grid;grid-template-columns:32px 44px minmax(0,1fr);gap:18px;padding:0 0 22px}.depth-sequence li:not(:last-child):before{content:'';position:absolute;left:72px;top:44px;bottom:0;width:2px;background:#3b7288}.depth-step-number{width:44px;height:44px;display:flex;align-items:center;justify-content:center;border:1px solid #67d6c4;background:#143a36;border-radius:50%;color:#b3f5e8;font-size:16px;font-weight:700}.depth-sequence li>div{min-width:0;padding:16px 20px;border:1px solid #2b4f63;border-radius:12px;background:#0c2333}.depth-sequence b{font-size:16px;color:#edf8ff}.depth-sequence p{margin:6px 0 0;font-size:16px}
.depth-console,.depth-split{display:grid;grid-template-columns:1fr 1fr;gap:24px}.depth-console>div,.depth-split>article{min-width:0;padding:24px;background:#071725;border:1px solid #294959;border-radius:14px}.depth-console b{font-size:16px;color:#90e9d3}.depth-console pre{overflow:auto;margin:18px 0 0;max-width:100%;font-size:14px;line-height:1.6;color:#d2eff9;white-space:pre-wrap;overflow-wrap:anywhere}.depth-split ul{padding-left:20px;color:#b9ccd8;line-height:1.8;font-size:16px}
.depth-assessments{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}.depth-assessment{padding:26px;border:1px solid #355267;border-radius:16px;background:#102535;min-width:0}.depth-assessment h3{margin-top:12px;color:#e5faff}.depth-assessment dl{margin:20px 0}.depth-assessment dt{margin-top:16px;font-size:14px;color:#80dcee}.depth-assessment dd{margin:6px 0 0;color:#bed2dd;font-size:16px;line-height:1.65}.depth-assessment a{font-size:14px;color:#91f2dc}.depth-legend{display:flex;gap:10px;flex-wrap:wrap;margin-top:24px}.depth-legend details{position:relative}.depth-legend summary,.depth-badge{display:inline-block;padding:7px 12px;border:1px solid #436176;border-radius:8px;color:#a9eee0;font-size:14px;font-weight:700;line-height:1.5}.depth-legend summary{cursor:pointer}.depth-legend p{position:absolute;top:35px;left:0;padding:14px;background:#0d2738;border:1px solid #456477;border-radius:10px;width:240px;z-index:5;font-size:14px}.depth-registry{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.depth-record{padding:26px;border:1px solid #31556a;border-radius:16px;background:#0d2434;min-width:0}
.depth-record>.depth-badge{display:inline-block;margin:0 0 12px}
.depth-record>h3{margin:0 0 14px}
.depth-record h3 a{color:#e5faff}
.depth-record dl{display:grid;grid-template-columns:130px 1fr;gap:12px 16px;margin:0;font-size:16px;line-height:1.6}.depth-record dt{color:#80dbee}.depth-record dd{margin:0;color:#c5d6df;overflow-wrap:anywhere}.depth-record>a{color:#86e6ce}.depth-record[hidden]{display:none}.depth-filter{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:24px}.depth-filter button{font:inherit;font-size:14px;padding:10px 16px;background:#112a3a;color:#cee3ed;border:1px solid #37596e;border-radius:8px;cursor:pointer}.depth-filter button[aria-pressed=true]{border-color:#67dfc6;background:#17463c;color:#cdfff3}.depth-evidence dl{border-left:2px solid #4c8ca0;margin-left:24px;padding-left:24px}.depth-evidence dl>div{padding:14px 18px;margin:12px 0;background:#0d2738;border:1px solid #31536a;border-radius:10px}.depth-evidence dt{font-family:ui-monospace,monospace;color:#91ebd4;font-size:16px}.depth-evidence dd{margin:8px 0 0;color:#bed2df;font-size:16px;line-height:1.6}
/* Chỉ SigningTransaction + dl: gap = đúng chiều dài line */
.depth-evidence>.depth-root:has(+dl){margin-bottom:var(--depth-rail,20px)}
/* Preview flow: luôn xếp dọc 1 cột; line nối tâm ô tròn đầu ↔ cuối */
.visual-preview-stage[data-domain=trust],
.visual-preview-stage[data-domain=developer],
.visual-preview-stage[data-domain=signing],
.visual-preview-stage[data-domain=industry]{
  display:grid!important;
  grid-template-columns:1fr!important;
}
.visual-mini-node{font-size:14px!important}
.depth-hero-map .depth-branches{grid-template-columns:1fr 1fr;--depth-gap:18px}
.depth-hero-map .depth-branches:before{
  left:calc((100% - var(--depth-gap)) / 4);
  right:calc((100% - var(--depth-gap)) / 4);
}.depth-hero-map .depth-node{padding:16px}.depth-hero-map .depth-icon{width:24px;height:24px}.depth-hero-map .depth-node b{font-size:16px}.depth-hero-map .depth-node p{font-size:14px}.depth-hero-map{align-self:center;padding:22px}.depth-hero-map .depth-output{padding-top:16px;margin-top:16px}.depth-hero-map figcaption{font-size:14px;margin-bottom:16px}
@media(max-width:1000px){.depth-branches{grid-template-columns:repeat(2,minmax(0,1fr))}.depth-branches:before{left:calc((100% - var(--depth-gap)) / 4);right:calc((100% - var(--depth-gap)) / 4)}.depth-assessments{grid-template-columns:1fr}.depth-stack .depth-node{grid-template-columns:32px 1fr}.depth-stack p{grid-column:2}.depth-record dl{grid-template-columns:1fr;gap:6px}.depth-record dt{margin-top:10px}}
@media(max-width:640px){.section>.wrap,.v9-guide-toc>.wrap,.assurance-proof-strip>.wrap{padding-inline:20px}.section-head,.assurance-section-head,.structure-section-head{display:block!important}.section-summary{margin-top:16px}.depth-section{padding-block:42px}.depth-visual{padding:18px}.depth-branches,.depth-branches.two,.depth-output,.depth-handoff,.depth-console,.depth-split,.depth-registry{grid-template-columns:1fr}.depth-branches:before,.depth-branches .depth-node:before{display:none}.depth-branches{gap:12px;padding-top:18px}.depth-node{padding:18px}.depth-output{gap:12px}.depth-table{min-width:600px}.depth-record{padding:20px}.depth-assessment{padding:22px}.depth-sequence li{gap:12px}.depth-sequence li:not(:last-child):before{left:66px}.depth-sequence li>div{padding:16px}.depth-sequence b{font-size:16px}.depth-evidence dl{margin-left:8px;padding-left:14px}.depth-legend p{position:static;width:auto;max-width:280px}.depth-registry h3{overflow-wrap:anywhere}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
/* Intrinsic sizing of long technical labels and illustrated application panels. */
main .wrap>*{min-width:0}main h1,main h2,main h3,main p,main small{overflow-wrap:anywhere}
.breadcrumbs,.breadcrumb{display:flex;flex-wrap:wrap;min-width:0;max-width:100%;gap:8px}.breadcrumbs span,.breadcrumb span{white-space:normal;min-width:0;overflow-wrap:anywhere}
.structure-breadcrumb .wrap{flex-wrap:wrap;min-width:0;gap:8px}.structure-breadcrumb span,.structure-breadcrumb a{white-space:normal;min-width:0;overflow-wrap:anywhere;font-size:14px}
.content-card,.feature-card,.assurance-card,.hero-copy,.hero-side-card,.pdf-sheet,.pdf-rail{min-width:0;max-width:100%;box-sizing:border-box}.content-grid,.feature-grid,.assurance-grid{min-width:0}.content-table-wrap,.assurance-table-wrap,.table-scroll{max-width:100%;min-width:0;overflow-x:auto}
@media(max-width:640px){.depth-hero-map .depth-branches{grid-template-columns:1fr}.depth-hero-map .depth-branches:before{display:none}.content-card{overflow-wrap:anywhere}.pdf-sheet,.pdf-rail,.feature-flow,.feature-node{min-width:0;max-width:100%;box-sizing:border-box}.pdf-workspace,.pdf-layout,.pdf-demo{min-width:0;max-width:100%}.content-grid{grid-template-columns:minmax(0,1fr)!important}.hero-side-card{overflow-wrap:anywhere}}

/* Three semantic children: icon, numbered marker, content. Keep each on the same row. */
.depth-sequence li>.v8-icon{grid-column:1;grid-row:1;width:28px;height:28px;align-self:start;margin-top:8px}.depth-sequence li>.depth-step-number{grid-column:2;grid-row:1;align-self:start}.depth-sequence li>div{grid-column:3;grid-row:1;overflow-wrap:break-word}

/* Grid: số item < số cột khai báo → full width, không dư cột trống */
@media(min-width:901px){
  /* 4-cột → 3/2/1 */
  .assurance-proof-grid:has(>:nth-child(3):last-child),
  .structure-intent-grid:has(>:nth-child(3):last-child),
  .visual-intent-rail:has(>:nth-child(3):last-child),
  .v10-ca-grid:has(>:nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,1fr))}
  .assurance-proof-grid:has(>:nth-child(2):last-child),
  .structure-intent-grid:has(>:nth-child(2):last-child),
  .visual-intent-rail:has(>:nth-child(2):last-child),
  .v10-ca-grid:has(>:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
  .assurance-proof-grid:has(>:nth-child(1):last-child),
  .structure-intent-grid:has(>:nth-child(1):last-child),
  .visual-intent-rail:has(>:nth-child(1):last-child),
  .v10-ca-grid:has(>:nth-child(1):last-child){grid-template-columns:minmax(0,1fr)}
  /* 3-cột → 2/1; 4 item trên 3-cột → 2×2 */
  /* 3-cột → 2/1; 4 item trên 3-cột → 2×2 */
  .structure-hub-links:has(>:nth-child(2):last-child),
  .structure-card-grid:has(>:nth-child(2):last-child),
  .structure-process:has(>:nth-child(2):last-child),
  .assurance-grid:has(>:nth-child(2):last-child),
  .depth-assessments:has(>:nth-child(2):last-child),
  .v8-tiles:has(>:nth-child(2):last-child),
  .cols-3:has(>:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
  .structure-hub-links:has(>:nth-child(1):last-child),
  .structure-card-grid:has(>:nth-child(1):last-child),
  .assurance-grid:has(>:nth-child(1):last-child),
  .v8-tiles:has(>:nth-child(1):last-child),
  .cols-3:has(>:nth-child(1):last-child){grid-template-columns:minmax(0,1fr)}
  .structure-hub-links:has(>:nth-child(4):last-child),
  .v8-tiles:has(>:nth-child(4):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
  /* assurance-grid đúng 4 item (Prevent/Detect/Respond/Prove) → 4 cột; grid 3/6 item giữ nguyên */
  .assurance-grid:has(>:nth-child(4):last-child){grid-template-columns:repeat(4,minmax(0,1fr))}
  /* assurance-grid 8 item (3-cột dư 2) → 4 cột đều */
  .assurance-grid:has(>:nth-child(8):last-child){grid-template-columns:repeat(4,minmax(0,1fr))}
  /* assurance-workflows: 3 cột; ít item hơn thì full hàng */
  .assurance-workflows:has(>:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
  .assurance-workflows:has(>:nth-child(1):last-child){grid-template-columns:minmax(0,1fr)}
  /* feature-flow / v8-steps ít node */
  .feature-flow:has(>.feature-node:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .feature-flow:has(>.feature-node:nth-child(1):last-child){grid-template-columns:minmax(0,1fr)!important}
  .v8-steps:has(>li:nth-child(5):last-child){grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* content-cards: 4 cột nhưng thường 3 thẻ — chỉ desktop (>1200, tránh đè breakpoint tablet) */
@media(min-width:1201px){
  .content-cards:has(>:nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,1fr))}
  .content-cards:has(>:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}
  .content-cards:has(>:nth-child(1):last-child){grid-template-columns:minmax(0,1fr)}
}
