/* Kodela docs, feature group 2: git & provenance, audit, administration,
   integrations, and the policy-key reference. Built on kit.css tokens and the
   docs.css reading layout; every rule is scoped under .df2 so it cannot reach
   another group's page. Instruments are readable with JS off; the classes that
   only matter once JS has run sit under .is-live. */

.df2 code { overflow-wrap: anywhere; }
.df2 ::selection { background: var(--amber-soft); }
.df2 .kd-docs__body > p code, .df2 .kd-docs__body li code, .df2 .dg-kv dd code { font: 500 .88em/1.2 var(--f-mono); background: var(--elevated); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
/* a command block inside a list step keeps the code block's own dark face, not the inline chip */
.df2 .kd-docs__body li .kd-code pre code { font: inherit; background: none; border: 0; border-radius: 0; padding: 0; }
.df2-lbl { display: block; margin-bottom: 5px; font: 600 .7rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dimmer); }
.df2-note { color: var(--ink-dimmer); font-style: italic; }
.df2 .kd-module__bar .kd-tag { margin-left: auto; }

/* ---------- policy keys: tools ---------- */
.df2-keys { display: flex; flex-direction: column; gap: 14px; padding-bottom: 6px; }
.df2-keys__tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.df2-search { flex: 1 1 260px; }
.df2-select { flex: 0 1 260px; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 48px; padding: 6px 12px; border-radius: 10px; background: var(--bay); box-shadow: var(--well); }
.df2-select label { font: 600 .7rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dimmer); }
.df2-select select { width: 100%; border: 0; background: none; font: 500 .92rem/1.2 var(--f-sans); color: var(--ink); cursor: pointer; padding: 2px 0; }
.df2-select:focus-within { box-shadow: var(--well), 0 0 0 2px var(--focus); }
.df2-select select:focus { outline: none; }
.df2-keys__count { margin: 0 !important; font: 500 .8rem/1.3 var(--f-mono) !important; color: var(--ink-dimmer) !important; max-width: none !important; }
.df2-keys__scroll { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); max-height: min(78vh, 920px); overflow: auto; overscroll-behavior: contain; scroll-padding-top: 12px; }
.df2-keys__scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.df2-keys__scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid var(--panel); }
.df2-keys__scroll { scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }

/* ---------- policy keys: the command builder (JS only) ---------- */
.df2-built { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--elevated); border: 1px solid var(--line); }
.df2-built[hidden] { display: none; }
.df2-built__head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.df2-built__key { margin: 0 !important; min-width: 0; flex: 1 1 200px; }
.df2-built__key code { font: 600 .95rem/1.3 var(--f-mono); color: var(--ink); overflow-wrap: anywhere; }
.df2-built__scope button[disabled] { opacity: .38; cursor: not-allowed; }
.df2-built__val { display: flex; flex-direction: column; flex: 1 1 200px; }
.df2-built__val input { min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); padding: 0 10px; font: 500 .88rem/1 var(--f-mono); color: var(--ink); caret-color: var(--amber); min-width: 0; }
.df2-built__val input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.df2-built pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.df2-built__note { margin: 0 !important; font-size: .9rem; }
.df2-built .p { color: var(--lcd-dim); }
.df2-built .c { color: var(--lcd-dim); }

/* ---------- policy keys: table (rows are grids so they read in a narrow column) ---------- */
.df2-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.df2-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.df2-table tbody tr[data-key] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr); grid-template-areas: "k h h" "d a s"; gap: 10px 18px; padding: 14px 16px; border-top: 1px solid var(--line); scroll-margin-top: 64px; transition: background .35s var(--ease), box-shadow .35s var(--ease); }
.df2-table tbody tr[data-key] > * { padding: 0; text-align: left; vertical-align: top; min-width: 0; }
.df2-table tbody th { grid-area: k; font-weight: 400; }
.df2-table .df2-help { grid-area: h; color: var(--ink-dim); line-height: 1.5; }
.df2-table .df2-def { grid-area: d; }
.df2-table .df2-allow { grid-area: a; color: var(--ink-dim); line-height: 1.45; }
.df2-table .df2-scope { grid-area: s; display: flex; flex-direction: column; gap: 6px; color: var(--ink-dim); }
.df2-table .df2-help code, .df2-table .df2-def code, .df2-table .df2-allow code { font: 500 .82rem/1.3 var(--f-mono); color: var(--ink); background: var(--elevated); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; }
.df2-k { display: inline; font: 600 .88rem/1.5 var(--f-mono); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; border-bottom: 1px dashed var(--line-strong); }
.df2-k:hover { color: var(--amber-text); border-bottom-color: var(--amber); }
.df2-k:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.df2-table tbody th small { display: block; margin-top: 5px; font: 400 .84rem/1.35 var(--f-sans); color: var(--ink-dimmer); }
.df2-sc { font: 500 .8rem/1.3 var(--f-mono); color: var(--ink); }
.df2-restart { font: 500 .78rem/1.3 var(--f-mono); }
.df2-rs { color: var(--amber-text); }
.df2-rs::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--amber-led); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.df2-scope small { font-size: .8rem; line-height: 1.4; color: var(--ink-dimmer); }
.df2-rule { justify-self: start; align-self: flex-start; display: inline-flex; font: 600 .7rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--ink-dim); background: var(--elevated); white-space: nowrap; }
.df2-rule:not([data-r="replace"]) { color: var(--amber-text); border-color: rgba(184,106,0,.45); background: #fff; }
.df2-table tr.df2-group { display: block; position: sticky; top: 0; z-index: 2; }
.df2-table tr.df2-group th { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px 10px; background: var(--ground); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); font: 700 .8rem/1 var(--f-cond); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); text-align: left; scroll-margin-top: 90px; }
.df2-table tr.df2-group th span { font: 500 .72rem/1 var(--f-mono); letter-spacing: .04em; text-transform: none; color: var(--ink-dimmer); }
.df2-table tr[hidden] { display: none !important; }
.df2-table tbody tr.is-picked { background: #fffaf2; box-shadow: inset 0 0 0 1.5px rgba(184,106,0,.45); }
.df2-table tbody tr.is-target { background: var(--amber-soft); }
.df2-table tbody tr[data-key]:target { background: var(--amber-soft); }
.df2-empty { padding: 18px 16px; margin: 0 !important; }

/* rules list and profile table */
.df2-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 0 28px; border-top: 1.5px solid var(--ink); }
.df2-rules > div { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px dashed var(--line-strong); }
.df2-rules p { margin: 0; font-size: .94rem; }
.df2-mini-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.df2-prof td { font: 500 .82rem/1.3 var(--f-mono); }

/* ---------- shared instrument frame for the four feature pages ---------- */
.df2-inst { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.df2-inst__ctl { display: flex; flex-wrap: wrap; gap: 12px 20px; min-width: 0; }
.df2-field.is-off > span::after { content: " · not used on this route"; text-transform: none; letter-spacing: 0; }
.df2-inst__out { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.df2-field { display: flex; flex-direction: column; gap: 6px; }
.df2-field > span { font: 600 .7rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dimmer); }
.df2-field .dg-seg { flex-wrap: wrap; align-self: flex-start; max-width: 100%; }
.df2-field .dg-seg button[aria-pressed="true"][data-bad] { background: var(--ink); color: #fff; }
.df2-tty { margin: 0; min-height: 190px; padding: 14px 16px; border-radius: 12px; background: var(--lcd); box-shadow: inset 0 2px 8px rgba(0,0,0,.55); font: 500 .8rem/1.6 var(--f-mono); color: #e3e5ea; white-space: pre-wrap; overflow-wrap: anywhere; }
.df2-tty .p { color: var(--lcd-dim); }
.df2-tty .d { color: var(--lcd-dim); }
.df2-tty .a { color: var(--lcd-ink); }
.df2-tty .x { color: #fff; background: rgba(240,138,0,.22); border-radius: 3px; padding: 0 2px; }
.df2-tty .s { text-decoration: line-through; text-decoration-thickness: 1.5px; color: #9aa0aa; }
.df2-verdict { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 10px; background: var(--lcd); box-shadow: inset 0 2px 6px rgba(0,0,0,.5); font: 600 .8rem/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--lcd-ink); }
.df2-verdict .kd-led { flex: none; }
.df2-verdict[data-v="refuse"] { color: #fff; }
.df2-verdict[data-v="refuse"] .kd-led { background: var(--lcd-dim); box-shadow: none; }
.df2-stamp { margin-left: auto; padding: 4px 8px; border: 2px solid currentColor; border-radius: 4px; font: 700 .78rem/1 var(--f-cond); letter-spacing: .14em; transform: rotate(-3deg); }
.df2-why { margin: 0 !important; font-size: .92rem; color: var(--ink-dim); }
@media (prefers-reduced-motion: no-preference) {
  .df2 .is-live .df2-stamp { animation: df2-stamp .32s var(--ease); }
  .df2 .is-live .df2-flash { animation: df2-flash .6s var(--ease); }
}
@keyframes df2-stamp { from { transform: rotate(-3deg) scale(1.35); opacity: 0; } to { transform: rotate(-3deg) scale(1); opacity: 1; } }
@keyframes df2-flash { from { background: var(--amber-soft); } to { background: transparent; } }

/* sign-in trace and credential path: a row of stations */
.df2 ol.df2-path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 8px; }
.df2-path > li { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); max-width: none !important; font-size: .86rem !important; line-height: 1.4; color: var(--ink-dim); transition: border-color .3s var(--ease), background .3s var(--ease), opacity .3s var(--ease); }
.df2-path > li b { font: 700 .76rem/1.1 var(--f-cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.df2-path > li b::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: none; transition: background .3s; }
.df2-path > li.is-on { border-color: rgba(184,106,0,.5); background: #fffaf2; }
.df2-path > li.is-on b::before { background: var(--amber-led); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.df2-path > li.is-stop { border-color: var(--ink); background: var(--panel); }
.df2-path > li.is-stop b::before { background: var(--ink); }
.df2-path > li.is-off { border-style: dashed; border-color: var(--line-strong); background: transparent; color: var(--ink-dimmer); }
.df2-path > li.is-off b { color: var(--ink-dimmer); }
.df2-path code { font: 500 .78rem/1.3 var(--f-mono); color: var(--ink); overflow-wrap: anywhere; }
.df2-status { align-self: flex-start; font: 600 .7rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 3px 5px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--ink-dim); }
.df2-status[data-s="verified"] { color: var(--amber-text); border-color: rgba(184,106,0,.45); }
.df2-pick { display: flex; flex-wrap: wrap; gap: 8px; }

/* SIEM field map */
.df2-map td:first-child, .df2-map th[scope="row"] { font: 600 .82rem/1.3 var(--f-mono); color: var(--ink); white-space: nowrap; }
.df2-map td { font-size: .88rem; }

/* sample record */
.df2-record pre { white-space: pre; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .df2-inst { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .df2-table tbody tr[data-key] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "k k" "h h" "d a" "s s"; padding: 14px 12px; }
  .df2-keys__scroll { max-height: none; overflow: visible; }
  .df2-table tr.df2-group { position: static; }
  .df2 ol.df2-path { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 460px) {
  .df2-table tbody tr[data-key] { grid-template-columns: minmax(0, 1fr); grid-template-areas: "k" "h" "d" "a" "s"; }
  .df2-select { flex-basis: 100%; }
}
@media (pointer: coarse) {
  .df2 .dg-seg button { min-height: 44px; }
  .df2 .kd-chip { min-height: 44px; }
  .df2-k { padding: 8px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .df2-table tbody tr[data-key], .df2-path > li { transition: none; }
}
.df2 .kd-module__bar { flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 460px) { .df2 .kd-module__bar .kd-tag { margin-left: 0; } }
.df2 .kd-code__bar { flex-wrap: wrap; row-gap: 6px; }
.df2 .dg-steps > li > div { min-width: 0; }
.df2 .dg-steps .kd-code { margin-top: 10px; }
.df2 .dg-steps b { color: var(--ink); }
.df2-day input { min-height: 40px; width: 15ch; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); padding: 0 10px; font: 500 .88rem/1 var(--f-mono); color: var(--ink); caret-color: var(--amber); }
.df2-day input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.df2-day input[aria-invalid="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.df2-streams { flex-basis: 100%; }
.df2-sample { min-height: 0; }
.df2-why code { font: 500 .8rem/1.4 var(--f-mono); color: var(--ink); overflow-wrap: anywhere; }
.df2 pre[data-df2-cmd] { white-space: pre-wrap; overflow-wrap: anywhere; }
.df2-cred { display: flex; flex-direction: column; gap: 12px; }
.df2-cred__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.df2-cred__head b { font: 700 1.1rem/1.1 var(--f-cond); text-transform: uppercase; letter-spacing: .02em; color: var(--ink); }
.df2-cred ol.df2-path { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.df2-signin ol.df2-path { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1280px) { .df2-cred ol.df2-path { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .df2-cred ol.df2-path, .df2-signin ol.df2-path { grid-template-columns: minmax(0, 1fr); } }
