/*
 * ThrivoSign RSSP Developer Center.
 *
 * Shared ThrivoSign "indigo / violet" application theme (see ssa/web/resources/design/thrivosign-purple.css):
 * brand-navy-to-indigo chrome, lavender canvas, white 14px cards, violet pill buttons. Violet is reserved for
 * actions, the active navigation item and links. Calm and quiet: a reference people read for an hour at a time.
 *
 * Everything wide (tables, JSON, cURL) scrolls inside its own container, so the
 * page body never scrolls sideways at any width.
 */

:root {
  --accent: #5b4ce6;
  --accent-2: #7a3ff0;
  --accent-deep: #3b2fb5;
  --accent-soft: #edeafe;
  --grad: linear-gradient(135deg, #5b4ce6, #7a3ff0);
  --night: #0b2a55;
  --sidebar-bg: linear-gradient(180deg, #0b2a55 0%, #16226a 100%);
  --chrome: radial-gradient(900px 260px at 12% -40%, rgba(122, 63, 240, .45), transparent 70%),
    radial-gradient(700px 240px at 92% 10%, rgba(18, 179, 166, .22), transparent 70%),
    linear-gradient(135deg, #0b2a55 0%, #1b2b86 55%, #3b2fb5 100%);
  --ink: #17143a;
  --ink-soft: #55537a;
  --line: #e3e1f1;
  --line-2: #cfcce6;
  --surface: #ffffff;
  --surface-alt: #f3f2fa;
  --code-bg: #14123d;
  --code-ink: #e9e7fb;
  --green: #146c43;
  --amber: #9a5b00;
  --red: #b3261e;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(23, 20, 58, .05), 0 8px 28px rgba(35, 28, 95, .07);
  --sidebar-width: 286px;
  --topbar-height: 56px;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "Inter", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;

  /* Names the internal test pages (full-lifecycle / embedded / texttag) already use, kept pointing at the new palette. */
  --orange: var(--accent);
  --orange-dark: var(--accent-deep);
  --navy: var(--night);
  --navy-dark: var(--night);
  --navy-soft: #0a7068;
  --border: var(--line);
  --muted: var(--ink-soft);
  --ok: var(--green);
  --warn: var(--amber);
}

* { box-sizing: border-box; }

:focus-visible { outline: 2px solid #7a63ff; outline-offset: 2px; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--surface-alt);
  font-size: 15px;
  line-height: 1.6;
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--chrome);
  color: #fff;
  box-shadow: 0 2px 14px rgba(11, 42, 85, .25);
}

.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-mark { font-weight: 750; letter-spacing: .3px; display: inline-flex; align-items: center; gap: 9px; }
/* PQCTrust mark (the same brand asset as the Credential Services and CA developer portals). */
.brand-logo { width: 22px; height: 22px; flex: 0 0 auto; display: block; align-self: center; }
.brand-title {
  color: #d3d8f3;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.env { color: #d3d8f3; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }

.topbar select {
  background: #1f2a7a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: var(--radius);
  padding: 5px 8px;
  font-size: 13px;
  max-width: 190px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  border-radius: 999px;
  font-size: 17px;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
}

/* ------------------------------------------------------------------ layout */

.layout { display: flex; align-items: flex-start; }

.sidebar {
  position: sticky;
  top: var(--topbar-height);
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  background: var(--sidebar-bg);
  color: #d3d8f3;
  padding-bottom: 32px;
}

.search-wrap { padding: 14px 14px 8px; position: sticky; top: 0; background: #0b2a55; }

.search-wrap input {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 13px;
}

.search-wrap input { border-radius: 999px; padding-left: 14px; }
.search-wrap input:focus { outline: 2px solid #a99bff; outline-offset: 1px; }
.search-wrap input::placeholder { color: #aab3dc; }

.nav { padding: 4px 8px 0; }

.nav-group-title {
  padding: 14px 10px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: #aab3dc;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #d3d8f3;
  text-decoration: none;
  font-size: 13.5px;
}

.nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.nav a.active { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(91, 76, 230, .35); }
.nav .count { margin-left: auto; font-size: 11px; color: #aab3dc; }
.nav a.active .count { color: #e9e5ff; }

.search-results { padding: 4px 8px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.search-results .empty { padding: 10px; color: #aab3dc; font-size: 13px; }

.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 26px 34px 80px;
}

.view { max-width: 940px; }

/* ---------------------------------------------------------------- headings */

h1 { font-size: 25px; margin: 0 0 6px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 30px 0 10px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 14px; margin: 22px 0 8px; text-transform: uppercase; letter-spacing: .6px;
     color: var(--ink-soft); }
p { margin: 0 0 12px; }
.view p a, .view li a:not(.card-link), .view td a, .notice a { color: var(--accent); }
.view p a:hover, .view li a:not(.card-link):hover, .view td a:hover, .notice a:hover { color: var(--accent-deep); }
.lede { color: var(--ink-soft); font-size: 16px; margin-bottom: 18px; }
.muted { color: var(--ink-soft); font-size: 13.5px; }

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card-grid .card { margin: 0; }
.card-grid .card h2 { margin-top: 0; font-size: 15px; }

.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { border-color: var(--accent); }

/* ------------------------------------------------------------------ badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.badge-muted { background: #ecebf7; color: var(--ink-soft); }
.badge-prod { background: #fbe3e1; color: var(--red); }
.badge-ok { background: #dff2e7; color: var(--green); }
.badge-warn { background: #fdefd6; color: var(--amber); }

.method {
  display: inline-block;
  min-width: 54px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
}

.method-GET { background: #1a6fb5; }
.method-POST { background: var(--green); }
.method-PUT { background: var(--amber); }
.method-DELETE { background: var(--red); }
.method-PATCH { background: #6b3fc9; }

/* --------------------------------------------------------------- endpoints */

.endpoint-line {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.endpoint-line code { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }

.op-list { list-style: none; margin: 0; padding: 0; }

.op-list li { border-bottom: 1px solid var(--line); }
.op-list li:last-child { border-bottom: 0; }

.op-list a {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 10px 4px;
  text-decoration: none;
  color: inherit;
}

.op-list a:hover { background: #faf9ff; }
.view .op-list a { color: inherit; }

/* The method badge is a direct <span> child, so the `.op-list a > span` flex:1
   rule below would stretch it to inconsistent widths. Pin it to a fixed column
   so every POST/GET badge is the same size and they align down the left edge. */
.op-list a > .method { flex: 0 0 auto; width: 76px; min-width: 76px; align-self: flex-start; }

/*
  The text column must be allowed to shrink below its content width. Without
  min-width:0 a flex item refuses to, and an unbreakable path such as
  /doc/package/{packageId}/documents/{documentId}/fields/digital_signature
  pushes the whole page sideways on a narrow screen.
*/
.op-list a > span { min-width: 0; flex: 1 1 auto; }
.op-list .op-title { font-weight: 600; }
.op-list .op-summary { color: var(--ink-soft); font-size: 13px; display: block; }

.op-list .op-path {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }

table { border-collapse: collapse; width: 100%; font-size: 13.5px; background: var(--surface); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8f7fd; font-size: 11px; font-weight: 700; text-transform: uppercase;
     letter-spacing: .07em; color: var(--ink-soft); white-space: nowrap; }
tbody tr:hover td { background: #faf9ff; }
tr:last-child td { border-bottom: 0; }
td code { font-family: var(--mono); font-size: 12.5px; }

/* -------------------------------------------------------------------- code */

pre {
  margin: 0 0 14px;
  padding: 14px 16px;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.8px;
  line-height: 1.55;
  white-space: pre;
  tab-size: 2;
}

code { font-family: var(--mono); }
p code, li code, td code { background: #efedfb; padding: 1px 5px; border-radius: 3px; }

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.code-head h3 { margin: 0; }

/* ----------------------------------------------------------------- buttons */

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: filter .15s, box-shadow .15s, background .15s;
}

.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 3px 10px rgba(91, 76, 230, .28); }
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 5px 16px rgba(91, 76, 230, .35); }
.btn-primary:disabled { background: #e3e1f1; color: #6b6a8a; box-shadow: none; filter: none; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--accent-deep); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-small { padding: 3px 12px; font-size: 12px; }
.topbar .btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .32); }
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, .22); }

/* ------------------------------------------------------------------ try-it */

.tryit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
         box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.field .hint { font-weight: 400; color: var(--ink-soft); }

.field input, .field textarea, .field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
  background: #fff;
  color: var(--ink);
}

.field textarea { min-height: 190px; resize: vertical; white-space: pre; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; box-shadow: 0 0 0 4px rgba(91, 76, 230, .16); }
.field.invalid input, .field.invalid textarea { border-color: var(--red); }

.tryit-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Test Application Credentials: the per-run override block on APP_BASIC operations. */
.tryit-appcreds { border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 12px 0 16px; }
.tryit-appcreds h3 { margin-top: 0; }
.tryit-appcreds .tryit-actions input { flex: 1; width: auto; }

.result-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 14px 0 8px; }

.status-pill {
  font-family: var(--mono);
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12.5px;
}

.status-2xx { background: #dff2e7; color: var(--green); }
.status-4xx { background: #fdefd6; color: var(--amber); }
.status-5xx { background: #fbe3e1; color: var(--red); }

.notice {
  border-left: 3px solid var(--accent);
  background: #f4f2ff;
  padding: 10px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 16px;
  font-size: 13.5px;
}

.notice-danger { border-left-color: var(--red); background: #fdf1f0; }
.notice-info { border-left-color: #1a6fb5; background: #eef4fc; }
.notice-warn { border-left-color: var(--amber); background: #fdf6e8; }

.error-text { color: var(--red); font-size: 13px; }

/* ------------------------------------------------------------------- steps */

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 42px;
  border-left: 2px solid var(--line);
  margin-left: 13px;
}

.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }

.steps li::before {
  content: counter(step);
  position: absolute;
  left: -14px;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Long paths such as /doc/package/{packageId}/documents/{documentId}/... have
   no natural break point, so they are told explicitly that they may wrap. */
.steps .step-op {
  font-family: var(--mono);
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ------------------------------------------------------------------- modal */

/*
   The dialog is capped at the viewport and scrolls INSIDE its body.

   Before this it was an uncapped block inside a centred flex container. A centred flex item
   taller than its container overflows both ends, and the overflow above the top edge is
   unreachable — no scrollbar takes you there. So on a short screen the title disappeared upward
   and the action buttons disappeared downward at the same time, which is exactly what a
   developer met at 1366x768. The fix is structural: cap the card, give it a header / body /
   footer, and let only the body scroll. No offsets, no negative margins. */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 42, 85, .55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  z-index: 50;
  /* A last-resort escape hatch: if a browser still lays the card out taller than the cap
     (a very large default font, say), the whole card stays reachable rather than clipped. */
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal[hidden] { display: none; }

/* While a modal is open the page behind it must not scroll: a wheel over the backdrop otherwise
   moves the document and leaves the dialog looking stuck. Restored on every close path. */
body.modal-open { overflow: hidden; }

.modal-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(11, 42, 85, .45);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  /* Mobile browsers whose toolbars change the visible height report it here; a browser that
     does not know the unit keeps the line above. */
  max-height: calc(100dvh - 48px);
  overflow: hidden;
}

.modal-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 { margin: 0; font-size: 17px; }

.modal-close {
  flex: none;
  background: none;
  border: 0;
  padding: 0 2px;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}

.modal-close:hover { color: var(--ink); }

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 22px 16px;
}

.modal-lede { margin: 0 0 14px; font-size: 12.5px; }
.modal-footnote { margin: 14px 0 0; font-size: 12px; }

.modal-card label { display: block; font-size: 12.5px; font-weight: 600; margin: 12px 0 4px; }
.modal-card .modal-body > .field > label:first-child { margin-top: 0; }
.modal-card input { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2);
                    border-radius: var(--radius); font-size: 14px; }
.modal-card input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

.field-caption {
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.mono-hint { font-family: var(--mono); font-size: 12px; word-break: break-all; }

.modal-actions {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--line);
}

.modal-actions .btn-ghost { color: var(--ink-soft); }

/* -------------------------------------------------------------- responsive */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 1024px) {
  .content { padding: 22px 22px 70px; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }

  /*
    The drawer slides on `left` rather than `transform`. A transform is the
    usual choice for this and is cheaper to animate, but it is also the property
    most likely to be flattened by a compositor that is not running — which made
    the closed and open states indistinguishable under automated inspection.
    Offsetting a fixed element is a layout change, so the position is real and
    measurable whatever the renderer is doing.
  */
  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-width));
    top: var(--topbar-height);
    z-index: 25;
    transition: left .18s ease;
    box-shadow: 0 8px 26px rgba(11, 42, 85, .3);
  }

  .sidebar.open { left: 0; }

  .brand-title { display: none; }
  .env { display: none; }
  .content { padding: 18px 16px 60px; }
  h1 { font-size: 21px; }
}

@media (max-width: 520px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar select { max-width: 110px; }
  :root { --sidebar-width: 84vw; }
  .card { padding: 14px 15px; }
  .op-list a { flex-direction: column; gap: 3px; }
}


/* ---- configuration & RSSP session ---- */
/* A two-column key/value table: the label column is sized to the longest
   realistic label so values line up across separate cards, which is what makes
   several environment cards scannable rather than a wall of rows. */
.kv { margin: 10px 0 4px; }
.kv th {
  text-align: left;
  width: 210px;
  font-weight: 600;
  color: var(--ink-soft);
  vertical-align: top;
}
.kv td { word-break: break-word; }
.ok-text { color: #1a7f37; font-size: 13px; }
/* The session, compactly. The full diagnostic table it replaced was eleven rows of which four
   mattered; the rest are one <details> away and are the reason the dialog outgrew the screen. */
.rssp-account { margin: 16px 0 0; }

.rssp-status-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.rssp-status-state {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 650;
}

.rssp-status-state.is-ok { color: var(--green, #1c7a4a); }
.rssp-status-state.is-pending { color: var(--amber); }

.rssp-status-line { margin-top: 3px; font-size: 13px; color: var(--ink-soft); }

.rssp-advanced { margin-top: 12px; }
.rssp-advanced > summary { cursor: pointer; font-size: 12.5px; color: var(--ink-soft); }
.rssp-advanced .kv { margin-top: 8px; }
.rssp-advanced .kv th { width: 190px; }
.code-block {
  max-height: 220px;
  overflow: auto;
  font-size: 12px;
}

/* Inline style attributes are blocked by the portal's own CSP (style-src 'self'),
   so spacing that used to live in a style="" attribute belongs here instead. */
.actions-spaced { margin-bottom: 12px; }

/* ---- API Explorer: document upload control ---- */
.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.upload-controls { margin: 8px 0 0 32px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 8px; }
/* ---- Response body row-by-row (formatted) view ---- */
.resp-body { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
  background: var(--surface); overflow-x: auto; }
.jr-block { display: block; }
.jr-row { display: flex; gap: 8px; padding: 2px 0; align-items: flex-start; }
.jr-row .jr-block { margin-left: 14px; border-left: 1px solid var(--line); padding-left: 10px; }
.jr-key { color: var(--accent-deep); font-weight: 600; font-family: var(--mono); font-size: 12px;
  flex: 0 0 auto; white-space: nowrap; }
.jr-key::after { content: ':'; color: #94a3b8; margin-left: 1px; }
.jr-index { color: #94a3b8; font-weight: 500; }
.jr-index::after { content: ''; }
.jr-scalar { font-family: var(--mono); font-size: 12px; word-break: break-all; color: var(--ink); }
.jr-null, .jr-empty { color: #94a3b8; font-family: var(--mono); font-size: 12px; }
/* A document body stands in for itself: never rendered, never copied. */
.jr-redacted { color: #94a3b8; font-family: var(--mono); font-size: 12px; font-style: italic; }

/* ------------------------------------------- application-credential editor */
/* A form the developer meets when login is being refused, so it has to read at
   a glance: the fields carry the values actually in force, secrets masked, and
   one line above them names which of the two sources supplied them. */

.env-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.1px;
}

.cred-source { margin: 0 0 16px; font-size: 13px; display: flex; align-items: center; gap: 8px; }

.cred-effective {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.cred-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px 20px;
  margin-bottom: 16px;
}

.cred-field { min-width: 0; }

.cred-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.cred-label { font-size: 12.5px; font-weight: 600; }

.cred-control { display: flex; gap: 8px; align-items: stretch; }

.cred-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}

.cred-input::placeholder { color: #6b6a8a; font-family: var(--sans); font-style: italic; }
.cred-input:focus { outline: 2px solid var(--accent); border-color: transparent; box-shadow: 0 0 0 4px rgba(91, 76, 230, .16); }
select.cred-input { font-family: var(--sans); }

.cred-reveal { flex: none; color: var(--ink-soft); border-color: var(--line-2); }
.cred-reveal:hover { color: var(--ink); }

/* Which source is in force for this one field. */
.src-pill {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.src-pill-global { background: var(--accent-soft); color: var(--accent-deep); border-color: #d9d4fb; }
.src-pill-config { background: var(--surface-alt); color: var(--ink-soft); border-color: var(--line); }
.src-pill-none   { background: #fbe3e1; color: var(--red); border-color: #f0c4c0; }

.cred-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.cred-actions .btn-ghost { color: var(--accent-deep); border-color: var(--line-2); }
.cred-actions .btn-ghost:disabled { color: #8c8aa8; cursor: not-allowed; }

.cred-msg { font-size: 13px; }
.cred-msg-ok { color: var(--green); }
.cred-msg-error { color: var(--red); }

@media (max-width: 720px) {
  .cred-form { grid-template-columns: 1fr; }
}

/* ---- Application credential (Configuration page + Sign in dialog) ---- */
.app-cred {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}
.app-cred-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.app-cred-title { font-weight: 600; font-size: 13px; }
.app-cred-table { margin-top: 8px; }
.app-cred-table th { width: 150px; }
.app-cred-msg { margin: 6px 0 0; min-height: 1em; }
.app-cred-msg.is-error { color: var(--red); }
.app-cred-msg.is-ok { color: var(--green, #1c7a4a); }
.app-cred-stages th { width: 190px; }
.src-pill-ok { background: #e3f4ea; color: var(--green, #1c7a4a); border-color: #bfe3cd; }
.cred-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-top: 6px; color: var(--ink-soft); }
.cred-note { font-size: 12.5px; color: var(--ink-soft); margin: 4px 0 0; }
.cred-problem { margin: 0 0 14px; }
.verdict-passed { color: var(--green, #1c7a4a); font-weight: 600; }
.verdict-failed { color: var(--red); font-weight: 600; }
.verdict-other { color: var(--ink-soft); }
.rssp-error-layer { display: block; font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: .02em; }
.rssp-error-correlation { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-soft); }
