:root { --navy:#010F3E; --teal:#09C9BE; --ok:#0A8F87; --err:#C0392B; --line:#DDE1EC; --muted:#6B7280; }
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:var(--navy); color:#0B1020;
       font-family:'IBM Plex Sans',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; }
h1,h2,h3 { font-family:'Sora',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; color:var(--navy); }
.hidden { display:none !important; }

.gate { min-height:100vh; display:grid; place-items:center; padding:24px; }
.card { width:100%; max-width:420px; background:#fff; border-radius:16px; padding:32px; }
h1 { font-size:22px; margin:0 0 4px; }
.sub { color:var(--muted); font-size:13px; margin:0 0 24px; }
label { display:block; font-size:13px; font-weight:600; margin:0 0 6px; color:var(--navy); }
input,textarea,select { width:100%; padding:12px 14px; font-size:15px; border:1px solid var(--line);
        border-radius:10px; font-family:inherit; background:#fff; }
input:focus,textarea:focus,select:focus { outline:none; border-color:var(--teal); box-shadow:0 0 0 3px rgba(9,201,190,.18); }
.field { margin-bottom:18px; }
.hint { font-size:13px; margin-top:6px; min-height:18px; }
.hint.ok { color:var(--ok); font-weight:600; }
.hint.bad { color:var(--err); }
.hint.wait { color:var(--muted); }
button { padding:14px; font-size:15px; font-weight:700; border:0; border-radius:10px;
         background:var(--teal); color:var(--navy); cursor:pointer; font-family:inherit; width:100%; }
button:disabled { background:var(--line); color:var(--muted); cursor:not-allowed; }

.console { display:grid; grid-template-columns:240px 1fr; min-height:100vh; }
nav { background:#020A2A; padding:20px 0; overflow-y:auto; }
.brand { color:var(--teal); font-weight:700; padding:0 20px 20px; letter-spacing:.05em; }
nav .group { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.08em; padding:16px 20px 6px; }
nav button.item { display:block; width:100%; text-align:left; background:none; color:#C8CEE4;
                  padding:9px 20px; font-size:13px; font-weight:500; border-radius:0; }
nav button.item:hover { background:rgba(255,255,255,.06); }
nav button.item.active { background:rgba(9,201,190,.15); color:var(--teal); }
nav button.item .money { color:#F0B429; margin-left:6px; }

main { background:#F5F7FB; padding:28px 32px; overflow-y:auto; }
main header { display:flex; align-items:center; gap:12px; margin-bottom:20px; }
h2 { font-size:20px; margin:0; }
.method { font-size:11px; font-weight:700; background:var(--navy); color:#fff; padding:3px 8px; border-radius:6px; }
.modes { display:flex; gap:8px; margin-bottom:12px; }
button.mode { width:auto; padding:7px 14px; font-size:12.5px; font-weight:600;
              background:#E7EBF5; color:var(--muted); border-radius:8px; }
button.mode.active { background:var(--navy); color:#fff; }
#endpoint-form { background:#fff; border-radius:14px; padding:24px; margin-bottom:16px; }
#raw-panel { background:#fff; border-radius:14px; padding:24px; margin-bottom:16px; }
#raw-body { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:12.5px; line-height:1.6; }
#send { max-width:200px; }
.run-bar { display:flex; align-items:flex-end; gap:16px; flex-wrap:wrap; }
.run-as { min-width:220px; }
.run-as label { font-size:12px; }
.run-as select { padding:11px 12px; font-size:14px; }

.response { background:#fff; border-radius:14px; padding:20px; margin-top:20px; }
.response-meta { display:flex; gap:16px; font-size:13px; font-weight:600; margin-bottom:12px; }
.response-meta .ok { color:var(--ok); }
.response-meta .bad { color:var(--err); }
pre { background:#0B1020; color:#D5E1FF; padding:16px; border-radius:10px; overflow-x:auto;
      font-size:12.5px; line-height:1.55; margin:0; }

.provider { margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
.provider h4 { margin:0 0 10px; font-size:13px; color:var(--err); }
.provider .row { border-bottom:none; padding:4px 0; }
.provider pre { margin:10px 0; }
button.secondary { width:auto; padding:9px 16px; font-size:13px; background:var(--navy); color:#fff; }

.panels { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:24px; }
.panels h3 { font-size:14px; margin:0 0 10px; }
.row { display:flex; justify-content:space-between; gap:12px; padding:8px 0;
       border-bottom:1px solid var(--line); font-size:13px; }
.row span:first-child { color:var(--muted); }
.row span:last-child { font-weight:600; text-align:right; word-break:break-all; }

/* The credential set a row ran as. Rendered only when there IS one — a call on
   .env carries no tag at all, so a console with no sets looks as it always
   did. */
.tag { display:inline-block; margin-left:8px; padding:2px 7px; border-radius:5px;
       background:#E7EBF5; color:var(--muted); font-size:11px; font-weight:600;
       vertical-align:middle; word-break:break-all; }
.response-meta .tag { margin-left:0; }

/* Collapsed by default (see the <details> in index.html). */
.credentials { grid-column:1 / -1; background:#fff; border-radius:14px; padding:16px 20px; }
.credentials > summary { font-family:'Sora',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
       font-size:14px; font-weight:700; color:var(--navy); cursor:pointer; }
.credentials .sub { margin:12px 0 18px; max-width:70ch; }
.credentials .field { margin-bottom:14px; }
#credential-save { max-width:240px; }
#credential-list { margin-top:8px; }
.cred-row span:first-child { color:var(--navy); font-weight:600; word-break:break-all; }
.cred-row span:last-child { display:flex; align-items:center; gap:10px; justify-content:flex-end; }
button.danger { width:auto; padding:6px 12px; font-size:12px; background:none;
       color:var(--err); border:1px solid var(--line); border-radius:8px; }
button.danger:hover { background:#FCEAE7; }

@media (max-width:800px) { .console { grid-template-columns:1fr; } .panels { grid-template-columns:1fr; } }
