@font-face {
      font-family: "Anthropic Sans";
      src: url("fonts/AnthropicSans-Romans-Variable-25x258.ttf") format("truetype");
      font-weight: 300 800;
      font-style: normal;
      font-display: swap;
    }

    @font-face {
      font-family: "Anthropic Sans";
      src: url("fonts/AnthropicSans-Italics-Variable-25x258.ttf") format("truetype");
      font-weight: 300 800;
      font-style: italic;
      font-display: swap;
    }

    @font-face {
      font-family: "Anthropic Serif";
      src: url("fonts/AnthropicSerif-Romans-Variable-25x258.ttf") format("truetype");
      font-weight: 300 800;
      font-style: normal;
      font-display: swap;
    }

    @font-face {
      font-family: "Anthropic Serif";
      src: url("fonts/AnthropicSerif-Italics-Variable-25x258.ttf") format("truetype");
      font-weight: 300 800;
      font-style: italic;
      font-display: swap;
    }

    :root {
      --bg: #f5f8fa;
      --sidebar: #121426;
      --sidebar-soft: #1b1f35;
      --sidebar-muted: #8b92b5;
      --panel: #ffffff;
      --panel-soft: #f9fafb;
      --surface: #f5f8fa;
      --surface-raised: #ffffff;
      --text: #181c32;
      --muted: #7e8299;
      --line: #e4e6ef;
      --brand: #3e97ff;
      --brand-strong: #1b84ff;
      --brand-soft: #eef6ff;
      --accent: #50cd89;
      --danger: #f1416c;
      --warn: #ffc700;
      --soft: #f1f3f8;
      --shadow: 0 10px 30px rgba(76, 87, 125, .08);
      color-scheme: light;
      font-family: "Anthropic Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }
    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    [hidden] { display: none !important; }
    body {
      margin: 0;
      min-height: 100vh;
      background: var(--bg);
      color: var(--text);
    }
    button, input, select, textarea { font: inherit; }
    button {
      min-height: 38px;
      border: 0;
      border-radius: 8px;
      padding: 0 14px;
      background: var(--brand);
      color: #fff;
      font-weight: 700;
      cursor: pointer;
      white-space: nowrap;
      box-shadow: 0 8px 18px rgba(62, 151, 255, .18);
      transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
    }
    button:hover { background: var(--brand-strong); box-shadow: 0 10px 24px rgba(62, 151, 255, .24); }
    button:active { transform: translateY(1px); }
    button.secondary {
      background: var(--soft);
      color: #3f4254;
      border: 1px solid transparent;
      box-shadow: none;
    }
    button.secondary:hover { background: #e9edf6; color: var(--brand-strong); }
    button.danger {
      background: #fff5f8;
      color: var(--danger);
      border: 1px solid #ffd5df;
      box-shadow: none;
    }
    button.danger:hover { background: #f1416c; color: #fff; }
    button.ghost { background: transparent; color: var(--brand-strong); border: 1px solid transparent; padding: 0 6px; box-shadow: none; }
    button:disabled { opacity: .6; cursor: not-allowed; }
    input, select, textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px 12px;
      background: var(--surface-raised);
      color: var(--text);
      outline: none;
      transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
    }
    input:focus, select:focus, textarea:focus {
      border-color: rgba(62, 151, 255, .52);
      box-shadow: 0 0 0 3px rgba(62, 151, 255, .12);
    }
    input::placeholder, textarea::placeholder { color: #a1a5b7; }
    textarea { min-height: 78px; resize: vertical; }
    h1, h2, h3 { margin: 0; letter-spacing: 0; }
    h1 { font-size: 28px; }
    h2 { font-size: 22px; }
    h3 { font-size: 15px; }
    p { color: var(--muted); margin: 6px 0 0; }
    .login {
      min-height: 100vh;
      display: grid;
      place-items: center;
      padding: 24px;
      background:
        radial-gradient(circle at 20% 16%, rgba(62, 151, 255, .18), transparent 28rem),
        linear-gradient(135deg, #f7faff 0%, #eef3fb 100%);
    }
    .login-card, .panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
    }
    .login-card {
      width: min(430px, 100%);
      padding: 28px;
      border: 0;
      box-shadow: 0 18px 60px rgba(76, 87, 125, .16);
    }
    .field { display: grid; gap: 7px; margin-top: 12px; }
    .field.compact { margin-top: 0; }
    label { color: #5e6278; font-size: 12px; font-weight: 750; text-transform: uppercase; }
    .check-field {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-top: 12px;
      color: #5e6278;
      font-size: 13px;
      font-weight: 700;
      text-transform: none;
    }
    .check-field input { width: auto; }
    .row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
    .app {
      min-height: 100vh;
      display: grid;
      grid-template-columns: 282px minmax(0, 1fr);
      background: var(--bg);
    }
    .admin-sidebar {
      position: sticky;
      top: 0;
      align-self: start;
      min-height: 100vh;
      padding: 22px 18px;
      background: var(--sidebar);
      color: #fff;
      display: flex;
      flex-direction: column;
      gap: 20px;
    }
    .sidebar-brand {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 0 8px 14px;
      border-bottom: 1px solid rgba(255, 255, 255, .08);
    }
    .brand-mark {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      background: linear-gradient(135deg, var(--brand), #7c4dff);
      color: #fff;
      font-size: 13px;
      font-weight: 850;
      letter-spacing: 0;
    }
    .brand-title { color: #fff; font-size: 16px; font-weight: 800; line-height: 1.1; }
    .brand-subtitle { color: var(--sidebar-muted); font-size: 12px; margin-top: 4px; }
    .sidebar-section { display: grid; gap: 6px; }
    .sidebar-heading {
      padding: 0 10px 4px;
      color: #5d658f;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    .sidebar-link {
      min-height: 38px;
      display: grid;
      grid-template-columns: 28px 1fr auto;
      align-items: center;
      gap: 9px;
      padding: 0 10px;
      border-radius: 8px;
      color: #aeb5d4;
      text-decoration: none;
      font-size: 13px;
      font-weight: 700;
      transition: background .16s ease, color .16s ease;
    }
    .sidebar-link:hover, .sidebar-link:focus {
      background: var(--sidebar-soft);
      color: #fff;
      outline: none;
    }
    .sidebar-link.active {
      background: rgba(62, 151, 255, .14);
      color: #fff;
    }
    .sidebar-link.active .nav-icon { background: var(--brand); }
    .nav-icon {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      background: rgba(255, 255, 255, .07);
      color: #fff;
      font-size: 11px;
      font-weight: 850;
    }
    .nav-count {
      color: #687098;
      font-size: 11px;
      font-weight: 800;
    }
    .sidebar-card {
      margin-top: auto;
      padding: 14px;
      border-radius: 8px;
      background: linear-gradient(180deg, rgba(62, 151, 255, .18), rgba(62, 151, 255, .08));
      border: 1px solid rgba(62, 151, 255, .22);
    }
    .sidebar-card strong {
      display: block;
      color: #fff;
      font-size: 13px;
    }
    .sidebar-card span {
      display: block;
      margin-top: 6px;
      color: #b9c3e7;
      font-size: 12px;
      line-height: 1.45;
    }
    .workspace {
      min-width: 0;
      display: grid;
      grid-template-rows: auto 1fr;
    }
    header {
      position: sticky;
      top: 0;
      z-index: 4;
      background: rgba(255, 255, 255, .9);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border-bottom: 1px solid var(--line);
      padding: 16px 28px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
    }
    .breadcrumb {
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
      text-transform: uppercase;
    }
    .admin-header-tools {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 12px;
      flex-wrap: wrap;
      min-width: min(620px, 100%);
    }
    .admin-module-search {
      width: min(340px, 34vw);
      min-width: 220px;
    }
    .admin-module-search input {
      min-height: 38px;
      border-color: #dfe3ee;
      background: #f9fbfd;
    }
    main {
      padding: 28px;
      display: grid;
      gap: 18px;
      align-content: start;
    }
    .admin-section { scroll-margin-top: 92px; }
    .section-title {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 16px;
      margin-top: 6px;
    }
    .section-title:first-child { margin-top: 0; }
    .section-title .eyebrow {
      display: block;
      margin-bottom: 4px;
      color: var(--brand-strong);
      font-size: 11px;
      font-weight: 850;
      letter-spacing: .08em;
      text-transform: uppercase;
    }
    .section-title h2 {
      font-size: 24px;
      line-height: 1.18;
      color: var(--text);
    }
    .section-title p {
      max-width: 760px;
      font-size: 13px;
      line-height: 1.45;
    }
    .section-chip {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      padding: 0 10px;
      border-radius: 999px;
      background: var(--brand-soft);
      color: var(--brand-strong);
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }
    .metrics {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 14px;
    }
    .panel { padding: 18px; min-width: 0; }
    .panel-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 10px;
    }
    .metric {
      position: relative;
      overflow: hidden;
    }
    .metric::after {
      content: "";
      position: absolute;
      right: -20px;
      top: -24px;
      width: 86px;
      height: 86px;
      border-radius: 999px;
      background: var(--brand-soft);
    }
    .metric strong {
      position: relative;
      z-index: 1;
      font-size: 29px;
      display: block;
      margin-top: 7px;
      color: #181c32;
    }
    .metric small {
      position: relative;
      z-index: 1;
      display: block;
      margin-top: 6px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 750;
      line-height: 1.35;
    }
    .dashboard-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
      gap: 18px;
      align-items: start;
      margin-top: 18px;
    }
    .summary-list {
      display: grid;
      gap: 10px;
      margin-top: 12px;
    }
    .summary-list.compact { gap: 8px; }
    .summary-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto auto;
      gap: 12px;
      align-items: center;
      min-height: 44px;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel-soft);
    }
    .summary-list.compact .summary-row {
      grid-template-columns: minmax(0, 1fr) auto;
      min-height: 38px;
      padding: 8px 10px;
    }
    .summary-row span {
      color: #5e6278;
      font-size: 13px;
      font-weight: 700;
      min-width: 0;
    }
    .summary-row strong {
      color: #181c32;
      font-size: 14px;
      font-weight: 850;
      white-space: nowrap;
    }
    .summary-row em {
      color: var(--brand-strong);
      font-size: 13px;
      font-style: normal;
      font-weight: 850;
      white-space: nowrap;
    }
    .dashboard-user-report {
      margin-top: 18px;
    }
    .dashboard-report-tools {
      justify-content: flex-end;
      min-width: 260px;
    }
    .dashboard-report-tools .muted {
      min-width: 86px;
      text-align: right;
      font-size: 12px;
      font-weight: 750;
    }
    .dashboard-table-scroll {
      width: 100%;
      overflow: auto;
    }
    .dashboard-table-scroll table {
      min-width: 960px;
    }
    .dashboard-user-cell {
      display: grid;
      gap: 3px;
    }
    .dashboard-user-cell strong {
      color: var(--text);
      font-size: 13px;
    }
    .dashboard-user-cell span,
    .dashboard-user-meta {
      color: var(--muted);
      font-size: 12px;
    }
    .money-text {
      color: var(--brand-strong);
      font-weight: 850;
      white-space: nowrap;
    }
    .credit-positive {
      color: #0f9f63;
      font-weight: 850;
      white-space: nowrap;
    }
    .credit-negative {
      color: var(--danger);
      font-weight: 850;
      white-space: nowrap;
    }
    .grid {
      display: grid;
      grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
      gap: 18px;
      align-items: start;
    }
    .pricing-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(360px, .85fr);
      gap: 18px;
      align-items: start;
    }
    table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      margin-top: 10px;
      font-size: 13px;
    }
    th, td {
      border-bottom: 1px solid var(--line);
      text-align: left;
      padding: 12px 10px;
      vertical-align: top;
    }
    th {
      color: #a1a5b7;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: .02em;
      background: var(--panel-soft);
      font-weight: 800;
    }
    tbody tr:hover td { background: #fcfcfd; }
    .table-wrap { width: 100%; overflow-x: auto; }
    .pill {
      display: inline-flex;
      min-height: 23px;
      align-items: center;
      border-radius: 999px;
      padding: 0 8px;
      background: #e8fff3;
      color: var(--accent);
      font-weight: 750;
      font-size: 12px;
    }
    .pill.blocked { background: #fff5f8; color: var(--danger); }
    .pill.queued { background: #fff8dd; color: #b68600; }
    .pill.failed { background: #fff5f8; color: var(--danger); }
    .status { min-height: 20px; color: var(--muted); font-size: 13px; }
    .danger-text { color: var(--danger); }
    .ok-text { color: var(--accent); }
    .mini-input { width: 118px; }
    .inline-select { width: auto; min-width: 104px; padding: 7px 9px; }
    .split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .price-row { display: grid; grid-template-columns: 1.2fr 1.3fr .9fr .9fr auto; gap: 8px; align-items: end; margin-top: 8px; }
    .model-row { display: grid; grid-template-columns: 1fr 112px auto; gap: 8px; align-items: end; margin-top: 8px; }
    .model-price-frame {
      margin-top: 12px;
      padding: 12px;
      border: 1px solid rgba(62, 151, 255, .24);
      border-radius: 8px;
      background:
        linear-gradient(180deg, rgba(62, 151, 255, .06), rgba(62, 151, 255, .018)),
        #fff;
    }
    .model-price-frame > summary {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      list-style: none;
      min-height: 40px;
      padding: 0 2px;
      cursor: pointer;
      user-select: none;
      font-weight: 750;
    }
    .model-price-frame > summary::-webkit-details-marker { display: none; }
    .model-price-summary {
      color: var(--muted);
      font-size: 13px;
      font-weight: 650;
    }
    .model-caret {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      border-radius: 999px;
      color: var(--brand-strong);
      background: var(--brand-soft);
      transition: transform .16s ease, background .16s ease;
    }
    .model-price-frame[open] .model-caret {
      transform: rotate(90deg);
      background: #dceeff;
    }
    .model-list-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 100px 56px;
      gap: 8px;
      margin: 10px 8px 2px;
      color: #5e6278;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
    }
    #modelsEditor {
      max-height: 420px;
      overflow-y: auto;
      padding-right: 4px;
    }
    .model-price-frame .model-row {
      grid-template-columns: minmax(0, 1fr) 100px 56px;
      align-items: center;
      padding: 8px;
      border: 1px solid transparent;
      border-radius: 8px;
      background: #fbfcfe;
      cursor: pointer;
      transition: border-color .16s ease, background .16s ease, transform .16s ease;
    }
    .model-price-frame .model-row:hover {
      border-color: rgba(62, 151, 255, .34);
      background: var(--brand-soft);
      transform: translateY(-1px);
    }
    .model-price-frame .model-row input { cursor: text; }
    .model-price-frame .model-row input:disabled { cursor: pointer; }
    .model-price-frame .model-row button { cursor: pointer; }
    .model-price-frame .model-row .field label { display: none; }
    .model-price-frame .model-row .field { margin-top: 0; }
    .model-price-frame .model-row input { padding: 7px 10px; }
    .model-price-frame .model-row button { min-height: 34px; padding: 0 10px; }
    .model-price-frame .model-add-row {
      border-color: var(--line);
      background: var(--panel-soft);
    }
    .model-add-row {
      margin-top: 10px;
    }
    .model-add-row .field label { display: block; }
    .public-model-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 10px;
      margin-top: 12px;
    }
    .public-model-card {
      display: grid;
      gap: 8px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--surface);
    }
    .public-model-card.featured {
      border-color: rgba(62, 151, 255, .38);
      background: linear-gradient(180deg, rgba(62, 151, 255, .08), rgba(62, 151, 255, .018)), var(--surface-raised);
    }
    .public-model-card code {
      font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
      color: #181c32;
      overflow-wrap: anywhere;
    }
    .public-model-card p {
      margin: 0;
      font-size: 12px;
      line-height: 1.45;
    }
    .public-model-card .model-meta {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 750;
    }
    .tool-price-block {
      margin-top: 16px;
      padding-top: 14px;
      border-top: 1px solid var(--line);
    }
    .ops-grid {
      display: grid;
      grid-template-columns: minmax(220px, .75fr) minmax(0, 1.25fr);
      gap: 14px;
      align-items: stretch;
    }
    .toggle-card {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 10px;
      align-items: start;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--surface);
      text-transform: none;
      font-size: 14px;
      font-weight: 700;
    }
    .toggle-card input { width: auto; margin-top: 2px; }
    .toggle-card span { display: block; }
    .toggle-card small {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 500;
      line-height: 1.45;
    }
    .secret-note {
      margin-top: 7px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }
    .orchestrator-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
      color: var(--muted);
      font-size: 12px;
    }
    .system-instructions-box {
      display: grid;
      gap: 12px;
    }
    .system-instructions-box textarea {
      min-height: 180px;
      line-height: 1.5;
    }
    .system-instructions-hint {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }
    .user-controls {
      display: grid;
      grid-template-columns: minmax(220px, 1fr) minmax(140px, .35fr);
      gap: 10px;
      align-items: end;
      margin: 12px 0 4px;
    }
    .ledger-controls {
      display: grid;
      grid-template-columns: minmax(220px, 1.5fr) minmax(150px, .8fr) minmax(170px, .8fr) minmax(140px, .6fr);
      gap: 10px;
      align-items: end;
      margin: 12px 0 4px;
    }
    .chat-controls {
      display: grid;
      grid-template-columns: minmax(220px, 1fr);
      gap: 10px;
      align-items: end;
      margin: 12px 0 4px;
    }
    .ledger-footer {
      justify-content: space-between;
      margin-top: 12px;
      color: var(--muted);
      font-size: 13px;
    }
    .usage-content { max-width: 560px; min-width: 320px; }
    .usage-text {
      margin-top: 8px;
      padding: 9px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--surface);
      white-space: pre-wrap;
      overflow-wrap: anywhere;
      color: var(--text);
      line-height: 1.45;
      max-height: 320px;
      overflow: auto;
    }
    details summary { cursor: pointer; color: var(--brand-strong); font-weight: 700; }
    a.link { color: var(--brand-strong); font-weight: 700; text-decoration: none; }
    a.link:hover { text-decoration: underline; }
    .muted { color: var(--muted); }
    .empty {
      padding: 18px;
      border: 1px dashed var(--line);
      border-radius: 8px;
      color: var(--muted);
      text-align: center;
      margin-top: 10px;
      background: var(--panel-soft);
    }
    @media (max-width: 1180px) {
      .app { grid-template-columns: 1fr; }
      .admin-sidebar {
        position: static;
        min-height: auto;
        padding: 16px;
      }
      .sidebar-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .sidebar-heading { grid-column: 1 / -1; }
      .sidebar-card { margin-top: 0; }
      .metrics, .dashboard-grid, .grid, .pricing-grid { grid-template-columns: 1fr; }
      header { align-items: flex-start; flex-direction: column; }
      .admin-header-tools { justify-content: flex-start; min-width: 0; width: 100%; }
      .admin-module-search { width: 100%; }
    }
    @media (max-width: 720px) {
      main, header { padding: 16px; }
      .admin-sidebar { gap: 12px; padding: 12px; }
      .sidebar-brand { padding-bottom: 10px; }
      .brand-mark { width: 34px; height: 34px; }
      .sidebar-section { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
      .sidebar-heading { padding-top: 2px; }
      .sidebar-link {
        min-height: 34px;
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 7px;
        padding: 0 8px;
        font-size: 12px;
      }
      .nav-icon { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
      .nav-count { display: none; }
      .sidebar-card { display: none; }
      .section-title { align-items: flex-start; flex-direction: column; }
      .split-fields, .price-row, .model-row, .ops-grid, .summary-row, .user-controls, .ledger-controls { grid-template-columns: 1fr; }
      .usage-content { min-width: 260px; }
    }
    @media (max-width: 360px) {
      .sidebar-section { grid-template-columns: 1fr; }
    }
    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      *, *::before, *::after { transition-duration: .01ms !important; }
    }

    /* Metronic demo1-inspired admin refresh. Keep this block last so it can
       reskin the existing static admin pages without changing data logic. */
    :root {
      --bg: #f5f8fa;
      --sidebar: #1e1e2d;
      --sidebar-soft: #2b2b40;
      --sidebar-hover: #2a2a3c;
      --sidebar-muted: #7e8299;
      --panel: #ffffff;
      --panel-soft: #f9fafb;
      --surface: #f5f8fa;
      --surface-raised: #ffffff;
      --text: #181c32;
      --muted: #7e8299;
      --line: #eff2f5;
      --brand: #009ef7;
      --brand-strong: #0095e8;
      --brand-soft: #f1faff;
      --accent: #50cd89;
      --danger: #f1416c;
      --warn: #ffc700;
      --soft: #f5f8fa;
      --shadow: 0 0 20px rgba(76, 87, 125, .06);
      --header-height: 70px;
      --aside-width: 265px;
      font-family: "Anthropic Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    body {
      min-height: 100dvh;
      background: var(--bg);
      color: var(--text);
      -webkit-font-smoothing: antialiased;
      text-rendering: geometricPrecision;
    }

    button {
      min-height: 36px;
      border-radius: 8px;
      padding: 0 15px;
      background: var(--brand);
      box-shadow: none;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0;
    }

    button:hover {
      background: var(--brand-strong);
      box-shadow: none;
    }

    button.secondary {
      background: #f5f8fa;
      color: #5e6278;
      border: 1px solid transparent;
    }

    button.secondary:hover {
      background: #eef3f7;
      color: var(--brand-strong);
    }

    button.danger {
      background: #fff5f8;
      color: var(--danger);
      border-color: #ffe2e9;
    }

    input, select, textarea {
      min-height: 42px;
      border-color: #e4e6ef;
      border-radius: 8px;
      background: #f9fafb;
      color: #3f4254;
      font-size: 13px;
      font-weight: 600;
    }

    input:focus, select:focus, textarea:focus {
      border-color: #b5dcff;
      background: #fff;
      box-shadow: 0 0 0 3px rgba(0, 158, 247, .1);
    }

    h2 {
      font-size: 21px;
      font-weight: 800;
      line-height: 1.2;
      color: var(--text);
    }

    h3 {
      font-size: 15px;
      font-weight: 800;
      color: var(--text);
    }

    p {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }

    .login {
      background:
        linear-gradient(135deg, rgba(0, 158, 247, .08), transparent 34%),
        linear-gradient(180deg, #f5f8fa 0%, #eef3f7 100%);
    }

    .login-card {
      border: 0;
      border-radius: 8px;
      box-shadow: 0 22px 70px rgba(76, 87, 125, .16);
    }

    .app {
      grid-template-columns: var(--aside-width) minmax(0, 1fr);
      background: var(--bg);
    }

    .admin-sidebar {
      position: sticky;
      top: 0;
      min-height: 100dvh;
      height: 100dvh;
      padding: 0 0 18px;
      overflow-y: auto;
      background: var(--sidebar);
      border-right: 0;
      gap: 0;
      scrollbar-width: thin;
      scrollbar-color: #474761 transparent;
    }

    .admin-sidebar::-webkit-scrollbar { width: 6px; }
    .admin-sidebar::-webkit-scrollbar-thumb {
      background: #474761;
      border-radius: 999px;
    }

    .sidebar-brand {
      min-height: var(--header-height);
      padding: 0 22px;
      border-bottom: 1px solid rgba(255, 255, 255, .06);
    }

    .brand-mark {
      width: 38px;
      height: 38px;
      border-radius: 8px;
      background: #009ef7;
      box-shadow: 0 10px 24px rgba(0, 158, 247, .25);
      font-size: 12px;
      letter-spacing: 0;
    }

    .brand-title {
      font-size: 15px;
      letter-spacing: 0;
    }

    .brand-subtitle {
      color: #7e8299;
      font-size: 11px;
      font-weight: 700;
    }

    .sidebar-section {
      display: grid;
      gap: 3px;
      padding: 16px 14px 0;
    }

    .sidebar-heading {
      padding: 0 11px 7px;
      color: #565674;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: .08em;
    }

    .sidebar-link {
      min-height: 40px;
      grid-template-columns: 30px minmax(0, 1fr) auto;
      gap: 10px;
      padding: 0 11px;
      border-radius: 8px;
      color: #9899ac;
      font-size: 13px;
      font-weight: 700;
    }

    .sidebar-link span:nth-child(2) {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .sidebar-link:hover,
    .sidebar-link:focus {
      background: var(--sidebar-hover);
      color: #fff;
    }

    .sidebar-link.active {
      background: var(--sidebar-soft);
      color: #fff;
    }

    .nav-icon {
      width: 30px;
      height: 30px;
      border-radius: 8px;
      background: rgba(255, 255, 255, .06);
      color: #92929f;
      font-size: 10px;
      font-weight: 800;
    }

    .sidebar-link:hover .nav-icon,
    .sidebar-link.active .nav-icon {
      background: rgba(0, 158, 247, .14);
      color: var(--brand);
    }

    .nav-count {
      min-width: 34px;
      min-height: 20px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      background: rgba(255, 255, 255, .045);
      color: #6d6d80;
      font-size: 10px;
      padding: 0 7px;
    }

    .sidebar-link.active .nav-count {
      color: #fff;
      background: rgba(0, 158, 247, .18);
    }

    .sidebar-card {
      margin: 18px 14px 0;
      padding: 15px;
      border-radius: 8px;
      border: 1px solid rgba(0, 158, 247, .16);
      background: rgba(0, 158, 247, .08);
    }

    .sidebar-card strong {
      color: #fff;
      font-size: 13px;
      font-weight: 800;
    }

    .sidebar-card span {
      color: #b5b5c3;
      font-size: 12px;
      line-height: 1.45;
    }

    .workspace {
      min-width: 0;
      background: var(--bg);
    }

    .admin-topbar {
      min-height: var(--header-height);
      padding: 0 28px;
      background: #fff;
      border-bottom: 1px solid var(--line);
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
    }

    .admin-topbar-title {
      min-width: 0;
      display: grid;
      gap: 2px;
    }

    .admin-topbar-title h2,
    #pageTitle {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .breadcrumb {
      color: #a1a5b7;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .04em;
    }

    #adminEmail {
      margin: 0;
      color: #7e8299;
      font-size: 12px;
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .admin-header-tools {
      min-width: 0;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      flex-wrap: nowrap;
    }

    .admin-module-search {
      position: relative;
      width: min(340px, 34vw);
      min-width: 240px;
      margin: 0;
      display: block;
      text-transform: none;
    }

    .admin-module-search input {
      height: 40px;
      min-height: 40px;
      padding-left: 38px;
      padding-right: 12px;
      border: 0;
      background: #f5f8fa;
      color: #5e6278;
      font-size: 12px;
      font-weight: 700;
    }

    .search-icon {
      position: absolute;
      left: 15px;
      top: 50%;
      width: 13px;
      height: 13px;
      border: 2px solid #a1a5b7;
      border-radius: 999px;
      transform: translateY(-55%);
      pointer-events: none;
      z-index: 1;
    }

    .search-icon::after {
      content: "";
      position: absolute;
      right: -5px;
      bottom: -5px;
      width: 6px;
      height: 2px;
      border-radius: 999px;
      background: #a1a5b7;
      transform: rotate(45deg);
      transform-origin: center;
    }

    .admin-module-results {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      z-index: 30;
      width: min(380px, 86vw);
      max-height: 360px;
      overflow: auto;
      padding: 8px;
      border: 1px solid #eff2f5;
      border-radius: 8px;
      background: #fff;
      box-shadow: 0 18px 50px rgba(76, 87, 125, .14);
    }

    .admin-module-results a {
      min-height: 46px;
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      padding: 7px 9px;
      border-radius: 8px;
      color: #3f4254;
      text-decoration: none;
    }

    .admin-module-results a:hover,
    .admin-module-results a:focus {
      background: var(--brand-soft);
      outline: none;
    }

    .module-result-icon {
      width: 34px;
      height: 34px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      background: var(--brand-soft);
      color: var(--brand);
      font-size: 10px;
      font-weight: 850;
    }

    .module-result-title {
      display: block;
      color: #181c32;
      font-size: 13px;
      font-weight: 800;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .module-result-meta {
      display: block;
      margin-top: 2px;
      color: #a1a5b7;
      font-size: 11px;
      font-weight: 700;
    }

    .topbar-chip {
      min-height: 34px;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      border-radius: 8px;
      padding: 0 10px;
      background: #e8fff3;
      color: #47be7d;
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }

    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 999px;
      background: #50cd89;
      box-shadow: 0 0 0 4px rgba(80, 205, 137, .16);
    }

    .button-with-icon {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
    }

    .button-with-icon .btn-icon {
      position: relative;
      width: 14px;
      height: 14px;
      display: inline-block;
      flex: 0 0 14px;
    }

    .refresh-action .btn-icon {
      border: 2px solid currentColor;
      border-right-color: transparent;
      border-radius: 999px;
    }

    .refresh-action .btn-icon::after {
      content: "";
      position: absolute;
      right: -2px;
      top: -2px;
      border-left: 5px solid currentColor;
      border-top: 4px solid transparent;
      border-bottom: 4px solid transparent;
      transform: rotate(20deg);
    }

    .logout-action .btn-icon::before {
      content: "";
      position: absolute;
      inset: 2px 5px 2px 1px;
      border: 2px solid currentColor;
      border-right: 0;
      border-radius: 3px 0 0 3px;
    }

    .logout-action .btn-icon::after {
      content: "";
      position: absolute;
      right: 0;
      top: 6px;
      width: 8px;
      height: 2px;
      border-radius: 999px;
      background: currentColor;
      box-shadow: 3px -3px 0 -1px currentColor, 3px 3px 0 -1px currentColor;
    }

    .admin-sidebar-toggle {
      display: none;
      width: 40px;
      height: 40px;
      min-height: 40px;
      padding: 0;
      border-radius: 8px;
      background: #f5f8fa;
      color: #5e6278;
      box-shadow: none;
    }

    .admin-sidebar-toggle span {
      display: block;
      width: 18px;
      height: 2px;
      margin: 4px auto;
      border-radius: 999px;
      background: currentColor;
    }

    .workspace-toolbar {
      min-height: 58px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 0 28px;
      background: #fff;
      border-bottom: 1px solid var(--line);
    }

    .workspace-toolbar > div {
      min-width: 0;
      display: grid;
      gap: 2px;
    }

    .toolbar-kicker {
      color: #a1a5b7;
      font-size: 10px;
      font-weight: 850;
      letter-spacing: .08em;
      text-transform: uppercase;
    }

    .workspace-toolbar strong {
      color: #181c32;
      font-size: 14px;
      font-weight: 850;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .toolbar-links {
      display: inline-flex;
      gap: 6px;
      align-items: center;
      overflow-x: auto;
      max-width: 100%;
      padding-bottom: 1px;
    }

    .toolbar-links a {
      min-height: 32px;
      display: inline-flex;
      align-items: center;
      border-radius: 8px;
      padding: 0 11px;
      color: #7e8299;
      background: #f5f8fa;
      text-decoration: none;
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }

    .toolbar-links a:hover,
    .toolbar-links a.active {
      background: var(--brand-soft);
      color: var(--brand);
    }

    main {
      padding: 24px 28px 32px;
      gap: 18px;
    }

    .panel {
      padding: 20px;
      border: 0;
      border-radius: 8px;
      background: #fff;
      box-shadow: var(--shadow);
    }

    .panel-head {
      align-items: center;
      margin-bottom: 14px;
    }

    .panel-head p {
      margin-top: 4px;
    }

    .metrics {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 18px;
    }

    .metric {
      min-height: 134px;
      display: grid;
      align-content: space-between;
      padding: 20px;
      border-left: 3px solid transparent;
    }

    .metric::after {
      right: 18px;
      top: 18px;
      width: 42px;
      height: 42px;
      border-radius: 8px;
      background:
        linear-gradient(135deg, rgba(0, 158, 247, .18), rgba(0, 158, 247, .05));
    }

    .metric:nth-child(2n)::after {
      background: linear-gradient(135deg, rgba(80, 205, 137, .18), rgba(80, 205, 137, .05));
    }

    .metric:nth-child(3n)::after {
      background: linear-gradient(135deg, rgba(255, 199, 0, .2), rgba(255, 199, 0, .05));
    }

    .metric p {
      position: relative;
      z-index: 1;
      margin: 0;
      color: #a1a5b7;
      font-size: 12px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .metric strong {
      font-size: 30px;
      line-height: 1.05;
      font-weight: 850;
      color: #181c32;
    }

    .metric small {
      color: #7e8299;
      font-size: 12px;
      font-weight: 700;
    }

    .dashboard-grid,
    .grid,
    .pricing-grid {
      gap: 18px;
      margin-top: 0;
    }

    .summary-row {
      border-color: #eff2f5;
      background: #fbfcfe;
    }

    table {
      border-collapse: separate;
      border-spacing: 0;
      color: #3f4254;
    }

    th, td {
      border-bottom-color: #eff2f5;
      padding: 13px 12px;
    }

    th {
      background: #f9fafb;
      color: #a1a5b7;
      font-size: 10px;
      font-weight: 850;
      letter-spacing: .04em;
    }

    tbody tr:hover td {
      background: #f8fbff;
    }

    .pill {
      min-height: 24px;
      border-radius: 8px;
      background: #e8fff3;
      color: #47be7d;
      font-size: 11px;
      font-weight: 850;
    }

    .pill.blocked,
    .pill.failed {
      background: #fff5f8;
      color: var(--danger);
    }

    .pill.queued {
      background: #fff8dd;
      color: #b68600;
    }

    .empty {
      border-color: #e4e6ef;
      background: #f9fafb;
      color: #a1a5b7;
      font-weight: 700;
    }

    .model-price-frame,
    .toggle-card,
    .public-model-card,
    .summary-row,
    .usage-text {
      border-radius: 8px;
    }

    .admin-shell-scrim {
      position: fixed;
      inset: 0;
      z-index: 39;
      background: rgba(24, 28, 50, .42);
      opacity: 0;
      visibility: hidden;
      transition: opacity .18s ease, visibility .18s ease;
    }

    body.admin-sidebar-open .admin-shell-scrim {
      opacity: 1;
      visibility: visible;
    }

    @media (max-width: 1280px) {
      .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .admin-module-search {
        width: min(300px, 30vw);
        min-width: 210px;
      }
    }

    @media (max-width: 1180px) {
      .app { grid-template-columns: 1fr; }
      .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        width: min(300px, 86vw);
        height: 100dvh;
        min-height: 100dvh;
        transform: translateX(-102%);
        transition: transform .18s ease;
      }
      body.admin-sidebar-open .admin-sidebar {
        transform: translateX(0);
      }
      .admin-sidebar-toggle { display: inline-block; }
      .admin-topbar {
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr);
        align-items: center;
        justify-content: stretch;
        gap: 8px 10px;
        padding: 12px 18px;
      }
      .admin-sidebar-toggle { grid-column: 1; }
      .admin-topbar-title { grid-column: 2; }
      #adminEmail {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .admin-header-tools {
        grid-column: 1 / -1;
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        justify-content: stretch;
        gap: 8px;
      }
      .topbar-chip { display: none; }
      .admin-module-search {
        grid-column: 1 / -1;
        order: 0;
        width: 100%;
        min-width: min(360px, 100%);
        flex: none;
      }
      .button-with-icon {
        width: 100%;
        min-width: 0;
        justify-content: center;
      }
      .workspace-toolbar {
        padding: 0 18px;
      }
      main { padding: 18px; }
      .dashboard-grid,
      .grid,
      .pricing-grid,
      .ops-grid {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 720px) {
      .admin-topbar {
        min-height: auto;
        padding: 12px;
        display: grid;
        grid-template-columns: 40px minmax(0, 1fr);
        align-items: start;
        justify-content: stretch;
        gap: 8px 10px;
      }
      .admin-sidebar-toggle { grid-column: 1; }
      .admin-topbar-title {
        grid-column: 2;
        flex: 1 1 auto;
      }
      #adminEmail {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .admin-header-tools {
        grid-column: 1 / -1;
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        justify-content: flex-start;
        gap: 8px;
      }
      .topbar-chip {
        display: none;
      }
      .admin-module-search {
        grid-column: 1 / -1;
        order: 0;
        width: 100%;
        min-width: 0;
        flex: none;
      }
      .button-with-icon {
        width: 100%;
        min-width: 0;
        flex: none;
        justify-content: center;
        padding: 0 10px;
      }
      .workspace-toolbar {
        min-height: auto;
        align-items: flex-start;
        flex-direction: column;
        padding: 12px;
      }
      .toolbar-links {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }
      .toolbar-links a {
        min-width: 0;
        flex: none;
        justify-content: center;
        padding: 0 8px;
        font-size: 11px;
      }
      main {
        padding: 14px 12px 22px;
      }
      .metrics {
        grid-template-columns: 1fr;
        gap: 12px;
      }
      .metric {
        min-height: 112px;
      }
      .panel {
        padding: 15px;
      }
      .panel-head {
        align-items: flex-start;
        flex-direction: column;
      }
      .summary-row {
        grid-template-columns: 1fr;
      }
      .sidebar-section {
        grid-template-columns: 1fr;
      }
      .nav-count {
        display: inline-flex;
      }
    }
