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

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

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

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

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

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