/* ========================================
   Rogue Cortex Developer Portal
   ======================================== */

/* --- Preview Gate --- */

.preview-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.preview-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 24px;
}

.preview-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 24px;
  font-size: 0.8125rem;
  color: #888888;
  border-top: 1px solid #ececec;
  background: #ffffff;
}

.preview-footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 0.9375rem;
}

.preview-footer a {
  color: #555555;
  text-decoration: none;
}

.preview-footer a:hover {
  color: #222222;
  text-decoration: underline;
}

.preview-footer-sep {
  color: #c8c8c8;
}

.preview-gate-box {
  background: #ffffff;
  border: 1px solid #d5d5d5;
  border-radius: 12px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.preview-gate-logo {
  margin-bottom: 32px;
}
.preview-gate-logo img {
  display: block;
  width: 160px;
  height: auto;
  margin: 0 auto;
}

.preview-gate-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.preview-gate-subtitle {
  font-size: 0.95rem;
  color: #555555;
  margin: 0 0 28px;
  line-height: 1.5;
}

.preview-gate-request {
  margin: 20px 0 0;
  font-size: 0.85rem;
  color: #555555;
}

.preview-gate-request a {
  color: inherit;
  font-weight: 600;
}

.preview-gate-error {
  background: #fff0f0;
  border: 1px solid #f5c2c2;
  border-radius: 6px;
  color: #c0392b;
  font-size: 0.875rem;
  padding: 10px 14px;
  margin-bottom: 20px;
}

.preview-gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-gate-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cccccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  background: #f8f8f8;
  color: #222222;
  outline: none;
  transition: border-color 0.15s;
}

.preview-gate-input:focus {
  border-color: #222222;
  background: #ffffff;
}

.preview-gate-submit {
  width: 100%;
  padding: 12px;
  background: #222222;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.preview-gate-submit:hover {
  background: #444444;
}

/* --- Reset & Base --- */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: #1a1a2e;
  background: #fafafa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: #4361ee;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0;
}

h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; margin-top: 2rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }

code {
  background: #eef;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

/* --- Container --- */

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

/* --- Top Nav --- */

.preview-bar {
  background: #f5a623;
  color: #5a3600;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 0;
  width: 100%;
}

/* "View as customer": an admin seeing the portal as a customer's company.
   Louder than the preview bar on purpose — it changes what every page shows. */
.customer-view-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 1rem;
  background: #4361ee;
  color: #fff;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
}
.customer-view-bar__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.customer-view-bar__actions form {
  display: inline;
  margin: 0;
}
.customer-view-bar a,
.customer-view-bar button {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

/* A POST form that reads as an ordinary link (e.g. "View as customer" links
   from /admin into a customer's portal pages). */
.inline-form {
  display: inline;
  margin: 0;
}
.link-button {
  font: inherit;
  color: #4361ee;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.link-button:hover {
  text-decoration: underline;
}

.top-nav {
  background: #1a1a2e;
  color: #fff;
  padding: 0 1.5rem;
}

.nav-container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}
/* The logo file is the navy one (#101C2A); on a dark header it turns white. */
.brand-link img {
  filter: brightness(0) invert(1);
}
.brand-logo {
  display: block;
  height: 22px;
  width: auto;
}
/* Lines "Developer" up with the wordmark's baseline (the image box ends below
   it, at the tail of the "g"). */
.brand-logo + .brand-light {
  position: relative;
  top: -2px;
}
.brand-light {
  font-weight: 300;
  opacity: 0.75;
}

.brand-link:hover {
  text-decoration: none;
  color: #c3c3ff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: #ccc;
  font-size: 0.9rem;
  font-weight: 600;
}
.nav-links a:hover {
  color: #fff;
  text-decoration: none;
}
/* Sign up: a solid button, not a grey link. */
.nav-links a.btn-primary,
.nav-links a.btn-primary:hover {
  color: #fff;
}
/* The section you're in (NavigationHelper#nav_link_to), in every header. */
.nav-links a[aria-current="page"] {
  color: #fff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}

/* Menu button for the shared header (shared/_site_header.html.erb); shown
   only on narrow screens, where the links fold into a drop-down panel. */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
}
.nav-toggle:focus-visible {
  outline: 2px solid #9aaaff;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .top-nav .nav-container {
    position: relative;
  }
  .top-nav .nav-toggle {
    display: inline-flex;
  }
  .top-nav .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: -1.5rem;
    right: -1.5rem;
    z-index: 50;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    background: #1a1a2e;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  }
  .top-nav .nav-links.is-open {
    display: flex;
  }
  .top-nav .nav-links > a,
  .top-nav .nav-links > form,
  .top-nav .nav-links > .notif {
    padding: 0.6rem 0;
  }
  .top-nav .nav-links > a.btn,
  .top-nav .nav-links .nav-button {
    width: 100%;
    text-align: center;
  }
}

.nav-admin-link {
  color: #f7c948 !important;
}

.nav-button {
  background: transparent;
  border: 1px solid #555;
  color: #ccc;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}
.nav-button:hover {
  background: #333;
  color: #fff;
}

.nav-divider {
  color: #555;
}

/* Admin theme — black to distinguish from portal */
.admin-nav {
  background: #111;
  border-bottom: 3px solid #555;
}
.admin-nav .nav-links a {
  color: #eee;
}
.admin-nav .nav-links a:hover {
  color: #fff;
}
.admin-nav .brand-link {
  color: #fff;
}
.admin-nav .nav-button {
  color: #eee;
  border-color: #666;
}
.admin-nav .nav-button:hover {
  background: #333;
  color: #fff;
}
.admin-nav .nav-divider {
  color: #666;
}

.admin-layout {
  background: #f5f5f5;
}

.admin-layout .btn-primary {
  background: #333;
  color: #fff;
}
.admin-layout .btn-primary:hover {
  background: #111;
  color: #fff;
}

.admin-layout .btn-outline {
  border-color: #333;
  color: #333;
}
.admin-layout .btn-outline:hover {
  background: #333;
  color: #fff;
}

.admin-layout .btn-sm.btn-outline {
  border-color: #555;
  color: #555;
}
.admin-layout .btn-sm.btn-outline:hover {
  background: #333;
  color: #fff;
}

.admin-layout .stat-number {
  color: #111;
}
.admin-layout .stat-green { color: #2e7d32; }
.admin-layout .stat-red { color: #c62828; }

.admin-layout main a {
  color: #333;
}
.admin-layout main a:hover {
  color: #000;
}

.admin-layout .container {
  max-width: 1400px;
}

.admin-layout h1 { font-size: 1.5rem; }
.admin-layout h2 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
}
.admin-layout h3 { font-size: 1rem; }

/* Admin shell — left nav + content, same shape as portal account shell. */
.admin-shell .docs-content { font-size: 0.9rem; }

.portal-layout .container:has(.account-shell),
.portal-layout .container:has(.docs-layout),
.portal-layout .container:has(.guide-cards),
.public-layout .container:has(.docs-layout),
.public-layout .container:has(.guide-cards) {
  max-width: 1400px;
}

/* --- Flash messages --- */

.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.flash-notice {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash-alert {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* --- Buttons --- */

.btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  border: 1.5px solid transparent;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: #4361ee;
  color: #fff;
}
.btn-primary:hover {
  background: #3651d4;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid #4361ee;
  color: #4361ee;
}
.btn-outline:hover {
  background: #4361ee;
  color: #fff;
}

.btn-danger {
  background: #e63946;
  color: #fff;
}
.btn-danger:hover {
  background: #c5303c;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

/* --- Front page (DRC-65, design "Option A") --- */

.btn-outline-light {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  color: #fff;
}
.btn-outline-light:hover {
  background: #fff;
  border-color: #fff;
  color: #1a1a2e;
}

.home-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

/* Hero: dark, like the header; text left, code window right. */
.home-hero {
  background: radial-gradient(120% 90% at 85% 10%, #22305e 0%, #1a1a2e 55%, #141426 100%);
  color: #fff;
  padding: 4.5rem 1.5rem 5rem;
}
.home-hero-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 3.5rem;
  align-items: center;
}
.home-hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  color: #fff;
}
.home-hero-lede {
  font-size: 1.12rem;
  line-height: 1.65;
  color: #c3cbe3;
  margin: 0 0 2rem;
  max-width: 34rem;
}
.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.home-hero-note {
  margin: 0.9rem 0 0;
  font-size: 0.85rem;
  color: #8f98b8;
}

/* Code window */
.home-code {
  margin: 0;
  background: #10101f;
  border: 1px solid #2c3656;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  min-width: 0;
}
.home-code-bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #2c3656;
  background: #16162b;
}
.home-code-dots { display: inline-flex; gap: 6px; }
.home-code-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3f5c;
}
.home-code-file {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.8rem;
  color: #b8c0d6;
}
.home-code pre {
  margin: 0;
  padding: 1rem 0;
  overflow-x: auto;
  color: #e0e0e0;
  font-size: 0.82rem;
  line-height: 1.7;
}
.home-code pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
.home-code-line {
  display: block;
  padding: 0 1.1rem;
  min-height: 1.7em;
}
.home-code-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.25rem;
  padding: 0.7rem 1.1rem;
  border-top: 1px solid #2c3656;
  background: #16162b;
  font-size: 0.8rem;
  color: #9aa3c4;
}
.home-code-status-run { display: inline-flex; align-items: center; gap: 0.4rem; }
.home-code-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #55d6d0;
  box-shadow: 0 0 0 3px rgba(85, 214, 208, 0.18);
}
.home-code-status-camera {
  display: inline-block;
  min-width: 5.5em;
  color: #fff;
  font-weight: 600;
}
.home-code-status-camera.is-entering { animation: home-fade-in 0.35s ease-out; }
.home-code-status-ok { color: #55d6d0; }
.home-code-status-same {
  margin-left: auto;
  font-family: ui-monospace, Menlo, monospace;
  color: #7f88a8;
}
@keyframes home-fade-in {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: none; }
}

/* Sections */
.home-section {
  padding: 4rem 1.5rem;
}
.home-section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 1.5rem;
}

/* SDK / Apps / Portal */
.home-products { padding-top: 3.5rem; }
.home-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.home-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e3e5ef;
  border-radius: 12px;
  padding: 1.6rem;
}
.home-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #eef0fd;
  color: #4361ee;
  margin-bottom: 1rem;
}
.home-card h2 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
  color: #1a1a2e;
}
.home-card p {
  flex: 1;
  margin: 0 0 1.25rem;
  color: #4a4f63;
  line-height: 1.6;
}
.home-card-link {
  font-weight: 600;
  color: #4361ee;
  text-decoration: none;
}
.home-card-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-solved-link {
  margin: 1.5rem 0 0;
  text-align: center;
  color: #4a4f63;
}
.home-solved-link a {
  font-weight: 600;
  color: #4361ee;
  text-decoration: none;
}
.home-solved-link a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* What you can build */
.home-build { padding-top: 1rem; }
.home-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.home-tile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  height: 100%;
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px solid #e3e5ef;
  border-radius: 10px;
  color: #1a1a2e;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-tile:hover {
  border-color: #4361ee;
  box-shadow: 0 4px 14px rgba(67, 97, 238, 0.12);
  text-decoration: none;
}
.home-tile-icon { display: inline-flex; color: #4361ee; }
.home-tile-title { flex: 1; }
.home-tile-arrow { color: #9aa0b8; }
.home-tile:hover .home-tile-arrow { color: #4361ee; }

/* Stories carousel */
.home-stories { background: #fff; border-top: 1px solid #ecedf3; border-bottom: 1px solid #ecedf3; }
.home-carousel { border-radius: 14px; }
.home-slide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 2.5rem;
  align-items: center;
}
.home-slide[hidden] { display: none; }
.home-slide-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #f1f3fb;
  display: block;
}
.home-slide-tag {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #eef0fd;
  color: #3651d4;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.home-slide h3 {
  font-size: 1.45rem;
  margin: 0 0 0.6rem;
  color: #1a1a2e;
}
.home-slide p {
  margin: 0 0 1.25rem;
  color: #4a4f63;
  line-height: 1.6;
}
.home-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.home-carousel-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #d5d8e6;
  background: #fff;
  color: #1a1a2e;
  font-size: 1rem;
  cursor: pointer;
}
.home-carousel-arrow:hover { border-color: #4361ee; color: #4361ee; }
.home-carousel-dots { display: flex; gap: 0.5rem; }
.home-carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: #cfd3e3;
  cursor: pointer;
}
.home-carousel-dot[aria-current="true"] { background: #4361ee; }

/* Ready to build? Text on the left, actions on the right; stacked on phones. */
.home-section.home-ready { padding-top: 1rem; }
.home-ready-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background: #1a1b1f;
  color: #fff;
  border-radius: 16px;
  padding: 2.75rem 3.5rem;
}
.home-ready-copy { max-width: 38rem; }
.home-ready-box h2 {
  margin: 0 0 0.6rem;
  font-size: 2rem;
  color: #fff;
}
.home-ready-text {
  margin: 0;
  color: #d4d5db;
  line-height: 1.6;
}
.home-ready-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}
.home-ready-button {
  background: #fff;
  border: 1px solid #fff;
  color: #1a1b1f;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}
.home-ready-button:hover { background: #e9eaef; border-color: #e9eaef; color: #1a1b1f; }
.home-ready-login {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.home-ready-login:hover { color: #d4d5db; }

/* Keyboard focus is visible on every link and button on the page. */
.home-hero a:focus-visible,
.home-section a:focus-visible,
.home-section button:focus-visible,
.home-carousel:focus-visible {
  outline: 3px solid #55d6d0;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .home-code-status-camera.is-entering { animation: none; }
  .home-tile { transition: none; }
}

@media (max-width: 900px) {
  .home-hero-inner { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .home-cards,
  .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-slide { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
}
@media (max-width: 600px) {
  .home-hero { padding: 3rem 1rem 3.5rem; }
  .home-section { padding: 3rem 1rem; }
  .home-cards,
  .home-tiles { grid-template-columns: minmax(0, 1fr); }
  .home-code pre { font-size: 0.75rem; }
  .home-code-status-same { margin-left: 0; }
  .home-hero-actions .btn { flex: 1 1 100%; text-align: center; }
  .home-ready-box { flex-direction: column; align-items: flex-start; padding: 2rem 1.5rem; gap: 1.5rem; }
  .home-ready-box h2 { font-size: 1.6rem; }
}

/* --- Auth forms --- */

.auth-form-container {
  max-width: 460px;
  margin: 4rem auto;
  padding: 2.5rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.auth-form-container h2 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.form-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.form-fieldset legend {
  font-weight: 700;
  font-size: 0.9rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
  width: 100%;
}

/* A line of explanation under an auth form's heading (password reset). */
.auth-intro {
  margin: -0.75rem 0 1.5rem;
  text-align: center;
  color: #555;
  font-size: 0.95rem;
}

.auth-alt {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #666;
}

/* --- Forms --- */

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #4361ee;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-group-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-group-inline label {
  display: inline-block;
  min-width: 160px;
  margin-bottom: 0;
}

.form-group-inline input[type="text"],
.form-group-inline input[type="email"],
.form-group-inline input[type="password"],
.form-group-inline input[type="date"],
.form-group-inline input[type="number"],
.form-group-inline select {
  width: 260px;
}

.form-group-inline input[type="checkbox"] {
  width: auto;
}

.form-select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-check input[type="checkbox"] {
  width: auto;
}
.form-check label {
  display: inline;
  margin-bottom: 0;
}

.form-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.form-errors {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}
.form-errors ul {
  margin: 0;
  padding-left: 1.25rem;
}

/* --- Data tables --- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.data-table thead {
  background: #f0f0f5;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  font-weight: 600;
  color: #555;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table tbody tr {
  border-top: 1px solid #eee;
}

.data-table tbody tr:hover {
  background: #f9f9fc;
}

.data-table .actions {
  white-space: nowrap;
}
.data-table .actions > * + * {
  margin-left: 0.4rem;
}
.data-table .actions form {
  display: inline-block;
}

/* --- Detail cards --- */

.detail-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 2rem;
}

.detail-card dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
}

.detail-card dt {
  font-weight: 600;
  color: #666;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.detail-card dd {
  margin: 0;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.card-actions form {
  display: inline;
}

/* --- Page header (title + action button) --- */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.page-header h1 {
  margin-bottom: 0;
}
/* Lets a title carry a caption underneath without pushing the header's action
   button onto its own line — the flex row still sees two children. */
.page-header__titles {
  min-width: 0;
}
/* A heading's own margins have to go: a flex item establishes its own
   formatting context, so an h2's margin-top would sit *inside* this wrapper and
   drop the heading out of line with the button instead of spacing the section.
   .page-header--section carries that spacing instead. */
.page-header__titles h1,
.page-header__titles h2,
.page-header__titles h3 {
  margin: 0;
}
.page-header--section {
  margin-top: 2rem;
}
.page-caption {
  margin: 0.35rem 0 0;
  max-width: 60ch;
  color: #6b7280;
  font-size: 0.92rem;
  line-height: 1.5;
}

/* --- Stats grid (admin dashboard) --- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.stat-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: #4361ee;
}

.stat-green { color: #2e7d32; }
.stat-red { color: #c62828; }

.stat-label {
  display: block;
  color: #666;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

/* --- Badges --- */

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-doc      { background: #e8f5e9; color: #2e7d32; }
.badge-owner    { background: #ede7f6; color: #4527a0; }
.badge-member   { background: #f0f0f5; color: #555; }
.badge-active   { background: #e8f5e9; color: #2e7d32; }
.badge-inactive { background: #fce4ec; color: #c62828; }
.badge-admin    { background: #fff3e0; color: #e65100; }
.badge-support  { background: #e3f2fd; color: #1565c0; }
.badge-staff-member { background: #ede7f6; color: #4527a0; }

.data-table tr.row-highlight > td { background: #fff8e1; }

/* Drop zone for package version uploads. */
.upload-dropzone {
  display: block;
  border: 2px dashed #bdbdbd;
  border-radius: 8px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: #fafafa;
  transition: border-color 0.15s, background 0.15s;
}
.upload-dropzone:hover,
.upload-dropzone:focus-within {
  border-color: #1565c0;
  background: #f0f7ff;
}
.upload-dropzone.is-dragover {
  border-color: #1565c0;
  background: #e3f2fd;
}
.upload-dropzone-primary { font-weight: 600; }
.upload-dropzone-hint    { color: #666; font-size: 0.85rem; margin-top: 0.35rem; }
.upload-dropzone input[type="file"] { display: none; }

/* Compact dropzone variant used in the batch "new version" per-package rows. */
.upload-dropzone-sm { padding: 0.85rem 1rem; }
.upload-dropzone-sm .upload-dropzone-primary { font-weight: 500; font-size: 0.9rem; }

/* Batch new-version form: shared fields + one upload cell per package. */
.batch-version-shared {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.batch-version-shared .form-group { margin-bottom: 0; }
.batch-version-actions { margin-top: 1.5rem; }

.batch-pkg-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.batch-pkg-row .pkg-main { flex: 1 1 40%; min-width: 0; }
.batch-pkg-row .batch-pkg-upload { flex: 1 1 55%; }
.batch-row-status { font-size: 0.85rem; margin-top: 0.35rem; }
.batch-row-status[data-level="error"] { color: #c62828; }
.batch-row-status[data-level="warn"]  { color: #ef6c00; }
.batch-row-status[data-level="success"] { color: #2e7d32; }

/* One line per file on the flight log upload page. */
.log-upload-list { font-size: 0.9rem; margin-top: 0.75rem; padding-left: 1.2rem; }
.log-upload-list li[data-level="error"]   { color: #c62828; }
.log-upload-list li[data-level="success"] { color: #2e7d32; }
.form-actions[hidden] { display: none; }

/* Per-version "folder" view below the packages board. */
.pkg-versions-panel { margin-top: 2.5rem; }
.pkg-versions-title { margin-bottom: 0.25rem; }

.version-folder {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 0.6rem;
}
.version-folder-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  list-style: none;
}
.version-folder-summary::-webkit-details-marker { display: none; }
.version-folder-summary:hover { background: #fafafa; }
.version-folder-caret {
  color: #888;
  transition: transform 0.15s;
  display: inline-block;
}
.version-folder[open] > .version-folder-summary > .version-folder-caret { transform: rotate(90deg); }
.version-folder-name code { font-size: 0.95rem; }
.version-folder-date { margin-left: auto; font-size: 0.85rem; }

.version-folder-list {
  list-style: none;
  margin: 0;
  padding: 0 1rem 0.5rem;
  border-top: 1px solid #eee;
}
.version-folder-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f2f2f2;
}
.version-folder-item:last-child { border-bottom: none; }
.version-folder-item .pkg-main { flex: 1 1 40%; min-width: 0; }
.version-folder-item .pkg-meta { display: flex; align-items: center; gap: 1rem; }
.version-folder-nofile { font-style: italic; }

.upload-current {
  background: #f5f5f7;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.upload-current p { margin: 0.25rem 0; font-size: 0.9rem; }
.upload-current code { font-size: 0.8rem; word-break: break-all; }

/* Daily downloads bar chart on admin/packages/show */
.download-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding: 0.5rem 0;
  border-bottom: 1px solid #ddd;
  margin: 1rem 0 0.25rem;
}
.download-bar {
  flex: 1;
  min-width: 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  height: 100%;
}
.download-bar-fill {
  background: #1565c0;
  border-radius: 2px 2px 0 0;
  min-height: 1px;
  transition: background 0.15s;
}
.download-bar-fill.is-zero { background: #ddd; }
.download-bar:hover .download-bar-fill { background: #0d47a1; }
.download-chart-labels {
  display: flex;
  gap: 3px;
  margin-bottom: 1.5rem;
  font-size: 0.7rem;
  color: #666;
}
.download-chart-labels span { flex: 1; min-width: 6px; text-align: center; }

/* --- Package cards --- */

.package-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.package-header h3 {
  margin: 0;
}

.package-actions {
  margin-top: 0.75rem;
}

/* --- Portal downloads: grouped package sections --- */

.dl-group {
  margin-bottom: 2.5rem;
}
.dl-group-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #e6e6ef;
}
/* The group title anchors each section — override the shell's top padding so
   the border sits tight against it. */
.account-shell .docs-content .dl-group-title {
  margin: 0;
  padding-top: 0;
}
.dl-group-count {
  font-size: 0.72rem;
  color: #666;
  background: #f0f0f5;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.dl-group-desc {
  margin: 0.5rem 0 0;
  color: #666;
  font-size: 0.85rem;
}

.dl-packages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.dl-package {
  background: #fff;
  border: 1.5px solid #e6e6ef;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dl-package-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.account-shell .docs-content .dl-package-name {
  margin: 0;
  font-size: 1.05rem;
}
.dl-package-slug {
  font-size: 0.72rem;
  color: #888;
  background: #f5f5fa;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.dl-package-latest {
  margin-left: auto;
  font-size: 0.78rem;
  color: #666;
}
.dl-package-desc {
  margin: 0.5rem 0 0;
  color: #555;
  font-size: 0.88rem;
}
.dl-versions {
  margin-top: 0.9rem;
}
.dl-package-empty {
  margin: 0.75rem 0 0;
  color: #888;
  font-size: 0.85rem;
  font-style: italic;
}
.wizard-params {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.6rem;
}
.wizard-param {
  display: grid;
  grid-template-columns: minmax(12rem, max-content) 8rem;
  align-items: center;
  gap: 0.25rem 0.75rem;
  font-weight: normal;
}
.wizard-param__hint {
  grid-column: 1 / -1;
  font-size: 0.8rem;
}
@media (max-width: 600px) {
  .wizard-param { grid-template-columns: 1fr; }
}
.dl-withdrawn-reason {
  font-size: 0.8rem;
  margin-top: 0.2rem;
  max-width: 32rem;
}
.dl-platforms {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #555;
  white-space: nowrap;
}
.dl-notes {
  max-width: 32rem;
  font-size: 0.85rem;
  line-height: 1.45;
}
.dl-notes p {
  margin: 0 0 0.35rem;
}
.dl-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* --- Status bar --- */

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0f0f5;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  gap: 1rem;
}

.status-bar-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-green { background: #2e7d32; }
.status-dot-red { background: #c62828; }

/* --- Inline form (admin add package) --- */

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
/* Logs page filter: one row; From – To only for "Custom range…". */
.logs-filter { gap: 0.5rem; }
.logs-filter #vehicle_id { max-width: 14rem; } /* a vehicle id can be a 36-character UUID */
.logs-filter__custom { display: none; align-items: center; gap: 0.4rem; }
.logs-filter:has(select[name="range"] option[value="custom"]:checked) .logs-filter__custom { display: inline-flex; }
.filter-summary { margin: -0.5rem 0 1rem; }

.form-select-inline {
  padding: 0.4rem 0.6rem;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
}

/* --- Misc --- */

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.callout {
  background: #e3f2fd;
  border-left: 4px solid #4361ee;
  padding: 1rem 1.25rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.5rem;
}
.callout p { margin: 0; }
.callout-danger {
  background: #fdecec;
  border-left-color: #e5484d;
  color: #7a1f22;
}

.empty-state {
  color: #888;
  font-style: italic;
  padding: 2rem;
  text-align: center;
}

.text-muted {
  color: #888;
  font-size: 0.85rem;
}

.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* --- Docs layout --- */

.docs-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 1rem;
}

.docs-sidebar-group {
  margin-bottom: 1.5rem;
}

.docs-sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 0.5rem;
}

.docs-sidebar-link {
  display: block;
  padding: 0.3rem 0.5rem;
  font-size: 0.9rem;
  color: #555;
  border-radius: 4px;
}
.docs-sidebar-link:hover {
  background: #f0f0f5;
  text-decoration: none;
  color: #1a1a2e;
}
.docs-sidebar-link.active {
  background: #4361ee;
  color: #fff;
}
.docs-sidebar-link.active:hover {
  background: #3651d4;
}

.docs-sidebar-link-sub {
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: #777;
}

.docs-toc {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.docs-toc-link {
  display: block;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  color: #888;
}
.docs-toc-link:hover {
  color: #4361ee;
  text-decoration: none;
}
.docs-toc-h3 {
  padding-left: 1.25rem;
}

.docs-content {
  flex: 1;
  min-width: 0;
}

/* Total saved line — highlighted so the savings stand out */
.buy-license-summary .total-saved-row dt,
.buy-license-summary .total-saved-row dd {
  color: #2e7d32;
  font-weight: 600;
}

/* Renewal info below "Total today" when a subscription is selected */
.buy-license-renewal {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
  color: #555;
  text-align: center;
}
.buy-license-renewal strong { color: #1a1a2e; font-weight: 600; }

.buy-license-summary .btn-block {
  margin-top: 0.75rem;
}
.buy-license-summary .btn-block[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.buy-license-terms {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: #555;
  line-height: 1.4;
  cursor: pointer;
}
.buy-license-terms input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.buy-license-terms a { color: #4361ee; }

/* Terms acceptance on the signup and invitation forms. */
.form-terms {
  margin-top: 1.25rem;
}
.terms-accept {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #555;
  line-height: 1.45;
  cursor: pointer;
}
.terms-accept input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.terms-accept a { color: #4361ee; }

/* Legal documents rendered from docs/legal/*.md */
.legal-document {
  max-width: 760px;
  margin: 0 auto;
}
.legal-document-header { margin-bottom: 1.5rem; }
.legal-document-body h1 { font-size: 1.75rem; margin-top: 0; }
.legal-document-body h2 { font-size: 1.25rem; margin-top: 1.75rem; }
.legal-document-body h3 { font-size: 1.05rem; margin-top: 1.25rem; }
.legal-document-body p,
.legal-document-body li { font-size: 0.95rem; line-height: 1.6; }

/* Strikethrough list price next to discounted price */
.unit-price-list {
  text-decoration: line-through;
  color: #999;
  margin-right: 0.4rem;
  font-size: 0.85em;
  font-weight: 400;
}

/* Company discount banner above plan picker */
.company-discount-banner {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: #1b5e20;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.company-discount-banner strong {
  font-weight: 700;
}

/* Admin: company-wide discount inline form */
.company-discount-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.75rem 0 1.25rem;
  padding: 0.85rem 1.1rem;
  background: #f5f7ff;
  border: 1px solid #dfe4ff;
  border-radius: 8px;
  font-size: 0.95rem;
}
.company-discount-form .company-discount-label,
.company-discount-form .company-discount-input,
.company-discount-form .company-discount-suffix,
.company-discount-form .company-discount-help,
.company-discount-form .btn {
  font-size: 0.95rem;
  line-height: 1.4;
}
.company-discount-form .company-discount-label {
  font-weight: 600;
  margin: 0;
}
.company-discount-form .company-discount-input {
  width: 80px;
  padding: 0.45rem 0.6rem;
}
.company-discount-form .company-discount-suffix {
  color: #555;
  margin-right: 0.25rem;
}
.company-discount-form .btn {
  padding: 0.45rem 1rem;
}
.company-discount-form .company-discount-help {
  font-size: 0.8rem;
  color: #777;
  margin-left: auto;
}

/* Buy Licenses */
.buy-license-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}
.buy-license-plans {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.buy-license-plan-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1.5px solid #e5e5ec;
  border-radius: 8px;
  cursor: pointer;
}
.buy-license-plan-blurb {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
}
.buy-license-plan-card.selected {
  border-color: #4361ee;
  box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}
.buy-license-plan-card input[type="radio"],
.buy-license-maint-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.buy-license-plan-name { font-weight: 600; }
.buy-license-plan-blurb { font-size: 0.85rem; color: #666; }
.buy-license-plan-price { font-weight: 700; }
.buy-license-plan-unit { font-size: 0.8rem; color: #888; font-weight: 400; }
.buy-license-summary {
  background: #fff;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.buy-license-summary dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}
.buy-license-summary dt { color: #666; }
.buy-license-summary dd { margin: 0; text-align: right; }
.buy-license-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
  margin-bottom: 1rem;
}
.buy-license-total strong { font-size: 1.25rem; }
.buy-license-excl-vat { font-size: 0.8rem; color: #888; font-weight: 400; }
.buy-license-vat-note {
  margin: -0.5rem 0 1rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #777;
}
.btn-block { display: block; width: 100%; text-align: center; }

.buy-license-help {
  font-size: 0.85rem;
  color: #666;
  margin: 0 0 0.75rem;
}

.buy-license-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.buy-license-tiers-card {
  background: #fafafa;
  border: 1px solid #ececf2;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  color: #555;
}
.buy-license-tiers-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 0.4rem;
}
.buy-license-tiers {
  width: 100%;
  border-collapse: collapse;
}
.buy-license-tiers td {
  padding: 0.15rem 0;
}
.buy-license-tiers td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.buy-license-tiers tr.tier-active {
  font-weight: 600;
  color: #1a1a2e;
}
.buy-license-tiers-beaten {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #1b5e20;
}
.buy-license-tiers-note {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: #888;
}

.buy-license-summary {
  font-size: 1rem;
}
.buy-license-summary h2 {
  font-size: 1.15rem;
}

.buy-license-maint-toggle {
  position: relative;
  display: grid;
  /* checkbox | name + blurb | price */
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1.5px solid #e5e5ec;
  border-radius: 8px;
  cursor: pointer;
}
.buy-license-maint-toggle.selected {
  border-color: #4361ee;
  box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}
/* The box is shown rather than hidden behind the card: the outline says which
   state you are in, the checkbox says it is yours to change. */
.buy-license-maint-toggle input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: #4361ee;
  cursor: pointer;
}
.buy-license-maint-toggle:focus-within {
  border-color: #4361ee;
}
.buy-license-maint-name { font-weight: 600; }
.buy-license-maint-blurb { font-size: 0.85rem; color: #666; }
.buy-license-maint-price { font-weight: 700; }
.buy-license-disclaimer {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: #888;
  text-align: center;
}
@media (max-width: 800px) {
  .buy-license-layout { grid-template-columns: 1fr; }
}

.stripe-link code {
  color: #635bff;
}
.stripe-link:hover code {
  text-decoration: underline;
}

.sortable-header {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.sortable-header:hover {
  color: #4361ee;
  text-decoration: none;
}
.sortable-header.is-active {
  color: #4361ee;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}
.pagination-info {
  font-size: 0.85rem;
  color: #666;
}

/* Subscription cards */
.subscription-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.subscription-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.subscription-card-title {
  font-weight: 600;
  font-size: 1.05rem;
}
.subscription-card-meta {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
}
.subscription-card-price {
  font-weight: 700;
  font-size: 1.1rem;
  text-align: right;
  white-space: nowrap;
}
.subscription-card-price-unit {
  font-size: 0.75rem;
  font-weight: 400;
  color: #888;
  display: block;
}
.subscription-card-stats {
  display: flex;
  gap: 2rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}
.subscription-card-stats > div { margin: 0; }
.subscription-card-stats dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 0.2rem;
}
.subscription-card-stats dd { margin: 0; font-size: 0.95rem; }
.subscription-card-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: #4361ee;
  margin-bottom: 0.5rem;
}
.subscription-card-details summary:hover { text-decoration: underline; }
.subscription-card-empty {
  font-size: 0.85rem;
  color: #888;
  margin: 0.5rem 0 1rem;
}
.data-table-compact th,
.data-table-compact td {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}
.subscription-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}
.subscription-card-actions .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Inactive buttons read as disabled everywhere. */
.btn[disabled],
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.count-muted {
  color: #888;
  font-weight: 400;
  font-size: 0.85em;
}

.license-group-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}
.license-group-header code {
  background: #f0f0f5;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.95rem;
}
.license-group-count {
  font-size: 0.8rem;
  font-weight: 400;
  color: #888;
}

/* Account dashboard cards */
.account-dashboard-company {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.account-dashboard-company-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.account-dashboard-company-header h2 {
  margin: 0;
  padding: 0;
  border: none;
}
.account-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.account-stat-card {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
}
.account-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: #1a1a2e;
}
.account-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-top: 0.25rem;
}
@media (max-width: 600px) {
  .account-dashboard-stats { grid-template-columns: 1fr; }
}

/* Account dashboard — tighter typography than docs */
.account-shell .docs-content { font-size: 0.9rem; }
.account-shell .docs-content h1 { font-size: 1.5rem; }
.account-shell .docs-content h2 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
}
.account-shell .docs-content h3 { font-size: 1rem; }
.account-shell .docs-content .detail-card dt { font-size: 0.8rem; }
.account-shell .docs-content .detail-card dd { font-size: 0.9rem; }

/* Markdown rendered content */
.docs-content h1 { margin-top: 0; }
.docs-content h2 {
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}
.docs-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.docs-content pre {
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

.docs-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.docs-content table th,
.docs-content table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  text-align: left;
  font-size: 0.9rem;
}
.docs-content table th {
  background: #f0f0f5;
  font-weight: 600;
}

.docs-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 6px;
}

/* Guide cards */
.guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.guide-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow-wrap: break-word;
  word-break: break-word;
}
.guide-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.guide-card p {
  color: #666;
  font-size: 0.9rem;
  margin: 0;
}

/* --- Configuration editor --- */


/* --- JSON editor: gutter + coloured overlay + live verdict --- */

.json-editor {
  border-radius: 6px;
  overflow: hidden;
  background: #1a1a2e;
}

/* The height lives here, on the flex container, and nowhere else.

   Put it on __body instead and the gutter — which has no height of its own and
   renders one span per line — sets the flex line's cross size to its full
   content height. The frame then grows to the line count while __body stays
   put, and the text ends up in a short scrolling box at the top of a tall dark
   one, like an iframe. With the height here, both children stretch to it and
   the gutter's overflow does the clipping. */
.json-editor__frame {
  display: flex;
  align-items: stretch;
  height: 26rem;
}

/* Both boxes must agree on every metric that affects where a glyph lands, or
   the overlay drifts out from under the caret. Change these together.

   The selector is doubled on purpose. The editor sits inside a .form-group, and
   `.form-group textarea` (0-1-1) outranks a lone `.json-editor__ink` (0-1-0) —
   it would hand the textarea `font-family: inherit` (a proportional face!), a
   different size, different padding and a border, while the <pre> underneath
   kept monospace. The two layers then drift further apart along every line.
   Keep both classes, and keep re-declaring the properties that rule sets. */
.json-editor .json-editor__ink {
  margin: 0;
  border: 0;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 1rem 1.25rem;
  tab-size: 2;
  white-space: pre;
  word-wrap: normal;
  overflow-wrap: normal;
  border-radius: 0;

  /* Everything below shifts where a glyph lands. Declared explicitly — not
     left to inherit — so an ambient form or layout rule can't move one layer
     without moving the other. */
  font-weight: 400;
  font-style: normal;
  font-variant-ligatures: none;
  letter-spacing: normal;
  word-spacing: normal;
  text-indent: 0;
  text-transform: none;
  text-rendering: auto;
}

/* .form-group textarea:focus paints a border colour and a ring, which would
   sit over the overlay and move the text. The frame shows focus instead. */
.json-editor .json-editor__input:focus {
  border: 0;
  box-shadow: none;
  outline: none;
}
.json-editor:focus-within {
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.json-editor__gutter {
  flex: 0 0 auto;
  padding: 1rem 0.75rem 1rem 1rem;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  text-align: right;
  color: #4a4a68;
  background: #16162a;
  user-select: none;
  overflow: hidden;
  min-width: 3ch;
  height: 100%;
}
.json-editor__line {
  display: block;
}
.json-editor__line.is-error {
  color: #fff;
  background: #e5484d;
  border-radius: 3px;
  padding: 0 0.35rem;
  margin: 0 -0.35rem;
  font-weight: 700;
}

.json-editor__body {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}

.json-editor .json-editor__highlight,
.json-editor .json-editor__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.json-editor__highlight {
  overflow: hidden;
  color: #e0e0e0;
  pointer-events: none;
}

/* Readable on its own: without JavaScript the overlay stays empty, so the
   textarea keeps its own text and this degrades to the plain editor it was.
   The controller adds .is-enhanced once it connects, and only then does the
   text hand over to the coloured layer underneath. */
.json-editor .json-editor__input {
  background: transparent;
  color: #e0e0e0;
  caret-color: #e0e0e0;
  resize: none;
  overflow: auto;
  outline: none;
}
.json-editor.is-enhanced .json-editor__input {
  color: transparent;
}
.json-editor.is-enhanced .json-editor__input::selection {
  background: rgba(67, 97, 238, 0.45);
  color: transparent;
}

.json-editor__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: #16162a;
  border-top: 1px solid #26263f;
}

.json-editor__status {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.78rem;
  color: #9aa0b5;
}
.json-editor__status[data-state="valid"]   { color: #98c379; }
.json-editor__status[data-state="invalid"] { color: #ff7b72; font-weight: 600; }

.json-editor__repair[hidden] {
  display: none;
}

.json-editor__banner {
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.json-editor__banner ul {
  margin: 0.4rem 0 0;
  padding-left: 1.25rem;
}
.json-editor__banner--error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}
.json-editor__banner--fixed {
  background: #e8f5e9;
  border: 1px solid #c3e6cb;
  color: #1b5e20;
}

/* JSON tokens, sharing the One Dark palette used by the API reference. */
.json-editor__highlight .syn-key     { color: #61afef; }
.json-editor__highlight .syn-string  { color: #98c379; }
.json-editor__highlight .syn-number  { color: #d19a66; }
.json-editor__highlight .syn-literal { color: #c678dd; }
.json-editor__highlight .syn-punct   { color: #abb2bf; }

.config-editor {
  width: 100%;
  min-height: 400px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  background: #1a1a2e;
  color: #e0e0e0;
  border: none;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  tab-size: 2;
  resize: vertical;
}
.config-editor:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.config-preview pre {
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}
.config-preview pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.page-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Secondary line beneath a table cell's primary value (e.g. a slug under a name). */
.cell-subtext {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #8a8a99;
}

/* Signed-license (JWT) display — wrap the long token instead of overflowing. */
.token-block {
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 9rem;
  overflow: auto;
  background: #1a1a2e;
  color: #e0e0e0;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.75rem;
  line-height: 1.5;
}
.token-block code {
  background: none;
  padding: 0;
  color: inherit;
}

/* --- Configuration content: tabs + block diagram --- */

.config-content {
  margin-bottom: 1.5rem;
}

.config-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid #e6e6ef;
  margin-bottom: 1rem;
}
.config-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 1rem;
  margin-bottom: -1px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
}
.config-tab:hover {
  color: #1a1a2e;
}
a.config-tab { text-decoration: none; }
.config-tab.is-active {
  color: #4361ee;
  border-bottom-color: #4361ee;
}

.cfg-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

/* Diagram toolbar: a permanent row of block-adding tools above the diagram,
   distinct from .cfg-toolbar (expand/collapse), which sits inside it. */
.cfg-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
  background: #f7f7fb;
  border: 1px solid #e6e6ef;
  border-radius: 6px;
}
.cfg-tools:empty {
  display: none;
}

/* A tool and the sub-toolbar that drops open under it. */
.cfg-tool {
  position: relative;
}
.cfg-tool__button[aria-expanded="true"] {
  background: #4361ee;
  border-color: #4361ee;
  color: #fff;
}
.cfg-tool__menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 17rem;
  max-height: 24rem;
  overflow-y: auto;
  padding: 0.3rem;
  background: #fff;
  border: 1px solid #e1e1ee;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(26, 26, 46, 0.14);
}
.cfg-tool__option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  background: none;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  color: #1a1a2e;
  cursor: pointer;
}
.cfg-tool__option:hover,
.cfg-tool__option:focus-visible {
  background: #eef1fe;
  outline: none;
}
.cfg-tool__option.is-draft {
  color: #6b7280;
}
.cfg-badge--draft {
  margin-left: auto;
  background: #fff4e5;
  border-color: #ffd9a8;
  color: #9a5b00;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Sits in a block's header, which is itself a button — hence the stopPropagation
   in the controller, so removing a block doesn't also collapse it on the way out. */
.cfg-block__delete {
  appearance: none;
  margin-left: auto;
  padding: 0 0.4rem;
  background: none;
  border: 0;
  border-radius: 4px;
  color: #9aa0b5;
  font-size: 0.85rem;
  line-height: 1.6;
  cursor: pointer;
}
.cfg-block__delete:hover,
.cfg-block__delete:focus-visible {
  background: #e5484d;
  color: #fff;
  outline: none;
}

/* Brief highlight so a newly added block is findable in a long diagram. */
.cfg-block.is-new {
  animation: cfg-block-in 1.2s ease-out;
}
@keyframes cfg-block-in {
  from { box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.45); }
  to   { box-shadow: 0 0 0 3px rgba(67, 97, 238, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .cfg-block.is-new { animation: none; }
}

.cfg-toolbar {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}
.cfg-toolbar__btn {
  appearance: none;
  background: #ffffff;
  border: 1px solid #e1e1ee;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4361ee;
  cursor: pointer;
}
.cfg-toolbar__btn:hover {
  background: #f2f4fd;
}

.cfg-top {
  margin-bottom: 1rem;
}

.cfg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  align-items: start;
}

.cfg-block {
  border: 1px solid #e1e1ee;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}
/* Three sibling controls, not one button: the caret collapses, the title
   selects, the cross removes. They only look like a single bar. */
.cfg-block__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(180deg, #f7f8ff, #eef1fd);
  border: 0;
  border-bottom: 1px solid #e1e1ee;
  font: inherit;
  text-align: left;
}
.cfg-block__select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cfg-block__select:focus-visible {
  outline: 2px solid #4361ee;
  outline-offset: 2px;
  border-radius: 3px;
}
.cfg-block.is-collapsed .cfg-block__header {
  border-bottom-color: transparent;
}
.cfg-block__caret {
  appearance: none;
  flex: 0 0 auto;
  padding: 0 0.15rem;
  background: none;
  border: 0;
  border-radius: 3px;
  font: inherit;
  font-size: 0.7rem;
  color: #8a8a99;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.cfg-block__caret:hover,
.cfg-block__caret:focus-visible {
  color: #1a1a2e;
  background: rgba(67, 97, 238, 0.12);
  outline: none;
}

/* Services are software rather than hardware — give them their own accent the
   same way identity has one: header and outline only, body stays white.
   Violet, because identity is already green and the two must stay tellable
   apart at a glance. */
.cfg-block--service {
  border-color: #c4b5fd;
}
.cfg-block--service > .cfg-block__header {
  background: linear-gradient(180deg, #f5f3ff, #ede9fe);
  border-bottom-color: #c4b5fd;
}
.cfg-block--service.is-collapsed > .cfg-block__header {
  border-bottom-color: transparent;
}
.cfg-block--service > .cfg-block__header .cfg-block__title {
  color: #5b21b6;
}
.cfg-block--service > .cfg-block__header .cfg-badge--type {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}
.cfg-block--service.is-selected {
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.35);
}
.cfg-block--service.is-selected > .cfg-block__header {
  background: linear-gradient(180deg, #ede9fe, #ddd6fe);
}

/* A selected block stays marked while you edit it — the ring survives redraws. */
.cfg-block.is-selected {
  border-color: #4361ee;
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.35);
}
.cfg-block.is-selected > .cfg-block__header {
  background: linear-gradient(180deg, #e8ecff, #dbe2fd);
}
.cfg-block.is-collapsed .cfg-block__caret {
  transform: rotate(-90deg);
}
.cfg-block.is-collapsed .cfg-block__body {
  display: none;
}
.cfg-block__title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1a1a2e;
}
.cfg-block__body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.cfg-block .cfg-block {
  background: #fafaff;
}
.cfg-block .cfg-block__header {
  background: #f2f4fd;
}

.cfg-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.3rem 0.85rem;
}
/* The identity block holds long values (UUID, names) — keep it one column. */
.cfg-block[data-key="identity"] > .cfg-block__body > .cfg-fields {
  grid-template-columns: 1fr;
}

/* Identity is the vehicle's special root block — give it a distinct accent. */
.cfg-block[data-key="identity"] {
  border-color: #9bd9c5;
}
.cfg-block[data-key="identity"] > .cfg-block__header {
  background: linear-gradient(180deg, #ecfdf5, #d6f3e7);
  border-bottom-color: #9bd9c5;
}
.cfg-block[data-key="identity"].is-collapsed > .cfg-block__header {
  border-bottom-color: transparent;
}
.cfg-block[data-key="identity"] > .cfg-block__header .cfg-block__title {
  color: #0f766e;
}
.cfg-field {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  min-width: 0;
}
.cfg-field__key {
  color: #6b7280;
  white-space: nowrap;
}
.cfg-field__val {
  color: #1a1a2e;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
  text-align: right;
}

.cfg-badge {
  margin-left: auto;
  background: #e7ebfd;
  color: #4361ee;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}
.cfg-badge--type {
  background: #1a1a2e;
  color: #ffffff;
}

.cfg-note {
  margin: 0;
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.4;
  color: #8a8a99;
}
.cfg-field--note {
  background: #f7f7fb;
  border-left: 2px solid #d9dcec;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
}

/* API reference */
/* --- API module description --- */

.guides-intro {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #555;
  max-width: 720px;
  margin-bottom: 2rem;
}

.api-module-desc {
  color: #666;
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.api-entry {
  margin-bottom: 2rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}
.api-entry:first-child {
  padding-top: 0;
}
.api-entry:last-child,
.api-entry:has(+ h2) {
  border-bottom: none;
}
.api-entry .api-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.api-signature {
  background: #1a1a2e;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  overflow-x: auto;
}
.api-signature code {
  background: none;
  color: #e0e0e0;
  font-size: 0.9rem;
}

.api-returns {
  font-size: 0.9rem;
  color: #555;
}
.api-returns code {
  background: none;
  padding: 0;
}

.api-params {
  margin: 0.75rem 0;
}
.api-params code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.api-include {
  background: #1a1a2e;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  margin-bottom: 2rem;
}
.api-include code {
  background: none;
  color: #e0e0e0;
  font-size: 0.9rem;
}

.api-details {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555;
  margin: 0.5rem 0;
}

.api-note {
  background: #fff8e1;
  border-left: 3px solid #f9a825;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #5d4037;
  border-radius: 0 4px 4px 0;
  overflow: visible;
}

.api-available-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: #e3f2fd;
  color: #1565c0;
  margin-bottom: 0.75rem;
}

.api-available-upcoming {
  background: #fce4ec;
  color: #c62828;
}

/* --- Syntax highlighting (API signatures) --- */

.syn-keyword  { color: #c678dd; }                          /* purple — keywords */
.syn-type     { color: #61afef; }                          /* blue — types */
.syn-func     { color: #e5c07b; }                          /* gold — function names */
.syn-param    { color: #e06c75; }                          /* red-ish — parameter names */
.syn-arrow    { color: #56b6c2; }                          /* cyan — -> arrow */
.syn-paren    { color: #abb2bf; }                          /* light grey — parentheses */
.syn-bracket  { color: #abb2bf; }                          /* light grey — < > */
.syn-punct    { color: #abb2bf; }                          /* light grey — , ; = */

/* Code block tokens (dark background) */
.syn-comment   { color: #7f848e; font-style: italic; }    /* grey — comments */
.syn-string    { color: #98c379; }                         /* green — strings */
.syn-number    { color: #d19a66; }                         /* orange — numbers */
.syn-directive { color: #c678dd; }                         /* purple — preprocessor */

/* In tables (light background), use darker shades */
.data-table .syn-keyword  { color: #8839be; }
.data-table .syn-type     { color: #2a6fad; }
.data-table .syn-func     { color: #986801; }
.data-table .syn-param    { color: #c24a52; }
.data-table .syn-arrow    { color: #0e7e8c; }

/* --- Footer --- */

/* Dark blue, like the header, on every page (the admin overrides it in black). */
.site-footer {
  padding: 32px 0 24px;
  border-top: 1px solid #2a2a4a;
  background: #1a1a2e;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  justify-content: center;
  gap: 48px;
  width: min(1200px, 92vw);
  margin: 0 auto 24px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-col-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8888aa;
  margin-bottom: 4px;
}

.footer-col-title-admin {
  color: #f7c948;
}

.footer-col a {
  color: #b0b8d0;
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-col a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  width: min(1200px, 92vw);
  margin: 0 auto;
  font-size: 0.85rem;
  color: #666888;
  border-top: 1px solid #2a2a4a;
  padding-top: 20px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b0b8d0;
  text-decoration: none;
}
.footer-brand:hover { color: #fff; text-decoration: none; }
/* The navy logo file, turned light grey on the dark footer. */
.footer-brand-logo {
  display: block;
  height: 16px;
  width: auto;
  filter: brightness(0) invert(0.78);
}
.footer-brand-name { font-weight: 300; position: relative; top: -1px; }

.admin-footer {
  background: #111;
  border-top: 1px solid #333;
}

.admin-footer .footer-col-title {
  color: #777;
}

.admin-footer .footer-col-title-admin {
  color: #d45555;
}

.admin-footer .footer-col a {
  color: #aaa;
}

.admin-footer .footer-col a:hover {
  color: #fff;
}

.admin-footer .footer-copy {
  justify-content: center;
  color: #555;
  border-top-color: #333;
}

/* --- Responsive --- */

@media (max-width: 640px) {
  .detail-card dl {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    flex-wrap: wrap;
    gap: 24px 36px;
    padding: 0 1.5rem;
  }
  .docs-layout {
    flex-direction: column;
  }
  .docs-sidebar {
    width: 100%;
    position: static;
  }
}

/* Cookie consent banner — fixed at bottom until accepted */
.cookie-banner {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 1000;
  background: #1a1a2e;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.cookie-banner-text {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  flex: 1;
  min-width: 240px;
}
.cookie-banner-text a {
  color: #9bb0ff;
  text-decoration: underline;
}
.cookie-banner-text a:hover { color: #fff; }
.cookie-banner .btn { flex-shrink: 0; }

/* Support ticket thread */
.support-thread {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.5rem 0 1.5rem;
}
.support-message {
  padding: 0.9rem 1.1rem 0.9rem 1.25rem;
  border-radius: 8px;
  border: 1px solid #ececf2;
  background: #fff;
  border-left-width: 4px;
}
.support-message.from-customer {
  background: #f0fdf4;        /* light green */
  border-color: #d9f0e0;
  border-left-color: #2e7d32; /* green accent */
}
.support-message.from-support {
  background: #f5f7ff;        /* light blue */
  border-color: #dfe4ff;
  border-left-color: #4361ee; /* brand blue accent */
}
.support-message.from-customer .support-message-head strong { color: #1b5e20; }
.support-message.from-support  .support-message-head strong { color: #1a1a2e; }
.support-message-head {
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}
.support-message-body {
  font-size: 0.95rem;
  line-height: 1.55;
}
.support-message-body p { margin: 0 0 0.5rem; }
.support-message-body p:last-child { margin: 0; }

.form-hint {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: #555;
}

/* Find a company: the first letters companies start with */
.letter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin: 0 0 1rem;
}
.letter-link {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 600;
  color: #4361ee;
  text-decoration: none;
}
.letter-link.is-active { background: #4361ee; color: #fff; }

/* The active company in the portal sidebar: a switcher, or just its name */
.sidebar-company {
  margin: 0.75rem 0 0.1rem;
}
.sidebar-company-header {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}
.sidebar-company-switch {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}
.sidebar-company-name {
  flex: 1;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
}

/* --- Admin package groups (vertical drag-and-drop board) --- */

.pg-hint {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
}

.pg-board {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pg-section {
  background: #fff;
  border: 1.5px solid #e6e6ef;
  border-radius: 10px;
  padding: 1rem 1.15rem 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.pg-section.is-drop-target {
  border-color: #4361ee;
  border-style: dashed;
  background: #f5f7ff;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

.pg-section-head {
  margin-bottom: 0.5rem;
}
.pg-section-titlebar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.pg-section-title {
  margin: 0;
  font-size: 1.1rem;
}
.group-slug {
  font-size: 0.75rem;
  color: #555;
  background: #f0f0f5;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}
.pg-count {
  font-size: 0.78rem;
  color: #777;
  background: #f0f0f5;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.pg-section-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pg-locked {
  font-size: 0.8rem;
  white-space: nowrap;
}
.pg-section-desc {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.pkg-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0 0.35rem;
  min-height: 2.25rem;
}

.pkg-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 0.4rem;
  cursor: grab;
}
.pkg-item:last-child { margin-bottom: 0; }
.pkg-item:hover { border-color: #d7d7e6; background: #fbfbfe; }
.pkg-item.is-dragging { opacity: 0.45; cursor: grabbing; }

.pkg-drag {
  color: #bbb;
  font-size: 1.05rem;
  line-height: 1;
  cursor: grab;
  user-select: none;
}
.pkg-main {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 40%;
}
.pkg-name { font-weight: 600; }
.pkg-slug { font-size: 0.72rem; color: #888; }

.pkg-meta {
  display: flex;
  gap: 0.9rem;
  font-size: 0.78rem;
  flex: 1 1 auto;
}
.pkg-meta span { white-space: nowrap; }

.pkg-actions {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}
.pkg-actions form { display: inline; }

.pkg-empty {
  padding: 0.6rem;
  font-size: 0.85rem;
  font-style: italic;
  border: 1px dashed #e0e0ec;
  border-radius: 8px;
  text-align: center;
}

@media (max-width: 720px) {
  .pkg-item { flex-wrap: wrap; }
  .pkg-meta { order: 3; flex-basis: 100%; }
}

/* ── Catalog hardware pictures ─────────────────────────────────────────── */
.hw-image {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: #f4f5f7;
  border-radius: 6px;
}
/* Drawings carry their own margin; no padding here (a % padding is taken
   from the container's width, which shrinks the drawing in wide layouts). */
.hw-image--icon {
  padding: 0;
}
.hw-image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #97a0af;
  font-size: 1.5rem;
}
.hw-image--thumb {
  width: 96px;
}
.hw-picture {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 110px;
}
.hw-picture__form {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
}
.hw-picture__form input[type="file"] {
  max-width: 180px;
}

/* Board picker: one card per catalog board */
.board-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.board-picker .board-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem;
  border: 2px solid #dfe1e6;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
}
.board-card:hover {
  border-color: #4c9aff;
}
.board-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.board-card:has(input:checked) {
  border-color: #4361ee;
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}
.board-card:has(input:focus-visible) {
  outline: 2px solid #4361ee;
  outline-offset: 2px;
}
.board-card__label {
  display: block;
  font-weight: 600;
}
.board-card__meta {
  display: block;
  font-size: 0.8rem;
  color: #6b778c;
}
.board-picker[hidden] { display: none; }
.board-summary {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.board-summary .hw-image {
  width: 150px;
  flex-shrink: 0;
}

/* Configuration toolbar options with a picture */
.cfg-tool__option img.cfg-tool__thumb.is-icon {
  padding: 2px;
  box-sizing: border-box;
}
.cfg-tool__option img.cfg-tool__thumb {
  flex-shrink: 0;
  margin: 0; /* the content area's image rule adds block margins */
  width: 42px;
  height: 28px;
  object-fit: contain;
  background: #f4f5f7;
  border-radius: 4px;
}

/* Wide tables scroll inside their card instead of pushing the page sideways. */
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}
.table-scroll > .data-table {
  margin-bottom: 0;
}

/* License kind: can the vehicle arm? */
.badge-kind-activated { background: #e3fcef; color: #006644; }
.badge-kind-unlimited { background: #deebff; color: #0747a6; }
.badge-kind-unactivated { background: #fffae6; color: #974f0c; }

/* Catalog picture cell: the picture, and a small control to swap in a photo. */
.hw-picture__replace summary {
  cursor: pointer;
  font-size: 0.75rem;
  color: #4361ee;
}
.hw-picture__replace[open] summary {
  margin-bottom: 0.3rem;
}
.hw-picture__meta {
  font-size: 0.75rem;
  color: #6b778c;
}
.board-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.board-inline img {
  width: 36px;
  height: 24px;
  object-fit: contain;
}

/* Add Device wizard */
.wizard-steps {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
}
.wizard-steps li {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: #f1f2f4;
  color: #6b778c;
}
.wizard-steps li.is-current {
  background: #4361ee;
  color: #fff;
  font-weight: 600;
}
.wizard-steps li.is-done {
  background: #e3fcef;
  color: #006644;
}
.wizard-board {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.wizard-board img,
.wizard-board .hw-image {
  width: 72px;
  height: 48px;
  object-fit: contain;
}
.wizard-group {
  border: 0;
  padding: 0;
  margin: 0 0 1.75rem;
  min-width: 0;
}
.wizard-group legend {
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}
.wizard-group__hint {
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}
.board-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.board-card:has(input[type="checkbox"]:checked)::after {
  content: "✓";
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: #4361ee;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.3rem;
  text-align: center;
}

/* Tabs across the related pages of one sidebar section */
.section-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid #dfe1e6;
  margin: 0 0 1.5rem;
  overflow-x: auto;
  overflow-y: hidden; /* the tabs' -1px margin would otherwise add a vertical scrollbar */
}
.section-tab {
  padding: 0.5rem 0.9rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: #6b778c;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.section-tab:hover {
  color: #172b4d;
}
.section-tab.is-active {
  color: #4361ee;
  border-bottom-color: #4361ee;
  font-weight: 600;
}

/* Row actions in a data table */
.data-table td.actions {
  white-space: nowrap;
}
.data-table td.actions > * + * {
  margin-left: 0.35rem;
}

/* A destructive action set apart at the foot of a detail page */
.danger-zone {
  margin-top: 2rem;
  border: 1px solid #f5c2c2;
}
.detail-card.danger-zone h2 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  color: #c0392b;
}

/* Devices list: selection and the actions on the selected rows */
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}
.bulk-bar__seats {
  margin-left: auto;
  font-size: 0.85rem;
}
.data-table .select-col {
  width: 2rem;
  text-align: center;
}

/* One line per device; the full vehicle ID is on hover and the device page. */
.devices-table th,
.devices-table td,
.table-oneline th,
.table-oneline td {
  white-space: nowrap;
  vertical-align: middle;
}
.devices-table .badge {
  margin-right: 0.25rem;
}

/* An icon-only link in a table cell (e.g. download), with a comfortable hit area. */
.data-table .icon-col {
  text-align: center;
}
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  color: #4361ee;
}
.icon-link:hover,
.icon-link:focus-visible {
  background: #eef1fd;
}
button.icon-link {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.icon-link--danger {
  color: #c0392b;
}
.icon-link--danger:hover,
.icon-link--danger:focus-visible {
  background: #fdecea;
}
.data-table td.actions {
  vertical-align: middle;
}
.data-table td.actions > .icon-link,
.data-table td.actions > form {
  vertical-align: middle;
}
/* Flight log tables: the long free-form values (vehicles, file names) wrap, the short fixed ones don't. */
.logs-table td {
  vertical-align: middle;
}
.logs-table .nowrap {
  white-space: nowrap;
}
.logs-table .cell-file {
  overflow-wrap: anywhere;
}
/* A long id in a cell's second line (.cell-subtext) is cut; its title has it all. */
.data-table .cell-clip {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A button with an icon before its label (e.g. a download per platform). */
.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
/* Wide one-line tables: a little less side padding so every column fits. */
.docs-content .table-oneline th,
.docs-content .table-oneline td,
.docs-content .logs-table th,
.docs-content .logs-table td {
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}

/* Internal details (model, variance, ids) folded away under a summary. */
.advanced-details {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #ebecf0;
}
.advanced-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: #6b778c;
}
.advanced-details dl {
  margin-top: 0.75rem;
}
.board-sync-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

/* Vehicle type page: the facts strip and the folded advanced editor. */
.type-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2.5rem;
  margin: 0 0 1.75rem;
}
.type-facts .wizard-board {
  margin: 0;
}
.type-facts__item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.9rem;
}
.type-facts__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b778c;
}
.advanced-settings {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid #dfe1e6;
  border-radius: 8px;
  background: #fff;
}
.advanced-settings > summary {
  cursor: pointer;
}
.advanced-settings[open] > summary {
  margin-bottom: 1rem;
}
.advanced-ids {
  margin-top: 1.5rem;
  font-size: 0.85rem;
}

/* Admin → Package storage: connection test results */
.storage-test {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: #f4f5f7;
  font-size: 0.9rem;
}
.storage-test ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  list-style: none;
}
.storage-test__ok { color: #006644; }
.storage-test__fail { color: #c0392b; }

/* --- Provider sign-in (Google) --- */

/* Neutral white button per Google's sign-in branding: logo left, dark label. */
.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #747775;
}
.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3);
}
.btn-google-logo {
  flex-shrink: 0;
}

.provider-sign-in {
  margin: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: #888;
  font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #e5e5e5;
}

/* Account page: one row per sign-in method, action on the right. */
.sign-in-methods {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.sign-in-method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}
.sign-in-method + .sign-in-method {
  border-top: 1px solid #eee;
}
.sign-in-method-name {
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.sign-in-method .text-muted {
  font-size: 0.9rem;
}
.sign-in-method-note {
  font-size: 0.85rem;
  white-space: nowrap;
}
.sign-in-method .provider-sign-in .btn-google {
  width: auto;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}
@media (max-width: 600px) {
  .sign-in-method { flex-direction: column; align-items: flex-start; }
}

/* --- Code blocks: copy button (DRC-61) --- */

.code-block {
  position: relative;
  margin: 1rem 0;
}

.code-block pre {
  margin: 0;
  padding-top: 2.5rem; /* room for the button, so it never covers code */
}

.code-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.6rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #e0e0e0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
}
.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.code-copy-btn:focus-visible {
  outline: 2px solid #9aaaff;
  outline-offset: 2px;
}
.code-copy-btn.is-copied {
  color: #98c379;
  border-color: #98c379;
}

/* --- Narrow windows: guide pages must not scroll sideways (DRC-61) --- */

.docs-content .table-scroll { margin: 1rem 0; }
.docs-content .table-scroll > table { margin: 0; }

/* Tables are wrapped in .table-scroll by Docs::HtmlRenderer#table, so they
   scroll inside their own box. Below 640px .docs-layout stacks into a column;
   without this, .docs-content grows to fit its widest code block. */
@media (max-width: 640px) {
  .docs-content { width: 100%; }
}
/* --- "Solved with the SDK" story page (DRC-61 Part 2) --- */

.portal-layout .container:has(.story-page),
.public-layout .container:has(.story-page) {
  max-width: 1200px;
}

.story-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.story-page .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Small uppercase section labels ("1 Â· THE MISSION") */
.story-eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4361ee;
  line-height: 1.4;
}
.story-eyebrow--muted { color: #555; }
.story-eyebrow--light { color: #9aaaff; }

/* Header */
.story-header {
  background: #f0f2fa;
  border: 1px solid #e3e6ef;
  border-radius: 12px;
  padding: 1.75rem 2rem;
}
.story-breadcrumb {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #666;
}
.story-header h1 {
  margin: 0 0 0.5rem;
  font-size: 2.1rem;
}
.story-summary {
  margin: 0 0 1rem;
  max-width: 48rem;
  text-wrap: balance; /* if it wraps, two even lines rather than one word alone */
  font-size: 1.05rem;
  color: #3a4058;
}
.story-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.story-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #4a5068;
  background: #e6e9f2;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
}
.story-badge--available { color: #1f6b45; background: #e3f3ea; font-weight: 700; }
.story-badge--soon { color: #7a4e00; background: #fff1d6; font-weight: 700; }
.story-meta {
  font-size: 0.8rem;
  color: #666;
}

/* The story at a glance: 4 illustrated panels */
.story-glance-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.story-glance-panel {
  background: #fff;
  border: 1px solid #e3e6ef;
  border-radius: 12px;
  overflow: hidden;
}
.story-glance-image {
  display: block;
  width: 100%;
  aspect-ratio: 240 / 130;
  object-fit: cover;
}
.story-glance-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem 0.9rem;
}
.story-glance-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4361ee;
}
.story-glance-title {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.35;
}

/* Section tabs */
.story-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 0;
  border-top: 1px solid #e3e6ef;
  border-bottom: 1px solid #e3e6ef;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fafafa;
}
.story-tab {
  font-size: 0.85rem;
  font-weight: 700;
  color: #555;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
}
.story-tab:hover {
  background: #eef0ff;
  color: #4361ee;
  text-decoration: none;
}

/* Scroll targets land below the sticky tabs */
.story-page [id] {
  scroll-margin-top: 4.5rem;
}

/* Two columns: mission / obstacle, own / outcome */
.story-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}
.story-prose > :first-child { margin-top: 0; }
.story-prose > :last-child { margin-bottom: 0; }
.story-prose p,
.story-prose li {
  color: #3a4058;
  line-height: 1.7;
}

/* Outcome (DRC-64): "Why this works" callout under the table */
.story-section--the-outcome blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: #eef2ff;
  border-left: 3px solid #4359e0;
  border-radius: 6px;
}
.story-section--the-outcome blockquote p { margin: 0; }

/* How the SDK solves it: intro, then steps beside the code */
.story-turning {
  background: #fff;
  border: 1px solid #e3e6ef;
  border-radius: 14px;
  padding: 1.5rem 1.75rem 1.75rem;
}
.story-turning-heading {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
}
.story-steps {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.5rem;
  align-items: start;
}
.story-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.story-step {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem;
  border-radius: 10px;
  cursor: pointer;
}
.story-step:hover { background: #f5f6fc; }
.story-step.is-active { background: #eef1fd; }
.story-step-number {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #4a5068;
  background: #e3e6ef;
}
.story-step.is-active .story-step-number {
  color: #fff;
  background: #4361ee;
}
.story-step-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.story-step-title {
  all: unset;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
}
.story-step-title:focus-visible {
  outline: 2px solid #4361ee;
  outline-offset: 2px;
  border-radius: 3px;
}
.story-step-text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #555;
}

/* Code panel */
.story-code {
  background: #1a1a2e;
  border-radius: 10px;
  overflow: hidden;
  position: sticky;
  top: 4.5rem;
}
.story-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #2c3656;
}
.story-code-file {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.8rem;
  color: #b8c0d6;
}
.story-code .code-copy-btn {
  position: static; /* in the bar, not floating over the code */
}
.story-code pre {
  margin: 0;
  padding: 0.9rem 0;
  overflow-x: auto;
  color: #e0e0e0;
  font-size: 0.82rem;
  line-height: 1.7;
}
.story-code pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
.story-code-line {
  display: block;
  padding: 0 1rem;
  min-height: 1.7em;
}
.story-code-line.is-highlighted {
  background: rgba(154, 170, 255, 0.16);
  box-shadow: inset 3px 0 0 #9aaaff;
}

/* Try it yourself banner */
.story-try {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: #1a1a2e;
  color: #f4f5f9;
  border-radius: 14px;
  padding: 1.75rem 2rem;
}
.story-try-text { flex: 1; min-width: 0; }
.story-try-title {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
  color: #fff;
}
.story-try-body {
  margin: 0;
  font-size: 0.9rem;
  color: #c9d0e3;
}
.story-try-body a { color: #9aaaff; }
/* Inline code on the dark banner: light text on a faint light chip */
.story-try-body code {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
}
.story-try-body a code {
  color: #c7d0ff;
}
.story-try-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.story-btn-secondary {
  background: #2c3656;
  color: #f4f5f9;
}
.story-btn-secondary:hover {
  background: #3a466c;
  color: #fff;
}

/* Extra sections (reference material after the banner) */
.story-extra h2 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

.story-back {
  margin: 0;
  font-size: 0.9rem;
}

/* Demo video (DRC-64): a compact card (thumbnail + title) linking to YouTube,
   in "How the SDK solves it", between the text and the steps */
.story-video {
  display: flex;
  align-items: stretch;
  max-width: 520px;
  margin: 1.25rem 0 1.5rem;
  border: 1px solid #e3e6ef;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  color: #1a1a2e;
  text-decoration: none;
}
.story-video:hover { border-color: #4359e0; }
.story-video:focus-visible {
  outline: 3px solid #4359e0;
  outline-offset: 3px;
}
.story-video-poster {
  display: block;
  flex: 0 0 180px;
  width: 180px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.story-video-caption {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  min-width: 0;
}
.story-video-title { font-weight: 600; }
.story-video-meta { color: #4359e0; font-size: 0.85rem; font-weight: 600; }
.story-video:hover .story-video-meta { text-decoration: underline; }
@media (max-width: 480px) {
  .story-video { flex-direction: column; }
  .story-video-poster { flex-basis: auto; width: 100%; }
}

/* Hardware profiles (DRC-64): closed section, chips + one profile card */
.story-profiles {
  margin: 0; /* spacing comes from the page's 2rem gap, like every other section */
}
.story-profiles-details {
  border: 1px solid #e3e6ef;
  border-radius: 14px;
  background: #fff;
}
.story-profiles-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  cursor: pointer;
  list-style: none;
}
.story-profiles-summary::-webkit-details-marker { display: none; }
.story-profiles-summary:focus-visible {
  outline: 2px solid #4359e0;
  outline-offset: 2px;
  border-radius: 14px;
}
.story-profiles-heading {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.story-profiles-title {
  margin: 0; /* uses .story-eyebrow, like the other section headings */
}
.story-profiles-text {
  color: #555;
  font-size: 0.95rem;
}
/* "Show cameras" / "Hide" pill, in the style of the story badges */
.story-profiles-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: #eef1fd;
  color: #2f43c4;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.story-profiles-toggle-hide,
.story-profiles-details[open] .story-profiles-toggle-show { display: none; }
.story-profiles-details[open] .story-profiles-toggle-hide { display: inline; }
.story-profiles-toggle::after {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.story-profiles-details[open] .story-profiles-toggle::after { transform: translateY(2px) rotate(225deg); }
.story-profiles-summary:hover .story-profiles-toggle { background: #e0e6fc; }
.story-profiles-body {
  padding: 0 1.5rem 1.5rem;
}
.story-profile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.story-profile-chip {
  border: 1px solid #d6dcef;
  background: #fff;
  color: #1a1a2e;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.story-profile-chip:hover { border-color: #4359e0; }
.story-profile-chip[aria-selected="true"] {
  background: #4359e0;
  border-color: #4359e0;
  color: #fff;
}
.story-profile-chip:focus-visible {
  outline: 2px solid #4359e0;
  outline-offset: 2px;
}
.story-profiles-body .story-profile-card {
  margin-bottom: 0;
  background: #f8f9fd;
}
.story-profile-card {
  margin-bottom: 0;
}
.story-profile-card {
  border: 1px solid #e3e6ef;
  border-radius: 12px;
  background: #fff;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.story-profile-card[hidden] {
  display: none;
}
.story-profile-head h3 {
  margin: 0;
  font-size: 1.1rem;
}
.story-profile-meta {
  margin: 0.25rem 0 0.6rem;
  color: #555;
  font-size: 0.9rem;
}
.story-profile-summary {
  margin: 0 0 0.9rem;
  color: #3a4058;
}
.story-profile-caps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.story-profile-cap {
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.story-profile-cap.is-yes { background: #e3f3ea; color: #1f6b45; }
.story-profile-cap.is-yes::before { content: "✓ "; }
.story-profile-cap.is-no { background: #f1f2f5; color: #8a90a6; text-decoration: line-through; }
.story-profile-code {
  position: static;
  margin-bottom: 1rem;
}
.story-profile-code pre {
  padding: 0.9rem 1rem;
  max-height: 22rem; /* long catalog templates scroll inside the box */
  overflow: auto;
}
.story-profile-facts {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.5rem 1rem;
  margin: 0;
  font-size: 0.9rem;
}
.story-profile-facts dt { font-weight: 600; }
.story-profile-facts dd { margin: 0; color: #3a4058; }
@media (max-width: 600px) {
  .story-profile-facts { grid-template-columns: minmax(0, 1fr); }
  .story-profile-facts dd { margin-bottom: 0.5rem; }
}

/* Narrower windows: stack the columns */
@media (max-width: 900px) {
  .story-two-col,
  .story-steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .story-glance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .story-code {
    position: static;
  }
  .story-try {
    flex-direction: column;
    align-items: flex-start;
  }
  /* Tabs stay one row and scroll sideways, so they don't cover the page */
  .story-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .story-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .story-header { padding: 1.25rem; }
  .story-header h1 { font-size: 1.6rem; }
  .story-turning { padding: 1.25rem; }
  .story-glance-title { font-size: 0.85rem; }
}

/* --- Illustrated story cards on the Guides page (DRC-61 Part 2) --- */

.guide-card--story {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}
.guide-card--story:hover {
  box-shadow: 0 4px 14px rgba(26, 26, 46, 0.12);
  transform: translateY(-2px);
}
.guide-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}
.guide-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.25rem 1.25rem;
  flex-grow: 1;
}
.guide-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.guide-card--story h3 {
  margin: 0;
}
/* The whole card is clickable; the link stays the only focusable element. */
.guide-card--story h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.guide-card--story h3 a:focus-visible {
  outline: none;
}
.guide-card--story:has(h3 a:focus-visible) {
  outline: 2px solid #4361ee;
  outline-offset: 2px;
}
.guide-card-meta {
  margin-top: auto;
  font-size: 0.8rem;
  color: #888;
}
.guide-card--placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  background: #fafbfd;
  border: 1.5px dashed #c9cedd;
  box-shadow: none;
}
.guide-card--placeholder .story-badge {
  align-self: flex-start;
}
.guide-card--placeholder h3 {
  margin: 0;
  color: #4a5068;
}

/* Guides page on very narrow screens: a 320px minimum column was wider than
   the window below ~370px, so the page scrolled sideways. */
.guide-cards {
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
}

/* --- Notification center: header bell + dropdown (DRC-19) --- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.notif {
  position: relative;
}

.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  color: #ccc;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.notif-bell:hover,
.notif-bell[aria-expanded="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.notif-bell:focus-visible {
  outline: 2px solid #9aaaff;
  outline-offset: 2px;
}

.notif-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.25rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  box-sizing: border-box;
  border-radius: 999px;
  background: #e63946;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
}
.notif-badge[hidden] {
  display: none;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 50;
  width: min(380px, calc(100vw - 2rem));
  background: #fff;
  color: #1a1a2e;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.notif-loading,
.notif-empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: #888;
  font-size: 0.9rem;
}

.notif-menu-header,
.notif-menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
}
.notif-menu-header {
  border-bottom: 1px solid #eee;
}
.notif-menu-title {
  font-weight: 700;
  font-size: 0.95rem;
}
.notif-menu-footer {
  justify-content: center;
  border-top: 1px solid #eee;
}
.nav-links .notif-menu-footer a {
  color: #4361ee;
  font-size: 0.88rem;
}
.nav-links .notif-menu-footer a:hover {
  color: #3651d4;
  text-decoration: underline;
}

.notif-menu-header form,
.notif-item-form {
  margin: 0;
}

.notif-link-button {
  padding: 0;
  background: none;
  border: none;
  color: #4361ee;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.notif-link-button:hover {
  text-decoration: underline;
}

.notif-list {
  max-height: 420px;
  overflow-y: auto;
}
.notif-list-page {
  max-height: none;
  padding: 0;
  overflow: hidden;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #fff;
  border: none;
  border-bottom: 1px solid #f1f1f1;
  font-family: inherit;
  text-align: left;
  color: #555;
  cursor: pointer;
}
.notif-item-form:last-child .notif-item {
  border-bottom: none;
}
.notif-item:hover {
  background: #f6f7fb;
}
.notif-item:focus-visible {
  outline: 2px solid #4361ee;
  outline-offset: -2px;
}
.notif-item.is-unread {
  background: #f3f5ff;
  color: #1a1a2e;
}
.notif-item.is-unread:hover {
  background: #e9edff;
}

.notif-dot {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.4rem;
  border-radius: 50%;
}
.notif-item.is-unread .notif-dot {
  background: #4361ee;
}

.notif-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.notif-message {
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.notif-item.is-unread .notif-message {
  font-weight: 600;
}
.notif-time {
  font-size: 0.78rem;
  color: #888;
}

@media (max-width: 640px) {
  .notif-panel {
    position: fixed;
    top: 3.75rem;
    left: 1rem;
    right: 1rem;
    width: auto;
  }
}

/* --- Private docs pages (DRC-46) ---------------------------------------- */

/* "Log in to read" beside a private page's link, for visitors only. */
.docs-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.25rem;
  color: #6b6b80;
  font-size: 0.8rem;
  font-weight: 600;
}
.docs-lock-icon {
  flex-shrink: 0;
}
/* In the docs sidebars: on its own small line under the page title. */
.docs-lock--compact {
  display: flex;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  font-weight: 500;
}

/* The page logging in will open, on the log in and sign up forms. */
.auth-destination {
  margin: -0.25rem 0 1rem;
  color: #555;
  font-size: 0.9rem;
}

/* The guide a support ticket was opened from. */
.support-from-guide {
  margin: -0.25rem 0 1rem;
  color: #555;
}

/* --- Two-factor authentication ------------------------------------------- */

.two-factor-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.25rem;
  letter-spacing: 0.15em;
  text-align: center;
}

.two-factor-setup {
  max-width: 520px;
}
.two-factor-steps {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: #333;
  line-height: 1.5;
}
.two-factor-steps li {
  margin-bottom: 1.25rem;
}
.two-factor-steps form {
  margin-top: 0.75rem;
}
.two-factor-qr {
  display: flex;
  justify-content: center;
  margin: 1rem 0 0.5rem;
}
.two-factor-qr svg {
  width: 200px;
  height: 200px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}
.two-factor-secret {
  display: inline-block;
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  word-break: break-all;
  background: #f0f0f5;
  border-radius: 4px;
}
.two-factor-help {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #555;
}
.two-factor-help summary {
  cursor: pointer;
  color: #4361ee;
}
.two-factor-recovery-codes {
  display: block;
  columns: 2;
  font-size: 1rem;
  line-height: 1.8;
}

.two-factor-account-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}
.two-factor-account-form label {
  flex-basis: 100%;
  color: #555;
}
.two-factor-account-form input[type="text"] {
  width: 9rem;
}
/* The Copy button is styled for dark code blocks; the codes sit on a light one. */
.two-factor-setup .code-copy-btn {
  color: #4361ee;
  background: #fff;
  border-color: #c3c3ff;
}
