.rk-deep-dive {

  /* Brand */
  --accent: #1F6FB8;        /* brand-primary / Toolkit Blue */
  --accent-dark: #155080;   /* brand-primary-700 */
  --accent-soft: #DDE9F4;   /* brand-primary-100 */
  --accent2: #D08A2B;       /* brand-secondary / Signal Amber */
  --accent2-dark: #A66816;  /* brand-secondary-700 */
  --accent2-soft: #FBF0DE;  /* light tint of Signal Amber */
  --danger: #C53636;
  --danger-soft: #FBEAEA;

  /* Neutrals */
  --ink: #1A1F2A;           /* ink-900 */
  --muted: #5D6B7E;         /* ink-500 / neutral-steel */
  --paper: #FFFFFF;         /* surface-0 */
  --paper-2: #F7F8FA;       /* surface-50 */
  --line: #DFE4EB;
  --dark: #161B22;          /* dark-900 */

  --shadow: 0 18px 50px rgba(26, 31, 42, .10);
  --radius: 18px;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;


  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f8fa 0, #eef1f4 100%);
  font: 16px/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;

}

/* WordPress block themes may run wpautop after the guide shortcode has
   rendered. Empty paragraphs must never participate in the guide's grids;
   otherwise they push callout/check-card content into the icon column. */
.rk-deep-dive p:empty {
  display: none !important;
}

@scope (.rk-deep-dive) {
/*
 * Shared stylesheet for RKCadTools "deep dive" tutorial guides
 * (docs/*-guide-da.html). Tokens follow marketing/brand/brand-identity.md —
 * do not introduce ad hoc colors in an individual guide; add a token here
 * instead so every deep-dive page stays visually one family.
 */
:root {
  /* Brand */
  --accent: #1F6FB8;        /* brand-primary / Toolkit Blue */
  --accent-dark: #155080;   /* brand-primary-700 */
  --accent-soft: #DDE9F4;   /* brand-primary-100 */
  --accent2: #D08A2B;       /* brand-secondary / Signal Amber */
  --accent2-dark: #A66816;  /* brand-secondary-700 */
  --accent2-soft: #FBF0DE;  /* light tint of Signal Amber */
  --danger: #C53636;
  --danger-soft: #FBEAEA;

  /* Neutrals */
  --ink: #1A1F2A;           /* ink-900 */
  --muted: #5D6B7E;         /* ink-500 / neutral-steel */
  --paper: #FFFFFF;         /* surface-0 */
  --paper-2: #F7F8FA;       /* surface-50 */
  --line: #DFE4EB;
  --dark: #161B22;          /* dark-900 */

  --shadow: 0 18px 50px rgba(26, 31, 42, .10);
  --radius: 18px;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f7f8fa 0, #eef1f4 100%);
  font: 16px/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-underline-offset: 3px; }
button { font: inherit; }
code, kbd { font-family: var(--mono); }
code {
  padding: .12rem .38rem;
  border: 1px solid var(--accent-soft);
  border-radius: 5px;
  background: #eef5fb;
  color: var(--accent-dark);
  font-size: .88em;
}
kbd {
  padding: .16rem .48rem;
  border: 1px solid #c7c2b8;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  font-size: .82em;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 64px;
  overflow: hidden;
  border: 1px solid rgba(26, 31, 42, .12);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  padding: clamp(34px, 7vw, 78px);
  color: #eef6fc;
  background: var(--dark);
  isolation: isolate;
}
.hero::before,
.hero::after {
  position: absolute;
  z-index: -1;
  content: "";
  border-radius: 999px;
  filter: blur(2px);
}
.hero::before {
  width: 430px;
  height: 430px;
  right: -120px;
  top: -175px;
  border: 74px solid rgba(31, 111, 184, .28);
}
.hero::after {
  width: 260px;
  height: 260px;
  right: 140px;
  bottom: -170px;
  background: rgba(208, 138, 43, .18);
}
.hero-logo {
  display: block;
  height: 30px;
  width: auto;
  margin-bottom: 22px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: #9ec3e6;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.eyebrow::before {
  width: 30px;
  height: 2px;
  content: "";
  background: var(--accent2);
}
h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.1rem);
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: .98;
}
.hero-lead {
  max-width: 680px;
  margin: 26px 0 0;
  color: #cfe0ee;
  font-size: clamp(1.05rem, 2vw, 1.27rem);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}
.pill {
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #eef6fc;
  font-size: .82rem;
}

.toolbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 11px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}
.toolbar a {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
  text-decoration: none;
}
.toolbar a:hover { background: var(--accent-soft); color: var(--accent-dark); }
.toolbar .spacer { flex: 1 0 16px; }
.print-button {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid #b8c6d3;
  border-radius: 7px;
  background: #fff;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
}
.print-button:hover { background: var(--accent-soft); }

main { padding: clamp(28px, 5vw, 66px); }
section { scroll-margin-top: 72px; }
section + section { margin-top: 72px; }
.section-kicker {
  margin: 0 0 7px;
  color: var(--accent2-dark);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
h2 {
  margin: 0 0 18px;
  font-size: clamp(1.75rem, 4vw, 2.7rem);
  letter-spacing: -.03em;
  line-height: 1.1;
}
h3 { margin: 0 0 9px; font-size: 1.14rem; line-height: 1.3; }
p { margin: 0 0 1em; }
.intro { max-width: 760px; color: var(--muted); font-size: 1.08rem; }

.flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, auto));
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.flow-card {
  min-height: 124px;
  padding: 15px;
  border-radius: 13px;
  background: var(--paper-2);
}
.flow-card strong { display: block; margin-bottom: 4px; color: var(--accent-dark); }
.flow-card span { color: var(--muted); font-size: .88rem; }
.flow-card.area { border: 2px solid var(--accent2); background: var(--accent2-soft); }
.flow-arrow { color: var(--accent2); font-size: 1.65rem; font-weight: 300; text-align: center; }

.callout {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 13px;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid #ecd3a8;
  border-left: 5px solid var(--accent2);
  border-radius: 12px;
  background: #fdf6ea;
}
.callout.danger { border-color: #e5b4ae; border-left-color: var(--danger); background: var(--danger-soft); }
.callout.info { border-color: #b7cfe6; border-left-color: var(--accent); background: var(--accent-soft); }
.callout-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent2);
  color: #fff;
  font-weight: 800;
}
.callout.danger .callout-icon { background: var(--danger); }
.callout.info .callout-icon { background: var(--accent); }
.callout p:last-child { margin-bottom: 0; }
.callout > .callout-icon { grid-column: 1; grid-row: 1; }
.callout > div { grid-column: 2; grid-row: 1; min-width: 0; }

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.check-card {
  display: grid;
  grid-template-columns: 31px 1fr;
  gap: 11px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.check-card-icon { display: block; width: 32px; height: 32px; object-fit: contain; }
.check-card p { margin: 3px 0 0; color: var(--muted); font-size: .9rem; }
.check-card > .check-card-icon { grid-column: 1; grid-row: 1; }
.check-card > div { grid-column: 2; grid-row: 1; min-width: 0; }

.steps { margin-top: 28px; }
.step {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  padding: 0 0 42px;
}
.step:not(:last-child) .step-body { border-bottom: 1px solid var(--line); padding-bottom: 42px; }
.step-number {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 7px 18px rgba(31,111,184,.25);
  font-size: 1.3rem;
  font-weight: 800;
}
.step-body > p { color: var(--muted); }
.actions { margin: 18px 0 0; padding-left: 1.2rem; }
.actions li { margin: 9px 0; padding-left: 4px; }
.actions li::marker { color: var(--accent2); font-weight: 800; }
.ui {
  display: inline-block;
  padding: .1rem .45rem;
  border: 1px solid #c4cbd0;
  border-radius: 5px;
  background: linear-gradient(#fff, #f1f2f3);
  color: #25323b;
  font-size: .9em;
  font-weight: 650;
  white-space: nowrap;
}

.guide-screenshot {
  margin: 24px 0 4px;
  overflow: hidden;
  border: 1px solid #bfc8ce;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 13px 30px rgba(26,31,42,.10);
}
.guide-screenshot img {
  display: block;
  width: 100%;
  height: auto;
}
.guide-screenshot figcaption {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .86rem;
}

.mock-window {
  margin: 22px 0 4px;
  overflow: hidden;
  border: 1px solid #bfc8ce;
  border-radius: 12px;
  background: #f4f7fa;
  box-shadow: 0 13px 30px rgba(26,31,42,.10);
  font-size: .84rem;
}
.mock-titlebar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-bottom: 1px solid #d1d8dd;
  background: #fff;
  font-weight: 700;
}
.window-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); box-shadow: 15px 0 var(--line), 30px 0 var(--line); margin-right: 29px; }
.mock-content { display: grid; grid-template-columns: 165px 1fr; min-height: 230px; }
.mock-list { padding: 13px; border-right: 1px solid #d1d8dd; background: #fff; }
.mock-item { margin-top: 8px; padding: 9px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.mock-form { display: grid; grid-template-columns: 124px 1fr; gap: 10px 14px; align-content: start; padding: 18px; }
.mock-label { color: #5d6b7a; }
.mock-input { min-height: 29px; padding: 5px 8px; border: 1px solid #bfc8ce; border-radius: 4px; background: #fff; }
.mock-tree { padding: 7px 9px; border: 1px solid #bfc8ce; border-radius: 4px; background: #fff; line-height: 1.8; }
.mock-note { grid-column: 1 / -1; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

.mapping-table { width: 100%; margin: 20px 0 8px; border-collapse: collapse; background: #fff; }
.mapping-table th, .mapping-table td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; }
.mapping-table th { background: #eef1f4; color: var(--ink); font-size: .86rem; }
.mapping-table td:first-child { color: var(--accent-dark); font-weight: 700; }

.logic-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(290px, .85fr);
  gap: 28px;
  align-items: start;
  margin-top: 26px;
}
.diagram {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.diagram svg { display: block; width: 100%; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; color: var(--muted); font-size: .82rem; }
.legend span::before { display: inline-block; width: 11px; height: 11px; margin-right: 6px; border-radius: 50%; content: ""; background: var(--accent2); }
.legend span:last-child::before { background: var(--accent); }
.rules { display: grid; gap: 10px; }
.rule { padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.rule b { display: block; margin-bottom: 3px; color: var(--accent-dark); }
.rule p { margin: 0; color: var(--muted); font-size: .9rem; }

.verify-list { display: grid; gap: 10px; margin-top: 24px; }
.verify-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.verify-item input { width: 19px; height: 19px; margin: 3px 0 0; accent-color: var(--accent); }
.verify-item label { cursor: pointer; }
.verify-item small { display: block; margin-top: 2px; color: var(--muted); }

details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { padding: 17px 4px; cursor: pointer; color: var(--accent-dark); font-weight: 750; }
details p { padding: 0 4px 17px; color: var(--muted); }

.quickref {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}
.quickref div { padding: 15px; border-radius: 11px; background: var(--dark); color: #eef6fc; }
.quickref strong { display: block; color: #8fb9dd; font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; }
.quickref code { display: block; margin-top: 5px; border: 0; background: transparent; color: #fff; padding: 0; font-size: .82rem; word-break: break-word; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(28px, 5vw, 66px);
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--muted);
  font-size: .8rem;
}

@media (max-width: 850px) {
  .flow { grid-template-columns: 1fr; }
  .flow-card { min-height: 0; }
  .flow-arrow { transform: rotate(90deg); }
  .logic-layout, .check-grid { grid-template-columns: 1fr; }
  .quickref { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 590px) {
  .page { width: 100%; margin: 0; border: 0; border-radius: 0; }
  .hero { min-height: 0; }
  main { padding-inline: 20px; }
  .toolbar { padding-inline: 12px; }
  .step { grid-template-columns: 45px 1fr; gap: 13px; }
  .step-number { width: 42px; height: 42px; font-size: 1rem; }
  .mock-content { grid-template-columns: 1fr; }
  .mock-list { border-right: 0; border-bottom: 1px solid #d1d8dd; }
  .mock-form { grid-template-columns: 1fr; }
  .mock-note { grid-column: auto; }
  .mapping-table { font-size: .82rem; }
  .mapping-table th, .mapping-table td { padding: 9px 7px; }
  footer { flex-direction: column; }
}

@media print {
  body { background: #fff; font-size: 10.5pt; }
  .page { width: 100%; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .hero { min-height: 0; padding: 34px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .toolbar, .print-button { display: none; }
  main { padding: 28px 34px; }
  section + section { margin-top: 42px; }
  .step { break-inside: avoid; }
  .mock-window, .guide-screenshot, .callout, .diagram, .check-card { break-inside: avoid; }
  details { break-inside: avoid; }
  details > * { display: block; }
}

}

.rk-guide-template { margin-block-start: 0; }

/* Collision shield for generic component names also used by theme.css.
   @scope limits where the guide rules apply, but it does not increase their
   specificity or reset properties they do not declare. Keep these selectors
   explicitly namespaced so the marketing hero/workflow cannot leak into a
   deep-dive article at any viewport width. */
.rk-deep-dive .hero {
  min-height: 390px;
  padding: clamp(34px, 7vw, 78px);
  color: #eef6fc;
  background: var(--dark);
}
.rk-deep-dive .hero::before,
.rk-deep-dive .hero::after {
  inset: auto;
  mask-image: none;
  -webkit-mask-image: none;
}
.rk-deep-dive .hero::before {
  top: -175px;
  right: -120px;
  bottom: auto;
  left: auto;
  width: 430px;
  height: 430px;
  background: none;
}
.rk-deep-dive .hero::after {
  top: auto;
  right: 140px;
  bottom: -170px;
  left: auto;
  width: 260px;
  height: 260px;
}
.rk-deep-dive .eyebrow {
  gap: 9px;
  margin: 0 0 18px;
  color: #9ec3e6;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .15em;
}
.rk-deep-dive .hero h1 {
  max-width: 820px;
  margin: 0;
  color: #eef6fc;
  font-size: clamp(2.5rem, 6vw, 5.1rem);
  font-weight: 760;
  letter-spacing: -.045em;
  line-height: .98;
}
.rk-deep-dive .steps {
  display: block;
  grid-template-columns: none;
  gap: 0;
  margin-top: 28px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.rk-deep-dive .step {
  min-height: 0;
  padding: 0 0 42px;
  background: transparent;
}
.rk-deep-dive .step-number {
  margin-bottom: 0;
}
.rk-deep-dive .step h3 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 1.14rem;
  font-weight: 700;
  line-height: 1.3;
}
.rk-deep-dive .step p {
  margin: 0 0 1em;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}
.rk-deep-dive .step-body > p {
  color: var(--muted);
}
.rk-deep-dive .callout p:last-child {
  margin-bottom: 0;
}
@media (max-width: 590px) {
  .rk-deep-dive .hero { min-height: 0; }
}
@media print {
  .rk-deep-dive .hero { min-height: 0; padding: 34px; }
}
.rk-deep-dive .toolbar { top: 64px; }
.admin-bar .rk-deep-dive .toolbar { top: 96px; }
.rk-guide-back { width: min(1180px, calc(100% - 32px)); margin: 18px auto -6px; }
.rk-guide-back a { display: inline-flex; min-height: 40px; align-items: center; font-size: 14px; font-weight: 600; }
