:root {
  --pvw-primary: #0f9488;
  --pvw-primary-dark: #064e48;
  --pvw-primary-light: #a7f3d0;
  --pvw-accent: #f59e0b;
  --pvw-accent-light: #fef3c7;
  --pvw-surface-light: #f8fafc;
  --pvw-border: rgba(15, 148, 136, 0.15);
  --pvw-shadow-sm: 0 1px 2px rgba(15, 148, 136, 0.05);
  --pvw-shadow: 0 10px 25px rgba(15, 148, 136, 0.12);
  --pvw-shadow-lg: 0 20px 40px rgba(15, 148, 136, 0.16);
}

/* Typography */
.md-typeset h1,
.md-typeset h2 {
  color: var(--pvw-primary-dark);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.md-typeset h3,
.md-typeset h4 {
  color: var(--pvw-primary);
  font-weight: 700;
}

.md-typeset p {
  line-height: 1.7;
}

/* Buttons */
.md-typeset .md-button {
  border-radius: 0.75rem;
  font-weight: 600;
  text-transform: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0.3rem 0.5rem 0.5rem 0;
  border: 2px solid transparent;
}

.md-typeset .md-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--pvw-shadow);
}

.md-typeset .md-button--primary {
  background: linear-gradient(135deg, var(--pvw-accent), #fbbf24);
  border-color: var(--pvw-accent);
  color: #1f2937;
  font-weight: 700;
}

.md-typeset .md-button--primary:hover {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.md-typeset .md-button {
  border-color: var(--pvw-primary);
  color: var(--pvw-primary);
  background-color: transparent;
}

.md-typeset .md-button:hover {
  background-color: var(--pvw-primary-light);
  border-color: var(--pvw-primary);
}

/* Grid cards */
.md-typeset .grid.cards {
  gap: 1.25rem;
}

.md-typeset .grid.cards > ol > li,
.md-typeset .grid.cards > ul > li {
  background: linear-gradient(180deg, #ffffff 0%, var(--pvw-surface-light) 100%);
  border: 2px solid var(--pvw-border);
  border-radius: 1rem;
  box-shadow: var(--pvw-shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1.5rem;
}

.md-typeset .grid.cards > ol > li:hover,
.md-typeset .grid.cards > ul > li:hover {
  border-color: var(--pvw-primary);
  background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
  box-shadow: var(--pvw-shadow-lg);
  transform: translateY(-4px);
}

.md-typeset .grid.cards strong {
  color: var(--pvw-primary-dark);
  font-size: 1.05rem;
  display: block;
  margin-bottom: 0.5rem;
}

.md-typeset .grid.cards a {
  text-decoration: none;
}

.md-typeset .grid.cards a:hover strong {
  color: var(--pvw-accent);
}

/* Tables */
.md-typeset table:not([class]) {
  border: 2px solid var(--pvw-border);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--pvw-shadow-sm);
}

.md-typeset table:not([class]) thead {
  background: linear-gradient(135deg, #f0fdf4 0%, var(--pvw-surface-light) 100%);
  border-bottom: 2px solid var(--pvw-border);
}

.md-typeset table:not([class]) th {
  color: var(--pvw-primary-dark);
  font-weight: 700;
  padding: 1rem;
  text-align: left;
}

.md-typeset table:not([class]) td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--pvw-border);
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: var(--pvw-accent-light);
}

.md-typeset table:not([class]) tbody tr:last-child td {
  border-bottom: none;
}

/* Admonitions */
.md-typeset .admonition {
  border: 2px solid var(--pvw-border);
  border-radius: 0.75rem;
  background-color: var(--pvw-surface-light);
  box-shadow: var(--pvw-shadow-sm);
  padding: 1rem 1.25rem;
}

.md-typeset .admonition.tip {
  border-left: 4px solid var(--pvw-primary);
  border-color: var(--pvw-primary);
}

.md-typeset .admonition.warning {
  border-left: 4px solid var(--pvw-accent);
  border-color: var(--pvw-accent);
}

.md-typeset .admonition.info {
  border-left: 4px solid var(--pvw-primary);
  border-color: var(--pvw-primary);
}

.md-typeset .admonition.note {
  border-left: 4px solid var(--pvw-primary);
  border-color: var(--pvw-primary);
}

.md-typeset .admonition > .admonition-title {
  color: var(--pvw-primary-dark);
  font-weight: 700;
  text-transform: capitalize;
}

/* Code blocks */
.md-typeset code {
  background-color: #f3f4f6;
  color: #111827;
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

.md-typeset pre {
  background: linear-gradient(180deg, #111111 0%, #050505 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.9rem;
  box-shadow: 0 18px 35px rgba(2, 6, 23, 0.24);
  overflow: auto;
  padding: 1rem 1.1rem;
  position: relative;
}

.md-typeset pre code {
  background-color: transparent;
  color: #f8fafc;
  padding: 0;
  font-weight: 500;
}

.md-typeset .highlight {
  position: relative;
  margin: 1.25rem 0 1.5rem;
  overflow: visible;
}

.md-typeset .highlight pre {
  padding-top: 2.35rem;
  padding-right: 4.75rem;
}

.md-typeset .highlight::before {
  content: "";
  position: absolute;
  top: 0.9rem;
  left: 1rem;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: #fb7185;
  box-shadow: 1.1rem 0 0 #f59e0b, 2.2rem 0 0 #10b981;
  z-index: 2;
}

.md-typeset .highlight::after {
  content: "code";
  position: absolute;
  top: 0.62rem;
  right: 4.4rem;
  padding: 0.22rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 2;
}

.md-typeset .highlight pre::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #f8fafc 0%, #94a3b8 40%, var(--pvw-accent) 100%);
}

.md-typeset .highlight,
.md-typeset .highlighttable {
  background: transparent;
  border-radius: 0.9rem;
}

.md-typeset .highlight pre,
.md-typeset .highlighttable td.code,
.md-typeset .highlighttable td.linenos {
  background: linear-gradient(180deg, #111111 0%, #050505 100%);
}

.md-typeset .highlighttable td.linenos {
  color: #64748b;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding-right: 0.9rem;
}

.md-typeset .highlighttable {
  overflow-x: auto;
}

/* PVW CLI badge: any bash block whose first non-whitespace token is "pvw" */
.md-typeset .highlight.language-bash::after,
.md-typeset .highlight.language-sh::after,
.md-typeset .highlight.language-shell::after,
.md-typeset .highlight.language-console::after,
.md-typeset .highlight.language-powershell::after,
.md-typeset .highlight.language-ps1::after {
  content: "shell";
  color: #fde68a;
}

/* Override: blocks that start with "pvw" get a dedicated CLI badge */
.md-typeset .highlight.language-bash[data-pvw]::after,
.md-typeset .highlight.language-bash:has(code[class*="language-bash"] .n:first-child)::after {
  content: "pvw cli";
  color: #a7f3d0;
  border-color: rgba(15, 148, 136, 0.4);
}

/* Global PVW CLI badge class — apply with { .pvw-cli } attribute on fences */
.md-typeset .highlight.pvw-cli::after {
  content: "pvw cli";
  color: #a7f3d0;
  border-color: rgba(15, 148, 136, 0.4);
}

.md-typeset .highlight.pvw-cli pre {
  border-color: rgba(15, 148, 136, 0.35);
  box-shadow: 0 18px 35px rgba(15, 148, 136, 0.1);
}

.md-typeset .highlight.language-python::after,
.md-typeset .highlight.language-py::after {
  content: "python";
  color: #93c5fd;
}

.md-typeset .highlight.language-json::after {
  content: "json";
  color: #c4b5fd;
}

.md-typeset .highlight.language-bash pre,
.md-typeset .highlight.language-sh pre,
.md-typeset .highlight.language-shell pre,
.md-typeset .highlight.language-console pre,
.md-typeset .highlight.language-powershell pre,
.md-typeset .highlight.language-ps1 pre {
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow: 0 18px 35px rgba(245, 158, 11, 0.08);
}

.md-typeset .highlight.language-python pre,
.md-typeset .highlight.language-py pre {
  border-color: rgba(59, 130, 246, 0.28);
  box-shadow: 0 18px 35px rgba(59, 130, 246, 0.08);
}

.md-typeset .highlight.language-json pre {
  border-color: rgba(139, 92, 246, 0.24);
  box-shadow: 0 18px 35px rgba(139, 92, 246, 0.08);
}

.md-typeset .highlight .hll {
  background-color: rgba(245, 158, 11, 0.16);
}

.md-typeset .highlight .c,
.md-typeset .highlight .c1,
.md-typeset .highlight .cm {
  color: #94a3b8;
}

.md-typeset .highlight .k,
.md-typeset .highlight .kd,
.md-typeset .highlight .kn,
.md-typeset .highlight .kr,
.md-typeset .highlight .ow {
  color: #f59e0b;
}

.md-typeset .highlight .nb,
.md-typeset .highlight .nf,
.md-typeset .highlight .nc,
.md-typeset .highlight .ne {
  color: #67e8f9;
}

.md-typeset .highlight .s,
.md-typeset .highlight .sa,
.md-typeset .highlight .sb,
.md-typeset .highlight .sc,
.md-typeset .highlight .s2 {
  color: #86efac;
}

.md-typeset .highlight .m,
.md-typeset .highlight .mi,
.md-typeset .highlight .mf {
  color: #fda4af;
}

.md-typeset .highlight .o,
.md-typeset .highlight .p {
  color: #e2e8f0;
}

.md-typeset .highlight .n,
.md-typeset .highlight .nv,
.md-typeset .highlight .w {
  color: #f8fafc;
}

.md-typeset .md-clipboard {
  position: absolute;
  top: 0.68rem;
  right: 0.9rem;
  color: #e2e8f0;
  opacity: 0.75;
  z-index: 3;
}

.md-typeset .md-clipboard:hover {
  color: #ffffff;
  opacity: 1;
}

.md-typeset .md-clipboard svg,
.md-typeset .md-clipboard .md-icon {
  fill: currentColor;
  color: inherit;
}

.md-typeset .tabbed-set {
  margin: 1.5rem 0 2rem;
}

.md-typeset .tabbed-labels {
  gap: 0.45rem;
}

.md-typeset .tabbed-labels > label {
  border-radius: 999px;
  border: 1px solid var(--pvw-border);
  background: #ffffff;
  color: #475569;
  font-weight: 700;
  padding: 0.55rem 0.95rem;
  transition: all 0.2s ease;
}

.md-typeset .tabbed-labels > label:hover,
.md-typeset .tabbed-content > .tabbed-block:has(.highlight) {
  box-shadow: var(--pvw-shadow-sm);
}

.md-typeset .tabbed-labels > input:checked + label,
.md-typeset .tabbed-labels > label[for]:hover {
  border-color: var(--pvw-primary);
  color: var(--pvw-primary-dark);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* Links */
.md-typeset a {
  color: var(--pvw-primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--pvw-primary-light);
  text-underline-offset: 0.3em;
  transition: all 0.2s ease;
}

.md-typeset a:hover {
  color: var(--pvw-accent);
  text-decoration-color: var(--pvw-accent);
}

/* Navigation — tighter, clearer hierarchy */
.md-nav {
  font-size: 0.78rem;
}

.md-nav__title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.75rem 0.75rem 0.3rem;
}

.md-nav__link {
  border-radius: 0.45rem;
  padding: 0.38rem 0.75rem;
  transition: all 0.18s ease;
  color: #475569;
  font-weight: 500;
}

.md-nav__link:hover {
  background: linear-gradient(90deg, rgba(15, 148, 136, 0.07) 0%, transparent 100%);
  color: var(--pvw-primary);
  padding-left: 1rem;
}

.md-nav__link--active {
  color: var(--pvw-primary-dark);
  font-weight: 700;
  background: linear-gradient(90deg, rgba(15, 148, 136, 0.12) 0%, transparent 100%);
  border-left: 3px solid var(--pvw-primary);
  padding-left: calc(0.75rem - 3px);
}

/* Section labels in sidebar nav */
.md-nav__item--section > .md-nav__link {
  font-weight: 700;
  font-size: 0.8rem;
  color: #1e293b;
  letter-spacing: -0.01em;
}

.md-nav--secondary .md-nav__link {
  font-size: 0.76rem;
  color: #64748b;
}

.md-nav--secondary .md-nav__link--active {
  color: var(--pvw-primary);
  background: none;
  border-left: 2px solid var(--pvw-primary-light);
}

/* Search */
.md-search__input {
  background-color: var(--pvw-surface-light);
  border: 2px solid var(--pvw-border);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.md-search__input:focus {
  border-color: var(--pvw-primary);
  box-shadow: 0 0 0 3px rgba(15, 148, 136, 0.1);
}

/* Sidebar */
.md-sidebar {
  background-color: #fafbfc;
  border-right: 1px solid var(--pvw-border);
}

/* Content area — editorial layout */
.md-main {
  background-color: #ffffff;
}

.md-content {
  padding: 2rem 2.5rem;
}

/* Lead paragraph: first <p> after h1 gets larger editorial treatment */
.md-typeset h1 + p,
.md-typeset h1 + p > em:only-child {
  font-size: 1.07rem;
  color: #475569;
  line-height: 1.75;
  max-width: 68ch;
}

/* Section dividers between h2 blocks */
.md-typeset h2 {
  border-top: 1px solid var(--pvw-border);
  padding-top: 1.5rem;
  margin-top: 2.5rem;
}

/* Keep very first h2 unbordered (flows from h1 naturally) */
.md-typeset h1 ~ h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 1.5rem;
}

/* Tight list spacing inside guides */
.md-typeset ul li,
.md-typeset ol li {
  margin-bottom: 0.35rem;
}

/* Horizontal rule as a clear visual break */
.md-typeset hr {
  border: none;
  border-top: 2px solid var(--pvw-border);
  margin: 2.5rem 0;
}

/* Responsive: collapse extra padding on narrower viewports */
@media screen and (max-width: 76.1875em) {
  .md-content {
    padding: 1.25rem 1.5rem;
  }
}

@media screen and (max-width: 44.9375em) {
  .md-content {
    padding: 1rem;
  }

  .md-typeset h2 {
    padding-top: 1rem;
    margin-top: 1.75rem;
  }
}

/* Section introduction */
.md-typeset .section-intro {
  color: #64748b;
  font-size: 1.025rem;
  line-height: 1.7;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

/* Task guide badges */
.md-typeset .task-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--pvw-primary-light), #d1fae5);
  color: var(--pvw-primary-dark);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Responsive */
@media screen and (max-width: 76.1875em) {
  .md-typeset {
    font-size: 0.9rem;
  }

  .md-typeset h1 {
    font-size: 1.75rem;
  }

  .md-content {
    padding: 1.5rem;
  }
}

@media screen and (max-width: 44.9375em) {
  .md-typeset h1 {
    font-size: 1.5rem;
  }

  .md-content {
    padding: 1rem;
  }

  .md-typeset .grid.cards {
    gap: 1rem;
  }

  .md-typeset .md-button {
    margin-right: 0;
    display: block;
    text-align: center;
    margin-bottom: 0.5rem;
  }
}

/* Print styles */
@media print {
  .md-header,
  .md-sidebar,
  .md-footer {
    display: none;
  }

  .md-typeset a {
    text-decoration: none;
  }
}
