/* Shared site styles (used by Razor Pages + /ui Blazor) */

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }
body { font-family: system-ui, Arial, sans-serif; margin: 0; min-height: 100%; display: flex; flex-direction: column; }
main { flex: 1; }
header { padding: 12px 16px; background: #0b1220; color: #fff; display:flex; align-items:center; justify-content:space-between; }
header a { color: #fff; text-decoration: none; margin-right: 12px; }
header a:hover { text-decoration: underline; }
header details.navdrop { display:inline-block; margin-right: 10px; position: relative; }
header details.navdrop > summary { list-style: none; cursor: pointer; display:inline-block; color:#fff; margin-right: 12px; }
header details.navdrop > summary::-webkit-details-marker { display:none; }
header details.navdrop[open] > summary { text-decoration: underline; }
header .navdrop-menu {
  position: absolute;
  top: 28px;
  left: 0;
  background: #0b1220;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 10px;
  min-width: 220px;
  z-index: 50;
}
header .navdrop-menu a { display:block; margin: 6px 0; }

.badge { display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:999px; font-size: 13px; }
.badge.ok { background: rgba(34,197,94,.18); border: 1px solid rgba(34,197,94,.35); color:#dcfce7; }
.badge.warn { background: rgba(245,158,11,.18); border: 1px solid rgba(245,158,11,.35); color:#fffbeb; }

/* Header helpers (avoid inline styles, CSP-friendly) */
.brand-link { display:inline-flex; align-items:center; gap:10px; margin-right: 8px; }
.landing-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.landing-brand { display:inline-flex; align-items:center; gap:12px; color:#fff; text-decoration:none; }
.logo-sm { height:24px; width:auto; display:inline-block; }
.logo-lg { height:32px; width:auto; display:inline-block; }
.lang-switch { display:inline-flex; align-items:center; gap:8px; }
.lang-divider { color:#fff; opacity:.8; }
.lang-link { text-decoration:none; color:#fff; opacity:.9; }
.lang-link.active { font-weight:700; }
.inline-form { display:inline; }
.mr-10 { margin-right: 10px; }
.hidden { display:none !important; }
.text-center { text-align:center; }
.max-w-500 { max-width: 500px; }
.mx-auto { margin-left:auto; margin-right:auto; }
.my-40 { margin-top:40px; margin-bottom:40px; }

/* Default content width: a bit wider for proof tables */
main { padding: 16px; max-width: 1400px; margin: 0 auto; width: 100%; }
@media (min-width: 1800px) { main { max-width: 1600px; } }
.card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; background: #fff; }
.grid { display:grid; grid-template-columns: 1fr; gap: 12px; }
.grid.cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 14px; }
.grid.status { gap: 8px; margin-top: 10px; }
.row-flex { display:flex; align-items:center; }
.status-row { display:flex; align-items:center; gap: 10px; }
.status-dot { width:10px; height:10px; border-radius:999px; background:#9ca3af; display:inline-block; }
.mt-0 { margin-top: 0; }

/* Small tooltip icon */
.info-icon {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 18px;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1;
  cursor: help;
  user-select: none;
}

/* Footer (landing) */
.site-footer { border-top: 1px solid #e5e7eb; padding: 18px 16px; background: #fff; }
.site-footer-inner { max-width: 1100px; margin: 0 auto; display:flex; align-items:center; justify-content:space-between; gap: 12px; flex-wrap: wrap; }
.site-footer-links { display:flex; gap: 14px; flex-wrap: wrap; }
.site-footer a { color: #374151; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Landing page */
.landing-page {
  color: #102033;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.landing-page h1,
.landing-page h2,
.landing-page h3,
.landing-page p {
  letter-spacing: 0;
}

.landing-page h1 {
  margin: 0;
  max-width: 840px;
  font-size: 4rem;
  line-height: 1.02;
}

.landing-page h2 {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.12;
}

.landing-page h3 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.25;
}

.landing-page p {
  line-height: 1.65;
}

.landing-hero {
  min-height: min(720px, calc(100vh - 100px));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  align-items: center;
  padding: 54px;
  border: 1px solid #d7e3ea;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(248,250,252,0.94), rgba(236,253,245,0.74)),
    linear-gradient(90deg, #f8fafc, #eff6ff);
  overflow: hidden;
}

.landing-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.landing-kicker {
  margin: 0;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.landing-lead {
  max-width: 820px;
  margin: 0;
  color: #425466;
  font-size: 1.08rem;
}

.landing-hero-statement {
  margin: 0;
  color: #102033;
  font-size: 1.18rem;
  font-weight: 850;
}

.landing-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.landing-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
}

.landing-button.primary {
  background: #0f766e;
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.22);
}

.landing-button.secondary {
  background: #fff;
  border-color: #b7c8d6;
  color: #102033;
}

.landing-button.compact {
  min-height: 40px;
  align-self: flex-start;
  background: #102033;
  color: #fff;
}

.landing-hero-panel {
  display: flex;
  justify-content: center;
}

.proof-card {
  width: min(100%, 420px);
  padding: 22px;
  border: 1px solid rgba(16,32,51,0.14);
  border-radius: 8px;
  background: rgba(255,255,255,0.86);
  box-shadow: 0 24px 80px rgba(16,32,51,0.16);
  backdrop-filter: blur(10px);
}

.proof-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #536475;
  font-size: 0.9rem;
  font-weight: 700;
}

.proof-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: #94a3b8;
}

.proof-dot.ok {
  background: #16a34a;
  box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.13);
}

.proof-card h2 {
  margin-top: 16px;
  font-size: 1.55rem;
}

.proof-card dl {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.proof-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}

.proof-card dt {
  color: #64748b;
  font-weight: 700;
}

.proof-card dd {
  margin: 0;
  color: #102033;
  text-align: right;
}

.proof-timeline {
  display: grid;
  gap: 8px;
}

.proof-timeline span {
  padding: 9px 10px;
  border-radius: 8px;
  background: #ecfdf5;
  color: #14532d;
  font-size: 0.92rem;
  font-weight: 700;
}

.landing-section {
  padding: 40px 8px;
}

.landing-section-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 900px;
  margin-bottom: 20px;
}

.landing-section-heading p {
  margin: 0;
  color: #536475;
}

.landing-summary {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 30px;
  align-items: start;
  padding: 44px 0;
  border-bottom: 1px solid #dfe8ef;
}

.landing-summary p:last-child {
  margin: 0;
  color: #425466;
  font-size: 1.03rem;
}

.landing-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.landing-card-grid.access {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.landing-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 22px;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(16,32,51,0.05);
}

.landing-card.accent {
  border-top: 4px solid #0f766e;
}

.landing-card p {
  margin: 0;
  color: #536475;
}

.landing-card ul {
  margin: 0;
  padding-left: 20px;
  color: #334155;
  line-height: 1.55;
}

.landing-card-label {
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.landing-card-strong {
  color: #102033 !important;
  font-weight: 800;
}

.landing-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.landing-section-callout {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 4px solid #1d4ed8;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 850;
}

.landing-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
  align-items: start;
  padding: 34px;
  border-radius: 8px;
  background: #102033;
  color: #fff;
}

.landing-band p {
  margin-top: 0;
  color: #dbe6ef;
}

.landing-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.landing-chip-list span,
.landing-example-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 8px;
  font-weight: 700;
}

.landing-chip-list span {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
}

.landing-security {
  border-bottom: 1px solid #dfe8ef;
}

.landing-note {
  max-width: 1000px;
  padding: 18px 20px;
  border-left: 4px solid #0f766e;
  border-radius: 8px;
  background: #f0fdfa;
  color: #134e4a;
  line-height: 1.65;
}

.landing-example-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.landing-example-grid span {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1e3a8a;
}

.landing-conclusion {
  margin: 18px 0 0;
  color: #102033;
  font-weight: 800;
}

.landing-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.landing-link-row a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #102033;
  text-decoration: none;
  font-weight: 700;
}

.landing-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
  border-radius: 8px;
  background: #ecfdf5;
}

.landing-contact p {
  max-width: 780px;
  color: #315164;
}

.contact-hero {
  max-width: 920px;
  padding: 42px 0;
}

.contact-hero h1 {
  margin: 0;
}

.contact-hero > p:not(.landing-kicker) {
  color: #425466;
}

.contact-support-bridge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
}

.contact-support-bridge p {
  color: #315164;
}

.support-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.support-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.support-info-list li {
  padding: 12px 14px;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  line-height: 1.45;
}

.support-warning {
  max-width: none;
  border-left-color: #b91c1c;
  background: #fef2f2;
  color: #7f1d1d;
}

.service-status-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.service-status-list .status-row {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
  background: #fff;
}

.service-status-list .status-row span:nth-child(2) {
  flex: 1 1 auto;
}

.status-ok {
  background: #16a34a;
}

.support-links {
  margin-top: 0;
}

.service-status {
  padding-top: 12px;
}

@media (max-width: 980px) {
  .landing-hero,
  .landing-summary,
  .landing-band {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    padding: 34px 22px;
  }

  .landing-page h1 {
    font-size: 3rem;
  }

  .landing-page h2 {
    font-size: 1.9rem;
  }

  .landing-card-grid,
  .landing-card-grid.access,
  .landing-split {
    grid-template-columns: 1fr;
  }

  .landing-example-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-contact {
    align-items: flex-start;
    flex-direction: column;
  }

  .contact-support-bridge {
    align-items: flex-start;
    flex-direction: column;
  }

  .support-card-grid,
  .service-status-list,
  .support-info-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  main {
    padding: 12px;
  }

  .landing-page {
    gap: 18px;
  }

  .landing-hero {
    min-height: auto;
    padding: 26px 16px;
  }

  .landing-page h1 {
    font-size: 2.25rem;
  }

  .landing-actions,
  .landing-actions .landing-button {
    width: 100%;
  }

  .landing-card {
    padding: 18px;
  }

  .landing-band,
  .landing-contact {
    padding: 24px 18px;
  }

  .landing-example-grid {
    grid-template-columns: 1fr;
  }
}

label { display:block; margin-bottom: 6px; font-weight: 600; }
input, select { padding: 8px; width: 100%; max-width: 720px; }

button { padding: 10px 14px; border-radius: 8px; border: none; background:#2563eb; color:#fff; cursor:pointer; }
button.secondary { background:#374151; }

.muted { color:#6b7280; }
.error { color:#b91c1c; }

/* Small layout utilities (to avoid inline styles, for strict CSP) */
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-4 { margin-top: 4px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-120 { width: 120px; }
.col-w-160 { width: 160px; }
.col-w-180 { width: 180px; }

.alert-box {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
}
.alert-success {
  border-color: #badbcc;
  background: #d1e7dd;
  color: #0f5132;
}
.alert-error {
  border-color: #f5c2c7;
  background: #f8d7da;
  color: #842029;
}
.text-success-strong {
  color:#16A34A;
  font-weight:600;
}
.code-block {
  display:block;
  white-space:pre-wrap;
  word-break:break-word;
}

table { width:100%; border-collapse: collapse; }
th, td { text-align:left; padding: 8px; border-bottom: 1px solid #e5e7eb; }
code { background:#f3f4f6; padding:2px 6px; border-radius: 6px; }

/* Pager / filters */
.row > div { min-width: 220px; }
.row input[type="datetime-local"] { max-width: 260px; }

/* Proofs table */
.proofs-table { width:100%; border-collapse: collapse; table-layout: fixed; }
.proofs-table th, .proofs-table td { vertical-align: top; }
.proofs-table td code { display:inline-block; max-width: 100%; overflow-wrap:anywhere; word-break: break-word; }
.pill { display:inline-block; padding:2px 8px; border-radius:999px; background:#eef2ff; color:#1e3a8a; font-size: 12px; }
details.tree { border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; margin: 10px 0; background:#fff; }
details.tree > summary { cursor: pointer; }

/* Dashboard */
.dash-grid { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dash-card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 14px; background:#fff; }
.dash-kpi { font-size: 26px; font-weight: 800; letter-spacing: .2px; color:#0f172a; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .dash-grid { grid-template-columns: 1fr; } }

/* Attribute proof verification */
.verify-result-valid { border-left: 4px solid #16A34A; }
.verify-result-invalid { border-left: 4px solid #B42318; }
.card-result-valid { border-left: 4px solid #16A34A; }
.card-result-invalid { border-left: 4px solid #B42318; }

/* ===== Help system ===== */

.help-layout { display:grid; grid-template-columns: 300px 1fr; gap: 16px; margin-top:14px; align-items:start; }
@media (max-width: 860px) { .help-layout { grid-template-columns: 1fr; } }
.help-sidebar { position:sticky; top:12px; }
.help-sidebar h3 { margin-top:0; margin-bottom:10px; }

.help-header { margin-bottom:16px; }
.help-header h3 { margin-top:0; margin-bottom:6px; }
.help-header p { margin:0; }

.help-tip, .help-warning, .help-info, .help-prereq {
  padding: 12px 14px;
  border-radius: 8px;
  margin: 12px 0;
  font-size: 14px;
  line-height: 1.5;
}
.help-tip {
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
  color: #14532d;
}
.help-warning {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  color: #78350f;
}
.help-info {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  color: #1e3a5f;
}
.help-prereq {
  background: #faf5ff;
  border-left: 4px solid #a855f7;
  color: #3b0764;
}
.help-tip strong, .help-warning strong, .help-info strong, .help-prereq strong { display:block; margin-bottom:4px; }

.help-steps { counter-reset: help-step; list-style: none; padding:0; margin: 14px 0; }
.help-steps li {
  counter-increment: help-step;
  position: relative;
  padding: 10px 12px 10px 48px;
  margin: 8px 0;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  line-height: 1.5;
}
.help-steps li::before {
  content: counter(help-step);
  position: absolute;
  left: 12px;
  top: 10px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-flow { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin: 14px 0; }
.help-flow-step {
  padding: 8px 14px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
}
.help-flow-arrow { color:#94a3b8; font-size:18px; line-height:1; }

.help-faq { margin: 14px 0; }
.help-faq details {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 6px 0;
  background: #fff;
}
.help-faq details summary {
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
}
.help-faq details[open] summary { border-bottom: 1px solid #e5e7eb; }
.help-faq details .faq-body { padding: 10px 14px; color: #475569; font-size: 14px; line-height: 1.5; }

.help-related { margin-top: 20px; padding-top: 14px; border-top: 1px solid #e5e7eb; }
.help-related h4 { margin-top:0; margin-bottom:8px; color:#64748b; font-size:13px; text-transform:uppercase; letter-spacing:.5px; }
.help-related a { display:inline-block; margin-right:16px; margin-bottom:6px; font-size:14px; }

.help-table { width:100%; border-collapse:collapse; margin:12px 0; font-size:14px; }
.help-table th { text-align:left; padding:8px 10px; background:#f8fafc; border-bottom:2px solid #e2e8f0; font-weight:600; color:#334155; }
.help-table td { padding:8px 10px; border-bottom:1px solid #f1f5f9; color:#475569; }
.help-table tr:hover td { background:#f8fafc; }

.help-quickstart { background:linear-gradient(135deg,#eff6ff 0%,#f0fdf4 100%); border:1px solid #bfdbfe; border-radius:10px; padding:16px; margin-bottom:16px; }
.help-quickstart h4 { margin-top:0; margin-bottom:10px; color:#1e40af; }
.help-quickstart ol { margin:0; padding-left:22px; }
.help-quickstart li { margin:6px 0; line-height:1.5; }

.help-cols { display:grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap:12px; margin:12px 0; }
.help-cols .card h4 { margin-top:0; }

/* ===== PoA console ===== */
.console-nav-card,
.support-console-card {
  margin-top:12px;
  background:#f8fafc;
}
.console-nav-title,
.support-console-title {
  margin-bottom:8px;
}
.poa-console-nav {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin: 12px 0 16px;
}
.console-nav-card .poa-console-nav,
.support-console-card .poa-console-nav {
  margin:0;
}
.poa-console-nav a {
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#334155;
  text-decoration:none;
  font-size:14px;
}
.poa-console-nav a.active {
  background:#0f172a;
  border-color:#0f172a;
  color:#fff;
}
.section-pill-row {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.section-pill {
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#334155;
  text-decoration:none;
  font-size:14px;
}
.section-pill.active {
  background:#0f172a;
  border-color:#0f172a;
  color:#fff;
}
.quick-filter-row {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}
.quick-filter-chip {
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  background:#eff6ff;
  color:#1d4ed8;
  text-decoration:none;
  border:1px solid #bfdbfe;
  font-size:14px;
}
.poa-kpi-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap:12px;
  margin: 14px 0 18px;
}
.poa-kpi-card {
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#fff;
  padding:14px;
}
.poa-kpi-label {
  color:#64748b;
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.4px;
}
.poa-kpi-value {
  font-size:28px;
  font-weight:800;
  margin:6px 0 4px;
  color:#0f172a;
}
.poa-kpi-success { color:#15803d; }
.poa-kpi-warning { color:#b45309; }
.poa-kpi-danger { color:#b91c1c; }
.poa-kpi-info { color:#1d4ed8; }
.poa-badge {
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  line-height:1.3;
  border:1px solid transparent;
}
.poa-badge-mono {
  font-family: Consolas, "Courier New", monospace;
}
.poa-badge-neutral {
  background:#f8fafc;
  border-color:#cbd5e1;
  color:#334155;
}
.poa-badge-info {
  background:#eff6ff;
  border-color:#bfdbfe;
  color:#1d4ed8;
}
.poa-badge-success {
  background:#f0fdf4;
  border-color:#bbf7d0;
  color:#166534;
}
.poa-badge-warning {
  background:#fffbeb;
  border-color:#fde68a;
  color:#92400e;
}
.poa-badge-danger {
  background:#fef2f2;
  border-color:#fecaca;
  color:#b91c1c;
}
.poa-panel-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:12px;
}
.poa-form-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap:12px;
}
.poa-editor-stack {
  display:flex;
  flex-direction:column;
  gap:6px;
}
.poa-form-actions {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin-top:16px;
}
.poa-checkbox-row {
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.poa-stack {
  display:flex;
  flex-direction:column;
  gap:16px;
}
.poa-detail-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap:12px;
}
.poa-timeline {
  display:flex;
  flex-direction:column;
  gap:10px;
}
.poa-timeline-item {
  position:relative;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:12px 14px 12px 22px;
  background:#fff;
}
.poa-timeline-item.success { border-left:4px solid #16a34a; }
.poa-timeline-item.warning { border-left:4px solid #f59e0b; }
.poa-timeline-item.danger { border-left:4px solid #dc2626; }
.poa-timeline-item.neutral { border-left:4px solid #94a3b8; }
.poa-timeline-marker {
  position:absolute;
  left:-8px;
  top:18px;
  width:12px;
  height:12px;
  border-radius:999px;
  background:#fff;
  border:3px solid #94a3b8;
}
.poa-timeline-item.success .poa-timeline-marker { border-color:#16a34a; }
.poa-timeline-item.warning .poa-timeline-marker { border-color:#f59e0b; }
.poa-timeline-item.danger .poa-timeline-marker { border-color:#dc2626; }
.poa-timeline-body {
  display:flex;
  flex-direction:column;
  gap:6px;
}
.poa-note {
  padding:12px 14px;
  border-radius:10px;
  border:1px solid #dbeafe;
  background:#eff6ff;
  color:#1d4ed8;
}
.poa-note.warning {
  border-color:#fde68a;
  background:#fffbeb;
  color:#92400e;
}
.poa-grid .dxbl-grid {
  border-radius:12px;
}
.poa-context-display {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  max-width: 360px;
}
.poa-context-display-main {
  color:#0f172a;
  line-height:1.35;
  white-space:normal;
}
.poa-grid-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.poa-badge-stack {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.agent-guard-signal-groups {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
}
.agent-guard-signal-group {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  text-align:left;
  padding:10px 12px;
  border:1px solid #dbeafe;
  border-radius:10px;
  background:#f8fafc;
  color:#0f172a;
}
.agent-guard-signal-group span {
  color:#64748b;
  font-size:12px;
  margin-right:8px;
}
.agent-guard-signal-group .poa-badge {
  flex:0 0 auto;
}
.agent-guard-path,
.agent-guard-command-preview {
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.agent-guard-command-preview {
  padding:4px 6px;
}
.agent-guard-signal-detail {
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:14px;
  border:1px solid #cbd5e1;
  border-radius:12px;
  background:#f8fafc;
}
.agent-guard-signal-detail-header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.agent-guard-signal-detail-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(260px, 1fr));
  gap:12px;
}
.agent-guard-signal-detail label {
  display:block;
  margin-bottom:4px;
  color:#475569;
  font-size:12px;
  font-weight:600;
  text-transform:uppercase;
}
.agent-guard-command-block {
  max-height:260px;
  overflow:auto;
  margin:0;
  padding:10px;
  border-radius:10px;
  background:#0f172a;
  color:#e2e8f0;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.agent-guard-command-block code {
  display:block;
  padding:0;
  border-radius:0;
  background:transparent;
  color:inherit;
  white-space:inherit;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.agent-guard-detail-value {
  display:block;
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
  line-height:1.45;
}
.poa-json-editor textarea {
  font-family: Consolas, "Courier New", monospace;
}

.mb-0 { margin-bottom: 0; }

.agent-guard-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: calc(100vh - 128px);
  min-height: 680px;
}

.agent-guard-shell-splitter {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
}

.agent-guard-shell-sidebar {
  width: 100%;
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.agent-guard-sidebar-splitter {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
}

.agent-guard-sidebar-pane {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.agent-guard-navigation-pane,
.agent-guard-sidebar-context-pane {
  padding: 0;
}

.agent-guard-sidebar-context-pane > .card,
.agent-guard-sidebar-context-pane > details.card {
  margin: 0;
}

.agent-guard-context-placeholder {
  height: 100%;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
}

.agent-guard-context-placeholder strong {
  color: #334155;
}

.agent-guard-context-placeholder p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.dash-card.selected {
  border-color:#60a5fa;
  background:#eff6ff;
  box-shadow:0 0 0 1px rgba(96,165,250,.24);
}

.agent-guard-runtime-rule-list {
  display:flex;
  flex-direction:column;
  gap:6px;
}

.agent-guard-runtime-rule-row {
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid #e5e7eb;
  border-radius:8px;
  background:#fff;
}

.agent-guard-shell-main {
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-left: 16px;
  overflow: auto;
}

.agent-guard-shell-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.agent-guard-shell-heading {
  flex: 1 1 420px;
  min-width: 0;
}

.agent-guard-shell-heading h2 {
  margin: 0;
}

.agent-guard-shell-heading p {
  margin: 8px 0 0;
}

.agent-guard-shell-toolbar {
  flex: 1 1 280px;
  min-width: min(280px, 100%);
}

.agent-guard-tree-panel {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
}

.agent-guard-tree-panel h3 {
  margin: 0;
  padding: 6px 8px 8px;
}

.agent-guard-tree-panel p {
  margin-top: 0;
  margin-bottom: 12px;
  padding: 0 8px;
}

.agent-guard-tree-panel .dxbl-treeview {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.agent-guard-tree-panel .dxbl-treeview,
.agent-guard-tree-panel .dxbl-treeview ul,
.agent-guard-tree-panel .dxbl-treeview li {
  max-width: none;
}

.agent-guard-tree-panel .dxbl-treeview .dxbl-treeview-item {
  width: 100%;
}

.agent-guard-shell-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

@media (max-width: 980px) {
  .agent-guard-shell {
    height: auto;
    min-height: 0;
  }

  .agent-guard-shell-splitter {
    min-height: 680px;
    overflow-x: auto;
  }

  .agent-guard-shell-sidebar {
    min-width: 260px;
  }

  .agent-guard-sidebar-splitter {
    min-height: 620px;
  }

  .agent-guard-shell-main {
    min-width: 480px;
  }
}

.agent-guard-tree-node-group {
  font-weight: 700;
}

.agent-guard-tree-node-active {
  font-weight: 700;
}

.agent-guard-policy-tree-summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  width:100%;
}

.agent-guard-policy-tree-actions {
  display:inline-flex;
  align-items:center;
  gap:4px;
}

.agent-guard-icon-button {
  padding:2px 6px;
  border:1px solid #cbd5e1;
  border-radius:6px;
  background:#f8fafc;
  color:#1f2937;
  font-size:11px;
  line-height:1.4;
}

.agent-guard-icon-button.danger {
  border-color:#fecaca;
  background:#fef2f2;
  color:#b91c1c;
}

.agent-guard-icon-button.danger:hover {
  border-color:#fca5a5;
  background:#fee2e2;
}

.agent-guard-icon-button.danger.confirm {
  font-weight:700;
  min-width:72px;
}

.agent-guard-policy-tree {
  list-style:none;
  margin:0;
  padding:0;
}

.agent-guard-policy-tree ul {
  list-style:none;
  margin:4px 0 4px 14px;
  padding-left:10px;
  border-left:1px solid #e5e7eb;
}

.agent-guard-policy-tree li {
  margin:4px 0;
}

.agent-guard-policy-tree-surfaces {
  display:flex;
  align-items:center;
  gap:6px;
  margin:4px 0 4px 14px;
  padding-left:10px;
  border-left:1px solid #e5e7eb;
}

.agent-guard-policy-tree-rules li {
  display:flex;
  align-items:center;
  gap:6px;
}

.agent-guard-policy-tree-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
}

.agent-guard-policy-tree-row.active {
  font-weight:700;
}

.agent-guard-policy-tree-node {
  flex:1 1 auto;
  min-width:0;
  padding:4px 6px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:#111827;
  text-align:left;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.agent-guard-policy-tree-node:hover,
.agent-guard-policy-tree-node.active {
  background:#eff6ff;
  color:#1d4ed8;
}

/* Flat policy list (sidebar) : reuse the same chromatics as the tree node. */
.agent-guard-policy-sidebar {
  padding:6px 0;
}

.agent-guard-policy-list {
  list-style:none;
  margin:0;
  padding:0;
}

.agent-guard-policy-list li {
  margin:0 0 4px 0;
  padding:0;
}

.agent-guard-policy-list-item {
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  padding:8px 10px;
  border:1px solid #cbd5e1;
  border-radius:6px;
  background:#f8fafc;
  color:#1f2937;
  text-align:left;
  cursor:pointer;
  font-size:13px;
}

.agent-guard-policy-list-item:hover {
  background:#eff6ff;
  border-color:#bfdbfe;
}

.agent-guard-policy-list-item.selected {
  background:#dbeafe;
  border-color:#3b82f6;
  color:#1e3a8a;
  font-weight:600;
}

.agent-guard-policy-list-item:disabled {
  opacity:0.6;
  cursor:not-allowed;
}

.agent-guard-policy-list-name {
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.agent-guard-policy-list-status {
  flex:0 0 auto;
  font-size:11px;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:0.04em;
}

.agent-guard-policy-list-badge {
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  padding:2px 8px;
  border-radius:12px;
  font-size:11px;
  font-weight:600;
  letter-spacing:0.02em;
}

.agent-guard-policy-list-badge.fs {
  background:#dcfce7;
  color:#166534;
  border:1px solid #86efac;
}

.agent-guard-policy-list-badge.net {
  background:#dbeafe;
  color:#1e40af;
  border:1px solid #93c5fd;
}

/* Duplicate detection badges (in rules grid) */
.agent-guard-rule-duplicate-badge {
  display:inline-block;
  padding:2px 8px;
  border-radius:10px;
  font-size:11px;
  font-weight:600;
  letter-spacing:0.02em;
  white-space:nowrap;
}

.agent-guard-rule-duplicate-badge.winner {
  background:#fef3c7;
  color:#92400e;
  border:1px solid #fcd34d;
}

.agent-guard-rule-duplicate-badge.inert {
  background:#fee2e2;
  color:#991b1b;
  border:1px solid #fca5a5;
}

.agent-guard-policy-tree-label {
  margin-right:4px;
}

.agent-guard-policy-tree-surface {
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  padding:2px 6px;
  border:1px solid #cbd5e1;
  border-radius:6px;
  background:#f8fafc;
  color:#334155;
  font-size:11px;
  font-weight:700;
  cursor:help;
}

.agent-guard-policy-treelist {
  width:100%;
  height:100%;
  min-height:0;
  overflow:auto;
}

.agent-guard-policy-treelist-grid {
  height:100%;
  min-width:390px;
}

.agent-guard-policy-treelist .dxbl-grid {
  height:100%;
  border:0;
  box-shadow:none;
}

.agent-guard-policy-treelist .dxbl-grid-table {
  font-size:12px;
}

.agent-guard-policy-treelist .dxbl-grid-header,
.agent-guard-policy-treelist .dxbl-grid-headers {
  display:none;
}

.agent-guard-policy-treelist .dxbl-grid-table,
.agent-guard-policy-treelist .dxbl-grid-table > tbody > tr > td {
  border-color:transparent;
}

.agent-guard-policy-treelist .dxbl-grid-table > tbody > tr > td {
  padding-top:4px;
  padding-bottom:4px;
}

.agent-guard-policy-tree-node.root {
  font-weight:700;
}

.agent-guard-policy-tree-line {
  display:inline-flex;
  align-items:center;
  gap:6px;
  max-width:100%;
}


/* ===== PoA workflow block builder ===== */
.wf-builder-overlay {
  position:fixed;
  inset:0;
  background:rgba(15,23,42,0.45);
  z-index:1040;
  display:flex;
  justify-content:flex-end;
}
.wf-builder-drawer {
  background:#f8fafc;
  width:100%;
  height:100%;
  overflow-y:auto;
  box-shadow:-8px 0 24px rgba(0,0,0,0.18);
  animation:wf-drawer-in 160ms ease-out;
}
@keyframes wf-drawer-in {
  from { transform:translateX(24px); opacity:0.6; }
  to { transform:translateX(0); opacity:1; }
}
.wf-builder-header {
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  padding:14px 20px;
  background:#fff;
  border-bottom:1px solid #e5e7eb;
}
.wf-builder-header h2 { margin:0; font-size:1.15rem; }
.wf-builder-header .spacer { flex:1 1 auto; }
.wf-builder-body {
  max-width:980px;
  margin:0 auto;
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:16px;
}
.wf-pipeline {
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:0;
}
.wf-connector {
  align-self:center;
  width:2px;
  height:18px;
  background:#cbd5e1;
}
.wf-block {
  border:1px solid #e5e7eb;
  border-left:4px solid #6366f1;
  border-radius:12px;
  background:#fff;
  padding:14px 16px;
}
.wf-block.emitter { border-left-color:#0ea5e9; }
.wf-block.step-approval { border-left-color:#16a34a; }
.wf-block.step-stepup { border-left-color:#7c3aed; }
.wf-block.step-notification { border-left-color:#0ea5e9; }
.wf-block.step-delay { border-left-color:#d97706; }
.wf-block.step-escalation { border-left-color:#dc2626; }
.wf-block-head {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.wf-block-head .title { font-weight:700; }
.wf-block-head .spacer { flex:1 1 auto; }
.wf-step-summary {
  color:#475569;
  font-size:0.92rem;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:10px;
  padding:8px 10px;
  margin-bottom:10px;
}
.wf-step-ports {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  border-top:1px dashed #e5e7eb;
  padding-top:10px;
  margin-top:10px;
  margin-bottom:10px;
}
.wf-step-badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:26px;
  height:26px;
  padding:0 8px;
  border-radius:999px;
  background:#eef2ff;
  color:#4338ca;
  font-weight:700;
  font-size:0.85rem;
}
.wf-chip {
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:2px 9px;
  border-radius:999px;
  font-size:0.8rem;
  font-weight:600;
  background:#f1f5f9;
  color:#334155;
}
.wf-chip.desk { background:#e0f2fe; color:#075985; }
.wf-chip.mobile { background:#dcfce7; color:#166534; }
.wf-chip.both { background:#fef9c3; color:#854d0e; }
.wf-chip.none { background:#fee2e2; color:#991b1b; }
.wf-approvers {
  margin-top:10px;
  border-top:1px dashed #e5e7eb;
  padding-top:10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.wf-approver-row {
  border:1px solid #eef2f7;
  border-radius:10px;
  background:#fafafa;
  padding:10px 12px;
}
.wf-empty-hint {
  color:#6b7280;
  font-style:italic;
  font-size:0.9rem;
}
.wf-step-runbook {
  margin-top:10px;
  border-top:1px dashed #e5e7eb;
  padding-top:10px;
}
.wf-runbook-toggle {
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  background:none;
  border:none;
  padding:4px 0;
  cursor:pointer;
  font:inherit;
  color:inherit;
  text-align:left;
}
.wf-runbook-caret {
  color:#6b7280;
  font-size:0.9em;
  width:1em;
}
.wf-runbook-body {
  margin-top:8px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.wf-runbook-item {
  display:flex;
  align-items:flex-start;
  gap:8px;
  border:1px solid #eef2f7;
  border-radius:10px;
  background:#fafafa;
  padding:8px 10px;
}
.wf-runbook-item .op-seq {
  min-width:24px;
  padding-top:6px;
}

/* Step editor: labelled sections + aligned 2-column grid */
.wf-section + .wf-section { margin-top:18px; }
.wf-section-title {
  margin:0 0 10px;
  font-size:0.72rem;
  font-weight:700;
  letter-spacing:0.05em;
  text-transform:uppercase;
  color:#64748b;
}
.poa-form-grid.cols-2 { grid-template-columns:repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .poa-form-grid.cols-2 { grid-template-columns:1fr; } }
.poa-form-grid .span-2 { grid-column:1 / -1; }

/* Conditional sub-panel (e.g. structured client response) */
.wf-subpanel {
  grid-column:1 / -1;
  border:1px solid #e2e8f0;
  border-left:3px solid #6366f1;
  border-radius:12px;
  background:#f8fafc;
  padding:14px 16px;
  margin-top:6px;
}
.wf-subpanel > .wf-section-title { margin-top:0; }

/* Readable key/label/action tables */
.wf-options-table { table-layout:fixed; }
.wf-options-table th, .wf-options-table td { padding:6px 8px; vertical-align:top; }
.wf-options-table col.col-key { width:34%; }
.wf-options-table col.col-label { width:48%; }
.wf-options-table col.col-action { width:18%; }

/* Generic collapsible section (step-template palette) */
.wf-collapse-toggle {
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  background:none;
  border:none;
  padding:2px 0;
  cursor:pointer;
  font:inherit;
  color:inherit;
  text-align:left;
}
.wf-collapse-caret { color:#6b7280; font-size:0.9em; width:1em; }
.wf-collapse-title { font-weight:700; font-size:1.05rem; }
.wf-collapse-body { margin-top:12px; }
.wf-required { color:#b42318; }
.wf-error-text { color:#b42318; }

/* Builder view toggle (Pipeline / Schéma) */
.wf-viewmode-toggle {
  display:inline-flex;
  border:1px solid #e5e7eb;
  border-radius:8px;
  overflow:hidden;
}
.wf-viewmode-toggle button {
  background:none;
  border:none;
  padding:5px 12px;
  font:inherit;
  font-size:0.85rem;
  color:#64748b;
  cursor:pointer;
}
.wf-viewmode-toggle button.active {
  background:#eff6ff;
  color:#185fa5;
  font-weight:500;
}

/* Read-only workflow graph (dxDiagram host) */
.wf-graph-legend {
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  margin-bottom:10px;
  font-size:0.85rem;
  color:#475569;
}
.wf-graph-legend-item { display:inline-flex; align-items:center; gap:6px; }
.wf-graph-swatch {
  width:12px;
  height:12px;
  border-radius:3px;
  border:1.5px solid #888780;
  display:inline-block;
}
.wf-graph-host {
  position:relative; /* anchor the dxDiagram floating toolbar inside the host, not over the page header */
  overflow:hidden;
  height:70vh;
  min-height:420px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#fff;
}
.wf-hidden { display:none; }
