.wiki-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  overflow: hidden;
}

.wiki-thumb {
  border-radius: 13px;
  max-width: 40%;
  float: right;
  margin-left: 1rem;
  margin-bottom: 1rem;
  background: var(--border-color);
}

.wiki-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wiki-title {
  display: block;
  font-size: var(--font-large);
  font-weight: 600;
  color: var(--link-color);
  text-decoration: none;
  line-height: 1.1;
}

.wiki-title:hover {
  color: var(--link-hover, var(--link-color));
  text-decoration: underline;
}

.wiki-desc {
  margin-bottom: 1rem;
  font-size: var(--font-small);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
}

.wiki-extract {
  font-size: var(--font-medium);
  color: var(--text-primary);
  display: inline;
}

.wiki-footer-link {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.wiki-footer-link:hover {
  color: var(--link-color);
  text-decoration: underline;
}

/* ── Reddit Slot Panel ─────────────────────────────────────── */

.rslot-panel {
  padding: 4px 0 12px;
  margin-bottom: 4px;
  max-width: 680px;
}

.rslot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.rslot-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.rslot-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-primary);
}

/* Post card */
.rslot-post {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  margin-bottom: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.rslot-post:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.rslot-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rslot-post-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.rslot-post-stats {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.rslot-post-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.45;
}

/* Comments label */
.rslot-comments-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Comments grid — scrollable on mobile */
.rslot-comments-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 600px) {
  .rslot-comments-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .rslot-comments-row::-webkit-scrollbar {
    display: none;
  }
  .rslot-comment {
    flex: 0 0 85%;
    scroll-snap-align: start;
    min-width: 0;
  }
}

.rslot-comment {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 13px 15px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.rslot-comment:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.rslot-comment--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: default;
}

.rslot-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rslot-comment-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.rslot-comment-score {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
}

.rslot-comment-body {
  font-size: 14px;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 480px) {
  .rslot-comments-row { grid-template-columns: 1fr; }
}

/* ── Translate Command ───────────────────────────────────── */
.trc-wrap {
  max-width: 680px;
  margin-bottom: 12px;
  font-family: var(--font-sans, sans-serif);
}

.trc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.trc-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.trc-card {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.trc-card:focus-within {
  border-color: var(--primary);
}

.trc-card-top {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
  display: flex;
  align-items: center;
}

.trc-select {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 100%;
}

.trc-select:focus { outline: none; }

.trc-card-body {
  padding: 14px 16px;
}

.trc-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--text-primary);
  resize: none;
  height: 90px;
  font-family: var(--font-sans, sans-serif);
  line-height: 1.7;
}

.trc-textarea::placeholder { color: var(--text-secondary); }
.trc-textarea.trc-result { color: var(--text-secondary); }

.trc-card-footer {
  display: flex;
  gap: 6px;
  padding: 0 14px 12px;
  justify-content: flex-end;
}

.trc-foot-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  padding: 4px 11px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-sans, sans-serif);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.trc-foot-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.trc-action {
  display: flex;
  justify-content: center;
  margin: 6px 0;
}

.trc-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 22px;
  border-radius: 9px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans, sans-serif);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.trc-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.trc-btn:active { transform: scale(0.97); }

.trc-btn.trc-loading {
  opacity: 0.6;
  pointer-events: none;
}

.trc-btn.trc-loading .trc-btn-arrow {
  animation: trc-spin 0.7s linear infinite;
}

@keyframes trc-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Result fade-in */
.trc-result {
  animation: trc-fadein 0.35s ease;
}

@keyframes trc-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Copy success flash */
.trc-foot-btn.trc-copied {
  color: var(--success, #4ade80);
  border-color: var(--success, #4ade80);
}

/* ── Custom dropdown ─────────────────────────────────────── */
.trc-dd {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  width: 100%;
}

.trc-dd-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex: 1;
}

.trc-dd-arrow {
  color: var(--text-secondary);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.trc-dd-open .trc-dd-arrow {
  transform: rotate(180deg);
}

.trc-dd-menu {
  display: none;
  position: fixed;
  min-width: 160px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  z-index: 9999;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

.trc-dd-open .trc-dd-menu {
  display: block;
  animation: trc-dd-in 0.15s ease;
}

@keyframes trc-dd-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.trc-dd-item {
  padding: 7px 10px;
  font-size: 0.78rem;
  color: var(--text-primary);
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.1s;
}

.trc-dd-item:hover {
  background: var(--bg-hover);
}

.trc-dd-item-active {
  color: var(--primary);
  font-weight: 600;
}

.trc-auto-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-style: italic;
}

/* Arrow on left side — reorder flex */
.trc-dd {
  flex-direction: row;
}

/* ── Weather Command ─────────────────────────────────────── */
.wxs-wrap {
  --wxs-sun: #f59e0b;
  max-width: 680px;
  margin-bottom: 12px;
  font-family: var(--font-sans, sans-serif);
}

.wxs-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}

.wxs-city {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.wxs-temp-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  line-height: 1;
}

.wxs-num {
  font-size: 64px;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: -2px;
}

.wxs-deg {
  font-size: 28px;
  font-weight: 300;
  color: var(--text-secondary);
  padding-bottom: 10px;
}

.wxs-desc {
  font-size: 14px;
  color: var(--text-primary);
  margin-top: 8px;
}

.wxs-feels {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* Animated icon */
.wxs-icon-wrap {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  position: relative;
}

.wxs-icon-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.wxs-icon-in  { opacity: 1; transform: scale(1); }
.wxs-icon-out { opacity: 0; transform: scale(0.82); }

/* Float animation */
.wxs-ani-float { animation: wxs-float 4s ease-in-out infinite; }
.wxs-ani-sun   { animation: wxs-float 4s ease-in-out infinite; }
@keyframes wxs-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px)} }
@keyframes wxs-spin  { from{transform:rotate(0)} to{transform:rotate(360deg)} }
@keyframes wxs-fadein{ from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:translateY(0)} }

/* Rain drops */
.wxs-drop {
  position: absolute;
  width: 2px;
  border-radius: 2px;
  background: #60a5fa;
  opacity: 0.8;
  animation: wxs-rain 1.1s linear infinite;
}
@keyframes wxs-rain {
  0%   { transform: translateY(-2px); opacity: 0; }
  50%  { opacity: 0.8; }
  100% { transform: translateY(18px); opacity: 0; }
}

/* Snow flakes */
.wxs-flake {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #bfdbfe;
  animation: wxs-snow 1.4s linear infinite;
}
@keyframes wxs-snow {
  0%   { transform: translateY(-2px); opacity: 0; }
  50%  { opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* Lightning bolt */
.wxs-bolt { animation: wxs-flash 2s ease-in-out infinite; }
@keyframes wxs-flash { 0%,100%{opacity:.45} 50%{opacity:1} }

/* Stats */
.wxs-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.wxs-st { background: var(--bg); padding: 11px 13px; }

.wxs-st-l {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.wxs-st-v {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Sunrise/sunset */
.wxs-sun-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 13px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

.wxs-sun-bar {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  position: relative;
}

.wxs-sun-fill {
  height: 100%;
  background: #f59e0b;
  opacity: 0.7;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.wxs-sun-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #f59e0b;
  border-radius: 50%;
  transition: left 0.6s ease;
}

.wxs-sun-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Forecast label */
.wxs-fl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.wxs-fl-hint {
  font-size: 9px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-secondary);
}

/* Day cards */
.wxs-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.wxs-day {
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 9px 4px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.wxs-day-active {
  border-color: var(--primary);
  background: var(--bg-light);
}

.wxs-day-name {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.wxs-day-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 28px;
  margin-bottom: 5px;
}

.wxs-day-hi {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.wxs-day-lo {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Hourly panel */
.wxs-hourly {
  margin-top: 8px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

.wxs-hourly-open {
  max-height: 80px;
  opacity: 1;
}

.wxs-hourly-scroll {
  display: flex;
  overflow-x: auto;
  padding: 10px 12px;
  gap: 14px;
  scrollbar-width: none;
}

.wxs-hourly-scroll::-webkit-scrollbar { display: none; }

.wxs-h { flex-shrink: 0; text-align: center; min-width: 36px; }
.wxs-h-time { font-size: 10px; color: var(--text-secondary); margin-bottom: 3px; }
.wxs-h-temp { font-size: 12px; font-weight: 500; color: var(--text-primary); }

@media (max-width: 500px) {
  .wxs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wxs-days  { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wxs-num   { font-size: 52px; }
}

/* ── Currency Slot Animations ───────────────────────── */

@keyframes cxs-slide-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cxs-fade-scale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes cxs-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(74, 222, 128, 0); }
}

@keyframes cxs-number-pop {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes cxs-accent-flash {
  0% { color: var(--text-secondary); }
  30% { color: var(--primary, #4ade80); text-shadow: 0 0 20px rgba(var(--primary-rgb, 74, 222, 128), 0.3); }
  100% { color: var(--text-secondary); }
}

/* ── Base ──────────────────────────────────────────── */

.cxs-wrap {
  max-width: 680px;
  margin-bottom: 16px;
  font-family: var(--font-sans, sans-serif);
  position: relative;
  animation: cxs-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cxs-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  animation: cxs-fade-scale 0.3s ease 0.1s both;
}

.cxs-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-primary);
  opacity: 0.9;
}

.cxs-main {
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cxs-main:hover {
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.cxs-row {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  gap: 14px;
  transition: background-color 0.2s ease;
}

.cxs-row:hover {
  background-color: rgba(255,255,255,0.02);
}

.cxs-flag {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.cxs-flag.changing {
  opacity: 0;
  transform: scale(0.8) rotate(-10deg);
}

.cxs-flag svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.cxs-input-wrap { flex: 1; min-width: 0; }

.cxs-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
  opacity: 0.8;
  transition: opacity 0.2s, color 0.2s;
}

.cxs-input-wrap:focus-within .cxs-label {
  opacity: 1;
  color: var(--primary, var(--text-primary));
}

.cxs-amount {
  width: 100%;
  font-size: 32px;
  font-weight: 300;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans, sans-serif);
  letter-spacing: -1px;
  padding: 0;
  transition: all 0.2s ease;
}

.cxs-amount:focus {
  transform: translateX(2px);
}

.cxs-amount::-webkit-inner-spin-button,
.cxs-amount::-webkit-outer-spin-button { -webkit-appearance: none; }
.cxs-amount[type=number] { -moz-appearance: textfield; }

.cxs-result {
  font-size: 32px;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: -1px;
  transition: all 0.3s ease;
  min-height: 40px;
  font-variant-numeric: tabular-nums;
}

.cxs-result.updating {
  animation: cxs-accent-flash 0.8s ease;
}

/* Currency buttons */
.cxs-cur-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  color: var(--text-primary);
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-sans, sans-serif);
  position: relative;
  overflow: hidden;
}

.cxs-cur-btn:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cxs-cur-btn:active {
  transform: translateY(0) scale(0.98);
}

.cxs-cur-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.cxs-cur-btn:active::after {
  width: 100px;
  height: 100px;
}

.cxs-cur-code {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
  transition: color 0.2s;
}

.cxs-cur-name {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
  transition: color 0.2s;
}

.cxs-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-light) 20%, var(--border-light) 80%, transparent);
  position: relative;
  margin: 4px 0;
}

.cxs-swap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--bg, #1a1a1a);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 2;
  padding: 0; 
}

.cxs-swap:hover {
  border-color: rgba(255,255,255,0.3);
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.cxs-swap:active {
  transform: translate(-50%, -50%) scale(0.92);
}

.cxs-swap-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 100%;
  height: 100%;
}

.cxs-swap.spinning .cxs-swap-inner {
  transform: rotate(180deg);
}

/* Rate bar */
.cxs-rate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-secondary);
  position: relative;
  overflow: hidden;
}

.cxs-rate-val {
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
}

.cxs-updated { 
  font-size: 10px; 
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cxs-updated::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--primary, #4ade80);
  border-radius: 50%;
  animation: cxs-pulse-glow 2s infinite;
  box-shadow: 0 0 0 0 rgba(var(--primary-rgb, 74, 222, 128), 0.4);
}

/* Quick amounts */
.cxs-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
  animation: cxs-fade-scale 0.3s ease 0.2s both;
}

.cxs-ql {
  font-size: 11px;
  color: var(--text-secondary);
  margin-right: 4px;
}

.cxs-q {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-sans, sans-serif);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cxs-q:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cxs-q:active {
  transform: translateY(0);
}

/* Popular pairs */
.cxs-pairs-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
  opacity: 0.8;
}

.cxs-pairs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  animation: cxs-fade-scale 0.3s ease 0.25s both;
}

.cxs-pair {
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255,255,255,0.02);
  position: relative;
  overflow: hidden;
}

.cxs-pair:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  z-index: 1;
}

.cxs-pair:active {
  transform: translateY(-1px) scale(0.98);
}

.cxs-pair-name {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  transition: color 0.2s;
}

.cxs-pair:hover .cxs-pair-name {
  color: var(--text-primary);
}

.cxs-pair-rate {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.2s;
  font-variant-numeric: tabular-nums;
}

/* Picker */
.cxs-picker {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-light, var(--bg));
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  z-index: 1000;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  display: none;
  opacity: 0;
  transform: scale(0.95) translateY(-10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cxs-picker.active {
  display: block;
  opacity: 1;
  transform: scale(1) translateY(0);
}

.cxs-picker-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  background: rgba(255,255,255,0.02);
}

.cxs-picker-search {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text-primary);
  font-family: var(--font-sans, sans-serif);
  transition: color 0.2s;
}

.cxs-picker-search::placeholder { 
  color: var(--text-secondary);
  opacity: 0.6;
}

.cxs-picker-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cxs-picker-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.cxs-picker-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
}

.cxs-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: cxs-fade-scale 0.2s ease both;
  opacity: 0;
  transform: translateX(-10px);
}

.cxs-picker-item:nth-child(1) { animation-delay: 0.02s; }
.cxs-picker-item:nth-child(2) { animation-delay: 0.04s; }
.cxs-picker-item:nth-child(3) { animation-delay: 0.06s; }
.cxs-picker-item:nth-child(4) { animation-delay: 0.08s; }
.cxs-picker-item:nth-child(5) { animation-delay: 0.10s; }
.cxs-picker-item:nth-child(6) { animation-delay: 0.12s; }

.cxs-picker-item:hover { 
  background: rgba(255,255,255,0.08);
  transform: translateX(4px);
}

.cxs-picker-item:active {
  transform: translateX(2px) scale(0.98);
}

.cxs-picker-flag { 
  width: 22px; 
  height: 22px; 
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.cxs-picker-item:hover .cxs-picker-flag {
  transform: scale(1.1) rotate(5deg);
}

.cxs-picker-flag svg {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.cxs-picker-code {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 42px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.cxs-picker-name {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.cxs-picker-item:hover .cxs-picker-name {
  color: var(--text-primary);
}

@media (max-width: 480px) {
  .cxs-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cxs-amount, .cxs-result { font-size: 26px; }
  .cxs-row { padding: 14px; }
}

.lyrics-widget {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--text-primary);
  max-width: 100%;
  width: 100%;
}

/* ── Header ─────────────────────────────────────────────── */
.lyrics-header {
  margin-bottom: 0.75rem;
}

.lyrics-heading {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* ── Track info ──────────────────────────────────────────── */
.lyrics-track-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.75rem;
}

.lyrics-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.lyrics-artist {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ── Lyrics lines ────────────────────────────────────────── */
.lyrics-preview,
.lyrics-full {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.lyrics-preview {
  margin-bottom: 0.5rem;
}

.lyrics-line {
  display: block;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-primary);
}

/* ── Expand toggle ───────────────────────────────────────── */
.lyrics-details {
  margin-bottom: 0.75rem;
}

.lyrics-show-all {
  font-size: 0.875rem;
  color: var(--link-color);
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.lyrics-show-all::-webkit-details-marker {
  display: none;
}

.lyrics-show-all::after {
  content: "›";
  font-size: 1rem;
  line-height: 1;
}

details[open] .lyrics-show-all::after {
  content: "‹";
}

.lyrics-full {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.75rem 0 0.25rem;
  border-top: 1px solid var(--border-light, var(--border-color));
  margin-top: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--text-secondary) transparent;
}

.lyrics-full::-webkit-scrollbar {
  width: 4px;
}

.lyrics-full::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  border-radius: 2px;
  opacity: 0.4;
}

/* ── Source attribution ──────────────────────────────────── */
.lyrics-source {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
}

.lyrics-source-link {
  color: var(--link-color);
  text-decoration: none;
}

.lyrics-source-link:hover {
  text-decoration: underline;
}

/* ── Loading / pending state ─────────────────────────────── */
.lyrics-widget--pending .lyrics-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-height: 2rem;
}

.lyrics-loading-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--link-color);
  flex-shrink: 0;
  animation: lyrics-pulse 1.2s ease-in-out infinite;
}

@keyframes lyrics-pulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

/* ── TMDB Slot Plugin ──────────────────────────────────────────────────────── */

.tmdb-result {
  width: 100%;
  color: var(--text-primary);
  padding: 0 0 4px;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
}

/* ── Image Combo (movie / TV): 1 large poster + 2 stacked backdrops ───────── */

.tmdb-img-combo {
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  overflow: hidden;
}

.tmdb-img-main {
  height: 100%;
}

.tmdb-img-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  height: 100%;
}

.tmdb-combo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--bg-light);
}

.tmdb-combo-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-light);
  border-radius: 6px;
}

.tmdb-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* ── Person: 3-column portrait grid ──────────────────────────────────────── */

.tmdb-person-grid,
.tmdb-img-combo {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-column: 1 / 3;
  gap: 0rem;
  margin-bottom: 1rem;
  border-radius: 13px;
  overflow: hidden;
  height: 300px;
}

.tmdb-person-photo {
  overflow: hidden;
  background: var(--bg-light);
  grid-template-columns: repeat(2, 1fr);
}
.tmdb-person-grid .tmdb-person-photo:nth-child(odd):last-child {
  grid-row: 1 / 3;
}

.tmdb-person-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tmdb-person-photo--empty {
  opacity: 0.15;
}

.tmdb-person-info,
.tmdb-info-block {
  grid-column: 3 / 5;
  padding-bottom: 0.25rem;
}

/* ── Info block ───────────────────────────────────────────────────────────── */

.tmdb-plot,
.tmdb-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 13px;
  background-color: var(--bg-light);
  border: 1px solid var(--border);
  overflow: hidden;
  justify-content: space-between;
}

.tmdb-info-block {
  margin-bottom: 0.75rem;
}

.tmdb-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.tmdb-year {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 1rem;
}

.tmdb-plot {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-primary);
}

.tmdb-ext-link {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--link-color, #1a73e8);
  text-decoration: none;
  margin-top: 0.25rem;
}

.tmdb-ext-link:hover {
  text-decoration: underline;
}

/* ── Metadata grid ────────────────────────────────────────────────────────── */

.tmdb-meta-grid {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tmdb-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
}

.tmdb-meta-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.tmdb-meta-value {
  font-size: 0.8125rem;
  color: var(--text-primary);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Cast horizontal scroll strip ────────────────────────────────────────── */

.tmdb-cast-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0;
  scrollbar-width: none;
}

.tmdb-cast-scroll::-webkit-scrollbar {
  display: none;
}

.tmdb-cast-strip {
  display: flex;
  gap: 0.5rem;
  width: max-content;
  padding: 0 0.25rem 0 0;
}

.tmdb-cast-card {
  flex: 0 0 auto;
  width: 5.5rem;
  background: var(--bg-light);
  border-radius: 13px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.tmdb-cast-photo-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tmdb-cast-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tmdb-cast-initial {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tmdb-cast-name {
  padding: 0.4rem 0.35rem 0.1rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tmdb-cast-char {
  padding: 0 0.35rem 0.4rem;
  font-size: 0.65rem;
  color: var(--text-secondary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Filmography scroll strip ─────────────────────────────────────────────── */

.tmdb-filmography-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0 0.5rem;
  margin-bottom: 0.75rem;
  scrollbar-width: none;
}

.tmdb-filmography-scroll::-webkit-scrollbar {
  display: none;
}

.tmdb-filmography-strip {
  display: flex;
  gap: 0.65rem;
  width: max-content;
}

.tmdb-film-card {
  flex: 0 0 auto;
  width: 6.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border-radius: 13px;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.tmdb-film-card:hover {
  transform: scale(1.03);
}

.tmdb-film-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 13px;
  overflow: hidden;
  background: var(--bg-light);
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tmdb-film-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tmdb-film-placeholder {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tmdb-film-title {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  padding: 0 0.2rem;
}

.tmdb-film-year {
  font-size: 0.67rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
  text-align: center;
}

/* ── Section heading ──────────────────────────────────────────────────────── */

.tmdb-section-heading {
  margin: 0.75rem 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

/* ── Accordion (seasons, cast) ────────────────────────────────────────────── */

.tmdb-accordion {
  margin-bottom: 0.4rem;
}

.tmdb-accordion-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.tmdb-accordion-summary::-webkit-details-marker {
  display: none;
}

.tmdb-accordion-summary::before {
  content: "\25B6";
  font-size: 0.55rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.tmdb-accordion[open] > .tmdb-accordion-summary::before {
  transform: rotate(90deg);
}

.tmdb-accordion-meta {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.tmdb-accordion-body {
  padding: 0 0 0.5rem 0.4rem;
}

/* ── Season detail row ────────────────────────────────────────────────────── */

.tmdb-season-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.tmdb-season-poster {
  flex-shrink: 0;
  width: 52px;
  border-radius: 13px;
  display: block;
}

.tmdb-season-info {
  flex: 1;
  min-width: 0;
}

.tmdb-season-overview {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */

.tmdb-tabs {
  position: relative;
}

.tmdb-tab-bar {
  display: flex;
  gap: 0.15rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--border-light);
}

.tmdb-tab-bar::-webkit-scrollbar {
  display: none;
}

.tmdb-tab-btn {
  all: unset;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0.45rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  margin-bottom: -1px;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.tmdb-tab-btn:hover {
  color: var(--text-primary);
}

.tmdb-tab-btn--active {
  color: var(--text-primary);
  border-bottom-color: var(--primary, #1a73e8);
}

/* ── Jellyfin card ────────────────────────────────────────────────────────── */

.tmdb-jf-wrap {
  margin-top: 0.75rem;
}

.tmdb-jf-card {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: 13px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-light);
  transition:
    border-color 0.15s,
    background 0.15s;
  max-width: 100%;
}

.tmdb-jf-card:hover {
  border-color: var(--primary, #1a73e8);
  background: var(--bg-hover);
}

.tmdb-jf-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  object-fit: contain;
}

.tmdb-jf-title {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.tmdb-jf-btn {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary, #1a73e8);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--primary, #1a73e8);
  border-radius: 4px;
  white-space: nowrap;
}

.wiki-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  overflow: hidden;
}

.wiki-thumb {
  border-radius: 13px;
  max-width: 40%;
  float: right;
  margin-left: 1rem;
  margin-bottom: 1rem;
  background: var(--border-color);
}

.wiki-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wiki-title {
  display: block;
  font-size: var(--font-large);
  font-weight: 600;
  color: var(--link-color);
  text-decoration: none;
  line-height: 1.1;
}

.wiki-title:hover {
  color: var(--link-hover, var(--link-color));
  text-decoration: underline;
}

.wiki-desc {
  margin-bottom: 1rem;
  font-size: var(--font-small);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
}

.wiki-extract {
  font-size: var(--font-medium);
  color: var(--text-primary);
  display: inline;
}

.wiki-footer-link {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.wiki-footer-link:hover {
  color: var(--link-color);
  text-decoration: underline;
}
