/* AIMLRouter User Console — Daylight Aurora Theme (Aligned with aimlapi.com) */
:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --subtle: #f2f4f8;
  --line: #e5e7eb;
  --line-soft: #eef0f4;
  --ink: #0a0a0a;
  --ink-2: #1b1b22;
  --muted: #525866;
  --muted-2: #767d8c;
  --violet: #5a2fd6;
  --blue: #3984ff;
  --emerald: #05c168;
  --danger: #dc2b2b;
  --shadow-sm: 0 1px 2px rgba(20, 20, 43, 0.04), 0 4px 14px -4px rgba(20, 20, 43, 0.05);
  --shadow-md: 0 12px 32px -12px rgba(20, 20, 43, 0.09);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink-2); overflow-x: hidden;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Shell & Left Sidebar (hidden until data-auth="authed" or JS reveals) */
.uc-shell { display: none; grid-template-columns: 238px 1fr; min-height: 100vh; }
body[data-auth="guest"] .uc-gate { display: flex; }
body[data-auth="guest"] .uc-shell { display: none; }
body[data-auth="authed"] .uc-gate { display: none; }
body[data-auth="authed"] .uc-shell { display: grid; }
.uc-rail {
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: sticky; top: 0; height: 100vh; z-index: 25;
}
.uc-brand {
  display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px;
  border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--ink);
}
.uc-brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 4px 12px rgba(10, 10, 10, 0.14); }
.uc-nav { display: grid; gap: 4px; margin-top: 14px; }
.uc-nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  border-radius: 11px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left;
  transition: all .15s;
}
.uc-nav-btn svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.78; }
.uc-nav-btn:hover { background: var(--bg); color: var(--ink); }
.uc-nav-btn.active { background: #0a0a0a; color: #ffffff; font-weight: 700; box-shadow: 0 6px 16px -6px rgba(10, 10, 10, 0.35); }
.uc-nav-btn.active svg { opacity: 1; }
.uc-nav-cnt { margin-left: auto; font-family: var(--mono); font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: var(--subtle); color: var(--muted); }
.uc-nav-btn.active .uc-nav-cnt { background: rgba(255,255,255,0.18); color: #ffffff; }
.uc-rail-foot { display: grid; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 14px; }

/* Main Column & Aurora Topbar */
.uc-main { display: flex; flex-direction: column; min-width: 0; }
.uc-topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line); padding: 13px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.uc-topbar-l, .uc-topbar-r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.uc-body { padding: 24px 26px 48px; max-width: 1220px; width: 100%; margin: 0 auto; }

/* Buttons, Pills & Inputs */
.uc-btn {
  height: 36px; padding: 0 15px; border-radius: 999px; border: 1px solid #e2e5ec;
  background: #ffffff; color: var(--ink-2); font-size: 12.5px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
  white-space: nowrap; transition: all .16s; box-shadow: 0 1px 3px rgba(20, 20, 43, 0.04);
}
.uc-btn:hover { background: #f9fafb; border-color: #cbd5e1; color: var(--ink); transform: translateY(-0.5px); }
.uc-btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }
.uc-btn-primary { background: #0a0a0a; color: #ffffff; border-color: #0a0a0a; box-shadow: 0 6px 16px -6px rgba(10, 10, 10, 0.35); }
.uc-btn-primary:hover { background: #23232c; color: #ffffff; border-color: #23232c; }
.uc-btn-violet { background: var(--violet); color: #ffffff; border-color: var(--violet); box-shadow: 0 8px 20px -8px rgba(90, 47, 214, 0.55); }
.uc-btn-violet:hover { background: #4c23bd; color: #ffffff; border-color: #4c23bd; }
.uc-btn-danger { background: #fef2f2; color: var(--danger); border-color: #fecaca; box-shadow: none; }
.uc-btn-danger:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }

.uc-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.uc-pill.violet { background: #f5f3ff; color: var(--violet); border: 1px solid #e0e7ff; }
.uc-pill.emerald { background: #def2e6; color: #047857; }
.uc-pill.blue { background: #eaf4ff; color: #1d4ed8; }
.uc-pill.muted { background: var(--subtle); color: var(--muted); }
.uc-pill.danger { background: #fef2f2; color: var(--danger); }

.uc-pill-tab {
  height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #ffffff; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.uc-pill-tab:hover { color: var(--ink); border-color: #cbd5e1; }
.uc-pill-tab.on { background: #0a0a0a; color: #ffffff; border-color: #0a0a0a; }
.uc-input, .uc-select {
  height: 38px; border-radius: 10px; border: 1px solid var(--line); padding: 0 12px;
  font-size: 13px; background: #f9fafb; color: var(--ink); transition: all .15s;
}
.uc-input:focus, .uc-select:focus { outline: none; background: #ffffff; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(90, 47, 214, 0.11); }

/* Banners, Onboarding & KPI Strip */
.uc-banner {
  display: none; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border-radius: 16px; padding: 14px 18px; margin-bottom: 16px; border: 1px solid var(--line);
}
.uc-banner.aurora {
  background:
    radial-gradient(45% 140% at 8% 50%, rgba(165, 132, 255, 0.16) 0%, transparent 72%),
    radial-gradient(45% 140% at 92% 50%, rgba(110, 231, 183, 0.2) 0%, transparent 72%),
    #ffffff;
  border-color: #c7d2fe; box-shadow: var(--shadow-sm);
}
.uc-banner.warn { background: #fffbeb; border-color: #fde68a; }
.uc-banner.upgrade {
  background: linear-gradient(90deg, #f5f3ff 0%, #eff6ff 55%, #ecfdf5 100%);
  border-color: #ddd6fe;
}
.uc-onboard {
  display: none; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #ffffff; border: 1px solid #ddd6fe; border-radius: 16px; padding: 13px 18px;
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.uc-step { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted-2); }
.uc-step.done { color: #047857; }

.uc-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.uc-kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px;
  box-shadow: var(--shadow-sm); transition: border-color .18s, transform .18s, box-shadow .18s;
}
.uc-kpi.clickable { cursor: pointer; }
.uc-kpi:hover { border-color: #c7d2fe; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.uc-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.uc-kpi-label { font-size: 11px; font-weight: 700; color: var(--muted-2); letter-spacing: 0.06em; text-transform: uppercase; }
.uc-kpi-link { font-size: 11.5px; font-weight: 700; color: var(--violet); }
.uc-kpi-val { font-size: 24px; font-weight: 800; color: var(--ink); margin-top: 7px; letter-spacing: -0.025em; }
.uc-kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Cards, Panels & Quick Start */
.uc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.uc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.uc-card-title { font-size: 15.5px; font-weight: 800; color: var(--ink); margin: 0; letter-spacing: -0.02em; }
.uc-panel { display: none; }
.uc-panel.active { display: block; animation: ucFade .18s cubic-bezier(.22,1,.36,1); }
@keyframes ucFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.uc-cred-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.uc-cred-box { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; min-width: 0; }
.uc-cred-k { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; font-weight: 800; color: var(--violet); letter-spacing: 0.06em; margin-bottom: 7px; }
.uc-cred-v { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-code-box {
  background: #0d1117; color: #e2e8f0; border-radius: 14px; padding: 16px 18px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.62; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

/* Models Directory inside Console */
.uc-mdir { display: grid; grid-template-columns: 220px 1fr; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #ffffff; box-shadow: var(--shadow-sm); }
.uc-vrail { border-right: 1px solid var(--line); background: #f9fafb; padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.uc-vbtn {
  display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 9px 12px;
  border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 700; cursor: pointer; text-align: left; transition: all .15s;
}
.uc-vbtn:hover { background: #ffffff; color: var(--ink); border-color: var(--line); }
.uc-vbtn.on { background: #0a0a0a; color: #ffffff; border-color: #0a0a0a; }
.uc-vcnt { font-family: var(--mono); font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--subtle); color: var(--muted); }
.uc-vbtn.on .uc-vcnt { background: rgba(255,255,255,0.18); color: #ffffff; }
.uc-vdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); margin-right: 6px; vertical-align: middle; }
.uc-vbtn.soon { opacity: 0.6; color: var(--muted-2); }
.uc-vbtn.soon:hover { opacity: 0.85; }
.uc-vbtn.soon.on { opacity: 1; background: #4b5563; border-color: #4b5563; color: #ffffff; }
.uc-vcnt.soon { font-family: inherit; font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.uc-table tr.is-soon td { opacity: 0.56; color: #6b7280; background: #fafafa; }
.uc-table tr.is-soon .uc-mid-chip { color: #6b7280; background: #f3f4f6; border-color: #e5e7eb; cursor: default; }
.uc-btn-soon { background: #f2f4f8; color: #6b7280; border-color: #e5e7eb; cursor: not-allowed; box-shadow: none; }
.uc-btn-soon:hover { transform: none; background: #f2f4f8; color: #6b7280; border-color: #e5e7eb; }
.uc-mid-chip {
  font-family: var(--mono); font-size: 12px; background: var(--subtle); color: var(--ink-2);
  padding: 4px 8px; border-radius: 7px; border: 1px solid #e2e5ec; cursor: pointer; display: inline-block;
}
.uc-mid-chip:hover { background: #eef2ff; border-color: #a5b4fc; color: var(--violet); }

/* Tables, Playground, Billing & Auth Gate */
.uc-table-wrap { overflow-x: auto; }
.uc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.uc-table th { text-align: left; padding: 10px 12px; font-size: 11px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--line); background: #f9fafb; }
.uc-table td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.uc-table tr:hover td { background: #fafafa; }
.uc-num { text-align: right !important; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.uc-pg-out {
  min-height: 210px; max-height: 380px; overflow-y: auto; background: var(--bg);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px; font-size: 13.5px;
  line-height: 1.65; margin-bottom: 12px; white-space: pre-wrap; color: var(--ink-2);
}
.uc-plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.uc-plan-card {
  background: #ffffff; border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.uc-plan-card.hot { border-color: #a5b4fc; background: linear-gradient(180deg, rgba(90,47,214,0.04) 0%, #ffffff 42%); box-shadow: 0 12px 30px -14px rgba(90,47,214,0.22); }

/* Standalone Aurora Auth Gate (hidden by default so authed redirects never flash) */
.uc-gate {
  position: fixed; inset: 0; z-index: 99; display: none; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(46% 60% at 15% 45%, rgba(165, 132, 255, 0.34) 0%, transparent 72%),
    radial-gradient(40% 56% at 50% 52%, rgba(110, 231, 183, 0.25) 0%, transparent 72%),
    radial-gradient(46% 60% at 88% 45%, rgba(253, 164, 175, 0.34) 0%, transparent 72%),
    #f7f7f8;
}
.uc-gate-card {
  width: 100%; max-width: 440px; background: #ffffff; border: 1px solid var(--line);
  border-radius: 24px; overflow: hidden; box-shadow: 0 30px 76px -18px rgba(15, 23, 42, 0.22);
}
.uc-gate-head {
  padding: 26px 26px 18px; text-align: center; border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fafaff 0%, #ffffff 100%);
}
.uc-gate-body { padding: 20px 24px 24px; }
.uc-tabs-inline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--subtle); padding: 4px; border-radius: 999px; border: 1px solid var(--line); margin-bottom: 14px; }
.uc-tabs-inline button { height: 34px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; transition: all .15s; }
.uc-tabs-inline button.on { background: #ffffff; color: var(--ink); font-weight: 800; box-shadow: 0 2px 6px rgba(20, 20, 43, 0.09); }

.uc-toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 120; background: #0a0a0a; color: #ffffff;
  padding: 10px 18px; border-radius: 999px; font-size: 12.5px; font-weight: 700; display: none;
  box-shadow: 0 14px 34px rgba(10, 10, 10, 0.28);
}

/* Tactile Press & Accessibility Focus */
.uc-btn:active, .uc-pill-tab:active, .uc-nav-btn:active, .uc-mbnav-btn:active { transform: scale(0.975); }
.uc-btn:focus-visible, .uc-pill-tab:focus-visible, .uc-nav-btn:focus-visible, .uc-mbnav-btn:focus-visible {
  outline: 2px solid var(--violet); outline-offset: 2px;
}

/* Mobile-only topbar brand, icon buttons & native fixed Bottom Tab Bar (hidden on desktop) */
.uc-mob-brand, .uc-mob-icon-btn, .uc-mbnav { display: none; }

@media (max-width: 1040px) {
  .uc-kpi-grid, .uc-plan-grid { grid-template-columns: repeat(2, 1fr); }
  .uc-cred-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .uc-shell { grid-template-columns: minmax(0, 1fr); }
  .uc-rail { display: none; }
  .uc-hide-mob { display: none !important; }
  .uc-topbar {
    padding: 10px 14px; gap: 8px; flex-wrap: nowrap;
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .uc-topbar-l { gap: 8px; min-width: 0; flex: 1; flex-wrap: nowrap; }
  .uc-topbar-r { gap: 6px; flex-wrap: nowrap; flex-shrink: 0; }
  .uc-mob-brand { display: inline-flex; align-items: center; flex-shrink: 0; }
  .uc-mob-brand img { width: 26px; height: 26px; border-radius: 7px; display: block; }
  #uc-page-title { font-size: 15.5px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #top-pool2-badge { padding: 3px 8px; font-size: 11px; white-space: nowrap; }
  .uc-top-upgrade { height: 32px; padding: 0 11px; font-size: 11.5px; }
  .uc-mob-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
    background: #ffffff; color: var(--muted); cursor: pointer; padding: 0; flex-shrink: 0;
  }
  .uc-mob-icon-btn svg { width: 16px; height: 16px; }
  .uc-mob-icon-btn.active { background: #0a0a0a; color: #ffffff; border-color: #0a0a0a; }
  .uc-mob-icon-btn.danger { color: var(--danger); border-color: #fecaca; background: #fef2f2; }
  .uc-body { padding: 14px 14px calc(86px + env(safe-area-inset-bottom)); }
  .uc-mdir { grid-template-columns: 1fr; }
  .uc-vrail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
  .uc-vbtn { width: auto; white-space: nowrap; gap: 6px; }

  /* Native Fixed Glassmorphic Bottom Tab Bar */
  .uc-mbnav {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px -10px rgba(15, 23, 42, 0.12);
  }
  .uc-mbnav-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 48px; border: 0; border-radius: 12px; background: transparent;
    color: var(--muted-2); font-size: 10.5px; font-weight: 700; cursor: pointer; padding: 4px 2px;
    transition: color .15s, background .15s;
  }
  .uc-mbnav-btn svg { width: 20px; height: 20px; }
  .uc-mbnav-btn.active { color: var(--violet); background: #f5f3ff; }
  .uc-toast {
    left: 16px; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom));
    text-align: center;
  }
}
@media (max-width: 720px) {
  /* Prevent iOS Safari auto-zoom on form focus */
  .uc-input, .uc-select { font-size: 16px; min-height: 42px; }
  .uc-gate { padding: 14px; align-items: flex-start; overflow-y: auto; }
  .uc-gate-card { margin: auto 0; border-radius: 20px; }
  .uc-card { padding: 16px 14px; border-radius: 16px; margin-bottom: 14px; }
  .uc-card-head { margin-bottom: 12px; }
  /* Compact 2x2 KPI Grid on Mobile so Quick Connect sits right above the fold */
  .uc-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .uc-kpi { padding: 13px 12px; border-radius: 14px; }
  .uc-kpi-label { font-size: 10px; letter-spacing: 0.04em; }
  .uc-kpi-link { font-size: 10.5px; }
  .uc-kpi-val { font-size: 17.5px; margin-top: 5px; }
  .uc-kpi-sub { font-size: 11px; line-height: 1.35; }
  .uc-plan-grid { grid-template-columns: 1fr; gap: 12px; }
  .uc-plan-card .uc-btn, .uc-mob-full { width: 100%; min-height: 44px; font-size: 13.5px; }
  .uc-pg-controls { width: 100%; }
  .uc-pg-controls select { width: 100%; max-width: 100% !important; }
  .uc-pg-out { min-height: 170px; max-height: 300px; padding: 13px; }
  .uc-pg-form { flex-direction: column; }
  .uc-pg-form .uc-btn { width: 100%; min-height: 44px; }
  #uc-mdir-search, #new-key-name { width: 100% !important; }
  #uc-tab-settings > div { grid-template-columns: 1fr !important; }
  .uc-cred-k .uc-btn-sm { height: 30px !important; padding: 0 11px !important; font-size: 11.5px !important; }
  /* Stacked Mobile Cards for ALL Console Tables (Models, Keys, Logs, Invoices) */
  .uc-table thead { display: none; }
  .uc-table, .uc-table tbody, .uc-table tr, .uc-table td { display: block; width: 100%; }
  .uc-table tr {
    padding: 12px 12px; border-bottom: 1px solid var(--line);
    display: grid; gap: 7px; background: #ffffff;
  }
  .uc-table td { padding: 0; border: 0; text-align: left !important; }
  .uc-table td[data-label]::before {
    content: attr(data-label) ': ';
    font-size: 11px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.03em;
  }
  .uc-mid-chip { word-break: break-all; max-width: 100%; font-size: 11.5px; }
}

/* Upgraded Playground Studio — Multi-Turn, Compare A vs B, Markdown & Thinking Accordion */
.pg-mode-seg { display: flex; gap: 3px; background: var(--subtle); padding: 3px; border-radius: 999px; border: 1px solid var(--line); }
.pg-mode-seg .uc-pill-tab { height: 28px; border: 0; padding: 0 12px; }
.pg-params-drawer, .pg-code-drawer {
  background: #f9fafb; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  margin-bottom: 12px; gap: 10px;
}
.pg-thread {
  display: flex; flex-direction: column; gap: 12px; min-height: 300px; max-height: 480px;
  overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px;
}
.pg-empty { margin: auto; text-align: center; max-width: 560px; padding: 14px 6px; }
.pg-empty-title { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.pg-empty-sub { font-size: 13px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.pg-chip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.pg-chip-card {
  padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: #ffffff;
  color: var(--ink-2); font-size: 12.5px; font-weight: 700; cursor: pointer; text-align: left;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.pg-chip-card:hover { border-color: #a5b4fc; transform: translateY(-1px); box-shadow: var(--shadow-sm); color: var(--violet); }
.pg-msg { display: flex; flex-direction: column; gap: 5px; }
.pg-msg.user { align-items: flex-end; }
.pg-msg-head { display: flex; align-items: center; gap: 8px; }
.pg-model-tag { font-size: 11.5px; font-weight: 700; color: var(--violet); background: #f5f3ff; border: 1px solid #e0e7ff; padding: 2px 8px; border-radius: 999px; }
.pg-live-dot { font-family: var(--mono); font-size: 10px; font-weight: 800; color: #047857; background: #def2e6; padding: 2px 7px; border-radius: 999px; }
.pg-msg-bubble { max-width: 100%; border-radius: 14px; padding: 12px 15px; font-size: 13.5px; line-height: 1.62; }
.pg-msg-bubble.user { background: #0a0a0a; color: #ffffff; max-width: 82%; white-space: pre-wrap; }
.pg-msg-bubble.assistant { background: #ffffff; border: 1px solid var(--line); color: var(--ink-2); }
.pg-md .pg-p { margin: 0 0 8px; }
.pg-md .pg-p:last-child { margin-bottom: 0; }
.pg-md .pg-h { margin: 10px 0 6px; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.pg-md .pg-ul, .pg-md .pg-ol { margin: 6px 0 10px; padding-left: 20px; }
.pg-md li { margin-bottom: 4px; }
.pg-ic { font-family: var(--mono); font-size: 12px; background: #f2f4f8; color: var(--violet); padding: 1px 5px; border-radius: 5px; }
.pg-code-wrap { margin: 10px 0; border-radius: 12px; overflow: hidden; border: 1px solid #1e293b; background: #0d1117; }
.pg-code-head {
  display: flex; align-items: center; justify-content: space-between; padding: 6px 12px;
  background: #161b22; border-bottom: 1px solid #262c36; font-family: var(--mono); font-size: 11px; color: #94a3b8;
}
.pg-code-copy {
  border: 1px solid #334155; background: #0f172a; color: #e2e8f0; border-radius: 6px;
  padding: 2px 9px; font-size: 11px; font-weight: 700; cursor: pointer;
}
.pg-code-copy:hover { border-color: #818cf8; color: #ffffff; }
.pg-code-pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 12px; line-height: 1.58; color: #e2e8f0; }
.pg-think {
  margin-bottom: 10px; border: 1px solid #e0e7ff; background: #f8f7ff; border-radius: 10px; padding: 7px 11px; font-size: 12px;
}
.pg-think summary { cursor: pointer; font-weight: 700; color: var(--violet); display: flex; align-items: center; gap: 6px; list-style: none; }
.pg-think-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); }
.pg-think-dot.live { animation: pgBlink 1s infinite; }
.pg-think-body { margin-top: 7px; color: var(--muted); white-space: pre-wrap; font-family: var(--mono); font-size: 11.5px; line-height: 1.5; max-height: 160px; overflow-y: auto; }
.pg-cursor { display: inline-block; width: 7px; height: 15px; background: var(--violet); vertical-align: middle; margin-left: 2px; animation: pgBlink .85s infinite; border-radius: 1px; }
@keyframes pgBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.15; } }
.pg-meta-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted);
  padding: 2px 4px;
}
.pg-meta-pool { padding: 2px 7px; border-radius: 999px; font-weight: 700; font-size: 10.5px; }
.pg-meta-pool.p1 { background: #def2e6; color: #047857; }
.pg-meta-pool.p2 { background: #eaf4ff; color: #1d4ed8; }
.pg-meta-spacer { flex: 1; }
.pg-mini-btn {
  border: 1px solid var(--line); background: #ffffff; color: var(--muted); border-radius: 7px;
  padding: 3px 8px; font-size: 11px; font-weight: 700; cursor: pointer;
}
.pg-mini-btn:hover { color: var(--ink); border-color: #cbd5e1; }
.pg-compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pg-cmp-col {
  border: 1px solid var(--line); border-radius: 14px; background: #ffffff; overflow: hidden;
  display: flex; flex-direction: column; min-height: 290px; max-height: 440px;
}
.pg-cmp-bar {
  padding: 9px 12px; background: #f9fafb; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.pg-cmp-meta { font-size: 11.5px; color: var(--muted); }
.pg-cmp-out { padding: 13px 14px; overflow-y: auto; flex: 1; font-size: 13px; line-height: 1.6; }
.pg-cmp-note { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.pg-link-btn { background: none; border: 0; padding: 0; color: var(--violet); font-weight: 700; cursor: pointer; text-decoration: underline; font-size: 12px; }
.pg-conv-strip {
  margin-top: 10px; padding: 11px 14px; border-radius: 12px; border: 1px solid #ddd6fe;
  background: linear-gradient(90deg, #f5f3ff 0%, #eff6ff 100%);
  align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2);
}
.pg-conv-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pg-recover { padding: 12px 14px; border-radius: 12px; font-size: 13px; display: grid; gap: 10px; }
.pg-recover.warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.pg-recover.err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.pg-recover-acts { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .pg-chip-grid, .pg-compare-grid { grid-template-columns: 1fr; }
  .pg-thread { min-height: 240px; max-height: 380px; padding: 12px; }
  .pg-msg-bubble.user { max-width: 92%; }
  .pg-cmp-col { min-height: 190px; max-height: 300px; }
}
