/* Static renderer CSS. The Electron UI intentionally avoids runtime Tailwind
   CDN compilation so startup does not depend on network/CDN latency. */

:root {
  --nr-bg: #1a1a1a;
  --nr-bg-alt: #1f1f1e;
  --nr-surface: #262626;
  --nr-surface-2: #303030;
  --nr-border: #333333;
  --nr-text: #ededed;
  --nr-muted: #9ca3af;
  --nr-subtle: #6b7280;
  --nr-brand: #E56A4A;
  --nr-brand-soft: #ee8d6a;
  --nr-brand-muted: #f4b59c;
  --nr-success: #22c55e;
  --nr-warning: #fbbf24;
  --nr-danger: #ef4444;
}

html, body { color-scheme: dark; }

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background-color: #1a1a1a;
  color: #ededed;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

table {
  border-collapse: collapse;
}

.selection\:bg-brand-violet-500\/40::selection {
  background: rgba(229, 106, 74, 0.4);
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(700px 360px at 20% 12%, rgba(229, 106, 74, 0.18), transparent 65%),
    radial-gradient(620px 340px at 82% 20%, rgba(229, 106, 74, 0.16), transparent 64%),
    #1a1a1a;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.app-loading[hidden] {
  display: none;
}

.app-loading.app-loading-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loading-card {
  width: min(360px, calc(100vw - 48px));
  border: 1px solid rgba(51, 51, 51, 0.95);
  border-radius: 14px;
  background: rgba(38, 38, 38, 0.94);
  padding: 22px;
  box-shadow: 0 24px 90px -38px rgba(0, 0, 0, 0.85);
}

.app-loading-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-loading-brand strong,
.app-loading-brand span {
  display: block;
}

.app-loading-brand strong {
  color: #f7f4f0;
  font-size: 18px;
  line-height: 1.2;
}

.app-loading-brand span:not(.app-loading-icon) {
  margin-top: 5px;
  color: #9ca3af;
  font-size: 13px;
}

.app-loading-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #E56A4A, #E56A4A 58%, #E56A4A);
  box-shadow: 0 14px 36px -18px rgba(229, 106, 74, 0.75);
}

.app-loading-bar {
  position: relative;
  overflow: hidden;
  height: 4px;
  margin-top: 20px;
  border-radius: 999px;
  background: #333333;
}

.app-loading-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #E56A4A, #E56A4A, #E56A4A);
  animation: app-loading-slide 1050ms ease-in-out infinite;
}

@keyframes app-loading-slide {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(85%); }
  100% { transform: translateX(260%); }
}

@media (prefers-reduced-motion: reduce) {
  .app-loading,
  .app-loading-bar span {
    transition: none;
    animation: none;
  }
}

/* Minimal utility layer for the classes used by renderer/index.html. */
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.w-9 { width: 36px; }
.h-9 { height: 36px; }
.h-px { height: 1px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-5 { margin-top: 20px; margin-bottom: 20px; }
.max-w-xl { max-width: 576px; }
.max-w-\[1320px\] { max-width: 1320px; }
.max-w-\[180px\] { max-width: 180px; }
.px-2\.5 { padding-left: 10px; padding-right: 10px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.pt-8 { padding-top: 32px; }
.pb-7 { padding-bottom: 28px; }
.pb-16 { padding-bottom: 64px; }

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1\.5 { gap: 6px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.gap-x-6 { column-gap: 24px; }
.gap-y-4 { row-gap: 16px; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }
.order-1 { order: 1; }
.order-2 { order: 2; }
.order-3 { order: 3; }
.order-4 { order: 4; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 8px; }

.overflow-hidden { overflow: hidden; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-full { border-radius: 999px; }
.border { border-width: 1px; border-style: solid; }
.border-ink-700 { border-color: #333333; }
.border-brand-violet-500\/40 { border-color: rgba(229, 106, 74, 0.4); }
.divide-y > :not([hidden]) ~ :not([hidden]) { border-top-width: 1px; border-top-style: solid; }
.divide-ink-700\/70 > :not([hidden]) ~ :not([hidden]) { border-top-color: rgba(51, 51, 51, 0.7); }

.bg-ink-900 { background-color: #1a1a1a; }
.bg-ink-750 { background-color: #262626; }
.bg-brand-violet-500\/15 { background-color: rgba(229, 106, 74, 0.15); }
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.from-brand-violet-500 { --tw-gradient-from: #E56A4A; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(229, 106, 74, 0)); }
.via-brand-teal-500 { --tw-gradient-stops: var(--tw-gradient-from), #E56A4A, var(--tw-gradient-to, rgba(229, 106, 74, 0)); }
.to-brand-amber-500 { --tw-gradient-to: #E56A4A; }
.from-transparent { --tw-gradient-from: transparent; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, transparent); }
.via-ink-600 { --tw-gradient-stops: var(--tw-gradient-from), #333333, var(--tw-gradient-to, rgba(51, 51, 51, 0)); }
.to-transparent { --tw-gradient-to: transparent; }

.font-sans { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.font-mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace; }
.font-semibold { font-weight: 700; }
.font-bold { font-weight: 700; }
.text-left { text-align: left; }
.text-2xl { font-size: 24px; line-height: 32px; }
.text-base { font-size: 16px; line-height: 24px; }
.text-sm { font-size: 14px; line-height: 20px; }
.text-xs { font-size: 12px; line-height: 16px; }
.text-\[10px\] { font-size: 10px; }
.uppercase { text-transform: uppercase; }
.tracking-tight { letter-spacing: 0; }
.tracking-wider { letter-spacing: 0.05em; }
.text-ink-100 { color: #ededed; }
.text-ink-200 { color: #d6d3cf; }
.text-ink-300 { color: #9ca3af; }
.text-brand-violet-200 { color: #f4b59c; }
.text-brand-violet-400 { color: #ee8d6a; }
.text-brand-teal-400 { color: #22c55e; }
.text-brand-amber-400 { color: #fbbf24; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25), 0 4px 6px -4px rgba(0, 0, 0, 0.25); }

@media (min-width: 1024px) {
  .lg\:grid-cols-\[1\.45fr_1fr\] { grid-template-columns: 1.45fr 1fr; }
  .lg\:row-span-2 { grid-row: span 2 / span 2; }
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
}

.panel {
  border: 1px solid #333333;
  border-radius: 16px;
  background: rgba(38, 38, 38, 0.88);
  padding: 20px;
  box-shadow: 0 18px 60px -30px rgba(2, 6, 12, 0.7);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-view[hidden] {
  display: none;
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 16px;
  border: 1px solid #333333;
  border-radius: 16px;
  background: rgba(38, 38, 38, 0.94);
  box-shadow: 0 24px 80px -32px rgba(0, 0, 0, 0.72);
  padding: 24px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 4px;
}

.login-brand-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(229, 106, 74, 0.18);
  color: #f4b59c;
}

.login-brand strong {
  display: block;
  color: #ededed;
  font-size: 20px;
  line-height: 1.2;
}

.login-brand span:last-child {
  display: block;
  margin-top: 2px;
  color: #9ca3af;
  font-size: 13px;
}

.login-status {
  min-height: 18px;
  color: #9ca3af;
  font-size: 12px;
}

.login-status.error { color: #f87171; }
.login-status.warn { color: #fbbf24; }

.current-user-pill {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric {
  appearance: none;
  display: flex;
  min-width: 96px;
  flex-direction: column;
  gap: 2px;
  border: 1px solid #333333;
  border-radius: 12px;
  background: rgba(38, 38, 38, 0.8);
  color: inherit;
  cursor: pointer;
  padding: 8px 14px;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, filter 140ms ease, transform 120ms ease;
}

.metric:hover {
  border-color: rgba(238, 141, 106, 0.45);
  background: rgba(51, 51, 51, 0.86);
  filter: brightness(1.06);
}

.metric:active {
  transform: translateY(1px);
}

.metric:focus-visible {
  outline: 2px solid rgba(238, 141, 106, 0.55);
  outline-offset: 2px;
}

.metric.metric-selected {
  border-color: rgba(238, 141, 106, 0.56);
  background: rgba(229, 106, 74, 0.14);
  box-shadow: inset 0 0 0 1px rgba(238, 141, 106, 0.18);
}

.metric-label {
  color: #9ca3af;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.metric-value {
  color: #ededed;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.metric-active {
  max-width: 260px;
}

.socket-panel {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  max-width: 360px;
  border: 1px solid rgba(68, 68, 68, 0.72);
  border-radius: 12px;
  background: rgba(31, 31, 30, 0.76);
  padding: 7px 8px 7px 12px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.socket-panel:hover {
  filter: brightness(1.08);
}

.socket-panel:focus-visible {
  outline: 2px solid rgba(238, 141, 106, 0.55);
  outline-offset: 2px;
}

.socket-panel-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.socket-panel-main > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.socket-panel-label {
  color: #9ca3af;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.socket-panel-main strong {
  color: #ededed;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
}

.socket-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.14);
}

.socket-panel-meta {
  display: grid;
  gap: 2px;
  min-width: 72px;
  color: #9ca3af;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.socket-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.socket-panel-live {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.12);
}

.socket-panel-live .socket-status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.socket-panel-waiting {
  border-color: rgba(251, 191, 36, 0.32);
  background: rgba(245, 158, 11, 0.1);
}

.socket-panel-error {
  border-color: rgba(244, 63, 94, 0.42);
  background: rgba(244, 63, 94, 0.12);
}

.socket-panel-error .socket-status-dot {
  background: #fb7185;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.16);
}

.socket-status-dot-live {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.socket-status-dot-waiting {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.14);
}

.socket-status-dot-error {
  background: #fb7185;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.16);
}

.dock-statusbar {
  justify-content: flex-end;
  max-width: 100%;
}

.dock-statusbar > * {
  flex: 0 0 auto;
}

.status-pill {
  appearance: none;
  display: inline-flex;
  min-width: 120px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease;
}

.status-pill:hover {
  filter: brightness(1.08);
}

.status-pill:active {
  transform: translateY(1px);
}

.status-pill-ready {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.status-pill-starting {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.status-pill-offline {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
}

.background-switch-btn {
  display: inline-flex;
  min-width: 112px;
  max-width: 100%;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(229, 106, 74, 0.42);
  border-radius: 999px;
  background: rgba(229, 106, 74, 0.14);
  color: #f4b59c;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.025em;
  white-space: nowrap;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, opacity 140ms ease;
}

.auto-start-btn {
  min-width: 158px;
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
}

.background-switch-btn:hover:not(:disabled) {
  border-color: rgba(229, 106, 74, 0.55);
  background: rgba(229, 106, 74, 0.16);
  color: #f4b59c;
}

.background-switch-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.auto-start-enabled {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  opacity: 1;
}

.auto-start-unavailable {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.08);
  color: #94a3b8;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  color: #9ca3af;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.field > .field-icon-label {
  display: inline-flex;
  width: 22px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.field input,
.field select {
  width: 100%;
  height: 40px;
  border: 1px solid #333333;
  border-radius: 8px;
  background: #1f1f1e;
  color: #ededed;
  outline: none;
  padding: 0 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input:focus,
.field select:focus {
  border-color: #ee8d6a;
  box-shadow: 0 0 0 2px rgba(229, 106, 74, 0.3);
}

.field input::placeholder {
  color: #6b7280;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  transition: border-color 140ms ease, background 140ms ease, filter 140ms ease, transform 120ms ease, opacity 140ms ease;
}

.btn-primary {
  border: 0;
  background: linear-gradient(to right, #E56A4A, #E56A4A);
  color: #1a1a1a;
  box-shadow: 0 8px 24px -12px rgba(229, 106, 74, 0.7);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-secondary {
  border: 1px solid #333333;
  background: #262626;
  color: #ededed;
}

.btn-secondary:hover {
  border-color: rgba(229, 106, 74, 0.6);
  background: #333333;
}

.btn-danger {
  border: 1px solid rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.15);
  color: #fecdd3;
}

.btn-danger:hover {
  border-color: rgba(251, 113, 133, 0.65);
  background: rgba(244, 63, 94, 0.25);
}

.btn-primary:active,
.btn-secondary:active,
.btn-danger:active {
  transform: translateY(1px);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: 0.6;
}

.icon-btn.ghost {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border-color: transparent;
  background: transparent;
  color: #9ca3af;
  font-size: 14px;
  padding: 0;
}

.icon-btn.ghost:hover {
  border-color: #333333;
  background: #262626;
  color: #ededed;
}

.icon-btn.danger-soft {
  color: #fda4af;
}

.icon-btn.danger-soft:hover {
  border-color: rgba(244, 63, 94, 0.38);
  background: rgba(244, 63, 94, 0.14);
  color: #fecdd3;
}

.icon-btn.violet-on {
  border-color: rgba(238, 141, 106, 0.5);
  background: rgba(229, 106, 74, 0.2);
  color: #f4b59c;
}

.info-cell {
  min-width: 0;
}

.info-cell > * + * {
  margin-top: 4px;
}

.info-label {
  display: block;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.info-value {
  display: block;
  overflow: hidden;
  color: #ededed;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin: 0 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(68, 68, 68, 0.7);
  background: rgba(31, 31, 30, 0.72);
}

.app-view-tab {
  appearance: none;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 8px 14px;
}

.app-view-tab:hover {
  background: rgba(51, 51, 51, 0.75);
  color: #ededed;
}

.app-view-tab.active {
  background: rgba(229, 106, 74, 0.18);
  color: #f4b59c;
  box-shadow: inset 0 0 0 1px rgba(238, 141, 106, 0.45);
}

.app-view-hidden {
  display: none !important;
}

.settings-panel {
  max-width: 920px;
}

.settings-view {
  display: grid;
  max-width: 980px;
  gap: 20px;
}

.usage-view {
  display: grid;
  gap: 20px;
}

.users-view {
  display: grid;
  max-width: 1180px;
  gap: 20px;
}

.usage-panel {
  max-width: 1180px;
}

.users-panel {
  max-width: 1180px;
}

.users-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.user-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(160px, 1fr) minmax(160px, 1fr) 130px 130px auto;
  gap: 12px;
  align-items: end;
  border-top: 1px solid rgba(68, 68, 68, 0.55);
  padding-top: 16px;
}

.user-form-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.users-table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid rgba(51, 51, 51, 0.72);
  border-radius: 10px;
}

.users-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
}

.users-table th,
.users-table td {
  border-bottom: 1px solid rgba(51, 51, 51, 0.72);
  padding: 10px 12px;
  color: #d6d3cf;
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.users-table th {
  color: #9ca3af;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.users-table tr:last-child td {
  border-bottom: 0;
}

.users-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-table th:nth-child(1) { width: 28%; }
.users-table th:nth-child(2) { width: 18%; }
.users-table th:nth-child(3) { width: 12%; }
.users-table th:nth-child(4) { width: 12%; }
.users-table th:nth-child(5) { width: 18%; }
.users-table th:nth-child(6) { width: 12%; }

.users-actions {
  display: flex;
  gap: 8px;
}

.users-empty {
  color: #9ca3af;
  text-align: center !important;
}

.user-role-pill,
.user-state-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.user-role-pill.role-admin {
  background: rgba(229, 106, 74, 0.16);
  color: #f4b59c;
}

.user-role-pill.role-customer {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.user-state-pill.active {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
}

.user-state-pill.inactive {
  background: rgba(244, 63, 94, 0.14);
  color: #fda4af;
}

.usage-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.usage-select {
  min-width: 86px;
  height: 34px;
  border: 1px solid rgba(68, 68, 68, 0.85);
  border-radius: 8px;
  background: #1f1f1e;
  color: #ededed;
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
}

.usage-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.usage-metric {
  min-height: 82px;
  border: 1px solid rgba(68, 68, 68, 0.72);
  border-radius: 8px;
  background: #171918;
  color: #ededed;
  cursor: pointer;
  padding: 14px;
  text-align: left;
}

.usage-metric:hover {
  border-color: rgba(45, 212, 191, 0.55);
}

.usage-metric span {
  display: block;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.usage-metric strong {
  display: block;
  margin-top: 9px;
  color: #f4b59c;
  font-size: 28px;
  line-height: 1;
}

.usage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr);
  gap: 14px;
}

.usage-flow,
.usage-profile-panel,
.usage-recent-panel {
  border: 1px solid rgba(68, 68, 68, 0.7);
  border-radius: 8px;
  background: #151716;
}

.usage-flow {
  min-height: 424px;
  overflow: hidden;
}

.usage-flow-canvas {
  position: relative;
  width: 100%;
  min-height: 424px;
  overflow: auto;
}

.usage-flow-edges {
  position: absolute;
  inset: 0;
  width: 720px;
  height: 380px;
  margin: 20px;
  pointer-events: none;
}

.usage-flow-edge-glow,
.usage-flow-edge-track,
.usage-flow-edge-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.usage-flow-edge-glow {
  stroke: rgba(94, 234, 212, 0.16);
  stroke-width: 12;
  filter: blur(5px);
}

.usage-flow-edge-track {
  stroke: rgba(148, 163, 184, 0.2);
  stroke-width: 6;
}

.usage-flow-edge-line {
  stroke: rgba(94, 234, 212, 0.76);
  stroke-dasharray: 10 8;
  stroke-width: 2.35;
}

.usage-flow-arrow-head {
  fill: #5eead4;
  stroke: none;
}

.usage-flow-pulse {
  fill: #5eead4;
  filter: drop-shadow(0 0 8px rgba(94, 234, 212, 0.72));
  opacity: 0.95;
}

@media (prefers-reduced-motion: reduce) {
  .usage-flow-pulse {
    display: none;
  }
}

.usage-flow-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 158px;
  min-height: 64px;
  gap: 9px;
  border: 1px solid rgba(68, 68, 68, 0.78);
  border-radius: 8px;
  background: #1f1f1e;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  padding: 12px;
  transform: translate(20px, 20px);
}

.usage-flow-node[data-profile-id]:not([data-profile-id=""]) {
  cursor: pointer;
}

.usage-flow-node[data-profile-id]:not([data-profile-id=""]):hover,
.usage-flow-node[data-profile-id]:not([data-profile-id=""]):focus-visible {
  border-color: rgba(45, 212, 191, 0.72);
  outline: none;
}

.usage-flow-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 999px;
  background: radial-gradient(circle at 35% 25%, rgba(94, 234, 212, 0.18), rgba(94, 234, 212, 0.05));
  color: #5eead4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 22px rgba(0, 0, 0, 0.24);
}

.usage-flow-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.usage-flow-icon[data-icon="bolt"] svg path {
  fill: currentColor;
  stroke: none;
}

.usage-flow-badges {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.usage-flow-badges span {
  max-width: 66px;
  overflow: hidden;
  border: 1px solid rgba(68, 68, 68, 0.72);
  border-radius: 999px;
  background: rgba(9, 11, 10, 0.42);
  color: #d1d5db;
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
  padding: 5px 7px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.usage-flow-node-request { border-color: rgba(229, 106, 74, 0.62); }
.usage-flow-node-profile { border-color: rgba(45, 212, 191, 0.62); }
.usage-flow-node-captcha { border-color: rgba(167, 139, 250, 0.62); }
.usage-flow-node-failed { border-color: rgba(248, 113, 113, 0.68); }
.usage-flow-node-ok { border-color: rgba(34, 197, 94, 0.62); }
.usage-flow-node-center,
.usage-flow-node-center-warn {
  z-index: 2;
  border-color: rgba(45, 212, 191, 0.72);
  background: #202422;
  text-align: center;
}

.usage-flow-node-center-warn {
  border-color: rgba(248, 113, 113, 0.72);
}

.usage-flow-node-center .usage-flow-icon,
.usage-flow-node-center-warn .usage-flow-icon {
  width: 48px;
  height: 48px;
}

.usage-flow-node-center .usage-flow-icon svg,
.usage-flow-node-center-warn .usage-flow-icon svg {
  width: 25px;
  height: 25px;
}

.usage-flow-node-chrome,
.usage-flow-node-chrome-warn {
  border-color: rgba(229, 106, 74, 0.54);
}

.usage-flow-node-chrome-warn {
  border-color: rgba(248, 113, 113, 0.64);
}

.usage-flow-node-selected {
  border-color: rgba(244, 181, 156, 0.9);
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.16), rgba(229, 106, 74, 0.13)), #202422;
  box-shadow:
    0 0 0 1px rgba(244, 181, 156, 0.28),
    0 0 34px rgba(45, 212, 191, 0.18),
    0 18px 40px rgba(0, 0, 0, 0.34);
}

.usage-flow-node-selected .usage-flow-icon {
  border-color: rgba(244, 181, 156, 0.62);
  background: radial-gradient(circle at 35% 25%, rgba(244, 181, 156, 0.28), rgba(45, 212, 191, 0.1));
  color: #f4b59c;
}

.usage-flow-node-selected .usage-flow-badges span {
  border-color: rgba(244, 181, 156, 0.38);
  color: #f8d5c6;
}

.usage-profile-panel,
.usage-recent-panel {
  padding: 14px;
}

.usage-profile-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 424px;
}

.usage-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.usage-section-head strong {
  color: #ededed;
  font-size: 14px;
}

.usage-section-head span {
  color: #9ca3af;
  font-size: 12px;
}

.usage-recent-head-actions,
.usage-recent-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.usage-recent-head-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.usage-recent-pagination {
  border: 1px solid rgba(68, 68, 68, 0.68);
  border-radius: 8px;
  background: rgba(9, 11, 10, 0.28);
  padding: 3px;
}

.usage-recent-page-size {
  height: 28px;
  min-width: 58px;
  border: 0;
  border-right: 1px solid rgba(68, 68, 68, 0.68);
  background: transparent;
  color: #d1d5db;
  font-size: 11px;
  font-weight: 760;
  outline: none;
  padding: 0 6px;
}

.usage-recent-page-label {
  min-width: 44px;
  color: #d1d5db;
  font-size: 11px;
  font-weight: 760;
  text-align: center;
}

.usage-recent-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  border-top: 1px solid rgba(68, 68, 68, 0.48);
  padding-top: 10px;
}

.usage-recent-footer > span {
  color: #9ca3af;
  font-size: 12px;
}

.usage-profile-rows {
  display: grid;
  min-height: 0;
  overflow: auto;
  align-content: start;
  gap: 8px;
}

.usage-profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(68, 68, 68, 0.56);
  border-radius: 8px;
  background: #1b1d1c;
  cursor: pointer;
  padding: 10px;
  text-align: left;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.usage-profile-row:hover,
.usage-profile-row:focus-visible {
  border-color: rgba(45, 212, 191, 0.5);
  background: #202322;
  outline: none;
}

.usage-profile-row-selected {
  border-color: rgba(244, 181, 156, 0.72);
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(229, 106, 74, 0.1)), #202322;
  box-shadow: inset 3px 0 0 rgba(244, 181, 156, 0.82);
}

.usage-profile-row strong,
.usage-profile-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-profile-row strong {
  color: #ededed;
  font-size: 13px;
}

.usage-profile-row span {
  color: #8f949b;
  font-size: 11px;
}

.usage-profile-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.usage-profile-stats span {
  color: #d1d5db;
  font-size: 11px;
  font-weight: 700;
}

.usage-recent-panel {
  margin-top: 14px;
}

.usage-table-wrap {
  overflow: auto;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.usage-table th,
.usage-table td {
  border-bottom: 1px solid rgba(68, 68, 68, 0.56);
  color: #d1d5db;
  font-size: 12px;
  overflow: hidden;
  padding: 10px 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-table th {
  color: #9ca3af;
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.usage-generation-action {
  display: inline-flex;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(68, 68, 68, 0.72);
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.55);
  padding: 3px 7px;
  color: #9ca3af;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-generation-action-image_generation {
  border-color: rgba(45, 212, 191, 0.44);
  background: rgba(45, 212, 191, 0.12);
  color: #99f6e4;
}

.usage-generation-action-video_generation {
  border-color: rgba(244, 181, 156, 0.46);
  background: rgba(229, 106, 74, 0.12);
  color: #f8d5c6;
}

.usage-event-row {
  cursor: pointer;
}

.usage-event-row:hover td,
.usage-event-row:focus td,
.usage-event-expanded td {
  background: rgba(255, 255, 255, 0.035);
}

.usage-event-row:focus {
  outline: 1px solid rgba(45, 212, 191, 0.58);
  outline-offset: -1px;
}

.usage-event-caret {
  display: inline-block;
  margin-right: 6px;
  color: #5eead4;
  font-size: 10px;
  font-weight: 900;
}

.usage-event-details-row td {
  background: #151716;
  white-space: normal;
}

.usage-event-error {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.08);
  padding: 9px 10px;
}

.usage-event-error strong {
  color: #fca5a5;
  font-size: 10px;
  text-transform: uppercase;
}

.usage-event-error span {
  color: #fecaca;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.usage-event-details {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  border: 1px solid rgba(68, 68, 68, 0.56);
  border-radius: 8px;
  background: #0f1110;
  color: #d1d5db;
  padding: 10px;
  white-space: pre-wrap;
}

.usage-channel {
  display: inline-flex;
  min-width: 24px;
  justify-content: center;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.08);
  color: #99f6e4;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
}

.usage-kind {
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(107, 114, 128, 0.18);
  color: #d1d5db;
  font-size: 11px;
  font-weight: 760;
}

.usage-kind-captcha {
  background: rgba(167, 139, 250, 0.16);
  color: #c4b5fd;
}

.usage-good { color: #22c55e !important; }
.usage-bad { color: #fda4af !important; }
.usage-empty,
.usage-empty-cell {
  color: #8f949b;
  font-size: 12px;
  padding: 16px 10px;
}

@media (max-width: 920px) {
  .usage-metric-grid,
  .usage-layout {
    grid-template-columns: 1fr;
  }

  .usage-profile-row {
    grid-template-columns: 1fr;
  }
}

.collapsible-panel {
  align-self: start;
}

.panel-collapse-content {
  display: block;
}

.collapsible-panel.is-collapsed .panel-collapse-content {
  display: none !important;
}

.collapsible-panel.is-collapsed .panel-title {
  margin-bottom: 0;
}

.panel-collapse-toggle {
  flex: 0 0 auto;
  font-size: 13px;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.settings-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  border-top: 1px solid rgba(68, 68, 68, 0.55);
  padding-top: 16px;
}

.settings-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.settings-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.settings-section-title span {
  color: #ededed;
  font-size: 13px;
  font-weight: 800;
}

.settings-section-title strong {
  min-width: 0;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-field-wide {
  grid-column: 1 / -1;
}

.settings-path-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(68, 68, 68, 0.6);
  border-radius: 10px;
  background: rgba(31, 31, 30, 0.55);
  padding: 10px 12px;
}

.settings-path-note span {
  color: #9ca3af;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.settings-path-note strong {
  color: #d6d3cf;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.agent-connection-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.agent-connection-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.14);
}

.agent-connection-ready {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16), 0 0 12px rgba(34, 197, 94, 0.38);
}

.agent-connection-missing {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.16);
}

.agent-connection-error {
  background: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.16);
}

.settings-status {
  color: #9ca3af;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.settings-status.ok { color: #22c55e; }
.settings-status.warn { color: #fbbf24; }
.settings-status.error { color: #f87171; }

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid rgba(68, 68, 68, 0.55);
  padding-top: 16px;
}

@media (max-width: 720px) {
  .settings-grid { grid-template-columns: 1fr; }
  .user-form { grid-template-columns: 1fr; }
  .user-form-actions { justify-content: flex-end; }
  .settings-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .settings-section-title strong {
    text-align: left;
    white-space: normal;
  }
}

.btn-compact {
  height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 11px;
  line-height: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-command {
  width: 38px;
  min-width: 38px;
  padding: 0;
  font-size: 15px;
}

.app-version-pill {
  cursor: pointer;
  line-height: 1;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.app-version-pill:hover,
.app-version-pill:focus {
  border-color: rgba(229, 106, 74, 0.58);
  background: rgba(229, 106, 74, 0.14);
  color: #f4b59c;
  outline: none;
}

.update-status {
  overflow: hidden;
  color: #d6d3cf;
  font-size: 13px;
  font-weight: 680;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  white-space: normal;
}

.update-status.ok {
  color: #86efac;
}

.update-status.available,
.update-status.working {
  color: #fde68a;
}

.update-status.error {
  color: #fda4af;
}

.profile-view-tabs {
  display: inline-flex;
  gap: 2px;
  border: 1px solid rgba(51, 51, 51, 0.85);
  border-radius: 9px;
  background: rgba(26, 26, 26, 0.55);
  padding: 2px;
}

.profile-view-tab {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}

.profile-view-tab:hover {
  background: rgba(51, 51, 51, 0.75);
  color: #ededed;
}

.profile-view-tab.active {
  background: rgba(229, 106, 74, 0.18);
  color: #f4b59c;
}

.provider-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.provider-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(51, 51, 51, 0.85);
  border-radius: 10px;
  background: rgba(26, 26, 26, 0.42);
  color: #d6d3cf;
  padding: 9px;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.provider-option:hover {
  border-color: rgba(229, 106, 74, 0.42);
  background: rgba(38, 38, 38, 0.9);
  color: #ededed;
}

.provider-option.active {
  border-color: rgba(229, 106, 74, 0.55);
  background: rgba(229, 106, 74, 0.13);
  color: #f7f4f0;
}

.provider-option-icon,
.profile-provider-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: #f7f4f0;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.provider-option-icon.flow,
.profile-provider-icon.flow {
  border: 1px solid rgba(229, 106, 74, 0.34);
  background: rgba(229, 106, 74, 0.18);
  color: #f4b59c;
}

.provider-option-icon.grok,
.profile-provider-icon.grok {
  border: 1px solid rgba(238, 141, 106, 0.38);
  background: rgba(229, 106, 74, 0.18);
  color: #f4b59c;
}

.provider-option-copy {
  display: grid;
  min-width: 0;
}

.provider-option-copy strong {
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
}

.provider-option-copy small {
  overflow: hidden;
  color: #9ca3af;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-option-check {
  display: none;
  margin-left: auto;
  color: #22c55e;
  font-size: 13px;
  font-weight: 900;
}

.provider-option.active .provider-option-check {
  display: inline-flex;
}

.profile-create-form {
  display: grid;
  gap: 12px;
}

.profile-create-name {
  min-width: 0;
}

.profile-create-grid {
  display: grid;
  grid-template-columns: minmax(80px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
}

.label-generate-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  min-width: 0;
}

.label-generate-wrap input {
  min-width: 0;
}

.label-generate-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.profile-create-submit {
  width: 100%;
  font-size: 20px;
  line-height: 1;
}

.profile-defaults {
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: flex-end;
}

.profile-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 210px) minmax(78px, 96px);
  gap: 10px;
  margin-bottom: 10px;
  align-items: end;
}

.profile-search-wrap,
.profile-filter-wrap,
.profile-page-size-wrap {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.profile-search-wrap span,
.profile-filter-wrap span,
.profile-page-size-wrap span {
  color: #6b7280;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.profile-search-wrap input,
.profile-filter-wrap select,
.profile-page-size-wrap select {
  width: 100%;
  height: 36px;
  min-width: 0;
  border: 1px solid rgba(68, 68, 68, 0.72);
  border-radius: 9px;
  background: rgba(31, 31, 30, 0.88);
  color: #ededed;
  font-size: 12px;
  outline: none;
  padding: 0 10px;
}

.profile-search-wrap input::placeholder {
  color: #6b7280;
}

.profile-search-wrap input:focus,
.profile-filter-wrap select:focus,
.profile-page-size-wrap select:focus {
  border-color: rgba(229, 106, 74, 0.6);
  box-shadow: 0 0 0 3px rgba(229, 106, 74, 0.16);
}

.profile-list-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: #9ca3af;
  font-size: 12px;
}

.profile-list {
  display: grid;
  gap: 8px;
}

.profile-list-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-list .profile-empty {
  display: block;
  grid-column: 1 / -1;
}

.profile-pagination {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-page-label {
  min-width: 52px;
  color: #d6d3cf;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  text-align: center;
}

.profile-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #333333;
  border-radius: 8px;
  background: rgba(38, 38, 38, 0.72);
  padding: 10px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.profile-card.active {
  border-color: rgba(229, 106, 74, 0.45);
  background: rgba(45, 37, 33, 0.78);
  box-shadow: inset 3px 0 0 rgba(229, 106, 74, 0.78);
}

.profile-card:hover {
  border-color: #333333;
}

.profile-card.profile-expanded {
  border-color: rgba(45, 212, 191, 0.42);
}

.profile-card.active::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 180px at 20% 0%, rgba(229, 106, 74, 0.1), transparent 70%);
  pointer-events: none;
}

.profile-card > * {
  position: relative;
  z-index: 1;
}

.profile-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-identity {
  display: flex;
  flex: 1 1 240px;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.profile-avatar {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(91, 106, 133, 0.45);
  border-radius: 12px;
  background: #262626;
  color: #ededed;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.profile-avatar.is-active {
  border-color: rgba(229, 106, 74, 0.5);
  background:
    linear-gradient(135deg, rgba(229, 106, 74, 0.22), rgba(238, 141, 106, 0.18)),
    #262626;
  color: #f7f4f0;
}

.profile-title-block {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.profile-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: #ededed;
  font-size: 14px;
  font-weight: 650;
}

.profile-name-text,
.profile-subtitle,
.profile-detail-row strong,
.info-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-name-text {
  min-width: 0;
  color: #f7f4f0;
  font-size: 13px;
  font-weight: 800;
}

.profile-subtitle {
  min-width: 0;
  color: #9ca3af;
  font-size: 10px;
}

.profile-status-row {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.profile-connection-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.profile-connection-provider,
.profile-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(51, 51, 51, 0.78);
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.46);
  padding: 3px 7px;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 720;
  line-height: 1.25;
}

.profile-connection-provider {
  font-weight: 850;
}

.profile-connection-provider.flow {
  border-color: rgba(229, 106, 74, 0.34);
  background: rgba(229, 106, 74, 0.11);
  color: #f4b59c;
}

.profile-connection-provider.grok {
  border-color: rgba(238, 141, 106, 0.34);
  background: rgba(229, 106, 74, 0.12);
  color: #f4b59c;
}

.profile-meta-item strong {
  overflow: hidden;
  color: #ededed;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-flow-log {
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(51, 51, 51, 0.75);
  border-radius: 8px;
  background: rgba(26, 26, 26, 0.42);
}

.profile-flow-log-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
  padding: 4px 8px;
  cursor: pointer;
  color: #9ca3af;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.08em;
  list-style: none;
  text-transform: uppercase;
  user-select: none;
}

.profile-flow-log[open] .profile-flow-log-summary {
  border-bottom: 1px solid rgba(51, 51, 51, 0.7);
}

.profile-flow-log-summary::-webkit-details-marker {
  display: none;
}

.profile-flow-log-title {
  flex: 0 0 auto;
}

.profile-flow-log-summary strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0;
  text-align: right;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.profile-flow-log-toggle {
  flex: 0 0 auto;
  color: #6b7280;
  font-size: 10px;
  line-height: 1;
  transition: transform 140ms ease, color 140ms ease;
}

.profile-flow-log[open] .profile-flow-log-toggle {
  color: #d6d3cf;
  transform: rotate(180deg);
}

.flow-last-success,
.flow-count-success {
  color: #22c55e;
}

.flow-last-failed,
.flow-count-failed {
  color: #fda4af;
}

.flow-last-idle {
  color: #6b7280;
}

.flow-count-retry {
  color: #fbbf24;
}

.profile-flow-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.profile-flow-table th,
.profile-flow-table td {
  padding: 5px 6px;
  text-align: center;
  white-space: nowrap;
}

.profile-flow-table th {
  border-bottom: 1px solid rgba(51, 51, 51, 0.52);
  color: #6b7280;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-flow-table td {
  color: #ededed;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  font-weight: 800;
}

.active-chip {
  display: inline-flex;
  height: 18px;
  align-items: center;
  border: 1px solid rgba(229, 106, 74, 0.38);
  border-radius: 999px;
  background: rgba(229, 106, 74, 0.12);
  padding: 0 7px;
  color: #f4b59c;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.headless-chip {
  display: inline-flex;
  height: 18px;
  align-items: center;
  border: 1px solid rgba(107, 114, 128, 0.42);
  border-radius: 999px;
  background: rgba(107, 114, 128, 0.12);
  padding: 0 7px;
  color: #cbd5e1;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.headless-chip.on {
  border-color: rgba(45, 212, 191, 0.38);
  background: rgba(45, 212, 191, 0.12);
  color: #99f6e4;
}

.profile-stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.profile-stat {
  min-width: 0;
  border: 1px solid rgba(51, 51, 51, 0.8);
  border-radius: 10px;
  background: rgba(26, 26, 26, 0.5);
  padding: 9px 10px;
}

.profile-stat span {
  display: block;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-stat strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #ededed;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-value.ready {
  color: #22c55e;
}

.status-value.starting {
  color: #fbbf24;
}

.status-value.error {
  color: #fda4af;
}

.bridge-value.connected {
  color: #22c55e;
}

.bridge-value.disconnected {
  color: #fda4af;
}

.profile-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  border: 1px solid rgba(51, 51, 51, 0.7);
  border-radius: 8px;
  background: rgba(26, 26, 26, 0.38);
  padding: 8px 9px;
}

.profile-details > span {
  display: inline-flex;
  min-width: min(220px, 100%);
  max-width: 100%;
  gap: 6px;
  align-items: center;
  color: #6b7280;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-details > span strong {
  min-width: 0;
  overflow: hidden;
  color: #d6d3cf;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.profile-detail-row {
  display: grid;
  grid-template-columns: minmax(78px, max-content) minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 4px;
  align-items: baseline;
  min-width: 0;
}

.profile-detail-row span {
  color: #6b7280;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.profile-detail-row strong {
  display: block;
  min-width: 0;
  color: #d6d3cf;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  font-weight: 600;
}

.profile-error {
  flex: 1 1 100%;
  overflow: hidden;
  border: 1px solid rgba(244, 63, 94, 0.32);
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.1);
  padding: 8px 10px;
  color: #fda4af;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: normal;
}

.profile-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  border-top: 1px solid rgba(51, 51, 51, 0.62);
  padding-top: 8px;
}

.profile-primary-actions,
.profile-utility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.profile-primary-actions {
  flex: 1 1 420px;
  justify-content: flex-start;
}

.profile-headless-toggle {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(51, 51, 51, 0.72);
  border-radius: 8px;
  background: rgba(26, 26, 26, 0.42);
  padding: 0 9px;
  color: #d6d3cf;
  cursor: pointer;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

.profile-headless-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #2dd4bf;
}

.profile-headless-toggle:has(input:checked) {
  border-color: rgba(45, 212, 191, 0.34);
  background: rgba(45, 212, 191, 0.08);
  color: #99f6e4;
}

.profile-utility-actions {
  flex: 0 1 auto;
  justify-content: flex-end;
  margin-left: auto;
}

.profile-action {
  display: inline-flex;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #333333;
  border-radius: 8px;
  background: #262626;
  padding: 0 10px;
  color: #d6d3cf;
  font-size: 12px;
  font-weight: 760;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 120ms ease, opacity 160ms ease;
}

.profile-action.icon-only {
  width: 30px;
  min-width: 30px;
  padding: 0;
  font-size: 13px;
}

.profile-expanded-details {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 8px;
  background: rgba(15, 17, 16, 0.82);
  padding: 10px;
}

.profile-expanded-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-expanded-grid span {
  display: grid;
  min-width: 0;
  gap: 3px;
  border: 1px solid rgba(68, 68, 68, 0.56);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  padding: 8px;
}

.profile-expanded-grid small {
  color: #8f949b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-expanded-grid strong {
  overflow: hidden;
  color: #ededed;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-expanded-error {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.08);
  padding: 9px 10px;
}

.profile-expanded-error strong {
  color: #fca5a5;
  font-size: 10px;
  text-transform: uppercase;
}

.profile-expanded-error span {
  color: #fecaca;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.profile-expanded-json {
  max-height: 300px;
  overflow: auto;
  margin: 0;
  border: 1px solid rgba(68, 68, 68, 0.56);
  border-radius: 8px;
  background: #0f1110;
  color: #d1d5db;
  padding: 10px;
  white-space: pre-wrap;
}

.profile-list-table .profile-card {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(220px, 0.95fr) minmax(190px, 0.75fr);
  gap: 7px 10px;
  align-items: center;
  padding: 8px 10px;
}

.profile-list-table .profile-card-top {
  margin: 0;
  border: 0;
  padding: 0;
}

.profile-list-table .profile-card-top {
  min-width: 0;
}

.profile-list-table .profile-identity {
  flex-basis: auto;
}

.profile-list-table .profile-provider-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 10px;
}

.profile-list-table .profile-subtitle {
  display: none;
}

.profile-list-table .profile-status-row {
  margin-left: auto;
}

.profile-list-table .profile-connection-strip {
  margin: 0;
  min-width: 0;
}

.profile-list-table .profile-flow-log {
  margin: 0;
  min-width: 0;
}

.profile-list-table .profile-flow-log-summary {
  min-height: 24px;
  padding: 3px 7px;
}

.profile-list-table .profile-flow-table th,
.profile-list-table .profile-flow-table td {
  padding: 4px 5px;
}

.profile-list-table .profile-details {
  display: none;
}

.profile-list-table .profile-card-actions {
  grid-column: 1 / -1;
  justify-content: space-between;
  margin: 2px 0 0;
  border-top: 1px solid rgba(51, 51, 51, 0.55);
  padding-top: 6px;
}

.profile-list-table .profile-expanded-details {
  grid-column: 1 / -1;
}

.profile-list-table .profile-primary-actions {
  flex: 1 1 auto;
  justify-content: flex-start;
}

.profile-list-table .profile-headless-toggle {
  flex: 0 0 auto;
}

.profile-list-table .profile-utility-actions {
  flex: 0 0 auto;
}

.profile-list-table .bridge-chip {
  display: none;
}

.profile-list-grid .profile-card {
  min-width: 0;
}

.profile-list-grid .profile-card-actions {
  align-items: flex-start;
}

.profile-action.primary {
  border-color: rgba(229, 106, 74, 0.44);
  background: rgba(229, 106, 74, 0.16);
  color: #f4b59c;
}

.profile-action.close-session {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.profile-action.close-session:hover {
  border-color: rgba(248, 113, 113, 0.58);
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
}

.profile-action:hover {
  border-color: rgba(229, 106, 74, 0.55);
  background: #262626;
  color: #ededed;
}

.profile-action:active {
  transform: translateY(1px);
}

.profile-action:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.profile-empty {
  text-align: center;
}

.profile-empty-icon {
  font-size: 30px;
  line-height: 1;
}

.profile-empty-title {
  margin-top: 8px;
  color: #ededed;
  font-size: 14px;
  font-weight: 700;
}

.profile-empty-copy {
  margin-top: 4px;
  color: #9ca3af;
  font-size: 12px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #4a4a4a;
}

.dot.ready {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.dot.starting {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
}

.dot.error {
  background: #fb7185;
  box-shadow: 0 0 0 3px rgba(244, 114, 128, 0.18);
}

.dot.closed {
  background: #4a4a4a;
}

.provider-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(68, 68, 68, 0.76);
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.5);
  padding: 3px 8px 3px 5px;
  color: #d6d3cf;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.provider-chip span {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0;
}

.provider-chip.flow {
  border-color: rgba(34, 197, 94, 0.34);
  color: #bbf7d0;
}

.provider-chip.flow span {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.provider-chip.grok {
  border-color: rgba(238, 141, 106, 0.38);
  color: #f4b59c;
}

.provider-chip.grok span {
  background: rgba(229, 106, 74, 0.18);
  color: #f4b59c;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #333333;
  border-radius: 999px;
  background: #262626;
  padding: 4px 10px;
  color: #ededed;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-chip.ready {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

.status-chip.background {
  border-color: rgba(45, 212, 191, 0.58);
  background: rgba(45, 212, 191, 0.14);
  color: #99f6e4;
}

.status-chip.starting {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
}

.status-chip.error {
  border-color: rgba(244, 63, 94, 0.6);
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
}

.status-chip.closed {
  border-color: #333333;
  background: #262626;
  color: #d6d3cf;
}

.bridge-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #333333;
  border-radius: 999px;
  background: #262626;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.25;
  white-space: nowrap;
}

.bridge-chip.connected {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.bridge-chip.disconnected {
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
}

.channel-badge {
  display: inline-flex;
  height: 24px;
  align-items: center;
  border: 1px solid rgba(238, 141, 106, 0.4);
  border-radius: 999px;
  background: rgba(229, 106, 74, 0.1);
  padding: 0 10px;
  color: #f4b59c;
  font-size: 11px;
  font-weight: 600;
}

.icon-btn {
  display: inline-flex;
  width: auto;
  min-width: 34px;
  max-width: 100%;
  flex: 0 0 auto;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #333333;
  border-radius: 8px;
  background: #262626;
  color: #ededed;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  padding: 0 8px;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease, opacity 160ms ease;
}

.icon-btn:hover {
  border-color: rgba(229, 106, 74, 0.6);
  background: #333333;
}

.icon-btn:active {
  transform: translateY(1px);
}

.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.icon-btn.danger {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.15);
  color: #fecdd3;
}

.icon-btn.danger:hover {
  border-color: rgba(251, 113, 133, 0.65);
  background: rgba(244, 63, 94, 0.25);
}

.icon-btn.amber-on {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

@keyframes bridge-shimmer {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

@media (max-width: 760px) {
  .provider-picker,
  .profile-create-grid {
    grid-template-columns: 1fr;
  }

  .profile-list-grid,
  .profile-list-table {
    grid-template-columns: 1fr;
  }

  .profile-list-table .profile-card {
    grid-template-columns: 1fr;
  }

  .profile-list-table .profile-card-actions {
    justify-content: flex-start;
  }

  .profile-toolbar {
    grid-template-columns: 1fr;
  }

  .profile-list-status {
    align-items: stretch;
    flex-direction: column;
  }

  .usage-recent-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .usage-recent-footer .usage-recent-pagination {
    justify-content: space-between;
  }

  .profile-pagination {
    justify-content: space-between;
  }

  .profile-card-top,
  .profile-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-status-row {
    width: 100%;
    justify-content: flex-start;
  }

  .profile-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-expanded-grid {
    grid-template-columns: 1fr;
  }

  .profile-primary-actions,
  .profile-utility-actions {
    width: 100%;
  }

  .profile-action {
    flex: 1;
  }

  .profile-detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

#log::-webkit-scrollbar,
#profiles::-webkit-scrollbar { width: 10px; height: 10px; }
#log::-webkit-scrollbar-thumb,
#profiles::-webkit-scrollbar-thumb { background: #333333; border-radius: 6px; }
#log::-webkit-scrollbar-track,
#profiles::-webkit-scrollbar-track { background: transparent; }

/* Cookie modal */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cookie-modal[hidden] {
  display: none;
}

.cookie-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 9, 0.72);
  backdrop-filter: blur(6px);
}

.cookie-modal-card {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid #333333;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 27, 41, 0.98), rgba(26, 26, 26, 0.98));
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(238, 141, 106, 0.18);
  padding: 22px 22px 20px;
  color: #ededed;
}

.app-info-modal-card {
  width: min(760px, 100%);
}

.bridge-info-modal-card {
  width: min(760px, 100%);
}

.socket-info-modal-card {
  width: min(760px, 100%);
}

.bridge-info-grid {
  margin-top: 14px;
}

.socket-info-grid {
  margin-top: 14px;
}

.socket-info-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  border: 1px solid rgba(68, 68, 68, 0.68);
  border-radius: 999px;
  background: rgba(31, 31, 30, 0.58);
  padding: 8px 12px;
}

.socket-info-status strong {
  color: #ededed;
  font-size: 13px;
  font-weight: 800;
}

.bridge-info-actions {
  justify-content: flex-start;
}

.app-info-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-info-section {
  margin-top: 14px;
  border: 1px solid rgba(51, 51, 51, 0.7);
  border-radius: 10px;
  background: rgba(26, 26, 26, 0.34);
  padding: 14px;
}

.app-info-section-title {
  margin-bottom: 10px;
  color: #9ca3af;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.app-info-update-grid {
  display: grid;
  grid-template-columns: 1fr 0.75fr 1fr;
  gap: 12px;
}

.app-info-update-grid > div {
  min-width: 0;
}

.app-info-update-actions {
  justify-content: flex-start;
}

.app-info-changelog {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  border: 1px solid rgba(51, 51, 51, 0.72);
  border-radius: 9px;
  background: #1f1f1e;
  padding: 10px 12px;
  color: #d6d3cf;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .app-info-meta,
  .app-info-update-grid {
    grid-template-columns: 1fr;
  }
}

.rename-modal-card {
  width: min(440px, 100%);
}

.rename-modal-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #333333;
  border-radius: 10px;
  background: #1f1f1e;
  padding: 10px 12px;
  color: #ededed;
  font: inherit;
}

.rename-modal-input:focus {
  outline: none;
  border-color: rgba(229, 106, 74, 0.65);
  box-shadow: 0 0 0 3px rgba(229, 106, 74, 0.16);
}

.cookie-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cookie-modal-title {
  font-size: 16px;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.cookie-modal-subtitle {
  margin-top: 2px;
  color: #9ca3af;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
}

.cookie-modal-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(51, 51, 51, 0.7);
  border-radius: 10px;
  background: rgba(26, 26, 26, 0.4);
}

.cookie-modal-meta div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cookie-modal-meta dt {
  margin: 0;
  color: #6b7280;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cookie-modal-meta dd {
  margin: 0;
  overflow: hidden;
  color: #d6d3cf;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cookie-state-valid { color: #22c55e; }
.cookie-state-unknown { color: #fde68a; }
.cookie-state-expired,
.cookie-state-missing { color: #fda4af; }

.captcha-test-ok { color: #22c55e; }
.captcha-test-fail { color: #fda4af; }
.captcha-test-none { color: #6b7280; }

.cookie-modal-value-label {
  display: block;
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.modal-field-spaced {
  margin-top: 12px;
}

.cookie-modal-value {
  width: 100%;
  height: 168px;
  resize: vertical;
  border: 1px solid #333333;
  border-radius: 10px;
  background: #1f1f1e;
  padding: 10px 12px;
  color: #ededed;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 11.5px;
  line-height: 1.45;
  word-break: break-all;
}

.cookie-modal-value:focus {
  outline: none;
  border-color: rgba(238, 141, 106, 0.55);
  box-shadow: 0 0 0 3px rgba(229, 106, 74, 0.18);
}

.cookie-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.cookie-modal-hint {
  margin-top: 12px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.1);
  padding: 10px 12px;
  color: #fde68a;
  font-size: 12px;
  line-height: 1.5;
}

/* ─── Log Manager ─────────────────────────────────────────────────────── */

.log-manager .panel-title {
  flex-wrap: wrap;
  gap: 8px;
}

.log-stats-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #22c55e;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.log-stats-counts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 10.5px;
  color: #9ca3af;
  text-transform: none;
  letter-spacing: 0;
}

.log-stats-counts .lc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.log-stats-counts .lc-debug strong { color: #94a3b8; }
.log-stats-counts .lc-info strong  { color: #d6d3cf; }
.log-stats-counts .lc-warn strong  { color: #fbbf24; }
.log-stats-counts .lc-error strong { color: #f87171; }

.log-toolbar {
  display: grid;
  grid-template-columns: auto 1fr 1.2fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

@media (max-width: 880px) {
  .log-toolbar { grid-template-columns: 1fr; }
}

.log-level-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(68, 68, 68, 0.6);
  background: rgba(31, 31, 30, 0.55);
}

.log-level-chip {
  appearance: none;
  border: 0;
  background: transparent;
  color: #d6d3cf;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.log-level-chip:hover { background: rgba(51, 51, 51, 0.8); color: #ededed; }
.log-level-chip.active { background: rgba(229, 106, 74, 0.18); color: #f4b59c; box-shadow: inset 0 0 0 1px rgba(167,139,250,0.45); }
.log-level-chip.log-chip-debug.active { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; box-shadow: inset 0 0 0 1px rgba(148,163,184,0.45); }
.log-level-chip.log-chip-warn.active  { background: rgba(251, 191, 36, 0.18); color: #fde68a; box-shadow: inset 0 0 0 1px rgba(251,191,36,0.5); }
.log-level-chip.log-chip-error.active { background: rgba(248, 113, 113, 0.18); color: #fecaca; box-shadow: inset 0 0 0 1px rgba(248,113,113,0.5); }

.log-source-select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(68, 68, 68, 0.7);
  background: rgba(31, 31, 30, 0.85);
  color: #ededed;
  font-size: 12px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.log-source-select:focus {
  border-color: rgba(238, 141, 106, 0.6);
  box-shadow: 0 0 0 3px rgba(229, 106, 74, 0.18);
}

.log-search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(68, 68, 68, 0.7);
  background: rgba(31, 31, 30, 0.85);
  color: #ededed;
  font-size: 12px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.log-search-input::placeholder { color: #6b7280; }
.log-search-input:focus {
  border-color: rgba(229, 106, 74, 0.6);
  box-shadow: 0 0 0 3px rgba(229, 106, 74, 0.18);
}

.log-viewport {
  height: 360px;
  min-height: 240px;
  max-height: 60vh;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(68, 68, 68, 0.7);
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.85), rgba(31, 31, 30, 0.85));
  padding: 6px 4px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  scrollbar-color: rgba(91, 106, 133, 0.4) transparent;
}

.log-viewport::-webkit-scrollbar { width: 10px; }
.log-viewport::-webkit-scrollbar-thumb { background: rgba(91, 106, 133, 0.4); border-radius: 6px; }

.log-row {
  display: grid;
  grid-template-columns: 78px 60px 110px 1fr;
  gap: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  color: #d6d3cf;
  align-items: baseline;
}
.log-row + .log-row { border-top: 1px solid rgba(51, 51, 51, 0.55); }
.log-row:hover { background: rgba(51, 51, 51, 0.55); }
.log-row.expanded { background: rgba(51, 51, 51, 0.65); }

.log-row .lr-time { color: #6b7280; font-size: 10.5px; white-space: nowrap; }
.log-row .lr-level {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  align-self: center;
}
.log-row .lr-source {
  font-size: 10.5px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-row .lr-message {
  color: #ededed;
  word-break: break-word;
  white-space: pre-wrap;
  cursor: pointer;
}
.log-row .lr-message .lr-toggle {
  color: #6b7280;
  font-size: 10px;
  margin-left: 6px;
}

.log-truncated-note {
  color: #94a3b8;
  font-size: 10px;
  margin-left: 6px;
}

.log-row.lvl-debug .lr-level { background: rgba(148, 163, 184, 0.15); border-color: rgba(148, 163, 184, 0.4); color: #cbd5e1; }
.log-row.lvl-info  .lr-level { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35); color: #22c55e; }
.log-row.lvl-warn  .lr-level { background: rgba(251, 191, 36, 0.15); border-color: rgba(251, 191, 36, 0.45); color: #fde68a; }
.log-row.lvl-error .lr-level { background: rgba(248, 113, 113, 0.16); border-color: rgba(248, 113, 113, 0.5); color: #fecaca; }

.log-row.lvl-warn  { background: rgba(251, 191, 36, 0.04); }
.log-row.lvl-error { background: rgba(248, 113, 113, 0.06); }
.log-row.lvl-error .lr-message { color: #fecaca; }

.log-details {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(68, 68, 68, 0.5);
  background: rgba(26, 26, 26, 0.7);
  color: #d6d3cf;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-empty {
  padding: 18px 14px;
  text-align: center;
  color: #6b7280;
  font-size: 12px;
}

.cookie-modal-hint[data-tone="info"] {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(229, 106, 74, 0.1);
  color: #86efac;
}

.icon-btn.ghost.violet-on {
  border-color: rgba(238, 141, 106, 0.5);
  background: rgba(229, 106, 74, 0.18);
  color: #f4b59c;
}

.agent-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1100;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(229, 106, 74, 0.65);
  border-radius: 999px;
  background: linear-gradient(135deg, #E56A4A, #ee8d6a);
  color: #1a1a1a;
  font-size: 23px;
  font-weight: 900;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.agent-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 1101;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(460px, calc(100vw - 24px));
  height: min(720px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid #333333;
  border-radius: 10px;
  background: #1a1a1a;
  color: #ededed;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58);
}

.agent-chat-panel[hidden] {
  display: none;
}

.agent-chat-view {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(220px, 1fr) auto;
}

.agent-chat-view[hidden],
.agent-skill-view[hidden] {
  display: none;
}

.agent-fab,
.agent-chat-panel,
.agent-chat-panel * {
  pointer-events: auto;
}

.agent-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #333333;
  background: #262626;
}

.agent-chat-title {
  font-size: 15px;
  font-weight: 800;
}

.agent-chat-subtitle {
  margin-top: 2px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9ca3af;
  font-size: 11px;
}

.agent-chat-header-actions {
  display: flex;
  gap: 6px;
}

.agent-skill-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(51, 51, 51, 0.7);
}

.agent-skill-chip {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(229, 106, 74, 0.35);
  border-radius: 999px;
  background: rgba(229, 106, 74, 0.12);
  color: #f4b59c;
  font-size: 11px;
  font-weight: 700;
}

.agent-context-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(51, 51, 51, 0.7);
  color: #9ca3af;
  font-size: 11px;
}

.agent-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  background: #1a1a1a;
}

.agent-message {
  margin-bottom: 12px;
}

.agent-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 800;
}

.agent-copy-btn {
  width: 26px;
  height: 24px;
  border: 1px solid #333333;
  border-radius: 7px;
  background: #262626;
  color: #ededed;
  font-size: 12px;
}

.agent-message-body {
  max-width: 100%;
  padding: 10px 11px;
  border: 1px solid #333333;
  border-radius: 8px;
  background: #262626;
  color: #ededed;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.agent-message-user .agent-message-body {
  margin-left: 40px;
  border-color: rgba(229, 106, 74, 0.45);
  background: rgba(229, 106, 74, 0.14);
}

.agent-message-body p {
  margin: 0 0 8px;
}

.agent-message-body p:last-child {
  margin-bottom: 0;
}

.agent-message-body h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #f4b59c;
}

.agent-message-body ul {
  margin: 6px 0;
  padding-left: 18px;
}

.agent-message-body code {
  border: 1px solid rgba(68, 68, 68, 0.7);
  border-radius: 5px;
  background: #1a1a1a;
  padding: 1px 4px;
  color: #f4b59c;
}

.agent-message-body pre,
.agent-tool-step pre {
  max-height: 260px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 9px;
  border: 1px solid rgba(68, 68, 68, 0.7);
  border-radius: 8px;
  background: #111111;
  color: #d6d3cf;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-thinking,
.agent-tool-step {
  margin: 7px 0;
}

.agent-thinking summary,
.agent-tool-step summary {
  cursor: pointer;
  color: #f4b59c;
  font-size: 12px;
  font-weight: 800;
}

.agent-tool-step summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.agent-skill-view {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: #1a1a1a;
}

.agent-skill-view-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid rgba(51, 51, 51, 0.7);
  background: #262626;
}

.agent-skill-view-header strong {
  color: #ededed;
  font-size: 13px;
}

.agent-form,
.agent-skill-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #333333;
  background: #262626;
}

.agent-form textarea,
.agent-skill-form input {
  min-width: 0;
  resize: none;
  border: 1px solid #333333;
  border-radius: 8px;
  background: #1a1a1a;
  color: #ededed;
  padding: 9px 10px;
  outline: none;
}

.agent-form textarea:focus,
.agent-skill-form input:focus {
  border-color: rgba(229, 106, 74, 0.7);
}

@media (max-width: 560px) {
  .agent-chat-panel {
    right: 12px;
    bottom: 78px;
    height: min(680px, calc(100vh - 92px));
  }

  .agent-fab {
    right: 14px;
    bottom: 14px;
  }
}
