:root {
  color-scheme: dark;
  --bg: #090a0c;
  --panel: #17191f;
  --panel-2: #1e2129;
  --card-bg: #0c0f12;
  --line: #1a1c24;
  --text: #f5f7fb;
  --muted: #9aa3b2;
  --green: #22c55e;
  --green-bg: #12351f;
  --red: #ef4444;
  --red-bg: #3b161a;
  --blue: #60a5fa;
  --violet: #8b5cf6;
  --amber: #f59e0b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.shell {
  min-height: 100vh;
  padding: 20px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto 20px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #22c55e, #2563eb);
  color: white;
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--text);
}
.user-pill {
  background: #090a0c;
  max-width: 300px;
  font-weight: 400;
  /* overflow: hidden;
  text-overflow: ellipsis; */
}

.login-layout, .center-state {
  min-height: calc(100vh - 100px);
  display: grid;
  place-items: center;
}
.login-card, .state-card {
  width: min(520px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.login-card h1, .state-card h1 {
  margin: 8px 0 10px;
  font-size: 34px;
  line-height: 1.1;
}
.login-card p, .state-card p, .section-head p, .hero-band p {
  color: var(--muted);
  line-height: 1.55;
}
.login-actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}
.state-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--amber);
  font-weight: 900;
}
.state-card.danger .state-icon { color: var(--red); }
.eyebrow {
  color: var(--blue);
  text-transform: uppercase;
  font-weight: 400;
  font-size: 12px;
}

.dashboard, .admin-layout {
  max-width: 1240px;
  margin: 0 auto;
}
.hero-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  gap: 20px;
  padding: 34px;
  min-height: 160px;
  background: radial-gradient(ellipse 40% 110% at 80% 115%, 
      rgba(105, 55, 255, 0.38) 0%,
      rgba(105, 55, 255, 0.22) 24%,
      rgba(105, 55, 255, 0.08) 46%,
      rgba(105, 55, 255, 0) 72%
    ),
    linear-gradient(180deg, #10131b 0%,#090b10 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 60px rgba(0, 0, 0, 0.35);
  }
.hero-band::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(145, 105, 255, 0.28) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 55% 70% at 72% 95%,black 0%, transparent 65%);
}
.hero-band h1 {
  margin: 10px 0;
  font-size: 26px;
  font-weight: 400;
}
.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin: 20px 0;
  overflow-x: auto;
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 6px;
  padding: 0 24px;
  line-height: 1;
  white-space: nowrap;
}
.tab.active {
  color: white;
  border-color: #3b1980;
  background: #3b1980;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; margin: 40px 0 0 0; }
.section-head {
  margin: 30px 0;
}
.section-head-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}
.section-head h1, .section-head h2 {
  margin: 0 0 6px;
  font-weight: 400;
}
.section-head p { margin: 0; }
.muted-line {
  min-height: 20px;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  padding-bottom: 86px;
}
.preset-card, .pod-card, .group-card, .preset-form, .preset-edit, .admin-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.preset-card {
  min-width: 0;
  min-height: 382px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--card-bg);
}
.preset-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
}
.preset-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preset-card h3, .pod-card h3 {
  margin: 0;
  font-size: 18px;
}
.preset-card h3 {
  text-align: center;
  min-height: 44px;
  max-height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: clamp(14px, 1.05vw, 18px);
  line-height: 1.15;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.preset-card .meta {
  text-align: center;
  min-height: 38px;
  max-height: 38px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: clamp(11px, .85vw, 13px);
  line-height: 1.35;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.preset-icon-preview {
  display: flex;
  gap: 10px;
  align-items: center;
}
.preset-icon-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.pod-list {
  display: grid;
  gap: 14px;
}
.pod-card {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}
.pod-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-content: start;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: #12141a;
  border: 1px solid var(--line);
}
.status.running { color: #bbf7d0; border-color: #166534; background: var(--green-bg); }
.status.deploying { color: #bfdbfe; border-color: #1d4ed8; background: #111f3a; }
.status.failed, .status.stopped { color: #fecaca; border-color: #7f1d1d; background: var(--red-bg); }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
  align-items: start;
}
.result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  margin: 0;
}
.result-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #11141b;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
.result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .18s ease;
}
.result-thumb.thumb-loaded img {
  opacity: 1;
}
.thumb-shimmer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent),
    #141720;
  background-size: 180% 100%;
  animation: thumb-shimmer 1.1s infinite linear;
}
.result-thumb.thumb-loaded .thumb-shimmer,
.result-thumb.thumb-error .thumb-shimmer {
  display: none;
}
.result-thumb.thumb-error::after {
  content: "preview error";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}
@keyframes thumb-shimmer {
  from { background-position: 180% 0; }
  to { background-position: -180% 0; }
}
.result-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px;
  min-width: 0;
}
.result-card figcaption span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result-card figcaption a {
  flex: 0 0 auto;
  color: #bfdbfe;
  font-size: 12px;
}
.result-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(5, 6, 9, .94);
  padding: 16px;
}
.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 14px;
}
.viewer-toolbar strong {
  display: block;
  max-width: 70vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewer-actions {
  display: flex;
  gap: 8px;
}
.viewer-progress {
  width: min(420px, 70vw);
  height: 5px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #242833;
}
.viewer-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #60a5fa);
  transition: width .18s ease;
}
.viewer-stage {
  display: grid;
  place-items: center;
  min-height: 0;
}
.viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}
.viewer-stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #000;
}
.modal-open {
  overflow: hidden;
}
.event-log {
  display: grid;
  gap: 8px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}
.event {
  display: grid;
  grid-template-columns: 190px 70px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0d11;
}
.event p { margin: 0; }
.event time, .event span { color: var(--muted); }
.event.success span { color: var(--green); }
.event.warn span { color: var(--amber); }
.event.error span { color: var(--red); }

.warning-bar {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #92400e;
  border-radius: 8px;
  background: #2c1d0b;
  color: #fde68a;
}
.hidden { display: none !important; }

.primary, .secondary, .ghost, .danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 10px 16px;
  border-radius: 6px;
  background: #3b1980;
  border: 0 solid transparent;
  color: white;
}
.primary { background: #3b1980; border-color: #3b1980; }
.secondary { background: #1d2737; border-color: #334155; }
.ghost { 
  background: #3b1980; 
  border-color: var(--line); 
  color: var(--text); 
  min-height: 46px;
  min-width: 100px;
}
.danger { background: var(--red-bg); border-color: #7f1d1d; color: #fecaca; }
.wide { width: 100%; }
.link-ok { background: var(--green-bg); border-color: #16a34a; color: #dcfce7; }
.disabled-link {
  pointer-events: none;
  opacity: .55;
}

.flash-stack {
  max-width: 1240px;
  margin: 0 auto 14px;
  display: grid;
  gap: 8px;
}
.flash {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.flash.error { border-color: #7f1d1d; color: #fecaca; }
.flash.success { border-color: #166534; color: #bbf7d0; }
.hint-line {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.hint-line.error {
  color: #fecaca;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.admin-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.admin-menu a {
  flex: 0 0 auto;
  padding: 9px 11px;
  border-radius: 7px;
  color: var(--muted);
  white-space: nowrap;
}
.admin-menu a:hover { background: var(--panel-2); color: white; }
.admin-content {
  min-width: 0;
}
.admin-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.admin-subtabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
}
.admin-subtabs a.active {
  border-color: rgba(96, 165, 250, .5);
  background: rgba(96, 165, 250, .12);
  color: #dbeafe;
}
.admin-subtabs span {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .16);
  color: var(--text);
  font-size: 12px;
  text-align: center;
}
.admin-user-section {
  display: grid;
  gap: 10px;
}
.admin-user-section h2 {
  margin: 0;
  font-size: 18px;
}
.admin-divider {
  height: 1px;
  margin: 22px 0;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, .32), transparent);
}
.empty-admin-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(15, 17, 23, .45);
}
.admin-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.key-value-list {
  display: grid;
  gap: 12px;
  margin: 0;
}
.key-value-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.key-value-list dt {
  color: var(--muted);
  font-weight: 800;
}
.key-value-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.table-list, .preset-admin-list, .group-list {
  display: grid;
  gap: 12px;
}
.stats-table {
  display: grid;
  gap: 10px;
}
.stats-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(6, minmax(110px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.stats-row-head {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.stats-row span {
  color: var(--muted);
}
.stats-row div span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}
.admin-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(120px, 180px)) auto;
  gap: 10px;
  padding: 12px;
  align-items: center;
}
.admin-row-head {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.admin-row span { color: var(--muted); font-size: 13px; display: block; }
.admin-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.admin-actions button {
  white-space: nowrap;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #101218;
  color: var(--text);
  border-radius: 7px;
  padding: 9px 10px;
}
textarea { min-height: 80px; resize: vertical; }
.preset-form, .preset-edit, .group-card {
  padding: 14px;
}
.preset-edit summary {
  cursor: pointer;
  font-weight: 700;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.form-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}
.form-grid .wide { grid-column: 1 / -1; }
.check {
  display: flex !important;
  align-items: center;
  gap: 8px;
}
.check input { width: auto; }
.group-list {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.output-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.output-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}
.output-context {
  display: grid;
  gap: 3px;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.output-context span {
  color: var(--muted);
  font-size: 13px;
}
.admin-results {
  margin-top: 10px;
}
.css-editor-form {
  margin-top: 18px;
}
.css-upload {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}
.css-editor {
  min-height: 520px;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre;
}

@media (max-width: 760px) {
  .shell { padding: 12px; }
  .topbar, .hero-band, .pod-card, .section-head-actions { align-items: stretch; flex-direction: column; display: flex; }
  .nav { flex-wrap: wrap; }
  .admin-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .output-toolbar { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .event { grid-template-columns: 1fr; }
}

.login-card {
  text-align: center;
}

.login-card h1 {
  margin: 8px 0 24px;
}

.login-card .login-actions {
  justify-items: center;
}

.login-card .primary,
.login-card .ghost {
  width: min(100%, 450px);
}

.result-grid > .state-card {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
}

.result-grid > .state-card h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.result-grid > .state-card p {
  max-width: 520px;
  margin: 0 auto;
}


/* --- Professional UI polish: actions, timers, dialogs --- */

.preset-card,
.pod-card,
.result-card,
.admin-row,
.login-card,
.state-card {
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.preset-card:hover,
.result-card:hover {
  border-color: #0c0f12;
}

.pod-card:hover {
  transform: none;
  border-color: rgba(96, 165, 250, .55);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .16);
  background:
    radial-gradient(circle at 0% 0%, rgba(96, 165, 250, .07), transparent 34%),
    var(--panel);
}

.primary,
.secondary,
.ghost,
.danger {
  position: relative;
  transition: transform .12s ease, filter .12s ease, box-shadow .18s ease, border-color .18s ease;
}

.primary:hover,
.secondary:hover,
.ghost:hover,
.danger:hover,
.tab:hover {
  transform: translateY(0);
  filter: brightness(1.2);
}

.primary:active,
.secondary:active,
.ghost:active,
.danger:active {
  transform: translateY(0) scale(.98);
}

.primary.is-loading,
.secondary.is-loading,
.danger.is-loading,
.ghost.is-loading {
  pointer-events: none;
  opacity: .82;
}

.primary.is-loading::after,
.secondary.is-loading::after,
.danger.is-loading::after,
.ghost.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 9px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: ui-spin .7s linear infinite;
}

@keyframes ui-spin {
  to { transform: rotate(360deg); }
}

.lease-timer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(96, 165, 250, .08);
  border: 1px solid rgba(96, 165, 250, .22);
  color: #bfdbfe;
}

.lease-timer.muted {
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border-color: var(--line);
}

.countdown {
  display: inline-flex;
  align-items: center;
  min-width: 74px;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.countdown-ok {
  color: #bbf7d0;
  background: rgba(34, 197, 94, .12);
}

.countdown-warn {
  color: #fde68a;
  background: rgba(245, 158, 11, .16);
  animation: timer-pulse 1.8s ease-in-out infinite;
}

.countdown-danger,
.countdown-expired {
  color: #fecaca;
  background: rgba(239, 68, 68, .18);
  animation: timer-pulse .9s ease-in-out infinite;
}

@keyframes timer-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .0); }
  50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, .12); }
}

.ui-dialog {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.ui-dialog.hidden {
  display: none;
}

.ui-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 10, .72);
  backdrop-filter: blur(8px);
}

.ui-dialog-card {
  position: relative;
  width: min(430px, 100%);
  padding: 26px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 16px;
  background:
    radial-gradient(circle at 20% 0%, rgba(96,165,250,.14), transparent 32%),
    linear-gradient(180deg, #1b1f2a, #12141b);
  box-shadow: 0 26px 80px rgba(0, 0, 0, .48);
  animation: dialog-in .18s ease-out;
  text-align: center;
}

@keyframes dialog-in {
  from {
    transform: translateY(10px) scale(.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.ui-dialog-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: rgba(96, 165, 250, .15);
  color: #bfdbfe;
  font-weight: 900;
  font-size: 22px;
}

.ui-dialog-success .ui-dialog-icon {
  background: rgba(34, 197, 94, .16);
  color: #bbf7d0;
}

.ui-dialog-danger .ui-dialog-icon {
  background: rgba(239, 68, 68, .16);
  color: #fecaca;
}

.ui-dialog-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.ui-dialog-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.ui-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
}

.ui-dialog-actions .primary,
.ui-dialog-actions .ghost {
  min-width: 120px;
}

@media (max-width: 760px) {
  .ui-dialog-actions {
    flex-direction: column-reverse;
  }

  .ui-dialog-actions .primary,
  .ui-dialog-actions .ghost {
    width: 100%;
  }
}


/* --- Pod status VFX: canvas ribbons, particles, smooth right-flow --- */

.pod-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.pod-card > * {
  position: relative;
  z-index: 4;
}

.pod-wave {
  --pod-vfx-rgb: 34, 197, 94;
  --pod-vfx-soft-rgb: 45, 212, 191;
  border-color: rgba(var(--pod-vfx-rgb), .28);
  background:
    radial-gradient(circle at 0% 0%, rgba(var(--pod-vfx-rgb), .035), transparent 34%),
    linear-gradient(180deg, rgba(var(--pod-vfx-rgb), .018), transparent 62%),
    var(--panel);
}

.pod-wave-search {
  --pod-vfx-rgb: 59, 130, 246;
  --pod-vfx-soft-rgb: 125, 211, 252;
}

.pod-wave-setup {
  --pod-vfx-rgb: 245, 158, 11;
  --pod-vfx-soft-rgb: 253, 224, 71;
}

.pod-wave-running {
  --pod-vfx-rgb: 34, 197, 94;
  --pod-vfx-soft-rgb: 45, 212, 191;
}

.pod-wave-stopping {
  --pod-vfx-rgb: 239, 68, 68;
  --pod-vfx-soft-rgb: 251, 146, 60;
}

.pod-vfx-canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .95;
  mix-blend-mode: screen;
}

.pod-wave:hover {
  transform: none;
  border-color: rgba(var(--pod-vfx-rgb), .52);
  box-shadow:
    inset 0 0 0 1px rgba(var(--pod-vfx-rgb), .16),
    0 0 34px rgba(var(--pod-vfx-rgb), .08);
}

/* status transition sweep */

.pod-shift-to-search {
  --pod-shift-rgb: 59, 130, 246;
  --pod-shift-soft-rgb: 125, 211, 252;
}

.pod-shift-to-setup {
  --pod-shift-rgb: 245, 158, 11;
  --pod-shift-soft-rgb: 253, 224, 71;
}

.pod-shift-to-running {
  --pod-shift-rgb: 34, 197, 94;
  --pod-shift-soft-rgb: 45, 212, 191;
}

.pod-shift-to-stopping {
  --pod-shift-rgb: 239, 68, 68;
  --pod-shift-soft-rgb: 251, 146, 60;
}

.pod-card > .pod-color-sweep {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      rgba(var(--pod-shift-rgb), 0) 0%,
      rgba(var(--pod-shift-rgb), .04) 14%,
      rgba(var(--pod-shift-rgb), .18) 34%,
      rgba(var(--pod-shift-soft-rgb), .28) 50%,
      rgba(var(--pod-shift-rgb), .14) 66%,
      rgba(var(--pod-shift-rgb), .035) 84%,
      rgba(var(--pod-shift-rgb), 0) 100%
    );
  box-shadow:
    inset 0 0 0 1px rgba(var(--pod-shift-rgb), .16),
    0 0 34px rgba(var(--pod-shift-rgb), .10);
  transform: translate3d(-120%, 0, 0);
  opacity: 0;
  animation: pod-color-sweep-roll 2s cubic-bezier(.2, .75, .2, 1) both;
}

.pod-card.pod-shift {
  border-color: rgba(var(--pod-shift-rgb), .5);
  box-shadow:
    inset 0 0 0 1px rgba(var(--pod-shift-rgb), .14),
    0 0 34px rgba(var(--pod-shift-rgb), .08);
  transition: border-color 2s ease, box-shadow 2s ease;
}

@keyframes pod-color-sweep-roll {
  0% {
    transform: translate3d(-120%, 0, 0);
    opacity: 0;
  }
  14% {
    opacity: .82;
  }
  62% {
    opacity: .68;
  }
  100% {
    transform: translate3d(120%, 0, 0);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pod-vfx-canvas,
  .pod-card > .pod-color-sweep {
    animation: none;
    display: none;
  }
}


/* --- Cinematic login page --- */

.login-vfx-page {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 100px);
}

.login-vfx-page::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 18% 18%, rgba(59, 130, 246, .18), transparent 30%),
    radial-gradient(circle at 82% 72%, rgba(45, 212, 191, .14), transparent 34%),
    radial-gradient(circle at 42% 88%, rgba(34, 197, 94, .08), transparent 28%);
  filter: blur(8px);
  animation: login-bg-drift 18s ease-in-out infinite alternate;
}

.login-orb {
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(34px);
  opacity: .55;
}

.login-orb-a {
  width: 260px;
  height: 260px;
  left: 8%;
  top: 14%;
  background: rgba(37, 99, 235, .22);
  animation: login-orb-a 13s ease-in-out infinite alternate;
}

.login-orb-b {
  width: 320px;
  height: 320px;
  right: 9%;
  bottom: 10%;
  background: rgba(45, 212, 191, .18);
  animation: login-orb-b 15s ease-in-out infinite alternate;
}

.login-card-pro {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: min(560px, 100%);
  border-radius: 18px;
  border-color: rgba(96, 165, 250, .22);
  background:
    linear-gradient(180deg, rgba(30, 41, 59, .82), rgba(15, 17, 24, .92)),
    var(--panel);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, .42),
    inset 0 0 0 1px rgba(255, 255, 255, .03);
}

.login-card-pro > *:not(.login-vfx-layer) {
  position: relative;
  z-index: 2;
}

.login-vfx-layer {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: .72;
  background:
    radial-gradient(circle at 8% 24%, rgba(125, 211, 252, .78) 0 1px, transparent 2px),
    radial-gradient(circle at 22% 72%, rgba(34, 197, 94, .70) 0 1.2px, transparent 2.4px),
    radial-gradient(circle at 42% 38%, rgba(96, 165, 250, .56) 0 1px, transparent 2px),
    radial-gradient(circle at 68% 68%, rgba(45, 212, 191, .62) 0 1px, transparent 2px),
    radial-gradient(ellipse at 16% 48%, rgba(96, 165, 250, .16), transparent 58%),
    radial-gradient(ellipse at 58% 62%, rgba(45, 212, 191, .14), transparent 62%);
  background-size: 360px 100%, 360px 100%, 360px 100%, 360px 100%, 540px 180px, 620px 210px;
  background-repeat: repeat-x;
  animation: login-particles-flow 14s linear infinite;
  mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

.login-brand-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #22c55e, #2563eb);
  color: white;
  font-weight: 900;
  box-shadow: 0 0 38px rgba(37, 99, 235, .24);
}

.login-subtitle {
  margin: -10px auto 0;
  max-width: 360px;
}

@keyframes login-bg-drift {
  from { transform: translate3d(-1%, -1%, 0) scale(1); }
  to { transform: translate3d(1%, 1%, 0) scale(1.04); }
}

@keyframes login-orb-a {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(60px, 30px, 0); }
}

@keyframes login-orb-b {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-70px, -40px, 0); }
}

@keyframes login-particles-flow {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0, 0 50%, 0 54%;
  }
  to {
    background-position: 360px 0, 360px 0, 360px 0, 360px 0, 540px 50%, 620px 54%;
  }
}

@keyframes google-panel-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-vfx-page::before,
  .login-orb,
  .login-vfx-layer {
    animation: none;
  }
}

/* --- Login fullscreen layout and seamless VFX fix --- */

.login-page-body {
  background: #0f1014;
}

.login-page-body .shell {
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
}

.login-page-body .topbar {
  position: absolute;
  top: 22px;
  left: 50%;
  z-index: 20;
  width: auto;
  max-width: none;
  margin: 0;
  transform: translateX(-50%);
}

.login-page-body .flash-stack {
  position: fixed;
  top: 70px;
  left: 50%;
  z-index: 30;
  width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
}

.login-vfx-page {
  min-height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 96px 20px 32px;
  background:
    radial-gradient(circle at 15% 24%, rgba(37, 99, 235, .20), transparent 25%),
    radial-gradient(circle at 84% 76%, rgba(45, 212, 191, .18), transparent 30%),
    radial-gradient(circle at 47% 92%, rgba(34, 197, 94, .08), transparent 28%),
    linear-gradient(135deg, #101726 0%, #0f1014 48%, #0b201e 100%);
}

.login-vfx-page::before {
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(59, 130, 246, .16), transparent 31%),
    radial-gradient(circle at 82% 72%, rgba(45, 212, 191, .13), transparent 35%);
  filter: blur(18px);
  animation: login-bg-drift 20s ease-in-out infinite alternate;
}

.login-card-pro {
  margin: auto;
}

.login-vfx-layer {
  background: none;
  opacity: 1;
  overflow: hidden;
  mask-image: none;
  -webkit-mask-image: none;
  animation: none;
}

.login-vfx-layer::before,
.login-vfx-layer::after {
  content: "";
  position: absolute;
  inset: -25%;
  pointer-events: none;
  opacity: .62;
  mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

.login-vfx-layer::before {
  background:
    radial-gradient(ellipse at 20% 48%, rgba(96, 165, 250, .20), transparent 58%),
    radial-gradient(ellipse at 58% 62%, rgba(45, 212, 191, .17), transparent 62%),
    radial-gradient(ellipse at 86% 38%, rgba(34, 197, 94, .10), transparent 56%);
  filter: blur(18px);
  background-size: 760px 240px;
  background-repeat: repeat-x;
  animation: login-vfx-wave-seamless 22s linear infinite;
}

.login-vfx-layer::after {
  inset: 0;
  opacity: .54;
  background:
    radial-gradient(circle at 8% 24%, rgba(125, 211, 252, .72) 0 1px, transparent 2px),
    radial-gradient(circle at 22% 72%, rgba(34, 197, 94, .62) 0 1.2px, transparent 2.4px),
    radial-gradient(circle at 42% 38%, rgba(96, 165, 250, .52) 0 1px, transparent 2px),
    radial-gradient(circle at 68% 68%, rgba(45, 212, 191, .56) 0 1px, transparent 2px);
  background-size: 420px 100%;
  background-repeat: repeat-x;
  animation: login-vfx-particles-seamless 15s linear infinite;
}

@keyframes login-vfx-wave-seamless {
  from { background-position: 0 50%; }
  to { background-position: 760px 50%; }
}

@keyframes login-vfx-particles-seamless {
  from { background-position: 0 0; }
  to { background-position: 420px 0; }
}

@media (max-width: 760px) {
  .login-vfx-page {
    padding: 86px 14px 24px;
  }

  .login-page-body .topbar {
    top: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-vfx-layer::before,
  .login-vfx-layer::after {
    animation: none;
  }
}

/* --- Pod VFX color accents and frosted timer --- */

.pod-wave-search {
  --pod-vfx-rgb: 59, 130, 246;
  --pod-vfx-soft-rgb: 125, 211, 252;
  --pod-vfx-accent-rgb: 168, 85, 247;
}

.pod-wave-setup {
  --pod-vfx-rgb: 245, 158, 11;
  --pod-vfx-soft-rgb: 253, 224, 71;
  --pod-vfx-accent-rgb: 249, 115, 22;
}

.pod-wave-running {
  --pod-vfx-rgb: 34, 197, 94;
  --pod-vfx-soft-rgb: 45, 212, 191;
  --pod-vfx-accent-rgb: 34, 211, 238;
}

.pod-wave-stopping {
  --pod-vfx-rgb: 239, 68, 68;
  --pod-vfx-soft-rgb: 251, 146, 60;
  --pod-vfx-accent-rgb: 244, 63, 94;
}

.pod-vfx-canvas {
  opacity: .88;
  mix-blend-mode: screen;
  filter: saturate(1.18) contrast(1.04);
}

/* frosted glass lease timer */

.lease-timer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: rgba(226, 232, 240, .94);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(15, 23, 42, .42)),
    rgba(15, 23, 42, .38);
  border: 1px solid rgba(226, 232, 240, .20);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 -1px 0 rgba(0, 0, 0, .20),
    0 8px 24px rgba(0, 0, 0, .20);
  backdrop-filter: blur(14px) saturate(1.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
}

.lease-timer::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, .18), transparent 42%),
    linear-gradient(90deg, rgba(255, 255, 255, .10), transparent 32%, rgba(255, 255, 255, .05));
  opacity: .7;
}

.countdown {
  min-width: 82px;
  color: #f8fafc;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, .55),
    0 0 12px rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(15, 23, 42, .36)),
    rgba(15, 23, 42, .34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 0 18px rgba(15, 23, 42, .18);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
}

.countdown-ok {
  color: #ecfeff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(8, 47, 73, .32)),
    rgba(20, 184, 166, .20);
  border-color: rgba(125, 211, 252, .28);
}

.countdown-warn {
  color: #fff7ed;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(67, 20, 7, .34)),
    rgba(249, 115, 22, .23);
  border-color: rgba(253, 186, 116, .34);
}

.countdown-danger,
.countdown-expired {
  color: #fff1f2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(69, 10, 10, .36)),
    rgba(239, 68, 68, .25);
  border-color: rgba(252, 165, 165, .34);
}

/* --- Single-bubble frosted lease timer --- */

.lease-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  color: rgba(226, 232, 240, .92);
  line-height: 1;
  background: rgba(15, 23, 42, .34);
  border: 1px solid rgba(226, 232, 240, .18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    0 8px 20px rgba(0, 0, 0, .16);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.lease-timer::before {
  display: none;
}

.lease-timer .countdown,
.lease-timer .countdown-ok,
.lease-timer .countdown-warn,
.lease-timer .countdown-danger,
.lease-timer .countdown-expired {
  min-width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #f8fafc;
  font-weight: 900;
  letter-spacing: .01em;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, .65),
    0 0 10px rgba(255, 255, 255, .16);
}

.test-css-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(96, 165, 250, .38);
  border-radius: 999px;
  background: rgba(8, 13, 24, .86);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.test-css-float.is-dragging {
  cursor: grabbing;
}

.test-css-float a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(30, 41, 59, .72);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.test-css-float a:hover {
  border-color: rgba(96, 165, 250, .62);
  color: #ffffff;
  background: rgba(37, 99, 235, .42);
}

@media (max-width: 720px) {
  .test-css-float {
    right: 10px;
    bottom: 10px;
    gap: 6px;
    padding: 6px;
  }

  .test-css-float a {
    min-height: 30px;
    padding: 0 9px;
  }
}

/* --- Brand image logo --- */

.brand {
  min-height: 42px;
}

.brand-logo {
  display: block;
  width: auto;
  height: 42px;
  object-fit: contain;
}

@media (max-width: 640px) {
  .brand-logo {
    height: 36px;
    max-width: 180px;
  }
}

/* --- Topbar logo/button height sync --- */

:root {
  --topbar-control-height: 40px;
}

.topbar {
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  height: var(--topbar-control-height);
  min-height: var(--topbar-control-height);
}

.brand-logo {
  display: block;
  width: auto;
  height: var(--topbar-control-height);
  max-height: var(--topbar-control-height);
  object-fit: contain;
}

.nav form {
  display: flex;
  align-items: center;
  margin: 0;
}

.topbar .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--topbar-control-height);
  min-height: var(--topbar-control-height);
  padding-top: 0;
  padding-bottom: 0;
}

/* --- Results clear animation --- */

.result-card.result-removing {
  pointer-events: none;
  animation: result-card-collapse 420ms cubic-bezier(.2,.9,.2,1) forwards;
  transform-origin: center;
  overflow: hidden;
}

@keyframes result-card-collapse {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
    max-height: 460px;
  }

  55% {
    opacity: .35;
    transform: scale(.96) translateY(-6px);
    filter: blur(2px);
  }

  100% {
    opacity: 0;
    transform: scale(.9) translateY(-14px);
    filter: blur(5px);
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}


.preset-card .primary {
  width: 100%;
  min-height: 48px;
  margin-top: auto;
}

@media (max-width: 1180px) {
  .preset-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 460px) {
  .preset-grid { grid-template-columns: 1fr; }
}


/* Dynamic dashboard tabs */
.tabs {
  min-height: 40px;
}

.tab[data-tab="pods"],
.tab[data-tab="results"],
.tab[data-tab="events"] {
  transform-origin: left center;
  transition:
    opacity .34s ease,
    transform .42s cubic-bezier(.2, .9, .2, 1),
    max-width .42s cubic-bezier(.2, .9, .2, 1),
    margin .42s cubic-bezier(.2, .9, .2, 1),
    padding .42s cubic-bezier(.2, .9, .2, 1),
    border-width .42s ease;
  will-change: opacity, transform, max-width;
  overflow: hidden;
}

.tab.dynamic-tab-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px) scale(.92);
  max-width: 0 !important;
  margin-left: -8px;
  margin-right: 0;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-width: 0 !important;
}

.tab.dynamic-tab-enter {
  animation: tabSlideIn .48s cubic-bezier(.18, .95, .22, 1.12) both;
}

.tab.dynamic-tab-exit {
  animation: tabSlideOut .34s cubic-bezier(.7, 0, .84, 0) both;
}

.tab[data-tab="pods"].dynamic-tab-enter { animation-delay: 0ms; }
.tab[data-tab="results"].dynamic-tab-enter { animation-delay: 55ms; }
.tab[data-tab="events"].dynamic-tab-enter { animation-delay: 110ms; }

.tab[data-tab="events"].dynamic-tab-exit { animation-delay: 0ms; }
.tab[data-tab="results"].dynamic-tab-exit { animation-delay: 45ms; }
.tab[data-tab="pods"].dynamic-tab-exit { animation-delay: 90ms; }

@keyframes tabSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-24px) scale(.88);
    filter: blur(8px);
  }
  65% {
    opacity: 1;
    transform: translateX(4px) scale(1.02);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

@keyframes tabSlideOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-18px) scale(.9);
    filter: blur(7px);
  }
}

/* Dialog action order: destructive/confirm left, cancel right */
#uiDialogConfirm {
  order: 1;
}

#uiDialogCancel {
  order: 2;
}

/* --- Pod CRT Stop Animation --- */

.pod-card.pod-stop-crt-out {
  pointer-events: none;
  transform-origin: center;
  overflow: hidden;
  animation: pod-crt-collapse 1.75s cubic-bezier(.2, .75, .2, 1) forwards;
  will-change: transform, opacity, filter, max-height;
}

.pod-card.pod-stop-crt-out::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, .07) 0 1px,
      transparent 1px 4px
    ),
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(45, 212, 191, .22) 46%,
      rgba(187, 247, 208, .28) 50%,
      rgba(45, 212, 191, .18) 54%,
      transparent 100%
    );
  opacity: 0;
  mix-blend-mode: screen;
  animation: pod-crt-scanlines 1.75s ease-in-out forwards;
}

.pod-card.pod-stop-crt-out::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 41;
  width: 0%;
  height: 2px;
  border-radius: 999px;
  background: rgba(187, 247, 208, .95);
  box-shadow:
    0 0 12px rgba(34, 197, 94, .9),
    0 0 36px rgba(45, 212, 191, .55);
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  animation: pod-crt-center-line 1.75s ease-in-out forwards;
}

.pod-card.pod-stop-crt-out .pod-vfx-canvas,
.pod-card.pod-stop-crt-out .pod-color-sweep {
  opacity: .28;
  filter: grayscale(.8);
}

.pod-card.pod-stop-crt-out .status {
  color: #fde68a;
  border-color: rgba(245, 158, 11, .52);
  background: rgba(44, 29, 11, .92);
}

.pod-card.pod-stop-crt-out .status::before {
  background: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, .78);
}

.pod-card.pod-stop-crt-out .pod-actions > * {
  opacity: .42;
  filter: grayscale(1) brightness(.72);
}

.pod-card.pod-stop-crt-error {
  animation: pod-crt-error-return .55s ease-out;
}

@keyframes pod-crt-collapse {
  0% {
    opacity: 1;
    transform: translateX(0) scaleY(1);
    filter: none;
    max-height: 260px;
  }

  16% {
    transform: translateX(-1px) scaleY(1);
    filter: contrast(1.18) brightness(1.06);
  }

  23% {
    transform: translateX(1px) scaleY(.99);
    filter: contrast(1.34) saturate(.86);
  }

  31% {
    transform: translateX(-2px) scaleY(.97);
  }

  48% {
    opacity: .92;
    transform: translateX(0) scaleY(.74);
    filter: contrast(1.18) grayscale(.28) brightness(.92);
  }

  68% {
    opacity: .82;
    transform: scaleY(.08);
    filter: contrast(1.35) grayscale(.6) brightness(.88);
    max-height: 260px;
  }

  82% {
    opacity: .72;
    transform: scaleY(.025);
    filter: blur(.3px) brightness(1.12);
    max-height: 32px;
    margin-top: 0;
    margin-bottom: 0;
  }

  100% {
    opacity: 0;
    transform: scaleY(0);
    filter: blur(1.2px) brightness(.2);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    border-width: 0;
  }
}

@keyframes pod-crt-scanlines {
  0%, 10% {
    opacity: 0;
    transform: translateY(-8px);
  }

  22%, 68% {
    opacity: .78;
  }

  100% {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes pod-crt-center-line {
  0%, 48% {
    width: 0%;
    opacity: 0;
  }

  64% {
    width: 96%;
    opacity: .95;
  }

  82% {
    width: 72%;
    opacity: .86;
  }

  100% {
    width: 0%;
    opacity: 0;
  }
}

@keyframes pod-crt-error-return {
  0% {
    transform: scaleY(.92);
    opacity: .72;
    filter: grayscale(.5);
  }

  100% {
    transform: scaleY(1);
    opacity: 1;
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pod-card.pod-stop-crt-out,
  .pod-card.pod-stop-crt-out::before,
  .pod-card.pod-stop-crt-out::after,
  .pod-card.pod-stop-crt-error {
    animation: none !important;
  }
}

/* --- Timeline Log Chip --- */

.timeline-log-chip {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px 12px 14px 10px;
  border: 1px solid rgba(96, 165, 250, .16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(34, 197, 94, .06), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.025), transparent),
    rgba(8, 12, 18, .72);
  overflow: hidden;
}

.timeline-log-chip::before {
  content: "";
  position: absolute;
  left: 100px;
  top: 44px;
  bottom: 18px;
  width: 1px;
  background:
    linear-gradient(
      180deg,
      rgba(34, 197, 94, 0),
      rgba(34, 197, 94, .70) 16%,
      rgba(96, 165, 250, .45) 56%,
      rgba(245, 158, 11, .36) 82%,
      rgba(34, 197, 94, 0)
    );
  box-shadow: 0 0 18px rgba(34, 197, 94, .16);
  pointer-events: none;
}

.timeline-log-chip::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(45, 212, 191, .035), transparent);
  transform: translateX(-120%);
  animation: timeline-log-sweep 4.8s ease-in-out infinite;
}

.timeline-log-chip .timeline-event {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 74px 20px 64px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(12, 15, 18, .48);
  color: var(--muted);
  animation: timeline-event-in .34s cubic-bezier(.2, .75, .2, 1) both;
  animation-delay: var(--event-delay, 0s);
}

.timeline-log-chip .timeline-event:hover {
  border-color: rgba(96, 165, 250, .18);
  background: rgba(17, 24, 39, .62);
}

.timeline-log-chip .timeline-event time {
  color: #94a3b8;
  font: 12px ui-monospace, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.timeline-log-chip .event-pin {
  position: relative;
  z-index: 3;
  width: 10px;
  height: 10px;
  justify-self: center;
  border-radius: 999px;
  background: #60a5fa;
  box-shadow:
    0 0 0 4px rgba(96, 165, 250, .08),
    0 0 16px rgba(96, 165, 250, .55);
}

.timeline-log-chip .event-level {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border-radius: 999px;
  font: 10px ui-monospace, Consolas, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, .24);
  background: rgba(96, 165, 250, .08);
}

.timeline-log-chip .timeline-event p {
  margin: 0;
  min-width: 0;
  color: #cbd5e1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}

.timeline-log-chip .timeline-event.success .event-pin {
  background: #22c55e;
  box-shadow:
    0 0 0 4px rgba(34, 197, 94, .10),
    0 0 16px rgba(34, 197, 94, .66);
}

.timeline-log-chip .timeline-event.success .event-level {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, .32);
  background: rgba(34, 197, 94, .10);
}

.timeline-log-chip .timeline-event.warn {
  border-color: rgba(245, 158, 11, .16);
  background:
    radial-gradient(circle at 0% 50%, rgba(245, 158, 11, .10), transparent 36%),
    rgba(12, 15, 18, .54);
}

.timeline-log-chip .timeline-event.warn .event-pin {
  background: #f59e0b;
  box-shadow:
    0 0 0 4px rgba(245, 158, 11, .10),
    0 0 18px rgba(245, 158, 11, .70);
  animation: timeline-pin-pulse 1.7s ease-in-out infinite;
}

.timeline-log-chip .timeline-event.warn .event-level {
  color: #fde68a;
  border-color: rgba(245, 158, 11, .34);
  background: rgba(245, 158, 11, .10);
}

.timeline-log-chip .timeline-event.error {
  border-color: rgba(239, 68, 68, .22);
  background:
    radial-gradient(circle at 0% 50%, rgba(239, 68, 68, .13), transparent 38%),
    rgba(12, 15, 18, .58);
}

.timeline-log-chip .timeline-event.error .event-pin {
  background: #ef4444;
  box-shadow:
    0 0 0 4px rgba(239, 68, 68, .11),
    0 0 20px rgba(239, 68, 68, .76);
  animation: timeline-pin-pulse 1.1s ease-in-out infinite;
}

.timeline-log-chip .timeline-event.error .event-level {
  color: #fecaca;
  border-color: rgba(239, 68, 68, .34);
  background: rgba(239, 68, 68, .11);
}

.timeline-log-empty {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 82px;
  padding: 16px;
  color: var(--muted);
}

.timeline-log-empty strong {
  color: #dbeafe;
}

.timeline-log-empty p {
  margin: 5px 0 0;
}

@keyframes timeline-event-in {
  from {
    opacity: 0;
    transform: translateX(-8px) scale(.992);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes timeline-pin-pulse {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.22);
    filter: brightness(1.22);
  }
}

@keyframes timeline-log-sweep {
  0%, 72% {
    transform: translateX(-120%);
    opacity: 0;
  }
  82% {
    opacity: .75;
  }
  100% {
    transform: translateX(120%);
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .timeline-log-chip::before {
    left: 28px;
  }

  .timeline-log-chip .timeline-event {
    grid-template-columns: 20px 64px minmax(0, 1fr);
  }

  .timeline-log-chip .timeline-event time {
    grid-column: 2 / -1;
    opacity: .72;
  }

  .timeline-log-chip .timeline-event .event-pin {
    grid-row: 1 / 3;
  }

  .timeline-log-chip .timeline-event .event-level {
    grid-column: 2;
  }

  .timeline-log-chip .timeline-event p {
    grid-column: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-log-chip::after,
  .timeline-log-chip .timeline-event,
  .timeline-log-chip .timeline-event.warn .event-pin,
  .timeline-log-chip .timeline-event.error .event-pin {
    animation: none !important;
  }
}

