/* ApiLens skin: soft gradients, rounded panels, icon menu, top bar. Loaded after app.css, so it overrides it. */

:root, [data-theme="light"] {
  --g1: #7c5cf0; --g2: #4f8cff;
  --brand: #6d4be8; --brand-ink: #4a2fc0; --brand-wash: #efe9ff;
  --paper: #f6f4fd; --surface: #ffffff; --wash: #f1effa; --rule: #e7e3f3; --rule-strong: #d3cde8;
  --card-shadow: 0 8px 30px rgba(86, 70, 190, .07), 0 1px 2px rgba(86, 70, 190, .05);
  --radius: 20px;
  --banner-bg: linear-gradient(100deg, #e9e4ff 0%, #f1e8ff 30%, #fbe9f4 62%, #fffafd 100%);
  --navy: #14174f; --navy-soft: #3f4577; --accent: #6d5df5;
  --nav-on: linear-gradient(90deg, #e6dcff, #cfe3ff);
}
[data-theme="dark"] {
  --g1: #8b72ff; --g2: #4f9bff;
  --brand: #9a86ff; --brand-ink: #d6cdff; --brand-wash: #221d4a;
  --paper: #0a1020; --surface: #111a2f; --wash: #16213a; --rule: #22304d; --rule-strong: #34456a;
  --card-shadow: 0 6px 24px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .3);
  --banner-bg: linear-gradient(100deg, #1d1a47 0%, #251a4a 40%, #2e1c3e 75%, #1a1a33 100%);
  --navy: #eef1ff; --navy-soft: #b4bfdc; --accent: #9a86ff;
  --nav-on: linear-gradient(90deg, #2a2260, #1c3566);
}
body { background: var(--paper); }
[data-theme="light"] body, :root:not([data-theme="dark"]) body { background: linear-gradient(160deg, #f7f4ff 0%, #fbf3fa 55%, #fff6ee 100%) fixed; }
[data-theme="dark"] body { background: radial-gradient(1200px 600px at 20% -10%, #17163a 0%, #0a1020 60%) fixed; }

/* ---------- layout ---------- */
.app { grid-template-columns: 272px minmax(0, 1fr); gap: 0; }
.app.rail-min { grid-template-columns: 92px minmax(0, 1fr); }
.rail {
  margin: 14px 0 14px 14px; height: calc(100vh - 28px); border: 1px solid var(--rule); border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: var(--card-shadow); padding: 18px 14px 14px;
}
.stage { min-width: 0; display: flex; flex-direction: column; }
main { padding: 8px 28px 64px; max-width: 1320px; }
.brand { padding: 4px 8px 16px; }
.brand img { height: 36px; }

.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-sep { height: 1px; background: var(--rule); margin: 14px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 8px 10px; min-height: 46px; border-radius: 14px;
  color: var(--ink); font-weight: 550; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; text-decoration: none;
}
.nav-item .ico { flex: 0 0 auto; color: #6a5acd; width: 36px; height: 36px; padding: 8px; border-radius: 12px; background: var(--wash); box-sizing: border-box; }
.nav-item:hover { background: var(--wash); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--nav-on); color: var(--ink); font-weight: 650; }
.nav-item[aria-current="page"] .ico { background: linear-gradient(135deg, var(--g1), var(--g2)); color: #fff; box-shadow: 0 4px 12px rgba(109, 75, 232, .35); }
.proj-nav { display: flex; flex-direction: column; gap: 2px; margin: 0 0 4px 20px; padding-left: 14px; border-left: 2px solid var(--rule); }
.rail nav.proj-nav a { padding: 5px 10px; border-radius: 10px; font-size: 14px; color: var(--graphite); }
.rail nav.proj-nav a[aria-current="page"] { background: var(--brand-wash); color: var(--brand-ink); font-weight: 650; }
.rail-legal { margin-top: auto; padding: 10px 10px 0; }
.rail-foot { margin-top: 10px; padding: 0; display: flex; gap: 10px; align-items: center; }
.all-projects {
  flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--rule); box-shadow: var(--card-shadow); color: var(--ink); font-weight: 550; text-decoration: none;
}
.all-projects .ico:first-child { color: var(--g1); }
.all-projects .nav-label { flex: 1; }
.collapse { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--card-shadow); cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.rail-min .nav-label, .rail-min .proj-nav, .rail-min .rail-legal, .rail-min .brand .logo-light, .rail-min .brand .logo-dark, .rail-min .all-projects .ico:last-child { display: none; }
.rail-min .brand { height: 36px; background: url(/favicon.svg) center / 34px no-repeat; }
.rail-min .nav-item { justify-content: center; padding: 6px; }
.rail-min .all-projects { justify-content: center; }
.rail-min .rail-foot { flex-direction: column; }
.rail-min .collapse .ico { transform: rotate(180deg); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 28px; }
.search-box {
  flex: 1; max-width: 640px; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border: 1px solid var(--rule);
  border-radius: 16px; background: var(--surface); box-shadow: var(--card-shadow); color: var(--graphite); cursor: text; text-align: left; font-size: 15px;
}
.search-box span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font: 12px/1 ui-sans-serif, system-ui; padding: 4px 7px; border-radius: 6px; background: var(--wash); color: var(--graphite); border: 1px solid var(--rule); margin-left: 2px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.theme-pill { display: inline-flex; gap: 2px; padding: 4px; border-radius: 20px; border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--card-shadow); cursor: pointer; }
.theme-pill span { width: 30px; height: 26px; border-radius: 16px; display: grid; place-items: center; color: var(--graphite); }
[data-theme="light"] .th-sun, [data-theme="dark"] .th-moon { background: linear-gradient(135deg, var(--g2), var(--g1)); color: #fff; }
.bell { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--surface); box-shadow: var(--card-shadow); }
.bell-dot { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #ef4444; color: #fff; font-size: 10px; line-height: 16px; text-align: center; font-weight: 700; }
.user-wrap { position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border: 0; border-radius: 28px; background: var(--surface); box-shadow: var(--card-shadow); cursor: pointer; color: var(--ink); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; background: linear-gradient(135deg, #a78bfa, #6366f1); }
.user-text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; max-width: 190px; }
.user-text b { display: flex; align-items: center; gap: 5px; }
.user-text span:last-child { font-size: 13px; color: var(--graphite); overflow: hidden; text-overflow: ellipsis; }
.crown { color: #f59e0b; display: inline-grid; }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; padding: 10px; border-radius: 20px; background: var(--surface); box-shadow: 0 18px 44px rgba(70, 50, 170, .18), 0 2px 6px rgba(70, 50, 170, .06); border: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); z-index: 40; display: flex; flex-direction: column; }
.user-menu[hidden] { display: none; }
.user-menu a, .user-menu button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer; font-size: 15px; text-align: left; }
.user-menu a:hover, .user-menu button:hover { background: var(--wash); }
.user-menu .ico { color: #5b63c9; } [data-theme="dark"] .user-menu .ico { color: #a9b2ff; }
.user-menu a, .user-menu button { padding: 12px 14px; font-weight: 500; }
.user-menu .danger, .user-menu .danger .ico { color: #ef3b3b; }
.user-menu .danger { margin-top: 4px; }
.user-menu .danger:hover { background: color-mix(in srgb, #ef3b3b 10%, transparent); }

/* ---------- banner and cards ---------- */
.banner { position: relative; display: flex; align-items: center; gap: 26px; padding: 30px 36px; margin-bottom: 22px; border-radius: 22px; background: var(--banner-bg); border: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); box-shadow: var(--card-shadow); overflow: hidden; min-height: 150px; }
.banner-tile { flex: 0 0 auto; width: 76px; height: 76px; border-radius: 20px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #a681ff 0%, #7b5cf2 55%, #6a52e6 100%); box-shadow: 0 12px 26px rgba(122, 92, 242, .38), inset 0 1px 0 rgba(255, 255, 255, .35); }
.banner-tile .ico { stroke-width: 1.7; }
.banner-text { flex: 1; min-width: 0; }
.banner h1 { font-size: 36px; line-height: 1.1; font-weight: 800; letter-spacing: -.015em; color: var(--navy); }
.banner .sub { margin-top: 8px; color: var(--navy-soft); font-size: 16px; max-width: 640px; }
.banner-actions { margin-top: 14px; }
.banner-art { position: relative; flex: 0 0 380px; height: 170px; margin: -10px -8px -10px 0; }
.banner-art > svg { position: absolute; inset: 0; }
.art-badge .ico { stroke-width: 2.2; fill: currentColor; fill-opacity: .12; }
.art-badge { position: absolute; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--accent); box-shadow: 0 8px 22px rgba(100, 80, 220, .22), 0 0 0 5px rgba(255, 255, 255, .55); }
[data-theme="dark"] .art-badge { background: #1b2542; box-shadow: 0 8px 22px rgba(0, 0, 0, .4), 0 0 0 5px rgba(255, 255, 255, .06); }
[data-theme="dark"] .banner-art > svg { opacity: .85; }
.art-badge.b0 { top: 4px; left: 262px; } .art-badge.b1 { top: 78px; left: 34px; } .art-badge.b2 { top: 92px; left: 318px; }

.card, .block, .form-row {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--card-shadow);
}
.card { padding: 24px 28px; margin-bottom: 20px; border-color: color-mix(in srgb, var(--rule) 55%, transparent); }
.block { padding: 20px 22px; margin-top: 0; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.card-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--accent); background: var(--brand-wash); flex: 0 0 auto; }
.card-title { flex: 1; min-width: 0; }
.card-title h2 { font-size: 18px; font-weight: 750; color: var(--navy); }
.card-title p { margin-top: 3px; font-size: 14px; color: var(--navy-soft); }
.count-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 20px; background: var(--wash); font-weight: 600; font-size: 14px; }
.info-strip { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; background: var(--brand-wash); color: var(--ink); margin-top: 6px; }
.info-strip .ico { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--surface); color: var(--g1); flex: 0 0 auto; box-sizing: border-box; }

/* fields with a leading icon */
.field { position: relative; flex: 1 1 220px; min-width: 0; }
.field > .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--graphite); pointer-events: none; }
.field input, .field select { width: 100%; padding: 13px 14px 13px 44px; border-radius: 14px; border: 1px solid var(--rule); background: var(--surface); }
.field .trail { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; color: var(--graphite); }
.field-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; }
.field-row .btn { padding-left: 22px; padding-right: 22px; }

/* ---------- controls ---------- */
.btn { border-radius: 12px; padding: 9px 16px; border-color: var(--rule-strong); }
.btn.small { border-radius: 10px; }
.btn.primary { background: linear-gradient(135deg, var(--g1), var(--g2)); border: 0; color: #fff; box-shadow: 0 6px 16px rgba(109, 75, 232, .3); display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
[data-theme="dark"] .btn.primary { color: #fff; }
.btn.primary .ico { width: 18px; height: 18px; }
select, input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="date"], textarea { border-radius: 12px; border-color: var(--rule); background: var(--surface); }
.chip { border-radius: 20px; padding: 3px 12px; }
.chip.you { background: #e0f2fe; color: #0369a1; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; font-weight: 650; font-size: 14px; background: #fef3c7; color: #b45309; }
[data-theme="dark"] .role-chip { background: #3a2a0c; color: #fbbf24; }
.role-chip.member { background: var(--wash); color: var(--graphite); }

.table-wrap { border-radius: var(--radius); border-color: var(--rule); box-shadow: var(--card-shadow); overflow: auto; }
.table-wrap thead th { background: var(--wash); }
.member-row { display: flex; align-items: center; gap: 14px; }
.kebab { position: relative; display: inline-block; }
.kebab > button.dots { width: 36px; height: 36px; border-radius: 10px; border: 0; background: none; cursor: pointer; color: var(--graphite); }
.kebab > button.dots:hover { background: var(--wash); }
.kebab-menu { position: absolute; right: 0; top: 100%; z-index: 30; min-width: 170px; padding: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--rule); box-shadow: 0 14px 40px rgba(60, 40, 140, .22); }
.kebab-menu[hidden] { display: none; }
.kebab-menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--bad); font-size: 14px; }
.kebab-menu button:hover { background: var(--bad-wash); }

/* ---------- search palette ---------- */
.pal-back { position: fixed; inset: 0; z-index: 100; background: rgba(15, 12, 40, .45); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; backdrop-filter: blur(3px); }
.pal { width: min(640px, calc(100vw - 32px)); max-height: 70vh; overflow: hidden; display: flex; flex-direction: column; border-radius: 20px; background: var(--surface); box-shadow: 0 30px 80px rgba(20, 10, 80, .4); border: 1px solid var(--rule); }
.pal-in { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--rule); color: var(--graphite); }
.pal-in input { flex: 1; border: 0; background: none; outline: none; font-size: 17px; color: var(--ink); padding: 0; }
.pal-list { overflow: auto; padding: 8px; }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; color: var(--ink); }
.pal-item.on { background: var(--brand-wash); }
.pal-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-empty { padding: 18px; }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
  .app, .app.rail-min { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; margin: 10px 10px 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 18px; }
  .rail .brand { padding: 0 6px 0 0; }
  .nav-group { flex-direction: row; flex-wrap: wrap; }
  .proj-nav, .nav-sep, .rail-legal, .rail-foot, .nav-label { display: none; }
  .nav-item { min-height: 0; padding: 4px; width: auto; }
  .topbar { padding: 12px 14px; flex-wrap: wrap; }
  .search-box span { display: none; }
  .search-box kbd { display: none; }
  .user-text { display: none; }
  main { padding: 6px 14px 48px; }
  .banner { padding: 20px; flex-wrap: wrap; }
  .banner-art { display: none; }
  .banner h1 { font-size: 28px; }
  .banner-tile { width: 60px; height: 60px; border-radius: 18px; }
}

.banner.compact { min-height: 0; padding: 18px 24px; margin-bottom: 14px; }
.banner.compact .banner-tile { width: 54px; height: 54px; border-radius: 16px; }
.banner.compact h1 { font-size: 26px; }
.tabs { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 4px 14px; margin: 0 0 20px; box-shadow: var(--card-shadow); gap: 20px; }
.tabs a { padding: 12px 2px; }
.field input[type="password"], .field input.has-trail { padding-right: 46px; }
.field.wide { flex: 1.4 1 300px; }
.vitals { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 8px 6px; }
.empty { background: var(--surface); border: 1px dashed var(--rule-strong); border-radius: var(--radius); padding: 28px; }
.auth-card { max-width: 440px; border-radius: 26px; padding: 36px 34px; box-shadow: 0 20px 60px rgba(79, 60, 170, .18); }
.auth-card h1 { font-size: 26px; }
.auth-form input { padding: 12px 14px; border-radius: 14px; }
.auth-form .btn { align-self: stretch; padding: 12px 18px; }
.mail-card { border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; margin: 8px 0; background: var(--surface); } .mail-card pre.code { white-space: pre-wrap; max-height: 320px; overflow: auto; }

/* Live traffic */
.live-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 4px 0 14px; }
.live-stat { background: var(--wash); border-radius: 12px; padding: 12px 14px; }
.live-num { font-size: 24px; font-weight: 700; line-height: 1.2; }
.live-chart-wrap { margin-bottom: 14px; }
.live-chart { height: 56px; }
.live-bars { width: 100%; height: 56px; display: block; }
.live-bars rect.ok { fill: var(--g1, #4f7cff); opacity: .55; }
.live-bars rect.idle { fill: var(--rule-strong); }
.live-bars rect.bad { fill: var(--bad); }
.live-axis { display: flex; justify-content: space-between; font-size: 12px; }
.live-feed { max-height: 460px; overflow: auto; border: 1px solid var(--rule); border-radius: 12px; }
.live-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.live-table th { position: sticky; top: 0; background: var(--wash); text-align: left; padding: 6px 10px; }
.live-table td { padding: 5px 10px; border-top: 1px solid var(--rule); }
.live-err { font-size: 12px; }
.live-row.bad td:first-child { box-shadow: inset 3px 0 var(--bad); }
.live-row.warn td:first-child { box-shadow: inset 3px 0 var(--warn); }

/* Directory (admin) */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--wash); border-radius: 12px; margin: 4px 0 14px; }
.seg-btn { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; color: inherit; }
.seg-btn.on { background: var(--surface, #fff); box-shadow: 0 1px 4px rgba(60, 50, 120, .15); }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.dir-card { border: 1px solid var(--rule); border-radius: 16px; padding: 14px; }
.dir-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dir-head .chip { margin-left: auto; }
.dir-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 2px 0; }
.dir-line span:last-child { text-align: right; overflow-wrap: anywhere; }
.dir-msg { font-size: 13px; margin: 8px 0 0; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dir-head .avatar { flex: none; }

/* Monitoring */
.meter { position: relative; height: 8px; min-width: 70px; background: var(--wash); border-radius: 6px; display: flex; align-items: center; gap: 8px; }
.meter span { position: absolute; left: calc(100% + 8px); font-size: 12px; }
.meter { margin-right: 40px; }
.meter-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #8b7cf6, #5b8cff); }
.meter-fill.warn { background: var(--warn); } .meter-fill.bad { background: var(--bad); }
.meter.big { height: 12px; margin: 8px 0 6px; margin-right: 0; border-radius: 8px; }
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.gauge { border: 1px solid var(--rule); border-radius: 16px; padding: 14px 16px; }
.gauge-top { display: flex; justify-content: space-between; }

/* Developer / company dashboards */
.md-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.md-tile { display: flex; align-items: center; gap: 14px; background: var(--surface, #fff); border: 1px solid var(--rule); border-radius: 18px; padding: 16px; box-shadow: 0 6px 18px rgba(80, 70, 160, .06); }
.md-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.md-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.meter.big { width: 100%; min-width: 0; display: block; }

/* Upgrade to Pro */
.upgrade { margin: 10px 12px; padding: 14px; border-radius: 16px; background: linear-gradient(160deg, #f3efff, #eef4ff); border: 1px solid var(--rule); }
.upgrade-head { display: flex; align-items: center; gap: 8px; color: #b7791f; }
.upgrade-head b { color: var(--navy, #1b1b4b); }
.upgrade p { margin: 6px 0; font-size: 13px; color: var(--graphite); }
.upgrade-price { margin-bottom: 8px; font-size: 13px; } .upgrade-price b { font-size: 22px; }
.upgrade-btn { width: 100%; justify-content: center; text-align: center; display: block; }
.rail-min .upgrade { display: none; }
[data-theme="dark"] .upgrade { background: linear-gradient(160deg, #1d1b45, #14213f); }
[data-theme="dark"] .upgrade-head { color: #f2c26b; }
[data-theme="dark"] .upgrade-head b { color: #eef1ff; }
[data-theme="dark"] .upgrade p, [data-theme="dark"] .upgrade-price { color: #c4cde6; }
[data-theme="dark"] .upgrade-price b { color: #fff; }

/* Bell dropdown */
.bell-wrap { position: relative; }
.bell { border: 0; cursor: pointer; }
.bell-panel { position: absolute; right: 0; top: 52px; width: 270px; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; box-shadow: 0 14px 40px rgba(20, 20, 60, .22); padding: 14px; z-index: 30; }
.bell-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.bell-actions { display: flex; gap: 8px; }
.bell-empty { padding: 6px 2px; }

.mail-help { margin-top: 12px; } .mail-help summary { cursor: pointer; font-weight: 600; } .mail-help ol { display: grid; gap: 6px; padding-left: 20px; }

/* ---- connection status on the Setup tab */
.conn-status { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--rule); background: var(--surface, transparent); margin-bottom: 16px; }
.conn-status > div { flex: 1; }
.conn-dot { width: 12px; height: 12px; border-radius: 50%; background: #f5a524; flex: none; animation: conn-pulse 1.6s ease-in-out infinite; }
.conn-status.half .conn-dot { background: #4f9cff; }
.conn-status.ok { border-color: #22c55e; }
.conn-status.ok .conn-dot { background: #22c55e; animation: none; }
@keyframes conn-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 165, 36, .5); } 50% { box-shadow: 0 0 0 8px rgba(245, 165, 36, 0); } }
@media (prefers-reduced-motion: reduce) { .conn-dot { animation: none; } }

/* ---- rate limit test: one small box per request, filled in as the answers arrive */
.rl-live { margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.rl-strip { display: flex; flex-wrap: wrap; gap: 3px; margin: 6px 0 10px; }
.rl-box { width: 12px; height: 12px; border-radius: 3px; background: var(--rule); display: inline-block; }
.rl-box.ok { background: #22c55e; }
.rl-box.blocked { background: #ef4444; }
.rl-box.other { background: #f5a524; }
.rl-box.net { background: #6b7280; }
.rl-verdict { padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; margin-top: 6px; }

/* ---- security tab */
.sec-table th.sec-col { text-align: center; font-size: 12px; white-space: nowrap; }
.sec-cell { text-align: center; }
.sec-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--rule); vertical-align: middle; }
.sec-dot.FAIL { background: #ef4444; }
.sec-dot.WARN { background: #f5a524; }
.sec-dot.REVIEW { background: #4f9cff; }
.sec-dot.PASS { background: #22c55e; opacity: .55; }
.sec-dot.NA { background: transparent; border: 1px dashed var(--rule); }
.sec-row.open { background: rgba(124, 108, 255, .08); }
.sec-open { padding: 6px 4px 10px; }
.sec-finding { padding: 10px 0; border-top: 1px solid var(--rule); }
.sec-finding ul { margin: 6px 0 6px 18px; }
.sec-legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 12px; font-size: 13px; }
.chip-btn { border: 1px solid var(--rule); background: transparent; color: inherit; border-radius: 999px; padding: 4px 12px; cursor: pointer; font: inherit; }
.chip-btn[aria-pressed="true"] { border-color: #7c6cff; background: rgba(124, 108, 255, .16); }

/* Audit log */
.audit-table td, .audit-table th { overflow-wrap: break-word; }
.audit-table td:nth-child(1), .audit-table td:nth-child(4), .audit-table td:nth-child(6) { white-space: nowrap; }
.audit-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--soft, #eef2ff); font-size: .85em; }
.audit-tag.bad { background: #fee2e2; color: #991b1b; }

/* Sign-up consent and legal links */
.terms-row { display: flex; align-items: flex-start; gap: 8px; font-size: .92em; }
.terms-row input { margin-top: 3px; width: auto; }
.legal-links { font-size: .85em; }

/* Find running services */
.disc-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 14px 0 8px; }
.disc-row label { display: grid; gap: 4px; flex: 1 1 220px; font-weight: 600; font-size: 13px; }
.disc-box .table-wrap { margin-top: 10px; }
.disc-box td code { font-size: 13px; }
.disc-box td .btn { white-space: nowrap; }

/* Admin: how many requests wait on the Licences entry */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge[hidden] { display: none; }
.rail-min .nav-badge { position: absolute; top: 2px; right: 4px; margin: 0; }
.rail-min .nav-item { position: relative; }
.nav-request { color: inherit; }
.nav-request:disabled { opacity: .7; cursor: default; }
/* Dialogs built with .pal + .up-box must scroll instead of cutting off their buttons on a short window. */
.pal.up-box { max-height: calc(100vh - 24px); overflow-y: auto; overflow-x: hidden; display: block; }
.pal-back.up-back { padding-top: 12px; align-items: flex-start; overflow-y: auto; }
.pal.up-box .bld-foot { position: sticky; bottom: 0; background: var(--surface); z-index: 1; }

/* Licence validation popup (403) */
.lic-pop { text-align: center; padding: 8px 6px 4px; }
.lic-badge { width: 76px; height: 76px; border-radius: 50%; margin: 6px auto 14px; display: grid; place-items: center; background: #ffe9e0; color: #c8501e; }
.lic-title { margin: 0 0 8px; font-size: 22px; }
.lic-lead { margin: 0 auto 16px; max-width: 420px; color: var(--muted, #666); line-height: 1.5; }
.lic-err { text-align: left; background: #1d1a24; color: #f3f0fa; border-radius: 12px; padding: 14px 16px; margin: 0 0 16px; }
.lic-code { display: flex; align-items: center; gap: 4px; color: #ff9a72; margin-bottom: 4px; }
.lic-code b { color: #fff; font-size: 16px; }
.lic-msg { font-size: 14px; opacity: .9; }
.lic-svc { margin-top: 8px; font-size: 12px; opacity: .75; word-break: break-all; }
.lic-go, .lic-cancel { display: block; width: 100%; margin: 8px 0 0; padding: 13px; font-size: 16px; justify-content: center; }
.lic-foot { margin-top: 14px; font-size: 12px; }
.lic-badge.ok { background: #dff6e6; color: #1a8a45; }
.lic-ok { display: flex; align-items: center; justify-content: center; gap: 4px; background: #e8f8ee; color: #14753a; border-radius: 12px; padding: 14px 16px; margin: 0 0 16px; }
.lic-ok .lic-svc { margin: 0; opacity: .75; }
.conn-line { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0; font-weight: 600; }
.conn-line.ok { color: #14753a; } .conn-line.bad { color: #b3261e; }
@media (prefers-color-scheme: dark) { .lic-badge.ok { background: #16402a; color: #6fe3a0; } .lic-ok { background: #16402a; color: #8ff0b6; } .conn-line.ok { color: #6fe3a0; } .conn-line.bad { color: #ff8a80; } }
