/* ════════════════════════════════════════════════════════════════════════════
   Nokia Script Generator — Main Stylesheet
════════════════════════════════════════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #eceff1; min-height: 100vh; overflow-x: hidden; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #eceff1; }
::-webkit-scrollbar-thumb { background: #b0bec5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #78909c; }

/* ─── TOOLBAR ─── */
.toolbar {
  background: linear-gradient(135deg, #0d3b20 0%, #1a6b3c 60%, #22854a 100%);
  padding: 10px 18px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,.35);
  flex-wrap: wrap; position: relative; z-index: 100;
}
.toolbar-brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.toolbar-brand .logo {
  width: 36px; height: 36px; background: rgba(255,255,255,.15);
  border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.toolbar-brand h1    { color: #fff; font-size: 16px; font-weight: 700; line-height: 1.2; }
.toolbar-brand small { color: rgba(255,255,255,.65); font-size: 11px; }
.toolbar-sep { width: 1px; height: 22px; background: rgba(255,255,255,.25); flex-shrink: 0; }
.piu-toggle-label {
  display: flex; align-items: center; gap: 5px; cursor: pointer;
  color: #fff; font-size: 12px; font-weight: 600; user-select: none;
  background: rgba(255,255,255,.12); border-radius: 5px;
  padding: 5px 10px; border: 1px solid rgba(255,255,255,.2);
}
.piu-toggle-label input[type="checkbox"] { accent-color: #69f0ae; width: 14px; height: 14px; cursor: pointer; }

/* ─── BUTTONS ─── */
.btn {
  padding: 7px 14px; border: none; border-radius: 5px; cursor: pointer;
  font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
  transition: all .18s; white-space: nowrap; font-family: inherit;
}
.btn:hover   { filter: brightness(1.13); transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.btn:active  { transform: translateY(0); }

/* Neon button — permanent top glint + hover sweep shimmer */
.btn::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  z-index: 2; pointer-events: none;
}
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -130%; width: 80%; height: 100%;
  background: linear-gradient(108deg, transparent 30%, rgba(255,255,255,0.14) 50%, transparent 70%);
  z-index: 2; pointer-events: none;
  transition: left 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:hover::after { left: 150%; }

.btn-green   { background: #43a047; color: #fff; }
.btn-blue    { background: #1e88e5; color: #fff; }
.btn-amber   { background: #fb8c00; color: #fff; }
.btn-red     { background: #e53935; color: #fff; }
.btn-purple  { background: #8e24aa; color: #fff; }
.btn-teal    { background: #00897b; color: #fff; }
.btn-ghost   { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); }

/* ─── STATUS BAR ─── */
.statusbar {
  background: #263238; color: #90a4ae; font-size: 11px;
  padding: 4px 18px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.statusbar span { display: flex; align-items: center; gap: 5px; }
.statusbar .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
#sb-sel { color: #ffcc02; }

/* ─── TABS ─── */
.tabs {
  display: flex; background: #fff; border-bottom: 2px solid #ddd;
  padding: 0 18px; box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.tab {
  padding: 11px 18px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: #78909c; border-bottom: 3px solid transparent; transition: all .2s;
  display: flex; align-items: center; gap: 6px; user-select: none;
}
.tab:hover  { color: #1a6b3c; }
.tab.active { color: #1a6b3c; border-bottom-color: #1a6b3c; }
.tab .badge {
  background: #1a6b3c; color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}

/* ─── TAB CONTENT ─── */
.tab-content { display: none; }
.tab-content.active { display: flex; flex-direction: column; }

/* ════════════════════════════════════ DATA TAB ════════════════════════════ */
#tab-data { padding: 12px 18px; gap: 10px; height: calc(100vh - 114px); overflow: hidden; }

.table-toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-shrink: 0;
}
.table-toolbar .sep { width: 1px; height: 24px; background: #ccc; margin: 0 4px; }
.row-count { font-size: 12px; color: #78909c; margin-left: auto; }

.table-wrapper {
  flex: 1; overflow: auto; border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0,0,0,.12); border: 1px solid #c8d6d8;
}
table { border-collapse: collapse; white-space: nowrap; min-width: 100%; background: #fff; }

/* Header rows */
thead tr.hdr-main th {
  position: sticky; top: 0; z-index: 20;
  padding: 7px 9px; font-size: 11px; font-weight: 700; color: #fff;
  border-right: 1px solid rgba(255,255,255,.2); border-bottom: 1px solid rgba(0,0,0,.15);
}
.hdr-green  { background: #1a6b3c; }
.hdr-gold   { background: #b8860b; }
.hdr-blue   { background: #2965a5; }
.hdr-salmon { background: #c0553a; }
.hdr-gray   { background: #546e7a; }
.hdr-orange { background: #7b4a00; }
.hdr-num    { background: #37474f !important; width: 34px; min-width: 34px; text-align: center; }

thead tr.hdr-filter th {
  position: sticky; top: 33px; z-index: 19;
  background: #b0bec5; padding: 4px 6px;
  border-right: 1px solid #90a4ae; border-bottom: 2px solid #78909c;
}
thead tr.hdr-filter th select {
  width: 100%; border: 1px solid #90a4ae; border-radius: 3px;
  background: #eceff1; font-size: 10px; padding: 2px 3px; outline: none;
}

/* Body cells */
tbody td {
  padding: 0; border-right: 1px solid #e0e0e0; border-bottom: 1px solid #ececec;
  font-size: 12px; min-width: 140px;
}
tbody td.td-num {
  text-align: center; color: #90a4ae; font-weight: 700; font-size: 11px;
  background: #f5f7f7 !important; min-width: 34px; width: 34px;
}
tbody td input {
  width: 100%; padding: 5px 8px; border: none; background: transparent;
  font-size: 12px; font-family: inherit; outline: none; color: #263238;
}
tbody td input:focus { background: #fff9c4; }
tbody td.status-cell select {
  width: 100%; padding: 5px 6px; border: none; background: transparent;
  font-size: 12px; font-family: inherit; outline: none; cursor: pointer; font-weight: 600;
}
tbody tr { cursor: pointer; }
tbody tr:hover   td { background: #e8f5e9 !important; }
tbody tr.selected td { background: #c8e6c9 !important; }
tbody tr.selected td.td-num { background: #a5d6a7 !important; }

/* Status cell colors */
.s-done     { background: #e8f5e9 !important; color: #2e7d32; }
.s-pending  { background: #fff8e1 !important; color: #e65100; }
.s-shifted  { background: #f3e5f5 !important; color: #6a1b9a; }
.s-progress { background: #e3f2fd !important; color: #0d47a1; }

/* ═══════════════════════════════ TEMPLATE TAB ═════════════════════════════ */
#tab-template { padding: 14px 18px; gap: 12px; height: calc(100vh - 114px); overflow: hidden; }

.tpl-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }
.tpl-controls .sep { width: 1px; height: 24px; background: #ccc; margin: 0 4px; }

.template-grid {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 12px; flex: 1; overflow: hidden;
}

.panel {
  border: 1px solid #cfd8dc; border-radius: 8px; overflow: hidden;
  display: flex; flex-direction: column; background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.panel-hdr {
  background: linear-gradient(135deg, #1a6b3c, #2e7d4f);
  color: #fff; padding: 9px 14px; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.panel-hdr span { opacity: .75; font-weight: 400; font-size: 11px; margin-left: auto; }

/* Template list — premium 3D tilt cards */
.tpl-list {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 9px;
  /* breathing room so a tilted card's edges/glare are never clipped */
  perspective: 1200px;
}
.tpl-item {
  position: relative; overflow: hidden;
  padding: 11px 13px; border-radius: 10px;
  background: #f8f9fa; border: 1px solid #e0e0e0;
  cursor: pointer; font-size: 12px; color: #263238; line-height: 1.3;
  transform-style: preserve-3d; will-change: transform;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
/* devices without hover / reduced-motion get a clean static card, no GPU layer */
.tpl-item[data-tilt-static] { will-change: auto; }
.tpl-item:hover  { background: #e8f5e9; border-color: #4caf50; box-shadow: 0 10px 26px rgba(26,107,60,.18); }
.tpl-item.active { background: #1a6b3c; color: #fff; border-color: #1a6b3c; font-weight: 600; }

.tpl-card-body { position: relative; z-index: 1; }
.tpl-card-top  { display: flex; align-items: center; gap: 2px; }
.tpl-card-name { font-weight: 600; letter-spacing: .1px; }
.tpl-card-meta { margin-top: 4px; font-size: 10px; color: #78909c; font-weight: 500; letter-spacing: .3px; }
.tpl-item.active .tpl-card-meta { color: rgba(255,255,255,.78); }
.tpl-item.builtin .tpl-card-name::after { content: ' ★'; font-size: 10px; opacity: .7; }

/* glare sheen layer injected by tilt.js */
.tilt-glare {
  position: absolute; inset: 0; pointer-events: none;
  opacity: .16; z-index: 2; border-radius: inherit;
  mix-blend-mode: screen;          /* lighten-only — never muddies text */
  transition: opacity .25s ease;
}

.tpl-type-badge {
  display: inline-block;
  background: #00838f;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 5px;
  letter-spacing: .5px;
}

/* Template editor */
textarea#tplEditor {
  flex: 1; padding: 12px; font-family: 'Consolas','Courier New',monospace;
  font-size: 12.5px; border: none; resize: none; outline: none;
  line-height: 1.7; color: #263238; background: #fafffe;
}

/* Placeholder panel */
.ph-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: #f8f9fa; }
.ph-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px;
  border-radius: 5px; background: #fff; border: 1px solid #e0e0e0;
  cursor: pointer; transition: all .15s;
}
.ph-item:hover { background: #e8f5e9; border-color: #4caf50; transform: translateX(2px); }
.ph-tag {
  background: #0d3b20; color: #69f0ae; padding: 2px 8px; border-radius: 3px;
  font-family: 'Consolas',monospace; font-size: 10px; white-space: nowrap; flex-shrink: 0; margin-top: 1px;
}
.ph-desc { font-size: 11px; color: #546e7a; line-height: 1.3; }

/* ══════════════════════════════ OUTPUT TAB ════════════════════════════════ */
#tab-output { padding: 14px 18px; gap: 12px; height: calc(100vh - 114px); overflow: hidden; }

.output-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }
.output-toolbar .info { font-size: 12px; color: #546e7a; margin-left: auto; }

.cards-container { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-right: 2px; }

.script-card { border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.1); flex-shrink: 0; }

.card-hdr {
  padding: 9px 14px; display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #0d3b20 0%, #1a6b3c 100%); color: #fff;
}
.card-hdr .node-info  { flex: 1; min-width: 0; }
.card-hdr .node-name  { font-size: 13px; font-weight: 700; }
.card-hdr .node-sub   { font-size: 10px; color: rgba(255,255,255,.65); margin-top: 1px; }
.card-hdr .status-pill {
  padding: 2px 10px; border-radius: 10px; font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.card-hdr .card-copy {
  background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35);
  padding: 4px 12px; border-radius: 4px; cursor: pointer; font-size: 11px; font-weight: 600;
  transition: all .15s; flex-shrink: 0;
}
.card-hdr .card-copy:hover { background: rgba(255,255,255,.28); }

pre.script-body {
  margin: 0; padding: 12px 16px; font-family: 'Consolas','Courier New',monospace;
  font-size: 12px; line-height: 1.7; overflow-x: auto;
  background: #1e272e; color: #cdd6f4; max-height: 340px; overflow-y: auto;
}
.kw-cr   { color: #89b4fa; font-weight: 700; }
.kw-set  { color: #cba6f7; font-weight: 700; }
.kw-wait { color: #f38ba8; font-weight: 700; }
.kw-ipv6 { color: #a6e3a1; }
.kw-num  { color: #fab387; }
.kw-y    { color: #f9e2af; font-weight: 700; }

/* ══════════════════════════ EMPTY STATE ══════════════════════════════════ */
.empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #90a4ae; gap: 10px;
}
.empty-state .big-icon { font-size: 52px; }
.empty-state p { font-size: 13px; text-align: center; }

/* ══════════════════════════ MODAL (sheet picker) ═════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #fff; border-radius: 10px; min-width: 340px; max-width: 460px; width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,.3); overflow: hidden;
}
.modal-hdr {
  background: linear-gradient(135deg, #1a6b3c, #2e7d4f);
  color: #fff; padding: 14px 18px; font-size: 14px; font-weight: 700;
}
.modal-body { padding: 18px; }
.modal-body p { font-size: 13px; color: #546e7a; margin-bottom: 12px; }
.sheet-list { display: flex; flex-direction: column; gap: 8px; }
.sheet-btn {
  padding: 10px 14px; border-radius: 6px; background: #f0f4f8; border: 2px solid #e0e0e0;
  cursor: pointer; font-size: 13px; font-weight: 600; color: #263238; transition: all .15s; text-align: left;
}
.sheet-btn:hover { background: #e8f5e9; border-color: #4caf50; }
.modal-footer { padding: 12px 18px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; }

/* ══════════════════════ SPLASH SCREEN ════════════════════════════════════ */
.splash-screen {
  position: fixed; inset: 0; z-index: 9999; overflow: hidden;
  transition: opacity 0.6s ease;
  background: radial-gradient(ellipse 130% 95% at 50% 38%, #1c1136 0%, #0c0a1e 56%, #050410 100%);
}
.splash-screen.hidden { opacity: 0; pointer-events: none; }
/* Ericsson "boundless" iridescent aurora — slowly flowing brand gradient */
.splash-screen::before {
  content: ''; position: absolute; inset: -30%; pointer-events: none;
  background:
    radial-gradient(circle at 27% 30%, rgba(139,92,246,0.60), transparent 45%),
    radial-gradient(circle at 75% 24%, rgba(56,130,246,0.55), transparent 45%),
    radial-gradient(circle at 72% 76%, rgba(45,212,191,0.48), transparent 46%),
    radial-gradient(circle at 28% 80%, rgba(244,114,182,0.52), transparent 46%);
  filter: blur(52px) saturate(150%);
  animation: ericssonAurora 24s linear infinite;
}
@keyframes ericssonAurora {
  0%   { transform: rotate(0deg)   scale(1.18); }
  100% { transform: rotate(360deg) scale(1.18); }
}
/* faint vignette for depth */
.splash-screen::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 90% 70% at 50% 50%, transparent 55%, rgba(0,0,0,0.45) 100%);
}
.splash-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 2;
}
/* Ericsson three-stripe mark */
.splash-logo {
  position: absolute; left: 50%; top: 27%; transform: translate(-50%, -50%);
  width: 92px; height: 84px; z-index: 3;
  filter: drop-shadow(0 0 18px rgba(255,255,255,0.45));
  opacity: 0; animation: splashLogoIn 1s cubic-bezier(.16,1,.3,1) .15s forwards;
}
@keyframes splashLogoIn {
  from { opacity: 0; transform: translate(-50%, -42%) scale(.9); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.splash-logo .stripe { animation: stripeShimmer 3.5s ease-in-out infinite; }
.splash-logo .stripe:nth-child(2) { animation-delay: .25s; }
.splash-logo .stripe:nth-child(3) { animation-delay: .5s; }
@keyframes stripeShimmer { 0%,100% { opacity: .92; } 50% { opacity: 1; } }
.splash-footer {
  position: absolute; left: 0; right: 0; bottom: 52px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.splash-brand {
  font-family: 'Segoe UI', sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: 5px; color: #fff;
  text-shadow: 0 0 16px rgba(255,255,255,.45);
}
.splash-sub {
  font-size: 10.5px; letter-spacing: 3px; color: rgba(255,255,255,.62);
  text-transform: uppercase;
}
.splash-skip {
  position: absolute; bottom: 22px; right: 28px; z-index: 4;
  font-size: 11px; color: rgba(255,255,255,.55); cursor: pointer; letter-spacing: 1px;
  transition: color 0.2s;
}
.splash-skip:hover { color: #fff; }

/* ══════════════════════ SPARKLES TEXT ════════════════════════════════════ */
.sparkles-host { position: relative; display: inline-flex; align-items: center; }
.sparkle-star  {
  position: absolute; pointer-events: none; z-index: 20;
  transform: translate(-50%, -50%);
  animation: sparkle-pop 0.8s ease-in-out forwards;
}
@keyframes sparkle-pop {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(0) rotate(0deg); }
  45%  { opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(90deg); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(0) rotate(150deg); }
}

/* ══════════════════ MASTER OVERRIDE PANEL ════════════════════════════════ */
.ovr-panel {
  position: relative; flex-shrink: 0;
  background: linear-gradient(160deg, #0e1f2e 0%, #111e2d 50%, #0d1b28 100%);
  border: 1px solid #1e3a52; border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.04);
  transition: all .25s;
}
.ovr-panel.collapsed .ovr-body { display: none; }

/* pulse beam SVG behind header */
.ovr-beam-svg {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: .5;
}

/* Header */
.ovr-hdr {
  position: relative; display: flex; align-items: center;
  padding: 10px 16px; cursor: pointer; user-select: none;
  gap: 10px; min-height: 44px;
}
.ovr-hdr:hover { background: rgba(255,255,255,.02); }
.ovr-hdr-left  { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ovr-hdr-title { font-size: 13px; font-weight: 700; color: #e0f2fe; white-space: nowrap; }
.ovr-hdr-sub   { font-size: 11px; color: #546e7a; white-space: nowrap; }
.ovr-hdr-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ovr-toggle-icon { color: #546e7a; font-size: 11px; transition: transform .25s; }
.ovr-panel.collapsed .ovr-toggle-icon { transform: rotate(180deg); }

.ovr-badge {
  background: linear-gradient(135deg, #18CCFC, #6344F5);
  color: #fff; font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 10px;
  box-shadow: 0 0 8px rgba(99,68,245,.5);
  animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%,100% { box-shadow: 0 0 6px rgba(99,68,245,.4); }
  50%      { box-shadow: 0 0 14px rgba(99,68,245,.8); }
}

/* Body */
.ovr-body { padding: 0 16px 12px; display: flex; flex-direction: column; gap: 10px; }

/* Section label */
.ovr-sec-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: #78909c; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 6px;
}

/* Fields row */
.ovr-fields-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Each field card */
.ovr-field {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.04); border: 1px solid #1e3347;
  border-radius: 8px; padding: 7px 10px; transition: all .18s;
}
.ovr-field:focus-within {
  border-color: #18CCFC; background: rgba(24,204,252,.06);
  box-shadow: 0 0 12px rgba(24,204,252,.15);
}

/* Badges */
.ovr-field-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 24px; border-radius: 6px;
  font-size: 10px; font-weight: 800; color: #fff; flex-shrink: 0;
  letter-spacing: .04em;
}
.badge-b   { background: linear-gradient(135deg, #1a6b3c, #2e7d4f); box-shadow: 0 0 8px rgba(26,107,60,.6); }
.badge-c   { background: linear-gradient(135deg, #b8860b, #d4a017); box-shadow: 0 0 8px rgba(184,134,11,.6); }
.badge-piu { background: linear-gradient(135deg, #1565c0, #1e88e5); box-shadow: 0 0 8px rgba(30,136,229,.6); }
.badge-eth { background: linear-gradient(135deg, #6a1b9a, #8e24aa); box-shadow: 0 0 8px rgba(142,36,170,.6); }
.badge-vp  { background: linear-gradient(135deg, #00695c, #00897b); box-shadow: 0 0 8px rgba(0,137,123,.6); }
.badge-br  { background: linear-gradient(135deg, #bf360c, #e64a19); box-shadow: 0 0 8px rgba(230,74,25,.6); }

/* Field info */
.ovr-field-info { display: flex; flex-direction: column; gap: 1px; }
.ovr-field-name { font-size: 11px; font-weight: 600; color: #b0bec5; white-space: nowrap; }
.ovr-field-code {
  font-family: 'Consolas', monospace; font-size: 10px; color: #546e7a;
  white-space: nowrap; background: none; padding: 0;
}
.ovr-token { color: #69f0ae; font-weight: 700; }

/* Inputs */
.ovr-input {
  width: 80px; padding: 5px 8px; border-radius: 5px;
  border: 1px solid #263446; background: rgba(0,0,0,.3); color: #fff;
  font-size: 13px; font-weight: 700; font-family: 'Consolas', monospace;
  outline: none; transition: all .15s; text-align: center;
}
.ovr-input-wide { width: 130px; font-size: 11px; text-align: left; font-weight: 600; }
.ovr-input:focus    { border-color: #18CCFC; background: rgba(24,204,252,.06); color: #18CCFC; }
.ovr-input.active   { border-color: #69f0ae; color: #69f0ae; background: rgba(105,240,174,.06); }

/* Reset X button */
.ovr-x {
  background: none; border: none; color: #37474f; cursor: pointer;
  font-size: 11px; padding: 2px 4px; border-radius: 3px;
  transition: all .15s; line-height: 1; flex-shrink: 0;
}
.ovr-x:hover { color: #ef5350; background: rgba(239,83,80,.15); }

/* Divider */
.ovr-divider {
  display: flex; align-items: center; gap: 10px; margin: 4px 0;
}
.ovr-div-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #1e3a52, transparent); }
.ovr-div-text {
  font-size: 10px; font-weight: 700; color: #37474f;
  text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
}

/* Status bar */
.ovr-status-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: rgba(0,0,0,.2);
  border-radius: 6px; border: 1px solid #1a2e3e;
  margin-top: 4px;
}
.ovr-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #37474f; transition: all .3s;
}
.ovr-status-dot.active {
  background: #69f0ae;
  box-shadow: 0 0 8px rgba(105,240,174,.6);
  animation: dot-pulse 1.5s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%,100% { box-shadow: 0 0 6px rgba(105,240,174,.4); }
  50%      { box-shadow: 0 0 14px rgba(105,240,174,.9); }
}
.ovr-status-text { font-size: 11px; font-weight: 600; color: #546e7a; flex: 1; min-width: 0; }
.ovr-status-text.active { color: #69f0ae; }
.ovr-reset-all {
  background: rgba(239,83,80,.1); border: 1px solid rgba(239,83,80,.3);
  color: #ef9a9a; font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 4px; cursor: pointer; transition: all .15s; white-space: nowrap;
  flex-shrink: 0;
}
.ovr-reset-all:hover { background: rgba(239,83,80,.2); color: #ef5350; }

/* ══════════════════════ PASTE MODAL ══════════════════════════════════════ */
.paste-info {
  padding: 10px 14px; background: #e8f5e9; border-radius: 6px; font-size: 13px;
  color: #2e7d32; border: 1px solid #a5d6a7; margin-bottom: 12px; font-weight: 600;
}
.paste-info.warn { background: #fff3e0; color: #e65100; border-color: #ffcc80; }

/* column mapping grid */
.paste-map-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 0;
  border: 1px solid #ddd; border-radius: 6px; overflow: hidden; margin-bottom: 12px;
}
.paste-map-hdr {
  background: #263238; color: #fff; font-size: 11px; font-weight: 700;
  padding: 6px 10px; text-align: center;
}
.paste-map-row {
  display: contents;
}
.paste-map-row > div {
  padding: 5px 10px; border-top: 1px solid #eee; font-size: 12px;
  display: flex; align-items: center;
}
.paste-map-row:nth-child(odd) > div { background: #f8f9fa; }
.paste-col-label {
  font-family: 'Consolas', monospace; color: #263238; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.paste-arrow { justify-content: center; color: #90a4ae; font-size: 16px; }
.paste-map-select {
  width: 100%; border: 1px solid #b0bec5; border-radius: 4px; font-size: 12px;
  padding: 4px 6px; background: #fff; outline: none; font-family: inherit;
}
.paste-map-select:focus { border-color: #1a6b3c; }
.paste-map-select.auto-matched { border-color: #4caf50; background: #f0fff4; font-weight: 600; }

/* data preview */
.paste-preview-label { font-size: 11px; font-weight: 700; color: #546e7a; margin-bottom: 6px; }
.paste-preview-wrap { overflow-x: auto; border: 1px solid #ddd; border-radius: 6px; max-height: 180px; overflow-y: auto; }
.paste-preview-table { border-collapse: collapse; min-width: 100%; white-space: nowrap; font-size: 11px; }
.paste-preview-table th {
  background: #263238; color: #fff; padding: 5px 10px;
  position: sticky; top: 0; font-size: 10px; font-weight: 600;
}
.paste-preview-table td {
  padding: 4px 10px; border-bottom: 1px solid #eee; color: #263238;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.paste-preview-table tr:nth-child(even) td { background: #f8f9fa; }

.paste-append-lbl { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #546e7a; cursor: pointer; }
.paste-append-lbl input { cursor: pointer; }

/* ══════════════════════════ TOAST ════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 20px; right: 20px; background: #263238; color: #fff;
  padding: 10px 18px; border-radius: 6px; font-size: 12px; font-weight: 600;
  z-index: 9999; transform: translateY(60px); opacity: 0;
  transition: all .3s; box-shadow: 0 4px 12px rgba(0,0,0,.3);
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ══════════════════════════ SAVING INDICATOR ═════════════════════════════ */
.saving-dot {
  position: fixed; top: 12px; right: 14px; width: 8px; height: 8px;
  border-radius: 50%; background: #4caf50; opacity: 0;
  transition: opacity .3s; z-index: 200;
}
.saving-dot.active { opacity: 1; animation: pulse 1s infinite; }
.saving-dot.error { background: #f44336 !important; animation: none; box-shadow: 0 0 9px rgba(244,67,54,0.85); }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.4); } }

/* ══════════════════════════════════════════════════════════════════════════
   DARK THEME + FLOW FIELD BACKGROUND
   ══════════════════════════════════════════════════════════════════════════ */

/* Flow field canvas — sits behind everything */
#flowFieldBg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; display: block;
}

/* Dark base */
body {
  background: #07101a;
  position: relative; z-index: 1;
  display: flex; flex-direction: column; min-height: 100vh;
}

/* ── Brand marquee ribbon (vanilla port of InfiniteRibbon) ──────────────────── */
.brand-ribbon {
  overflow: hidden;
  background: linear-gradient(90deg, #00838f 0%, #26c6da 50%, #00838f 100%);
  color: #02161a;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: .6px;
  padding: 5px 0;
  border-top: 1px solid rgba(255,255,255,.10);
  border-bottom: 1px solid rgba(0,0,0,.30);
  flex-shrink: 0;
}
.brand-ribbon__track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: brand-ribbon-scroll 34s linear infinite;
}
.brand-ribbon:hover .brand-ribbon__track { animation-play-state: paused; }
.brand-ribbon__track span { padding: 0 2.5rem; }
@keyframes brand-ribbon-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-ribbon__track { animation-duration: 1ms; animation-iteration-count: 1; }
}
::-webkit-scrollbar-track { background: #0d1a26; }
::-webkit-scrollbar-thumb { background: #1e3a52; }
::-webkit-scrollbar-thumb:hover { background: #2a5070; }

/* Tabs bar */
.tabs {
  background: rgba(7,16,26,0.96);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(8px);
}
.tab { color: #607d8b; }
.tab:hover { color: #90a4ae; background: rgba(255,255,255,0.04); }
.tab.active { color: #69f0ae; border-bottom-color: #69f0ae; background: transparent; }
.tab .badge { background: rgba(255,255,255,0.1); color: #78909c; }
.tab.active .badge { background: rgba(105,240,174,0.2); color: #69f0ae; }
.tpl-controls .sep, .table-toolbar .sep { background: rgba(255,255,255,0.1); }
.row-count { color: #546e7a; }
.output-toolbar .info { color: #546e7a; }

/* ── Data table ──────────────────────────────────────────────────────────── */
.table-wrapper { border-color: rgba(255,255,255,0.08); background: transparent; }
table { background: #0b1622; }
thead tr.hdr-filter th {
  background: #132030; border-right-color: rgba(255,255,255,0.08); border-bottom-color: rgba(255,255,255,0.15);
}
thead tr.hdr-filter th select {
  background: #1a2e42; border-color: rgba(255,255,255,0.12); color: #90a4ae;
}
tbody td { border-right-color: rgba(255,255,255,0.05); border-bottom-color: rgba(255,255,255,0.04); }
tbody td input { color: #b0bec5; }
tbody td input:focus { background: rgba(105,240,174,0.07); }
tbody td.td-num { background: rgba(8,16,26,0.9) !important; color: #546e7a; }
tbody td.status-cell select { color: #90a4ae; }
tbody tr:hover   td { background: rgba(26,107,60,0.13) !important; }
tbody tr.selected td { background: rgba(26,107,60,0.22) !important; }
tbody tr.selected td.td-num { background: rgba(26,107,60,0.35) !important; color: #69f0ae; }
.s-done     { background: rgba(46,125,50,0.18)  !important; color: #69f0ae; }
.s-pending  { background: rgba(230,81,0,0.15)   !important; color: #ffab40; }
.s-shifted  { background: rgba(106,27,154,0.15) !important; color: #ce93d8; }
.s-progress { background: rgba(13,71,161,0.15)  !important; color: #64b5f6; }

/* Invalid cell — non-blocking visual hint only (never prevents generation) */
tbody td input.cell-invalid {
  background: rgba(183,28,28,0.20) !important;
  box-shadow: inset 0 0 0 1.5px rgba(244,67,54,0.75);
  color: #ff8a80 !important;
}
tbody td input.cell-invalid:focus { background: rgba(183,28,28,0.30) !important; }
tbody tr:hover td input.cell-invalid,
tbody tr.selected td input.cell-invalid { background: rgba(183,28,28,0.26) !important; }

/* ── Template panels ─────────────────────────────────────────────────────── */
.panel { background: rgba(10,18,30,0.95); border-color: rgba(255,255,255,0.09); }
.tpl-item {
  background: linear-gradient(155deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
  border-color: rgba(255,255,255,0.08); color: #90a4ae;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  --tilt-glare-color: rgba(105,240,174,0.50);
}
.tpl-item:hover {
  background: linear-gradient(155deg, rgba(26,107,60,0.22), rgba(26,107,60,0.08));
  border-color: #2e7d4f; color: #d7e0e6;
  box-shadow: 0 14px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(105,240,174,.12);
}
.tpl-item.active {
  background: linear-gradient(155deg, #1f7e47, #155e34);
  color: #fff; border-color: #69f0ae;
  box-shadow: 0 14px 34px rgba(0,0,0,.55), 0 0 0 1px rgba(105,240,174,.45), 0 0 22px rgba(105,240,174,.20);
  --tilt-glare-color: rgba(255,255,255,0.55);
}
.tpl-item .tpl-card-meta { color: #607d8b; }
.tilt-glare { opacity: .18; }
textarea#tplEditor { background: #091420; color: #cdd6f4; }
.ph-list { background: rgba(8,16,26,0.6); }
.ph-item { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.07); }
.ph-item:hover { background: rgba(26,107,60,0.12); }
.ph-desc { color: #546e7a; }

/* ── Script cards ────────────────────────────────────────────────────────── */
.script-card { background: #0b1622; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.empty-state { color: #37474f; }

/* ── Modals (sheet picker + paste) ──────────────────────────────────────── */
.modal-overlay { background: rgba(0,0,0,0.65); }
.modal-box { background: #0d1a26; border: 1px solid rgba(255,255,255,0.1); }
.modal-body p { color: #78909c; }
.sheet-btn { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.1); color: #90a4ae; }
.sheet-btn:hover { background: rgba(26,107,60,0.2); border-color: #2e7d4f; color: #b0bec5; }
.modal-footer { border-top-color: rgba(255,255,255,0.08); }

/* ── Paste modal columns ─────────────────────────────────────────────────── */
.paste-map-row { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.07); }
.paste-map-row select { background: #1a2e42; border-color: rgba(255,255,255,0.12); color: #90a4ae; }
.paste-preview-table th { background: #132030; color: #90a4ae; }
.paste-preview-table td { border-color: rgba(255,255,255,0.06); color: #78909c; }

/* ── Tab content backgrounds ─────────────────────────────────────────────── */
#tab-data, #tab-template, #tab-output {
  position: relative; z-index: 1;
}

/* ══════════════════════ CARD HIGHLIGHT (scroll-to pulse) ════════════════════ */
@keyframes card-highlight-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(105,240,174,0.7), 0 4px 20px rgba(0,0,0,.5); }
  50%  { box-shadow: 0 0 0 8px rgba(105,240,174,0), 0 8px 32px rgba(105,240,174,.3); }
  100% { box-shadow: 0 0 0 0 rgba(105,240,174,0),   0 4px 20px rgba(0,0,0,.5); }
}
.script-card.card-highlight {
  animation: card-highlight-pulse 1.4s ease-out;
  outline: 1px solid rgba(105,240,174,.45);
}

/* ══════════════════════ GLOWING SEARCH BAR — animated border ════════════════ */
@keyframes search-spin { to { transform: rotate(360deg); } }

.search-glow-wrap { position: relative; display: flex; align-items: center; flex-shrink: 0; }

/* Outer = clipping container; padding = border thickness */
.search-glow-outer {
  position: relative;
  display: flex; align-items: center;
  border-radius: 10px;
  padding: 1.5px;
  overflow: hidden;          /* keeps every spinning layer inside — no bleed */
  box-shadow:
    0 0 10px rgba(64,47,181,.35),
    0 0 22px rgba(207,48,170,.18);
  transition: box-shadow .3s;
}
.search-glow-outer:focus-within {
  box-shadow:
    0 0 14px rgba(64,47,181,.65),
    0 0 32px rgba(207,48,170,.4);
}

/* Disc layer 1 — forward spin */
.search-glow-outer::before {
  content: '';
  position: absolute;
  width: 220%; height: 220%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    #000 0deg,
    #402fb5 22deg,
    #000 70deg,
    #000 160deg,
    #cf30aa 200deg,
    #000 240deg,
    #000 320deg,
    #402fb5 348deg,
    #000 360deg
  );
  animation: search-spin 3s linear infinite;
  z-index: 0;
}

/* Disc layer 2 — counter-spin for depth */
.search-glow-outer::after {
  content: '';
  position: absolute;
  width: 220%; height: 220%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    rgba(0,0,0,0) 0deg,
    #18116a       55deg,
    rgba(0,0,0,0) 95deg,
    rgba(0,0,0,0) 185deg,
    #6e1b60       230deg,
    rgba(0,0,0,0) 270deg
  );
  animation: search-spin 7s linear infinite reverse;
  z-index: 0;
}

/* Accelerate on focus */
.search-glow-outer:focus-within::before { animation-duration: 1.2s; }
.search-glow-outer:focus-within::after  { animation-duration: 2s; }

/* Inner fills the cavity above the spinning discs */
.search-glow-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  background: #060d18; border-radius: 8.5px;
  width: 100%;
}
.search-glow-icon { padding: 0 8px 0 10px; color: #818cf8; flex-shrink: 0; display: flex; align-items: center; }
.search-glow-input {
  background: transparent; border: none; outline: none;
  color: #cdd6f4; font-size: 12.5px; font-family: inherit;
  padding: 7px 10px 7px 0; width: 190px; caret-color: #a78bfa;
}
.search-glow-input::placeholder { color: #3a3a5a; }
/* Kill the browser autofill white/blue background that breaks the dark search field */
.search-glow-input:-webkit-autofill,
.search-glow-input:-webkit-autofill:hover,
.search-glow-input:-webkit-autofill:focus,
.search-glow-input:-webkit-autofill:active {
  -webkit-text-fill-color: #cdd6f4 !important;
  -webkit-box-shadow: 0 0 0 1000px #060d18 inset !important;
  box-shadow: 0 0 0 1000px #060d18 inset !important;
  caret-color: #a78bfa;
  transition: background-color 9999s ease-in-out 0s;
}

/* ══════════════════════ PIXEL CANVAS ════════════════════════════════════════ */
pixel-canvas { display: block; }
.script-card { position: relative; overflow: hidden; }
.card-hdr, pre.script-body { position: relative; z-index: 1; }
.btn { position: relative; overflow: hidden; }
.btn pixel-canvas { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }

/* ══════════════════════ PREMIUM POLISH ══════════════════════════════════════ */
.toolbar-brand h1 {
  background: linear-gradient(135deg, #69f0ae 0%, #00e5ff 50%, #818cf8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.toolbar-brand small { color: rgba(255,255,255,0.4); }
.tab { position: relative; }
.tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 10%; right: 10%; height: 2px;
  background: linear-gradient(90deg, transparent, #69f0ae, transparent);
  box-shadow: 0 0 8px #69f0ae;
}
.btn-blue:hover   { box-shadow: 0 0 0 1px rgba(30,136,229,.35), 0 0 20px rgba(30,136,229,.55),   0 3px 8px rgba(0,0,0,.3); }
.btn-amber:hover  { box-shadow: 0 0 0 1px rgba(251,140,0,.35),  0 0 20px rgba(251,140,0,.5),    0 3px 8px rgba(0,0,0,.3); }
.btn-green:hover  { box-shadow: 0 0 0 1px rgba(67,160,71,.35),  0 0 20px rgba(105,240,174,.45), 0 3px 8px rgba(0,0,0,.3); }
.btn-red:hover    { box-shadow: 0 0 0 1px rgba(229,57,53,.35),  0 0 20px rgba(229,57,53,.5),    0 3px 8px rgba(0,0,0,.3); }
.btn-purple:hover { box-shadow: 0 0 0 1px rgba(142,36,170,.35), 0 0 20px rgba(142,36,170,.55),  0 3px 8px rgba(0,0,0,.3); }
.btn-teal:hover   { box-shadow: 0 0 0 1px rgba(0,137,123,.35),  0 0 20px rgba(0,137,123,.5),    0 3px 8px rgba(0,0,0,.3); }
.btn-ghost:hover  { box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 0 18px rgba(255,255,255,.12), 0 3px 8px rgba(0,0,0,.3); }

/* ══════════════════════════════════════════════════════════════════════════
   APP FOOTER  —  Premium MaskedSlideReveal signature
   ══════════════════════════════════════════════════════════════════════════ */
.app-footer {
  position: relative;
  background: linear-gradient(180deg, rgba(6,12,22,0.97) 0%, rgba(4,8,16,1) 100%);
  border-top: none;
  z-index: 10;
  flex-shrink: 0;
  margin-top: auto;
}

/* ── Animated multi-stop glow border ──────────────────────────────────────── */
.footer-glow-line {
  height: 1px;
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
}
.footer-glow-line::after {
  content: '';
  position: absolute;
  top: 0; left: -60%; width: 60%; height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(99,102,241,0.6) 30%,
    rgba(105,240,174,1)  50%,
    rgba(0,229,255,0.7)  65%,
    transparent);
  animation: glowline-travel 3.5s ease-in-out infinite;
}
@keyframes glowline-travel {
  0%   { left: -60%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: 120%; opacity: 0; }
}

/* ── Three-column layout ──────────────────────────────────────────────────── */
.footer-body {
  padding: 9px 22px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
}

/* ── Left column: tech stack ─────────────────────────────────────────────── */
.footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-pill {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}
.footer-pill.fp-flask  { background: rgba(105,240,174,0.08); border: 1px solid rgba(105,240,174,0.2); color: #4db6ac; }
.footer-pill.fp-js     { background: rgba(251,191,36,0.08);  border: 1px solid rgba(251,191,36,0.2);  color: #f59e0b; }
.footer-pill.fp-canvas { background: rgba(99,102,241,0.08);  border: 1px solid rgba(99,102,241,0.2);  color: #818cf8; }

/* ── Center: MaskedSlideReveal signature ─────────────────────────────────── */
.footer-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.footer-eyebrow {
  font-size: 8.5px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #263238;
  font-weight: 500;
  overflow: hidden;
}
.footer-eyebrow-inner {
  display: block;
  transform: translateY(100%);
  animation: rv-slide-up 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) 0.05s forwards;
}

/* Reveal row: "Made & Developed by VISHU" */
.footer-reveal {
  display: flex;
  align-items: baseline;
  gap: 0;
}

/* Each word is masked by its overflow:hidden parent — MaskedSlideReveal pattern */
.rv-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: 1.4;
  margin-right: 0.3em;
}
.rv-word:last-child { margin-right: 0; }

/* Inner span: starts below clip, springs up — mirrors Remotion translateY */
.rv-inner {
  display: inline-block;
  transform: translateY(110%);
  animation: rv-slide-up 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  font-size: 11.5px;
  font-family: 'Segoe UI', sans-serif;
  letter-spacing: 0.04em;
}
@keyframes rv-slide-up { to { transform: translateY(0); } }

/* Per-word styling */
.rv-word.rv-muted  .rv-inner { color: #455a64; font-weight: 400; }
.rv-word.rv-amp    .rv-inner { color: #4f46e5; font-weight: 700; font-size: 10px; }
.rv-word.rv-label  .rv-inner { color: #546e7a; font-weight: 500; }
.rv-word.rv-by     .rv-inner { color: #37474f; font-weight: 400; font-size: 10.5px; font-style: italic; }

/* ══════════════════════ GLOWING SHADOW — "VISHU" footer badge ═══════════════
   Faithful 1:1 port of glowing-shadow.tsx to vanilla CSS.
   @property declarations are REQUIRED — they allow @keyframes to smoothly
   interpolate --gs-rotate (blob orbit) and --gs-hue (colour cycle).
   Structure mirrors the React component exactly:
     .gs-container  →  .glow-container
     .gs-glow       →  .glow (orbiting blob)
     .gs-content    →  .glow-content (dark inner card)
   ══════════════════════════════════════════════════════════════════════════ */

/* Register custom properties so @keyframes can interpolate them */
@property --gs-hue         { syntax: "<number>"; inherits: true; initial-value: 0;    }
@property --gs-rotate      { syntax: "<number>"; inherits: true; initial-value: -70;  }
@property --gs-bg-x        { syntax: "<number>"; inherits: true; initial-value: 0;    }
@property --gs-bg-y        { syntax: "<number>"; inherits: true; initial-value: 0;    }
@property --gs-glow-ty     { syntax: "<number>"; inherits: true; initial-value: -65;  }
@property --gs-bg-size     { syntax: "<number>"; inherits: true; initial-value: 1;    }
@property --gs-glow-blur   { syntax: "<number>"; inherits: true; initial-value: 6;    }
@property --gs-glow-scale  { syntax: "<number>"; inherits: true; initial-value: 1.5;  }
@property --gs-glow-op     { syntax: "<number>"; inherits: true; initial-value: 1;    }
@property --gs-glow-radius { syntax: "<number>"; inherits: true; initial-value: 100;  }
@property --gs-white-shd   { syntax: "<number>"; inherits: true; initial-value: 0;    }

/* Slide-up wrapper — picks up rv-word nth-child(5) delay */
.gs-slide {
  display: inline-block;
  transform: translateY(110%);
  animation: rv-slide-up 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.rv-word:nth-child(5) .gs-slide { animation-delay: 0.44s; }

/* ── .glow-container ─────────────────────────────────────────────────────── */
.gs-container {
  --gs-card-color:   hsl(260deg 100% 3%);
  --gs-card-radius:  22px;
  --gs-border-width: 2px;
  --gs-speed:        4s;
  --gs-interact:     0.55s;
  --gs-hue-speed:    1;
  --gs-scale-factor: 1;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  border-radius: var(--gs-card-radius);
  cursor: default;
  margin-left: 3px;
}

/* ── .glow — orbiting element ────────────────────────────────────────────── */
.gs-glow {
  --gs-glow-ty: -65;
  display: block;
  position: absolute;
  width: 28px; height: 28px;
  animation: gs-rotate-anim var(--gs-speed) linear infinite;
  transform: rotateZ(calc(var(--gs-rotate) * 1deg));
  transform-origin: center;
  border-radius: calc(var(--gs-glow-radius) * 10vw);
}
/* The actual coloured glow sphere — mirrors .glow:after exactly */
.gs-glow::after {
  content: "";
  display: block;
  position: relative;
  z-index: -2;
  width: 130%; height: 130%;
  left: -15%; top: -15%;
  border-radius: calc(var(--gs-glow-radius) * 10vw);
  background: hsl(calc(var(--gs-hue) * var(--gs-hue-speed) * 1deg) 100% 60%);
  filter: blur(calc(var(--gs-glow-blur) * 8px));
  animation: gs-hue-anim var(--gs-speed) linear infinite;
  transform:
    scaleY(calc(var(--gs-glow-scale) * var(--gs-scale-factor) / 1.1))
    scaleX(calc(var(--gs-glow-scale) * var(--gs-scale-factor) * 1.2))
    translateY(calc(var(--gs-glow-ty) * 1%));
  opacity: var(--gs-glow-op);
}

/* ── .glow-content — dark inner card ────────────────────────────────────── */
.gs-content {
  position: relative;
  z-index: 1;
  background: var(--gs-card-color);
  border-radius: calc(var(--gs-card-radius) * 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 18px;
}
/* Animated radial-gradient shimmer — mirrors .glow-content:before */
.gs-content::before {
  content: "";
  display: block;
  position: absolute;
  width:  calc(100% + var(--gs-border-width));
  height: calc(100% + var(--gs-border-width));
  top:  calc(var(--gs-border-width) / -2);
  left: calc(var(--gs-border-width) / -2);
  border-radius: calc(var(--gs-card-radius) * 0.9);
  box-shadow: 0 0 20px black;
  mix-blend-mode: color-burn;
  z-index: -1;
  background: hsl(0deg 0% 16%) radial-gradient(
    30% 30% at calc(var(--gs-bg-x) * 1%) calc(var(--gs-bg-y) * 1%),
    hsl(calc(var(--gs-hue) * 1deg) 100% 90%) calc(0%  * var(--gs-bg-size)),
    hsl(calc(var(--gs-hue) * 1deg) 100% 80%) calc(20% * var(--gs-bg-size)),
    hsl(calc(var(--gs-hue) * 1deg) 100% 60%) calc(40% * var(--gs-bg-size)),
    transparent 100%
  );
  animation:
    gs-hue-anim   var(--gs-speed) linear infinite,
    gs-rotate-bg  var(--gs-speed) linear infinite;
  transition: --gs-bg-size var(--gs-interact) ease;
}

/* ── VISHU text ──────────────────────────────────────────────────────────── */
.gs-text {
  position: relative; z-index: 1;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.22em;
  font-style: italic;
  color: #fff;
  font-family: 'Segoe UI', sans-serif;
}

/* ── Hover — mirrors exact React hover states ────────────────────────────── */
.gs-container:hover .gs-content {
  mix-blend-mode: darken;
  box-shadow: 0 0 calc(var(--gs-white-shd) * 1vw)
              calc(var(--gs-white-shd) * 0.15vw) rgb(255 255 255 / 20%);
  animation: gs-shadow-pulse calc(var(--gs-speed) * 2) linear infinite;
}
.gs-container:hover .gs-content::before {
  --gs-bg-size: 15;
  animation-play-state: paused;
}
.gs-container:hover .gs-glow {
  --gs-glow-blur:   1.5;
  --gs-glow-op:     0.6;
  --gs-glow-scale:  2.5;
  --gs-glow-radius: 0;
  animation-play-state: paused;
}
.gs-container:hover .gs-glow::after {
  --gs-glow-ty: 0;
  animation-play-state: paused;
  transition:
    --gs-glow-blur   0.05s ease,
    --gs-glow-op     0.05s ease,
    --gs-glow-scale  0.05s ease,
    --gs-glow-radius 0.05s ease;
}

/* ── Keyframes — exact port of original @keyframes ──────────────────────── */
/* blob rotation: --gs-rotate -70 → 290 (full revolution), ty stays -65 */
@keyframes gs-rotate-anim {
  from { --gs-rotate: -70;  --gs-glow-ty: -65; }
  25%  {                    --gs-glow-ty: -65; }
  50%  {                    --gs-glow-ty: -65; }
  75%  {                    --gs-glow-ty: -65; }
  to   { --gs-rotate: 290;  --gs-glow-ty: -65; }
}
/* hue cycle 0 → 360 */
@keyframes gs-hue-anim {
  from { --gs-hue: 0;   }
  to   { --gs-hue: 360; }
}
/* background spotlight walks the four corners */
@keyframes gs-rotate-bg {
  0%   { --gs-bg-x: 0;   --gs-bg-y: 0;   }
  25%  { --gs-bg-x: 100; --gs-bg-y: 0;   }
  50%  { --gs-bg-x: 100; --gs-bg-y: 100; }
  75%  { --gs-bg-x: 0;   --gs-bg-y: 100; }
  100% { --gs-bg-x: 0;   --gs-bg-y: 0;   }
}
/* white glow pulse on hover */
@keyframes gs-shadow-pulse {
  0%,  24%, 46%, 73%, 96%           { --gs-white-shd: 0.5; }
  12%, 28%, 41%, 63%, 75%, 82%, 98% { --gs-white-shd: 2.5; }
  6%,  32%, 57%                     { --gs-white-shd: 1.3; }
  18%, 52%, 88%                     { --gs-white-shd: 3.5; }
}

/* Stagger delays — i * 0.09s (mirrors Remotion i * staggerDelay / fps) */
.rv-word:nth-child(1) .rv-inner { animation-delay: 0.08s; }
.rv-word:nth-child(2) .rv-inner { animation-delay: 0.17s; }
.rv-word:nth-child(3) .rv-inner { animation-delay: 0.26s; }
.rv-word:nth-child(4) .rv-inner { animation-delay: 0.35s; }
.rv-word:nth-child(5) .rv-inner { animation-delay: 0.44s; }

/* ── Right column: version + copyright ───────────────────────────────────── */
.footer-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.footer-version {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em;
  padding: 2px 8px; border-radius: 20px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.28);
  color: #6366f1;
  transition: box-shadow 0.3s;
}
.footer-version:hover {
  box-shadow: 0 0 12px rgba(99,102,241,0.4);
}
.footer-copy {
  font-size: 9.5px; color: #263238; letter-spacing: 0.03em;
  overflow: hidden;
}
.footer-copy-inner {
  display: block;
  transform: translateY(100%);
  animation: rv-slide-up 0.55s cubic-bezier(0.34, 1.4, 0.64, 1) 0.6s forwards;
}

/* ══════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY & POLISH PASS  (cascades last — overrides earlier outline:none)
   Keyboard focus rings show only for keyboard users (:focus-visible); mouse
   clicks are unaffected, so the existing visual design is untouched.
   ══════════════════════════════════════════════════════════════════════════ */
.btn:focus-visible,
.tab:focus-visible,
.piu-toggle-label:focus-within {
  outline: 2px solid #69f0ae;
  outline-offset: 2px;
  border-radius: 5px;
}
tbody td input:focus-visible,
thead tr.hdr-filter th select:focus-visible,
#tplEditor:focus-visible,
.search-glow-input:focus-visible,
.ovr-input:focus-visible {
  outline: 2px solid #18CCFC;
  outline-offset: -1px;
}
/* Honour reduced-motion globally — calm everything for users who ask for it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .brand-ribbon__track { animation: none !important; }
}
/* Slimmer, themed scrollbar for the data table (Chromium/WebKit) */
.table-wrapper::-webkit-scrollbar { height: 10px; width: 10px; }
.table-wrapper::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
.table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(105,240,174,0.25); border-radius: 6px;
}
.table-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(105,240,174,0.45); }

/* ═══════════════════════════ LOGIN — NEURAL / MERCURY ════════════════════════ */
#loginOverlay {
  position: fixed; inset: 0; z-index: 99999; overflow: hidden;
  background: radial-gradient(ellipse at 62% 38%, #0a1f16 0%, #04100a 58%, #020806 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .45s ease;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
#loginOverlay.fade-out { opacity: 0; pointer-events: none; }
.neural-svg-filter { position: absolute; width: 0; height: 0; }

/* liquid gooey blob field (green mercury on brand) */
.neural-stage {
  position: absolute; inset: 0; z-index: 0;
  filter: url('#gooey'); opacity: .5; pointer-events: none;
}
.neural-blob {
  position: absolute; border-radius: 50%;
  background: linear-gradient(135deg, #69f0ae, #1a6b3c);
  filter: blur(22px);
  box-shadow: inset -10px -10px 22px rgba(0,0,0,.55), 10px 10px 34px rgba(105,240,174,.18);
  animation: neuralFloat 20s infinite alternate ease-in-out;
  transition: margin .12s ease-out;
}
@keyframes neuralFloat {
  0%   { transform: translate(0,0) scale(1); }
  33%  { transform: translate(10vw,20vh) scale(1.2); }
  66%  { transform: translate(-5vw,10vh) scale(.8); }
  100% { transform: translate(5vw,-10vh) scale(1.1); }
}
@keyframes neuralCardIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes neuralShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-9px); } 40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(6px); }
}

.neural-card {
  position: relative; z-index: 10; width: 100%; max-width: 430px; margin: 0 20px;
  padding: 46px 42px 28px;
  background: rgba(6,16,11,.55); backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(105,240,174,.14); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.02) inset;
  animation: neuralCardIn .5s cubic-bezier(.16,1,.3,1) both;
}
.neural-card::before {
  content: ''; position: absolute; top: 0; left: 22px; right: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(105,240,174,.5), transparent);
}
.neural-card.shake { animation: neuralShake .4s ease both; }

.neural-header { margin-bottom: 42px; }
.neural-brandid {
  display: block; font-family: ui-monospace, 'Courier New', monospace;
  font-size: 9.5px; letter-spacing: 4px; text-transform: uppercase;
  color: rgba(105,240,174,.55); margin-bottom: 16px;
}
.neural-title {
  margin: 0; font-weight: 800; font-size: 3rem; line-height: .88; letter-spacing: -2px;
  color: #eafff3;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .neural-title {
    background: linear-gradient(180deg, #ffffff 0%, #b9f6d4 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  }
}
.neural-tagline { margin: 14px 0 0; font-size: 11px; letter-spacing: .4px; color: rgba(144,164,174,.6); }

.neural-group { position: relative; margin-bottom: 26px; transition: transform .4s cubic-bezier(.2,1,.3,1); }
.neural-group:focus-within { transform: translateX(8px); }
.neural-group label {
  display: block; font-family: ui-monospace, 'Courier New', monospace;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(105,240,174,.6); margin-bottom: 10px;
}
.neural-group input {
  width: 100%; box-sizing: border-box; background: transparent; border: none;
  border-bottom: 1px solid rgba(255,255,255,.12); color: #eafff3;
  padding: 11px 0; font-size: 17px; letter-spacing: .3px; outline: none; transition: border-color .4s;
}
.neural-group input::placeholder { color: rgba(144,164,174,.35); }
.neural-glow {
  position: absolute; left: 0; bottom: 0; width: 0; height: 2px;
  background: #69f0ae; box-shadow: 0 0 14px #69f0ae;
  transition: width .6s cubic-bezier(.2,1,.3,1);
}
.neural-group input:focus ~ .neural-glow { width: 100%; }

.neural-remember {
  display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 4px;
  font-family: ui-monospace, 'Courier New', monospace; font-size: 10px; letter-spacing: 1px;
  text-transform: uppercase; color: rgba(144,164,174,.55); cursor: pointer; user-select: none;
}
.neural-remember input { accent-color: #69f0ae; width: 13px; height: 13px; cursor: pointer; }

.neural-submit { position: relative; margin-top: 34px; filter: url('#gooey'); }
.neural-btn {
  position: relative; z-index: 2; width: 100%; border: none; cursor: pointer;
  background: #69f0ae; color: #04120a; padding: 18px 32px;
  font-family: system-ui, sans-serif; font-size: 13px; font-weight: 800;
  letter-spacing: 2px; text-transform: uppercase; transition: letter-spacing .3s;
}
.neural-btn:hover { letter-spacing: 4px; }
.neural-drop {
  position: absolute; top: 50%; left: 50%; z-index: 1; width: 100%; height: 100%;
  background: #69f0ae; border-radius: 50px; transform: translate(-50%,-50%);
  transition: all .5s cubic-bezier(.175,.885,.32,1.275);
}
.neural-submit:hover .neural-drop { transform: translate(-50%,-50%) scale(1.06,1.25); filter: brightness(1.15); }

.neural-error {
  display: none; margin-top: 18px; padding: 10px 14px; border-radius: 8px;
  background: rgba(211,47,47,.12); border: 1px solid rgba(211,47,47,.32);
  color: #ff8a80; font-size: 11px; text-align: center; letter-spacing: .3px;
}
.neural-foot {
  margin-top: 32px; display: flex; justify-content: space-between;
  font-family: ui-monospace, 'Courier New', monospace; font-size: 9px;
  letter-spacing: 2px; color: rgba(144,164,174,.4);
}
@media (max-width: 480px) {
  .neural-card { padding: 38px 26px 24px; }
  .neural-title { font-size: 2.4rem; }
}
