.math-widget {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg-light);
  max-width: 652px;
  color: var(--text-primary);
}

.math-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
}

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

.math-query {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.math-equals {
  font-size: 0.9rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

.math-result {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
/* Hide sidebar and expand main column when Maps tab is active */
body.maps-tab-active .results-sidebar {
  display: none !important;
}

body.maps-tab-active .results-layout {
  grid-template-columns: 1fr !important;
  display: block !important;
}

body.maps-tab-active .results-main {
  width: 100% !important;
  max-width: 100% !important;
}

/* Map container */
#maps-plugin-container {
  width: 100%;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-light);
}

#maps-plugin-map {
  width: 100%;
  height: 420px;
}

/* Leaflet popup theming */
#maps-plugin-map .leaflet-popup-content-wrapper {
  background: var(--bg-light);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: none;
  border-radius: 6px;
}

#maps-plugin-map .leaflet-popup-content a {
  color: var(--text-link);
}

#maps-plugin-map .leaflet-popup-tip {
  background: var(--bg-light);
}

#maps-plugin-map .leaflet-control-attribution {
  background: var(--bg-light);
  color: var(--text-secondary);
  font-size: 0.7rem;
}

#maps-plugin-map .leaflet-control-attribution a {
  color: var(--text-link);
}

.maps-no-results {
  padding: 1.5rem;
  color: var(--text-secondary);
  text-align: center;
}

@media (max-width: 600px) {
  #maps-plugin-map {
    height: 260px !important;
  }
}

.time-result .time-place {
  font-size: 1.25rem;
  margin: 0 0 0.25rem 0;
}

.time-time {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0.25rem 0;
}

.time-date {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

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

/* ── Dictionary Slot ──────────────────────────────────────── */

.dslot-wrap {
  max-width: 680px;
  margin-bottom: 12px;
  padding: 0;
}

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

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

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

.dslot-word-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dslot-word {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
}

.dslot-phonetic {
  font-size: 15px;
  color: var(--text-secondary);
  font-style: italic;
}

.dslot-audio-btn {
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.dslot-audio-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.dslot-divider {
  height: 1px;
  background: var(--border-light);
  margin-bottom: 12px;
}

.dslot-section {
  margin-bottom: 14px;
}

.dslot-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.dslot-defs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dslot-def-row {
  display: flex;
  gap: 10px;
}

.dslot-def-num {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 16px;
  padding-top: 1px;
  flex-shrink: 0;
}

.dslot-pos {
  font-size: 13px;
  font-style: italic;
  color: var(--primary);
  margin-right: 6px;
}

.dslot-def-text {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.55;
}

.dslot-example {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 4px;
  line-height: 1.5;
}

.dslot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.dslot-tags-box {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 9px 11px;
}

.dslot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.dslot-tag {
  font-size: 13px;
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  background: var(--bg-light);
}

.dslot-tag-empty {
  font-size: 13px;
  color: var(--text-secondary);
}

.dslot-etymology {
  font-size: 14px;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.55;
}

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

.dslot-tag[data-word] {
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, transform 0.1s;
  /* Larger tap target on mobile */
  padding: 5px 11px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.dslot-tag[data-word]:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.dslot-tag[data-word]:active {
  transform: scale(0.95);
  border-color: var(--primary);
  color: var(--primary);
}

.dslot-audio-playing {
  color: var(--primary);
  border-color: var(--primary);
}

.dslot-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px 2px 6px;
  border-radius: 5px;
  border: 0.5px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-sans, sans-serif);
  transition: color .15s, border-color .15s;
  margin-right: 6px;
  flex-shrink: 0;
}

.dslot-back-btn:hover {
  color: var(--text-primary);
  border-color: var(--border);
}

/* Not found toast */
.dslot-toast {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 0.5px solid var(--border-light);
  background: var(--bg);
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.dslot-toast strong {
  color: var(--text-primary);
  font-weight: 500;
}

.dslot-toast-in {
  opacity: 1;
  transform: translateY(0);
}

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