/* Pendulum FX — semantics and page shell layered on top of nocturne.css. */
:root {
  --c-gain: oklch(0.80 0.085 160);
  --c-loss: oklch(0.72 0.115 25);
  --c-warn: oklch(0.80 0.100 85);
}

body {
  background: #0f111c;
  color: var(--color-text);
  font-family: 'Inter', sans-serif;
  margin: 0;
}

.mono { font-family: ui-monospace, Menlo, monospace; }

@keyframes pf-swing { from { transform: rotate(-40deg); } to { transform: rotate(40deg); } }
@keyframes pf-swing-loop { 0% { transform: rotate(-40deg); } 50% { transform: rotate(40deg); } 100% { transform: rotate(-40deg); } }
@keyframes pf-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes pf-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .login-logo g, .login-logo path, .login-logo circle, .splash-logo g { animation: none !important; }
}

/* ---- Login ---- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1100px 620px at 62% 40%, #1b1e30 0%, #0f111c 70%);
}
.login-row {
  display: flex;
  align-items: center;
  gap: 56px;
  transform: translateX(7%);
}
.login-left { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.login-wordmark { font-size: 30px; font-weight: 500; }
.login-wordmark .fx { color: var(--color-accent-300); }
.login-tagline {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--color-accent-300);
}
.login-divider {
  width: 1px; align-self: stretch; min-height: 300px;
  background: linear-gradient(to bottom, transparent, var(--color-divider) 48px, var(--color-divider) calc(100% - 48px), transparent);
}
.login-right { width: 360px; }
.login-right h4 { font-size: 20px; font-weight: 500; margin: 0 0 4px; }
.login-sub { font-size: 13px; color: var(--color-neutral-400); margin: 0 0 20px; }
.login-error {
  font-size: 12px; color: var(--c-loss); background: color-mix(in srgb, var(--c-loss) 14%, transparent);
  border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 14px;
}
.field-row { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 4px; }
.link { color: var(--color-accent-300); font-size: 12px; text-decoration: none; }
.link:hover { text-decoration: underline; }
.code-inputs { display: flex; gap: 8px; margin: 16px 0; }
.code-inputs input {
  width: 48px; height: 54px; text-align: center; font-size: 22px; font-weight: 500;
  font-family: ui-monospace, Menlo, monospace;
}
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 12px 0; }
.qr-box {
  width: 124px; height: 124px; border: 1px dashed var(--color-divider); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.qr-box img { width: 100%; height: 100%; }
.key-block {
  background: color-mix(in srgb, var(--color-text) 5%, transparent);
  font-family: ui-monospace, Menlo, monospace; font-size: 13px; padding: 10px 12px;
  border-radius: var(--radius-sm); word-break: break-all; margin-bottom: 12px;
}
.recovery-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px;
  background: color-mix(in srgb, var(--color-text) 5%, transparent);
  border-radius: var(--radius-md); padding: 14px; font-family: ui-monospace, Menlo, monospace;
  font-size: 13px; margin-bottom: 14px;
}
.btn-row { display: flex; gap: 8px; margin-bottom: 14px; }

/* ---- Splash ---- */
.splash {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(1100px 620px at 62% 40%, #1b1e30 0%, #0f111c 70%);
}
.splash-track { width: 172px; height: 2px; background: var(--color-divider); position: relative; overflow: hidden; border-radius: 2px; }
.splash-bar { position: absolute; width: 42%; height: 100%; background: var(--color-accent); animation: sweep 1.4s ease-in-out infinite; }
@keyframes sweep { 0% { left: -42%; } 100% { left: 100%; } }
.splash-status { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.4; font-family: ui-monospace, Menlo, monospace; }

/* ---- App shell ---- */
.app-header {
  position: sticky; top: 0; z-index: 10; background: var(--color-surface);
  box-shadow: 0 1px 0 var(--color-divider);
}
.app-header-inner {
  max-width: 1560px; margin: 0 auto; padding: 0 24px; height: 56px;
  display: flex; align-items: center; gap: 20px;
}
.app-brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 500; margin-right: 16px; }
.app-nav { display: flex; gap: 4px; flex: 1; }
.app-nav a {
  font-size: 13px; padding: 6px 11px; border-radius: 7px; color: var(--color-neutral-400);
  text-decoration: none;
}
.app-nav a.active { color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.app-page { max-width: 1560px; margin: 0 auto; padding: 24px; }
.paused-strip {
  background: color-mix(in srgb, var(--c-warn) 14%, transparent); color: var(--c-warn);
  font-size: 12px; padding: 8px 24px; text-align: center;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.dot-gain { background: var(--c-gain); }
.dot-warn { background: var(--c-warn); }
.dot-loss { background: var(--c-loss); }

@media (prefers-reduced-motion: reduce) {
  .pulse-dot, .splash-bar { animation: none; }
}

/* ---- Legacy utility classes (older templates) ---- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--color-divider); }
th { color: color-mix(in srgb, var(--color-text) 60%, transparent); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.num { font-family: ui-monospace, Menlo, monospace; }
.pos { color: var(--c-gain); }
.neg { color: var(--c-loss); }
.overflow-x { overflow-x: auto; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.row .label { color: var(--color-neutral-400); }
.dry-run-banner { background: color-mix(in srgb, var(--c-warn) 12%, transparent); color: var(--c-warn); padding: 8px 14px; border-radius: var(--radius-md); margin-bottom: 14px; font-size: 13px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.badge-win { background: color-mix(in srgb, var(--c-gain) 18%, transparent); color: var(--c-gain); }
.badge-loss { background: color-mix(in srgb, var(--c-loss) 18%, transparent); color: var(--c-loss); }
.badge-weekend { background: transparent; color: var(--color-accent-300); border: 1px solid var(--color-accent-300); }
.badge-manual { background: var(--color-neutral-800); color: var(--color-neutral-400); }
.badge-open { background: color-mix(in srgb, var(--color-accent) 18%, transparent); color: var(--color-accent-300); }
.badge-stale { background: color-mix(in srgb, var(--c-loss) 18%, transparent); color: var(--c-loss); }
.badge-fresh { background: color-mix(in srgb, var(--c-gain) 18%, transparent); color: var(--c-gain); }
.badge-dry { background: var(--color-neutral-800); color: var(--color-neutral-400); }
.badge-live { background: color-mix(in srgb, var(--c-loss) 14%, transparent); color: var(--c-loss); }
select, input[type=text] { background: var(--color-bg); border: 1px solid var(--color-divider); color: var(--color-text); border-radius: var(--radius-sm); padding: 6px 8px; font-size: 13px; }
h2 { font-size: 15px; font-weight: 500; color: var(--color-neutral-400); margin: 18px 0 8px; }
h3 { font-size: 15px; font-weight: 500; margin: 0 0 6px; }
