/* ── Custom properties ──────────────────────────────────────────────────── */
:root {
  --bg: #0a0f0d;
  --surface: #0d1210; --surface2: #121a15; --border: #1a2e20; --border2: #254530;
  --primary: #1db954; --accent-bright: #39ff85; --accent-mid: var(--primary); --accent-dim: #0f5c30;
  --accent: var(--accent-mid); /* legacy alias — components used var(--accent) */
  --accent-text: #39ff85;
  --success: #22c55e; --danger: #ef4444; --warning: #f59e0b;
  --text: #e2e8f0; --text-muted: #6b8a72;
  --radius: 12px;
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-display: 'Syne', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Consolas', monospace;
  --transition: color 300ms ease, background-color 300ms ease, border-color 300ms ease;
}
/* ── Base ───────────────────────────────────────────────────────────────── */
html { background: var(--bg); height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(ellipse 140% 70% at 65% -5%, rgba(29,185,84,.1) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 0% 90%, rgba(57,255,133,.06) 0%, transparent 50%),
    var(--bg);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition);
}
/* ── Global scrollbars ───────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: rgba(57,255,133,.15) transparent; }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-thumb { background: rgba(57,255,133,.15); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(57,255,133,.3); }

/* ── Input focus glow (via Bootstrap tokens — no !important) ─────────────── */
:root {
  --bs-focus-ring-color: rgba(57,255,133,.3);
  --bs-focus-ring-width: 3px;
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--bs-focus-ring-color);
  outline: none;
}
/* ── Keyboard focus ring (WCAG 2.4.7) — only for keyboard users ─────────────── */
a:focus-visible, button:focus-visible, .btn:focus-visible,
[role="button"]:focus-visible, [tabindex]:focus-visible,
.ps-sbar-item:focus-visible, .ps-sbar-cat:focus-visible,
.ps-recent-chip:focus-visible, .nav-link:focus-visible,
.uc-tab:focus-visible, .fc-tab:focus-visible,
.ic-fmt-btn:focus-visible, .hist-chip:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
  border-radius: 4px;
}
.tool-section { display: none; }
.tool-section.active { display: block; }
.hidden { display: none !important; }
.tool-header h2 { font-size: 1.6rem; }
.section-title { font-size: .95rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 10px; }

/* ── Display font: titles & navigation only (body keeps a readable sans) ─── */
h1, h2, h3, h4, h5,
.tool-header h2, .section-title,
.app-brand-name, .mobile-brand,
.ps-logo-title, .ps-sbar-cat-name {
  font-family: var(--font-display);
}
/* Keep the embedded mundial view on its own display font */
#tool-mundial h1, #tool-mundial h2, #tool-mundial h3,
#tool-mundial h4, #tool-mundial h5 {
  font-family: var(--mw-font-display, var(--font-display));
}

/* ── App layout ─────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Mobile top bar ─────────────────────────────────────────────────────── */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 52px;
  background: rgba(10,15,13,.92);
  border-bottom: 1px solid rgba(57,255,133,.08);
  flex-shrink: 0;
}
.mobile-menu-btn {
  background: none; border: none;
  color: rgba(255,255,255,.75); font-size: 1.4rem;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.mobile-menu-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.mobile-brand {
  font-size: .88rem; font-weight: 700; color: #e2e8f0;
  text-decoration: none; letter-spacing: -.02em;
}

/* ── Sidebar overlay (mobile) ────────────────────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 200;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ── Page transition ────────────────────────────────────────────────────── */
@keyframes toolEnter {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:none; }
}
.tool-section.active:not(#tool-home) {
  animation: toolEnter .28s cubic-bezier(.4,0,.2,1);
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px;
}
/* Home fades in too, but opacity-only so the flex centering isn't disturbed */
@keyframes homeEnter { from { opacity: 0; } to { opacity: 1; } }
#tool-home.active { animation: homeEnter .3s ease both; }
@media (prefers-reduced-motion: reduce) {
  .tool-section.active:not(#tool-home), #tool-home.active { animation: none; }
}
#tool-mundial.active {
  max-width: 1600px;
  padding: 16px 20px 24px;
}

/* ── Home screen ────────────────────────────────────────────────────────── */
#tool-home {
  background:
    radial-gradient(ellipse 100% 60% at 50% -10%, rgba(57,255,133,.14) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 10% 100%, rgba(29,185,84,.09) 0%, transparent 50%),
    radial-gradient(ellipse 50% 35% at 90% 95%, rgba(15,92,48,.15) 0%, transparent 50%),
    transparent;
  min-height: 100%;
  position: relative;
  overflow: hidden;
}
#tool-home.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Particle canvas */
/* Global ambient particle network — fixed behind all content */
#ps-particles {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 230px;
  pointer-events: none;
  z-index: 0;
  opacity: .32;
  transition: opacity .7s ease;
}
/* Brighter on the home screen */
#ps-particles.ps-home-active { opacity: 1; }

/* Animated "aurora" gradient layer, drifting slowly behind the particles */
#ps-aurora {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 38% 30% at 20% 25%, rgba(57,255,133,.10) 0%, transparent 60%),
    radial-gradient(ellipse 42% 34% at 80% 35%, rgba(29,185,84,.09) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 85%, rgba(15,92,48,.14) 0%, transparent 60%);
  animation: auroraDrift 28s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
@keyframes auroraDrift {
  0%   { transform: translate3d(-3%, -2%, 0) scale(1);    opacity: .85; }
  50%  { transform: translate3d(4%, 3%, 0)   scale(1.12); opacity: 1; }
  100% { transform: translate3d(-2%, 4%, 0)  scale(1.05); opacity: .9; }
}
/* Keep content above the ambient layers */
.app-sidebar { position: relative; z-index: 3; }
.app-main { position: relative; z-index: 1; }
.mobile-topbar { position: relative; z-index: 3; }
.ps-home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 560px;
  padding: 40px 24px;
  position: relative;
  z-index: 1;
}

/* ── App sidebar ────────────────────────────────────────────────────────── */
.app-sidebar {
  width: 230px;
  min-width: 230px;
  display: flex;
  flex-direction: column;
  background: rgba(57,255,133,.018);
  border-right: 1px solid rgba(57,255,133,.08);
  overflow: hidden;
  flex-shrink: 0;
  transition: var(--transition);
}

.app-sidebar-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(57,255,133,.08);
  flex-shrink: 0;
  gap: 8px;
}

.app-brand {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; cursor: pointer; min-width: 0;
}
.app-brand-emoji { font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.app-brand-name {
  font-size: .82rem; font-weight: 700; color: #e2e8f0;
  letter-spacing: -.02em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* ── Sidebar nav list ────────────────────────────────────────────────────── */
.ps-sidebar {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(57,255,133,.2) transparent;
}
.ps-sidebar::-webkit-scrollbar { width: 4px; }
.ps-sidebar::-webkit-scrollbar-thumb { background: rgba(57,255,133,.2); border-radius: 4px; }

/* ── App main content ────────────────────────────────────────────────────── */
.app-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

.ps-sbar-section { border-bottom: 1px solid rgba(57,255,133,.05); }

.ps-sbar-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
  font-family: var(--font);
}
.ps-sbar-cat:hover { background: rgba(57,255,133,.06); }
.ps-sbar-cat-icon { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.ps-sbar-cat-name { flex: 1; font-size: .85rem; font-weight: 700; color: #e2e8f0; letter-spacing: .01em; }
.ps-sbar-chevron {
  font-size: .7rem;
  color: rgba(255,255,255,.3);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.ps-sbar-section.open .ps-sbar-chevron { transform: rotate(180deg); }

.ps-sbar-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s cubic-bezier(.4,0,.2,1);
}
.ps-sbar-section.open .ps-sbar-body { max-height: 2200px; }

/* Stagger-in animation when category opens */
@keyframes sbarItemIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: none; }
}
.ps-sbar-section.open .ps-sbar-body .ps-sbar-item { animation: sbarItemIn .18s cubic-bezier(.4,0,.2,1) both; }
.ps-sbar-section.open .ps-sbar-body .ps-sbar-item:nth-child(1)  { animation-delay: .02s; }
.ps-sbar-section.open .ps-sbar-body .ps-sbar-item:nth-child(2)  { animation-delay: .04s; }
.ps-sbar-section.open .ps-sbar-body .ps-sbar-item:nth-child(3)  { animation-delay: .06s; }
.ps-sbar-section.open .ps-sbar-body .ps-sbar-item:nth-child(4)  { animation-delay: .08s; }
.ps-sbar-section.open .ps-sbar-body .ps-sbar-item:nth-child(5)  { animation-delay: .10s; }
.ps-sbar-section.open .ps-sbar-body .ps-sbar-item:nth-child(6)  { animation-delay: .12s; }
.ps-sbar-section.open .ps-sbar-body .ps-sbar-item:nth-child(n+7) { animation-delay: .14s; }

.ps-sbar-group {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 8px 16px 4px 44px;
}
.ps-sbar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 44px;
  cursor: pointer;
  font-size: .82rem;
  color: rgba(255,255,255,.6);
  transition: background .12s, color .12s;
  position: relative;
}
.ps-sbar-item:hover { background: rgba(57,255,133,.07); color: #fff; }
/* Hover micro-interactions: icon micro-rotate + label nudge */
.ps-sbar-item-icon, .ps-sbar-item span { transition: transform .18s cubic-bezier(.4,0,.2,1); }
.ps-sbar-item span { display: inline-block; }
.ps-sbar-item:hover .ps-sbar-item-icon { transform: rotate(-10deg) scale(1.15); }
.ps-sbar-item:hover span { transform: translateX(3px); }

/* Active sidebar item with animated indicator bar */
@keyframes sbarIndicator {
  from { transform: scaleY(0); opacity: 0; }
  to   { transform: scaleY(1); opacity: 1; }
}
.ps-sbar-item.active {
  color: var(--accent-bright);
  background: rgba(57,255,133,.09);
}
.ps-sbar-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent-bright);
  border-radius: 0 3px 3px 0;
  animation: sbarIndicator .2s cubic-bezier(.4,0,.2,1);
}
.ps-sbar-item-icon { font-size: .85rem; width: 16px; text-align: center; flex-shrink: 0; }


.ps-logo {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 38px;
  animation: logoIn .6s cubic-bezier(.4,0,.2,1) both;
}

/* Info button + hover/focus tooltip (replaces the always-on tagline). */
.ps-info {
  position: relative;
  align-self: center;
  margin-left: -8px;
  display: inline-flex;
  background: none;
  border: none;
  padding: 4px;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: help;
  transition: color .15s, transform .15s;
  animation: logoIn .6s cubic-bezier(.4,0,.2,1) both .12s;
}
.ps-info:hover, .ps-info:focus-visible { color: var(--accent-bright); transform: scale(1.12); outline: none; }
.ps-info-tip {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: min(360px, 82vw);
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 12px 15px;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: .85rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: normal;
  text-align: center;
  box-shadow: 0 12px 34px rgba(0,0,0,.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 60;
}
.ps-info-tip strong { color: var(--text); font-weight: 600; }
/* Little arrow pointing up at the button. */
.ps-info-tip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--border2);
}
.ps-info:hover .ps-info-tip,
.ps-info:focus-visible .ps-info-tip,
.ps-info:focus-within .ps-info-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
@keyframes logoIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: none; }
}
.ps-logo-emoji {
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 0 24px rgba(57,255,133,.55));
  animation: logoEmoji .8s cubic-bezier(.4,0,.2,1) both .1s;
}
@keyframes logoEmoji {
  from { opacity: 0; transform: scale(.6) rotate(-20deg); }
  to   { opacity: 1; transform: none; }
}
/* Two independently-animated shine bands. @property lets each band have its
   own CSS custom property animated at a different speed, so they drift in and
   out of phase and never repeat the same pattern within a visible window. */
@property --_s1 { syntax: '<percentage>'; inherits: false; initial-value: 110%; }
@property --_s2 { syntax: '<percentage>'; inherits: false; initial-value: 130%; }
.ps-logo-title {
  font-size: clamp(1.8rem,4vw,2.6rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0;
  font-family: 'Syne', system-ui, sans-serif;
  background-image:
    linear-gradient(100deg, transparent 38%, rgba(255,255,255,.82) 50%, transparent 62%),
    linear-gradient(100deg, transparent 41%, rgba(255,255,255,.38) 50%, transparent 59%),
    linear-gradient(135deg, #e2e8f0 20%, #39ff85 60%, #1db954);
  background-size: 260% 100%, 340% 100%, 100% 100%;
  background-position: var(--_s1) 0, var(--_s2) 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: _ts1 19s ease-in-out infinite, _ts2 29s ease-in-out infinite -11s;
}
@keyframes _ts1 {
  0%   { --_s1: 112%; }
  50%  { --_s1: -12%; }
  100% { --_s1: 112%; }
}
@keyframes _ts2 {
  0%   { --_s2: 132%; }
  50%  { --_s2: -32%; }
  100% { --_s2: 132%; }
}

/* Search */
.ps-search-wrap {
  width: 100%; max-width: 520px; margin: 0 auto 24px; position: relative;
}

/* Legacy open-state: sidebar handles navigation now; no override needed */

.ps-search-box {
  display: flex; align-items: center;
  background: rgba(57,255,133,.05); border: 1px solid rgba(57,255,133,.12);
  border-radius: 14px; padding: 0 14px; gap: 10px;
  transition: border-color .2s, background .2s, box-shadow .2s;
  position: relative;
}
/* Animated gradient border that flows around the box on focus */
.ps-search-box::before {
  content: ''; position: absolute; inset: 0; border-radius: 14px; padding: 1.5px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-bright), var(--accent-mid), var(--accent-bright), var(--accent-dim));
  background-size: 300% 100%;
  -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; opacity: 0; transition: opacity .3s;
}
.ps-search-box:focus-within::before { opacity: 1; animation: fxBorderFlow 3s linear infinite; }
@keyframes fxBorderFlow { to { background-position: 300% 0; } }
.ps-search-box:focus-within {
  border-color: var(--accent-dim);
  background: rgba(57,255,133,.08);
  box-shadow: 0 0 0 3px rgba(57,255,133,.15);
}
.ps-search-icon { color: rgba(57,255,133,.5); font-size: 1rem; flex-shrink:0; }
.ps-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: .95rem; padding: 12px 0;
  font-family: var(--font);
  box-shadow: none;
}
.ps-search-input::placeholder { color: rgba(255,255,255,.3); }
.ps-search-clear {
  background: none; border: none; color: rgba(57,255,133,.45); cursor: pointer;
  font-size: .8rem; padding: 4px; border-radius: 6px; flex-shrink:0;
  transition: color .15s;
}
.ps-search-clear:hover { color: var(--accent-bright); }

.ps-search-results {
  margin-top: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; max-height: 440px; overflow-y: auto;
}
.ps-search-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .15s;
}
.ps-search-item:last-child { border-bottom: none; }
.ps-search-item:hover { background: rgba(255,255,255,.06); }
.ps-search-item-icon { font-size: 1.3rem; flex-shrink: 0; width: 26px; text-align:center; }
.ps-search-item-info { display: flex; flex-direction: column; flex: 1; min-width:0; }
.ps-search-item-name { font-weight: 700; font-size: .88rem; color: var(--text); }
.ps-search-hl { background: rgba(57,255,133,.22); color: var(--accent-bright); border-radius: 3px; padding: 0 1px; }
.ps-search-item-meta { font-size: .72rem; color: rgba(255,255,255,.38); }
.ps-search-item-desc { font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.ps-search-empty {
  padding: 24px; text-align: center; color: var(--text-muted); font-size: .9rem;
}

/* Recently used strip */
.ps-recent {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.ps-recent-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(57,255,133,.4);
  margin-right: 4px;
}
.ps-recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(57,255,133,.06);
  border: 1px solid rgba(57,255,133,.15);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: .78rem;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.ps-recent-chip:hover {
  background: rgba(57,255,133,.13);
  border-color: rgba(57,255,133,.35);
  color: var(--accent-bright);
  transform: scale(1.04);
}

@media (max-width: 768px) {
  .mobile-topbar { display: flex; }

  /* Sidebar is an overlay on mobile, so the ambient canvas spans full width */
  #ps-particles { left: 0; }

  .app-sidebar {
    position: fixed;
    top: 0; left: -242px;
    height: 100%; width: 242px;
    z-index: 300;
    transition: left .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 28px rgba(0,0,0,.45);
  }
  .app-sidebar.open { left: 0; }

  .app-layout { height: 100%; }

  .ps-home-content { padding: 32px 16px; }
  .ps-logo { margin-bottom: 28px; gap: 12px; }
  .ps-logo-emoji { font-size: 2.2rem; }
  .ps-logo-title { font-size: 1.6rem; }

  .tool-section.active:not(#tool-home) { padding: 20px 16px; }
}

/* ── Navbar bigger dropdowns ────────────────────────────────────────────── */
.dropdown-wide { min-width: 240px; padding: 8px 0; }
.dropdown-wide .dropdown-item { padding: 8px 18px; transition: background .15s, transform .15s; }
.dropdown-wide .dropdown-item:hover { transform: translateX(5px); }
.dropdown-wide .dropdown-item small { font-size: .72rem; line-height: 1.2; margin-top: 1px; }
.dropdown-wide .dropdown-header { font-size: .68rem; letter-spacing: 1.5px; padding: 6px 18px 4px; }

/* ── Port tabs (custom, not Bootstrap) ─────────────────────────────────── */
.tab-content-panel { display: none; }
.tab-content-panel.active { display: block; }

/* ── Result area ─────────────────────────────────────────────────────────── */
.result-area { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; animation: fadeIn .2s ease; box-shadow: 0 4px 24px rgba(0,0,0,.3), 0 0 0 0 rgba(57,255,133,.06); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

pre { font-family: var(--mono); font-size: .85rem; white-space: pre-wrap; word-break: break-all; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 14px; overflow-x: auto; max-height: 500px; overflow-y: auto; }

/* ── Badges (custom, complement Bootstrap) ───────────────────────────────── */
.badge-success { background: rgba(34,197,94,.15); color: var(--success); }
.badge-danger  { background: rgba(239,68,68,.15);  color: var(--danger); }
.badge-warning { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-info    { background: rgba(29,185,84,.15); color: var(--accent-text); }
.badge-custom { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; }

/* ── Summary cards ───────────────────────────────────────────────────────── */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.summary-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-align: center; }
.summary-card .card-value { font-size: 2rem; font-weight: 700; }
.summary-card .card-label { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.card-value.green { color: var(--success); }
.card-value.red   { color: var(--danger); }
.card-value.orange { color: var(--warning); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.dnsbl-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.dnsbl-table th { background: var(--surface2); padding: 10px 12px; text-align: left; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.dnsbl-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.dnsbl-table tr:hover td { background: var(--surface2); }
.listed-row td { background: rgba(239,68,68,.06) !important; }
.hop-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: 12px; }
.hop-table th { background: var(--surface2); padding: 8px 12px; text-align: left; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.hop-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: .82rem; }

/* ── Info grid ───────────────────────────────────────────────────────────── */
.info-grid { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 0; font-size: .9rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.info-grid .ig-label { background: var(--surface2); padding: 10px 14px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.info-grid .ig-value { padding: 10px 14px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: .85rem; word-break: break-all; }
.info-grid .ig-label:last-of-type, .info-grid .ig-value:last-of-type { border-bottom: none; }

/* ── SSL bar ─────────────────────────────────────────────────────────────── */
.ssl-days-bar { height: 10px; border-radius: 5px; background: var(--border); overflow: hidden; margin: 8px 0; }
.ssl-days-fill { height: 100%; border-radius: 5px; transition: width .5s; }
.fill-green  { background: var(--success); }
.fill-orange { background: var(--warning); }
.fill-red    { background: var(--danger); }

/* ── Propagation ─────────────────────────────────────────────────────────── */
.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.prop-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.prop-card .prop-name { font-weight: 600; font-size: .9rem; }
.prop-card .prop-ip   { font-size: .78rem; color: var(--text-muted); }
.prop-card .prop-result { font-family: var(--mono); font-size: .82rem; margin-top: 6px; word-break: break-all; }
.prop-card.ok   { border-left: 3px solid var(--success); }
.prop-card.fail { border-left: 3px solid var(--danger); }
.prop-card .prop-ms { font-size: .75rem; color: var(--text-muted); }

/* ── Port scan ───────────────────────────────────────────────────────────── */
.port-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.port-pill { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 8px; font-size: .85rem; font-family: var(--mono); border: 1px solid var(--border); background: var(--surface2); }
.port-pill.open   { border-color: var(--success); background: rgba(34,197,94,.08); }
.port-pill.closed { opacity: .55; }

/* ── Passwords ───────────────────────────────────────────────────────────── */
.pwd-list { display: flex; flex-direction: column; gap: 8px; }
.pwd-item { display: flex; align-items: center; justify-content: space-between; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-family: var(--mono); font-size: .95rem; gap: 10px; }
.pwd-copy-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; cursor: pointer; color: var(--text); font-size: .8rem; white-space: nowrap; transition: background .15s, transform .1s; }
.pwd-copy-btn:hover { background: var(--primary); color: #0a0f0d; border-color: var(--primary); }
.pwd-copy-btn:active { transform: scale(.96); }
.pwd-copy-btn.copied { background: var(--success); color: #0a0f0d; border-color: var(--success); }
.strength-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; margin-top: 8px; }
.strength-fill { height: 100%; border-radius: 4px; transition: width .4s, background .4s; }
.strength-detail { margin-top: 10px; font-size: .85rem; color: var(--text-muted); line-height: 1.7; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg { color: var(--text-muted); display: flex; align-items: center; gap: 8px; font-size: .95rem; }

/* ── Themed micro-animations (terminal · scramble · flash) ─────────────────── */
/* Terminal: blinking caret while a network output reveals line-by-line */
.fx-terminal::after {
  content: '▋';
  color: var(--accent-bright);
  animation: fxCaret 1s steps(1) infinite;
  margin-left: 1px;
}
@keyframes fxCaret { 50% { opacity: 0; } }
/* Floating scroll-to-top button (shown when .app-main is scrolled down) */
#scroll-top-btn {
  position: fixed;
  bottom: 84px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--accent-bright);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px) scale(.9);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .15s, border-color .15s;
  box-shadow: 0 4px 18px rgba(0,0,0,.4);
}
#scroll-top-btn.visible { opacity: 1; transform: none; pointer-events: auto; }
#scroll-top-btn:hover { background: var(--surface2); border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(57,255,133,.12), 0 4px 18px rgba(0,0,0,.4); }
@media (max-width: 768px) { #scroll-top-btn { bottom: 76px; } }

/* Flash: green pulse ring when a converter output updates */
@keyframes fxFlash {
  0%   { box-shadow: 0 0 0 2px var(--accent-bright), 0 0 14px rgba(57,255,133,.5); }
  100% { box-shadow: 0 0 0 0 rgba(57,255,133,0); }
}
.fx-flash { animation: fxFlash .6s ease-out; }
/* Stagger: children fade up in sequence (text/result tools) */
@keyframes fxFadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Copy feedback: animated green checkmark */
.btn-copied { color: var(--accent-bright) !important; border-color: var(--accent-dim) !important; }
.fx-check { display: inline-block; animation: fxCheckPop .35s cubic-bezier(.34,1.56,.64,1); }
@keyframes fxCheckPop {
  0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ── Button ripple & overrides ────────────────────────────────────────────── */
.btn { position: relative; overflow: hidden; transition: transform .1s, box-shadow .15s; }
.btn:active { transform: scale(.97); }
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}
.btn-ripple {
  position: absolute; border-radius: 50%;
  width: 8px; height: 8px; margin: -4px;
  background: rgba(255,255,255,.35);
  animation: ripple .5s linear;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  /* Neutralise non-essential motion; keep .spinner spinning (loading feedback). */
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .spinner { animation-duration: .7s !important; }
  .btn-ripple { display: none; }
  .tool-section.active:not(#tool-home),
  .ps-logo, .ps-logo-emoji,
  .ps-sbar-section.open .ps-sbar-body .ps-sbar-item { animation: none; }
  /* Cancel hover lift/scale transforms */
  .cg-swatch:hover, .pick-card:hover, .ps-recent-chip:hover { transform: none; }
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: #0a0f0d; font-weight: 700; }
.btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); color: #0a0f0d; box-shadow: 0 4px 16px rgba(57,255,133,.3); }
.btn-primary:focus { box-shadow: 0 0 0 3px rgba(57,255,133,.35) !important; }
.btn-outline-secondary:hover { border-color: var(--accent-dim); color: var(--accent-bright); }

/* ── WHOIS ───────────────────────────────────────────────────────────────── */
.whois-grid { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; align-items: start; max-width: 720px; }
.whois-label { font-size: .8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.whois-value { font-size: .9rem; word-break: break-all; }
.whois-ns-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.whois-ns-list li { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 10px; font-size: .82rem; font-family: var(--mono); }
.whois-status-list { display: flex; flex-wrap: wrap; gap: 6px; }
.whois-status { background: rgba(29,185,84,.12); border: 1px solid rgba(29,185,84,.3); border-radius: 6px; padding: 2px 10px; font-size: .78rem; }

/* ─── JSON Formatter ────────────────────────────────────────────────────────── */
.jf-container { display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; }
@media (max-width:700px) { .jf-container { grid-template-columns:1fr; } }
.jf-textarea { min-height:280px; font-family:var(--mono,'monospace'); font-size:.85rem; resize:vertical; }
.jf-output {
  min-height:280px; max-height:520px; overflow:auto;
  background:var(--surface); color:var(--text);
  border:1px solid var(--border); border-radius:var(--radius,8px);
  padding:12px 14px; font-family:var(--mono,'monospace'); font-size:.85rem;
  white-space:pre; margin:0;
}
.jf-error { min-height:1.4rem; font-size:.85rem; font-weight:500; }
.jf-error.jf-valid   { color:#22c55e; }
.jf-error.jf-invalid { color:#ef4444; }

/* ─── Word Counter ──────────────────────────────────────────────────────────── */
.wc-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; max-width:700px; }
@media (max-width:480px) { .wc-stats { grid-template-columns:repeat(2,1fr); } }
.wc-stat { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius,8px); padding:18px 16px; text-align:center; }
.wc-stat-num   { font-size:1.9rem; font-weight:800; color:var(--accent-bright); line-height:1; margin-bottom:6px; }
.wc-stat-label { font-size:.78rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; }

/* ─── Color Generator ───────────────────────────────────────────────────────── */
.cg-palette { display:flex; flex-direction:row; flex-wrap:wrap; gap:16px; }
.cg-swatch {
  display:flex; flex-direction:column; border:1px solid var(--border);
  border-radius:var(--radius,8px); overflow:hidden; cursor:pointer;
  transition:transform .2s, box-shadow .2s; min-width:130px; flex:1 1 130px; max-width:180px;
  background:var(--surface);
}
.cg-swatch:hover { transform:translateY(-4px) scale(1.03); box-shadow:0 10px 28px rgba(0,0,0,.35); }
.cg-box { height:100px; width:100%; }
.cg-info { padding:10px 12px; font-size:.78rem; }
.cg-hex  { font-weight:700; font-size:.9rem; color:var(--text); font-family:var(--mono,'monospace'); margin-bottom:2px; }
.cg-rgb, .cg-hsl { color:var(--text-muted); font-family:var(--mono,'monospace'); font-size:.75rem; }
.cg-comp { max-width:360px; }
.cg-comp-title { font-size:.82rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; margin-bottom:10px; }
.cg-comp-pair  { display:flex; gap:12px; }
.cg-comp-swatch {
  flex:1; height:72px; border-radius:var(--radius,8px);
  display:flex; align-items:flex-end; padding:6px 10px;
  cursor:pointer; transition:transform .2s;
}
.cg-comp-swatch:hover { transform:scale(1.04); }
.cg-comp-swatch span { font-size:.8rem; font-weight:700; font-family:var(--mono,'monospace'); color:rgba(255,255,255,.9); text-shadow:0 1px 4px rgba(0,0,0,.6); }

/* ─── Unit Converter ────────────────────────────────────────────────────────── */
.uc-tabs, .fc-tabs { display:flex; flex-wrap:wrap; gap:8px; }
.uc-tab, .fc-tab {
  background:var(--surface2,#2a2a2a); border:1px solid var(--border);
  color:var(--text-muted); border-radius:8px; padding:8px 18px;
  font-size:.88rem; font-weight:600; cursor:pointer;
  transition:background .18s, color .18s, border-color .18s;
}
.uc-tab:hover, .fc-tab:hover { background:var(--surface); color:var(--text); border-color:var(--border2,#555); }
.uc-tab.active, .fc-tab.active { background:var(--primary); border-color:var(--primary); color:#0a0f0d; }
.uc-result {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius,8px); padding:18px 20px;
  font-size:1.1rem; min-height:60px; display:flex; align-items:center;
}
.uc-result:empty { display:none; }
.uc-result strong { color:var(--accent-bright); font-size:1.2rem; }

/* ─── Format Converter ──────────────────────────────────────────────────────── */
.fc-panel { display:none; }
.fc-panel.active { display:block; }
.fc-io { display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; }
@media (max-width:700px) { .fc-io { grid-template-columns:1fr; } }
.fc-textarea { min-height:220px; font-family:var(--mono,'monospace'); font-size:.85rem; resize:vertical; }

/* ─── Image Converter ───────────────────────────────────────────────────────── */
.ic-wrap { max-width:860px; }
.ic-upload {
  border:2px dashed var(--border); border-radius:var(--radius,8px);
  padding:52px 24px; text-align:center; cursor:pointer;
  transition:border-color .2s, background .2s;
}
.ic-upload:hover, .ic-upload.ic-drag-over {
  border-color:var(--primary); background:rgba(var(--primary-rgb,.5,.7,1),.05);
}
.ic-upload-icon { font-size:2.8rem; color:var(--text-muted); display:block; margin-bottom:12px; }
.ic-upload-text { font-size:1.05rem; font-weight:600; color:var(--text); margin-bottom:4px; }
.ic-upload-sub  { font-size:.82rem; color:var(--text-muted); }
.ic-preview-row {
  display:flex; flex-direction:row; align-items:flex-start; gap:16px; flex-wrap:wrap;
}
.ic-preview-box { flex:1 1 260px; min-width:200px; }
.ic-preview-label { font-size:.78rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; margin-bottom:6px; }
.ic-preview-img {
  width:100%; max-height:320px; object-fit:contain;
  border:1px solid var(--border); border-radius:var(--radius,8px);
  background:repeating-conic-gradient(#808080 0% 25%, transparent 0% 50%) 0 0/16px 16px;
}
.ic-img-info  { font-size:.78rem; color:var(--text-muted); margin-top:4px; font-family:var(--mono,'monospace'); }
.ic-arrow     { align-self:center; font-size:1.8rem; color:var(--text-muted); padding:0 4px; }
.ic-fmt-btn {
  background:var(--surface2,#2a2a2a); border:1px solid var(--border);
  color:var(--text-muted); border-radius:6px; padding:6px 14px;
  font-size:.88rem; font-weight:600; cursor:pointer;
  transition:background .15s, color .15s, border-color .15s;
}
.ic-fmt-btn:hover { background:var(--surface); color:var(--text); }
.ic-fmt-btn.active { background:var(--primary); border-color:var(--primary); color:#0a0f0d; }
@media (max-width:600px) { .ic-arrow { transform:rotate(90deg); } .ic-preview-row { flex-direction:column; } }

/* ── Mi IP pública ──────────────────────────────────────────────────────── */
.myip-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius,12px); padding:24px; max-width:560px; margin:0 auto;
}
.myip-ip-row { margin-bottom:16px; }
.myip-label { font-size:.75rem; font-weight:700; text-transform:uppercase;
  letter-spacing:.06em; color:var(--text-muted); display:block; margin-bottom:6px; }
.myip-ip-wrap { display:flex; align-items:center; gap:10px; }
.myip-ip { font-size:1.9rem; font-weight:700; font-family:var(--mono,'monospace');
  color:var(--accent-bright); letter-spacing:.02em; }
.myip-copy { padding:4px 10px; font-size:.8rem; }
.myip-details { display:flex; flex-direction:column; gap:8px; margin-bottom:20px; }
.myip-detail { font-size:.93rem; color:var(--text-muted); display:flex; align-items:center; }
.myip-actions { display:flex; gap:10px; flex-wrap:wrap; }
@media (max-width:480px) { .myip-ip { font-size:1.4rem; } }

/* ── Calculadora de Subredes ────────────────────────────────────────────── */
.sn-input-row {
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
}
.sn-input-wrap {
  position:relative; flex:1; min-width:220px;
}
.sn-input-icon {
  position:absolute; left:12px; top:50%; transform:translateY(-50%);
  color:var(--text-muted); font-size:1rem; pointer-events:none;
}
.sn-input {
  width:100%; padding:10px 36px 10px 36px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius,10px); color:var(--text);
  font-family:var(--mono,'monospace'); font-size:.95rem;
  transition:border-color .2s;
}
.sn-input:focus { outline:none; border-color:var(--primary); }
.sn-input.sn-input--err { border-color:#e74c3c; }
.sn-clear-btn {
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  background:none; border:none; color:var(--text-muted); font-size:1rem;
  cursor:pointer; padding:2px 4px; line-height:1;
}
.sn-clear-btn:hover { color:var(--text); }
.sn-error {
  background:rgba(231,76,60,.12); border:1px solid #e74c3c; color:#e74c3c;
  border-radius:8px; padding:8px 14px; font-size:.88rem;
}
.sn-cards {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:12px;
}
.sn-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius,10px); padding:14px 16px;
}
.sn-card-label {
  font-size:.72rem; font-weight:700; text-transform:uppercase;
  letter-spacing:.07em; color:var(--text-muted); margin-bottom:4px; display:block;
}
.sn-card-value {
  font-family:var(--mono,'monospace'); font-size:1rem; font-weight:600;
  color:var(--text); word-break:break-all;
}
.sn-card--accent { border-color:var(--primary); }
.sn-card--accent .sn-card-value { color:var(--accent-text); }
.sn-card-badge {
  display:inline-block; font-size:.68rem; font-weight:700; padding:2px 7px;
  border-radius:20px; margin-left:6px; vertical-align:middle;
}
/* Translucent backgrounds so badges adapt to light/dark mode */
.sn-badge-private { background:rgba(34,197,94,.15);  color:#22c55e; }
.sn-badge-public  { background:rgba(56,189,248,.15); color:#38bdf8; }
.sn-badge-a { background:rgba(168,85,247,.15); color:#a855f7; }
.sn-badge-b { background:rgba(34,197,94,.15);  color:#22c55e; }
.sn-badge-c { background:rgba(56,189,248,.15); color:#38bdf8; }
.sn-badge-other { background:rgba(234,179,8,.15); color:#eab308; }

/* Visual bar */
.sn-vis-wrap { max-width:100%; }
.sn-vis-labels {
  display:flex; justify-content:space-between; font-size:.72rem;
  font-family:var(--mono,'monospace'); color:var(--text-muted); margin-bottom:4px;
}
.sn-vis-bar {
  display:flex; height:28px; border-radius:6px; overflow:hidden;
  border:1px solid var(--border);
}
.sn-vis-net   { background:#bb86fc; flex-shrink:0; }
.sn-vis-hosts { background:#4caf50; flex:1; }
.sn-vis-bc    { background:#e74c3c; flex-shrink:0; }
.sn-vis-legend {
  display:flex; gap:14px; margin-top:6px; flex-wrap:wrap; font-size:.78rem;
  color:var(--text-muted);
}
.sn-leg {
  display:inline-block; width:12px; height:12px;
  border-radius:3px; margin-right:4px; vertical-align:middle;
}
.sn-leg-net   { background:#bb86fc; }
.sn-leg-hosts { background:#4caf50; }
.sn-leg-bc    { background:#e74c3c; }

/* Binary representation */
.sn-binary-wrap { overflow-x:auto; }
.sn-binary-table {
  border-collapse:collapse; font-family:var(--mono,'monospace');
  font-size:.78rem; width:100%;
}
.sn-binary-table td, .sn-binary-table th {
  border:1px solid var(--border); padding:5px 8px; text-align:center; white-space:nowrap;
}
.sn-binary-table th {
  background:var(--surface2,#1e1e1e); color:var(--text-muted);
  font-weight:600; font-size:.7rem; text-transform:uppercase;
}
.sn-bit-1 { color:#4caf50; font-weight:700; }
.sn-bit-0 { color:var(--text-muted); }
.sn-bit-sep { color:var(--border); padding:0 3px; user-select:none; }

/* VLSM */
.sn-vlsm-box {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius,10px); padding:18px 20px;
}
.sn-vlsm-hdr { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.sn-vlsm-hdr h4 { margin:0; font-size:1rem; }
.sn-vlsm-row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.sn-vlsm-input { max-width:160px; }
.sn-vlsm-table {
  border-collapse:collapse; width:100%; font-size:.85rem;
  font-family:var(--mono,'monospace');
}
.sn-vlsm-table th, .sn-vlsm-table td {
  border:1px solid var(--border); padding:6px 10px; text-align:left;
}
.sn-vlsm-table th {
  background:var(--surface2,#1e1e1e); color:var(--text-muted);
  font-size:.72rem; text-transform:uppercase; font-weight:700;
}
.sn-vlsm-table tr:nth-child(even) td { background:var(--surface2,#1e1e1e); }

/* Explicación en lenguaje natural */
.sn-explain-box {
  background:var(--surface); border:1px solid var(--border);
  border-left:4px solid var(--primary,#4a9eff);
  border-radius:var(--radius,10px); padding:14px 18px;
  font-size:.9rem; line-height:1.7; color:var(--text);
}
.sn-explain-box strong { color:var(--accent-text); }
.sn-explain-box .sn-exp-row { margin-bottom:4px; }
.sn-explain-box .sn-exp-row:last-child { margin-bottom:0; }

/* Conversor de prefijo */
.sn-prefix-box {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius,10px); padding:18px 20px;
}
.sn-prefix-slider-row {
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
}
.sn-prefix-label {
  font-family:var(--mono,'monospace'); font-size:1.4rem; font-weight:700;
  color:var(--accent-text); min-width:46px;
}
.sn-prefix-slider {
  flex:1; min-width:160px; accent-color:var(--primary,#4a9eff);
}
.sn-prefix-hint {
  font-size:.8rem; color:var(--text-muted); min-width:100px;
}
.sn-prefix-result-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px;
}
.sn-pfx-card {
  background:var(--surface2,#1e1e1e); border:1px solid var(--border);
  border-radius:8px; padding:12px 14px;
}
.sn-pfx-card-label {
  font-size:.7rem; font-weight:700; text-transform:uppercase;
  letter-spacing:.07em; color:var(--text-muted); margin-bottom:3px; display:block;
}
.sn-pfx-card-value {
  font-family:var(--mono,'monospace'); font-size:.95rem;
  font-weight:600; color:var(--text);
}
.sn-pfx-diff {
  font-size:.75rem; margin-left:6px; font-weight:700;
}
.sn-pfx-diff--up   { color:#4caf50; }
.sn-pfx-diff--down { color:#e74c3c; }
.sn-pfx-explain {
  margin-top:12px; font-size:.88rem; color:var(--text-muted);
  line-height:1.6; border-top:1px solid var(--border); padding-top:10px;
}
.sn-pfx-explain strong { color:var(--text); }

@media (max-width:580px) {
  .sn-cards { grid-template-columns:1fr 1fr; }
  .sn-binary-table { font-size:.65rem; }
}

/* ── Historial de consultas recientes ───────────────────────────────────── */
.hist-chips {
  display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px;
}
.hist-chip {
  background:var(--surface2,#1e1e1e); border:1px solid var(--border);
  border-radius:20px; padding:3px 10px; font-size:.75rem;
  color:var(--text-muted); cursor:pointer; transition:background .15s, color .15s;
  font-family:var(--mono,'monospace');
}
.hist-chip:hover { background:var(--primary); color:#0a0f0d; border-color:var(--primary); }
.hist-chip-label {
  font-size:.65rem; text-transform:uppercase; letter-spacing:.05em;
  color:var(--text-muted); margin-right:4px; font-family:sans-serif;
}

/* ── Ping ────────────────────────────────────────────────────────────────── */
.ping-stats {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; margin-bottom:14px;
}
.ping-stat {
  background:var(--surface); border:1px solid var(--border);
  border-radius:10px; padding:12px 14px; text-align:center;
}
.ping-stat-val {
  font-family:var(--mono,'monospace'); font-size:1.2rem; font-weight:700;
  color:var(--accent-text);
}
.ping-stat-lbl {
  font-size:.7rem; color:var(--text-muted); text-transform:uppercase;
  letter-spacing:.06em; margin-top:3px;
}
.ping-loss-ok   { color:#4caf50; }
.ping-loss-warn { color:#ffc107; }
.ping-loss-bad  { color:#e74c3c; }

/* ── ASN ────────────────────────────────────────────────────────────────── */
.asn-cards {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; margin-bottom:14px;
}
.asn-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:10px; padding:14px 16px;
}
.asn-card-label {
  font-size:.7rem; font-weight:700; text-transform:uppercase;
  letter-spacing:.07em; color:var(--text-muted); margin-bottom:4px; display:block;
}
.asn-card-value {
  font-family:var(--mono,'monospace'); font-size:.95rem;
  font-weight:600; color:var(--text); word-break:break-word;
}
.asn-card--accent { border-color:var(--primary); }
.asn-card--accent .asn-card-value { color:var(--accent-text); }

/* ── Email Health ────────────────────────────────────────────────────────── */
.eh-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px;
}
.eh-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:12px; overflow:hidden;
}
.eh-card-head {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap;
  gap:8px; padding:12px 16px; border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.03);
}
.eh-card-title { font-weight:700; font-size:.85rem; color:var(--text); }
.eh-card-body  { padding:12px 16px; font-size:.85rem; }
.eh-desc       { margin:0 0 8px; color:var(--text-muted); line-height:1.5; }
.eh-desc--fail { color:#f87171; }

.eh-badge {
  display:inline-flex; align-items:center; font-size:.72rem; font-weight:700;
  padding:3px 9px; border-radius:20px; white-space:nowrap;
}
.eh-ok   { background:rgba(34,197,94,.15);  color:#4ade80; border:1px solid rgba(34,197,94,.3); }
.eh-warn { background:rgba(234,179,8,.15);  color:#facc15; border:1px solid rgba(234,179,8,.3); }
.eh-fail { background:rgba(239,68,68,.15);  color:#f87171; border:1px solid rgba(239,68,68,.3); }
.eh-info { background:rgba(29,185,84,.15); color:var(--accent-text); border:1px solid rgba(29,185,84,.3); }

.eh-record {
  display:block; background:var(--code-bg,#0d1117); border:1px solid var(--border);
  border-radius:6px; padding:8px 10px; font-size:.75rem;
  word-break:break-all; color:#7dd3fc; margin-top:8px; line-height:1.6;
}
.eh-mx-row {
  display:flex; align-items:center; gap:10px; padding:4px 0;
  border-bottom:1px solid rgba(255,255,255,.05); font-size:.82rem;
}
.eh-mx-row:last-child { border-bottom:none; }
.eh-mx-prio {
  background:var(--primary); color:#0a0f0d; border-radius:4px;
  font-size:.7rem; font-weight:700; padding:2px 6px; min-width:28px; text-align:center;
}
.eh-dkim-sel {
  padding:4px 0; font-size:.82rem; color:var(--text-muted);
  border-bottom:1px solid rgba(255,255,255,.05);
}
.eh-dkim-sel:last-child { border-bottom:none; }

/* ── Hash ────────────────────────────────────────────────────────────────── */
.hash-grid {
  display:flex; flex-direction:column; gap:10px; max-width:800px;
}
.hash-row {
  background:var(--surface); border:1px solid var(--border);
  border-radius:10px; padding:12px 16px;
  display:flex; align-items:flex-start; gap:12px; flex-wrap:wrap;
}
.hash-algo {
  font-size:.72rem; font-weight:700; text-transform:uppercase;
  letter-spacing:.07em; color:var(--text-muted); min-width:60px;
  padding-top:2px;
}
.hash-val {
  font-family:var(--mono,'monospace'); font-size:.85rem; color:var(--text);
  word-break:break-all; flex:1;
}
.hash-copy {
  background:none; border:1px solid var(--border); border-radius:6px;
  color:var(--text-muted); font-size:.75rem; padding:2px 8px;
  cursor:pointer; white-space:nowrap;
}
.hash-copy:hover { background:var(--surface2,#1e1e1e); color:var(--text); }
.hash-placeholder { color:var(--text-muted); font-size:.88rem; padding:8px 0; }

/* ── QR ─────────────────────────────────────────────────────────────────── */
.qr-layout {
  display:flex; gap:32px; align-items:flex-start; flex-wrap:wrap;
}
.qr-input-col { flex:1; min-width:260px; max-width:440px; }
.qr-preview-col {
  display:flex; flex-direction:column; align-items:center; gap:10px;
}
.qr-canvas-wrap {
  background:#fff; border-radius:10px; padding:12px;
  border:1px solid var(--border); min-width:80px; min-height:80px;
  display:flex; align-items:center; justify-content:center;
}
.qr-canvas-wrap canvas { display:block; }
.qr-placeholder { font-size:.88rem; margin:0; }

/* ── Keycode ─────────────────────────────────────────────────────────────── */
.kc-display {
  display:flex; flex-direction:column; align-items:center; gap:16px;
  padding:24px; border-radius:14px; background:var(--surface);
  border:1px solid var(--border); min-height:120px; justify-content:center;
}
.kc-main-key {
  font-size:2.4rem; font-weight:700; font-family:var(--mono,'monospace');
  padding:12px 24px; border-radius:10px;
  background:var(--surface2,#1e1e1e); border:2px solid var(--accent-mid);
  color:var(--accent-text); min-width:80px; text-align:center;
}
.kc-display table { font-size:.85rem; border-collapse:collapse; }
.kc-display td { padding:3px 12px 3px 4px; }
.kc-display td:first-child { color:var(--text-muted); font-weight:600; }
.kc-display td:last-child { font-family:var(--mono,'monospace'); color:var(--text); }

/* ── HTTP Status ─────────────────────────────────────────────────────────── */
.hs-group { margin-bottom:20px; }
.hs-group-title {
  font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em;
  color:var(--text-muted); padding:4px 0 8px; border-bottom:1px solid var(--border);
  margin-bottom:10px;
}
.hs-codes { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:8px; }
.hs-card {
  display:flex; align-items:flex-start; gap:10px; padding:10px 12px;
  border-radius:8px; border:1px solid var(--border); background:var(--surface);
  cursor:default;
}
.hs-code { font-size:1.05rem; font-weight:700; font-family:var(--mono,'monospace'); min-width:36px; }
.hs-code.s1xx { color:#6c757d; }
.hs-code.s2xx { color:#22c55e; }
.hs-code.s3xx { color:#eab308; }
.hs-code.s4xx { color:#ef4444; }
.hs-code.s5xx { color:#a855f7; }
.hs-name { font-size:.82rem; font-weight:600; color:var(--text); }
.hs-desc { font-size:.75rem; color:var(--text-muted); margin-top:1px; }

/* ── Device Info ─────────────────────────────────────────────────────────── */
.devinfo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:12px; }
.devinfo-card {
  padding:14px 16px; border-radius:10px; border:1px solid var(--border);
  background:var(--surface);
}
.devinfo-label { font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); font-weight:600; margin-bottom:4px; }
.devinfo-value { font-size:.9rem; color:var(--text); font-family:var(--mono,'monospace'); word-break:break-word; }

/* ── Color Converter ─────────────────────────────────────────────────────── */
.cc-preview {
  width:100%; height:60px; border-radius:10px; border:1px solid var(--border);
  margin-bottom:12px; transition:background .15s;
}
.cc-val { font-family:var(--mono,'monospace'); font-size:.85rem; }

/* ── Base Converter ──────────────────────────────────────────────────────── */
.bc-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.bc-field { display:flex; flex-direction:column; gap:4px; }
.bc-field label { font-size:.75rem; font-weight:600; color:var(--text-muted); }
.bc-field input { font-family:var(--mono,'monospace'); font-size:.85rem; }
@media (max-width:480px) { .bc-grid { grid-template-columns:1fr; } }

/* ── chmod Calculator ────────────────────────────────────────────────────── */
.chmod-grid { display:flex; flex-direction:column; gap:6px; }
.chmod-group { display:flex; align-items:center; gap:12px; padding:10px 14px; border-radius:8px; background:var(--surface); border:1px solid var(--border); }
.chmod-group-title { font-weight:700; width:70px; font-size:.88rem; }
.chmod-cb { display:flex; align-items:center; gap:6px; font-size:.85rem; cursor:pointer; }
.chmod-cb input { accent-color:var(--accent-text); }
.chmod-result { display:flex; gap:20px; padding:14px; border-radius:8px; background:var(--surface2,#1e1e1e); border:1px solid var(--border); align-items:center; flex-wrap:wrap; }
.chmod-result-num { font-size:2rem; font-weight:700; font-family:var(--mono,'monospace'); color:var(--accent-text); }
.chmod-result-sym { font-size:1.1rem; font-family:var(--mono,'monospace'); color:var(--text); }

/* ── Cron ────────────────────────────────────────────────────────────────── */
.cron-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; }
.cron-field { display:flex; flex-direction:column; gap:4px; }
.cron-label { font-size:.72rem; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); }
.cron-input { font-family:var(--mono,'monospace'); font-size:.9rem; text-align:center; }
@media (max-width:600px) { .cron-grid { grid-template-columns:repeat(3,1fr); } }

/* ── JWT ─────────────────────────────────────────────────────────────────── */
.jwt-section { margin-bottom:16px; }
.jwt-section-title { font-size:.75rem; font-weight:700; text-transform:uppercase; letter-spacing:.07em; margin-bottom:6px; }
.jwt-section-title.jwt-header { color:var(--accent-text); }
.jwt-section-title.jwt-payload { color:#22c55e; }
.jwt-section-title.jwt-sig { color:#ef4444; }
.jwt-pre {
  background:var(--surface); border:1px solid var(--border); border-radius:8px;
  padding:12px 14px; font-size:.82rem; font-family:var(--mono,'monospace');
  white-space:pre-wrap; word-break:break-all; color:var(--text); margin:0;
}

/* ── Regex ───────────────────────────────────────────────────────────────── */
.regex-match { background:rgba(234,179,8,.3); border-radius:2px; }

/* ── JSON Diff ───────────────────────────────────────────────────────────── */
.jd-count { font-size:.8rem; color:var(--text-muted); margin-bottom:8px; }
.jd-row { display:flex; gap:8px; align-items:baseline; padding:4px 8px; border-radius:6px; font-size:.83rem; font-family:var(--mono,'monospace'); }
.jd-row.add { background:rgba(34,197,94,.12); }
.jd-row.del { background:rgba(239,68,68,.12); }
.jd-row.chg { background:rgba(234,179,8,.10); }
.jd-path { color:var(--text-muted); flex:1; min-width:0; word-break:break-all; }
.jd-sign { font-weight:700; width:16px; }
.jd-row.add .jd-sign { color:#22c55e; }
.jd-row.del .jd-sign { color:#ef4444; }
.jd-row.chg .jd-sign { color:#eab308; }
.jd-val { color:var(--text); flex:2; word-break:break-all; }

/* ── NATO ────────────────────────────────────────────────────────────────── */
.nato-output { display:flex; flex-wrap:wrap; gap:8px; }
.nato-char {
  display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:8px 12px; border-radius:8px; background:var(--surface); border:1px solid var(--border);
}
.nato-letter { font-size:1.2rem; font-weight:700; color:var(--text); }
.nato-word { font-size:.75rem; color:var(--text-muted); }
.nato-unknown { opacity:.4; }

/* ── SVG Placeholder ─────────────────────────────────────────────────────── */
.svg-preview {
  border-radius:10px; border:1px solid var(--border); overflow:hidden;
  display:flex; align-items:center; justify-content:center; background:var(--surface);
  min-height:80px;
}
.svg-preview svg { display:block; max-width:100%; }

/* ── Percentage ──────────────────────────────────────────────────────────── */
.pct-card {
  background:var(--surface); border:1px solid var(--border); border-radius:10px;
  padding:16px; margin-bottom:12px;
}
.pct-card label { font-size:.8rem; color:var(--text-muted); font-weight:600; }
.pct-card .pct-result {
  font-size:1.5rem; font-weight:700; color:var(--accent-text);
  font-family:var(--mono,'monospace'); margin-top:6px;
}

/* ── Case Converter ──────────────────────────────────────────────────────── */
.caseconv-grid { display:flex; flex-direction:column; gap:8px; }
.caseconv-row { display:grid; grid-template-columns:160px 1fr; gap:10px; align-items:center; }
.caseconv-label { font-size:.8rem; font-weight:600; color:var(--text-muted); text-align:right; white-space:nowrap; }
@media(max-width:480px){ .caseconv-row { grid-template-columns:1fr; } .caseconv-label { text-align:left; } }

/* ── Text Diff ───────────────────────────────────────────────────────────── */
.tdiff-inputs { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media(max-width:640px){ .tdiff-inputs { grid-template-columns:1fr; } }
.tdiff-out { border:1px solid var(--border); border-radius:8px; overflow:hidden; font-size:.82rem; }
.tdiff-stats { padding:6px 12px; background:var(--surface); border-bottom:1px solid var(--border); font-size:.8rem; font-weight:600; }
.tdiff-add { background:rgba(34,197,94,.12); padding:2px 12px; }
.tdiff-del { background:rgba(239,68,68,.12); padding:2px 12px; }
.tdiff-eq  { padding:2px 12px; color:var(--text-muted); }
.tdiff-sign { display:inline-block; width:14px; }

/* ── String Inspector ────────────────────────────────────────────────────── */
.si-stats-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; }
.si-stat { display:flex; flex-direction:column; align-items:center; padding:14px 10px; border-radius:8px; background:var(--surface); border:1px solid var(--border); }
.si-stat-val { font-size:1.6rem; font-weight:700; color:var(--accent-text); font-family:var(--mono,'monospace'); }
.si-stat-label { font-size:.7rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; margin-top:2px; }
.si-freq-wrap { display:flex; flex-wrap:wrap; gap:6px; }
.si-freq-item { display:flex; flex-direction:column; align-items:center; padding:6px 10px; border-radius:6px; background:var(--surface); border:1px solid var(--border); min-width:42px; }
.si-freq-char { font-size:1rem; font-weight:700; font-family:var(--mono,'monospace'); }
.si-freq-n { font-size:.7rem; color:var(--text-muted); }

/* ── ASCII Table ─────────────────────────────────────────────────────────── */
.ascii-table { font-size:.82rem; margin-bottom:0; }
.ascii-table th { font-size:.75rem; text-transform:uppercase; letter-spacing:.05em; background:var(--surface); }

/* ── Number to Words ─────────────────────────────────────────────────────── */
.ntw-result { font-size:1.1rem; font-weight:600; color:var(--accent-text); min-height:48px; padding:14px 16px; border-radius:8px; background:var(--surface); border:1px solid var(--border); line-height:1.4; }

/* ── Markdown Preview ────────────────────────────────────────────────────── */
.md-preview { border:1px solid var(--border); border-radius:8px; padding:16px 20px; min-height:200px; overflow-y:auto; line-height:1.7; background:var(--surface); }
.md-preview h1,.md-preview h2,.md-preview h3,.md-preview h4 { margin-top:.9em; margin-bottom:.4em; }
.md-preview code { background:var(--surface2,#1e1e1e); padding:2px 5px; border-radius:4px; font-family:var(--mono,'monospace'); font-size:.88em; }
.md-preview pre { background:var(--surface2,#1e1e1e); padding:12px 14px; border-radius:6px; overflow-x:auto; }
.md-preview pre code { background:none; padding:0; }
.md-preview blockquote { border-left:3px solid var(--accent-mid); margin:0 0 12px; padding:4px 14px; color:var(--text-muted); }
.md-preview table { border-collapse:collapse; width:100%; margin-bottom:12px; }
.md-preview th,.md-preview td { border:1px solid var(--border); padding:6px 10px; text-align:left; }
.md-preview th { background:var(--surface2,#1e1e1e); }
.md-preview img { max-width:100%; border-radius:6px; }
.md-preview p { margin-bottom:.6em; }
.md-preview ul,.md-preview ol { padding-left:1.4em; margin-bottom:.6em; }

/* ── TOTP ────────────────────────────────────────────────────────────────── */
.totp-display { display:flex; flex-direction:column; align-items:flex-start; gap:14px; }
.totp-code { font-size:2.8rem; font-weight:700; letter-spacing:.2em; font-family:var(--mono,'monospace'); color:var(--accent-text); }
.totp-timer { display:flex; align-items:center; gap:10px; width:100%; max-width:300px; }
.totp-bar-wrap { flex:1; height:6px; background:var(--border); border-radius:3px; overflow:hidden; }
.totp-bar { height:100%; background:var(--accent-mid); transition:width 1s linear; border-radius:3px; }
.totp-time { font-size:.8rem; color:var(--text-muted); min-width:30px; font-family:var(--mono,'monospace'); }

/* ── Tute ─────────────────────────────────────────────────────────────────── */
:root {
  --tt-card-w: 72px;
  --tt-card-h: 108px;
  --tt-felt: #0b2416;
  --tt-felt2: #0d2b1a;
}
@media (max-width: 768px) {
  :root { --tt-card-w: 58px; --tt-card-h: 87px; }
}

/* Screens */
.tt-screen { animation: toolEnter .28s cubic-bezier(.4,0,.2,1) both; }

/* Menu / selection screens */
.tt-menu, .tt-select-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; gap: 24px; text-align: center; padding: 32px 16px;
}
.tt-select-screen h3 { font-family: var(--font-display); color: var(--text); margin-bottom: 8px; }
.tt-mode-cards { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.tt-mode-card {
  background: var(--surface2); border: 1px solid var(--border2); border-radius: 14px;
  padding: 20px 24px; cursor: pointer; width: 190px; text-align: left;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.tt-mode-card:hover { border-color: var(--accent-mid); background: rgba(29,185,84,.06);
  transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.tt-mode-card h4 { color: var(--accent-bright); font-size: 1.05rem; margin-bottom: 6px; }
.tt-mode-card p { color: var(--text-muted); font-size: .8rem; margin: 0; line-height: 1.45; }
.tt-diff-card { background: var(--surface2); border: 1px solid var(--border2); border-radius:12px;
  padding: 16px 22px; cursor: pointer; width: 170px; text-align: center;
  transition: border-color .18s, background .18s, transform .18s; }
.tt-diff-card:hover { border-color: var(--accent-mid); background: rgba(29,185,84,.06); transform:translateY(-3px); }
.tt-diff-card h4 { color: var(--accent-bright); margin-bottom: 4px; }
.tt-diff-card p { color: var(--text-muted); font-size: .78rem; margin: 0; }

/* Table */
.tt-table {
  background: var(--tt-felt2);
  border-radius: 16px;
  padding: 16px;
  min-height: 520px;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  gap: 12px;
}
@media (max-width: 768px) {
  .tt-table { padding: 10px 8px; border-radius: 10px; gap: 8px; }
}

/* HUD */
.tt-hud {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  background: rgba(0,0,0,.3); border-radius: 10px; padding: 8px 14px;
  font-size: .82rem; color: var(--text-muted);
}
.tt-hud-score { display:flex; flex-direction:column; align-items:center; gap:2px; min-width:60px; }
.tt-hud-score .tt-score-val { font-size: 1.1rem; font-weight: 700; color: var(--text); font-family: var(--mono); }
.tt-hud-score .tt-score-lbl { font-size: .7rem; color: var(--text-muted); }
.tt-hud-score.tt-active .tt-score-val { color: var(--accent-bright); }
.tt-hud-trump { display:flex; align-items:center; gap:6px; margin-left:auto; font-size:.85rem; }
.tt-trump-sym { font-size: 1.2rem; }

/* Opponents area */
.tt-opponents {
  display: flex; justify-content: center; gap: 16px; align-items: flex-start; flex-wrap: wrap;
}
.tt-opponent-area { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tt-opp-label { font-size: .72rem; color: var(--text-muted); letter-spacing: .04em; }
.tt-cpu-fan { display: flex; justify-content: center; }
.tt-cpu-fan .tt-card { margin-right: -24px; }
.tt-cpu-fan .tt-card:last-child { margin-right: 0; }

/* Trick area */
/* Trick area: CPU slots on top, human slot at bottom */
.tt-trick-area {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 4px 0;
}
.tt-trick-row {
  display: flex; justify-content: center; align-items: center; gap: 16px;
  min-height: calc(var(--tt-card-h) + 28px);
}
.tt-trick-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tt-trick-slot-lbl { font-size: .68rem; color: var(--text-muted); }
.tt-trick-empty {
  width: var(--tt-card-w); height: var(--tt-card-h);
  border: 1.5px dashed rgba(57,255,133,.2); border-radius: 8px;
}

/* Trump / draw-pile area */
.tt-trump-area   { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.tt-trump-col    { display:flex; flex-direction:column; align-items:center; gap:6px; }
.tt-trump-label  { font-size:.78rem; color:var(--text-muted); font-weight:600; }

/* The trump card sits sideways under the draw pile */
.tt-trump-card-wrap {
  position: relative;
  width: calc(var(--tt-card-w) + 28px);
  height: calc(var(--tt-card-h) + 28px);
  display: flex; align-items: center; justify-content: center;
}
.tt-trump-card-rotated {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%) rotate(-90deg);
  transform-origin: center bottom;
}
/* Draw pile stacked on top of the rotated trump card */
.tt-deck-pile {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: var(--tt-card-w); height: var(--tt-card-h);
}
.tt-deck-count {
  position: absolute; top: 4px; right: 6px; z-index: 3;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: .7rem; font-weight:700; border-radius:4px; padding:1px 5px;
  pointer-events: none;
}

/* Cards */
.tt-card {
  width: var(--tt-card-w);
  height: var(--tt-card-h);
  border-radius: 8px;
  position: relative;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
  transition: transform .15s, box-shadow .15s;
  overflow: hidden;
}
.tt-card-inner {
  width: 100%; height: 100%;
  background: #faf8f0;
  border: 1.5px solid #d4c89a;
  border-radius: 8px;
  display: flex; flex-direction: column; justify-content: space-between; padding: 4px 5px;
  box-sizing: border-box; position: relative;
}
.tt-card-corner { font-size: .72rem; font-weight: 700; line-height: 1.1; }
.tt-card-corner.tt-bot { transform: rotate(180deg); align-self: flex-end; }
.tt-card-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 1.7rem; line-height: 1;
}
/* Suit colors */
.tt-card.tt-oros  .tt-card-corner, .tt-card.tt-oros  .tt-card-center { color: #b8860b; }
.tt-card.tt-copas .tt-card-corner, .tt-card.tt-copas .tt-card-center { color: #cc0000; }
.tt-card.tt-espadas .tt-card-corner, .tt-card.tt-espadas .tt-card-center { color: #1a1a2e; }
.tt-card.tt-bastos .tt-card-corner, .tt-card.tt-bastos .tt-card-center { color: #5c3317; }
/* Playable highlight */
.tt-card.tt-playable {
  cursor: pointer;
  animation: tt-pulse 1.8s ease-in-out infinite;
  box-shadow: 0 0 0 2px var(--accent-bright), 0 4px 14px rgba(57,255,133,.3);
}
.tt-card.tt-playable:hover, .tt-card.tt-playable:focus {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 0 0 2.5px var(--accent-bright), 0 10px 28px rgba(57,255,133,.4);
  animation: none;
}
.tt-card.tt-invalid { opacity: .38; filter: saturate(.3); cursor: not-allowed; }
/* Card back */
.tt-card.tt-back .tt-card-inner {
  background: repeating-linear-gradient(45deg, #1a3a5c 0, #1a3a5c 4px, #102a45 4px, #102a45 8px);
  border-color: #0d1f33;
}
@keyframes tt-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent-bright), 0 4px 14px rgba(57,255,133,.2); }
  50%  { box-shadow: 0 0 0 3px var(--accent-bright), 0 6px 20px rgba(57,255,133,.45); }
}
/* Card play animation */
@keyframes tt-fly-in {
  from { transform: translateY(-40px) scale(.8); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.tt-card.tt-just-played { animation: tt-fly-in .28s cubic-bezier(.4,0,.2,1) both; }

/* Real "Naipes Libres" card images (override the SVG fallback look) */
.tt-card.tt-img { background: #faf8f0; border: none; padding: 0; }
.tt-card.tt-img .tt-card-pic {
  width: 100%; height: 100%; display: block;
  object-fit: cover; border-radius: 8px; user-select: none; pointer-events: none;
}

/* Human hand */
.tt-hand {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px;
}
@media (max-width: 600px) {
  .tt-hand { gap: 3px; }
  .tt-cpu-fan .tt-card { margin-right: -30px; }
}

/* Acuse / canto buttons */
.tt-acuse-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 4px 0; }
.tt-acuse-btn {
  background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.4);
  color: #f59e0b; border-radius: 8px; padding: 5px 14px; font-size: .8rem;
  cursor: pointer; transition: background .15s, transform .1s;
}
.tt-acuse-btn:hover { background: rgba(245,158,11,.22); transform: scale(1.04); }

/* Message bar */
.tt-msg { font-size: .85rem; color: var(--text-muted); min-height: 22px; text-align: center; }
.tt-msg.tt-win { color: var(--success); font-weight: 700; }
.tt-msg.tt-lose { color: var(--danger); font-weight: 700; }

/* Announcement overlay */
.tt-announce {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(0,0,0,.8); border: 2px solid var(--accent-bright);
  border-radius: 14px; padding: 16px 32px; text-align: center;
  font-size: 1.4rem; font-weight: 700; color: var(--accent-bright);
  z-index: 10; pointer-events: none;
  animation: tt-announce-pop .45s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes tt-announce-pop {
  from { transform: translate(-50%,-50%) scale(.4); opacity: 0; }
  to   { transform: translate(-50%,-50%) scale(1); opacity: 1; }
}

/* Log panel */
.tt-log-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; max-height: 160px; overflow-y: auto; font-size: .78rem;
  color: var(--text-muted); display: none;
}
.tt-log-panel.open { display: block; }
.tt-log-entry { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,.04); }

/* Result screen */
.tt-result {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 40px 24px; text-align: center;
}
.tt-result-winner { font-size: 2rem; font-weight: 800; color: var(--accent-bright); font-family: var(--font-display); }
.tt-result-table { width: 100%; max-width: 480px; border-collapse: collapse; font-size: .88rem; margin: 0 auto; }
.tt-result-table th { background: var(--surface2); padding: 8px 12px; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.tt-result-table td { padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.04); }
.tt-result-table .tt-result-hl td { color: var(--accent-bright); font-weight: 600; }
.tt-result-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Capote bar */
.tt-capote-bar { display:flex; justify-content:center; gap:10px; padding:4px 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tt-card.tt-playable { animation: none; }
  .tt-card.tt-just-played { animation: none; }
  .tt-announce { animation: none; }
  .tt-screen { animation: none; }
}

/* ── Tute – complementary classes (matching tute.js structure) ─────────────── */

/* Card inner structure */
.tt-card { display: flex; flex-direction: column; justify-content: space-between; padding: 3px 4px; box-sizing: border-box; background: #faf8f0; border: 1.5px solid #d4c89a; }
.tt-card.tt-back { background: repeating-linear-gradient(45deg,#1a3a5c 0,#1a3a5c 4px,#102a45 4px,#102a45 8px); border-color:#0d1f33; }
.tt-card-tl { display:flex; flex-direction:column; align-items:flex-start; line-height:1.1; }
.tt-card-br { display:flex; flex-direction:column; align-items:flex-end; line-height:1.1; transform:rotate(180deg); }
.tt-rank-lbl { font-size:.72rem; font-weight:700; }
.tt-suit-lbl { font-size:.65rem; }
.tt-card-center { display:flex; align-items:center; justify-content:center; flex:1; }
.tt-suit-svg { width:32px; height:32px; }

/* Slot */
.tt-slot-empty { width:var(--tt-card-w); height:var(--tt-card-h); border:1.5px dashed rgba(57,255,133,.2); border-radius:8px; }
.tt-trick-label { font-size:.68rem; color:var(--text-muted); text-align:center; }
.tt-trick-current .tt-slot-empty { border-color:rgba(57,255,133,.5); }

/* CPU fan */
.tt-cpu-fan { display:flex; flex-direction:column; align-items:center; gap:6px; }
.tt-cpu-fan-empty { opacity:.35; }
.tt-cpu-cards { display:flex; align-items:center; }
.tt-cpu-label { font-size:.72rem; color:var(--text-muted); }
.tt-cpu-row { display:flex; justify-content:center; gap:24px; flex-wrap:wrap; }

/* Trump area */
.tt-trump-label { font-size:.75rem; color:var(--text-muted); margin-bottom:6px; }
.tt-baceta-info { font-size:.75rem; color:var(--text-muted); margin-top:6px; }

/* Game layout */
.tt-game-area { display:flex; flex-direction:column; gap:10px; }
.tt-mid-row { display:flex; align-items:flex-start; justify-content:center; gap:24px; flex-wrap:wrap; }
.tt-cpu-area { display:flex; justify-content:center; }
.tt-actions-row { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; padding:4px 0; }
.tt-hand-area { display:flex; flex-direction:column; align-items:center; gap:6px; }
.tt-hand-label { font-size:.75rem; color:var(--text-muted); }
.tt-status-bar { min-height:24px; text-align:center; font-size:.85rem; padding:4px 0; }
.tt-msg-active { color:var(--accent-bright); }
.tt-msg-over { color:var(--text); font-weight:600; }

/* Screen headers */
.tt-screen-hdr { display:flex; align-items:center; gap:14px; margin-bottom:20px; flex-wrap:wrap; }
.tt-screen-hdr h3 { margin:0; font-family:var(--font-display); }

/* Mode / difficulty grids */
.tt-mode-grid { display:flex; flex-wrap:wrap; gap:14px; justify-content:center; }
.tt-diff-grid { display:flex; flex-wrap:wrap; gap:14px; justify-content:center; }
.tt-mode-title { font-family:var(--font-display); font-size:1rem; font-weight:700; color:var(--accent-bright); margin-bottom:2px; }
.tt-mode-sub { font-size:.78rem; color:var(--text-muted); margin-bottom:6px; }
.tt-mode-desc { font-size:.77rem; color:var(--text-muted); line-height:1.4; }
.tt-diff-label { font-family:var(--font-display); font-size:.95rem; font-weight:700; color:var(--accent-bright); margin-bottom:4px; }
.tt-diff-desc { font-size:.77rem; color:var(--text-muted); line-height:1.4; }

/* 4-player layout */
.tt-4p-row { display:flex; justify-content:space-between; align-items:flex-start; width:100%; gap:8px; }
.tt-4p-left, .tt-4p-right { flex:1; display:flex; justify-content:center; }
.tt-4p-center { flex:2; display:flex; justify-content:center; }
@media (max-width:600px) {
  .tt-4p-row { flex-direction:column; align-items:center; }
  .tt-4p-left,.tt-4p-right,.tt-4p-center { width:100%; }
}

/* ── Brisca ─────────────────────────────────────────────────────────────────── */
:root { --br-card-w:72px; --br-card-h:108px; }
@media(max-width:480px){ :root{ --br-card-w:58px; --br-card-h:87px; } }

.br-game-layout { display:flex; flex-direction:column; gap:10px; max-width:560px; margin:0 auto; }
.br-header { display:flex; flex-direction:column; gap:4px; padding:8px 0; }
.br-back-btn { background:transparent; border:none; color:var(--accent-bright); font-size:.85rem; cursor:pointer; padding:2px 0; align-self:flex-start; }
.br-back-btn:hover { text-decoration:underline; }
.br-header-title { font-family:var(--font-display); font-size:1.3rem; font-weight:800; }
.br-diff-badge { font-size:.75rem; color:var(--text-muted); margin-left:8px; }
.br-score-row { display:flex; align-items:center; gap:8px; font-family:var(--font-display); font-size:1.15rem; }
.br-score-val { font-size:1.4rem; font-weight:900; color:var(--accent-bright); }
.br-score-win { color:#fbbf24; }
.br-score-sep { color:var(--text-muted); }
.br-score-lbl { font-size:.8rem; color:var(--text-muted); }
.br-rounds-row { margin-top:2px; }

.br-board { display:flex; flex-direction:column; gap:8px; }
.br-area-label { font-size:.72rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; margin-bottom:4px; text-align:center; }
.br-hand { display:flex; gap:6px; flex-wrap:wrap; justify-content:center; }
.br-hand-human { gap:8px; }

.br-card { width:var(--br-card-w); height:var(--br-card-h); border-radius:8px; display:flex; flex-direction:column; align-items:center; justify-content:space-around; background:#faf8f0; border:1.5px solid #d4c89a; box-sizing:border-box; user-select:none; }
.br-card.br-img { background:#faf8f0; border:none; padding:0; overflow:hidden; }
.br-card.br-img .br-card-pic { width:100%; height:100%; object-fit:cover; border-radius:8px; display:block; }
.br-card-back { background:repeating-linear-gradient(45deg,#1a3a5c 0,#1a3a5c 4px,#102a45 4px,#102a45 8px); border-color:#0d1f33; }
.br-card-wrap { cursor:default; border-radius:10px; }
.br-playable { cursor:pointer; }
.br-playable:hover .br-card { transform:translateY(-10px); transition:transform .15s; }
.br-card-sm { width:calc(var(--br-card-w)*.85); height:calc(var(--br-card-h)*.85); }

.br-middle { display:flex; align-items:center; justify-content:center; gap:24px; padding:8px 0; }
.br-trick-area { display:flex; flex-direction:column; gap:6px; align-items:center; }
.br-trick-cpu, .br-trick-human { display:flex; justify-content:center; }
.br-trick-slot { width:var(--br-card-w); height:var(--br-card-h); border:1.5px dashed rgba(57,255,133,.2); border-radius:8px; }

.br-trump-wrap { display:flex; flex-direction:column; align-items:center; gap:4px; }
.br-trump-label { font-size:.72rem; color:var(--text-muted); text-align:center; }
.br-trump-card .br-card { transform:rotate(-90deg); }
.br-deck-count { font-size:.75rem; color:var(--text-muted); text-align:center; margin-top:2px; }
.br-deck-empty { color:#ef4444; }

.br-msg { text-align:center; font-size:.9rem; padding:8px 12px; border-radius:8px; background:var(--surface2); margin-top:6px; }
.br-msg-win  { background:rgba(57,255,133,.15); color:var(--accent-bright); font-weight:700; }
.br-msg-lose { background:rgba(239,68,68,.12); color:#fca5a5; font-weight:700; }
.br-msg-tie  { background:rgba(251,191,36,.12); color:#fbbf24; font-weight:700; }

.br-menu { display:flex; flex-direction:column; align-items:center; gap:20px; padding:32px 16px; text-align:center; }
.br-menu-title { font-family:var(--font-display); font-size:2.2rem; font-weight:800; margin:0; }
.br-menu-sub { color:var(--text-muted); font-size:.95rem; margin:0; }
.br-rules { font-size:.82rem; color:var(--text-muted); background:var(--surface2); border:1px solid var(--border); border-radius:10px; padding:12px 16px; max-width:420px; line-height:1.6; text-align:left; }
.br-diff-select { display:flex; gap:12px; flex-wrap:wrap; justify-content:center; }
.br-diff-btn { background:var(--surface2); border:1px solid var(--border2); color:var(--text); border-radius:10px; padding:.65rem 1.5rem; font-size:.9rem; font-weight:700; cursor:pointer; transition:border-color .15s,color .15s; font-family:var(--font-display); letter-spacing:.04em; }
.br-diff-btn:hover { border-color:var(--accent-bright); color:var(--accent-bright); }
.br-btn { background:var(--surface2); border:1px solid var(--border2); color:var(--text); border-radius:10px; padding:.55rem 1.3rem; font-size:.88rem; font-weight:700; cursor:pointer; transition:border-color .15s; }
.br-btn:hover { border-color:var(--accent-bright); color:var(--accent-bright); }
.br-btn-sec { opacity:.7; }

/* ── Wordle ──────────────────────────────────────────────────────────────────── */
.wl-wrap { display:flex; flex-direction:column; align-items:center; gap:14px; max-width:420px; margin:0 auto; padding:16px 8px; }
.wl-header { display:flex; align-items:center; justify-content:space-between; width:100%; }
.wl-title { font-family:var(--font-display); font-size:1.6rem; font-weight:800; margin:0; }
.wl-title-es { font-size:1rem; color:var(--accent-bright); }
.wl-new-btn { background:var(--surface2); border:1px solid var(--border2); color:var(--text); border-radius:8px; padding:.4rem .9rem; font-size:.82rem; font-weight:600; cursor:pointer; }
.wl-new-btn:hover { border-color:var(--accent-bright); color:var(--accent-bright); }

.wl-grid { display:flex; flex-direction:column; gap:5px; }
.wl-row { display:flex; gap:5px; }
.wl-cell {
  width:56px; height:56px;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-size:1.5rem; font-weight:800;
  border:2px solid var(--border2); border-radius:4px;
  background:var(--surface2); color:var(--text);
  text-transform:uppercase;
  transition:border-color .1s;
}
@media(max-width:380px) { .wl-cell{width:46px;height:46px;font-size:1.2rem;} .wl-row{gap:4px;} .wl-grid{gap:4px;} }
.wl-cell.wl-filled { border-color:var(--accent-bright); }
.wl-cell.wl-hit  { background:#166534; border-color:#166534; color:#fff; }
.wl-cell.wl-near { background:#92400e; border-color:#92400e; color:#fff; }
.wl-cell.wl-miss { background:#374151; border-color:#374151; color:#9ca3af; }
.wl-cell.wl-empty { border-style:dashed; opacity:.4; }
.wl-row.wl-shake { animation:wlShake .45s ease both; }
@keyframes wlShake {
  0%,100%{transform:translateX(0)} 15%{transform:translateX(-8px)} 30%{transform:translateX(8px)} 45%{transform:translateX(-6px)} 60%{transform:translateX(6px)} 75%{transform:translateX(-4px)} 90%{transform:translateX(4px)}
}

.wl-msg { font-size:.95rem; font-weight:600; padding:8px 16px; border-radius:8px; text-align:center; }
.wl-msg-win  { background:rgba(57,255,133,.15); color:var(--accent-bright); }
.wl-msg-lose { background:rgba(239,68,68,.12); color:#fca5a5; }

.wl-keyboard { display:flex; flex-direction:column; gap:6px; align-items:center; width:100%; }
.wl-kb-row { display:flex; gap:5px; }
.wl-key {
  min-width:34px; height:52px;
  background:var(--surface2); border:1px solid var(--border2);
  color:var(--text); border-radius:6px; font-size:.85rem; font-weight:700;
  cursor:pointer; padding:0 4px;
  transition:background .15s,color .15s;
}
.wl-key:hover { border-color:var(--accent-bright); }
.wl-key-wide { min-width:52px; font-size:.8rem; }
.wl-key-hit  { background:#166534; border-color:#166534; color:#fff; }
.wl-key-near { background:#92400e; border-color:#92400e; color:#fff; }
.wl-key-miss { background:#374151; border-color:#374151; color:#6b7280; }

.wl-hint { font-size:.72rem; color:var(--text-muted); margin:0; text-align:center; }

.wl-toast {
  position:fixed; top:72px; left:50%; transform:translateX(-50%) translateY(-8px);
  background:var(--surface); border:1px solid var(--border2); color:var(--text);
  padding:.45rem 1.1rem; border-radius:8px; font-size:.85rem; font-weight:600;
  opacity:0; pointer-events:none; transition:opacity .2s,transform .2s; z-index:200;
}
.wl-toast.wl-toast-show { opacity:1; transform:translateX(-50%) translateY(0); }

/* Log panel */
.tt-log { display:none; position:fixed; bottom:60px; right:16px; width:min(340px,90vw);
  background:var(--surface); border:1px solid var(--border2); border-radius:12px;
  box-shadow:0 8px 32px rgba(0,0,0,.5); z-index:100; overflow:hidden; }
.tt-log.tt-log-visible { display:flex; flex-direction:column; }
.tt-log-hdr { display:flex; align-items:center; justify-content:space-between; padding:8px 14px; border-bottom:1px solid var(--border); }
.tt-log-body { padding:10px 14px; max-height:220px; overflow-y:auto; font-size:.78rem; color:var(--text-muted); display:flex; flex-direction:column; gap:3px; }

/* Menu */
.tt-menu-inner { display:flex; flex-direction:column; align-items:center; gap:18px; text-align:center; }
.tt-title { font-family:var(--font-display); font-size:2.2rem; font-weight:800; color:var(--text); margin:0; }
.tt-subtitle { color:var(--text-muted); margin:0; font-size:.95rem; }
.tt-last-result { background:var(--surface2); border:1px solid var(--border); border-radius:10px; padding:10px 18px; }
.tt-result-summary { color:var(--text-muted); font-size:.85rem; margin:0; }

/* ── Card-game flash fix: containers keep their bg while innerHTML is replaced ── */
#tute-game   { background: var(--tt-felt2); border-radius: 14px; }
#brisca-game { background: var(--surface); }

/* ── Trick collection: cards drift toward the winner's side before clearing ──── */
.tt-trick-area.tt-collect-up   { animation: ttCollectUp   .4s ease-in forwards; }
.tt-trick-area.tt-collect-down { animation: ttCollectDown .4s ease-in forwards; }
@keyframes ttCollectUp   { to { transform: translateY(-64px) scale(.66); opacity: 0; } }
@keyframes ttCollectDown { to { transform: translateY( 64px) scale(.66); opacity: 0; } }
.br-trick-area.br-collect-up   { animation: brCollectUp   .4s ease-in forwards; }
.br-trick-area.br-collect-down { animation: brCollectDown .4s ease-in forwards; }
@keyframes brCollectUp   { to { transform: translateY(-54px) scale(.66); opacity: 0; } }
@keyframes brCollectDown { to { transform: translateY( 54px) scale(.66); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tt-trick-area.tt-collect-up, .tt-trick-area.tt-collect-down,
  .br-trick-area.br-collect-up, .br-trick-area.br-collect-down { animation: none; opacity: 0; }
}

/* ── Pokémon Ayudamon ─────────────────────────────────────────────────────── */
.pkmn-two-col { display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; }
.pkmn-col { display:flex; flex-direction:column; min-width:0; }
.pkmn-col-hdr { font-size:1rem; font-weight:700; color:var(--text); margin-bottom:10px; padding-bottom:8px; border-bottom:2px solid var(--border2); }

.pkmn-team-grid { display:flex; flex-direction:column; gap:10px; margin-bottom:12px; }
.pkmn-add-btn { background:var(--surface2); border:1px dashed var(--border2); border-radius:var(--radius); padding:10px 20px; cursor:pointer; color:var(--text-muted); font-size:.9rem; transition:all .15s; }
.pkmn-add-btn:hover { background:var(--border); color:var(--text); }

.pkmn-slot-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); }
.pkmn-slot-hdr { display:flex; align-items:center; gap:8px; padding:10px 12px; background:var(--surface2); border-bottom:1px solid var(--border); border-radius:var(--radius) var(--radius) 0 0; }

.pkmn-toggle-btn { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:.85rem; padding:2px 6px; border-radius:6px; flex-shrink:0; transition:transform .2s; }
.pkmn-toggle-btn:hover { background:var(--border); color:var(--text); }
.pkmn-toggle-btn.expanded { transform:rotate(180deg); }

.pkmn-mini-row { display:flex; align-items:center; gap:10px; padding:8px 12px; }
.pkmn-mini-spr { width:40px; height:40px; object-fit:contain; flex-shrink:0; }
.pkmn-mini-name { font-size:.85rem; font-weight:600; color:var(--text); flex-shrink:0; }
.pkmn-mini-types { display:flex; gap:4px; flex-wrap:wrap; }

.pkmn-search-wrap { position:relative; flex:1; }
.pkmn-search-inp { width:100%; background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:6px 10px; color:var(--text); font-size:.88rem; outline:none; }
.pkmn-search-inp:focus { border-color:var(--primary); }
.pkmn-sugg { position:absolute; top:100%; left:0; right:0; background:var(--surface); border:1px solid var(--border); border-radius:8px; z-index:100; max-height:200px; overflow-y:auto; box-shadow:0 8px 24px rgba(0,0,0,.4); }
.pkmn-sugg-item { padding:7px 12px; cursor:pointer; font-size:.88rem; }
.pkmn-sugg-item:hover { background:var(--surface2); }
.pkmn-sugg-es { color:var(--text-muted); font-size:.8rem; }

.pkmn-rm-btn { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:1rem; padding:2px 6px; border-radius:6px; flex-shrink:0; }
.pkmn-rm-btn:hover { background:rgba(239,68,68,.15); color:var(--danger); }

.pkmn-body { display:flex; gap:12px; padding:12px; }
.pkmn-sprite-col { display:flex; flex-direction:column; align-items:center; gap:6px; min-width:100px; }
.pkmn-sprite { width:90px; height:90px; object-fit:contain; }
.pkmn-sprite-ph { width:90px; height:90px; display:flex; align-items:center; justify-content:center; font-size:2.5rem; color:var(--border2); }
.pkmn-sprite-name { font-size:.75rem; color:var(--text-muted); text-align:center; }

.pkmn-stats-col { flex:1; min-width:0; }
.pkmn-stat-hdr { display:grid; grid-template-columns:40px 36px 1fr auto; gap:4px; font-size:.72rem; color:var(--text-muted); font-weight:700; margin-bottom:4px; text-transform:uppercase; letter-spacing:.04em; }
.pkmn-stat-row { display:grid; grid-template-columns:40px 36px 1fr auto; gap:4px; align-items:center; margin-bottom:3px; }
.pkmn-stat-nm { font-size:.78rem; font-weight:600; color:var(--text-muted); }
.pkmn-stat-val { font-size:.82rem; font-weight:700; font-family:var(--mono); text-align:right; }
.pkmn-stat-bar { height:8px; border-radius:4px; background:var(--border); overflow:hidden; }
.pkmn-stat-bar div { height:100%; border-radius:4px; }
.pkmn-stat-final { font-size:.82rem; font-family:var(--mono); color:var(--primary); font-weight:700; text-align:right; min-width:32px; }

.pkmn-type-badge { display:inline-block; padding:2px 8px; border-radius:20px; color:#fff; font-size:.72rem; font-weight:700; letter-spacing:.04em; }

.pkmn-config { padding:10px 12px; border-top:1px solid var(--border); background:var(--surface2); }
.pkmn-config--opp { background:transparent; padding:6px 12px 2px; }
.pkmn-cfg-row { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:10px; align-items:flex-end; }
.pkmn-cfg-field { display:flex; flex-direction:column; gap:4px; }
.pkmn-cfg-field--wide { flex:1; min-width:140px; }
.pkmn-cfg-field label { font-size:.72rem; color:var(--text-muted); font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.pkmn-ability-desc-box { flex:2; min-width:160px; align-self:flex-end; padding-bottom:4px; }
.pkmn-ability-desc { font-size:.75rem; color:var(--text-muted); line-height:1.35; font-style:italic; display:block; min-height:1.2em; }
.pkmn-select { background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:5px 8px; color:var(--text); font-size:.82rem; }
.pkmn-num-inp { background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:5px 8px; color:var(--text); font-size:.82rem; width:64px; }

.pkmn-evivs { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.pkmn-eviv-box { background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:8px; }
.pkmn-eviv-lbl { font-size:.72rem; color:var(--text-muted); }
.pkmn-stat-inp-row { display:flex; gap:6px; flex-wrap:wrap; margin-top:4px; }
.pkmn-stat-inp-col { display:flex; flex-direction:column; align-items:center; gap:2px; }
.pkmn-stat-inp-col .pkmn-num-inp { width:54px; text-align:center; padding:4px; }

.pkmn-empty { padding:20px; text-align:center; color:var(--text-muted); font-size:.9rem; }

.pkmn-moves-section { padding:10px 12px; border-top:1px solid var(--border); }
.pkmn-moves-title { font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); margin-bottom:8px; }
.pkmn-moves-grid { display:flex; flex-direction:column; gap:6px; }
.pkmn-move-row { display:flex; align-items:center; gap:6px; }
.pkmn-move-inp { font-size:.82rem; padding:4px 8px; }
.pkmn-move-type { font-size:.68rem; flex-shrink:0; }
.pkmn-move-power { font-size:.78rem; font-family:var(--mono); color:var(--text-muted); min-width:28px; text-align:right; flex-shrink:0; }
.pkmn-move-cat { font-size:.8rem; flex-shrink:0; width:18px; text-align:center; }
.pkmn-move-cat-physical { color:#e2794a; }
.pkmn-move-cat-special  { color:#6c9ddd; }
.pkmn-move-cat-status   { color:var(--text-muted); }

.pkmn-analysis { display:flex; flex-direction:column; gap:16px; }
.pkmn-mu-vs-section { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.pkmn-mu-vs-hdr { display:flex; align-items:center; gap:10px; padding:10px 14px; background:var(--surface2); border-bottom:1px solid var(--border); flex-wrap:wrap; }
.pkmn-mu-vs-spr { width:52px; height:52px; object-fit:contain; flex-shrink:0; }
.pkmn-mu-vs-title { font-size:1rem; font-weight:700; }
.pkmn-mu-cards { display:flex; flex-direction:column; }
.pkmn-mu-card { padding:12px 14px; border-bottom:1px solid var(--border); }
.pkmn-mu-card:last-of-type { border-bottom:none; }
.pkmn-mu-card-great { border-left:3px solid #22c55e; }
.pkmn-mu-card-good  { border-left:3px solid #86efac; }
.pkmn-mu-card-ok    { border-left:3px solid var(--border2); }
.pkmn-mu-card-bad   { border-left:3px solid #f59e0b; }
.pkmn-mu-card-bad2  { border-left:3px solid #ef4444; }
.pkmn-mu-card-hdr { display:flex; align-items:center; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.pkmn-mu-card-spr { width:30px; height:30px; object-fit:contain; flex-shrink:0; vertical-align:middle; }
.pkmn-mu-card-name { font-weight:700; font-size:.9rem; }
.pkmn-mu-verdict { font-size:.72rem; font-weight:700; padding:2px 9px; border-radius:20px; white-space:nowrap; }
.pkmn-mu-verdict-great { background:rgba(34,197,94,.18); color:#4ade80; }
.pkmn-mu-verdict-good  { background:rgba(134,239,172,.15); color:#86efac; }
.pkmn-mu-verdict-ok    { background:rgba(148,163,184,.12); color:var(--text-muted); }
.pkmn-mu-verdict-bad   { background:rgba(245,158,11,.18); color:#fbbf24; }
.pkmn-mu-verdict-bad2  { background:rgba(239,68,68,.18); color:#f87171; }
.pkmn-mu-reasons { margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:5px; }
.pkmn-mu-reasons li { font-size:.82rem; color:var(--text); line-height:1.45; }
.pkmn-mu-best-banner { padding:9px 14px; background:rgba(99,102,241,.08); border-top:1px solid rgba(99,102,241,.18); font-size:.82rem; color:var(--text-muted); display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.pkmn-mu-best-banner strong { color:var(--text); }
.pkmn-summary-section { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; display:flex; flex-direction:column; gap:12px; }
.pkmn-summary-title { font-size:.9rem; font-weight:700; margin-bottom:2px; }
.pkmn-summary-row { font-size:.82rem; display:flex; align-items:flex-start; gap:8px; flex-wrap:wrap; }
.pkmn-summary-row-label { font-weight:600; white-space:nowrap; color:var(--text-muted); min-width:160px; }

.pkmn-options-bar { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:14px; padding:10px 14px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); }
.pkmn-battle-tabs { display:flex; gap:6px; }
.pkmn-battle-tab { padding:5px 14px; border-radius:20px; border:1px solid var(--border2); background:transparent; color:var(--text-muted); font-size:.82rem; cursor:pointer; transition:background .15s,color .15s,border-color .15s; }
.pkmn-battle-tab:hover { background:var(--surface2); color:var(--text); }
.pkmn-battle-tab.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.pkmn-locke-tab { margin-left:6px; }
.pkmn-locke-tab.active { background:#7c3aed; color:#fff; border-color:#7c3aed; }
.pkmn-rlocke-tab.active { background:#ea580c; color:#fff; border-color:#ea580c; }
.pkmn-slotmode-bar { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:8px 12px; border-top:1px solid var(--border); background:var(--surface); border-radius:0 0 10px 10px; }
.pkmn-slotmode-label { font-size:.72rem; color:var(--text-muted); font-weight:600; white-space:nowrap; }
.pkmn-slotmode-btn { padding:3px 10px; border-radius:20px; border:1px solid var(--border2); background:transparent; color:var(--text-muted); font-size:.75rem; cursor:pointer; transition:background .15s,color .15s,border-color .15s; white-space:nowrap; }
.pkmn-slotmode-btn:hover { background:var(--surface2); color:var(--text); }
.pkmn-slotmode-btn.active { background:#7c3aed; color:#fff; border-color:#7c3aed; font-weight:600; }
.pkmn-slotmode-btn--random.active { background:#ea580c; color:#fff; border-color:#ea580c; }
.pkmn-slotmode-hint { font-size:.7rem; color:var(--text-muted); font-style:italic; margin-left:4px; }
.pkmn-slotmode-hint--off { opacity:.5; }
.pkmn-unknown-badge { font-size:.72rem; padding:2px 8px; border-radius:20px; background:#7c3aed22; color:#7c3aed; border:1px solid #7c3aed55; white-space:nowrap; }
.pkmn-unknown-badge--random { background:#ea580c22; color:#ea580c; border-color:#ea580c55; }
.pkmn-iv-group { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-left:auto; }
.pkmn-iv-toggle { display:flex; align-items:center; gap:6px; cursor:pointer; font-size:.82rem; color:var(--text-muted); user-select:none; }
.pkmn-iv-toggle input[type=checkbox] { accent-color:var(--accent); width:15px; height:15px; cursor:pointer; }
.pkmn-iv-toggle span { white-space:nowrap; }
.pkmn-iv-subopts { display:flex; align-items:center; gap:10px; padding:4px 10px; background:var(--surface2); border-radius:20px; border:1px solid var(--border2); }
.pkmn-iv-radio { display:flex; align-items:center; gap:5px; cursor:pointer; font-size:.8rem; color:var(--text-muted); user-select:none; white-space:nowrap; }
.pkmn-iv-radio input[type=radio] { accent-color:var(--accent); width:14px; height:14px; cursor:pointer; }
.pkmn-iv-radio:has(input:checked) span { color:var(--text); font-weight:600; }
.pkmn-active-badge { font-size:.6rem; font-weight:700; padding:1px 6px; border-radius:20px; background:rgba(99,102,241,.2); color:var(--accent); text-transform:uppercase; letter-spacing:.04em; }
.pkmn-slot-active { border-color:rgba(99,102,241,.4) !important; box-shadow:0 0 0 2px rgba(99,102,241,.12); }
.pkmn-section-lbl { font-size:.75rem; font-weight:700; color:var(--accent); text-transform:uppercase; letter-spacing:.06em; padding:6px 4px 4px; }
.pkmn-bench-lbl { font-size:.75rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.06em; padding:10px 4px 4px; }
.pkmn-section-cards { display:flex; flex-direction:column; gap:10px; }
.pkmn-slot-ph { border:2px dashed var(--border2); border-radius:var(--radius); padding:18px; text-align:center; color:var(--text-muted); font-size:.82rem; opacity:.6; }
.pkmn-double-banner { padding:8px 14px; border-radius:var(--radius); background:rgba(99,102,241,.1); border:1px solid rgba(99,102,241,.25); font-size:.82rem; font-weight:600; color:var(--accent); text-align:center; }

@media (max-width:768px) {
  .pkmn-two-col { grid-template-columns:1fr; }
}
@media (max-width:576px) {
  .pkmn-body { flex-direction:column; }
  .pkmn-sprite-col { flex-direction:row; min-width:unset; justify-content:flex-start; }
  .pkmn-evivs { grid-template-columns:1fr; }
}
