:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --text: #e7ecf3;
  --muted: #9aa8bc;
  --accent: #4da3ff;
  --warn: #ffb347;
  --ok: #6bcf7f;
  --danger: #ff6b6b;
  --border: #2d3a4f;
  --app-footer-pad-top: 0.75rem;
  --app-footer-pad-bottom: 0.85rem;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.site-header--auth .auth-nav a { margin-left: 1rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  line-height: 1.3;
  text-decoration: none;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand-logo {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

/* --- App shell with collapsible sidebar --- */
body.has-sidebar {
  display: flex;
  min-height: 100vh;
}
.app-topbar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.app-topbar-title {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  font-size: 0.95rem;
}
.app-topbar-logout {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.app-topbar-logout:hover {
  color: var(--text);
  border-color: var(--accent);
  text-decoration: none;
}
.sidebar-open,
.sidebar-collapse {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}
.sidebar-open {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.1rem;
}
.sidebar-collapse {
  width: 1rem;
  height: 1.375rem;
  font-size: 0.75rem;
  padding: 0;
  flex: 0 0 1rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar-open:hover,
.sidebar-collapse:hover {
  color: var(--text);
  border-color: var(--accent);
}
.app-sidebar {
  width: 15rem;
  flex-shrink: 0;
  align-self: stretch;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "brand"
    "nav"
    "footer";
  min-height: 0;
  height: 100%;
  max-height: 100%;
  border-right: 1px solid var(--border);
  background: var(--panel);
  overflow: hidden;
  transition: width 0.18s ease;
  z-index: 40;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0.65rem 0.5rem 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
}
.sidebar-brand-link.brand { flex: 1 1 auto; min-width: 0; padding-right: 0.15rem; }
.sidebar-brand-link .brand-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  padding-block: 0.05rem;
}
.sidebar-nav {
  grid-area: nav;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.65rem 0.5rem;
}
.sidebar-section { margin-bottom: 0.85rem; }
.sidebar-section--admin {
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
}
.sidebar-section-title {
  margin: 0 0 0.35rem;
  padding: 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.15rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.25;
}
.sidebar-link:hover {
  text-decoration: none;
  background: rgba(77, 163, 255, 0.08);
  color: var(--text);
}
.sidebar-link.is-active {
  background: rgba(77, 163, 255, 0.16);
  color: var(--accent);
  font-weight: 600;
}
.sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  flex-shrink: 0;
  color: var(--text);
}
.sidebar-icon-svg {
  width: 1rem;
  height: 1rem;
  display: block;
}
.sidebar-icon-img {
  width: 1rem;
  height: 1rem;
  display: block;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}
.sidebar-icon-img--webhooks {
  mask-image: url("/ui/static/img/icons/fishing-hook.png");
  -webkit-mask-image: url("/ui/static/img/icons/fishing-hook.png");
  mask-mode: alpha;
  -webkit-mask-mode: alpha;
}
.sidebar-icon-img--workers {
  mask-image: url("/ui/static/img/icons/worker.png");
  -webkit-mask-image: url("/ui/static/img/icons/worker.png");
  mask-mode: alpha;
  -webkit-mask-mode: alpha;
}
.sidebar-icon-img--sbom {
  mask-image: url("/ui/static/img/icons/bomb.png");
  -webkit-mask-image: url("/ui/static/img/icons/bomb.png");
  mask-mode: alpha;
  -webkit-mask-mode: alpha;
}
.sidebar-icon-img--api-keys {
  mask-image: url("/ui/static/img/icons/key.png");
  -webkit-mask-image: url("/ui/static/img/icons/key.png");
  mask-mode: alpha;
  -webkit-mask-mode: alpha;
}
.sidebar-link.is-active .sidebar-icon {
  border-color: rgba(77, 163, 255, 0.45);
  color: var(--accent);
}
.sidebar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer {
  grid-area: footer;
  padding: var(--app-footer-pad-top) 0.5rem var(--app-footer-pad-bottom);
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.sidebar-user {
  margin: 0 0 0.35rem;
  padding: 0 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-link--logout { color: var(--muted); }
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 35;
}
.app-frame {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.sidebar-collapsed .app-sidebar { width: 4.25rem; }
body.sidebar-collapsed .sidebar-label { display: none; }
body.sidebar-collapsed .sidebar-section-title { display: none; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 0.35rem; }
body.sidebar-collapsed .sidebar-brand-link.brand { flex: 0 0 auto; padding-right: 0; }
body.sidebar-collapsed .sidebar-brand-link .brand-logo {
  width: 2rem;
  height: 2rem;
}
body.sidebar-collapsed .sidebar-collapse {
  position: absolute;
  right: 0.2rem;
  top: 50%;
  width: 0.875rem;
  height: 1.125rem;
  font-size: 0.65rem;
  transform: translateY(-50%) rotate(180deg);
}
body.sidebar-collapsed .sidebar-link { justify-content: center; padding-inline: 0.35rem; }
body.sidebar-collapsed .sidebar-footer .sidebar-link { justify-content: center; }

.auth-logo-wrap {
  text-align: center;
  margin: 0.5rem auto 1.5rem;
}
.auth-logo {
  display: block;
  width: 7.5rem;
  height: 7.5rem;
  margin: 0 auto;
  object-fit: contain;
}
.auth-logo-title {
  margin: 0.75rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.verify-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: min(72vh, 640px);
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 1rem;
}
.verify-welcome-stamp {
  width: min(320px, 72vw);
  height: auto;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  opacity: 0.95;
  display: block;
}
.verify-welcome-title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.verify-welcome-lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 28rem;
}
.verify-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.container { max-width: 960px; margin: 0 auto; padding: 1.5rem; }

.app-layout {
  min-height: 100vh;
}
body.has-sidebar.app-layout {
  display: flex;
  flex-wrap: wrap;
  align-content: stretch;
  align-items: stretch;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
body.has-sidebar .app-topbar {
  flex: 0 0 100%;
}
body.has-sidebar .app-sidebar {
  flex: 0 0 auto;
  align-self: stretch;
  min-height: 0;
  height: 100%;
  max-height: 100%;
}
body.has-sidebar .app-frame {
  flex: 1 1 0;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.app-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  align-items: stretch;
}
.app-main {
  flex: 1;
  min-width: 0;
  overflow: auto;
}

.assistant-dock {
  width: min(22rem, 34vw);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--panel);
  min-height: 0;
  max-height: 100%;
  height: fit-content;
  align-self: stretch;
}
.assistant-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.assistant-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.assistant-subtitle {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}
.assistant-toggle {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.assistant-toggle:hover { color: var(--text); border-color: var(--accent); }
.assistant-messages {
  flex: 0 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.75rem 0.85rem;
  min-height: 2.5rem;
  max-height: calc(100vh - 9.5rem);
}
.assistant-placeholder {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}
.assistant-composer {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem 0.85rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}
.assistant-composer textarea {
  margin-bottom: 0;
  font-size: 0.9rem;
  resize: none;
  min-height: 2.75rem;
  max-height: 6rem;
}
.assistant-composer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.assistant-send-feedback {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.assistant-send-feedback:hover {
  color: var(--text);
  border-color: var(--accent);
}
.assistant-composer button {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}
.assistant-ask-btn[aria-busy="true"],
.assistant-ask-btn:disabled {
  opacity: 0.8;
  cursor: wait;
  border-color: var(--accent);
}
.assistant-turn {
  margin-bottom: 0.85rem;
}
.assistant-turn:last-child {
  margin-bottom: 0;
}
.assistant-user-question {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.assistant-reply-body {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
}
.assistant-reply-body p {
  margin: 0 0 0.55rem;
}
.assistant-reply-body p:last-child {
  margin-bottom: 0;
}
.assistant-reply-body ol,
.assistant-reply-body ul {
  margin: 0 0 0.55rem;
  padding-left: 1.15rem;
}
.assistant-reply-body li {
  margin-bottom: 0.3rem;
}
.assistant-reply-body li:last-child {
  margin-bottom: 0;
}
.assistant-reply-body code {
  font-size: 0.78rem;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  word-break: break-all;
}
.assistant-reply-body strong {
  color: var(--text);
  font-weight: 600;
}
.assistant-draft {
  margin: 0.5rem 0 0;
  padding: 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  overflow: auto;
  font-size: 0.75rem;
  line-height: 1.4;
  max-height: 14rem;
}
.text-ok { color: var(--ok); }
.text-danger { color: var(--danger); }

body.assistant-feedback-mode .assistant-feedback-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.45rem 0.85rem 0;
  border-top: 1px solid var(--border);
}
.assistant-feedback-tools[hidden] {
  display: none !important;
}
.assistant-feedback-draft {
  margin-top: 0.65rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}
.assistant-feedback-draft-title {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
}
.assistant-feedback-draft-body {
  margin: 0.35rem 0;
  padding: 0.5rem;
  border-radius: 6px;
  background: var(--bg);
  font-size: 0.78rem;
  white-space: pre-wrap;
  max-height: 10rem;
  overflow: auto;
}
.assistant-feedback-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.assistant-feedback-draft-actions form {
  margin: 0;
}
.assistant-feedback-send-btn {
  background: var(--accent);
  color: #041018;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.checkbox-label {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.88rem;
  margin: 0.75rem 0;
  line-height: 1.4;
}
.checkbox-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.assistant-launcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  background: var(--accent);
  color: #041018;
  border: none;
  border-radius: 999px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.assistant-launcher:hover {
  filter: brightness(1.08);
}
body.has-assistant:not(.assistant-collapsed) .assistant-launcher {
  display: none;
}
body.assistant-collapsed .assistant-dock {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.72);
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: min(52rem, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}
.modal-body {
  overflow: auto;
  padding: 0.85rem 1rem;
  min-height: 6rem;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}
.vex-report-body {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.45;
  max-height: 50vh;
  white-space: pre-wrap;
  word-break: break-word;
}
.vex-report-meta p { margin: 0 0 0.35rem; }
.vex-encrypted-notice {
  margin: 0.5rem 0;
  padding: 0.5rem 0.65rem;
  border-left: 3px solid var(--accent, #4a90d9);
  background: rgba(74, 144, 217, 0.08);
  font-size: 0.9rem;
}
.vex-report-meta code { font-size: 0.8rem; word-break: break-all; }
body.modal-open { overflow: hidden; }

.source-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
  max-width: 100%;
}
.source-actions form { margin: 0; }
.source-actions button,
.source-actions .btn {
  width: auto;
  min-width: 0;
}

@media (max-width: 900px) {
  body.has-sidebar .app-topbar { display: flex; }
  body.has-sidebar .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.2s ease, width 0.18s ease;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.35);
  }
  body.sidebar-mobile-open .app-sidebar { transform: translateX(0); }
  body.sidebar-mobile-open .sidebar-backdrop { display: block; }
  body.has-sidebar.sidebar-collapsed .app-sidebar { width: 15rem; }
  body.has-sidebar.sidebar-collapsed .sidebar-label,
  body.has-sidebar.sidebar-collapsed .sidebar-section-title { display: block; }
  .app-shell { flex-direction: column; }
  body.has-sidebar .app-frame {
    max-height: calc(100vh - 2.75rem);
    max-height: calc(100dvh - 2.75rem);
  }
  .assistant-dock {
    width: 100%;
    max-height: min(42vh, calc(100vh - 2.75rem));
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .assistant-messages {
    max-height: calc(42vh - 9rem);
  }
  body.has-assistant:not(.assistant-collapsed) .app-main {
    padding-bottom: 0;
  }
}

/* Short viewport: top-bar Logout; in-flow sidebar (wide layout) fits below top bar */
@media (max-height: 720px) {
  body.has-sidebar .app-topbar { display: flex; }
  body.has-sidebar .app-frame {
    max-height: calc(100vh - 2.75rem);
    max-height: calc(100dvh - 2.75rem);
  }
}
@media (max-height: 720px) and (min-width: 901px) {
  body.has-sidebar .app-sidebar {
    height: calc(100vh - 2.75rem);
    height: calc(100dvh - 2.75rem);
    max-height: calc(100vh - 2.75rem);
    max-height: calc(100dvh - 2.75rem);
  }
}

.sub-footnote { margin-top: 1rem; }

.webhook-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.webhook-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.list-row__main { flex: 1; min-width: min(100%, 14rem); }

.page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.page-actions form { margin: 0; }

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.25rem, 1fr));
  gap: 0.45rem;
  margin: 0 0 1rem;
}
.quick-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  text-align: center;
}
.quick-link:hover {
  text-decoration: none;
  border-color: rgba(77, 163, 255, 0.55);
  background: rgba(77, 163, 255, 0.08);
  color: var(--accent);
}
.quick-link--featured {
  border-color: rgba(77, 163, 255, 0.45);
  background: rgba(77, 163, 255, 0.12);
  color: var(--accent);
  font-weight: 600;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.card-header h2 { margin: 0; }
.webhook-item:last-child { border-bottom: none; padding-bottom: 0; }
.webhook-form { flex: 1; min-width: min(100%, 28rem); }
.webhook-form-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0.65rem 0.85rem;
}
.webhook-url-field { grid-column: 1 / -1; }
.webhook-active { display: flex; align-items: flex-end; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  font-size: 0.9rem;
  margin: 0;
  cursor: pointer;
}
.checkbox-label input { width: auto; margin: 0; }
.webhook-form-actions { margin-top: 0.65rem; }
.webhook-delete-form { flex-shrink: 0; }

.api-key-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.api-key-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-start;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.api-key-item:last-child { border-bottom: none; padding-bottom: 0; }
.api-key-form { flex: 1; min-width: min(100%, 28rem); }
.api-key-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.65rem 1rem;
}
.api-key-prefix { font-size: 0.9rem; }
.api-key-form-actions { margin-top: 0.65rem; }
.api-key-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0;
}
.api-key-reveal { border-color: var(--accent, #6c5ce7); }
.api-key-copy-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.api-key-value {
  flex: 1;
  min-width: min(100%, 20rem);
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}
.config-example {
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre;
}

.delivery-log-meta p { margin: 0 0 0.65rem; }
.delivery-log-body {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  overflow: auto;
  font-size: 0.78rem;
  line-height: 1.45;
  max-height: 55vh;
  white-space: pre-wrap;
  word-break: break-word;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  min-width: 0;
}
.card h2, .card h3 { margin-top: 0; }

.flash { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash.info { background: #1e3a5f; border: 1px solid var(--accent); }
.flash.warn { background: #3d2f1a; border: 1px solid var(--warn); }
.flash.error { background: #3d1a1a; border: 1px solid var(--danger); }

label { display: block; margin-bottom: 0.25rem; color: var(--muted); font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], input[type=url], textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
input.prefilled { border-color: #3d6a3d; }
input.user-edited { border-color: var(--warn); }

.checkbox-label.register-privacy-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.75rem 0;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.45;
  cursor: pointer;
}
.checkbox-label.register-privacy-label input {
  width: auto;
  margin: 0.15rem 0 0;
  flex-shrink: 0;
}
.checkbox-label.register-privacy-label .checkbox-label-text {
  flex: 1;
  min-width: 0;
}
.checkbox-label.register-privacy-label .checkbox-label-text a {
  white-space: nowrap;
}
@media (max-width: 28rem) {
  .checkbox-label.register-privacy-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .checkbox-label.register-privacy-label input {
    margin: 0;
  }
}

.field-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 0.75rem;
}
.field-row input[type=url] {
  flex: 1;
  margin-bottom: 0;
}
.field-row button { margin-bottom: 0; white-space: nowrap; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--accent);
  color: #041018;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
button.btn-sm, .btn.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  border-radius: 5px;
}
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
button.secondary.btn-sm, .btn.secondary.btn-sm {
  border-color: rgba(77, 163, 255, 0.55);
}
button.secondary.text-danger, .btn.secondary.text-danger {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.55);
}
button.secondary.text-danger:hover, .btn.secondary.text-danger:hover {
  background: rgba(255, 107, 107, 0.08);
}
button:hover, .btn:hover {
  filter: brightness(1.05);
  text-decoration: none;
}
button.secondary:hover, .btn.secondary:hover {
  background: rgba(77, 163, 255, 0.08);
  filter: none;
}
button:disabled,
.btn:disabled {
  background: var(--border);
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 0.65;
}
button.secondary:disabled,
.btn.secondary:disabled {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
button.copy-btn {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
button.copy-btn:active {
  transform: scale(0.97);
  background: rgba(108, 92, 231, 0.2);
}
button.copy-btn.copy-btn--copied {
  background: #1a3d2a;
  border-color: #3d9a5c;
  color: #8fe0a8;
  transform: none;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.badge:last-child { margin-right: 0; }
.badge.supplier { background: #1a3d2a; color: var(--ok); border: 1px solid var(--ok); }
.badge.third-party { background: #3d2f1a; color: var(--warn); border: 1px solid var(--warn); }
.badge.preferred { background: #1e3a5f; color: var(--accent); border: 1px solid var(--accent); }

.meta { color: var(--muted); font-size: 0.9rem; }
.source-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }

.data-table-scroll {
  overflow-x: auto;
  max-width: 100%;
}
.data-table {
  table-layout: fixed;
  width: 100%;
}
.data-table th,
.data-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.data-table code {
  display: inline-block;
  max-width: 100%;
  font-size: 0.82rem;
  word-break: break-all;
  white-space: normal;
}
.data-table col.col-key { width: 46%; }
.data-table col.col-narrow { width: 12%; }
.data-table .col-narrow { white-space: nowrap; }

.sub-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sub-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.sub-item:last-child { border-bottom: none; padding-bottom: 0; }
.sub-item:first-child { padding-top: 0; }
.sub-main { flex: 1; min-width: 0; }
.sub-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}
.sub-version {
  color: var(--muted);
  font-size: 0.9rem;
}
.sub-badges { margin-bottom: 0.65rem; }
.sub-details {
  display: grid;
  grid-template-columns: minmax(6rem, 8rem) 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}
.sub-details dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-top: 0.1rem;
}
.sub-details dd {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}
.sub-details dd:last-child { margin-bottom: 0; }
.sub-check-mode { display: block; margin-bottom: 0.25rem; }
.sub-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.sub-check-list li { margin: 0.15rem 0; }
.sub-check-key {
  display: inline-block;
  min-width: 5.5rem;
  color: var(--text);
  font-size: 0.85rem;
}
.sub-check-note { margin: 0.15rem 0 0; }
.sub-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
  max-width: 100%;
}
.sub-actions form { margin: 0; }
.sub-actions button,
.sub-actions .btn {
  width: auto;
  min-width: 0;
  margin: 0;
}
.sub-footnote { margin: 1rem 0 0; }

.dev-panel {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}
.dev-panel code { word-break: break-all; }

.notice-info {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: rgba(0, 200, 255, 0.08);
  margin: 1rem 0;
}

.sbom-matcher-panel .data-table { width: 100%; margin: 1rem 0; }
.sbom-oss-gap-status { margin: 0.75rem 0 0; min-height: 1.25rem; }
.sbom-oss-gap-status.is-busy { color: var(--accent, #00c8ff); }
.sbom-oss-gap-status.is-error { color: #f87171; }
.sbom-oss-gap-status.is-success { color: #4ade80; }

.oss-catalog-requests-card { overflow: hidden; }
.oss-catalog-requests-scroll {
  overflow-x: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}
.oss-catalog-requests-table {
  table-layout: fixed;
  width: 100%;
  min-width: 42rem;
}
.oss-catalog-requests-table .oss-col-component { width: 16%; }
.oss-catalog-requests-table .oss-col-metadata { width: 44%; }
.oss-catalog-requests-table .oss-col-requesters { width: 40%; }
.oss-catalog-requests-table th,
.oss-catalog-requests-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.oss-catalog-requests-table code {
  display: inline-block;
  max-width: 100%;
  font-size: 0.82rem;
  word-break: break-all;
}
.oss-col-requesters-cell { min-width: 0; }
.oss-request-requester {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.oss-request-requester:first-child { padding-top: 0; }
.oss-request-requester:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.oss-request-requester-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
  max-width: 100%;
}
.oss-request-email {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.oss-request-time { margin: 0; }
.oss-request-delete-form { margin: 0; flex-shrink: 0; }

/* --- Public landing page (LVFS-inspired content layout) --- */
.landing-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.site-header--landing {
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
}
.landing-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  margin-left: auto;
}
.landing-nav-link {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
  padding: 0.35rem 0.15rem;
}
.landing-nav-link:hover,
.landing-nav-link.is-active {
  color: var(--text);
  text-decoration: none;
}
.landing-nav-link.is-active { font-weight: 600; }
.landing-nav-dropdown { position: relative; }
.landing-nav-dropdown > summary {
  list-style: none;
  cursor: pointer;
}
.landing-nav-dropdown > summary::-webkit-details-marker { display: none; }
.landing-nav-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 12rem;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 20;
}
.landing-nav-menu a {
  display: block;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
}
.landing-nav-menu a:hover {
  background: rgba(77, 163, 255, 0.1);
  text-decoration: none;
}
.landing-nav-cta {
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
}
.landing-beta-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(107, 207, 127, 0.55);
  background: rgba(26, 61, 42, 0.85);
  color: var(--ok);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
  white-space: nowrap;
}
.landing-beta-badge--hero {
  align-self: center;
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
}
.landing-main { flex: 1; }
.landing-hero {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 2rem) clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(77, 163, 255, 0.14), transparent 60%),
    var(--bg);
}
.landing-stamp {
  position: absolute;
  top: clamp(1.25rem, 3vw, 2.25rem);
  right: clamp(1.25rem, 4vw, 2.75rem);
  left: auto;
  width: clamp(5.5rem, 12vw, 9.5rem);
  height: auto;
  transform: rotate(45deg);
  transform-origin: center center;
  opacity: 0.82;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
.landing-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 48rem;
  margin: 0 auto;
}
.landing-beta-eyebrow {
  margin: 0 0 0.65rem;
  color: var(--ok);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.landing-hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
}
.landing-hero-title h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.landing-lead {
  margin: 0 0 1rem;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--text);
}
.landing-sublead {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 44rem;
}
.landing-beta-note {
  margin: 0 0 1.35rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--ok);
  border-radius: 0 8px 8px 0;
  background: rgba(26, 61, 42, 0.35);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 44rem;
}
.landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.landing-audiences {
  padding: clamp(2.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) clamp(2rem, 4vw, 3rem);
}
.landing-audiences-heading {
  margin: 0 auto 2rem;
  max-width: 72rem;
  text-align: center;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  letter-spacing: -0.01em;
}
.landing-audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2.25rem 1.15rem;
  max-width: 72rem;
  margin: 0 auto;
}
.landing-audience-card {
  position: relative;
  padding: 2.5rem 1.35rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.landing-audience-icon {
  position: absolute;
  top: -1.35rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #c8d0dc;
  color: #4a5568;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.landing-audience-icon svg {
  width: 1.45rem;
  height: 1.45rem;
}
.landing-audience-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.08rem;
  color: var(--text);
}
.landing-audience-subtitle {
  margin: -0.35rem 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.landing-audience-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}
.landing-audience-card code {
  font-size: 0.85em;
}
.landing-more {
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.landing-more:hover { text-decoration: underline; }
.landing-quote {
  margin: 0;
  padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}
.landing-quote p {
  margin: 0 auto 0.85rem;
  max-width: 42rem;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: var(--text);
  line-height: 1.55;
}
.landing-quote footer {
  color: var(--muted);
  font-size: 0.88rem;
}
.landing-trust {
  padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 4vw, 2rem);
  max-width: 48rem;
  margin: 0 auto;
}
.landing-trust h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
}
.landing-trust-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
}
.landing-trust-list li { margin-bottom: 0.55rem; }
.landing-trust-list strong { color: var(--text); }
.landing-footer {
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 2rem;
  border-top: 1px solid var(--border);
  background: var(--panel);
  text-align: center;
}
.landing-footer-lead {
  margin: 0 auto 0.65rem;
  max-width: 40rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.landing-footer-meta {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.landing-footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.landing-footer-copy a {
  color: var(--muted);
  text-decoration: none;
}
.landing-footer-copy a:hover {
  color: var(--text);
  text-decoration: underline;
}
.landing-footer-links {
  margin: 0 0 0.75rem;
  font-size: 0.84rem;
}
.landing-footer-links a {
  color: var(--muted);
  text-decoration: none;
}
.landing-footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}
.landing-hero-privacy {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
}
.landing-hero-privacy:hover {
  color: var(--text);
  text-decoration: underline;
}
.landing-beta-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.landing-beta-note a:hover {
  filter: brightness(1.1);
}

.app-frame > .site-footer {
  flex-shrink: 0;
}
.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: var(--app-footer-pad-top) 1rem var(--app-footer-pad-bottom);
  border-top: 1px solid var(--border);
  background: var(--panel);
  text-align: center;
}
.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
}
.site-footer-nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer-nav a:hover {
  color: var(--text);
  text-decoration: underline;
}
.site-footer-sep {
  color: var(--muted);
  opacity: 0.6;
}
.site-footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 640px) {
  .site-header--landing { flex-direction: column; align-items: flex-start; }
  .landing-nav { margin-left: 0; width: 100%; }
  .landing-nav-cta { margin-left: auto; }
  .landing-stamp {
    top: clamp(1rem, 2.5vw, 1.75rem);
    right: clamp(1rem, 3vw, 1.5rem);
    width: 4.25rem;
    opacity: 0.65;
  }
}
