/* =========================================================
   MedPlus API Docs — theme (loaded after vue.css so it wins)
   Compact, calm, Mintlify-style scale. One accent, used sparingly.
   ========================================================= */

:root {
  --accent: #157f4f;
  --accent-hover: #0f603b;

  --bg: #ffffff;
  --bg-subtle: #f6f7f8;
  --sidebar-bg: #fcfcfd;

  --text: #3c444d;
  --text-muted: #6b737c;
  --heading: #0f1419;
  --border: #e9ebee;

  --code-bg: #f4f5f6;
  --pre-bg: #0f1216;
  --pre-text: #e6edf3;
  --pre-border: rgba(255, 255, 255, .07);

  --radius: 8px;
  --content-max: 780px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --accent: #4cbb86;
    --accent-hover: #6fd0a1;
    --bg: #0b0d10;
    --bg-subtle: #15181d;
    --sidebar-bg: #0b0d10;
    --text: #b6bec7;
    --text-muted: #7c858e;
    --heading: #f2f4f7;
    --border: #1d222a;
    --code-bg: #15181d;
    --pre-bg: #111419;
    --pre-text: #e6edf3;
    --pre-border: rgba(255, 255, 255, .06);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #4cbb86;
  --accent-hover: #6fd0a1;
  --bg: #0b0d10;
  --bg-subtle: #15181d;
  --sidebar-bg: #0b0d10;
  --text: #b6bec7;
  --text-muted: #7c858e;
  --heading: #f2f4f7;
  --border: #1d222a;
  --code-bg: #15181d;
  --pre-bg: #111419;
  --pre-text: #e6edf3;
  --pre-border: rgba(255, 255, 255, .06);
}

/* ---------- base ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding-top: 8px;
}

.sidebar .app-name {
  margin: 16px 0 4px;
  padding: 0 20px;
  text-align: left;
}

.app-name-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--heading);
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -.01em;
  text-decoration: none;
}

.app-name-link:hover {
  color: var(--heading);
  text-decoration: none;
}

.app-name-link .app-logo {
  height: 26px;
  width: auto;
  display: block;
}

.sidebar-nav {
  padding: 6px 12px 40px;
}

.sidebar-nav>ul>li>strong,
.sidebar-nav>ul>li>p {
  display: block;
  margin: 18px 0 4px;
  padding: 0 10px;
  color: var(--heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.sidebar-nav ul li a {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 6px;
  border-left: none;
  transition: color .12s ease, background .12s ease;
}

.sidebar-nav ul li a:hover {
  color: var(--heading);
  text-decoration: none;
}

.sidebar-nav li.active>a,
.sidebar-nav ul li a.active,
.sidebar ul li.active>a {
  color: var(--accent);
  background: var(--bg-subtle);
  font-weight: 600;
  border-right: 0;
}

.sidebar-nav ul li ul {
  margin-left: 3px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

/* ---------- content ---------- */
.content {
  background: var(--bg);
}

.markdown-section {
  max-width: var(--content-max);
  padding: 28px 26px 90px;
}

.markdown-section p,
.markdown-section li {
  color: var(--text);
  line-height: 1.62;
  font-size: 15px;
}

.markdown-section p {
  margin: 0 0 1em;
}

.markdown-section ul,
.markdown-section ol {
  margin: 0 0 1em;
}

.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4 {
  color: var(--heading);
  font-weight: 680;
  letter-spacing: -.015em;
}

.markdown-section h1 {
  font-size: 1.72rem;
  margin: .1em 0 .5em;
}

.markdown-section h2 {
  font-size: 1.28rem;
  margin-top: 2.1em;
  padding-bottom: 0;
  border-bottom: none;
}

.markdown-section h3 {
  font-size: 1.05rem;
  margin-top: 1.7em;
}

.markdown-section a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.markdown-section a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.markdown-section hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.6em 0;
}

/* ---------- inline code ---------- */
.markdown-section code {
  background: var(--code-bg);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82em;
  padding: .12em .38em;
  border-radius: 5px;
  border: 1px solid var(--border);
}

/* ---------- code blocks ---------- */
.markdown-section pre {
  background: var(--pre-bg);
  border: 1px solid var(--pre-border);
  border-radius: var(--radius);
  padding: 0;
  margin: 1.3em 0;
}

.markdown-section pre>code {
  background: transparent;
  color: var(--pre-text);
  border: none;
  font-size: 13px;
  line-height: 1.65;
  padding: 15px 16px;
  display: block;
}

.markdown-section pre::after {
  display: none;
}

.docsify-copy-code-button {
  background: rgba(255, 255, 255, .07) !important;
  color: #b9c2cc !important;
  font-size: 11.5px !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
  font-family: 'Inter', sans-serif !important;
  opacity: 0;
  transition: opacity .15s ease;
}

.markdown-section pre:hover .docsify-copy-code-button {
  opacity: 1;
}

.docsify-copy-code-button:hover {
  color: #fff !important;
}

/* ---------- tables ---------- */
.markdown-section table {
  display: table;
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 14px;
}

.markdown-section th {
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-align: left;
  padding: 8px 13px;
  border: none;
  border-bottom: 1.5px solid var(--border);
}

.markdown-section td {
  padding: 9px 13px;
  border: none;
  border-bottom: 1px solid var(--border);
}

.markdown-section tr:nth-child(2n) {
  background: transparent;
}

/* ---------- blockquote ---------- */
.markdown-section blockquote {
  background: var(--bg-subtle);
  border-left: 3px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  padding: 2px 18px;
  margin: 1.4em 0;
  font-size: 14.5px;
}

.markdown-section blockquote p {
  color: var(--text-muted);
}

/* ---------- HTTP method chips (added by plugin, in tables) ---------- */
.http-method {
  border: 1px solid transparent !important;
  font-weight: 600 !important;
  font-size: 10.5px !important;
  letter-spacing: .03em;
  padding: 2px 7px !important;
  border-radius: 5px !important;
}

.m-get {
  color: #1a7a4d !important;
  background: #eef6f1 !important;
}

.m-post {
  color: #2857c4 !important;
  background: #eef2fc !important;
}

.m-put {
  color: #9a5b13 !important;
  background: #f8f1e6 !important;
}

.m-patch {
  color: #6d3fc0 !important;
  background: #f2eefb !important;
}

.m-delete {
  color: #b3352f !important;
  background: #faecec !important;
}

:root[data-theme="dark"] .m-get,
:root:not([data-theme="light"]) .m-get {
  color: #7fd3a6 !important;
  background: #14251c !important;
}

:root[data-theme="dark"] .m-post,
:root:not([data-theme="light"]) .m-post {
  color: #9db6f2 !important;
  background: #182036 !important;
}

:root[data-theme="dark"] .m-put,
:root:not([data-theme="light"]) .m-put {
  color: #dfae6e !important;
  background: #2c2314 !important;
}

:root[data-theme="dark"] .m-patch,
:root:not([data-theme="light"]) .m-patch {
  color: #bfa2ee !important;
  background: #241d38 !important;
}

:root[data-theme="dark"] .m-delete,
:root:not([data-theme="light"]) .m-delete {
  color: #e79a95 !important;
  background: #301818 !important;
}

/* ---------- search (in sidebar) ---------- */
.sidebar .search {
  margin: 6px 0 4px;
  padding: 0 10px 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar .search input {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13.5px;
  color: var(--text);
}

.sidebar .search input:focus {
  border-color: var(--accent);
  outline: none;
}

.sidebar .search .results-panel {
  color: var(--text);
}

.sidebar .search .matching-post {
  border-bottom: 1px solid var(--border);
}

.sidebar .search p {
  color: var(--text-muted);
  font-size: 13.5px;
}

.sidebar .search .search-keyword {
  color: var(--accent);
  background: transparent;
  font-weight: 600;
}

/* ---------- pagination (GitBook-style cards) ---------- */
.docsify-pagination-container {
  border-top: none;
  margin-top: 3.4em;
  display: flex;
  gap: 14px;
}

.pagination-item {
  flex: 1;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 18px;
  transition: border-color .12s ease, background .12s ease;
}

.pagination-item:hover {
  border-color: var(--accent);
  background: var(--bg-subtle);
  opacity: 1;
}

.pagination-item a {
  display: block;
}

.pagination-item-label {
  color: var(--text-muted) !important;
  font-size: 12px;
  margin-bottom: 3px;
}

.pagination-item-title {
  color: var(--heading) !important;
  font-size: 14px !important;
  font-weight: 600;
}

.pagination-item--next {
  text-align: right;
}

/* ---------- sidebar toggle (docsify's hamburger) ---------- */
.sidebar-toggle {
  top: 14px;
  bottom: auto;
  left: 14px;
  width: auto;
  padding: 6px;
  background: transparent;
  border: none;
  z-index: 65;
}

.sidebar-toggle .sidebar-toggle-button span {
  background-color: var(--text);
  height: 2px;
}

@media (min-width: 769px) {
  .sidebar-toggle {
    display: none;
  }
}

/* ---------- theme toggle ---------- */
#theme-toggle {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 50;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease;
}

#theme-toggle:hover {
  color: var(--heading);
  border-color: var(--text-muted);
}

#theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* ---------- landing cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin: 24px 0 8px;
}

.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  text-decoration: none !important;
  transition: border-color .12s ease, background .12s ease;
}

.card:hover {
  border-color: var(--accent);
  background: var(--bg-subtle);
}

.card h3 {
  margin: 0 0 5px !important;
  color: var(--heading);
  font-size: 15px;
}

.card p {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.card .card-link {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}

/* ---------- scrollbar ---------- */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---------- responsive ---------- */
@media (max-width: 768px) {
  .markdown-section {
    padding: 24px 18px 64px;
  }

  .markdown-section h1 {
    font-size: 1.55rem;
  }

  .docsify-pagination-container {
    flex-direction: column;
  }
}