:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: rgba(16, 23, 32, 0.88);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f7fb;
  --muted: #91a0b3;
  --ok: #67e7ad;
  --error: #ff7676;
  --pending: #ffc96b;
}
.catalog-bar { display:flex; align-items:center; justify-content:space-between; gap:16px; border:1px solid var(--line); border-radius:12px; padding:16px 18px; margin-top:24px; background:var(--panel); }
.catalog-bar strong { font-size:14px; }
.catalog-bar p { margin:6px 0 0; color:var(--muted); font-size:12px; }
.catalog-bar p.stale { color:var(--pending); }
.catalog-bar button { padding:9px 14px; border:1px solid var(--line); border-radius:8px; background:#1b2936; color:var(--text); white-space:nowrap; cursor:pointer; }
.catalog-bar button:disabled { opacity:.5; }
.badge.disabled,.public-result.disabled { color:#a9b3c2; background:#252c35; }
.badge.unconfigured,.public-result.unconfigured { color:var(--pending); }
.overall.unconfigured { color:var(--pending); }
.overall.disabled { color:var(--muted); }
.empty-catalog { grid-column:1 / -1; color:var(--muted); line-height:1.8; padding:24px; }
.test-mode-select { width:100%; min-width:0; }
.model-tools { flex-wrap:wrap; }
footer a { color:var(--ok); text-decoration:none; }
@media(max-width:600px) { .catalog-bar { align-items:flex-start; padding:14px; } .catalog-bar p { line-height:1.7; } }

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(79, 119, 255, 0.17), transparent 34rem),
    radial-gradient(circle at 92% 84%, rgba(34, 218, 145, 0.11), transparent 32rem),
    var(--bg);
}
.shell { width: min(1180px, 100%); margin: 0 auto; padding: 38px 24px 22px; }
header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.eyebrow, .group-label { margin: 0 0 8px; color: var(--ok); font-size: .7rem; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.055em; }
.subtitle { margin: 12px 0 0; color: var(--muted); }
.viewer-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.access-level { padding: 6px 9px; border-radius: 8px; font-size: .72rem; font-weight: 760; }
.access-level.public { color: #b8c5d8; background: rgba(184,197,216,.09); }
.access-level.admin { color: var(--ok); background: rgba(103,231,173,.1); }
.login-link { color: var(--muted); font-size: .74rem; text-underline-offset: 3px; }
.login-link:hover { color: var(--text); }
.overall { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: .84rem; font-weight: 750; background: rgba(255,255,255,.04); }
.overall span { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 16px currentColor; }
.overall.ok { color: var(--ok); }
.overall.error { color: var(--error); }
.overall.pending { color: var(--pending); }
.summary { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 12px; margin: 34px 0 18px; }
.summary div { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.summary span { color: var(--muted); font-size: .78rem; }
.summary strong { font-size: 1.15rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 18px 45px rgba(0,0,0,.18); }
.card.ok { border-color: rgba(103,231,173,.28); }
.card.error { border-color: rgba(255,118,118,.34); }
.public-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.public-card { min-height: 150px; }
.public-result { margin-top: 28px; font-size: 1.6rem; font-weight: 850; letter-spacing: -.03em; }
.public-result.ok { color: var(--ok); }
.public-result.error { color: var(--error); }
.public-result.pending, .public-result.checking { color: var(--pending); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
h2 { margin: 0; font-size: 1.2rem; overflow-wrap: anywhere; }
.badge { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.badge.ok { color: var(--ok); background: rgba(103,231,173,.1); }
.badge.error { color: var(--error); background: rgba(255,118,118,.1); }
.badge.pending, .badge.checking { color: var(--pending); background: rgba(255,201,107,.1); }
.badge.hidden-badge { color: #d7b3ff; background: rgba(170,120,255,.14); }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.admin-visibility-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.hide-group-button {
  padding: 7px 12px;
  border: 1px solid rgba(170,120,255,.35);
  border-radius: 8px;
  background: rgba(170,120,255,.12);
  color: #e6d4ff;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}
.hide-group-button:disabled { opacity: .55; cursor: default; }
.hide-hint { color: var(--muted); font-size: .72rem; }
.card.is-hidden {
  border-color: rgba(170,120,255,.35);
  background:
    linear-gradient(180deg, rgba(170,120,255,.08), transparent 42%),
    var(--panel);
}
dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 16px; }
dl div { min-width: 0; }
dt { color: var(--muted); font-size: .7rem; margin-bottom: 4px; }
dd { margin: 0; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.message { min-height: 42px; padding: 11px 12px; border-radius: 10px; color: var(--muted); font-size: .78rem; line-height: 1.45; background: rgba(0,0,0,.2); overflow-wrap: anywhere; }
.error .message { color: #ffb0b0; }
.history { display: flex; gap: 5px; align-items: center; min-height: 10px; margin-top: 15px; }
.history i { width: 8px; height: 8px; border-radius: 50%; background: var(--pending); }
.history i.ok { background: var(--ok); }
.history i.error { background: var(--error); }
.no-history { color: var(--muted); font-size: .7rem; }
footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; color: var(--muted); font-size: .75rem; }
@media (max-width: 720px) {
  .shell { padding: 24px 14px 18px; }
  header, footer { flex-direction: column; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary div:last-child { grid-column: 1 / -1; }
  .grid { grid-template-columns: 1fr; }
  .public-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


.model-tools {
  display: flex;
  gap: 8px;
  margin: 14px 0 10px;
}
.model-select {
  min-width: 0;
  flex: 1;
  color: var(--text);
  background: #111923;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}
.test-model-button {
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  color: #06110d;
  background: var(--ok);
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}
.test-model-button:disabled {
  opacity: .55;
  cursor: wait;
}
.model-attempts {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  font-size: .74rem;
}
.model-attempt {
  overflow-wrap: anywhere;
}
.model-attempt.ok {
  color: var(--ok);
}
.model-attempt.error {
  color: var(--error);
}
@media (max-width: 520px) {
  .model-tools {
    flex-direction: column;
  }
}

#login-dialog {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 0;
  background: #12161c;
  color: #e8eef7;
  width: min(420px, calc(100vw - 2rem));
}
#login-dialog::backdrop { background: rgba(0,0,0,.55); }
#login-form { display: grid; gap: .85rem; padding: 1.25rem 1.35rem 1.35rem; }
#login-form h2 { margin: 0; font-size: 1.05rem; }
.login-hint { margin: 0; color: #9aa7b8; font-size: .82rem; line-height: 1.45; }
#login-form label { display: grid; gap: .35rem; font-size: .8rem; color: #9aa7b8; }
#login-form input {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: #0c1016;
  color: #e8eef7;
  padding: .65rem .75rem;
  font: inherit;
}
.login-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .25rem; }
.login-actions button {
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: #1a2230;
  color: #e8eef7;
  padding: .55rem .9rem;
  cursor: pointer;
  font: inherit;
}
#login-submit { background: #2f6fed; border-color: #2f6fed; }
.login-error { margin: 0; color: #ff8e8e; font-size: .82rem; }

.hello-box {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.hello-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.hello-head .group-label { margin: 0; }
.hello-button {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  color: #06110d;
  background: #7dd3fc;
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.hello-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.hello-reply {
  margin: 0;
  min-height: 110px;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(125, 211, 252, .18);
  background: rgba(0, 0, 0, .28);
  color: #d7e7f7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.hello-reply.error { color: #ffb0b0; border-color: rgba(255,118,118,.28); }
.public-hello .hello-button,
.public-hello .pelican-button { background: #3a4556; color: #c5d0de; }
.pelican-box { border-top-color: rgba(250, 204, 21, .22); }
.pelican-button {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  color: #1a1400;
  background: #facc15;
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.pelican-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.pelican-preview {
  margin: 0 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(250, 204, 21, .22);
  background: #fff;
  overflow: hidden;
  min-height: 180px;
}
.pelican-frame {
  display: block;
  width: 100%;
  height: 280px;
  border: 0;
  background: #fff;
}
.pelican-reply {
  margin: 0;
  min-height: 90px;
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(250, 204, 21, .18);
  background: rgba(0, 0, 0, .28);
  color: #f5e7a8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pelican-reply.error { color: #ffb0b0; border-color: rgba(255,118,118,.28); }
