/* apiwarden shell.

   Chrome for the pages RapiDoc does not render — the landing page and the
   change view. The API pages are RapiDoc itself; see rapidoc-extra.css.

   The palette is the editor's, so the portal reads like the panel it grew out
   of. The same values are passed to RapiDoc as attributes from render.py. */

:root {
  --bg: #ffffff;
  --surface: #f3f3f3;
  --surface-2: #e8e8e8;
  --border: #e0e0e0;
  --text: #1a1d21;
  --muted: #616872;
  --accent: #0066b8;
  --accent-soft: #e5f0fb;
  --get: #0066b8;
  --post: #15803d;
  --patch: #b45309;
  --put: #7c3aed;
  --delete: #c62828;
  --warn-bg: #fff8e6;
  --warn-border: #e6c068;
  --radius: 6px;
  --topbar: 46px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  /* Tahoma and Noto Sans are here for their broad right-to-left coverage. */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Tahoma,
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e1e;
    --surface: #252526;
    --surface-2: #2d2d30;
    --border: #37373d;
    --text: #d4d4d4;
    --muted: #9d9d9d;
    --accent: #4daafc;
    --accent-soft: #04395e;
    --get: #4daafc;
    --post: #4ade80;
    --patch: #e2b93d;
    --put: #c586c0;
    --delete: #f14c4c;
    --warn-bg: #2b2416;
    --warn-border: #6b5420;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.88em; }
h1, h2, h3, h4 { line-height: 1.3; }

/* ---------- portal navigation (top bar here, nav slot inside RapiDoc) ---- */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar);
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.portal-title {
  font-weight: 650;
  font-size: 13.5px;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.portal-title:hover { text-decoration: none; color: var(--accent); }

.portal-switch {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font: inherit;
  font-size: 12.5px;
  max-width: 190px;
}

.topbar-search { position: relative; flex: 1 1 200px; max-width: 380px; }

.portal-search {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 9px;
  font: inherit;
  font-size: 12.5px;
}
.portal-search:focus { outline: 1px solid var(--accent); border-color: transparent; }

.portal-results {
  list-style: none;
  margin: 0;
  padding: 4px;
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 5px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 30;
}
.portal-results:empty { display: none; }
.portal-results li a {
  display: block;
  padding: 5px 8px;
  border-radius: 4px;
  color: var(--text);
  font-size: 12.5px;
}
.portal-results li a:hover { background: var(--surface-2); text-decoration: none; }
.portal-results .sr-path {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  unicode-bidi: normal;
  direction: ltr;
}
.search-empty { padding: 6px 8px; font-size: 12.5px; color: var(--muted); }

/* One Bearer token, set here, applied to every API's Try it panel. */
.portal-auth { position: relative; flex: 1 1 140px; max-width: 200px; }
.portal-token {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 24px 5px 9px;
  font: inherit;
  font-size: 12.5px;
}
.portal-token:focus { outline: 1px solid var(--accent); border-color: transparent; }
.portal-token-clear {
  position: absolute;
  inset-inline-end: 3px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.portal-token-clear:hover { background: var(--surface-2); color: var(--text); }

.topbar-links { display: flex; gap: 4px; margin-inline-start: auto; }
.topbar-links a {
  font-size: 12.5px;
  padding: 4px 9px;
  border-radius: var(--radius);
  color: var(--muted);
}
.topbar-links a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topbar-links a.active { background: var(--accent-soft); color: var(--accent); }

.topbar-rev { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* The same controls, stacked, inside RapiDoc's nav-logo slot. */
.portal-nav { display: flex; flex-direction: column; gap: 7px; position: relative; }
.portal-nav .portal-title { font-size: 13px; }
.portal-nav .portal-switch,
.portal-nav .portal-search { max-width: none; width: 100%; }
.portal-nav .portal-auth { max-width: none; }
.portal-nav .portal-results { inset-inline: 0; top: calc(100% - 26px); }
.portal-nav .portal-links { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-nav .portal-links a { font-size: 11.5px; color: var(--muted); }

/* ---------- pages ---------- */

.main { padding: 26px 30px 60px; max-width: 1020px; }

.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.02em; }
.page-head p { margin: 0; color: var(--muted); }

.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.pill {
  font-size: 11.5px;
  font-family: var(--mono);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}
.pill-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 13px; }
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  background: var(--surface);
  display: block;
  color: var(--text);
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card h3 { margin: 0 0 4px; font-size: 15px; }
.card p { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); unicode-bidi: plaintext; }

.notice {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 11px 14px;
  margin-bottom: 18px;
  font-size: 13.5px;
}

.agent-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--surface);
  margin-top: 24px;
}
.agent-box h2 { margin: 0 0 4px; font-size: 15px; }
.agent-box p { margin: 0 0 11px; color: var(--muted); font-size: 13px; }
.agent-box pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  overflow-x: auto;
  font-size: 12px;
  margin: 0 0 10px;
}
.agent-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.agent-links a {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.ext-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.ext-block > h3 {
  margin: 0;
  padding: 9px 13px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  unicode-bidi: normal;
  direction: ltr;
}
.kv { width: 100%; border-collapse: collapse; }
.kv th, .kv td {
  text-align: start;
  padding: 7px 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 13px;
}
.kv tr:last-child :is(th, td) { border-bottom: none; }
.kv th { font-family: var(--mono); font-weight: 500; color: var(--muted); width: 32%; font-size: 12px; }
.kv td { font-family: var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

.empty { color: var(--muted); font-size: 13.5px; }

@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .topbar-links { margin-inline-start: 0; }
  .main { padding: 18px 16px 44px; }
}

/* ---------- changes ---------- */

.pill-breaking { background: var(--delete); color: var(--bg); border-color: transparent; }
.pill-additive { background: var(--post); color: var(--bg); border-color: transparent; }
.pill-info { background: var(--surface-2); color: var(--muted); }

.since-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 22px; }
.since-form label { font-size: 13px; color: var(--muted); }
.since-form input {
  flex: 1 1 260px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-size: 13px;
}
.since-form button {
  padding: 7px 14px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.since-form button:hover { opacity: 0.9; }

.ext-block.change-breaking > h3 { border-inline-start: 3px solid var(--delete); }
.ext-block.change-additive > h3 { border-inline-start: 3px solid var(--post); }
.ext-block.change-info > h3 { border-inline-start: 3px solid var(--border); }
.change-app { float: inline-end; font-family: var(--sans); font-size: 12px; font-weight: 400; }

.change-table td:first-child { width: 104px; white-space: nowrap; }
.change-table td:nth-child(2) { width: 30%; }
.change-table td { font-family: var(--sans); }

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.tag-breaking { color: var(--delete); }
.tag-additive { color: var(--post); }
.tag-info { color: var(--muted); }
