/* BitFire Rule Tuning guide — page-specific components.
   Shared documentation structure, typography, navigation, tables,
   callouts, FAQ, author, and CTA styles come from enterprise-docs.css. */

.tune-hero h1 { max-width: 880px; }
.tune-summary { border-color: rgba(99, 220, 145, 0.22); }
.tune-summary .recommendation-label { color: #8ce7ad; }

.tuning-path {
  display: grid;
  grid-template-columns: repeat(3, 1fr auto) 1fr;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(167, 210, 233, 0.18);
  border-radius: 20px;
  background: rgba(10, 28, 45, 0.8);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.28);
}

.tuning-path > div {
  position: relative;
  min-height: 126px;
  display: grid;
  align-content: center;
  padding: 21px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.tuning-path > div:first-child { background: rgba(91, 173, 218, 0.08); }
.tuning-path > div:last-child { background: rgba(99, 220, 145, 0.055); }
.tuning-path > div > span { position: absolute; top: 14px; right: 15px; color: #577284; font-family: ui-monospace, monospace; font-weight: 700; }
.tuning-path .icon { width: 22px; margin-bottom: 15px; color: #5eb9e5; }
.tuning-path > div:last-child .icon { color: #74dda0; }
.tuning-path strong,
.tuning-path small { display: block; }
.tuning-path strong { color: #e5f1f7; }
.tuning-path small { margin-top: 3px; color: #738c9c; }
.tuning-path > i { padding: 0 9px; color: #456276; font-style: normal; }

.tune-overview-preview { margin-top: 30px; }
.tune-overview-preview > a { display: block; }
.tune-overview-preview img { display: block; height: auto; }
.tune-overview-preview figcaption { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.tune-overview-preview figcaption a { flex: 0 0 auto; color: #87c9e9; font-weight: 800; }
.tune-overview-preview figcaption a:hover { color: #bce8fb; }

.tune-intro { scroll-margin-top: var(--nav-height); }
.tune-intro-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 72px; align-items: center; }
.tune-intro h2 { margin-bottom: 20px; font-weight: 790; letter-spacing: -0.06em; line-height: 0.98; }
.blocked-note { display: grid; grid-template-columns: 31px 1fr; gap: 14px; margin-top: 28px; padding: 21px; border: 1px solid #ecd4ad; border-radius: 15px; background: #fff9ef; }
.blocked-note > .icon { width: 22px; color: #c47e1d; }
.blocked-note strong { color: #604721; }
.blocked-note p { margin: 4px 0 0; color: #786547; }
.tune-checklist { margin: 0; }
.tune-checklist strong { color: #e8f4fa; }
.tune-body { border-top: 1px solid #e1e8ed; }

.subsection-title { margin: 38px 0 15px; color: #1e394c; letter-spacing: -0.02em; }
.body-copy { margin: 21px 0 0; color: #5c7180; line-height: 1.72; }
.body-copy strong { color: #29485b; }
.body-copy a,
.tune-faq a,
.tune-troubleshooting a { color: #1477aa; font-weight: 800; }
.documentation code { padding: 2px 5px; border-radius: 5px; color: #176f9e; background: #eef6fa; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.learning-panel { display: grid; grid-template-columns: 0.62fr 1.38fr; overflow: hidden; border: 1px solid #dbe4ea; border-radius: 19px; }
.learning-clock { display: grid; align-content: center; justify-items: start; min-height: 330px; padding: 30px; color: #e5f1f7; background: #0b2033; }
.learning-clock .icon { width: 34px; margin-bottom: 50px; color: #65bce5; }
.learning-clock strong { display: block; }
.learning-clock span { margin-top: 6px; color: #8fa7b5; }
.learning-points article { min-height: 110px; padding: 22px 25px; border-bottom: 1px solid #e1e8ed; }
.learning-points article:last-child { border-bottom: 0; }
.learning-points article > span { display: inline-block; margin-bottom: 7px; padding: 3px 8px; border-radius: 999px; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; }
.learning-points .yes { color: #087046; background: #dcf4e8; }
.learning-points .no { color: #126a9c; background: #e1f1fa; }
.learning-points .blocked { color: #9d4039; background: #fce7e4; }
.learning-points strong { display: block; color: #263f51; }
.learning-points p { margin: 4px 0 0; color: #647885; }

.learning-checks { display: grid; grid-template-columns: repeat(2, 1fr); overflow: hidden; border: 1px solid #dbe4ea; border-radius: 16px; }
.learning-checks span { position: relative; min-height: 70px; display: flex; align-items: center; padding: 14px 16px 14px 43px; border-right: 1px solid #e1e8ed; border-bottom: 1px solid #e1e8ed; color: #536b79; }
.learning-checks span:nth-child(2n) { border-right: 0; }
.learning-checks span:nth-last-child(-n + 2) { border-bottom: 0; }
.learning-checks span::before { position: absolute; left: 17px; content: "✓"; color: #15915e; font-weight: 900; }

.admin-test-note { display: grid; grid-template-columns: 48px 1fr; gap: 19px; margin-bottom: 18px; padding: 28px; border: 1px solid #efc6c1; border-radius: 18px; background: #fff7f5; }
.admin-test-note > .icon { width: 32px; color: #b34c45; }
.admin-test-note small { color: #a4453f; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.admin-test-note h3 { margin: 4px 0 7px; color: #493836; }
.admin-test-note p { margin: 0; color: #765f5c; }

.resolution-steps { overflow: hidden; border: 1px solid #dbe4ea; border-radius: 18px; }
.resolution-steps article { display: grid; grid-template-columns: 43px 1fr; gap: 19px; padding: 24px 27px; border-bottom: 1px solid #e1e8ed; }
.resolution-steps article:last-child { border-bottom: 0; }
.resolution-steps article > span { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #cfe0e9; border-radius: 12px; color: #197bad; background: #f1f8fb; font-family: ui-monospace, monospace; font-weight: 800; }
.resolution-steps strong { display: block; color: #263f51; }
.resolution-steps p { margin: 5px 0 0; color: #627684; }
.block-search-tip { display: grid; grid-template-columns: 35px 1fr; gap: 14px; margin-top: 18px; padding: 21px; border: 1px solid #cde3ee; border-radius: 15px; background: #f1f8fc; }
.block-search-tip > .icon { width: 24px; color: #218bc9; }
.block-search-tip strong { display: block; color: #146f9e; letter-spacing: 0.07em; text-transform: uppercase; }
.block-search-tip p { margin: 5px 0 0; color: #5d7180; }

.scope-comparison { display: grid; grid-template-columns: 1fr auto 1fr; gap: 13px; align-items: center; margin-top: 18px; }
.scope-comparison article { min-height: 200px; padding: 24px; border: 1px solid #bfe2cf; border-radius: 16px; background: #f2faf6; }
.scope-comparison article.scope-broad { border-color: #efd1ad; background: #fff9ef; }
.scope-comparison article > small { display: block; margin-bottom: 26px; color: #087046; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.scope-comparison .scope-broad > small { color: #955710; }
.scope-comparison .icon { width: 23px; margin-bottom: 14px; color: #15915e; }
.scope-comparison .scope-broad .icon { color: #c47e1d; }
.scope-comparison strong { display: block; color: #294659; }
.scope-comparison p { margin: 6px 0 0; color: #637785; }
.scope-comparison > i { color: #8ca0ad; font-size: 28px; font-style: normal; }

.rule-origin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.rule-origin-grid article { min-height: 270px; padding: 27px; border: 1px solid #dbe4ea; border-radius: 17px; }
.origin-icon { width: 45px; height: 45px; display: grid; place-items: center; margin-bottom: 38px; border-radius: 13px; color: #176f9e; background: #e8f5fb; }
.origin-icon .icon { width: 22px; }
.rule-origin-grid small { display: block; margin-bottom: 6px; color: #218bc9; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.rule-origin-grid h3 { margin-bottom: 9px; color: #213c4f; }
.rule-origin-grid p { margin: 0; color: #627684; }

.protection-note { display: grid; grid-template-columns: 38px 1fr; gap: 15px; margin-top: 18px; padding: 25px; border-radius: 16px; color: #dcecf5; background: #0b2033; }
.protection-note > .icon { width: 27px; color: #62bde8; }
.protection-note strong { display: block; margin-bottom: 5px; }
.protection-note p { margin: 0; color: #91a8b6; }
.protection-note.light-note { color: #294659; border: 1px solid #cde3ee; background: #f1f8fc; }
.protection-note.light-note > .icon { color: #218bc9; }
.protection-note.light-note p { color: #5d7180; }

.trusted-examples { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; border: 1px solid #dbe4ea; border-radius: 15px; }
.trusted-examples span { position: relative; min-height: 86px; display: flex; align-items: center; padding: 15px 13px 15px 36px; border-right: 1px solid #e1e8ed; color: #526b79; }
.trusted-examples span:last-child { border-right: 0; }
.trusted-examples span::before { position: absolute; left: 15px; content: "✓"; color: #218bc9; font-weight: 900; }

.bot-control-callout { display: grid; grid-template-columns: 48px 1fr; gap: 19px; margin-top: 18px; padding: 28px; border-radius: 18px; color: #e8f3f9; background: #0a1e31; }
.bot-control-callout > .icon { width: 33px; color: #63bde7; }
.bot-control-callout small { color: #63bde7; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.bot-control-callout h3 { margin: 4px 0 7px; }
.bot-control-callout p { margin: 0 0 12px; color: #92a8b5; }
.bot-control-callout a { display: inline-flex; align-items: center; gap: 7px; color: #bce5fb; font-weight: 800; }
.bot-control-callout a .icon { width: 15px; }

.source-choice { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin-top: 18px; }
.source-choice article { min-height: 400px; padding: 27px; border: 1px solid #dbe4ea; border-radius: 18px; }
.source-choice article > div { display: flex; gap: 15px; align-items: center; margin-bottom: 27px; }
.source-choice article > div > .icon { width: 27px; color: #218bc9; }
.source-choice small { color: #218bc9; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.source-choice h3 { margin: 2px 0 0; color: #213c4f; }
.source-choice p { color: #627684; }
.source-choice > article > strong { display: block; margin-top: 22px; color: #294659; }
.source-choice ul { display: grid; gap: 8px; padding-left: 19px; color: #627684; }
.source-agent { background: #fffaf3; }
.source-agent > div > .icon { color: #c47e1d; }

.compact-process { display: grid; grid-template-columns: 37px 1fr; overflow: hidden; border: 1px solid #dbe4ea; border-radius: 15px; }
.compact-process > span { display: grid; place-items: center; padding: 16px 10px; border-bottom: 1px solid #e1e8ed; color: #218bc9; background: #f3f9fc; font-family: ui-monospace, monospace; font-weight: 800; }
.compact-process > p { margin: 0; padding: 16px 18px; border-bottom: 1px solid #e1e8ed; color: #5d7180; }
.compact-process > span:nth-last-child(2),
.compact-process > p:last-child { border-bottom: 0; }

.block-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 15px; align-items: stretch; }
.block-steps { overflow: hidden; border: 1px solid #dbe4ea; border-radius: 17px; }
.block-steps article { display: grid; grid-template-columns: 39px 1fr; gap: 16px; padding: 23px; border-bottom: 1px solid #e1e8ed; }
.block-steps article:last-child { border-bottom: 0; }
.block-steps span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; color: #197bad; background: #eaf6fb; font-family: ui-monospace, monospace; font-weight: 800; }
.block-steps strong { display: block; color: #263f51; }
.block-steps p { margin: 5px 0 0; color: #627684; }
.shared-ip-card { padding: 27px; border: 1px solid #efc6c1; border-radius: 17px; background: #fff7f5; }
.shared-ip-card > .icon { width: 29px; margin-bottom: 34px; color: #bd564f; }
.shared-ip-card small { display: block; margin-bottom: 5px; color: #a4453f; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.shared-ip-card h3 { margin-bottom: 8px; color: #493836; }
.shared-ip-card p { margin: 0; color: #765f5c; }

.anonymous-meaning { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.anonymous-meaning article { min-height: 245px; padding: 26px; border: 1px solid #dbe4ea; border-radius: 17px; }
.anonymous-meaning article:last-child { color: #e6f2f8; border-color: #173c57; background: #0b2033; }
.anonymous-meaning .icon { width: 25px; margin-bottom: 32px; color: #218bc9; }
.anonymous-meaning article:last-child .icon { color: #65bce5; }
.anonymous-meaning small { display: block; margin-bottom: 5px; color: #218bc9; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.anonymous-meaning article:last-child small { color: #65bce5; }
.anonymous-meaning strong { display: block; color: #243e50; }
.anonymous-meaning article:last-child strong { color: #e6f2f8; }
.anonymous-meaning p { margin: 6px 0 0; color: #627684; }
.anonymous-meaning article:last-child p { color: #91a8b6; }

.default-restrictions { display: grid; grid-template-columns: repeat(5, 1fr); overflow: hidden; border: 1px solid #dbe4ea; border-radius: 16px; }
.default-restrictions span { position: relative; min-height: 125px; display: flex; align-items: flex-end; padding: 42px 17px 20px; border-right: 1px solid #e1e8ed; color: #536b79; }
.default-restrictions span:last-child { border-right: 0; }
.default-restrictions span::before { position: absolute; top: 18px; left: 17px; content: "×"; color: #b34c45; font-size: 21px; font-weight: 900; }

.exception-list { overflow: hidden; border: 1px solid #dbe4ea; border-radius: 19px; }
.exception-list > article { display: grid; grid-template-columns: 52px 1fr; gap: 21px; padding: 30px 28px; border-bottom: 1px solid #e1e8ed; scroll-margin-top: calc(var(--nav-height) + 25px); }
.exception-list > article:last-child { border-bottom: 0; }
.exception-icon { width: 49px; height: 49px; display: grid; place-items: center; border: 1px solid #cfe0e9; border-radius: 14px; color: #197bad; background: #f1f8fb; }
.exception-icon .icon { width: 23px; }
.exception-list small { color: #218bc9; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; }
.exception-list h3 { margin: 3px 0 9px; color: #213c4f; }
.exception-list article > div > p { margin: 0; color: #5d7180; line-height: 1.7; }
.use-when { margin-top: 18px; padding: 17px 19px; border-left: 3px solid #48a9d9; background: #f4f9fc; }
.use-when strong { display: block; margin-bottom: 4px; color: #146f9e; letter-spacing: 0.07em; text-transform: uppercase; }
.use-when p { margin: 0; color: #5d7180; }
.exception-caution { margin-top: 12px; color: #755f3c; }
.exception-caution strong { color: #63471e; }
.exception-caution.danger { color: #7e5652; }
.exception-caution.danger strong { color: #a03f3a; }
.exception-table { margin-top: 17px; }
.exception-table code { white-space: nowrap; }

.test-sequence { display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; border: 1px solid #dbe4ea; border-radius: 17px; }
.test-sequence article { position: relative; min-height: 235px; padding: 23px; border-right: 1px solid #e1e8ed; }
.test-sequence article:last-child { border-right: 0; }
.test-sequence article > span { position: absolute; top: 18px; right: 18px; color: #9aabb5; font-family: ui-monospace, monospace; font-weight: 800; }
.test-sequence .icon { width: 24px; margin: 40px 0 25px; color: #218bc9; }
.test-sequence strong { display: block; color: #263f51; }
.test-sequence p { margin: 6px 0 0; color: #647885; }
.tune-troubleshooting details > div,
.tune-faq details > div { line-height: 1.7; }

.support-callout { display: grid; grid-template-columns: 48px 1fr; gap: 19px; margin-top: 20px; padding: 28px; border-radius: 18px; color: #e8f3f9; background: #0a1e31; }
.support-callout > .icon { width: 32px; color: #63bde7; }
.support-callout strong { display: block; }
.support-callout p { margin: 6px 0 12px; color: #92a8b5; }
.support-callout a { display: inline-flex; align-items: center; gap: 7px; color: #bce5fb; font-weight: 800; }
.support-callout a .icon { width: 15px; }

.final-checklist { display: grid; grid-template-columns: 0.72fr 1.28fr; gap: 35px; margin-top: 20px; padding: 29px; border: 1px solid #dbe4ea; border-radius: 18px; }
.final-checklist small { color: #218bc9; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.final-checklist h3 { margin-top: 4px; color: #213c4f; }
.final-checklist ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.final-checklist li { position: relative; padding-left: 26px; color: #5d7180; }
.final-checklist li::before { position: absolute; left: 0; content: "✓"; color: #15915e; font-weight: 900; }

.final-principle { display: grid; grid-template-columns: 47px 1fr; gap: 18px; align-items: center; margin-top: 18px; padding: 29px; border-radius: 18px; color: #e6f2f8; background: #0a1e31; }
.final-principle > .icon { width: 34px; color: #63bde7; }
.final-principle small { display: block; margin-bottom: 5px; color: #65bce5; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.final-principle strong { display: block; line-height: 1.3; }

@media (max-width: 1050px) {
  .tuning-path > div { padding: 17px; }
  .trusted-examples { grid-template-columns: repeat(2, 1fr); }
  .trusted-examples span { border-bottom: 1px solid #e1e8ed; }
  .trusted-examples span:nth-child(2n) { border-right: 0; }
  .trusted-examples span:nth-last-child(-n + 2) { border-bottom: 0; }
  .default-restrictions { grid-template-columns: repeat(3, 1fr); }
  .default-restrictions span { border-bottom: 1px solid #e1e8ed; }
  .default-restrictions span:nth-child(3) { border-right: 0; }
  .default-restrictions span:nth-last-child(-n + 2) { border-bottom: 0; }
  .test-sequence { grid-template-columns: repeat(2, 1fr); }
  .test-sequence article { border-bottom: 1px solid #e1e8ed; }
  .test-sequence article:nth-child(2n) { border-right: 0; }
  .test-sequence article:nth-last-child(-n + 2) { border-bottom: 0; }
}

@media (max-width: 820px) {
  .tuning-path { grid-template-columns: 1fr; }
  .tuning-path > div { min-height: 102px; grid-template-columns: 38px 1fr; align-items: center; column-gap: 12px; }
  .tuning-path .icon { grid-row: 1 / 3; margin: 0; }
  .tuning-path > div > span { top: 12px; }
  .tuning-path > i { padding: 6px 0; text-align: center; transform: rotate(90deg); }
  .tune-intro-grid { grid-template-columns: 1fr; gap: 48px; }
  .learning-panel { grid-template-columns: 1fr; }
  .learning-clock { min-height: 215px; }
  .learning-clock .icon { margin-bottom: 28px; }
  .source-choice { grid-template-columns: 1fr; }
  .source-choice article { min-height: 0; }
  .block-layout { grid-template-columns: 1fr; }
  .default-restrictions { grid-template-columns: repeat(2, 1fr); }
  .default-restrictions span,
  .default-restrictions span:nth-child(3) { border-right: 1px solid #e1e8ed; border-bottom: 1px solid #e1e8ed; }
  .default-restrictions span:nth-child(2n) { border-right: 0; }
  .default-restrictions span:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
}

@media (max-width: 560px) {
  .tuning-path > div { min-height: 88px; }
  .tune-overview-preview { margin-top: 20px; }
  .tune-overview-preview figcaption { display: none; }
  .blocked-note { grid-template-columns: 1fr; }
  .tune-checklist { padding: 25px; }
  .learning-checks,
  .rule-origin-grid,
  .trusted-examples,
  .anonymous-meaning,
  .test-sequence,
  .final-checklist { grid-template-columns: 1fr; }
  .learning-checks span,
  .learning-checks span:nth-child(2n),
  .learning-checks span:nth-last-child(-n + 2),
  .trusted-examples span,
  .trusted-examples span:nth-child(2n),
  .trusted-examples span:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid #e1e8ed; }
  .learning-checks span:last-child,
  .trusted-examples span:last-child { border-bottom: 0; }
  .admin-test-note,
  .block-search-tip { grid-template-columns: 1fr; }
  .resolution-steps article { grid-template-columns: 39px 1fr; gap: 14px; padding: 21px 17px; }
  .resolution-steps article > span { width: 36px; height: 36px; }
  .scope-comparison { grid-template-columns: 1fr; }
  .scope-comparison > i { text-align: center; transform: rotate(90deg); }
  .rule-origin-grid article { min-height: 0; }
  .protection-note,
  .bot-control-callout,
  .support-callout { grid-template-columns: 1fr; }
  .source-choice article { padding: 23px; }
  .block-steps article { padding: 20px 17px; }
  .default-restrictions { grid-template-columns: 1fr; }
  .default-restrictions span,
  .default-restrictions span:nth-child(2n),
  .default-restrictions span:nth-child(3),
  .default-restrictions span:last-child { grid-column: auto; border-right: 0; border-bottom: 1px solid #e1e8ed; }
  .default-restrictions span:last-child { border-bottom: 0; }
  .exception-list > article { grid-template-columns: 1fr; padding: 25px 20px; }
  .test-sequence article,
  .test-sequence article:nth-child(2n),
  .test-sequence article:nth-last-child(-n + 2) { min-height: 0; border-right: 0; border-bottom: 1px solid #e1e8ed; }
  .test-sequence article:last-child { border-bottom: 0; }
  .test-sequence .icon { margin-top: 25px; }
  .final-checklist { gap: 20px; }
  .final-principle { grid-template-columns: 1fr; }
}
