:root {
  --sema-background: #f6f4f4;
  --sema-surface: #ffffff;
  --sema-text: #2b2e31;
  --sema-primary: #4e66eb;
  --sema-primary-soft: #e9ecfb;
  --sema-accent: #32d04c;
  --sema-success: #32d04c;
  --sema-border: #d8def4;
  --sema-sidebar-text: #ffffff;
  --sema-shadow: 0 10px 24px rgba(78, 102, 235, 0.08);
  --sema-radius: 10px;
}

html,
body {
  background: var(--sema-background);
  color: var(--sema-text);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

* {
  box-sizing: border-box;
}

.wy-nav-side {
  background: linear-gradient(180deg, #4e66eb 0%, #17245b 100%);
  box-shadow: 3px 0 18px rgba(78, 102, 235, 0.18);
}

.wy-side-nav-search {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.wy-side-nav-search > a,
.wy-side-nav-search .wy-dropdown > a {
  color: var(--sema-sidebar-text);
  font-weight: 700;
}

.wy-side-nav-search input[type="text"] {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.wy-side-nav-search input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.wy-menu-vertical p.caption {
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.wy-menu-vertical a {
  color: rgba(255, 255, 255, 0.92);
  border-left: 3px solid transparent;
}

.wy-menu-vertical a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: var(--sema-accent);
  color: #ffffff;
}

.wy-menu-vertical li.current > a,
.wy-menu-vertical li.toctree-l1.current > a {
  background: rgba(255, 255, 255, 0.14);
  border-left-color: var(--sema-accent);
  color: #ffffff;
}

.wy-nav-content-wrap {
  background: radial-gradient(circle at top right, rgba(241, 136, 5, 0.08), transparent 22%),
    radial-gradient(circle at top left, rgba(78, 102, 235, 0.08), transparent 28%),
    var(--sema-background);
}

.wy-nav-content {
  max-width: 980px;
  margin-top: 24px;
  margin-bottom: 32px;
  background: var(--sema-surface);
  border-radius: var(--sema-radius);
  box-shadow: var(--sema-shadow);
}

.wy-nav-top {
  background: #4e66eb;
}

.rst-content h1,
.rst-content h2,
.rst-content h3,
.rst-content h4 {
  color: var(--sema-text);
}

.rst-content h1 {
  border-bottom: 2px solid var(--sema-border);
  padding-bottom: 0.6rem;
}

.rst-content h1::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin-top: 0.75rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sema-primary), var(--sema-accent));
}

.rst-content h2 {
  margin-top: 2rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--sema-primary-soft);
}

.rst-content a {
  color: var(--sema-primary);
}

.rst-content a:hover {
  color: #3148c9;
}

.rst-content p,
.rst-content li {
  color: var(--sema-text);
}

.rst-content code.literal,
.rst-content tt.literal {
  color: #3148c9;
  background: #eef1ff;
  border: 1px solid #d8def4;
}

.rst-content .note,
.rst-content .tip,
.rst-content .important {
  border-radius: var(--sema-radius);
  box-shadow: none;
}

.rst-content .note {
  background: #eef1ff;
}

.rst-content .tip {
  background: #f6fff9;
}

.rst-content .important {
  background: #fff7eb;
}

.rst-content .figure,
.rst-content .figure.align-center {
  background: #fbfcff;
  border: 1px solid var(--sema-border);
  border-radius: var(--sema-radius);
  padding: 1rem;
  margin: 1.4rem 0 2rem;
}

.rst-content .caption-text {
  color: #4a5e72;
  font-style: italic;
}

.rst-content div[class^="highlight"],
.rst-content pre.literal-block {
  border-radius: var(--sema-radius);
}

.wy-breadcrumbs-aside,
.wy-breadcrumbs-aside a,
a[href$="_sources"],
a[href*="_sources"] {
  display: none !important;
}

.rst-content table.docutils,
.rst-content table.field-list {
  border-radius: var(--sema-radius);
  overflow: hidden;
  border: 1px solid var(--sema-border);
}

.rst-content table.docutils thead th {
  background: var(--sema-primary-soft);
}

.rst-content table.docutils td,
.rst-content table.docutils th {
  border-color: var(--sema-border);
}

.rst-content .contents.local {
  background: #fbfcff;
  border: 1px solid var(--sema-border);
  border-radius: var(--sema-radius);
  padding: 1rem 1.2rem;
  margin: 1.2rem 0 2rem;
}

.rst-content .contents.local .topic-title {
  color: var(--sema-primary);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.rst-content .contents.local ul {
  margin-bottom: 0;
}

.doc-home-hero {
  background: linear-gradient(135deg, #17245b 0%, #4e66eb 64%, #32d04c 100%);
  border-radius: 14px;
  padding: 1.5rem 1.6rem;
  margin: 0 0 1.75rem;
  box-shadow: 0 14px 32px rgba(78, 102, 235, 0.16);
}

.doc-home-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.doc-home-lead {
  color: rgba(255, 255, 255, 0.92) !important;
  font-size: 1rem;
  line-height: 1.75;
  margin: 1rem 0 0;
  max-width: 720px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.8rem 0;
}

.home-card {
  background: #ffffff;
  border: 1px solid var(--sema-border);
  border-radius: 14px;
  padding: 1.1rem 1.1rem 1rem;
  box-shadow: 0 8px 20px rgba(78, 102, 235, 0.06);
}

.home-card h2,
.home-card h3 {
  font-size: 1.08rem;
  margin-top: 0;
}

.home-card h2::before,
.home-card h3::before {
  display: none;
}

.home-card h2::after,
.home-card h3::after {
  display: none;
}

.home-card ul {
  padding-left: 1.2rem;
}

.home-card p:last-child,
.home-card ul:last-child {
  margin-bottom: 0;
}

.rst-footer-buttons .btn-neutral {
  background: #ffffff !important;
  color: var(--sema-primary) !important;
  border: 1px solid var(--sema-border) !important;
  border-radius: 999px !important;
}

.rst-footer-buttons .btn-neutral:hover {
  background: var(--sema-primary) !important;
  color: #ffffff !important;
  border-color: var(--sema-primary) !important;
}

footer {
  color: #5b6470;
}

@media screen and (max-width: 768px) {
  .wy-nav-content {
    margin: 0;
    border-radius: 0;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================
   Pointage-style sidebar for Sema Core / Sema Universe docs
   ============================================================= */

:root {
  --sema-sidebar-bg: #0f2d57;
  --sema-sidebar-bg-2: #123864;
  --sema-sidebar-active: rgba(78, 102, 235, 0.28);
  --sema-sidebar-muted: #7890ad;
  --sema-sidebar-border: rgba(255, 255, 255, 0.08);
}

.wy-nav-side {
  width: 280px;
  background: var(--sema-sidebar-bg) !important;
  box-shadow: none;
  border-right: none;
}

.wy-nav-content-wrap {
  margin-left: 280px;
}

.wy-side-scroll {
  width: 280px;
}

.wy-side-nav-search {
  background: var(--sema-sidebar-bg) !important;
  text-align: left;
  padding: 20px 12px 16px;
  border-bottom: 1px solid var(--sema-sidebar-border);
}

.wy-side-nav-search > a {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 0;
  margin: 0 0 16px;
  color: #ffffff !important;
  font-size: 0;
  text-decoration: none;
}

.wy-side-nav-search > a:hover {
  background: transparent;
  text-decoration: none;
}

.wy-side-nav-search > a img.logo,
.wy-side-nav-search img.logo {
  display: block !important;
  width: 182px !important;
  max-width: 182px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

.wy-side-nav-search input[type="text"] {
  width: 100%;
  height: 34px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #e7eef8;
  font-size: 12px;
  padding: 8px 10px;
  box-shadow: none;
}

.wy-side-nav-search input[type="text"]:focus {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  outline: none;
}

.wy-side-nav-search input[type="text"]::placeholder {
  color: rgba(231, 238, 248, 0.48);
}

.wy-menu-vertical {
  padding: 12px 0 24px;
}

.wy-menu-vertical p.caption {
  color: var(--sema-sidebar-muted);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 13px 12px 6px;
  margin: 0;
}

.wy-menu-vertical ul {
  margin: 0;
}

.wy-menu-vertical li.toctree-l1,
.wy-menu-vertical li.toctree-l2,
.wy-menu-vertical li.toctree-l3 {
  margin: 0;
}

.wy-menu-vertical a {
  min-height: 24px;
  padding: 5px 12px;
  color: rgba(231, 238, 248, 0.86) !important;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 500;
  border-left: 0;
  background: transparent;
  transition: background 0.14s ease, color 0.14s ease;
}

.wy-menu-vertical li.toctree-l2 > a {
  padding-left: 22px;
  font-size: 11.5px;
}

.wy-menu-vertical li.toctree-l3 > a {
  padding-left: 34px;
  font-size: 11.5px;
}

.wy-menu-vertical a::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border: 1.5px solid rgba(126, 154, 190, 0.8);
  border-radius: 2px;
  vertical-align: -1px;
}

.wy-menu-vertical li.toctree-l1 > a::before {
  border-radius: 50%;
}

.wy-menu-vertical a:hover {
  background: rgba(255, 255, 255, 0.055) !important;
  color: #ffffff !important;
  text-decoration: none;
}

.wy-menu-vertical li.current > a,
.wy-menu-vertical li.on a,
.wy-menu-vertical li.toctree-l1.current > a,
.wy-menu-vertical li.toctree-l2.current > a {
  background: var(--sema-sidebar-active) !important;
  color: #ffffff !important;
  border: 0;
  font-weight: 700;
}

.wy-menu-vertical li.current,
.wy-menu-vertical li.current > ul,
.wy-menu-vertical li.current ul,
.wy-menu-vertical li.current ul li,
.wy-menu-vertical li.current ul li a {
  background: transparent !important;
}

.wy-menu-vertical li.current ul li a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a,
.wy-menu-vertical li.toctree-l1.current li.toctree-l2 > a {
  color: rgba(231, 238, 248, 0.78) !important;
  border: 0 !important;
}

.wy-menu-vertical li.current ul li a:hover {
  background: rgba(255, 255, 255, 0.055) !important;
  color: #ffffff !important;
}

.wy-menu-vertical li.current ul li.current > a,
.wy-menu-vertical li.toctree-l2.current > a {
  background: var(--sema-sidebar-active) !important;
  color: #ffffff !important;
}

.wy-menu-vertical li.current > a::before,
.wy-menu-vertical li.on a::before {
  border-color: #32d04c;
  background: rgba(50, 208, 76, 0.18);
}

.wy-menu-vertical li button.toctree-expand {
  color: rgba(231, 238, 248, 0.65) !important;
}

.wy-nav-top {
  background: var(--sema-sidebar-bg) !important;
  color: #ffffff !important;
  height: 52px;
  line-height: 52px;
  padding: 0 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.wy-nav-top a {
  color: #ffffff !important;
  font-size: 0;
}

.wy-nav-top a::after {
  content: "Sema Core";
  font-size: 14px;
  font-weight: 700;
}

.wy-nav-top i {
  color: rgba(255, 255, 255, 0.8);
}

@media screen and (max-width: 768px) {
  .wy-nav-side {
    display: block !important;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 280px !important;
    height: 100vh;
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.28);
  }

  .wy-nav-side.shift {
    transform: translateX(0);
  }

  .wy-side-scroll {
    width: 280px;
  }

  .wy-nav-content-wrap {
    margin-left: 0;
    transition: transform 0.25s ease, opacity 0.25s ease, filter 0.25s ease;
  }

  .wy-nav-content-wrap.shift {
    transform: translateX(280px);
    opacity: 0.5;
    filter: grayscale(20%);
    pointer-events: none;
  }

  .wy-nav-content {
    margin: 0;
    border-radius: 0;
    min-height: calc(100vh - 52px);
  }

  .wy-side-nav-search {
    padding-top: 18px;
  }

  .wy-side-nav-search > a img.logo,
  .wy-side-nav-search img.logo {
    width: 174px !important;
    max-width: 174px !important;
  }

  .wy-menu-vertical a {
    font-size: 11.5px;
    padding-top: 5px;
    padding-bottom: 5px;
  }
}
