/* Shared status chrome.
   Owns status colors on components, the neon dot, and the top/input status rails
   for admin, admin_phone, PLDM desktop, and PLDM phone. App CSS must not redefine
   .tb-status or .arc-status-line. */

.tb-status,
.pane-head .tb-status,
.topbar .tb-status {
  display: none !important;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid color-mix(in oklab, var(--st-c, var(--accent)) 28%, transparent);
  border-radius: 99px;
  background: color-mix(in oklab, var(--st-c, var(--accent)) 12%, transparent);
  color: var(--st-c, var(--accent));
  font-family: var(--font-mono, "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace);
  font-size: 10px;
  font-feature-settings: "tnum" 1;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: all .2s ease;
}

.tb-status .neon,
.pane-head .tb-status .neon,
.topbar .tb-status .neon {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--st-c, var(--accent));
  box-shadow:
    0 0 6px var(--st-c, var(--accent)),
    0 0 12px var(--st-c, var(--accent));
  animation: none;
  flex: 0 0 auto;
}

.tb-status .lbl,
.pane-head .tb-status .lbl,
.topbar .tb-status .lbl {
  line-height: 1;
  color: inherit;
  font: inherit;
}

@keyframes tb-neon {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow:
      0 0 6px var(--st-c, var(--accent)),
      0 0 14px var(--st-c, var(--accent));
  }
  50% {
    opacity: .45;
    transform: scale(.7);
    box-shadow: 0 0 2px var(--st-c, var(--accent));
  }
}

[data-status="idle"] .tb-status .neon,
[data-status="ok"] .tb-status .neon {
  animation: none;
}

.conn-dot .dot,
.status-pill::before {
  background: var(--st-c, var(--accent));
}

.topbar {
  animation: none !important;
  box-shadow: none !important;
  border-bottom-color: var(--wv-chrome-line, var(--line)) !important;
}

.arc-status-line {
  position: relative;
  flex: 0 0 auto;
  height: 2px;
  width: 100%;
  overflow: hidden;
  contain: paint;
  clip-path: inset(0);
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      transparent 0%,
      color-mix(in oklab, var(--st-c, var(--accent)) 38%, transparent) 10%,
      color-mix(in oklab, var(--st-c, var(--accent)) 50%, transparent) 50%,
      color-mix(in oklab, var(--st-c, var(--accent)) 38%, transparent) 90%,
      transparent 100%);
  box-shadow: 0 0 10px -3px color-mix(in oklab, var(--st-c, var(--accent)) 42%, transparent);
}

.arc-status-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  width: 22%;
  height: 100%;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      transparent 0%,
      color-mix(in oklab, var(--st-c, var(--accent)) 30%, transparent) 18%,
      color-mix(in oklab, var(--st-c, var(--accent)) 28%, white) 50%,
      color-mix(in oklab, var(--st-c, var(--accent)) 30%, transparent) 82%,
      transparent 100%);
  box-shadow:
    0 0 8px color-mix(in oklab, var(--st-c, var(--accent)) 82%, transparent),
    0 0 18px color-mix(in oklab, var(--st-c, var(--accent)) 52%, transparent),
    0 0 34px color-mix(in oklab, var(--st-c, var(--accent)) 28%, transparent);
  filter: blur(.18px);
  animation: arc-status-sweep 6s ease-in-out infinite alternate;
}

html[data-status="thinking"] .arc-status-line::after,
html[data-status="writing"] .arc-status-line::after,
html[data-status="tool"] .arc-status-line::after {
  animation-duration: 3s;
}

.arc-status-line-top {
  display: none;
}

.arc-status-line-top::after {
  content: none;
}

html[data-theme="light"] .tb-status {
  border-color: color-mix(in oklab, var(--st-c, var(--accent)) 44%, transparent);
  background: color-mix(in oklab, var(--st-c, var(--accent)) 16%, transparent);
}

html[data-theme="light"] .tb-status .neon {
  box-shadow:
    0 0 3px color-mix(in oklab, var(--st-c, var(--accent)) 82%, transparent),
    0 0 7px color-mix(in oklab, var(--st-c, var(--accent)) 52%, transparent);
}

html[data-theme="light"] .arc-status-line {
  background:
    linear-gradient(90deg,
      transparent 0%,
      color-mix(in oklab, var(--st-c, var(--accent)) 54%, transparent) 10%,
      color-mix(in oklab, var(--st-c, var(--accent)) 70%, transparent) 50%,
      color-mix(in oklab, var(--st-c, var(--accent)) 54%, transparent) 90%,
      transparent 100%);
  box-shadow: 0 0 7px -3px color-mix(in oklab, var(--st-c, var(--accent)) 74%, transparent);
}

html[data-theme="light"] .arc-status-line::after {
  background:
    linear-gradient(90deg,
      transparent 0%,
      color-mix(in oklab, var(--st-c, var(--accent)) 34%, transparent) 18%,
      color-mix(in oklab, var(--st-c, var(--accent)) 28%, white) 50%,
      color-mix(in oklab, var(--st-c, var(--accent)) 34%, transparent) 82%,
      transparent 100%);
  box-shadow:
    0 0 8px color-mix(in oklab, var(--st-c, var(--accent)) 82%, transparent),
    0 0 18px color-mix(in oklab, var(--st-c, var(--accent)) 52%, transparent),
    0 0 34px color-mix(in oklab, var(--st-c, var(--accent)) 28%, transparent);
}

html[data-theme="light"] .arc-status-line-top {
  display: none;
}

html[data-theme="light"] .arc-status-line-top::after {
  content: none;
}

@keyframes arc-status-sweep {
  from { transform: translateX(0); opacity: .62; }
  to   { transform: translateX(263.636%); opacity: .96; }
}

@media (prefers-reduced-motion: reduce) {
  .arc-status-line::after { animation: arc-status-sweep 10s ease-in-out infinite alternate; }
  .arc-status-line-top::after { animation: none !important; }
}
