/* Render-only styles (pr- classes), on top of site.css (Launchpad theme) and app.css (Connect app styles). */

/* ---------- Small bits ---------- */
.cx-pill.err { background: var(--red-soft); color: var(--red); }
.pr-meter { height: 6px; border-radius: 99px; background: var(--lane); overflow: hidden; margin: 8px 0 4px; }
.pr-meter.lg { height: 12px; }
.pr-meter > i { display: block; height: 100%; background: var(--brand-grad); border-radius: inherit; min-width: 2px; transition: width .4s; }
.pr-meter > i.warn { background: linear-gradient(90deg, #f59e0b, var(--red)); }
.pr-spark { display: flex; align-items: flex-end; gap: 2px; height: 32px; margin-top: 6px; }
.pr-spark > i { flex: 1; background: color-mix(in srgb, var(--brand) 70%, transparent); border-radius: 2px 2px 0 0; min-height: 2px; }
.pr-usage-n b { font: 700 34px Poppins, Inter, sans-serif; color: var(--ink); letter-spacing: -.02em; }
.pr-usage-n span { color: var(--muted); }
.pr-table { --bs-table-bg: transparent; font-size: 13.5px; }
.pr-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; border-bottom-color: var(--line); }
.pr-table td { border-bottom-color: var(--line2); vertical-align: middle; }
.pr-table code { font-size: 12.5px; }
.pr-code { background: #1e1f1d; color: #e6e8e3; border-radius: 10px; padding: 14px 16px; font: 12.5px/1.6 "Cascadia Code", Consolas, monospace; white-space: pre; overflow: auto; margin-bottom: 12px; }
.pr-code i { color: #8fd165; font-style: normal; }
.pr-verb { display: inline-block; font: 700 11px Inter, sans-serif; padding: 2px 7px; border-radius: 5px; background: var(--soft); color: var(--brand-ink); letter-spacing: .04em; margin-right: 4px; }
.pr-verb.get { background: color-mix(in srgb, #2563eb 14%, var(--surface)); color: #2563eb; }
.pr-pills .nav-link { color: var(--body); font-weight: 600; font-size: 13px; padding: 5px 12px; }
.pr-pills .nav-link.active { background: var(--soft); color: var(--brand-ink); }
.pr-docs { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1200px) { .pr-docs { grid-template-columns: 1fr; } }

/* Lists of templates */
.pr-list { display: flex; flex-direction: column; }
.pr-list-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-top: 1px solid var(--line2); color: inherit; text-decoration: none; border-radius: 8px; }
.pr-list-row:first-child { border-top: 0; }
a.pr-list-row:hover { background: var(--hover); }
.pr-file-ic { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; display: grid; place-items: center; background: var(--soft); color: var(--brand-ink); font-size: 16px; }
.pr-file-ic.lg { width: 44px; height: 44px; font-size: 20px; border-radius: 12px; margin-bottom: 6px; }
.pr-empty-ic { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--soft); color: var(--brand-ink); font-size: 28px; }
.pr-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pr-card { background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s; min-width: 0; }
.pr-card:hover { box-shadow: var(--shadow-md); border-color: var(--line); }
.pr-card-main { display: flex; flex-direction: column; gap: 2px; padding: 16px 16px 10px; color: inherit; text-decoration: none; min-width: 0; }
.pr-card-main b { color: var(--ink); font-size: 15px; }
.pr-card-id { display: flex; gap: 6px; padding: 0 16px 10px; }
.pr-card-id .form-control { font-size: 11.5px; background: var(--surface-2); }
.pr-card-actions { display: flex; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--line2); }

/* Getting started */
.pr-steps { margin: 0; padding-left: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.pr-steps li { counter-increment: s; display: flex; gap: 10px; align-items: baseline; }
.pr-steps li::before { content: counter(s); flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--lane); color: var(--ink); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.pr-steps li.done::before { content: "\2713"; background: var(--brand-2); color: #fff; }
.pr-steps li.done { color: var(--muted); }

/* New key box */
.pr-newkey { background: var(--soft); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.pr-newkey h2 { font: 600 18px Poppins, Inter, sans-serif; margin: 0 0 4px; color: var(--ink); }
.pr-newkey p { margin-bottom: 12px; }
.pr-newkey-ic { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-grad); color: #fff; font-size: 20px; }

/* ---------- Template editor ---------- */
/* The editor fills the screen below the floating top bar. */
body.pr-wide main#main { overflow: hidden; display: flex; flex-direction: column; }
body.pr-wide .cx-page { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: 14px; }
.pr-ed-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.pr-ed-name { flex: 1 1 260px; max-width: 460px; }
.pr-ed-name .form-control { font-weight: 600; color: var(--ink); }
.pr-ed-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-ed-id code { font-size: 12.5px; background: var(--lane); padding: 4px 8px; border-radius: 6px; color: var(--ink); }
.pr-savestate { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pr-savestate.ok { color: var(--brand-ink); }
.pr-savestate.warn { color: var(--amber); }
.pr-savestate.err { color: var(--red); }

.pr-editor { flex: 1; min-height: 0; }
.pr-pane { background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.pr-tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); overflow-x: auto; flex: 0 0 auto; }
.pr-tabs button { border: 0; background: none; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.pr-tabs button:hover { color: var(--ink); }
.pr-tabs button.on { color: var(--brand-ink); border-bottom-color: var(--brand-2); }
.pr-tabs-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; padding: 0 4px 6px; }
.pr-tabs-tools [hidden] { display: none; }
.pr-tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); display: inline-block; }
.pr-tab-dot[hidden] { display: none; }
.pr-preview { min-height: 0; }
.pr-tabpane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.pr-tabpane.on { display: flex; }
.pr-monaco { flex: 1; min-height: 200px; }
.pr-monaco.sm { flex: 1; min-height: 120px; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; }
.pr-hf { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; }
.pr-hf label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pr-setup { padding: 16px; overflow: auto; }
.pr-rot { display: inline-block; transform: rotate(90deg); }
.pr-hint { font-size: 12.5px; color: var(--body); background: var(--surface-2); border-bottom: 1px solid var(--line2); padding: 8px 12px; display: flex; gap: 8px; align-items: baseline; }
.pr-setup .pr-hint { border: 1px solid var(--line2); border-radius: 8px; }
.pr-hint .bi { color: var(--brand-ink); }
.pr-ed-status { font-size: 12.5px; padding: 0 12px; min-height: 0; color: var(--muted); }
.pr-ed-status:not(:empty) { padding: 6px 12px; border-top: 1px solid var(--line2); }
.pr-ed-status.err { color: var(--red); background: var(--red-soft); }

.pr-prev-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pr-prev-body { position: relative; flex: 1; min-height: 300px; background: #525659; }

.pr-prev-err { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); border-left: 4px solid var(--red); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow-lg); font-size: 13px; }
.pr-prev-err .bi { color: var(--red); font-size: 16px; }
.pr-prev-err b { display: block; color: var(--ink); }
.pr-prev-err span { white-space: pre-wrap; word-break: break-word; }
.pr-prev-err[hidden], .pr-prev-busy[hidden] { display: none; }
.pr-prev-busy { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; align-items: center; background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: 12.5px; box-shadow: var(--shadow-md); }
.pr-cheat code { white-space: nowrap; }

@media (max-width: 1000px) {
    body.pr-wide main#main { overflow: auto; display: block; }
    body.pr-wide .cx-page { display: block; }
    .pr-pane { height: 78vh; }
}

/* ---------- Landing page bits ---------- */
.pr-hero-art { display: grid; gap: 14px; position: relative; }
.pr-hero-code { background: #1e1f1d; border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.pr-hero-code pre { margin: 0; padding: 14px 18px 18px; color: #c9ccc5; font: 12.5px/1.65 "Cascadia Code", Consolas, monospace; white-space: pre; overflow: hidden; }
.pr-hero-code b { color: #8fd165; font-weight: 400; }
.pr-hero-code em { color: #f0b86e; font-style: normal; }
.pr-hero-dots { display: flex; gap: 6px; align-items: center; padding: 10px 14px; background: #2a2b29; }
.pr-hero-dots i { width: 10px; height: 10px; border-radius: 50%; background: #55574f; }
.pr-hero-dots span { margin-left: 8px; color: #8a8d86; font-size: 12px; }
.pr-hero-pdf { background: #fff; color: #2a2a29; border-radius: 6px; box-shadow: var(--shadow-lg); padding: 20px 22px; margin-left: 60px; border-top: 4px solid #3fab35; }
.pr-hero-pdf-top { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 14px; }
.pr-hero-pdf-top span { color: #888; font-size: 13px; }
.pr-hero-line { display: flex; justify-content: space-between; font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid #eee; }
.pr-hero-total { display: flex; justify-content: space-between; padding-top: 10px; font-size: 14px; }
.pr-hero-art .ln-note-2 { position: absolute; right: -6px; bottom: -14px; }
.pr-land-code { max-width: 760px; margin: 0 auto; font-size: 13.5px; }
@media (max-width: 700px) { .pr-hero-pdf { margin-left: 0; } .pr-hero-art .ln-note-2 { display: none; } }

/* ---------- Tables used as lists (Templates, Images) ---------- */
.pr-rows td, .pr-rows th { padding: 10px 14px; }
.pr-rows tbody tr:hover { background: var(--hover); }
.pr-rows tr:last-child td { border-bottom: 0; }

/* ---------- Image library ---------- */
.pr-drop { display: flex; align-items: center; gap: 14px; border: 2px dashed var(--line); border-radius: 12px; padding: 16px 18px; margin: 0; transition: border-color .15s, background .15s; flex-wrap: wrap; }
.pr-drop > .bi { font-size: 28px; color: var(--brand-ink); }
.pr-drop.over { border-color: var(--brand); background: var(--soft); }
.pr-drop.off { opacity: .85; }
.pr-thumb { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--line2); overflow: hidden;
    background: repeating-conic-gradient(var(--lane) 0 25%, var(--surface) 0 50%) 0 0 / 12px 12px; }
.pr-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pr-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pr-pick-item { border: 1px solid var(--line2); background: var(--surface); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; text-align: left; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.pr-pick-item:hover { border-color: var(--brand); box-shadow: var(--shadow-md); }
.pr-pick-img { height: 90px; display: grid; place-items: center; border-radius: 6px; overflow: hidden;
    background: repeating-conic-gradient(var(--lane) 0 25%, var(--surface) 0 50%) 0 0 / 12px 12px; }
.pr-pick-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pr-pick-name { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Postman banner on the API docs */
.pr-postman { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.pr-postman-ic { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center; background: #ff6c37; color: #fff; font-size: 18px; }
.pr-upload-progress { margin-top: 8px; max-width: 520px; }
.pr-upload-progress .pr-meter { margin: 0 0 4px; }
.pr-drop.busy { pointer-events: none; }

/* Images: grid view and the list / grid switch */
[data-view].on { background: var(--soft); color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.pr-imggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pr-imggrid[hidden], #imgList[hidden] { display: none; }
.pr-imgcard { background: var(--surface); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; min-width: 0; transition: box-shadow .15s, border-color .15s; }
.pr-imgcard:hover { box-shadow: var(--shadow-md); border-color: var(--line); }
.pr-imgcard-img { height: 150px; display: grid; place-items: center; padding: 10px; border-bottom: 1px solid var(--line2);
    background: repeating-conic-gradient(var(--lane) 0 25%, var(--surface) 0 50%) 0 0 / 14px 14px; }
.pr-imgcard-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pr-imgcard-body { padding: 10px 12px 4px; display: flex; flex-direction: column; min-width: 0; }
.pr-imgcard-body b { color: var(--ink); font-size: 13.5px; }
.pr-imgcard-actions { display: flex; gap: 6px; padding: 8px 12px 12px; }

/* Preview pages drawn by pdf.js */
.pr-pages { position: absolute; inset: 0; overflow: auto; padding: 20px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pr-page { display: block; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); flex: 0 0 auto; }
.pr-zoom-label { min-width: 56px; font-variant-numeric: tabular-nums; }

/* ---------- Plans (Plan & usage, and the landing page) ---------- */
.pr-plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
@media (max-width: 1200px) { .pr-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pr-plans { grid-template-columns: 1fr; } }
.pr-plan { position: relative; background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; padding: 20px 18px 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-width: 0; }
.pr-plan.popular { border: 2px solid var(--brand); box-shadow: 0 18px 44px -20px color-mix(in srgb, var(--brand) 60%, transparent); }
.pr-plan.current { background: color-mix(in srgb, var(--soft) 55%, var(--surface)); }
.pr-plan-flag { position: absolute; top: -12px; left: 18px; background: var(--brand-grad); color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 11px; border-radius: 99px; letter-spacing: .02em; }
.pr-plan h3 { font: 600 18px Poppins, Inter, sans-serif; color: var(--ink); margin: 0 0 2px; }
.pr-plan-blurb { color: var(--muted); font-size: 13px; min-height: 38px; margin-bottom: 10px; }
.pr-plan-price { margin-bottom: 12px; }
.pr-plan-price b { font: 700 30px Poppins, Inter, sans-serif; color: var(--ink); letter-spacing: -.02em; }
.pr-plan-price span { color: var(--muted); font-size: 13px; margin-left: 4px; }
.pr-plan-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 7px; font-size: 13.5px; flex: 1; }
.pr-plan-list .bi { color: var(--brand-2); margin-right: 6px; }
.pr-plan-list b { color: var(--ink); }
.pr-usage-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; margin-bottom: 12px; }
.pr-usage-row > span { color: var(--body); font-size: 13.5px; }
.pr-usage-row > b { color: var(--ink); font-size: 15px; }
.pr-usage-row > b small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.pr-usage-row .pr-meter { grid-column: 1 / -1; margin: 2px 0 0; }
.ln-plans { max-width: 1180px; margin: 0 auto; text-align: left; }
.ln-plans .pr-plan { padding: 24px 20px 20px; }
