.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;
}

/* ── OSM Slot ─────────────────────────────────────────────── */

.osm-slot-wrap {
  margin-bottom: 12px;
  max-width: 680px;
}

.osm-slot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

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

.osm-slot-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-primary);
  flex-shrink: 0;
}

.osm-slot-city {
  font-size: 0.72rem;
  color: var(--text-secondary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.osm-slot-open {
  font-size: 0.7rem;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.osm-slot-open:hover {
  text-decoration: underline;
}

.osm-map-container {
  width: 100%;
  height: 280px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Fix Leaflet popup inside dark themes */
.leaflet-popup-content-wrapper {
  background: var(--bg-light) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.leaflet-popup-tip {
  background: var(--bg-light) !important;
}

.leaflet-popup-content {
  margin: 8px 12px !important;
  font-size: 0.8rem !important;
}

/* Fix Leaflet controls inside dark themes */
.leaflet-control-zoom a {
  background: var(--bg-light) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg-hover) !important;
}

.leaflet-control-attribution {
  background: rgba(0,0,0,0.4) !important;
  color: var(--text-secondary) !important;
  font-size: 0.6rem !important;
}

.leaflet-control-attribution a {
  color: var(--primary) !important;
}

.password-result .password-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.password-result .password-value {
  font-size: 1.1rem;
  word-break: break-all;
  margin: 0.5rem 0;
}

.password-result .password-value code {
  background: var(--bg-hover);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.password-result .password-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
}

/* ── Timer & Stopwatch Plugin ────────────────────────────────────────────── */

.timer-widget {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 704px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  user-select: none;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 10px;
  border-bottom: 1px solid var(--border);
}

.timer-tabs {
  display: flex;
  gap: 4px;
}

.timer-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 20px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.timer-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.timer-tab--active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.timer-tab--active svg {
  color: var(--text-link);
}

.timer-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.timer-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}

.timer-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.timer-icon-btn[aria-pressed="true"] {
  color: var(--text-link);
}

/* ── Body / Circle ───────────────────────────────────────────────────────── */

.timer-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 20px;
}

.timer-circle-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
}

.timer-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  height: 200px;
}

.timer-track {
  stroke: var(--border-light);
}

.timer-progress {
  stroke: var(--text-link);
  /* circumference = 2π × 54 ≈ 339.29 */
  stroke-dasharray: 339.29;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  transition: stroke-dashoffset 0.85s linear;
}

.timer-progress--instant {
  transition: none;
}

.timer-display-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-display {
  font-size: 2.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  cursor: pointer;
  line-height: 1;
}

.timer-display:hover {
  opacity: 0.8;
}

/* Stopwatch mode: display is not editable */
.timer-widget[data-mode="stopwatch"] .timer-display {
  cursor: default;
}

.timer-widget[data-mode="stopwatch"] .timer-display:hover {
  opacity: 1;
}

.timer-display-input {
  font-size: 2rem;
  font-weight: 600;
  width: 120px;
  text-align: center;
  background: none;
  border: none;
  border-bottom: 2px solid var(--text-link);
  color: var(--text-primary);
  outline: none;
  padding: 0 4px;
  line-height: 1;
  font-family: inherit;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.timer-footer {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
}

.timer-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 1rem;
}

.timer-action-btn:hover {
  background: var(--bg-hover);
}

.timer-action-btn:active {
  background: var(--border);
}

.timer-action-btn + .timer-action-btn {
  border-left: 1px solid var(--border);
}

/* ── Fullscreen ──────────────────────────────────────────────────────────── */

.timer-widget--fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh;
  border-radius: 0;
  border: none;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.timer-widget--fullscreen .timer-header {
  width: 100%;
  max-width: 560px;
}

.timer-widget--fullscreen .timer-body {
  flex: 1;
  padding: 0;
}

.timer-widget--fullscreen .timer-circle-wrap {
  width: min(60vh, 60vw);
  height: min(60vh, 60vw);
}

.timer-widget--fullscreen .timer-svg {
  width: min(60vh, 60vw);
  height: min(60vh, 60vw);
}

.timer-widget--fullscreen .timer-display {
  font-size: clamp(2rem, 8vw, 5rem);
}

.timer-widget--fullscreen .timer-footer {
  width: 100%;
  max-width: 560px;
  border-radius: 0 0 14px 14px;
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.header-link {
  line-height: 0;
}

.apps-pocket-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-left: auto;
}

.apps-pocket-launcher {
  background: transparent;
  border: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--text-secondary)
}

.apps-pocket-launcher:hover {
  color: var(--text-primary);
}

#results-header .apps-pocket-launcher {
  margin-left: auto;
}

@media (max-width: 767.98px) {
  #results-header .apps-pocket-launcher {
    position: absolute;
    top: 1rem;
    right: 3.25rem;
    margin-left: 0;
  }
}

.apps-pocket-panel {
  position: fixed;
  z-index: 9999;
  width: min(320px, calc(100vw - 16px));
  max-height: min(70vh, 480px);
  overflow: auto;
  background: var(--bg-light);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 12px;
}

.apps-pocket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.apps-pocket-title {
  font-weight: 600;
  color: var(--text-primary);
}

.apps-pocket-info-btn {
  all: unset;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
}

.apps-pocket-info-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.apps-pocket-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.apps-pocket-grid::-webkit-scrollbar {
  display: none;
}

.apps-pocket-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  text-align: center;
  transition: background 0.15s;
}

.apps-pocket-tile:hover {
  background: var(--bg-hover);
}

.apps-pocket-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.apps-pocket-tile-img {
  width: 80%;
  object-fit: contain;
}

.apps-pocket-tile-fallback {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
  background: var(--bg);
}

.apps-pocket-tile-label {
  font-size: 12px;
  color: var(--text-primary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apps-pocket-empty {
  grid-column: 1 / -1;
  padding: 16px 8px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

.apps-pocket-bang {
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
  color: var(--text-primary);
}

.apps-pocket-modal {
  width: 640px;
}

.apps-pocket-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 2px;
}

.apps-pocket-rows::-webkit-scrollbar {
  display: none;
}

.apps-pocket-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.apps-pocket-row-add {
  align-self: flex-start;
}

.apps-pocket-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.apps-pocket-output {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  resize: vertical;
  min-height: 160px;
}

.currency-widget {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  max-width: 704px;
  color: var(--text-primary);
  padding: 0 0 8px 0;
}

.currency-header {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
  line-height: 1.4;
}

.currency-result {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.currency-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
  opacity: 0.75;
  margin-bottom: 18px;
}

.currency-inputs {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
}

.currency-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
}

.currency-from-input,
.currency-to-input {
  flex: 1;
  min-width: 0;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  -moz-appearance: textfield;
}

.currency-from-input::-webkit-outer-spin-button,
.currency-from-input::-webkit-inner-spin-button,
.currency-to-input::-webkit-outer-spin-button,
.currency-to-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.currency-select-wrap {
  position: relative;
  flex-shrink: 0;
}

.currency-select-wrap::after {
  content: "▾";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1;
}

.currency-from-select,
.currency-to-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-hover, rgba(128, 128, 128, 0.08));
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 5px 26px 5px 9px;
  cursor: pointer;
  outline: none;
  max-width: 210px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
}

.currency-from-select:hover,
.currency-to-select:hover {
  border-color: var(--text-secondary);
}

.currency-loading .currency-from-select,
.currency-loading .currency-to-select {
  opacity: 0.5;
  pointer-events: none;
}

.currency-loading .currency-to-input {
  opacity: 0.4;
}

.currency-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0;
}

.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);
  }
}

/* ── 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;
}

.bang-ac-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--bg-secondary, var(--bg, #1e1e2e));
  border: 1px solid var(--border-light, rgba(255,255,255,0.1));
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  overflow: hidden;
  font-family: var(--font-sans, sans-serif);
}

.bang-ac-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border-light, rgba(255,255,255,0.06));
}

.bang-ac-item:last-child {
  border-bottom: none;
}

.bang-ac-item:hover,
.bang-ac-item.bang-ac-active {
  background: var(--primary-light, rgba(139,92,246,0.12));
}

.bang-ac-trigger {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: var(--primary, #cba6f7);
  min-width: 90px;
  flex-shrink: 0;
}

.bang-ac-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #cdd6f4);
  flex-shrink: 0;
}

.bang-ac-desc {
  font-size: 0.73rem;
  color: var(--text-secondary, #a6adc8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ── Calculator Plugin ─────────────────────────────────────────────────────── */

.calc-widget {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 704px;
  padding: 0 0 4px 0;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  user-select: none;
  overflow: hidden;
}

/* Display */
.calc-display {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px 16px 10px 16px;
  min-height: 72px;
  gap: 8px;
  border: 1px solid var(--border-light);
  border-radius: 13px;
}

.calc-history-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 6px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  line-height: 0;
  transition:
    color 0.15s,
    background 0.15s;
}

.calc-history-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.calc-display-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 1;
  min-width: 0;
  gap: 2px;
}

.calc-expr {
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: right;
  word-break: break-all;
  min-height: 1.4em;
  max-height: 3em;
  overflow: hidden;
  line-height: 1.4;
}

.calc-result {
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--text-primary);
  text-align: right;
  line-height: 1.1;
  word-break: break-all;
}

.calc-result--small {
  font-size: 1.6rem;
}

.calc-result--error {
  font-size: 1.4rem;
  color: var(--text-secondary);
}

/* History Panel */
.calc-history-panel {
  padding: 6px 0;
  max-height: 160px;
  overflow-y: auto;
}

.calc-history-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 12px 16px;
}

.calc-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 16px;
  cursor: pointer;
  transition: background 0.12s;
  gap: 12px;
}

.calc-history-item:hover {
  background: var(--border-light);
}

.calc-history-expr {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-history-val {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Grid */
.calc-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.5rem;
  border: 1px solid var(--border-light);
  background-color: var(--bg-light);
  border-radius: 13px;
}

.calc-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* Buttons */
.calc-btn {
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 400;
  height: 42px;
  padding: 0 4px;
  transition:
    background 0.12s,
    filter 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
}

button.calc-btn {
  border-radius: 13px;
}

.button-group button.calc-btn:first-child {
  border-radius: 13px 0 0 13px;
}
.button-group button.calc-btn:last-child {
  border-radius: 0 13px 13px 0;
}

.calc-row .button-group {
  grid-column: span 2;
}

.calc-btn sup {
  font-size: 0.6em;
  line-height: 1;
}

.calc-btn--digit {
  background: var(--bg-hover, var(--border-light));
  color: var(--text-primary);
}

.calc-btn--digit:hover {
  filter: brightness(1.15);
}

.calc-btn--digit:active {
  filter: brightness(0.9);
}

.calc-btn--sci {
  background: transparent;
  color: var(--text-secondary);
}

.calc-btn--sci:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.calc-btn--sci:active {
  filter: brightness(0.85);
}

.calc-btn--op {
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.calc-btn--op:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.calc-btn--op:active {
  filter: brightness(0.85);
}

.calc-btn--clear {
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
}

.calc-btn--clear:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.calc-btn--equals {
  background: var(--text-link);
  color: #202124;
  font-size: 1.1rem;
  font-weight: 500;
}

.calc-btn--equals:hover {
  background: var(--text-link-hover);
}

.calc-btn--equals:active {
  background: var(--text-link-active);
}

/* Deg/Rad toggle */
.calc-btn--toggle {
  background: transparent;
  color: var(--text-secondary);
  border-radius: 32px;
  font-size: 0.82rem;
}

.calc-btn--toggle.calc-btn--active {
  background: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 500;
}

.calc-btn--toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Inv active */
.calc-btn--inv {
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.calc-btn--inv:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.calc-btn--inv.calc-btn--active {
  background: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 500;
}

/* Footer */
.calc-footer {
  text-align: center;
  padding: 6px 0 2px;
}

.calc-footer-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  transition: color 0.15s;
}

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

.custom-logo-img {
  display: block;
  max-height: 300px;
  max-width: 500px;
  width: auto;
  object-fit: contain;
}

.custom-logo-img--search {
  max-width: 300px;
}

.custom-logo-upload-ui {
  padding: 12px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-logo-preview-wrap {
  display: flex;
  align-items: center;
  min-height: 60px;
}

.custom-logo-preview {
  max-height: 300px;
  max-width: 500px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border-light, rgba(255,255,255,0.1));
  background: var(--bg-tertiary, rgba(0,0,0,0.2));
  padding: 4px 8px;
}

.custom-logo-none {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}

.custom-logo-actions {
  display: flex;
  gap: 8px;
}

.custom-logo-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-light, rgba(255,255,255,0.15));
  background: var(--bg-secondary, #1e1e2e);
  color: var(--text-primary, #cdd6f4);
  transition: background 0.15s;
  user-select: none;
}

.custom-logo-btn:hover {
  background: var(--primary-light, rgba(139,92,246,0.15));
}

.custom-logo-btn--remove {
  color: var(--danger, #f38ba8);
  border-color: var(--danger-light, rgba(243,139,168,0.25));
}

.custom-logo-btn--remove:hover {
  background: rgba(243,139,168,0.12);
}

.custom-logo-status {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
  min-height: 1em;
}

/* ── 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; }
}
