:root {
  --ink: #080d17;
  --blue: #2d5be3;
  --cyan: #7aa7ff;
  --pale: #dce8ff;
  --bg: #f3f5f8;
  --muted: #606b7b;
  --line: #d9dee7;
}
.pbg-app-shell {
  min-height: 78vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  box-shadow: 0 24px 70px rgba(5, 14, 28, .12);
}
.pbg-app-shell * { box-sizing: border-box; }
.pbg-app-nav {
  padding: 25px 16px;
  background: linear-gradient(160deg, #080d17, #132038);
  color: #fff;
}
.pbg-app-nav > img { width: 43px; margin: 0 10px 34px; }
.pbg-app-nav button,
.pbg-app-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: 4px 0;
  padding: 13px 15px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #b9c7dc;
  text-align: left;
  font: 700 .9rem/1.25 Inter, system-ui;
  text-decoration: none;
  cursor: pointer;
}
.pbg-app-nav button span,
.pbg-app-nav a span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 8px;
  font-size: 1rem;
}
.pbg-app-nav button b,
.pbg-app-nav a b { font: inherit; }
.pbg-app-nav button.is-active,
.pbg-app-nav a:hover { background: rgba(122, 167, 255, .14); color: #dce8ff; }
.pbg-app-main { padding: 36px; }
.pbg-app-main > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.pbg-app-main header span,
.pbg-kicker {
  color: var(--blue);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .11em;
}
.pbg-app-main h1 { margin: 6px 0 0; font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -.03em; }
.pbg-network-status {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  margin: -12px 0 18px;
  padding: 7px 10px;
  border: 1px solid #cfe2dd;
  border-radius: 999px;
  background: #edf8f5;
  color: #175546;
  font-size: .72rem;
}
.pbg-network-status > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28a87b;
  box-shadow: 0 0 0 4px rgba(40, 168, 123, .11);
}
.pbg-network-status small { color: #547169; }
.pbg-network-status.is-offline { border-color: #e5c9a4; background: #fff6e8; color: #875214; }
.pbg-network-status.is-offline > span { background: #d07b22; box-shadow: 0 0 0 4px rgba(208, 123, 34, .11); }
.pbg-app-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.pbg-app-kpis article,
.pbg-app-panel,
.pbg-contact-module {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(7, 20, 38, .045);
}
.pbg-app-kpis small,
.pbg-app-kpis strong { display: block; }
.pbg-app-kpis strong { margin-top: 9px; font-size: 2rem; }
.pbg-app-panel { margin-top: 18px; }
.pbg-app-panel h2 { letter-spacing: -.025em; }
.pbg-app-panel label,
.pbg-contact-module label { display: block; margin: 15px 0; font-weight: 700; }
.pbg-app-panel input,
.pbg-app-panel textarea,
.pbg-app-panel select,
.pbg-contact-module input,
.pbg-contact-module textarea,
.pbg-contact-module select {
  width: 100%;
  margin-top: 7px;
  padding: 13px;
  border: 1px solid #c7ced9;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.pbg-app-panel textarea,
.pbg-contact-module textarea { min-height: 105px; resize: vertical; }
.pbg-app-button,
#pbg-install {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(110deg, #244fc4, #3f6fe8);
  color: #fff;
  font-weight: 820;
  text-decoration: none;
  cursor: pointer;
}
.pbg-app-button:disabled { opacity: .58; cursor: wait; }
.pbg-app-link {
  display: inline-flex;
  margin: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.pbg-scope-note {
  margin: 0 0 18px;
  padding: 15px 18px;
  border-left: 4px solid var(--blue);
  border-radius: 0 10px 10px 0;
  background: #eaf0fc;
  color: #24344e;
  line-height: 1.55;
}
.pbg-result { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #eef2f8; }
.pbg-stop { border-left: 5px solid #c72e49; }
.pbg-review { border-left: 5px solid #d07b22; }
.pbg-attention { border-left: 5px solid #c4a019; }
.pbg-baseline { border-left: 5px solid #2d6d5f; }
.pbg-result li { margin: .55rem 0; line-height: 1.55; }
.pbg-result-disclaimer { padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.pbg-assessment-form fieldset { margin: 24px 0; padding: 20px; border: 1px solid var(--line); border-radius: 13px; }
.pbg-assessment-form legend { padding: 0 8px; font-weight: 850; }
.pbg-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.pbg-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.pbg-check-grid label,
.pbg-confirm {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f8fa;
  font-weight: 620 !important;
  line-height: 1.45;
}
.pbg-check-grid input,
.pbg-confirm input { flex: 0 0 auto; width: auto !important; margin: 3px 0 0 !important; }
.pbg-assistant-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 24px; }
.pbg-assistant-option {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8f9fb;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.pbg-assistant-option:hover { transform: translateY(-1px); border-color: #a8b8d6; }
.pbg-assistant-option.is-active { border-color: var(--blue); background: #eef3ff; box-shadow: 0 0 0 3px rgba(45, 91, 227, .1); }
.pbg-assistant-option img { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; filter: saturate(.68) contrast(1.02); }
.pbg-assistant-option span,
.pbg-assistant-option small { display: block; min-width: 0; }
.pbg-assistant-option b { display: block; margin-bottom: 2px; font-size: .88rem; }
.pbg-assistant-option small { overflow: hidden; color: var(--muted); font-size: .7rem; white-space: nowrap; text-overflow: ellipsis; }
.pbg-assistant-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0 8px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(115deg, #f7f9fc, #eef3fb);
}
.pbg-assistant-head img { width: 62px; height: 62px; border-radius: 12px; object-fit: cover; filter: saturate(.75); }
.pbg-assistant-head h3 { margin: 0 0 3px; font-size: 1.15rem; }
.pbg-assistant-head small { color: var(--muted); }
.pbg-assistant-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.pbg-assistant-prompts button,
.pbg-lead-step button { padding: 10px 12px; border: 1px solid #b9c5da; border-radius: 9px; background: #fff; color: #1d3f8d; font-weight: 730; cursor: pointer; }
.pbg-chat,
.pbg-lead-chat { max-height: 330px; overflow: auto; margin: 20px 0; padding: 18px; border-radius: 13px; background: var(--bg); }
.pbg-chat p,
.pbg-lead-chat p,
.pbg-lead-result p { max-width: 85%; padding: 11px 14px; border-radius: 11px; }
.pbg-bot { background: #fff; }
.pbg-user { margin-left: auto; background: #203f87; color: #fff; }
.pbg-chat-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 10px; }
.pbg-chat-actions small { max-width: 560px; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.pbg-error,
.pbg-form-error { padding: 14px; border-radius: 9px; background: #ffe8ec; color: #8b1830; }
.pbg-form-success { padding: 14px; border-radius: 9px; background: #e6f6f1; color: #175546; }
.pbg-login { display: block; min-height: auto; padding: 50px; }
.pbg-login small { display: block; margin-top: 18px; color: var(--muted); }
.pbg-login-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.pbg-account-wrap,
.pbg-content-page,
.pbg-contact-module,
.pbg-lead-assistant,
.pbg-einvoice { width: min(920px, calc(100% - 32px)); margin: 34px auto; }
.pbg-contact-form > small { display: block; margin-top: 12px; color: var(--muted); }
.pbg-honeypot { position: absolute !important; left: -10000px !important; }
.pbg-lead-assistant { padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 18px 50px rgba(8, 20, 40, .08); }
.pbg-lead-step { padding: 18px; border-top: 1px solid var(--line); }
.pbg-lead-step button { margin: 5px; }
.pbg-lead-result > div { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px; }
.pbg-lead-privacy { color: var(--muted); font-size: .8rem; }
.pbg-einvoice aside { padding: 14px; border-left: 4px solid #d07b22; background: #fff5df; }
.pbg-install-sheet {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 10, 18, .68);
  backdrop-filter: blur(10px);
}
.pbg-install-sheet[hidden] { display: none; }
.pbg-install-sheet > div { position: relative; width: min(420px, 100%); padding: 30px; border: 1px solid #d7dde7; border-radius: 22px; background: #fff; color: var(--ink); box-shadow: 0 35px 90px rgba(0, 0, 0, .3); }
.pbg-install-sheet img { width: 70px; height: 70px; border-radius: 17px; box-shadow: 0 10px 25px rgba(8, 20, 40, .16); }
.pbg-install-sheet h2 { margin: .4rem 0; font-size: 1.65rem; letter-spacing: -.03em; }
.pbg-install-sheet p { line-height: 1.55; }
.pbg-install-close { position: absolute; top: 13px; right: 13px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #eef1f5; color: #172033; font-size: 1.5rem; cursor: pointer; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.pbg-app-shell button:focus-visible,
.pbg-app-shell a:focus-visible,
.pbg-install-sheet button:focus-visible { outline: 3px solid #7aa7ff; outline-offset: 3px; }

@media (max-width: 780px) {
  .pbg-app-shell { display: block; min-height: calc(100vh - 30px); min-height: calc(100dvh - 30px); border-radius: 16px; }
  .pbg-app-main { padding: 20px 14px calc(92px + env(safe-area-inset-bottom)); }
  .pbg-app-main > header { align-items: flex-start; gap: 12px; }
  .pbg-app-main > header h1 { font-size: 1.55rem; line-height: 1.08; }
  .pbg-app-main > header #pbg-install { min-height: 40px; padding: 0 12px; font-size: .78rem; }
  .pbg-app-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 9990;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 5px calc(6px + env(safe-area-inset-bottom));
    background: rgba(8, 13, 23, .97);
    box-shadow: 0 -12px 35px rgba(3, 8, 16, .2);
    backdrop-filter: blur(16px);
  }
  .pbg-app-nav > img { display: none; }
  .pbg-app-nav button,
  .pbg-app-nav a { flex-direction: column; justify-content: center; gap: 3px; min-width: 0; min-height: 54px; margin: 0; padding: 5px 2px; text-align: center; }
  .pbg-app-nav button span,
  .pbg-app-nav a span { width: 24px; height: 24px; border: 0; font-size: 1.05rem; }
  .pbg-app-nav button b,
  .pbg-app-nav a b { font-size: .59rem; letter-spacing: .01em; }
  .pbg-app-nav button.is-active { background: rgba(122, 167, 255, .17); }
  .pbg-scope-note { padding: 13px 14px; font-size: .86rem; }
  .pbg-network-status { margin: -9px 0 14px; }
  .pbg-network-status small { display: none; }
  .pbg-app-kpis { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .pbg-app-kpis article { min-width: 0; padding: 14px 10px; border-radius: 13px; }
  .pbg-app-kpis small { font-size: .65rem; line-height: 1.25; }
  .pbg-app-kpis strong { font-size: 1.45rem; }
  .pbg-app-panel { padding: 18px 14px; border-radius: 16px; }
  .pbg-assessment-form fieldset { margin: 18px 0; padding: 14px 11px; }
  .pbg-form-grid,
  .pbg-check-grid { grid-template-columns: 1fr; }
  .pbg-app-panel input,
  .pbg-app-panel textarea,
  .pbg-app-panel select { min-height: 48px; font-size: 16px; }
  .pbg-app-button { width: 100%; min-height: 50px; }
  .pbg-assistant-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pbg-assistant-option { padding: 8px; }
  .pbg-assistant-option img { width: 40px; height: 40px; }
  .pbg-assistant-head img { width: 54px; height: 54px; }
  .pbg-chat { padding: 12px; }
  .pbg-chat p { max-width: 92%; font-size: .9rem; }
  .pbg-chat-actions { align-items: stretch; flex-direction: column; }
  .pbg-install-sheet { align-items: end; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
  .pbg-install-sheet > div { border-radius: 22px; }
  .pbg-login { padding: 30px 20px; }
  .pbg-account-wrap,
  .pbg-content-page,
  .pbg-contact-module,
  .pbg-lead-assistant,
  .pbg-einvoice { width: min(100% - 20px, 920px); }
}

@media (prefers-reduced-motion: reduce) {
  .pbg-app-shell * { scroll-behavior: auto !important; transition: none !important; }
  .pbg-assistant-option:hover { transform: none; }
}

@media print {
  .pbg-app-nav,
  .pbg-app-main > header,
  .pbg-network-status,
  .pbg-scope-note,
  .pbg-app-kpis,
  .pbg-view:not(#pbg-check),
  #pbg-assessment-form { display: none !important; }
  .pbg-app-shell { display: block; border: 0; box-shadow: none; }
  .pbg-app-main { padding: 0; }
  .pbg-result { border: 1px solid #777; }
}
