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

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

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

.gh-slot-result {
  padding: 0;
  max-width: 100%;
  width: 100%;
  color: var(--text-primary);
  min-width: 0;
}

.gh-slot-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.gh-slot-section {
  margin-bottom: 0;
  min-width: 0;
}

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

.gh-slot-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0;
  min-width: 0;
}

.gh-slot-grid::-webkit-scrollbar {
  display: none;
}

.gh-slot-grid::-webkit-scrollbar-track {
  background: var(--bg-hover);
  border-radius: 3px;
}

.gh-slot-grid::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  opacity: 0.4;
  border-radius: 3px;
}

.gh-slot-card {
  display: block;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
  min-width: 220px;
  max-width: 280px;
  transition: background 0.15s ease;
}

.results-slot-panel-body a:hover {
  text-decoration: none;
}

.gh-slot-card {
  background: var(--bg-hover);
}

.gh-slot-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-hover);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gh-slot-avatar--user {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.gh-slot-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gh-slot-avatar-placeholder {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.gh-slot-repo-head,
.gh-slot-user-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.gh-slot-repo-meta,
.gh-slot-user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gh-slot-repo-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary, #0969da);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-slot-repo-lang {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.gh-slot-stars {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.gh-slot-desc {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gh-slot-user-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.gh-slot-user-login {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.gh-slot-user-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.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;
}
.trc-card {
  --trc-accent: var(--primary);
  container-type: inline-size;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  background: var(--bg-light);
  color: var(--text-primary);
  font-family: var(--font-sans, system-ui, sans-serif);
}

.results-slot-panel:has(.trc-card) {
  overflow: hidden;
}

.results-slot-panel:has(.trc-card) .results-slot-panel-body {
  padding: 0;
}

.results-slot-panel:has(.trc-card) .results-slot-panel-title {
  display: none;
}

.results-slot-panel:has(.trc-card) .trc-card {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.trc-card *,
.trc-card *::before,
.trc-card *::after {
  box-sizing: border-box;
}

.trc-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.trc-title-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.trc-glyph {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--trc-accent);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.trc-title {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trc-provider-field {
  display: grid;
  min-width: min(250px, 52%);
  gap: 4px;
}

.trc-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

.trc-status {
  display: none;
}

.trc-status[data-status="success"] {
  color: var(--success);
}

.trc-status[data-status="failed"] {
  color: var(--warning);
}

.trc-status[data-status="disabled"] {
  color: var(--text-secondary);
}

.trc-language-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.trc-field {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.trc-provider-select,
.trc-source-select,
.trc-target-select {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2380868b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 6px;
  padding: 0 32px 0 12px;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.trc-provider-select:focus,
.trc-source-select:focus,
.trc-target-select:focus {
  border-color: var(--trc-accent);
  outline: none;
}

.trc-source-input:focus,
.trc-output:focus {
  outline: none;
}

.trc-icon-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.trc-icon-button:hover,
.trc-icon-button:focus-visible,
.trc-audio-button.trc-audio-playing {
  border-color: var(--border);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-secondary) 10%, transparent);
  outline: none;
}

.trc-icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.trc-icon-button svg,
.trc-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.trc-text-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.trc-pane {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  min-height: 190px;
  padding: 13px 14px 10px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: var(--bg);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.trc-pane:focus-within {
  border-color: var(--trc-accent);
  box-shadow: 0 0 0 1px var(--trc-accent);
}

.trc-source-input,
.trc-output {
  width: 100%;
  min-height: 92px;
  max-height: 220px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.32;
  padding: 0;
}

.trc-output {
  color: var(--text-primary);
}

.trc-source-input::placeholder,
.trc-output::placeholder {
  color: var(--text-secondary);
}

.trc-romanization {
  min-height: 1.2em;
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.35;
}

.trc-romanization:empty {
  display: none;
}

.trc-pane-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-top: auto;
}

.trc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.trc-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 7px 11px;
}

.trc-button:hover {
  border-color: var(--border);
}

.trc-button:disabled,
.trc-card[data-trc-loading="1"] .trc-button {
  cursor: wait;
  opacity: 0.68;
}

.trc-copy-button[data-copied="1"] {
  border-color: var(--success);
  color: var(--success);
}

@container (max-width: 680px) {
  .trc-card {
    padding: 10px;
  }

  .trc-toolbar {
    display: grid;
    gap: 8px;
  }

  .trc-provider-field {
    min-width: 0;
  }
}


.undecideds-slot {
  container-type: inline-size;
  color: var(--text-primary, CanvasText);
  --undecideds-primary: var(--primary, #4285f4);
  --undecideds-primary-hover: color-mix(in srgb, var(--undecideds-primary) 85%, #000);
  --undecideds-border: var(--border, rgba(128, 128, 128, 0.25));
  --undecideds-bg: var(--bg, Canvas);
  --undecideds-card-bg: var(--bg-light, color-mix(in srgb, var(--bg, Canvas) 92%, var(--text-primary, CanvasText) 8%));
  --undecideds-field-bg: var(--bg, Canvas);
  --undecideds-text-secondary: var(--text-secondary, #70757a);
  --undecideds-coin-gold: linear-gradient(135deg, #ffd700, #ffa500, #d4af37, #ffd700);
  --undecideds-coin-silver: linear-gradient(135deg, #f0f0f0, #c0c0c0, #a9a9a9, #f0f0f0);
  --undecideds-slice-yes: #10b981;
  --undecideds-slice-no: #ef4444;
  
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 10px 0;
  width: 100%;
}

/* Card Outer Shell */
.undecideds-slot__card {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

/* Tabs Bar */
.undecideds-slot__tabs-carousel {
  position: relative;
  border-bottom: 1px solid var(--undecideds-border);
  background: color-mix(in srgb, var(--undecideds-card-bg) 94%, currentColor 6%);
}

.undecideds-slot__tabs {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-padding-inline: 36px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.undecideds-slot__tabs::-webkit-scrollbar {
  display: none;
}

.undecideds-slot__tab-nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--undecideds-border);
  border-radius: 999px;
  background: var(--undecideds-card-bg);
  color: var(--text-primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.undecideds-slot__tab-nav span {
  font-size: 1.45rem;
  line-height: 1;
  transform: translateY(-1px);
}

.undecideds-slot__tab-nav--prev {
  left: 6px;
}

.undecideds-slot__tab-nav--next {
  right: 6px;
}

.undecideds-slot__tabs-carousel:hover .undecideds-slot__tab-nav:not(:disabled),
.undecideds-slot__tabs-carousel:focus-within .undecideds-slot__tab-nav:not(:disabled) {
  opacity: 1;
  pointer-events: auto;
}

.undecideds-slot__tab-nav:hover {
  background: var(--undecideds-primary);
  color: #fff;
}

.undecideds-slot__tab-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.undecideds-slot__tab-btn {
  flex: 1;
  min-width: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--undecideds-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  position: relative;
  outline: none;
}

.undecideds-slot__tab-btn:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--undecideds-card-bg) 90%, currentColor 10%);
}

.undecideds-slot__tab-btn.is-active {
  color: var(--undecideds-primary);
  background: var(--undecideds-card-bg);
}

.undecideds-slot__tab-btn.is-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--undecideds-primary);
  border-radius: 3px 3px 0 0;
}

.undecideds-slot__tab-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.undecideds-slot__tab-btn.is-active .undecideds-slot__tab-icon {
  transform: scale(1.1);
}

/* Content Panel Wrapper */
.undecideds-slot__content-wrapper {
  padding: 24px;
}

.undecideds-slot__panel {
  display: block;
}

.undecideds-slot__panel[hidden] {
  display: none !important;
}

.undecideds-slot__panel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr);
  gap: 24px;
  align-items: center;
}

/* Panel Left Info / Controls */
.undecideds-slot__info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.undecideds-slot__title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  min-height: 2.3rem;
  overflow-wrap: anywhere;
}

/* Action Button */
.undecideds-slot__btn {
  align-self: flex-start;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: var(--undecideds-primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(66, 133, 244, 0.25);
  outline: none;
}

.undecideds-slot__btn:hover {
  background: var(--undecideds-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(66, 133, 244, 0.35);
}

.undecideds-slot__btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(66, 133, 244, 0.15);
}

.undecideds-slot__btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

/* Ticker text */
.undecideds-slot__ticker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--undecideds-text-secondary);
  margin-top: 8px;
  text-align: center;
}

/* Visual Stage */
.undecideds-slot__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 170px;
}

.undecideds-slot__panel[data-panel="number"] .undecideds-slot__panel-layout {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  text-align: center;
}

.undecideds-slot__panel[data-panel="number"] .undecideds-slot__info {
  align-items: center;
  width: min(100%, 420px);
}

.undecideds-slot__panel[data-panel="number"] .undecideds-slot__btn {
  align-self: center;
}

.undecideds-slot__panel[data-panel="number"] .undecideds-slot__visual {
  min-height: auto;
}

/* 1. COIN FLIP ANIMATION */
.undecideds-slot__coin-scene {
  position: relative;
  width: 120px;
  height: 120px;
  perspective: 1000px;
}

.undecideds-slot__coin-entity {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  transition: transform 0.1s linear;
  cursor: pointer;
}

.undecideds-slot__coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    inset 0 0 10px rgba(0, 0, 0, 0.2),
    0 8px 16px rgba(0, 0, 0, 0.15);
}

.undecideds-slot__coin-face--heads {
  background: var(--undecideds-coin-gold);
  border: 4px solid #d4af37;
  transform: rotateY(0deg);
}

.undecideds-slot__coin-face--tails {
  background: var(--undecideds-coin-silver);
  border: 4px solid #b0b0b0;
  transform: rotateY(180deg);
}

.undecideds-slot__coin-design {
  width: 82%;
  height: 82%;
  border-radius: 50%;
  border: 2px dashed rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.undecideds-slot__coin-symbol {
  font-size: 3rem;
  font-family: Georgia, serif;
  font-weight: bold;
  color: rgba(0, 0, 0, 0.6);
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.6);
  line-height: 1;
}

.undecideds-slot__coin-text {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(0, 0, 0, 0.5);
  margin-top: -2px;
}

.undecideds-slot__coin-drop-shadow {
  position: absolute;
  bottom: -15px;
  left: 10px;
  right: 10px;
  height: 10px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  filter: blur(5px);
  transform: scaleX(0.9);
}

/* 2. ROLL DIE ANIMATION */
.undecideds-slot__selector {
  display: flex;
  gap: 8px;
}

.undecideds-slot__toggle-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  background: transparent;
  border: 1px solid var(--undecideds-border);
  border-radius: 8px;
  color: var(--undecideds-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.undecideds-slot__toggle-btn.is-active {
  background: var(--undecideds-primary);
  border-color: var(--undecideds-primary);
  color: #fff;
}

.undecideds-slot__dice-scene {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 700px;
  perspective-origin: 50% 42%;
}

/* D6 Cube */
.undecideds-slot__die-d6 {
  width: 80px;
  height: 80px;
  position: relative;
  transform-style: preserve-3d;
}

.undecideds-slot__die-d6-face {
  position: absolute;
  width: 80px;
  height: 80px;
  background: linear-gradient(145deg, #ffffff 0%, #f5f7fb 48%, #d9dee8 100%);
  border: 2px solid #d6dbe5;
  border-radius: 12px;
  box-shadow:
    inset -10px -12px 18px rgba(0, 0, 0, 0.15),
    inset 8px 8px 14px rgba(255, 255, 255, 0.9),
    0 9px 18px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 10px;
  box-sizing: border-box;
}

.undecideds-slot__die-dot {
  width: 12px;
  height: 12px;
  background: #2b2b2b;
  border-radius: 50%;
  display: inline-block;
  box-shadow: inset 1px 1px 2px rgba(255,255,255,0.4);
}

.undecideds-slot__die-d6-face--1 { transform: rotateY(0deg) translateZ(40px); justify-content: center; align-items: center; }
.undecideds-slot__die-d6-face--6 { transform: rotateY(180deg) translateZ(40px); }
.undecideds-slot__die-d6-face--2 { transform: rotateY(90deg) translateZ(40px); flex-direction: row; justify-content: space-around; align-items: center; }
.undecideds-slot__die-d6-face--5 { transform: rotateY(-90deg) translateZ(40px); }
.undecideds-slot__die-d6-face--3 { transform: rotateX(90deg) translateZ(40px); flex-direction: row; justify-content: space-between; align-items: flex-start; }
.undecideds-slot__die-d6-face--3 span:nth-child(2) { align-self: center; }
.undecideds-slot__die-d6-face--3 span:nth-child(3) { align-self: flex-end; }
.undecideds-slot__die-d6-face--4 { transform: rotateX(-90deg) translateZ(40px); }

.undecideds-slot__dot-row {
  display: flex;
  justify-content: space-around;
  width: 100%;
}

/* D20 Polyhedron */
.undecideds-slot__die-d20 {
  width: 100px;
  height: 100px;
}

.undecideds-slot__d20-canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
}

.undecideds-slot__d20-text {
  font-family: inherit;
}

.undecideds-slot__dice-drop-shadow {
  position: absolute;
  bottom: -5px;
  width: 92px;
  height: 13px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  filter: blur(6px);
  transform: scaleX(1.08);
}

/* 3. PICK NUMBER ANIMATION */
.undecideds-slot__inputs {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.undecideds-slot__input-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.undecideds-slot__input-field label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--undecideds-text-secondary);
}

.undecideds-slot__input-field input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--undecideds-field-bg);
  border: 1px solid var(--undecideds-border);
  border-radius: 8px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease;
}

.undecideds-slot__input-field input:focus {
  border-color: var(--undecideds-primary);
}

.undecideds-slot__number-roller {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
  min-height: 56px;
  max-width: 100%;
  padding: 6px 12px;
  background: color-mix(in srgb, var(--undecideds-field-bg) 90%, var(--text-primary, CanvasText) 10%);
  border-radius: 12px;
  border: 1px dashed var(--undecideds-border);
  box-sizing: border-box;
  overflow-x: auto;
  scrollbar-width: none;
}

.undecideds-slot__number-roller::-webkit-scrollbar {
  display: none;
}

.undecideds-slot__digit-slot {
  flex: 0 0 32px;
  width: 32px;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--undecideds-border);
  border-radius: 6px;
  background: var(--undecideds-field-bg);
  position: relative;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.undecideds-slot__digit-slot--static {
  border: none;
  background: transparent;
  box-shadow: none;
  width: auto;
  display: inline-flex;
  align-items: center;
}

.undecideds-slot__digit-slot--static span {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
}

.undecideds-slot__digit-strip {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
}

.undecideds-slot__digit-strip span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.undecideds-slot__digit-box {
  display: inline-flex;
}

.undecideds-slot__digit-static {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* 4. YES OR NO WHEEL ANIMATION */
.undecideds-slot__wheel-container {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.undecideds-slot__wheel-spinner {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 4px solid var(--undecideds-border);
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  background: conic-gradient(
    from 0deg,
    var(--undecideds-slice-yes) 0deg 45deg,
    var(--undecideds-slice-no) 45deg 90deg,
    var(--undecideds-slice-yes) 90deg 135deg,
    var(--undecideds-slice-no) 135deg 180deg,
    var(--undecideds-slice-yes) 180deg 225deg,
    var(--undecideds-slice-no) 225deg 270deg,
    var(--undecideds-slice-yes) 270deg 315deg,
    var(--undecideds-slice-no) 315deg 360deg
  );
  will-change: transform;
}

.undecideds-slot__wheel-slice {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10px;
  font-weight: 850;
  font-size: 0.68rem;
  color: #fff;
  transform-origin: 50% 50%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.undecideds-slot__wheel-slice--0 { transform: rotate(22.5deg); }
.undecideds-slot__wheel-slice--1 { transform: rotate(67.5deg); }
.undecideds-slot__wheel-slice--2 { transform: rotate(112.5deg); }
.undecideds-slot__wheel-slice--3 { transform: rotate(157.5deg); }
.undecideds-slot__wheel-slice--4 { transform: rotate(202.5deg); }
.undecideds-slot__wheel-slice--5 { transform: rotate(247.5deg); }
.undecideds-slot__wheel-slice--6 { transform: rotate(292.5deg); }
.undecideds-slot__wheel-slice--7 { transform: rotate(337.5deg); }

.undecideds-slot__wheel-pointer-icon {
  position: absolute;
  top: -2px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 16px solid var(--undecideds-primary);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
  z-index: 10;
  transform-origin: 50% 0%;
  transition: transform 0.05s ease;
}

.undecideds-slot__wheel-pointer-icon.is-ticking {
  transform: rotate(-15deg);
}

/* RESPONSIVE DESIGN (Container Query) */
@container (max-width: 450px) {
  .undecideds-slot__tab-nav:not(:disabled) {
    opacity: 1;
    pointer-events: auto;
  }
  .undecideds-slot__panel-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    justify-items: center;
    text-align: center;
  }
  .undecideds-slot__info {
    align-items: center;
  }
  .undecideds-slot__btn {
    align-self: center;
  }
  .undecideds-slot__title {
    font-size: 1.6rem;
    min-height: auto;
  }
}

@media (hover: none) {
  .undecideds-slot__tab-nav:not(:disabled) {
    opacity: 1;
    pointer-events: auto;
  }
}

/* LiterallyGoogle uses pill-shaped controls; match that shell without changing default. */
#results-page.degoog-fullwidth-slot-shell .undecideds-slot__tabs-carousel {
  border-bottom: none;
  background: transparent;
}

#results-page.degoog-fullwidth-slot-shell .undecideds-slot__tabs {
  gap: 6px;
  padding: 6px;
  scroll-padding-inline: 40px;
}

#results-page.degoog-fullwidth-slot-shell .undecideds-slot__tab-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding-block: 10px;
}

#results-page.degoog-fullwidth-slot-shell .undecideds-slot__tab-btn.is-active {
  border-color: color-mix(in srgb, var(--undecideds-primary) 34%, transparent);
  background: color-mix(in srgb, var(--undecideds-primary) 14%, transparent);
}

#results-page.degoog-fullwidth-slot-shell .undecideds-slot__tab-btn.is-active::after {
  display: none;
}

#results-page.degoog-fullwidth-slot-shell .undecideds-slot__btn,
#results-page.degoog-fullwidth-slot-shell .undecideds-slot__toggle-btn,
#results-page.degoog-fullwidth-slot-shell .undecideds-slot__input-field input,
#results-page.degoog-fullwidth-slot-shell .undecideds-slot__number-roller {
  border-radius: 999px;
}

/* REDUCED MOTION PREFERENCE */
@media (prefers-reduced-motion: reduce) {
  .undecideds-slot__btn,
  .undecideds-slot__coin-entity,
  .undecideds-slot__die-d6,
  .undecideds-slot__die-d20,
  .undecideds-slot__digit-strip,
  .undecideds-slot__wheel-spinner {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* ── Unit Converter Slot ────────────────────────────────────────── */

.uxs-wrap {
    container-type: inline-size;
    position: relative;
    color: var(--text-primary, inherit);
    width: 100%;
    max-width: none;
}

.results-slot-panel:has(> .results-slot-panel-body > .uxs-wrap.slot-full-width) {
    overflow: visible;
    max-width: none;
}

/* Card (inner frame; outer results-slot-panel provides chrome in full-width themes) */
.uxs-main {
    position: relative;
    background: var(--slot-inset-bg, var(--bg-light, var(--bg, Canvas)));
    border: 1px solid var(--slot-inset-border, var(--border-light, var(--border, color-mix(in srgb, currentColor 20%, transparent))));
    border-radius: 12px;
    overflow: hidden;
}

/* ── Category bar ──────────────────────────────────────────────── */

.uxs-top-bar {
    border-bottom: 1px solid var(--border-light, color-mix(in srgb, currentColor 15%, transparent));
    background: color-mix(in srgb, var(--text-primary, currentColor) 5%, var(--slot-inset-bg, var(--bg-light, rgba(128, 128, 128, 0.08))));
}

.uxs-category-select {
    width: 100%;
    padding: 12px 36px 12px 18px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2380868b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px 6px;
    border: none;
    color: var(--text-primary, inherit);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0;
    outline: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.uxs-category-select:hover {
    background-color: var(--bg-hover, rgba(128, 128, 128, 0.12));
}

.uxs-category-select:focus-visible {
    box-shadow: inset 0 0 0 2px var(--primary, #4285f4);
}

.uxs-category-select option,
.uxs-unit-select option {
    background: var(--bg-light, var(--bg, Canvas));
    color: var(--text-primary, CanvasText);
}

/* ── Conversion rows ───────────────────────────────────────────── */

.uxs-row {
    display: flex;
    align-items: center;
    padding: 18px 18px;
    gap: 16px;
    transition: background-color 0.15s ease;
    background: var(--bg-light, transparent);
}

.uxs-row:hover {
    background: var(--bg-hover, rgba(128, 128, 128, 0.06));
}

.uxs-input-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}

.uxs-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(
        --text-secondary,
        color-mix(in srgb, currentColor 60%, transparent)
    );
    margin-bottom: 4px;
}

/* ── Number input ──────────────────────────────────────────────── */

.uxs-amount {
    width: 100%;
    font-size: clamp(1.8rem, 5cqi, 2.1rem);
    font-weight: 400;
    color: var(--text-primary, inherit);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    outline: none;
    letter-spacing: 0;
    padding: 0 0 4px;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.2s ease;
    cursor: text;
}

.uxs-amount:hover {
    border-bottom-color: color-mix(
        in srgb,
        var(--primary, #4285f4) 45%,
        transparent
    );
}

.uxs-amount:focus {
    border-bottom-color: var(--primary, #4285f4);
}

.uxs-amount::-webkit-inner-spin-button,
.uxs-amount::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.uxs-amount[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ── Result display ────────────────────────────────────────────── */

.uxs-result {
    font-size: clamp(1.8rem, 5cqi, 2.1rem);
    font-weight: 400;
    color: var(--text-primary, inherit);
    letter-spacing: 0;
    min-height: 1.3em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: break-word;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

.uxs-result.updating {
    color: color-mix(
        in srgb,
        var(--text-primary, inherit) 78%,
        var(--primary, #4285f4)
    );
}

.uxs-result-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.uxs-result-line .uxs-result {
    flex: 1;
    min-width: 0;
}

.uxs-copy {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid
        var(
            --border-light,
            var(--border, color-mix(in srgb, currentColor 30%, transparent))
        );
    border-radius: 999px;
    background: transparent;
    color: var(
        --text-secondary,
        color-mix(in srgb, currentColor 60%, transparent)
    );
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.uxs-copy svg {
    display: block;
}

.uxs-copy .uxs-copy-done {
    display: none;
}

.uxs-copy.copied .uxs-copy-icon {
    display: none;
}

.uxs-copy.copied .uxs-copy-done {
    display: block;
}

.uxs-copy:hover,
.uxs-copy:focus-visible {
    background: var(--bg-hover, rgba(128, 128, 128, 0.08));
    border-color: var(--primary, #4285f4);
    color: var(--primary, #4285f4);
    outline: none;
}

.uxs-copy.copied {
    border-color: var(--success, #34a853);
    color: var(--success, #34a853);
}

/* ── Unit select (right side) ──────────────────────────────────── */

.uxs-select-wrap {
    flex-shrink: 0;
    max-width: 55%;
}

.uxs-unit-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color: var(--text-primary, inherit);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 10px 36px 10px 14px;
    border-radius: 999px;
    border: 1px solid
        var(--border, color-mix(in srgb, currentColor 30%, transparent));
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2380868b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px 6px;
    outline: none;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
    text-align: left;
}

.uxs-unit-select:hover {
    border-color: var(
        --text-secondary,
        color-mix(in srgb, currentColor 50%, transparent)
    );
    background-color: var(--bg-hover, rgba(128, 128, 128, 0.08));
}

.uxs-unit-select:focus-visible {
    border-color: var(--primary, #4285f4);
    box-shadow: 0 0 0 1px var(--primary, #4285f4);
}

/* ── Divider + swap button ─────────────────────────────────────── */

.uxs-divider {
    height: 1px;
    background: color-mix(in srgb, currentColor 15%, transparent);
    position: relative;
}

.uxs-swap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid
        var(--border, color-mix(in srgb, currentColor 30%, transparent));
    background: var(--bg-light, var(--bg, Canvas));
    color: var(
        --text-secondary,
        color-mix(in srgb, currentColor 60%, transparent)
    );
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
    z-index: 2;
    padding: 0;
}

.uxs-swap:hover {
    background: var(--bg-hover, rgba(128, 128, 128, 0.1));
    border-color: var(--primary, #4285f4);
    color: var(--primary, #4285f4);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}

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

.uxs-swap-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ── Formula bar ───────────────────────────────────────────────── */

.uxs-formula-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-top: 1px solid var(--border-light, color-mix(in srgb, currentColor 15%, transparent));
    font-size: 0.82rem;
    color: var(
        --text-secondary,
        color-mix(in srgb, currentColor 60%, transparent)
    );
    letter-spacing: 0;
    background: color-mix(in srgb, var(--text-primary, currentColor) 4%, var(--slot-inset-bg, var(--bg, transparent)));
}

/* At-a-glance already supplies the outer panel. Flatten the plugin's own card
   so Unit Converter reads as one integrated tool instead of a box in a box.
   Degoog renders async at-a-glance slot plugins inside results-slot-panel, while
   the built-in at-a-glance preview uses glance-box; handle both shells. */
#at-a-glance .results-slot-panel:has(.uxs-wrap) {
    padding: 0;
    overflow: hidden;
}

#at-a-glance .results-slot-panel:has(.uxs-wrap) .results-slot-panel-body {
    padding: 0;
}

#at-a-glance .results-slot-panel:has(.uxs-wrap) .uxs-wrap,
.glance-box:has(.uxs-wrap) .uxs-wrap {
    width: 100%;
}

#at-a-glance .results-slot-panel:has(.uxs-wrap) .uxs-main,
.glance-box:has(.uxs-wrap) .uxs-main {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

#at-a-glance .results-slot-panel:has(.uxs-wrap) .uxs-top-bar,
.glance-box:has(.uxs-wrap) .uxs-top-bar {
    background: color-mix(in srgb, currentColor 5%, transparent);
}

#at-a-glance .results-slot-panel:has(.uxs-wrap) .uxs-category-select,
.glance-box:has(.uxs-wrap) .uxs-category-select {
    padding: 11px 38px 11px 16px;
    font-size: 0.84rem;
}

#at-a-glance .results-slot-panel:has(.uxs-wrap) .uxs-row,
.glance-box:has(.uxs-wrap) .uxs-row {
    padding: 16px;
    gap: 12px;
}

#at-a-glance .results-slot-panel:has(.uxs-wrap) .uxs-amount,
#at-a-glance .results-slot-panel:has(.uxs-wrap) .uxs-result,
.glance-box:has(.uxs-wrap) .uxs-amount,
.glance-box:has(.uxs-wrap) .uxs-result {
    font-size: clamp(1.55rem, 5cqi, 1.95rem);
    font-weight: 500;
}

#at-a-glance .results-slot-panel:has(.uxs-wrap) .uxs-unit-select,
.glance-box:has(.uxs-wrap) .uxs-unit-select {
    padding-block: 9px;
}

#at-a-glance .results-slot-panel:has(.uxs-wrap) .uxs-swap,
.glance-box:has(.uxs-wrap) .uxs-swap {
    background: var(--bg, Canvas);
}

#at-a-glance .results-slot-panel:has(.uxs-wrap) .uxs-formula-bar,
.glance-box:has(.uxs-wrap) .uxs-formula-bar {
    justify-content: flex-start;
    padding: 10px 16px;
    background: color-mix(in srgb, currentColor 4%, transparent);
}

.glance-box:has(.uxs-wrap) {
    padding: 0;
    overflow: hidden;
}

/* ── Mobile / narrow container ─────────────────────────────────── */

@container (max-width: 480px) {
    .uxs-amount,
    .uxs-result {
        font-size: 1.5rem;
    }

    .uxs-result-line {
        align-items: flex-start;
    }

    .uxs-row {
        padding: 14px;
        gap: 12px;
    }

    .uxs-category-select {
        padding-left: 14px;
        font-size: 0.84rem;
    }

    .uxs-unit-select {
        font-size: 0.82rem;
        padding: 8px 32px 8px 12px;
    }
}

.imdb-result {
  padding: 0;
  max-width: 652px;
  color: var(--text-primary);
}

.imdb-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
}

.imdb-poster {
  flex-shrink: 0;
  width: 100px;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-light);
}

.imdb-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.imdb-hero-text {
  flex: 1;
  min-width: 0;
}

.imdb-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.imdb-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

.imdb-title-link {
  color: inherit;
  text-decoration: none;
}

.imdb-title-link:hover .imdb-title,
.imdb-title-link:hover .imdb-filmography-title {
  text-decoration: underline;
}

a.imdb-cast-card {
  color: inherit;
  text-decoration: none;
}

a.imdb-cast-card:hover .imdb-cast-name {
  text-decoration: underline;
}

.imdb-hero-meta {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.imdb-hero-meta .imdb-rated + .imdb-released::before {
  content: " · ";
  color: var(--text-secondary);
}

.imdb-ratings {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

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

.imdb-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
}

.imdb-grid-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8125rem;
}

.imdb-grid-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.imdb-grid-value {
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

.imdb-cast-scroll {
  scrollbar-width: none;
}

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

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

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

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

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

.imdb-cast-card .imdb-cast-name {
  padding: 0.4rem 0.35rem 0.15rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.imdb-cast-character {
  padding: 0 0.35rem 0.4rem;
  font-size: 0.65rem;
  color: var(--text-secondary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.imdb-link {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary, #1a73e8);
  text-decoration: none;
}

.imdb-link:hover {
  text-decoration: underline;
}

.imdb-hero--compact {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

.imdb-hero--compact .imdb-poster {
  width: 80px;
  height: 120px;
}

.imdb-filmography-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.imdb-filmography-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0;
  margin: 0 0 1rem;
}


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

.imdb-filmography-strip {
  display: flex;
  gap: 0.75rem;
  width: max-content;
  padding: 0 0.25rem 0 0;
}

.imdb-filmography-scroll::-webkit-scrollbar {
  height: 6px;
}

.imdb-filmography-scroll::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  opacity: 0.3;
  border-radius: 3px;
}

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

.imdb-movie-card:hover {
  transform: scale(1.02);
}

.imdb-movie-poster {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-light);
  margin-bottom: 0.35rem;
}

.imdb-movie-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.imdb-movie-poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.imdb-movie-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.imdb-movie-year {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

@media (min-width: 480px) {
  .imdb-meta-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 640px) {
  .imdb-meta-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tmdb-tabs {
  position: relative;
}

.tmdb-tab-bar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 1px;
}

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

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

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

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

.tmdb-accordion {
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.tmdb-accordion .tmdb-accordion {
  border-radius: 6px;
  margin: 0.35rem 0;
}

.tmdb-accordion-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 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: "";
  flex-shrink: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

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

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

.tmdb-accordion-body {
  padding: 0 0 0.75rem;
  max-height: 20rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

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

.tmdb-season-poster {
  flex-shrink: 0;
  width: 52px;
  border-radius: 6px;
  object-fit: cover;
}

.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;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tmdb-season-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary, #1a73e8);
  text-decoration: none;
}

.tmdb-season-link:hover {
  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; }
}

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

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

.calc-card {
  box-sizing: border-box;
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary, #202124);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

.calc-card *,
.calc-card *::before,
.calc-card *::after {
  box-sizing: border-box;
}

.calc-display {
  min-height: 82px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-light, #dadce0);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 4px;
}

.calc-expression {
  width: 100%;
  min-height: 20px;
  color: var(--text-secondary, #5f6368);
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: right;
  overflow-wrap: anywhere;
}

.calc-result {
  width: 100%;
  min-height: 38px;
  color: var(--text-primary, #202124);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.calc-result.calc-result--compact {
  font-size: 1.45rem;
}

.calc-result.calc-result--error {
  color: var(--danger, #b3261e);
  font-size: 1.25rem;
}

.calc-graph {
  margin: 10px 12px 12px;
  padding: 12px 14px 14px;
  border: 1px solid var(--border-light, #dadce0);
  border-radius: 16px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--text-primary, #202124) 4%, transparent),
      transparent 58%
    ),
    var(--bg-light, #f8fafd);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary, #202124) 6%, transparent);
}

.calc-graph[hidden] {
  display: none;
}

.calc-graph-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
  margin-bottom: 10px;
}

.calc-graph-title {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-secondary, #5f6368);
  text-transform: uppercase;
}

.calc-graph-expression {
  min-width: 0;
  max-width: 72%;
  color: var(--text-secondary, #5f6368);
  font-size: 0.88rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.calc-graph-area {
  position: relative;
  width: 100%;
  height: 224px;
  isolation: isolate;
}

.calc-graph-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  border: 1px solid color-mix(in srgb, var(--border-light, #dadce0) 72%, transparent);
  border-radius: 12px;
  background:
    radial-gradient(
      120% 120% at 0% 0%,
      color-mix(in srgb, var(--text-link, #1a73e8) 8%, transparent),
      transparent 42%
    ),
    var(--bg, #fff);
}

.calc-graph-canvas--dragging {
  cursor: grabbing;
}

.calc-graph-zoom-controls {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  flex-direction: row;
  gap: 4px;
  z-index: 10;
  pointer-events: auto;
  padding: 4px;
  border: 1px solid var(--border-light, #dadce0);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg, #ffffff) 88%, transparent);
  box-shadow: 0 3px 12px rgba(60, 64, 67, 0.12);
}

.calc-graph-zoom-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary, #202124);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition:
    background 150ms,
    border-color 150ms,
    color 150ms,
    transform 120ms;
}

.calc-graph-zoom-btn:hover {
  background: var(--bg-hover, #f1f3f4);
  border-color: var(--border-light, #dadce0);
}

.calc-graph-zoom-btn:active {
  background: var(--bg-active, #e8eaed);
  transform: scale(0.96);
}

.calc-keypad {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: var(--bg-light, #f8fafd);
}

.results-slot-panel:has(.calc-card) {
  overflow: hidden;
}

.results-slot-panel:has(.calc-card) .results-slot-panel-body {
  padding: 0;
}

.results-slot-panel:has(.calc-card) .results-slot-panel-title {
  display: none;
}

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

.calc-angle-toggle {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
}

.calc-btn {
  width: 100%;
  height: 42px;
  min-width: 0;
  border: 0;
  border-radius: 6px;
  padding: 0 6px;
  color: var(--text-primary, #202124);
  background: transparent;
  font: inherit;
  font-size: 0.86rem;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition:
    background 120ms ease,
    color 120ms ease,
    filter 120ms ease;
}

.calc-btn:hover {
  background: var(--bg-hover, rgba(60, 64, 67, 0.08));
}

.calc-btn:focus-visible {
  outline: 2px solid var(--primary, #1a73e8);
  outline-offset: 1px;
}

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

.calc-btn--digit {
  background: var(--bg, #fff);
  font-weight: 500;
}

.calc-btn--sci,
.calc-btn--op,
.calc-btn--clear,
.calc-btn--toggle {
  color: var(--text-secondary, #5f6368);
}

.calc-btn--op {
  font-size: 1rem;
}

.calc-btn--clear {
  font-weight: 600;
}

.calc-btn--toggle.calc-btn--active,
.calc-btn--sci.calc-btn--active {
  background: var(--bg-hover, rgba(60, 64, 67, 0.08));
  color: var(--text-primary, #202124);
  font-weight: 600;
}

.calc-btn--equals {
  background: var(--text-link, #1a73e8);
  color: #fff;
  font-weight: 600;
}

.calc-btn--equals:hover {
  background: var(--primary, #1967d2);
}

@media (max-width: 560px) {
  .calc-card {
    width: 100%;
  }

  .calc-display {
    min-height: 76px;
    padding: 12px;
  }

  .calc-result {
    min-height: 32px;
    font-size: 1.65rem;
  }

  .calc-result.calc-result--compact {
    font-size: 1.22rem;
  }

  .calc-graph {
    margin: 8px;
    padding: 10px;
  }

  .calc-graph-area {
    height: 184px;
  }

  .calc-keypad {
    padding: 6px;
  }

  .calc-row {
    gap: 3px;
  }

  .calc-btn {
    height: 36px;
    padding: 0 3px;
    font-size: 0.78rem;
  }
}

/* literallygoogle theme support */
#results-page.degoog-fullwidth-slot-shell .calc-card {
    border: 1px solid var(--border-light, #dadce0);
    border-radius: 16px;
}

/* ── Currency Slot – Minimal Theme ──────────────────── */

.cxs-wrap {
    container-type: inline-size;
    margin-bottom: 12px;
    font-family: var(--font-sans, sans-serif);
    position: relative;
    color: var(--text-primary);
}

.cxs-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.cxs-title {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.cxs-main {
    border: 1px solid var(--slot-inset-border, var(--border-light));
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--slot-inset-bg, var(--bg-light, #2f3033));
}

.cxs-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    grid-template-areas: "flag input button";
    align-items: end;
    padding: 16px 18px;
    gap: 14px;
}

.cxs-flag {
    grid-area: flag;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.cxs-flag.changing {
    opacity: 0;
}

.cxs-flag svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 6px;
}

.cxs-input-wrap {
    grid-area: input;
    flex: 1;
    min-width: 0;
    position: relative;
}

.cxs-label {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.cxs-amount {
    width: 100%;
    font-size: clamp(1.8rem, 5vw, 2rem);
    font-weight: 400;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-sans, sans-serif);
    letter-spacing: -0.03em;
    padding: 0 0 4px;
    border-bottom: 2px solid transparent;
    font-variant-numeric: tabular-nums;
    cursor: text;
    transition: border-color 160ms ease;
}

.cxs-amount:hover {
    border-bottom-color: color-mix(
        in srgb,
        var(--primary, #4285f4) 45%,
        transparent
    );
}

.cxs-amount:focus {
    border-bottom-color: var(--primary, #4285f4);
}

.cxs-amount::-webkit-inner-spin-button,
.cxs-amount::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.cxs-amount[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.cxs-result {
    font-size: clamp(1.8rem, 5vw, 2rem);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    min-height: 32px;
    font-variant-numeric: tabular-nums;
}

.cxs-result-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cxs-result-line .cxs-result {
    flex: 1;
    min-width: 0;
}

.cxs-copy {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--border-light, var(--border));
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.cxs-copy svg {
    display: block;
}

.cxs-copy .cxs-copy-done {
    display: none;
}

.cxs-copy.copied .cxs-copy-icon {
    display: none;
}

.cxs-copy.copied .cxs-copy-done {
    display: block;
}

.cxs-copy:hover,
.cxs-copy:focus-visible {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    border-color: var(--primary, #4285f4);
    color: var(--primary, #4285f4);
    outline: none;
}

.cxs-copy.copied {
    border-color: var(--success, #34a853);
    color: var(--success, #34a853);
}

/* Currency buttons */
.cxs-cur-btn {
    grid-area: button;
    justify-self: start;
    align-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    color: var(--text-primary);
    flex-shrink: 0;
    transition:
        background-color 160ms ease,
        border-color 160ms ease;
    font-family: var(--font-sans, sans-serif);
    margin-bottom: 2px;
}

.cxs-cur-btn:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.cxs-cur-display {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.cxs-cur-code {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.cxs-cur-name {
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--text-primary);
}

.cxs-divider {
    height: 1px;
    background: var(--border-light);
    position: relative;
}

.cxs-swap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg, #1a1a1a);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
    z-index: 2;
    padding: 0;
}

.cxs-swap:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    color: var(--text-primary);
}

.cxs-swap-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease;
    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;
    margin-top: auto;
    padding: 10px 18px;
    border-top: 1px solid var(--border-light);
    font-size: 0.88rem;
    color: var(--text-secondary);
}

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

.cxs-updated {
    font-size: 0.74rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cxs-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success, #4ade80);
    animation: cxs-pulse-animate 2s ease-in-out infinite;
}

@keyframes cxs-pulse-animate {
    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Quick amounts */
.cxs-quick {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
}

.cxs-q {
    font-size: 0.88rem;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-sans, sans-serif);
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.cxs-q:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    color: var(--text-primary);
}

/* Popular pairs */
.cxs-pairs-label {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.cxs-pairs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.cxs-pair {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        border-color 160ms ease;
    background: var(--bg-light, #2f3033);
    overflow: hidden;
}

.cxs-pair:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.cxs-pair-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.cxs-pair-rate {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    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 var(--border);
    border-radius: 12px;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

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

.cxs-picker-loading {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

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

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

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

.cxs-picker-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    border-radius: 8px;
    transition:
        background-color 160ms ease,
        color 160ms ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cxs-picker-close:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    color: var(--text-primary);
}

.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: 8px;
    cursor: pointer;
    transition: background-color 160ms ease;
}

.cxs-picker-item:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.cxs-picker-item--selected {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.cxs-picker-flag {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.cxs-picker-flag svg {
    width: 100%;
    height: 100%;
    border-radius: 6px;
}

.cxs-picker-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.cxs-picker-name {
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--text-primary);
}

.cxs-picker-code {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.cxs-picker-checkmark {
    color: var(--primary, #4ade80);
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

@container (max-width: 480px) {
    .cxs-row {
        grid-template-columns: 22px minmax(0, 1fr);
        grid-template-areas:
            "flag input"
            "flag button";
        align-items: start;
    }

    .cxs-cur-btn {
        margin-bottom: 0;
        margin-top: 2px;
    }

    .cxs-pairs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cxs-amount,
    .cxs-result {
        font-size: 1.6rem;
    }

    .cxs-result-line {
        align-items: flex-start;
    }

    .cxs-row {
        padding: 14px;
    }

    .cxs-main > .cxs-row:first-child {
        padding-bottom: 22px;
    }
}

/* ── Chart Panel ───────────────────────────────────── */

.cxs-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 20px;
}

/* Default (narrow layouts): picker uses full card width. */
.cxs-picker {
    right: 0;
    width: 100%;
}

/* Wide chart + converter row only when the theme opts into full-width slots (`degoog-fullwidth-slot-shell`). */
@container (min-width: 900px) {
    #results-page.degoog-fullwidth-slot-shell
        .cxs-wrap.slot-full-width
        .cxs-layout {
        flex-direction: row;
    }

    #results-page.degoog-fullwidth-slot-shell
        .cxs-wrap.slot-full-width
        .cxs-picker {
        right: auto;
        width: calc((100% - 1rem) / 2);
    }
}

@container (max-width: 600px) {
    .cxs-layout {
        flex-direction: column;
    }

    .cxs-picker {
        width: 100%;
    }
}

.cxs-layout .cxs-main {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.cxs-chart-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--slot-inset-border, var(--border-light));
    border-radius: 12px;
    padding: 16px;
    background: var(--slot-inset-bg, var(--bg-light, transparent));
}

@container (max-width: 600px) {
    .cxs-chart-panel {
        min-height: 212px;
    }
}

.cxs-chart-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 12px;
}

.cxs-chart-title {
    display: none;
}

.cxs-chart-periods {
    display: flex;
    gap: 4px;
}

.cxs-period {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        border-color 160ms ease;
}

.cxs-period:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.cxs-period--active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cxs-period--active:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cxs-chart-body {
    flex: 1;
    /* Matches renderChart() fixed H in script.js so loading state doesn’t jump. */
    min-height: 212px;
    position: relative;
}

.cxs-chart-svg {
    width: 100%;
    height: 100%;
    display: block;
    min-height: 212px;
}

.cxs-chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 212px;
    height: 100%;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.cxs-chart-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.45rem 0.7rem;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.cxs-stat {
    flex: 1 1 92px;
    min-width: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cxs-stat--placeholder {
    visibility: hidden;
    pointer-events: none;
}

.cxs-stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cxs-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

.cxs-stat-value--up {
    color: var(--success);
}

.cxs-stat-value--down {
    color: var(--danger);
}

.cxs-chart-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cxs-chart-fill {
    fill: url(#cxs-grad);
    opacity: 0.15;
}

.cxs-chart-dot {
    fill: var(--primary);
    r: 4;
}

.cxs-chart-tooltip {
    position: absolute;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.78rem;
    pointer-events: none;
    white-space: nowrap;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ── Chart grid & axes ─────────────────────────────────────── */

.cxs-chart-grid-line {
    stroke: var(--border-light);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.cxs-chart-y-label {
    font-size: 10px;
    fill: var(--text-secondary);
    font-family: var(--font-sans, sans-serif);
    dominant-baseline: middle;
}

.cxs-chart-x-label {
    font-size: 10px;
    fill: var(--text-secondary);
    font-family: var(--font-sans, sans-serif);
    dominant-baseline: middle;
}

/* ── Chart hover interaction ───────────────────────────────── */

.cxs-chart-hit {
    fill: transparent;
    pointer-events: all;
    cursor: crosshair;
}

.cxs-chart-hl-line {
    stroke: var(--text-secondary);
    stroke-width: 1;
    stroke-dasharray: 3 3;
    stroke-opacity: 0.5;
    pointer-events: none;
}

.cxs-chart-hl-dot {
    fill: var(--primary, #4285f4);
    stroke: var(--bg-light, var(--bg, #1f1f1f));
    stroke-width: 2;
    pointer-events: none;
}

.cxs-chart-tooltip {
    position: absolute;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.15s ease;
    top: 0;
}

.cxs-chart-tooltip--visible {
    opacity: 1;
}

.cxs-tt-date {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

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

/* -- Places Slot ------------------------------------------------ */

.results-slot-panel:has(> .results-slot-panel-body > .places-wrap.slot-full-width) {
  overflow: visible;
  max-width: none;
}

.places-wrap {
  margin-bottom: 0;
  max-width: 680px;
}

#results-page.degoog-fullwidth-slot-shell .places-wrap.slot-full-width {
  max-width: none;
}

.places-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  row-gap: 6px;
  margin-bottom: 12px;
}

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

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

.places-geo-btn {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-light);
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.places-geo-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.places-geo-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.places-layout {
  display: grid;
  gap: 12px;
}

.places-osm-attribution {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
}

.places-osm-attribution a {
  color: var(--text-link);
}

#results-page.degoog-fullwidth-slot-shell .places-layout {
  grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
  align-items: stretch;
}

/* Scroll lives on the list column — scrollbar sits on the outer edge, not over cards */
.places-list-col {
  min-height: 0;
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-right: 2px;
}

.places-list-col::-webkit-scrollbar {
  width: 8px;
}

.places-list-col::-webkit-scrollbar-track {
  background: transparent;
}

.places-list-col::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.places-list-col::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
  background-clip: padding-box;
}

.places-grid {
  display: grid;
  gap: 8px;
}

/* -- Result cards (Google local-pack inspired) ------------------- */

.places-card {
  border: 1px solid var(--slot-inset-border, var(--border-light));
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--slot-inset-bg, var(--bg-light));
  cursor: pointer;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.places-card:hover,
.places-card:focus-visible {
  border-color: rgba(26, 115, 232, 0.35);
  box-shadow: 0 1px 6px rgba(60, 64, 67, 0.12);
  outline: none;
}

.places-card-selected {
  border-color: rgba(26, 115, 232, 0.55);
  background: rgba(26, 115, 232, 0.04);
  box-shadow: 0 2px 10px rgba(26, 115, 232, 0.12);
}

.places-card-main {
  margin-bottom: 10px;
}

.places-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}

.places-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-link, #1a73e8);
  margin: 0;
  line-height: 1.35;
  word-break: break-word;
}

.places-distance {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Inline meta: "Category · Open · Closes 9 PM" */
.places-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin: 0 0 4px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
  overflow: hidden;
}

.places-meta-type {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.places-meta-sep {
  color: var(--text-secondary);
  opacity: 0.65;
  padding: 0 0.35em;
}

.places-hours {
  font-weight: 600;
  white-space: nowrap;
}

.places-hours-open {
  color: #137333;
}

.places-hours-closed {
  color: #c5221f;
}

.places-today-hours {
  color: var(--text-secondary);
  white-space: nowrap;
}

.places-address {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

.places-hours-toggle {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-link, #1a73e8);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.places-hours-toggle:hover {
  text-decoration: underline;
}

.places-hours-toggle::after {
  content: " ▾";
  font-size: 0.7em;
}

.places-hours-toggle.places-hours-toggle-open::after {
  content: " ▴";
}

.places-week {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.places-week[hidden] {
  display: none !important;
}

.places-week-row {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Compact icon action row */
.places-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.places-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: #1a73e8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  text-decoration: none;
  padding: 0;
}

.places-action-btn:hover:not(.places-disabled) {
  background: rgba(26, 115, 232, 0.08);
  border-color: rgba(26, 115, 232, 0.45);
  text-decoration: none;
  transform: translateY(-1px);
}

.places-action-btn.places-disabled {
  color: var(--text-secondary);
  border-color: var(--border-light);
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* -- Map -------------------------------------------------------- */

.places-map {
  min-height: 280px;
  border: 1px solid var(--slot-inset-border, var(--border));
  border-radius: 16px;
  background: var(--slot-inset-bg, var(--bg-light));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.places-tile-map {
  position: relative;
  min-height: 280px;
  flex: 1;
  overflow: hidden;
  background: var(--bg);
  cursor: grab;
  user-select: none;
}

.places-tile-map:active {
  cursor: grabbing;
}

.places-map-extlinks {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
}

.places-map-ext-btn {
  width: 34px;
  height: 34px;
  border-radius: 100px;
  border: 1px solid rgba(60, 64, 67, 0.14);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  box-shadow:
    0 1px 2px rgba(60, 64, 67, 0.18),
    0 1px 6px rgba(60, 64, 67, 0.12);
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

[data-theme="dark"] .places-map-ext-btn {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(48, 49, 52, 0.94);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.28);
}

.places-map-extlinks a.places-map-ext-btn,
.places-map-extlinks a.places-map-ext-btn:visited,
.places-map-extlinks a.places-map-ext-btn:hover,
.places-map-extlinks a.places-map-ext-btn:focus-visible {
  color: var(--text-primary);
  text-decoration: none;
}

.places-map-ext-btn:hover {
  background: #fff;
  box-shadow:
    0 2px 6px rgba(60, 64, 67, 0.22),
    0 4px 12px rgba(60, 64, 67, 0.14);
  transform: translateY(-1px);
  text-decoration: none;
}

[data-theme="dark"] .places-map-ext-btn:hover {
  background: rgba(60, 64, 67, 0.98);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.5),
    0 4px 14px rgba(0, 0, 0, 0.32);
}

.places-map-ext-btn svg.places-map-ext-icon,
.places-map-ext-btn svg {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

/* OSM: icon is the full green tile — flush inside the chip */
.places-map-ext-osm {
  padding: 0;
  overflow: hidden;
}

.places-map-ext-osm svg {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
  border-radius: 6px;
}

.places-map-ext-apple svg path {
  fill: #1d1d1f;
}

[data-theme="dark"] .places-map-ext-apple svg path {
  fill: #f5f5f7;
}

.places-tile-layer {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.places-tile {
  position: absolute;
  width: 256px;
  height: 256px;
  user-select: none;
  pointer-events: none;
}

.places-pin-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  will-change: transform;
}

.places-pin {
  position: absolute;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #1a73e8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -100%) rotate(-45deg);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  z-index: 2;
}

.places-pin:hover {
  background: #1557b0;
  z-index: 4;
}

.places-pin-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  pointer-events: none;
}

.places-pin-active {
  width: 30px;
  height: 30px;
  background: #ea4335;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  z-index: 5;
}

.places-pin-active .places-pin-label {
  font-size: 0.74rem;
}

.places-zoom-controls {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 3;
}

.places-zoom-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-light);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  line-height: 1;
  padding: 0;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--text-primary) 12%, transparent);
}

.places-zoom-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.places-zoom-btn:active {
  background: var(--border-light);
}

/* -- Directions modal ------------------------------------------- */

.places-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.places-modal[hidden] {
  display: none;
}

.places-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.places-modal-content {
  position: relative;
  z-index: 1;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.places-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}

.places-modal-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.places-modal-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  padding: 0;
  line-height: 1;
}

.places-modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.places-modal-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.places-modal-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.places-modal-option:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  text-decoration: none;
}

/* -- Mobile ----------------------------------------------------- */

@media (max-width: 1050px) {
  #results-page.degoog-fullwidth-slot-shell .places-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .places-card {
    padding: 11px 12px;
  }

  .places-card-title-row {
    flex-direction: column;
    gap: 2px;
  }

  .places-distance {
    align-self: flex-start;
  }

  .places-list-col {
    max-height: 420px;
  }

  .places-map,
  .places-tile-map {
    min-height: 220px;
  }

  .places-map-extlinks {
    top: 8px;
    right: 8px;
    gap: 4px;
  }

  .places-map-ext-btn {
    width: 32px;
    height: 32px;
  }

  .places-modal-content {
    min-width: 240px;
    max-width: 300px;
    margin: 0 16px;
  }
}

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

html[dir="rtl"] .apps-pocket-panel {
  right: auto;
  left: 0;
}

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

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

@media (min-width: 767.98px) {
  .apps-pocket-wrapper {
    position: relative;
  }
}

.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-wrapper {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    display: flex;
    margin-left: 0;
  }

  #results-header #nav-settings-results {
    position: relative;
    top: auto;
    right: auto;
  }
}

.apps-pocket-panel {
  position: absolute;
  z-index: 9999;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 16px));
  max-height: min(70vh, 480px);
  overflow: auto;
  padding: 12px;
}

@media (max-width: 767.98px) {
  .apps-pocket-panel {
    position: fixed;
    top: 56px;
    right: 8px;
    left: 8px;
    width: auto;
  }
}

.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: 100%;
  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;
}

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

.weather-result {
  padding: 1.5em 0;
  max-width: 652px;
  color: var(--text-primary);
}

.weather-result .ti {
  font-size: 1.25em;
  opacity: 0.9;
  color: var(--text-primary);
}

.weather-location {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.weather-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.weather-hero-icon {
  flex-shrink: 0;
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.weather-hero-icon .ti {
  font-size: 2.5rem;
  color: var(--primary, #1a73e8);
}

.weather-hero-text {
  min-width: 0;
}

.weather-temp {
  font-size: 2rem;
  margin: 0 0 0.2rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.weather-desc {
  font-size: 0.9375rem;
  font-weight: 400;
  opacity: 0.85;
  color: var(--text-secondary);
}

.weather-feels {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.weather-now-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.weather-now-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.weather-now-icon {
  flex-shrink: 0;
  font-size: 1.1rem !important;
  opacity: 0.7;
  color: var(--text-secondary) !important;
}

.weather-value {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.weather-week-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.8;
}

.weather-week-wrap {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-light);
  overflow: hidden;
}

.weather-week {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.weather-week th,
.weather-week td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.weather-week th {
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.7rem;
}

.weather-week tbody tr:last-child td {
  border-bottom: none;
}

.weather-week-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.weather-week-row:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.04));
}

.weather-week-row:focus {
  outline: 2px solid var(--primary, #1a73e8);
  outline-offset: -2px;
}

.weather-day {
  font-weight: 600;
  color: var(--text-primary);
  width: 3.5rem;
}

.weather-day-icon .ti {
  font-size: 1.35rem !important;
  color: var(--primary, #1a73e8) !important;
}

.weather-day-temps {
  font-weight: 500;
  color: var(--text-primary);
}

.weather-day-precip {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.weather-day-precip .ti {
  font-size: 0.9rem !important;
  opacity: 0.8;
  margin-right: 0.2rem;
}

.weather-hourly-row td {
  padding: 0 !important;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  background: var(--bg-light);
}

.weather-hourly-cell {
  padding: 0.75rem 1rem !important;
  overflow: hidden;
}

.weather-hourly-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0;
  margin: 0 -0.25rem 0 0;
}

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

.weather-hourly-scroll::-webkit-scrollbar {
  height: 6px;
}

.weather-hourly-scroll::-webkit-scrollbar-track {
  background: var(--border-light);
  border-radius: 3px;
}

.weather-hourly-scroll::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  opacity: 0.3;
  border-radius: 3px;
}

.weather-hour-card {
  flex: 0 0 auto;
  min-width: 4.25rem;
  padding: 0.6rem 0.5rem;
  background: var(--search-bar-bg, #fff);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.weather-hour-time {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.weather-hour-icon {
  font-size: 1.5rem !important;
  color: var(--primary, #1a73e8) !important;
}

.weather-hour-temp {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.weather-hour-precip {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.qr-result .qr-label {
  word-break: break-all;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.qr-result .qr-image {
  display: block;
  border-radius: 8px;
}
