/* base + elrise variables */

:root {
  --bg: #07090c;
  --bg-2: #0d1117;
  --fg: #c7d0d9;
  --dim: #6b7480;
  --bright: #ffffff;
  --accent: #4ec99a;       /* calmer sage-mint; the saturated #00ff9c reads too hot for buttons */
  --accent-bright: #6ee0ad; /* hover / slider thumb; still in the sage family */
  --accent-2: #6ec2d9;
  --accent-3: #b96bff;
  --accent-warm: #ff8c42;
  --line: rgba(255,255,255,0.06);
  --line-strong: rgba(255,255,255,0.10);
  --glass: rgba(20, 25, 32, 0.55);
  --glass-strong: rgba(20, 25, 32, 0.78);
  --glow: 0 0 0 1px rgba(78,201,154,0.25), 0 0 22px rgba(78,201,154,0.14);
  --glow-soft: 0 0 0 1px rgba(78,201,154,0.18), 0 0 10px rgba(78,201,154,0.06);
  --radius: 14px;
  --radius-sm: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "Fira Code", "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--fg); font-family: var(--font-mono); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  padding: 24px 24px 40px;
  position: relative;
  overflow-x: hidden;
}
@media (max-width: 720px) { body { padding: 16px; } }
::selection { background: var(--accent); color: #000; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--bright); }
img, svg { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }


/* page-local: glassmorphism + neon */

/* =========================================================================
 * /tools/converter/ — page-local styles (v5 glass + neon)
 * ========================================================================= */

/* === AURORA BACKGROUND === */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora::before, .aurora::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
  animation: aurora-float 22s ease-in-out infinite;
}
.aurora::before {
  width: 60vw; height: 60vw;
  top: -20%; left: -10%;
  background: radial-gradient(circle, rgba(78,201,154,0.55) 0%, transparent 60%);
}
.aurora::after {
  width: 50vw; height: 50vw;
  bottom: -20%; right: -10%;
  background: radial-gradient(circle, rgba(185,107,255,0.4) 0%, transparent 60%);
  animation-delay: -11s;
}
.aurora__third {
  position: absolute;
  width: 40vw; height: 40vw;
  top: 30%; left: 40%;
  background: radial-gradient(circle, rgba(0,212,255,0.25) 0%, transparent 60%);
  border-radius: 50%;
  filter: blur(100px);
  animation: aurora-float 30s ease-in-out infinite reverse;
  opacity: 0.4;
}
@keyframes aurora-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(8%, -4%) scale(1.08); }
  66% { transform: translate(-6%, 6%) scale(0.95); }
}

/* grain overlay for texture */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* === SHELL === */
.shell {
  position: relative;
  z-index: 2;
  max-width: 920px;
  margin: 0 auto;
}

/* === TABS + LANG PILL === */
.tabs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--dim);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
  min-height: 32px;
}
.tab:hover { color: var(--fg); text-decoration: none; }
.tab--active {
  color: var(--bg);
  background: var(--accent);
  box-shadow: 0 0 16px rgba(78,201,154,0.35);
}

/* RU/EN pill switcher */
.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.lang-pill button,
.lang-pill .lang-pill__link {
  appearance: none;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  min-height: 26px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.lang-pill button:hover,
.lang-pill .lang-pill__link:hover { color: var(--fg); }
.lang-pill button[aria-pressed="true"],
.lang-pill .lang-pill__link[aria-current="true"] {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(78,201,154,0.35);
}

/* === HEADER ACTIONS (CR-046 share button) === */
.header__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.header__btn:hover { color: var(--bright); border-color: var(--line-strong); background: rgba(255,255,255,0.04); }
.header__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.header__btn--ghost { /* alias of the base — explicit for grep-ability */ }
.header__btn svg { display: block; }

/* CR-113: inline share-button indicator. The capability-gated
 * share handler (converter.js) toggles `.is-copied` / `.is-error`
 * for ~1.5s so the operator sees the click outcome adjacent to
 * the button instead of at the page-bottom toast (which is too
 * far to register for a header button click). The element is
 * hidden by default; the handler un-hides it via the inline
 * style attribute when the indicator fires.
 */
.share-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--fg);
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: share-indicator-fade 1.5s ease forwards;
}
.share-indicator.is-copied {
  border-color: var(--accent);
  color: var(--accent);
}
.share-indicator.is-error {
  border-color: var(--err);
  color: var(--err);
}
.share-indicator[hidden] { display: none; }
@keyframes share-indicator-fade {
  0% { opacity: 0; transform: translateY(-2px); }
  10% { opacity: 1; transform: translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

/* === HERO === */
.hero {
  text-align: center;
  margin: 0 auto 36px;
  max-width: 640px;
}
.hero__title {
  font-family: var(--font-sans);
  font-size: 48px;
  font-weight: 700;
  color: #00ff9c;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 12px;
  text-shadow: 0 0 4px  rgba(0, 255, 156, 1.0),
               0 0 10px rgba(0, 255, 156, 0.95),
               0 0 24px rgba(0, 255, 156, 0.55),
               0 0 48px rgba(0, 255, 156, 0.25);
  animation: neon-breathe 4.2s ease-in-out infinite,
             neon-flicker 7s steps(1, end) infinite;
}

@keyframes neon-breathe {
  0%, 100% {
    text-shadow: 0 0 4px  rgba(0, 255, 156, 1.0),
                 0 0 10px rgba(0, 255, 156, 0.85),
                 0 0 24px rgba(0, 255, 156, 0.50),
                 0 0 48px rgba(0, 255, 156, 0.22);
  }
  50% {
    text-shadow: 0 0 5px  rgba(0, 255, 156, 1.0),
                 0 0 14px rgba(0, 255, 156, 0.95),
                 0 0 32px rgba(0, 255, 156, 0.65),
                 0 0 64px rgba(0, 255, 156, 0.30);
  }
}

@keyframes neon-flicker {
  /* real-tube "startup flicker": single brief opacity dip near
     the start of the loop; rest of the loop stays at full opacity. */
  0%, 86%, 100% { opacity: 1; }
  87%          { opacity: 0.7; }
  87.5%        { opacity: 1; }
  88%          { opacity: 0.85; }
  88.5%        { opacity: 1; }
}
@media (max-width: 720px) { .hero__title { font-size: 32px; } }
.hero__sub {
  color: var(--fg);
  font-size: 14px;
  max-width: 52ch;
  margin: 40px auto;
  line-height: 1.5;
}
.hero__sub .accent { color: var(--accent); }
.hero__meta {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.04em;
}
.hero__meta a { color: var(--dim); border-bottom: 1px dashed var(--line-strong); }
.hero__meta a:hover { color: var(--accent); border-color: var(--accent-dim); }

.stats-band {
  position: relative;
  display: block;
  margin: 0 0 18px;
  padding: 14px 18px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.stats-band::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(78,201,154,0.35), transparent 35%, transparent 65%, rgba(110,194,217,0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.stats-band__notice {
  margin: 10px 0 -2px;
  padding: 0 14px;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.02em;
}
.stats-band__notice.is-hidden { display: none; }
.stats-band__toggle {
  position: relative;
  display: block;
  width: 100%;
  margin: 0px 0 -2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
  border-radius: var(--radius-sm);
  transition: background 0.18s ease;
}
.stats-band__toggle:hover { background: rgba(255,255,255,0.02); }
.stats-band__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.stats-band__toggle .stats-band__chart {
  display: block;
  margin: 0;
  padding: 0 10px;
  position: relative;
}
.stats-band__chart {
  margin: 14px 4px -2px;
  padding: 0 10px;
  position: relative;
}
.stats-band__chart[hidden] { display: none; }
.stats-band__chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stats-band__chart-label {
  color: var(--dim);
  font-weight: 300;
}
.stats-band__chart-peak {
  color: var(--accent-bright);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.stats-band__chart-peak strong {
  color: var(--bright);
  font-weight: 700;
}
.stats-band__sparkline {
  display: block;
  width: 100%;
  /* CR-099: aspect-ratio matches the SVG viewBox (300x60 = 5:1) so the
     peak circle stays round under preserveAspectRatio="none". The
     area chart still stretches to fill the SVG element. */
  aspect-ratio: 5 / 1;
  max-height: 46px;
  overflow: visible;
}
.stats-band__sparkline .spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(78, 201, 154, 0.45));
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: spark-draw 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.stats-band__sparkline .spark-area {
  fill: url(#spark-grad);
  opacity: 0;
  animation: spark-fade 0.8s ease-out 0.4s forwards;
}
.stats-band__sparkline .spark-bar {
  fill: var(--line);
  opacity: 0.55;
}
.stats-band__sparkline .spark-peak {
  fill: var(--bright);
  stroke: var(--accent);
  stroke-width: 1.6;
  opacity: 0;
  animation: spark-peak-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.95s forwards;
}
.stats-band__sparkline .spark-peak-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0;
  animation: spark-ring 1.6s ease-out 1.1s infinite;
}
.stats-band__sparkline .spark-today {
  stroke: var(--line-strong);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}
@keyframes spark-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes spark-fade {
  to { opacity: 0.85; }
}
@keyframes spark-peak-pop {
  0%   { opacity: 0; transform: scale(0.4); }
  60%  { opacity: 1; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}
.spark-peak,
.spark-peak-ring {
  transform-origin: center;
  transform-box: fill-box;
}
@keyframes spark-ring {
  0%   { opacity: 0.7; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(2.6); }
}
@media (prefers-reduced-motion: reduce) {
  .stats-band__sparkline .spark-line,
  .stats-band__sparkline .spark-area,
  .stats-band__sparkline .spark-peak,
  .stats-band__sparkline .spark-peak-ring {
    animation: none;
    opacity: 1;
    stroke-dashoffset: 0;
    transform: none;
  }
}
@media (max-width: 540px) {
  .stats-band {
    padding: 12px 14px 10px;
  }
  /* CR-099: drop the height override — aspect-ratio keeps the
     sparkline proportional at narrow viewports, and the peak
     circle stays round regardless of container width. */
}

/* === EXPANDED STATS DASHBOARD === */
.stats-dash {
  position: relative;
  margin: 0 0 18px;
  padding: 16px 18px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  font-variant-numeric: tabular-nums;
}
.stats-dash[hidden] { display: none; }
.stats-dash::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(78,201,154,0.4), transparent 35%, transparent 65%, rgba(110,194,217,0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.stats-dash__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.stats-dash__close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,0.02);
  color: var(--dim);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  margin-left: auto;
}
.stats-dash__close:hover {
  color: var(--bright);
  background: rgba(255,255,255,0.05);
  border-color: var(--line-strong);
}
.stats-dash__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* CR-057: reduced-motion-safe expand transition.
   `no-preference` only — under `reduce` the view appears
   instantly so users with vestibular sensitivity don't get
   motion. */
@media (prefers-reduced-motion: no-preference) {
  .stats-dash {
    transform-origin: top center;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }
  .stats-dash.is-fading {
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
  }
}
.stats-dash__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--bright);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.stats-dash__tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
}
.stats-dash__tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.stats-dash__tab:hover { color: var(--fg); }
.stats-dash__tab.is-active {
  color: var(--bright);
  background: rgba(78,201,154,0.18);
  box-shadow: inset 0 0 0 1px rgba(78,201,154,0.4);
}
.stats-dash__kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stats-dash__kpi {
  position: relative;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.025);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}
.stats-dash__kpi-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.stats-dash__kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--bright);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-dash__kpi-unit {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.04em;
}
.stats-dash__kpi-spark {
  position: absolute;
  right: 8px;
  bottom: 6px;
  width: 60px;
  height: 18px;
  opacity: 0.55;
}
.stats-dash__kpi-spark .dash-spark-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stats-dash__kpi-spark .dash-spark-area {
  fill: var(--accent);
  opacity: 0.18;
}
.stats-dash__activity {
  margin-bottom: 14px;
}
.stats-dash__activity-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stats-dash__activity-title {
  color: var(--dim);
  font-weight: 600;
}
.stats-dash__activity-legend {
  display: inline-flex;
  gap: 12px;
  color: var(--dim);
}
.stats-dash__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.stats-dash__legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.stats-dash__legend-ok i { background: var(--accent); }
.stats-dash__legend-pending i { background: var(--accent-warm); }
.stats-dash__legend-err i { background: #ff6f6f; }
.stats-dash__activity-canvas {
  display: block;
  width: 100%;
  height: 64px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
}
.stats-dash__activity-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.04em;
}
.stats-dash__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}
.stats-dash__cols--single {
  grid-template-columns: 1fr;
}
.stats-dash__list {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px 10px;
  background: rgba(255,255,255,0.02);
}
.stats-dash__list-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 6px;
}
.stats-dash__list-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stats-dash__list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--fg);
}
.stats-dash__list-row-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-dash__list-row-bar {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  margin-top: 2px;
  grid-column: 1 / -1;
}
.stats-dash__list-row-bar > span {
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: inherit;
  transform-origin: left center;
}
.stats-dash__list-row.is-err .stats-dash__list-row-bar > span { background: #ff6f6f; }
.stats-dash__format-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--fg);
}
.stats-dash__format-row-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stats-dash__format-row-counts {
  display: inline-flex;
  gap: 6px;
  color: var(--bright);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stats-dash__format-row-counts > span:first-child::after {
  content: '/';
  color: var(--dim);
  margin: 0 2px;
}
.stats-dash__format-row-bars {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  margin-top: 4px;
  grid-column: 1 / -1;
}
.stats-dash__format-row-bar--total,
.stats-dash__format-row-bar--success {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-origin: left center;
  transition: transform 0.18s ease;
}
.stats-dash__format-row-bar--total { background: #ff6f6f; }
.stats-dash__format-row-bar--success { background: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .stats-dash__format-row-bar--total,
  .stats-dash__format-row-bar--success { transition: none; }
}
.stats-dash__list-row-count {
  color: var(--bright);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stats-dash__list-empty {
  font-size: 11px;
  color: var(--dim);
  font-style: italic;
}
.stats-dash__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
  text-transform: uppercase;
}
.stats-dash__foot b {
  color: var(--bright);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}
.stats-dash__foot-updated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stats-dash__live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(78,201,154,0.6);
  animation: dash-live-pulse 2.4s ease-in-out infinite;
}
@keyframes dash-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@media (prefers-reduced-motion: reduce) {
  .stats-dash__live { animation: none; }
  .stats-dash__activity-canvas { transition: none; }
}
@media (max-width: 760px) {
  .stats-dash__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-dash__cols { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .stats-dash { padding: 14px 14px 12px; }
  .stats-dash__tabs { flex-wrap: wrap; }
  .stats-dash__kpi-value { font-size: 18px; }
}

/* === CARD (the main panel) === */
.card {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 24px 80px rgba(0,0,0,0.5);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(78,201,154,0.4), transparent 30%, transparent 70%, rgba(185,107,255,0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* === URL BAR (top of the card) === */
.url {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
}
.url__input {
  flex: 1;
  appearance: none;
  background: rgba(255,255,255,0.03);
  color: var(--bright);
  border: 1px solid var(--line);
  outline: none;
  font: inherit;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  min-width: 0;
  caret-color: var(--accent);
  transition: border-color 0.15s, background 0.15s;
}
.url__input::placeholder { color: var(--dim); font-style: italic; }
.url__input:focus { border-color: var(--accent); background: rgba(78,201,154,0.04); }
.url__status {
  font-size: 11px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.url__status.is-err { color: #ff6b6b; }
.url__status.is-ok  { color: var(--accent); }
.url__status .spinner {
  width: 10px; height: 10px;
  border: 1.5px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: url-spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes url-spin { to { transform: rotate(360deg); } }
.url__go {
  appearance: none;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  white-space: nowrap;
  transition: background 0.12s, box-shadow 0.12s, transform 0.05s;
  box-shadow: 0 0 0 0 rgba(78,201,154,0);
}
.url__go:hover { background: var(--bright); box-shadow: 0 0 20px rgba(78,201,154,0.35); }
.url__go:active { transform: translateY(1px); }
.url__go:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.url.is-hidden { display: none; }

/* === DROPZONE === */
.dropzone {
  position: relative;
  margin: 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(78,201,154,0.025), rgba(0,212,255,0.02));
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  overflow: hidden;
}
.dropzone::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(78,201,154,0.06), transparent 70%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); outline: none; }
.dropzone:hover::before { opacity: 1; }
.dropzone.is-drag {
  border-color: var(--accent);
  border-style: solid;
  background: linear-gradient(180deg, rgba(78,201,154,0.08), rgba(0,212,255,0.04));
  transform: scale(1.005);
}
.dropzone.is-drag::before { opacity: 1; }
.dropzone__inner {
  text-align: center;
  padding: 32px 20px;
  color: var(--fg);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
  width: 100%;
}
.dropzone__icon {
  color: var(--dim);
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: color 0.2s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dropzone__icon svg {
  display: block;
  margin: 0 auto;
}
.dropzone.is-drag .dropzone__icon {
  color: var(--accent);
  transform: translateY(-6px) scale(1.1);
  filter: drop-shadow(0 0 12px rgba(78,201,154,0.6));
}
.dropzone__title {
  font-family: var(--font-sans);
  font-size: 22px;
  color: var(--bright);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.dropzone__sub {
  font-size: 12px;
  color: var(--dim);
}
.dropzone__formats {
  margin-top: 14px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}
.dropzone__formats span {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
}
.dropzone__formats span.is-disabled {
  color: var(--line);
  opacity: 0.45;
  border-style: dashed;
  background: transparent;
}
.url__hint {
  display: block;
  font-size: 10px;
  color: var(--dim);
  margin: 0 14px 14px;
  letter-spacing: 0.02em;
  text-align: center;
}
.url__hint code {
  color: var(--accent);
  background: rgba(78,201,154,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
}

/* empty-state copy inside dropzone-inner is hidden once items exist */
.dropzone__copy.is-hidden { display: none; }

/* === STAGING STRIP (replaces empty-state copy when items present) === */
.staging {
  display: none;
  width: 100%;
  text-align: left;
  pointer-events: auto;
}
.staging.is-active { display: block; }
.staging__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 4px;
}
.staging__label {
  font-size: 10px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.staging__count {
  font-size: 11px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.staging__count span { color: var(--accent); font-weight: 700; }
.staging__head .addmore {
  margin-left: auto;
  padding: 4px 10px;
  min-height: 0;
  font-size: 11px;
}
.staging__list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 2px 12px;
  min-height: 0;
}
.staging__tile {
  position: relative;
  flex: 0 0 auto;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background-color: var(--bg-2);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: visible;
  flex-shrink: 0;
}
.staging__tile.is-err {
  border-color: #ff6b6b;
}
.staging__tile__caption {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  padding: 3px 5px;
  font-size: 9px;
  color: var(--bright);
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.85));
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staging__tile__status {
  position: absolute;
  top: 3px; left: 3px;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(0,0,0,0.7);
  color: var(--dim);
  pointer-events: none;
}
.staging__tile.is-busy .staging__tile__status {
  color: var(--accent);
}
.staging__tile.is-done .staging__tile__status {
  color: var(--bg);
  background: var(--accent);
}
.staging__tile.is-err .staging__tile__status {
  color: #fff;
  background: #ff6b6b;
}
.staging__tile__del {
  position: absolute;
  top: -8px; right: -8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #ff4d4d;
  border: 1.5px solid #ff6b6b;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.15s, transform 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
  z-index: 4;
  padding: 0;
  box-shadow: 0 2px 6px rgba(255,77,77,0.45);
}
.staging__tile:hover .staging__tile__del,
.staging__tile:focus-within .staging__tile__del { opacity: 1; transform: scale(1); }
.staging__tile__del:hover {
  color: #fff;
  background: #d93838;
  border-color: #d93838;
  transform: scale(1.1);
}
.staging__tile__del:disabled {
  opacity: 0 !important;
  cursor: not-allowed;
}
.staging__tile__del svg { width: 11px; height: 11px; }

/* === CONTROLS BAR (inside card) === */
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
  font-size: 12px;
  color: var(--dim);
}
.bar--inline {
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.25);
}
.bar__group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bar__label {
  font-size: 10px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.bar__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-left: auto;
}
.bar__actions .addmore {
  width: 100%;
}
.bar__actions .convert-btn {
  margin-left: 0;
}

/* select */
.select {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(255,255,255,0.04);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--dim) 50%),
    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--bright);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 30px 8px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  min-height: 34px;
  min-width: 110px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.select:hover { border-color: var(--accent-dim); background-color: rgba(78,201,154,0.04); }
.select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(78,201,154,0.15); }

/* === TRADE-OFF WIDGET === */
.trade {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  flex: 1 1 240px;
}
.trade__row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.trade__label { min-width: 50px; color: var(--dim); }
.trade__label--right { text-align: right; }
.trade__bar {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  pointer-events: none;
}
.trade__bar--size {
  background: linear-gradient(90deg, rgba(255,140,66,0.4), var(--line));
}
.trade__bar--quality {
  background: linear-gradient(90deg, var(--line), rgba(78,201,154,0.4));
}
.trade__barfill {
  position: absolute;
  top: 0; bottom: 0;
  left: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.1s ease;
  box-shadow: 0 0 8px rgba(78,201,154,0.5);
}
.trade__bar--quality .trade__barfill {
  left: auto;
  right: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.trade__slider-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  padding-top: 26px;
}
.trade__slider-row input[type="range"] {
  display: block;
  width: 100%;
  height: 22px;
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  --val: 82%;
}
.trade__bubble {
  position: absolute;
  top: 0;
  left: var(--val, 82%);
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-bright);
  background: rgba(78,201,154,0.12);
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 1px 7px 2px;
  pointer-events: none;
  white-space: nowrap;
  line-height: 1.3;
  text-shadow: 0 0 6px rgba(78,201,154,0.35);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 0 10px rgba(78,201,154,0.25);
  transition: opacity 0.15s, left 0.08s linear;
}
.trade__bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--accent);
}
.trade__slider-row:not(:hover):not(:focus-within) .trade__bubble {
  opacity: 0.65;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background:
    linear-gradient(to right,
      var(--accent) 0%,
      var(--accent) var(--val, 82%),
      rgba(255,255,255,0.18) var(--val, 82%),
      rgba(255,255,255,0.18) 100%);
  border: 1px solid rgba(78,201,154,0.4);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
}
input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background:
    linear-gradient(to right,
      var(--accent) 0%,
      var(--accent) var(--val, 82%),
      rgba(255,255,255,0.18) var(--val, 82%),
      rgba(255,255,255,0.18) 100%);
  border: 1px solid rgba(78,201,154,0.4);
}
input[type="range"]::-moz-range-progress {
  background: var(--accent);
  height: 8px;
  border-radius: 4px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent-bright);
  border: 2px solid var(--bg);
  border-radius: 50%;
  margin-top: -8px;
  cursor: grab;
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 16px rgba(78,201,154,0.8),
    0 0 0 4px rgba(78,201,154,0.10);
  transition: transform 0.12s, box-shadow 0.12s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.18);
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 22px rgba(78,201,154,0.95),
    0 0 0 6px rgba(78,201,154,0.14);
}
input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.25);
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 28px rgba(78,201,154,1),
    0 0 0 8px rgba(78,201,154,0.18);
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent-bright);
  border: 2px solid var(--bg);
  border-radius: 50%;
  cursor: grab;
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 16px rgba(78,201,154,0.8),
    0 0 0 4px rgba(78,201,154,0.10);
  transition: transform 0.12s, box-shadow 0.12s;
}
input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.18);
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 22px rgba(78,201,154,0.95),
    0 0 0 6px rgba(78,201,154,0.14);
}
input[type="range"]::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.25);
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 28px rgba(78,201,154,1),
    0 0 0 8px rgba(78,201,154,0.18);
}
.trade__desc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--fg);
  flex-wrap: wrap;
  min-height: 22px;
  margin: 10px 0;
}
.trade__desc-text {
  color: var(--bright);
  font-weight: 500;
  font-size: 12px;
}
.trade__desc .pip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  background: rgba(255,255,255,0.03);
  color: var(--dim);
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  transition: all 0.15s;
}
.trade__desc .pip.is-active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(78,201,154,0.4);
}

/* progress line under staging strip */
.convert-progress {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 0 14px 0;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.15);
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.convert-progress.is-active { display: flex; }
.convert-progress__bar {
  flex: 1;
  height: 2px;
  background: var(--line);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}
.convert-progress__fill {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: var(--p, 0%);
  transition: width 0.2s ease;
  box-shadow: 0 0 8px rgba(78,201,154,0.5);
}
.convert-progress__text {
  white-space: nowrap;
}

/* Convert button (primary CTA) */
.convert-btn {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 14px 28px;
  cursor: pointer;
  min-height: 48px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(78,201,154,0.25);
  transition: background 0.15s, box-shadow 0.2s, transform 0.05s;
}
.convert-btn:hover {
  background: var(--bright);
  box-shadow: 0 6px 24px rgba(78,201,154,0.55);
}
.convert-btn:active { transform: translateY(1px); }
.convert-btn:disabled {
  background: rgba(78,201,154,0.35);
  color: var(--bg);
  border-color: rgba(78,201,154,0.35);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.85;
}
.convert-btn svg { width: 16px; height: 16px; }

.addmore {
  appearance: none;
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  padding: 8px 12px;
  cursor: pointer;
  min-height: 34px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.addmore:hover { color: var(--accent); border-color: var(--accent); background: rgba(78,201,154,0.05); }
.addmore.is-drag { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* === FORMAT PRESETS (DE-037) === */
.preset {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
  min-height: 30px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.preset:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(78,201,154,0.05);
}
.preset.is-hidden { display: none; }
#presets { flex-wrap: wrap; }

/* === bar--presets (own row above the inline bar) === */
.bar--presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
}
.bar--presets .bar__label {
  font-size: 10px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-right: 4px;
}

/* === AR-019 capability-driven transforms (DE-034) === */
.ar019-block {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ar019-note {
  font-size: 12px;
  color: var(--dim);
  padding: 4px 8px;
  border-left: 2px solid var(--line-strong);
}
.ar019-note.is-hidden { display: none; }
.ar019-strip {
  display: inline-flex;
  align-items: center;
}

/* === RESIZE PANEL === */
.bar--resize {
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.02em;
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  color: var(--fg);
}
.checkbox input[type="checkbox"] {
  width: 14px; height: 14px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.input {
  appearance: none;
  background: rgba(255,255,255,0.04);
  color: var(--bright);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  min-height: 26px;
  transition: border-color 0.15s, background 0.15s;
}
.input:hover:not(:disabled) { border-color: var(--accent); }
.input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(78,201,154,0.15); }
.input:disabled { opacity: 0.4; cursor: not-allowed; }
.input--num { width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
.resize-axis-only { display: none; }
.resize-axis-only.is-shown { display: inline-flex; }
.bar__suffix { color: var(--dim); font-size: 10px; }

/* === ADVANCED PANEL (DE-030: per-codec X-Encoder-Options) === */
.bar--advanced {
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
  padding: 0;
}
.bar--advanced > .bar__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.02em;
  user-select: none;
}
.bar--advanced > .bar__summary::-webkit-details-marker { display: none; }
.bar--advanced > .bar__summary > .bar__hint {
  color: var(--dim);
  opacity: 0.7;
  font-size: 10px;
}
.bar--advanced > .bar__summary > .bar__caret {
  margin-left: auto;
  transition: transform 0.18s ease;
  color: var(--fg);
  font-size: 10px;
}
.bar--advanced[open] > .bar__summary > .bar__caret { transform: rotate(90deg); }
.bar--advanced > .bar__body {
  padding: 4px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.advanced__body { display: flex; flex-direction: column; gap: 8px; }
.advanced__row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--dim);
  flex-wrap: wrap;
}
.advanced__row > .advanced__key {
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  font-weight: 500;
  min-width: 130px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}
.advanced__row > .advanced__hint {
  color: var(--dim);
  font-size: 10px;
  opacity: 0.8;
}
.advanced__empty,
.advanced__unavailable {
  color: var(--dim);
  font-style: italic;
  font-size: 11px;
}

/* === RESULTS STRIP + INLINE COMPARE EXPANDER === */
.results {
  margin: 0 14px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.25);
  overflow: hidden;
}
.results.is-hidden { display: none; }

.results__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
  gap: 10px;
  flex-wrap: wrap;
}
.results__title {
  display: inline-flex; align-items: center; gap: 10px;
}
.results__label {
  font-size: 10px; color: var(--dim);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600;
}
.results__count {
  font-size: 11px; color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.results__count span { color: var(--accent); font-weight: 700; }

.results__actions { display: inline-flex; gap: 6px; }
.results__btn {
  appearance: none;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  min-height: 28px;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.results__btn--ghost {
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--line-strong);
}
.results__btn--ghost:hover { color: var(--fg); border-color: var(--line-strong); background: rgba(255,255,255,0.04); }
.results__btn--accent {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
}
.results__btn--accent:hover { background: var(--bright); border-color: var(--bright); }
.results__btn--accent:disabled {
  background: var(--line-strong); color: var(--dim);
  border-color: var(--line-strong); cursor: not-allowed;
}

.results__list {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 8px;
}

/* empty result area */
.results__empty {
  padding: 14px 12px;
  font-size: 11px;
  color: var(--dim);
  text-align: center;
  letter-spacing: 0.02em;
}

/* one converted result tile */
.results-tile {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  overflow: hidden;
  width: 100%;
  display: block;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  animation: results-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.results-tile:hover {
  border-color: var(--accent-dim);
  background: rgba(78,201,154,0.04);
}
.results-tile.is-active {
  border-color: var(--accent);
  background: rgba(78,201,154,0.06);
  box-shadow: 0 0 0 1px var(--accent);
}
@keyframes results-slide-in {
  0%   { opacity: 0; transform: translateY(-8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.results-tile__row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
}
.results-tile__thumb {
  width: 56px; height: 56px;
  border-radius: 4px;
  background: var(--line) center/cover no-repeat;
  border: 1px solid var(--line-strong);
  position: relative;
  flex-shrink: 0;
}
.results-tile__thumb::after {
  content: "✓";
  position: absolute;
  right: -3px; top: -3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  font-weight: 700;
  border: 2px solid var(--bg);
}
.results-tile__body {
  min-width: 0;
}
.results-tile__name {
  font-size: 12px;
  color: var(--bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  margin-bottom: 3px;
}
.results-tile__meta {
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.results-tile__delta {
  font-weight: 700;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}
.results-tile__delta.is-save { color: var(--accent); }
.results-tile__delta.is-grow { color: var(--accent-warm); }

/* CR-048: per-row action group (download + delete). The
   action group sits in the rightmost grid column next to
   the savings pill, so the existing thumb/body/delta
   layout is unchanged. Both buttons are ghost-buttons
   (no background, line-coloured border) matching the
   `.results__btn--ghost` visual language; the delete
   button adds an `is-destructive` modifier that tints
   the icon and border with the warm-accent (the same
   colour the existing `.results-tile__delta.is-grow`
   rule uses to signal "destructive" intent). */
.results-tile__actions {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.results-tile__action {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.results-tile__action:hover,
.results-tile__action:focus-visible {
  border-color: var(--line-strong);
  background: rgba(255,255,255,0.04);
  outline: none;
}
.results-tile__action.is-destructive:hover,
.results-tile__action.is-destructive:focus-visible {
  color: var(--accent-warm);
  border-color: var(--accent-warm);
}
.results-tile__action svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* === MODAL + BEFORE/AFTER SLIDER === */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal.is-open { display: flex; }
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
  cursor: pointer;
}
.modal__dialog {
  position: relative;
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
  animation: modal-in 0.18s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.modal__close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--dim);
  font-size: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s;
  padding: 0;
}
.modal__close:hover { color: var(--bright); border-color: var(--accent); }
.modal__title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  font-weight: 700;
  margin: 0 0 12px;
}

.ba-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  user-select: none;
  touch-action: none;
  cursor: ew-resize;
  font-size: 0;  /* kill inline-img baseline alignment */
  line-height: 0;
}
.ba-slider__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  vertical-align: top;
  pointer-events: none;
  -webkit-user-drag: none;
}
.ba-slider__clip { display: none; }
.ba-slider__img--before {
  clip-path: inset(0 50% 0 0);
  -webkit-clip-path: inset(0 50% 0 0);
}
.ba-slider__handle {
  position: absolute; top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--accent);
  transform: translateX(-1px);
  box-shadow: 0 0 12px rgba(78,201,154,0.6);
  pointer-events: none;
}
.ba-slider__handle::before, .ba-slider__handle::after {
  content: "";
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 8px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(78,201,154,0.18), transparent);
}
.ba-slider__knob {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(78,201,154,0.55), 0 2px 6px rgba(0,0,0,0.4);
  pointer-events: auto;
  cursor: ew-resize;
}
.ba-slider__handle:focus-visible { outline: none; }
.ba-slider__handle:focus-visible .ba-slider__knob {
  box-shadow: 0 0 0 3px rgba(78,201,154,0.45), 0 0 16px rgba(78,201,154,0.55);
}

.ba-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
.ba-meta__row { display: inline-flex; align-items: center; gap: 6px; }
.ba-meta__label { color: var(--dim); text-transform: uppercase; font-size: 10px; letter-spacing: 0.08em; }
.ba-meta__row strong { color: var(--bright); font-weight: 600; }
.ba-meta__delta.is-save { color: var(--accent); font-weight: 700; }
.ba-meta__delta.is-grow { color: var(--accent-warm); font-weight: 700; }
.ba-meta__name {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ba-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.ba-btn {
  appearance: none; font: inherit;
  font-size: 12px; font-weight: 600;
  border-radius: 8px; padding: 8px 16px;
  min-height: 36px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.ba-btn--accent { background: var(--accent); color: var(--bg); border: 1px solid var(--accent); }
.ba-btn--accent:hover { background: var(--bright); border-color: var(--bright); }

@media (max-width: 540px) {
  .modal__dialog { padding: 16px; }
  .ba-slider { aspect-ratio: 1 / 1; }
  .ba-meta { gap: 10px; }
  .ba-meta__name { max-width: 100%; flex-basis: 100%; margin-left: 0; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--glass-strong);
  color: var(--bright);
  border: 1px solid #ff6b6b;
  border-left: 3px solid #ff6b6b;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
  max-width: 90vw;
  backdrop-filter: blur(20px);
}
.toast.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.note {
  margin-top: 24px;
  font-size: 11px;
  color: var(--dim);
  text-align: center;
  letter-spacing: 0.02em;
}
.note .accent { color: var(--accent); }

.footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--dim);
  font-size: 11px;
}
@media (min-width: 540px) {
  .footer { flex-direction: row; justify-content: space-between; align-items: baseline; flex-wrap: wrap; }
}
.footer__brand { color: var(--accent); font-weight: 600; }
.footer__brand-suffix { color: var(--fg); font-weight: 600; }
.footer__bridge { display: inline-flex; gap: 14px; }
.footer__bridge a { color: var(--dim); }
.footer__bridge a:hover { color: var(--accent); text-decoration: none; }
.footer__socials { display: inline-flex; gap: 14px; }
.footer__socials a { color: var(--dim); }
.footer__socials a:hover { color: var(--accent); }
.footer__cookies { flex-basis: 100%; font-size: 10px; color: var(--dim); opacity: 0.7; }
.footer__nav { display: inline-flex; gap: 14px; font-size: 12px; }
.footer__nav a { color: var(--dim); transition: color 0.15s; }
.footer__nav a:hover { color: var(--accent); text-decoration: none; }
.footer__brand { color: var(--dim); font-size: 11px; display: inline-flex; align-items: center; gap: 6px; }
.footer__brand-accent { color: var(--accent); font-weight: 600; }
.footer__sep { color: var(--line-strong); }
/* CR-064: build-stamped site version. Deliberately carries no
   data-i18n key — the tag is locale-invariant, and a catalog entry
   would let renderI18n() overwrite the build-time substitution with a
   stale literal on every language switch. */
.footer__version { color: var(--dim); font-variant-numeric: tabular-nums; }

/* === INFO BLOCKS (privacy, faq, foss CTA) === */
.info-blocks {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.info-blocks .section h2 {
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 8px;
}
.info-blocks .info-card {
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.info-blocks .info-card h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bright);
  letter-spacing: 0.02em;
}
.info-blocks .info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}
.info-blocks .info-grid > div {
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.info-blocks .info-grid h4 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--bright);
  letter-spacing: 0.01em;
}
.info-blocks .info-grid p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--fg);
}
@media (max-width: 720px) {
  .info-blocks .info-grid { grid-template-columns: 1fr; }
}
.info-blocks details {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 8px 0;
  transition: border-color 0.15s;
}
.info-blocks details[open] { border-color: var(--line-strong); }
.info-blocks details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  font-size: 13px;
  color: var(--bright);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.info-blocks details summary::-webkit-details-marker { display: none; }
.info-blocks details summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.info-blocks details[open] summary::after {
  content: "−";
}
.info-blocks details p {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--fg);
  line-height: 1.6;
}
.info-blocks code {
  font-family: var(--font-mono);
  background: rgba(78,201,154,0.10);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.86em;
  color: var(--accent-bright);
}
.info-blocks .cta-foss {
  text-align: center;
  padding: 28px 24px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(78,201,154,0.08), rgba(78,201,154,0.02));
}
.info-blocks .cta-foss h2 {
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 0;
  padding: 0;
}
.info-blocks .cta-foss p {
  margin: 0 0 16px;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.55;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}
.info-blocks .cta-foss a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}
.info-blocks .cta-foss a:hover {
  background: var(--accent-bright);
  box-shadow: 0 0 24px rgba(78,201,154,0.55);
}
.info-blocks .cta-foss a:active { transform: translateY(1px); }
.info-blocks .cta-foss a svg { transition: transform 0.15s; }
.info-blocks .cta-foss a:hover svg { transform: translate(2px, -2px); }

/* inline-russian/en switches driven by data-locale on <html> */
.info-blocks [lang="ru"] { display: none; }
.info-blocks [data-locale="ru"] [lang="en"] { display: none; }
.info-blocks [data-locale="ru"] [lang="ru"] { display: block; }

@media (max-width: 540px) {
  .hero__title { font-size: 32px; }
  .dropzone { min-height: 260px; }
  .bar { padding: 12px; }
  .trade { min-width: 100%; flex-basis: 100%; }
  .info-blocks .info-card { padding: 14px 14px; }
  .info-blocks .cta-foss { padding: 22px 16px; }
}
