:root {
  color-scheme: light;
  font: 14px -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #24272d;
  background: #fff;
  font-synthesis: none;
  --border: #e5e7eb;
  --muted: #737b87;
  --blue: #3979ce;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, summary { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { border: 1px solid var(--border); background: #fff; color: inherit; border-radius: 6px; padding: 9px 13px; }
button:hover { background: #f6f7f8; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: 25px; font-weight: 600; letter-spacing: -.65px; }
h2 { font-size: 14px; font-weight: 550; }
p { line-height: 1.6; }
.muted, .diagnostic-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.ph-logo { display: block; height: auto; object-fit: contain; filter: brightness(0); opacity: .85; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 224px; padding: 26px 16px 16px; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--border); }
.sidebar-organization { width: 155px; margin: 0 10px 28px; }
.wordmark { display: block; padding: 0 12px 25px; color: inherit; text-decoration: none; font-size: 23px; font-weight: 600; letter-spacing: -.65px; }
nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
nav button, .logout-button { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; padding: 11px 12px; font-size: 13px; color: #6b7280; text-align: left; background: transparent; }
nav button.selected { background: #f3f4f6; color: #24272d; font-weight: 550; }
nav button:hover { background: #f6f7f8; }
nav svg, .logout-button svg, .menu-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.logout-button { border-top: 1px solid var(--border); border-radius: 0; padding-top: 17px; }
.mobile-bar, .menu-backdrop { display: none; }
main { margin-left: 224px; min-width: 0; padding: 0 32px 40px; }
.page-heading { padding: 32px 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.segmented { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 7px; }
.segmented button { border: 0; font-size: 12px; padding: 5px 12px; white-space: nowrap; color: var(--muted); }
.segmented button.active { color: #24272d; background: #f3f4f6; }
.toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 24px; }
.filters { display: flex; gap: 10px; }
.filters select { width: 174px; margin: 0; padding: 8px 12px; font-size: 12px; }
#filter-app { width: 202px; }
.exports { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--muted); }
.icon-button { border-color: transparent; padding: 3px 7px; font-size: 19px; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 28px; border: 1px solid var(--border); border-radius: 8px; }
.metric { min-width: 0; padding: 20px; }
.metric + .metric { border-left: 1px solid var(--border); }
.metric .label { color: var(--muted); font-size: 12px; }
.metric .value { font-size: 28px; font-weight: 600; letter-spacing: -.6px; margin-top: 8px; line-height: 1.3; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric .note { color: var(--muted); font-size: 11px; margin-top: 8px; }
.analytics-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: 24px; margin-bottom: 24px; }
.card { min-width: 0; padding: 22px; margin-bottom: 24px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.analytics-grid .card { margin: 0; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.legend { display: flex; gap: 18px; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-dot.calls { background: var(--blue); }
.legend-dot.rejected { background: #df5559; }
.chart { position: relative; min-height: 250px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: #e6e9ed; stroke-dasharray: 3 4; }
.chart .axis-label { fill: #7e8793; font-size: 11px; }
.chart .call-line { stroke: var(--blue); fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart .rejected-line { stroke: #df5559; fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart .point { opacity: 0; outline: none; }
.chart .point:hover, .chart .point:focus { opacity: 1; }
.chart-empty { position: absolute; inset: 0 0 25px 40px; display: grid; place-content: center; background: #ffffffdf; color: var(--muted); font-size: 12px; }
.chart-empty strong, .empty strong { font-weight: 400; }
.numbers { margin-top: 16px; color: var(--muted); font-size: 12px; }
.numbers summary { width: fit-content; }
.numbers .table-wrap { max-height: 280px; overflow-y: auto; margin-top: 12px; }
.editor { margin-bottom: 22px; }
.editor > summary { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; list-style: none; border-radius: 6px; background: #24272d; color: #fff; font-size: 13px; }
.editor > summary::-webkit-details-marker { display: none; }
.editor > summary::before { content: "+"; font-size: 16px; }
.editor[open] > summary::before { content: "−"; }
.editor > form { max-width: 650px; margin: 16px 0 0; }
.editor-actions { display: flex; flex-wrap: wrap; align-items: start; gap: 12px; }
.editor-actions > .editor[open] { flex-basis: 100%; }
.editor-actions > .editor + .editor > summary { color: #596370; background: #fff; border: 1px solid var(--border); }
label { display: block; color: #5a6370; font-size: 12px; margin: 16px 0; }
input, select { display: block; width: 100%; min-width: 0; padding: 9px 11px; margin-top: 7px; background: #fff; color: #303844; border: 1px solid #dce0e5; border-radius: 6px; }
input::placeholder { color: #969eaa; }
input:focus, select:focus { outline: 2px solid #c1d6f2; border-color: #7c9fcf; }
form button { width: 100%; margin-top: 12px; background: #24272d; color: #fff; border-color: #24272d; }
form button:hover { background: #3a414d; }
form button.secondary { color: #596370; background: #fff; border-color: var(--border); }
.form-row { display: flex; gap: 14px; }
.form-row > label { width: 50%; margin: 0; }
.check { display: flex; align-items: center; gap: 9px; }
.check input { width: 15px; margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; font-variant-numeric: tabular-nums; }
th { color: #818996; font-weight: 400; padding: 11px 8px; border-bottom: 1px solid var(--border); font-size: 11px; white-space: nowrap; }
td { padding: 15px 8px; border-bottom: 1px solid var(--border); color: #4b5563; vertical-align: middle; overflow-wrap: anywhere; max-width: 230px; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tr:last-child td { border-bottom: 0; }
td:first-child { color: #303844; }
td small { display: block; color: #858e9b; font-size: 11px; margin-top: 4px; }
td strong { font-weight: 550; }
.model-card th:not(:first-child), .model-card td:not(:first-child) { text-align: right; }
.table-wrap { overflow-x: auto; }
.empty { padding: 45px 12px; text-align: center; color: var(--muted); font-size: 12px; }
.mini { padding: 5px 8px; font-size: 11px; margin: 0 3px 4px 0; color: #596370; }
.state { color: #27805e; font-size: 11px; }
.state.pending { color: #a67b24; }
.state.rejected { color: #ce4c50; }
.key-status { display: inline-block; border-radius: 20px; padding: 3px 8px; font-size: 11px; background: #eff8f2; color: #27774c; border: 1px solid #d3e9db; }
.key-status.revoked { background: #f5f6f8; color: var(--muted); border-color: var(--border); }
.key-status.expired { background: #fff8eb; color: #99701e; border-color: #efe1c1; }
.keys-card { padding: 0; overflow: hidden; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.table-toolbar input { max-width: 330px; margin: 0; font-size: 12px; }
.table-tools { display: flex; align-items: center; gap: 10px; }
.table-tools select { width: 160px; margin: 0; font-size: 12px; }
.table-tools button { padding: 7px 12px; font-size: 18px; }
.keys-card th { background: #fafbfc; padding: 12px 16px; }
.keys-card td { padding: 16px; }
.keys-card th:first-child, .keys-card td:first-child { padding-left: 20px; }
.keys-card .empty { padding: 64px 20px; }
.table-footer { padding: 15px 20px; font-size: 12px; color: var(--muted); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: 6px; background: #f7f8fa; padding: 16px; color: #495568; font-size: 12px; line-height: 1.7; }
#key-result { margin-top: 24px; }
#error, #login-error { padding: 12px 15px; margin: 0 0 20px; color: #a23e3e; background: #fff6f6; border: 1px solid #efdcdc; border-radius: 6px; font-size: 12px; }
#login-error:empty, #access-result:empty { display: none; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px,100%); padding: 30px; border: 1px solid var(--border); border-radius: 8px; }
.login-logo { width: 155px; margin-bottom: 28px; }
.login-card h1 { margin-bottom: 20px; }
.text-button { border: 0; padding: 8px 0; color: var(--muted); background: transparent; }
dialog { width: min(660px,calc(100% - 32px)); max-height: 85vh; padding: 0; border: 1px solid var(--border); border-radius: 8px; color: inherit; box-shadow: 0 15px 60px #17203926; }
dialog::backdrop { background: #18243855; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.dialog-content { padding: 22px 24px; }
.dialog-content select { margin-bottom: 15px; }
.diagnostic-status { padding: 12px 14px; border-radius: 6px; background: #fff8eb; color: #916e29; margin: 16px 0; font-size: 13px; }
.diagnostic-status.success { background: #eff8f2; color: #27774c; }
.diagnostic-note { margin: 14px 0; }
.diagnostic-models { max-height: 160px; overflow: auto; padding: 12px 16px; background: #f7f8fa; border: 1px solid var(--border); border-radius: 6px; font: 11px/1.9 ui-monospace,monospace; }
.diagnostic-models span { display: block; overflow-wrap: anywhere; }
.demo-badge { display: inline-flex; align-items: center; padding: 4px 8px; margin-left: auto; border: 1px solid #eadcb2; border-radius: 5px; color: #866115; background: #fff8e7; font-size: 10px; font-weight: 500; white-space: nowrap; }
@media (max-width:1150px) {
  main { padding: 0 24px 32px; }
  .analytics-grid { grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); }
  .metric { padding: 16px; }
  .metric .value { font-size: 25px; }
}
@media (max-width:900px) {
  .sidebar { transform: translateX(-100%); visibility: hidden; }
  body.menu-open .sidebar { transform: translateX(0); visibility: visible; }
  body.menu-open { overflow: hidden; }
  .mobile-bar { height: 58px; display: flex; align-items: center; gap: 13px; padding: 0 20px; border-bottom: 1px solid var(--border); }
  .menu-toggle { display: inline-flex; padding: 7px; border-color: transparent; }
  .mobile-brand { font-size: 16px; font-weight: 550; }
  .menu-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 20; border: 0; border-radius: 0; background: #15233655; }
  main { margin-left: 0; }
  .analytics-grid { grid-template-columns: 1fr; }
  .editor-actions { display: block; }
}
@media (max-width:600px) {
  main { padding: 0 18px 28px; }
  .page-heading { padding: 26px 0; gap: 12px; flex-wrap: wrap; }
  h1 { font-size: 23px; }
  .segmented button { padding: 6px 8px; font-size: 11px; }
  .toolbar { flex-wrap: wrap; gap: 14px; }
  .filters { width: 100%; }
  .filters select, #filter-app { width: calc(50% - 5px); font-size: 11px; }
  .exports { margin-left: auto; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric { padding: 16px; }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--border); }
  .metric .value { font-size: 24px; }
  .card { padding: 18px; }
  .keys-card { padding: 0; }
  .chart { min-height: 185px; }
  .table-toolbar { flex-wrap: wrap; padding: 14px; gap: 10px; }
  .table-toolbar input { width: 100%; max-width: none; }
  .table-tools { width: 100%; justify-content: space-between; }
  .table-tools select { width: calc(100% - 52px); }
  .keys-card td { min-width: 110px; }
  .form-row { flex-direction: column; gap: 0; }
  .form-row > label { width: 100%; margin: 16px 0; }
  .demo-badge { margin: 0 0 0 auto; font-size: 9px; }
}

#omni-login { display:block; text-align:center; padding:10px 16px; border-radius:6px; background:#18181b; color:white; text-decoration:none; }
#omni-login[hidden] { display:none; }
