.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-thumb--logo {
  display: block;
  max-width: 80%;
  max-height: 60px;
  width: auto;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 0.75rem;
  margin: 0.75rem auto 2rem auto;
}

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

.metro-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-primary, #202124);
  font-family: Roboto, Arial, sans-serif;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: none;
}

/* Outer layout adjustments when in degoog result panels */
.results-slot-panel:has(.metro-card) {
  overflow: hidden;
}

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

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

/* literallygoogle / literallyapple theme support: flatten outer slot shell and add card styling to metro-card */
#results-page.degoog-fullwidth-slot-shell .results-slot-panel:has(.metro-card) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

#results-page.degoog-fullwidth-slot-shell .results-slot-panel:has(.metro-card) > .results-slot-panel-body {
  padding: 0 !important;
}

#results-page.degoog-fullwidth-slot-shell .metro-card {
  background: var(--slot-inset-bg, var(--bg-secondary, var(--bg-light, #ffffff))) !important;
  border: 1px solid var(--slot-inset-border, var(--border-light, #e0e0e0)) !important;
  border-radius: var(--theme-radius-lg, 16px) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
  padding: 20px !important;
  margin: 0 auto !important;
  max-width: 600px !important;
}

/* Layout details */
.metro-card *,
.metro-card *::before,
.metro-card *::after {
  box-sizing: border-box;
}

.metro-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light, #e0e0e0);
  padding-bottom: 12px;
}

.metro-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary, #202124);
}

.metro-title-icon {
  color: var(--text-link, #1a73e8);
}

.metro-tempo-text {
  font-size: 0.9rem;
  color: var(--text-secondary, #5f6368);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Display Section */
.metro-display-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.metro-dots-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  height: 16px;
  margin-bottom: 12px;
}

.metro-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--border-light, #dadce0);
  transition: background-color 0.1s ease, transform 0.1s ease;
}

.metro-dot.active {
  background-color: var(--text-link, #1a73e8);
  transform: scale(1.3);
}

.metro-dot.active.accent {
  background-color: #ea4335; /* Premium downbeat red accent */
}

.metro-dot[hidden] {
  display: none !important;
}

.metro-bpm-container {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin: 4px 0;
}

.metro-bpm-val {
  font-size: 3.8rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, #202124);
}

.metro-bpm-unit {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary, #5f6368);
  margin-left: 6px;
}

/* Controls */
.metro-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.metro-slider-group {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}

.metro-btn {
  border: 1px solid var(--border-light, #dadce0);
  border-radius: 100px;
  background: var(--bg, #ffffff);
  color: var(--text-primary, #202124);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, border-color 150ms;
}

.metro-btn:hover {
  background: var(--bg-hover, #f1f3f4);
  border-color: var(--text-secondary, #9aa0a6);
}

.metro-btn:active {
  background: var(--bg-active, #e8eaed);
}

.metro-adjust-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  flex-shrink: 0;
}

.metro-slider {
  flex-grow: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border-light, #dadce0);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.metro-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-link, #1a73e8);
  cursor: pointer;
  border: none;
  transition: transform 100ms;
}

.metro-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.metro-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-link, #1a73e8);
  cursor: pointer;
  border: none;
  transition: transform 100ms;
}

.metro-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Play button and pulse animation */
.metro-action-group {
  display: flex;
  justify-content: center;
  width: 100%;
}

.metro-play-btn {
  position: relative;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: var(--text-link, #1a73e8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: background-color 150ms, transform 100ms;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.metro-play-btn svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.metro-play-btn:hover {
  background-color: var(--primary, #1557b0);
}

.metro-play-btn:active {
  transform: scale(0.95);
}

@keyframes metro-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.5);
  }
  30% {
    transform: scale(1.08);
    box-shadow: 0 0 0 10px rgba(26, 115, 232, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(26, 115, 232, 0);
  }
}

.metro-play-btn.pulse {
  animation: metro-pulse 0.22s cubic-bezier(0.1, 0.8, 0.3, 1);
}

/* Footer elements */
.metro-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light, #e0e0e0);
  padding-top: 14px;
}

.metro-footer-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metro-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary, #5f6368);
  font-weight: 500;
}

.metro-select {
  padding: 6px 32px 6px 14px;
  font-size: 0.85rem;
  border: 1px solid var(--border-light, #dadce0);
  border-radius: 100px;
  background: var(--bg, #ffffff);
  color: var(--text-primary, #202124);
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

.metro-select:hover {
  border-color: var(--text-secondary, #9aa0a6);
}

.metro-tap-btn {
  height: 32px;
  padding: 0 16px;
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.metro-hidden {
  display: none !important;
}

/* Dark mode overrides (fallback for standard themes) */
@media (prefers-color-scheme: dark) {
  .metro-card {
    background: var(--bg-light, #202124);
    border-color: var(--border-light, #3c4043);
    color: var(--text-primary, #e8eaed);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  .metro-header {
    border-bottom-color: var(--border-light, #3c4043);
  }
  .metro-tempo-text {
    color: var(--text-secondary, #9aa0a6);
  }
  .metro-dot {
    background-color: var(--border-light, #3c4043);
  }
  .metro-bpm-unit {
    color: var(--text-secondary, #9aa0a6);
  }
  .metro-btn {
    border-color: var(--border-light, #3c4043);
    background: var(--bg, #292a2d);
    color: var(--text-primary, #e8eaed);
  }
  .metro-btn:hover {
    background: var(--bg-hover, #3c4043);
    border-color: var(--text-secondary, #9aa0a6);
  }
  .metro-btn:active {
    background: var(--bg-active, #4f5357);
  }
  .metro-slider {
    background: var(--border-light, #3c4043);
  }
  .metro-footer {
    border-top-color: var(--border-light, #3c4043);
  }
  .metro-label {
    color: var(--text-secondary, #9aa0a6);
  }
  .metro-select {
    border-color: var(--border-light, #3c4043);
    background-color: var(--bg, #292a2d);
    color: var(--text-primary, #e8eaed);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa0a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  }
}

.timer-widget {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
    user-select: none;
}

/* Flatten degoog slot shell — .timer-widget is the visible card. */
.results-slot-panel:has(.timer-widget) {
    overflow: hidden;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.results-slot-panel:has(.timer-widget) .results-slot-panel-body {
    padding: 0;
}

.results-slot-panel:has(.timer-widget) .results-slot-panel-title {
    display: none;
}

#results-sidebar .timer-widget,
.results-slot-panel:has(.timer-widget) .timer-widget {
    width: 100%;
    max-width: none;
    margin: 0;
    background: var(--bg-light, var(--bg));
    border: 0;
    border-radius: 1rem;
}

#at-a-glance .results-slot-panel:has(.timer-widget) {
    overflow: hidden;
}

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

#at-a-glance .results-slot-panel:has(.timer-widget) .timer-widget {
    max-width: none;
    background: var(--bg-light, var(--bg));
    border-radius: 12px;
}

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

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

.timer-tab,
.timer-icon-btn,
.timer-action-btn {
  font: inherit;
  color: inherit;
}

.timer-tab {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
}

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

.timer-tab[aria-selected="true"] {
  color: var(--text-primary);
  background: var(--bg);
  border-color: var(--border-light, var(--border));
}

.timer-tab[aria-selected="true"] svg {
  color: var(--text-link);
}

.timer-icon-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.timer-icon-btn:hover,
.timer-icon-btn[aria-pressed="true"] {
  color: var(--text-primary);
  background: var(--bg);
}

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

.timer-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
}

.timer-circle {
  position: relative;
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
}

.timer-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

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

.timer-progress {
  stroke: var(--text-link);
  stroke-dasharray: 339.292;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
}

.timer-display {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 138px;
  min-height: 34px;
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.timer-widget[data-mode="stopwatch"] .timer-display {
  cursor: default;
}

.timer-display-input {
  position: relative;
  z-index: 1;
  width: 112px;
  min-height: 34px;
  padding: 0 4px 2px;
  border: 0;
  border-bottom: 2px solid var(--text-link);
  outline: 0;
  color: var(--text-primary);
  background: transparent;
  font: inherit;
  font-size: 1.75rem;
  font-weight: 650;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.timer-tone-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-light, var(--border));
}

.timer-widget[data-mode="stopwatch"] .timer-tone-bar {
  display: none;
}

.timer-tone-label {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.timer-tone-select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  height: 32px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border-light, var(--border));
  border-radius: 100px;
  background: var(--bg, #fff);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

.timer-tone-select:hover {
  border-color: var(--border);
  background-color: var(--bg-hover, var(--bg-light));
}

.timer-tone-select:focus {
  outline: 0;
  border-color: var(--text-link, #1a73e8);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-link, #1a73e8) 18%, transparent);
}

.timer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border-light, var(--border));
}

.timer-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}

.timer-action-btn svg {
  pointer-events: none;
}

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

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

.timer-widget[data-running="true"] .timer-action-btn[data-timer-action="toggle-play"],
.timer-widget[data-alarming="true"] .timer-action-btn[data-timer-action="toggle-play"] {
  color: var(--text-link);
}

@media (max-width: 420px) {
  .timer-tab span {
    display: none;
  }

  .timer-tab {
    width: 34px;
    padding: 0;
  }

  .timer-circle {
    width: 136px;
    height: 136px;
  }

  .timer-display {
    font-size: 1.78rem;
  }
}

/* literallygoogle theme support */
#results-page.degoog-fullwidth-slot-shell .timer-widget {
    border: 1px solid var(--border-light, var(--border));
    border-radius: 16px;
    margin: 0 auto;
}

.until-card {
    container-type: inline-size;
    color: var(--until-text, var(--text-primary, CanvasText));
    --until-text: var(--text-primary, #202124);
    --until-muted: var(--text-secondary, #5f6368);
    --until-board: var(--bg, #ffffff);
    --until-board-2: var(--bg-light, #f8f9fa);
    --until-flap-text: var(--text-primary, #202124);
    --until-edge: color-mix(in srgb, var(--border, #dadce0) 82%, var(--bg, #ffffff));
    --until-line: color-mix(in srgb, var(--border, #dadce0) 72%, transparent);
    --until-amber: var(--warning, #fbbc04);
    --until-blue: var(--primary, #1a73e8);
    --until-green: var(--success, #188038);
    --until-accent: var(--text-link, var(--primary, #1a73e8));
    --until-panel-highlight: rgba(255, 255, 255, 0.78);
    --until-panel-shadow: rgba(60, 64, 67, 0.14);
    --until-panel-shadow-strong: rgba(60, 64, 67, 0.2);
    --until-flap-border: color-mix(in srgb, var(--border, #dadce0) 86%, var(--bg, #ffffff));
    --until-flap-highlight: rgba(255, 255, 255, 0.82);
    --until-flap-lowlight: color-mix(in srgb, var(--border, #dadce0) 36%, transparent);
    --until-flap-shadow: rgba(60, 64, 67, 0.18);
    --until-flap-text-shadow: rgba(255, 255, 255, 0.7);
    --until-hinge: color-mix(in srgb, var(--border, #dadce0) 86%, rgba(0, 0, 0, 0.2));
    --until-hinge-highlight: rgba(255, 255, 255, 0.8);
    --until-chip-bg: color-mix(in srgb, var(--bg-light, #f8f9fa) 86%, transparent);
    --until-detail-bg: color-mix(in srgb, var(--bg-light, #f8f9fa) 72%, transparent);
    --until-detail-bg-hover: color-mix(in srgb, var(--primary, #1a73e8) 8%, var(--bg-light, #f8f9fa));
    /* Material-ish rounding hierarchy. */
    --until-radius: 24px;
    --until-radius-sm: 14px;
    --until-radius-flap: 10px;
}

[data-theme="dark"] .until-card {
    --until-text: var(--text-primary, #e8eaed);
    --until-muted: var(--text-secondary, #a1a1aa);
    --until-board: #17181b;
    --until-board-2: #202126;
    --until-flap-text: #f8fafc;
    --until-edge: color-mix(in srgb, var(--border, #4b5563) 72%, #9ca3af);
    --until-line: rgba(255, 255, 255, 0.1);
    --until-amber: #fbbf24;
    --until-blue: #8ab4f8;
    --until-green: #86efac;
    --until-accent: #8ab4f8;
    --until-panel-highlight: rgba(255, 255, 255, 0.08);
    --until-panel-shadow: rgba(0, 0, 0, 0.24);
    --until-panel-shadow-strong: rgba(0, 0, 0, 0.3);
    --until-flap-border: rgba(255, 255, 255, 0.12);
    --until-flap-highlight: rgba(255, 255, 255, 0.12);
    --until-flap-lowlight: rgba(0, 0, 0, 0.5);
    --until-flap-shadow: rgba(0, 0, 0, 0.26);
    --until-flap-text-shadow: rgba(0, 0, 0, 0.48);
    --until-hinge: rgba(0, 0, 0, 0.45);
    --until-hinge-highlight: rgba(255, 255, 255, 0.05);
    --until-chip-bg: rgba(255, 255, 255, 0.05);
    --until-detail-bg: rgba(255, 255, 255, 0.045);
    --until-detail-bg-hover: rgba(255, 255, 255, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .until-card {
        --until-text: var(--text-primary, #e8eaed);
        --until-muted: var(--text-secondary, #a1a1aa);
        --until-board: #17181b;
        --until-board-2: #202126;
        --until-flap-text: #f8fafc;
        --until-edge: color-mix(in srgb, var(--border, #4b5563) 72%, #9ca3af);
        --until-line: rgba(255, 255, 255, 0.1);
        --until-amber: #fbbf24;
        --until-blue: #8ab4f8;
        --until-green: #86efac;
        --until-accent: #8ab4f8;
        --until-panel-highlight: rgba(255, 255, 255, 0.08);
        --until-panel-shadow: rgba(0, 0, 0, 0.24);
        --until-panel-shadow-strong: rgba(0, 0, 0, 0.3);
        --until-flap-border: rgba(255, 255, 255, 0.12);
        --until-flap-highlight: rgba(255, 255, 255, 0.12);
        --until-flap-lowlight: rgba(0, 0, 0, 0.5);
        --until-flap-shadow: rgba(0, 0, 0, 0.26);
        --until-flap-text-shadow: rgba(0, 0, 0, 0.48);
        --until-hinge: rgba(0, 0, 0, 0.45);
        --until-hinge-highlight: rgba(255, 255, 255, 0.05);
        --until-chip-bg: rgba(255, 255, 255, 0.05);
        --until-detail-bg: rgba(255, 255, 255, 0.045);
        --until-detail-bg-hover: rgba(255, 255, 255, 0.08);
    }
}

.results-slot-panel:has(> .results-slot-panel-body > .until-card) {
    max-width: none;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

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

.until-card__panel {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(230px, 0.92fr);
    grid-template-areas:
        "header header"
        "main details";
    gap: 14px 18px;
    align-items: stretch;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--until-edge);
    border-radius: var(--until-radius);
    background:
        linear-gradient(180deg, var(--until-panel-highlight), transparent 36%),
        linear-gradient(135deg, color-mix(in srgb, var(--until-blue) 10%, transparent), transparent 52%),
        var(--until-board);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--until-panel-highlight) 80%, transparent),
        0 1px 2px var(--until-panel-shadow-strong),
        0 10px 30px var(--until-panel-shadow);
}

.until-card__header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 0 2px 10px;
    border-bottom: 1px solid var(--until-line);
}

.until-card__kicker,
.until-card__status,
.until-card__eyebrow,
.until-card__detail dt {
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.until-card__kicker {
    flex: 0 0 auto;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--until-line);
    background: var(--until-chip-bg);
    color: color-mix(in srgb, var(--until-muted) 88%, var(--until-text));
}

.until-card__status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid color-mix(in srgb, var(--until-green) 42%, transparent);
    border-radius: 999px;
    color: var(--until-green);
    background: color-mix(in srgb, var(--until-green) 10%, transparent);
}

/* Google-style status chip dot. */
.until-card__status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
    transform-origin: center;
    animation: until-status-pulse 1.8s ease-out infinite;
}

.until-card--past .until-card__status {
    color: var(--until-amber);
    border-color: color-mix(in srgb, var(--until-amber) 42%, transparent);
    background: color-mix(in srgb, var(--until-amber) 11%, transparent);
}

.until-card__main {
    grid-area: main;
    display: grid;
    align-content: center;
    gap: 10px;
    min-width: 0;
}

.until-card__eyebrow {
    color: var(--until-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.until-card__answer {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 9px 12px;
    min-width: 0;
    color: var(--text-primary, inherit);
    line-height: 1;
}

.until-card__answer--small {
    display: block;
    color: var(--until-text);
    font-size: 1.34rem;
    font-weight: 780;
    line-height: 1.16;
}

.until-card__part {
    display: inline-grid;
    grid-template-columns: auto;
    gap: 6px;
    min-width: 0;
}

.until-card__flap {
    position: relative;
    display: block;
    width: max-content;
    min-width: var(--until-flap-width, 76px);
    height: var(--until-flap-height, 64px);
    border: 1px solid var(--until-flap-border);
    border-radius: var(--until-radius-flap);
    overflow: hidden;
    color: var(--until-flap-text);
    background: var(--until-board-2);
    box-shadow:
        inset 0 1px 0 var(--until-flap-highlight),
        inset 0 -1px 0 var(--until-flap-lowlight),
        0 6px 16px var(--until-flap-shadow);
    font-variant-numeric: tabular-nums;
    perspective: 320px;
}

/* Hidden in-flow element rendered at the real value size so the flap grows
   to fit any number (e.g. "366,000" days). The four animated leaves are
   absolutely positioned and don't contribute width, so this is what the
   max-content box measures; --until-flap-width stays a per-level minimum. */
.until-card__flap-sizer {
    display: block;
    visibility: hidden;
    height: var(--until-flap-height, 64px);
    padding: 0 14px;
    font-size: var(--until-part-value-size, 1.42rem);
    font-weight: var(--until-part-value-weight, 700);
    line-height: var(--until-flap-height, 64px);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Hairline hinge that splits the flap into two leaves. */
.until-card__flap::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    height: 1px;
    z-index: 6;
    background: var(--until-hinge);
    box-shadow: 0 1px 0 var(--until-hinge-highlight);
}

.until-card__flap-card {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    box-sizing: border-box;
    overflow: hidden;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--until-flap-highlight) 68%, transparent), transparent 60%),
        var(--until-board-2);
}

.until-card__flap-card--upper {
    top: 0;
    z-index: 1;
    border-radius: var(--until-radius-flap) var(--until-radius-flap) 0 0;
}

.until-card__flap-card--lower {
    bottom: 0;
    z-index: 1;
    border-radius: 0 0 var(--until-radius-flap) var(--until-radius-flap);
}

/* Real split-flap motion: the old top leaf folds over the hinge, then the
   new lower leaf drops into place. These are solid half-cards, not masks, so
   the lower quarter cannot go transparent mid-animation. */
.until-card__flap-card--flip-upper {
    top: 0;
    z-index: 4;
    border-radius: var(--until-radius-flap) var(--until-radius-flap) 0 0;
    transform-origin: center bottom;
    transform: rotateX(0deg);
    backface-visibility: visible;
    pointer-events: none;
    visibility: hidden;
}

.until-card__flap-card--flip-lower {
    bottom: 0;
    z-index: 5;
    border-radius: 0 0 var(--until-radius-flap) var(--until-radius-flap);
    transform-origin: center top;
    transform: rotateX(180deg);
    backface-visibility: hidden;
    pointer-events: none;
    visibility: hidden;
}

.until-card__flap-text {
    position: absolute;
    left: 0;
    right: 0;
    height: 200%;
    display: grid;
    place-items: center;
    padding: 0 10px;
    color: var(--until-flap-text);
    font-size: var(--until-part-value-size, 1.42rem);
    font-weight: var(--until-part-value-weight, 700);
    line-height: 1;
    text-shadow: none;
    font-variant-numeric: tabular-nums;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.until-card__flap-card--upper .until-card__flap-text,
.until-card__flap-card--flip-upper .until-card__flap-text {
    top: 0;
}

.until-card__flap-card--lower .until-card__flap-text,
.until-card__flap-card--flip-lower .until-card__flap-text {
    bottom: 0;
}

.until-card__flap--anim .until-card__flap-card--flip-upper {
    animation: until-flip-top 341ms cubic-bezier(0.36, 0, 0.66, 1) both;
    visibility: visible;
}

.until-card__flap--anim .until-card__flap-card--flip-lower {
    animation: until-flip-bottom 341ms cubic-bezier(0.34, 0.62, 0.46, 1) both;
    visibility: visible;
}

.until-card__part-unit {
    color: var(--until-muted);
    font-size: var(--until-part-unit-size, 0.78rem);
    font-weight: 760;
    letter-spacing: 0.08em;
    line-height: 1.1;
    text-transform: uppercase;
}

.until-card__part--0 {
    --until-flap-width: 96px;
    --until-flap-height: 76px;
    --until-part-value-size: 2.24rem;
    --until-part-value-weight: 700;
    --until-part-unit-size: 0.82rem;
}

.until-card__part--1 {
    --until-flap-width: 82px;
    --until-flap-height: 66px;
    --until-part-value-size: 1.72rem;
}

.until-card__part--2 {
    --until-flap-width: 74px;
    --until-flap-height: 58px;
    --until-part-value-size: 1.46rem;
}

.until-card__part--3,
.until-card__part--4,
.until-card__part--5,
.until-card__part--6 {
    --until-flap-width: 68px;
    --until-flap-height: 54px;
    --until-part-value-size: 1.28rem;
}

.until-card__now {
    color: var(--until-text);
    font-size: 2.2rem;
    font-weight: 820;
    line-height: 1;
    text-shadow: 0 1px 1px var(--until-flap-text-shadow);
}

.until-card__caption {
    color: var(--until-muted);
    font-size: 0.92rem;
    line-height: 1.35;
}

.until-card__details {
    grid-area: details;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
}

.until-card__detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 42px;
    padding: 4px 5px 4px 12px;
    border: 1px solid var(--until-line);
    border-radius: 999px;
    background: var(--until-chip-bg);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--until-panel-highlight) 56%, transparent),
        0 1px 2px color-mix(in srgb, var(--until-panel-shadow) 70%, transparent);
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.until-card__detail:hover {
    transform: translateY(-1px);
    background: var(--until-detail-bg-hover);
    border-color: color-mix(in srgb, var(--until-accent) 40%, var(--until-line));
}

.until-card__detail dt {
    margin: 0;
    color: color-mix(in srgb, var(--until-muted) 86%, var(--until-text));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.until-card__detail dd {
    position: relative;
    isolation: isolate;
    display: block;
    min-width: 58px;
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--until-flap-border);
    border-radius: 999px;
    overflow: hidden;
    margin: 0;
    color: var(--until-flap-text);
    background: var(--until-board-2);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--until-flap-highlight) 72%, transparent),
        inset 0 -1px 0 color-mix(in srgb, var(--until-flap-lowlight) 56%, transparent);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    perspective: 180px;
}

.until-card__detail-sizer {
    display: block;
    visibility: hidden;
    min-height: 32px;
    padding: 0 10px;
    line-height: 32px;
    white-space: nowrap;
}

.until-card__detail-half {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    overflow: hidden;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--until-flap-highlight) 60%, transparent), transparent 62%),
        var(--until-board-2);
}

.until-card__detail-half--upper {
    top: 0;
    z-index: 1;
    border-radius: 999px 999px 0 0;
}

.until-card__detail-half--lower {
    bottom: 0;
    z-index: 1;
    border-radius: 0 0 999px 999px;
}

.until-card__detail-half--flip-upper {
    top: 0;
    z-index: 4;
    border-radius: 999px 999px 0 0;
    transform-origin: center bottom;
    transform: rotateX(0deg);
    backface-visibility: visible;
    visibility: hidden;
}

.until-card__detail-half--flip-lower {
    bottom: 0;
    z-index: 5;
    border-radius: 0 0 999px 999px;
    transform-origin: center top;
    transform: rotateX(180deg);
    backface-visibility: hidden;
    visibility: hidden;
}

.until-card__detail-text {
    position: absolute;
    left: 0;
    right: 0;
    height: 200%;
    display: grid;
    place-items: center;
    padding: 0 10px;
    color: var(--until-flap-text);
    line-height: 1;
    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
}

.until-card__detail-half--upper .until-card__detail-text,
.until-card__detail-half--flip-upper .until-card__detail-text {
    top: 0;
}

.until-card__detail-half--lower .until-card__detail-text,
.until-card__detail-half--flip-lower .until-card__detail-text {
    bottom: 0;
}

.until-card__detail-value--anim .until-card__detail-half--flip-upper {
    animation: until-flip-top 317ms cubic-bezier(0.36, 0, 0.66, 1) both;
    visibility: visible;
}

.until-card__detail-value--anim .until-card__detail-half--flip-lower {
    animation: until-flip-bottom 317ms cubic-bezier(0.34, 0.62, 0.46, 1) both;
    visibility: visible;
}

.until-card__detail dd::after {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    z-index: 6;
    height: 1px;
    background: var(--until-hinge);
    box-shadow: 0 1px 0 var(--until-hinge-highlight);
    pointer-events: none;
}

@keyframes until-status-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
    }
    45% {
        transform: scale(1.12);
        box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 0%, transparent);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 0%, transparent);
    }
}

/* Phase 1: the old upper half rotates around the center hinge. The solid back
   continues over the lower half, matching the mechanical leaf path. */
@keyframes until-flip-top {
    0% {
        transform: rotateX(0deg);
    }
    48% {
        transform: rotateX(-92deg);
    }
    100% {
        transform: rotateX(-180deg);
    }
}

/* Phase 2: the new lower half starts folded behind the hinge, then rotates
   into the bottom half as a normal solid flap. */
@keyframes until-flip-bottom {
    0%,
    50% {
        transform: rotateX(180deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

@container (max-width: 650px) {
    .until-card__panel {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "details";
    }

    .until-card__eyebrow {
        white-space: normal;
    }
}

@container (max-width: 430px) {
    .until-card__panel {
        padding: 12px;
    }

    .until-card__answer {
        gap: 8px;
    }

    .until-card__part--0,
    .until-card__part--1,
    .until-card__part--2,
    .until-card__part--3 {
        --until-flap-width: 72px;
        --until-flap-height: 58px;
        --until-part-value-size: 1.48rem;
    }

    .until-card__details {
        grid-template-columns: 1fr;
    }
}

@container (max-width: 340px) {
    .until-card__details {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .until-card__status::before,
    .until-card__flap-card--flip-upper,
    .until-card__flap-card--flip-lower,
    .until-card__detail-half--flip-upper,
    .until-card__detail-half--flip-lower {
        animation: none !important;
    }

    .until-card__flap-card--flip-upper {
        transform: rotateX(0deg);
    }

    .until-card__flap-card--flip-lower {
        transform: rotateX(180deg);
    }
}

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

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

.ttt-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  background: transparent;
  color: var(--text-primary, #202124);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  user-select: none;
}

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

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

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

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

.results-slot-panel:has(.ttt-card) .ttt-card {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Header & Controls */
.ttt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ttt-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary, #202124);
}

.ttt-select {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 6px 28px 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--border-light, #dadce0);
  background: var(--bg, #fff);
  color: var(--text-primary, #202124);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

.ttt-select:focus {
  border-color: var(--text-link, #1a73e8);
}

/* Turn Indicator */
.ttt-turn-indicator {
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 12px;
  height: 20px;
  line-height: 20px;
  color: var(--text-primary, #202124);
}

/* Score Board */
.ttt-score-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  text-align: center;
}

.ttt-score-box {
  background: var(--bg-light, #f8fafd);
  border: 1px solid var(--border-light, #dadce0);
  border-radius: 8px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ttt-score-label {
  font-size: 0.75rem;
  color: var(--text-secondary, #5f6368);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ttt-score-val {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #202124);
}

/* Game Board Area */
.ttt-game-area {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px 0;
}

.ttt-grid-wrapper {
  width: 100%;
  max-width: 260px;
}

.ttt-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 6px;
  background: var(--border-light, #dadce0);
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
}

.ttt-cell {
  background: var(--bg, #fff);
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18%;
  color: var(--text-primary, #202124);
  transition: background 150ms ease;
  position: relative;
}

.ttt-cell:hover:not([disabled]) {
  background: var(--bg-hover, rgba(60, 64, 67, 0.04));
}

.ttt-cell:focus-visible {
  outline: 2px solid var(--text-link, #1a73e8);
  outline-offset: -2px;
}

.ttt-cell[disabled] {
  cursor: default;
}

/* Symbols SVG Styling */
.ttt-symbol {
  width: 100%;
  height: 100%;
}

.ttt-symbol-x {
  color: var(--text-link, #1a73e8);
}

.ttt-symbol-o {
  color: #ea4335;
}

/* Drawing animations */
.ttt-symbol-o circle {
  stroke-dasharray: 188.5;
  stroke-dashoffset: 188.5;
  animation: ttt-draw 0.25s ease-out forwards;
}

.ttt-symbol-x line {
  stroke-dasharray: 85;
  stroke-dashoffset: 85;
  animation: ttt-draw 0.15s ease-out forwards;
}

.ttt-symbol-x line:nth-child(2) {
  animation-delay: 0.1s;
}

@keyframes ttt-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* Win Line Overlay */
.ttt-win-line {
  position: absolute;
  background: var(--primary, #1a73e8);
  z-index: 10;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
}

/* Row 0 */
.ttt-win-line.ttt-win-row-0 {
  opacity: 1;
  top: 16.66%;
  left: 5%;
  width: 90%;
  height: 6px;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  animation: ttt-scale-x 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Row 1 */
.ttt-win-line.ttt-win-row-1 {
  opacity: 1;
  top: 50%;
  left: 5%;
  width: 90%;
  height: 6px;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  animation: ttt-scale-x 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Row 2 */
.ttt-win-line.ttt-win-row-2 {
  opacity: 1;
  top: 83.33%;
  left: 5%;
  width: 90%;
  height: 6px;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  animation: ttt-scale-x 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Col 0 */
.ttt-win-line.ttt-win-col-0 {
  opacity: 1;
  left: 16.66%;
  top: 5%;
  width: 6px;
  height: 90%;
  transform: translateX(-50%) scaleY(0);
  transform-origin: center top;
  animation: ttt-scale-y 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Col 1 */
.ttt-win-line.ttt-win-col-1 {
  opacity: 1;
  left: 50%;
  top: 5%;
  width: 6px;
  height: 90%;
  transform: translateX(-50%) scaleY(0);
  transform-origin: center top;
  animation: ttt-scale-y 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Col 2 */
.ttt-win-line.ttt-win-col-2 {
  opacity: 1;
  left: 83.33%;
  top: 5%;
  width: 6px;
  height: 90%;
  transform: translateX(-50%) scaleY(0);
  transform-origin: center top;
  animation: ttt-scale-y 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Diag 0 (top-left to bottom-right) */
.ttt-win-line.ttt-win-diag-0 {
  opacity: 1;
  top: 0;
  left: 0;
  width: 141.4%;
  height: 6px;
  transform: rotate(45deg) scaleX(0);
  transform-origin: top left;
  animation: ttt-scale-diag-0 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Diag 1 (bottom-left to top-right) */
.ttt-win-line.ttt-win-diag-1 {
  opacity: 1;
  bottom: 0;
  left: 0;
  width: 141.4%;
  height: 6px;
  transform: rotate(-45deg) scaleX(0);
  transform-origin: bottom left;
  animation: ttt-scale-diag-1 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes ttt-scale-x {
  to {
    transform: translateY(-50%) scaleX(1);
  }
}

@keyframes ttt-scale-y {
  to {
    transform: translateX(-50%) scaleY(1);
  }
}

@keyframes ttt-scale-diag-0 {
  to {
    transform: rotate(45deg) scaleX(1);
  }
}

@keyframes ttt-scale-diag-1 {
  to {
    transform: rotate(-45deg) scaleX(1);
  }
}

/* Footer & Action Buttons */
.ttt-footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.ttt-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0 16px;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 120ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  outline: none;
}

.ttt-btn-primary {
  background: var(--text-link, #1a73e8);
  color: #fff;
}

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

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

.ttt-btn-secondary {
  background: var(--bg, #fff);
  border-color: var(--border-light, #dadce0);
  color: var(--text-primary, #202124);
}

.ttt-btn-secondary:hover {
  background: var(--bg-hover, rgba(60, 64, 67, 0.04));
}

.ttt-btn-secondary.ttt-btn-active {
  background: var(--bg-active, rgba(26, 115, 232, 0.08));
  border-color: var(--text-link, #1a73e8);
  color: var(--text-link, #1a73e8);
  font-weight: 600;
}

.ttt-btn-secondary:focus-visible {
  outline: 2px solid var(--text-link, #1a73e8);
  outline-offset: 1px;
}

.ttt-btn-text {
  background: transparent;
  color: var(--text-secondary, #5f6368);
  border: none;
  padding: 0 8px;
  cursor: pointer;
  border-radius: 4px;
}

.ttt-btn-text:hover {
  color: var(--text-primary, #202124);
  background: var(--bg-hover, rgba(60, 64, 67, 0.04));
}

.ttt-btn-text:focus-visible {
  outline: 2px solid var(--text-link, #1a73e8);
}

.ttt-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 400px) {
  .ttt-card {
    padding: 12px;
  }
  .ttt-score-label {
    font-size: 0.7rem;
  }
  .ttt-score-val {
    font-size: 1.1rem;
  }
}

.snake-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-primary, #202124);
  background: var(--slot-inset-bg, var(--bg-light, #f8f9fa));
  border: 1px solid var(--slot-inset-border, var(--border-light, #dadce0));
  border-radius: 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
  user-select: none;
  container-type: inline-size;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent),
    0 1px 2px color-mix(in srgb, var(--text-primary) 8%, transparent);
}

.snake-card.slot-full-width {
  max-width: none;
}

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

.results-slot-panel:has(> .results-slot-panel-body > .snake-card) {
  overflow: visible;
  max-width: none;
}

.results-slot-panel:has(> .results-slot-panel-body > .snake-card)
  > .results-slot-panel-body {
  padding: 0;
  max-width: none;
  width: 100%;
}

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

.results-slot-panel:has(> .results-slot-panel-body > .snake-card) .snake-card {
  width: 100%;
  max-width: none;
  margin: 0;
}

#results-page.degoog-fullwidth-slot-shell
  #slot-above-results
  > .results-slot-panel:has(.snake-card.slot-full-width) {
  background: transparent;
  border: none;
  box-shadow: none;
}

#results-page.degoog-fullwidth-slot-shell
  #slot-above-results
  > .results-slot-panel:has(.snake-card.slot-full-width)
  > .results-slot-panel-body {
  padding: 0;
}

#results-page.degoog-fullwidth-slot-shell
  .snake-card.slot-full-width {
  border-radius: 16px;
}

/* Shell: toolbar + playfield */
.snake-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.snake-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light, #dadce0);
  background: color-mix(in srgb, var(--text-primary) 3%, transparent);
}

.snake-toolbar__brand {
  flex: 0 0 auto;
}

.snake-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.snake-toolbar__scores {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.snake-toolbar__size {
  flex: 1 1 auto;
  justify-content: flex-start;
  min-width: min(100%, 220px);
}

.snake-toolbar__actions {
  flex: 0 0 auto;
  margin-left: auto;
}

.snake-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg, #fff);
  border: 1px solid var(--border-light, #dadce0);
  border-radius: 100px;
  padding: 4px 12px;
  min-width: 64px;
}

.snake-score-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #5f6368);
  font-weight: 600;
}

.snake-score-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.snake-board-size {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.snake-board-size-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #5f6368);
}

.snake-board-size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.snake-board-size-btn {
  border: 1px solid var(--border-light, #dadce0);
  background: var(--bg, #fff);
  color: var(--text-primary, #202124);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.snake-board-size-btn:hover:not(:disabled) {
  background: var(--bg-hover, #f1f3f4);
  border-color: color-mix(in srgb, var(--primary, #1a73e8) 35%, var(--border-light, #dadce0));
}

.snake-board-size-btn--active {
  background: color-mix(in srgb, var(--primary, #1a73e8) 12%, var(--bg, #fff));
  border-color: var(--primary, #1a73e8);
  color: var(--primary, #1a73e8);
}

.snake-board-size-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Playfield: board grows into horizontal space; dpad beside on touch */
.snake-playfield {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 16px 16px;
  min-width: 0;
  background: color-mix(in srgb, var(--text-primary) 2%, transparent);
}

.snake-game-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.snake-game-container {
  position: relative;
  width: min(100%, var(--snake-board-w, 270px));
  max-width: 100%;
  height: auto;
  aspect-ratio: var(--snake-cols, 15) / var(--snake-rows, 17);
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
}

@container (min-width: 520px) {
  .snake-game-container {
    width: min(
      100%,
      max(var(--snake-board-w, 270px), min(72cqw, 520px))
    );
  }
}

@container (min-width: 720px) {
  .snake-game-container {
    width: min(
      100%,
      max(var(--snake-board-w, 270px), min(58cqw, 640px))
    );
  }
}

@container (min-width: 960px) {
  .snake-game-container {
    width: min(
      100%,
      max(var(--snake-board-w, 270px), min(50cqw, 720px))
    );
  }
}

.snake-game-container::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: #0f172a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 24px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

#snake-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: inherit;
}

/* Wide toolbar: single row */
@container (min-width: 640px) {
  .snake-toolbar {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    column-gap: 16px;
  }

  .snake-toolbar__size {
    justify-self: center;
    justify-content: center;
  }

  .snake-toolbar__actions {
    margin-left: 0;
  }
}

/* Narrow: stack toolbar groups */
@container (max-width: 480px) {
  .snake-toolbar__actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .snake-toolbar__size {
    width: 100%;
  }
}

/* In-board overlays */
.snake-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 220ms ease;
  z-index: 10;
  text-align: center;
  padding: 20px 16px;
}

.snake-overlay.snake-hidden {
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.snake-overlay-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(100%, 240px);
  padding: 0;
  color: #e2e8f0;
}

.snake-overlay-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.snake-overlay-icon--start {
  color: #34d399;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.28);
}

.snake-overlay-icon--lose {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.24);
}

.snake-overlay-icon--win {
  color: #fde047;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.24);
}

.snake-overlay-icon--pause {
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.12);
  border: 1px solid rgba(147, 197, 253, 0.24);
}

.snake-overlay-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.15;
  color: #f8fafc;
}

.snake-overlay-panel--lose .snake-overlay-title {
  color: #fecaca;
}

.snake-overlay-panel--win .snake-overlay-title {
  color: #bbf7d0;
}

.snake-overlay-scoreline {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 2px 0 0;
}

.snake-overlay-score {
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #f8fafc;
}

.snake-overlay-score-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: lowercase;
}

.snake-overlay-meta {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #94a3b8;
  max-width: 24ch;
}

.snake-overlay-panel .snake-btn-play {
  margin-top: 8px;
}

.snake-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, transform 100ms ease, box-shadow 150ms ease;
  outline: none;
  white-space: nowrap;
}

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

.snake-btn-play {
  background: #34d399;
  color: #052e1c;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

.snake-btn-play:hover {
  background: #6ee7b7;
}

.snake-btn-secondary {
  background: var(--bg, #fff);
  color: var(--text-primary);
  border: 1px solid var(--border-light, #dadce0);
}

.snake-btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover, #e8eaed);
}

.snake-btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.snake-btn-icon {
  background: var(--bg, #fff);
  color: var(--text-secondary, #5f6368);
  border: 1px solid var(--border-light, #dadce0);
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
}

.snake-btn-icon:hover {
  background: var(--bg-hover, #e8eaed);
  color: var(--text-primary);
}

.snake-hidden {
  display: none !important;
}

.snake-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.snake-header-actions .snake-btn {
  padding: 6px 14px;
  height: 38px;
  font-size: 0.92rem;
  border-radius: 100px;
}

.snake-header-actions .snake-btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.snake-header-actions .snake-btn-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.snake-dpad {
  display: none;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

@media (pointer: coarse) {
  .snake-dpad {
    display: flex;
  }

  .snake-playfield {
    justify-content: center;
  }
}

.snake-dpad-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.snake-dpad-center {
  width: 50px;
  height: 50px;
  background: transparent;
}

.snake-dpad-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--border-light, #dadce0);
  background: var(--bg, #fff);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transition: background 120ms ease, transform 100ms ease, box-shadow 120ms ease;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.snake-dpad-btn:hover {
  background: var(--bg-hover, #e8eaed);
}

.snake-dpad-btn:active {
  background: var(--bg-active, #dadce0);
  transform: scale(0.92);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.snake-dpad-btn svg {
  pointer-events: none;
}

@container (max-width: 420px) {
  .snake-header-actions .snake-btn-secondary {
    padding-inline: 10px;
    font-size: 0.82rem;
  }

  .snake-score-box {
    min-width: 54px;
    padding-inline: 8px;
  }

  .snake-playfield {
    flex-direction: column;
    align-items: center;
  }
}

/* Fullscreen */
.snake-card:fullscreen {
  background: radial-gradient(circle, #1e293b 0%, #090d16 100%) !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  overflow-y: auto;
  color: #f8fafc;
  border: none;
  box-shadow: none;
  max-width: none;
}

.snake-card:fullscreen .snake-toolbar {
  width: 100%;
  max-width: 900px;
  border-bottom: 1px solid #334155;
  margin-bottom: 12px;
  background: transparent;
}

.snake-card:fullscreen .snake-title {
  color: #f8fafc;
}

.snake-card:fullscreen .snake-playfield {
  width: 100%;
  max-width: 900px;
  background: transparent;
}

.snake-card:fullscreen .snake-score-label {
  color: #94a3b8;
}

.snake-card:fullscreen .snake-score-val {
  color: #f8fafc;
}

.snake-card:fullscreen .snake-score-box {
  background: #1e293b;
  border-color: #334155;
}

.snake-card:fullscreen .snake-btn-secondary {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

.snake-card:fullscreen .snake-btn-secondary:hover {
  background: #334155;
}

.snake-card:fullscreen .snake-btn-icon {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

.snake-card:fullscreen .snake-btn-icon:hover {
  background: #334155;
  color: #f8fafc;
}

.snake-card:fullscreen .snake-board-size-btn {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

.snake-card:fullscreen .snake-board-size-btn--active {
  background: rgba(52, 211, 153, 0.18);
  border-color: #34d399;
  color: #6ee7b7;
}

.snake-card:fullscreen .snake-game-container {
  width: min(100%, max(var(--snake-board-w, 270px), min(80vw, 720px))) !important;
}

.snake-card:fullscreen .snake-game-container::after {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 0 24px rgba(0, 0, 0, 0.55);
}

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

.dslot-card {
  --dslot-accent: var(--primary);
  container-type: inline-size;
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-light, var(--border, #dadce0));
  border-radius: 18px;
  background: var(--bg, Canvas);
  color: var(--text-primary, CanvasText);
  font-family: var(--font-sans, sans-serif);
}

.dslot-head {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dslot-kicker,
.dslot-label {
  color: var(--text-secondary, #5f6368);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: uppercase;
}

.dslot-word-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.dslot-word {
  margin: 0;
  color: var(--text-primary, inherit);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.dslot-phonetic {
  color: var(--text-secondary, #5f6368);
  font-size: 0.96rem;
  line-height: 1.35;
}

.dslot-audio {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-light, var(--border, #dadce0));
  border-radius: 8px;
  background: var(--bg, Canvas);
  color: var(--text-secondary, #5f6368);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background-color 0.16s ease,
    transform 0.16s ease;
}

.dslot-audio:hover,
.dslot-audio:focus-visible,
.dslot-audio.dslot-audio-playing {
  border-color: var(--dslot-accent, #4285f4);
  background: color-mix(in srgb, var(--dslot-accent, #4285f4) 9%, transparent);
  color: var(--dslot-accent, #4285f4);
  outline: none;
}

.dslot-audio:active {
  transform: translateY(1px);
}

.dslot-audio-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.dslot-definitions {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dslot-def {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-light, Canvas) 80%, transparent);
}

.dslot-def-num {
  color: var(--text-secondary, #5f6368);
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dslot-def-copy {
  min-width: 0;
}

.dslot-def-line {
  color: var(--text-primary, inherit);
  font-size: 0.98rem;
  line-height: 1.55;
}

.dslot-pos {
  color: var(--dslot-accent, #4285f4);
  font-size: 0.88rem;
  font-style: italic;
  margin-right: 6px;
}

.dslot-example {
  margin-top: 2px;
  color: var(--text-secondary, #5f6368);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.45;
}

.dslot-related {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  padding: 12px;
  border: 1px solid var(--border-light, var(--border, #dadce0));
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-light, Canvas) 75%, transparent);
}

.dslot-related-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.dslot-tags {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.dslot-tag,
.dslot-term {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid var(--border-light, var(--border, #dadce0));
  border-radius: 999px;
  background: var(--bg, Canvas);
  color: var(--text-primary, inherit);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dslot-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px dashed var(--dslot-accent, #4285f4);
  border-radius: 999px;
  background: color-mix(in srgb, var(--dslot-accent, #4285f4) 5%, transparent);
  color: var(--dslot-accent, #4285f4);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.dslot-more:hover,
.dslot-more:focus-visible {
  border-color: var(--dslot-accent, #4285f4);
  background: color-mix(in srgb, var(--dslot-accent, #4285f4) 12%, transparent);
  outline: none;
}

.dslot-term {
  display: grid;
  align-items: start;
  gap: 2px;
  min-width: 0;
  min-height: 32px;
  padding: 5px 7px;
}

.dslot-term-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.dslot-term-word {
  min-width: 0;
  padding: 0 0 0 6px;
  border: 0;
  background: transparent;
  color: var(--text-primary, inherit);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  overflow-wrap: anywhere;
}

.dslot-term-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  min-width: 0;
  padding-left: 4px;
  color: var(--text-secondary, #5f6368);
  font-size: 0.76rem;
  line-height: 1.25;
}

.dslot-term-meta {
  color: var(--dslot-accent, #4285f4);
  font-style: italic;
}

.dslot-term-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.dslot-rating {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--success, #34a853) 13%, transparent);
  color: var(--success, #137333);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.dslot-term-link {
  flex: 0 0 auto;
  color: var(--text-link, var(--dslot-accent, #4285f4));
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.dslot-term-link:hover,
.dslot-term-link:focus-visible {
  text-decoration: underline;
}

.dslot-tag-button {
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background-color 0.16s ease,
    transform 0.16s ease;
}

.dslot-tag-button:hover,
.dslot-tag-button:focus-visible {
  color: var(--dslot-accent, #4285f4);
  outline: none;
}

.dslot-tag-button.dslot-tag:hover,
.dslot-tag-button.dslot-tag:focus-visible {
  border-color: var(--dslot-accent, #4285f4);
  background: color-mix(in srgb, var(--dslot-accent, #4285f4) 8%, transparent);
}

.dslot-tag-button:active {
  transform: translateY(1px);
}

/* Custom dslot-more styling is declared above */

.dslot-origin {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border-light, var(--border, #dadce0));
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-light, Canvas) 75%, transparent);
}

.dslot-origin p {
  margin: 0;
  color: var(--text-primary, inherit);
  font-size: 0.94rem;
  line-height: 1.5;
}

.dslot-empty {
  color: var(--text-secondary, #5f6368);
  font-size: 0.96rem;
  line-height: 1.5;
}

.dslot-empty strong {
  color: var(--text-primary, inherit);
  font-weight: 600;
}

.dslot-source {
  color: var(--text-secondary, #5f6368);
  font-size: 0.78rem;
  line-height: 1.35;
}

.dslot-source a {
  color: var(--text-link, var(--dslot-accent, #4285f4));
  text-decoration: none;
}

.dslot-source a:hover,
.dslot-source a:focus-visible {
  text-decoration: underline;
}

@container (max-width: 420px) {
  .dslot-word {
    font-size: 1.36rem;
  }

  .dslot-related {
    grid-template-columns: 1fr;
  }

  .dslot-def {
    grid-template-columns: 1.1rem minmax(0, 1fr);
  }
}

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

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

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

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

/* Unnest inside at-a-glance wrapper (.glance-box) */
.glance-box:has(.dslot-card) {
  padding: 0 !important;
  overflow: hidden;
}

.glance-box:has(.dslot-card) .dslot-card {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 14px;
}

/* ── Modal overlay ──────────────────────────────────────────────── */
.dslot-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--overlay-bg, rgba(0, 0, 0, 0.7));
  backdrop-filter: blur(4px);
  animation: dslot-fade-in 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.dslot-modal-overlay.dslot-modal-closing {
  animation: dslot-fade-out 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Modal container ────────────────────────────────────────────── */
.dslot-modal-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 580px;
  max-height: 80vh;
  border: 1px solid var(--border-light, #444746);
  border-radius: 20px;
  background: var(--bg-light, Canvas);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  animation: dslot-scale-in 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  color: var(--text-primary);
  font-family: var(--font-sans, sans-serif);
}

.dslot-modal-overlay.dslot-modal-closing .dslot-modal-container {
  animation: dslot-scale-out 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Modal header ───────────────────────────────────────────────── */
.dslot-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light, #444746);
}

.dslot-modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dslot-modal-word {
  color: var(--text-primary);
  font-weight: 700;
}

.dslot-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.dslot-modal-close:hover {
  background: var(--bg-hover, #3c4043);
  color: var(--text-primary);
}

/* ── Modal body ─────────────────────────────────────────────────── */
.dslot-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.dslot-tags-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes dslot-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dslot-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes dslot-scale-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes dslot-scale-out {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}



/* Periodic Table Styles */

/* Avoid double borders and padding when nested inside standard slot panels in full-width mode */
.results-slot-panel:has(.pt-card.slot-full-width) {
  max-width: none;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.results-slot-panel:has(.pt-card.slot-full-width)
  > .results-slot-panel-body {
  padding: 0;
  max-width: none;
  width: 100%;
}

.pt-card {
  --pt-alkali: #ff5e62;
  --pt-alkaline: #ff9966;
  --pt-transition: #4facfe;
  --pt-lanthanide: #b19ffb;
  --pt-actinide: #f39ffe;
  --pt-post-transition: #00f2fe;
  --pt-metalloid: #00c6ff;
  --pt-nonmetal: #38ef7d;
  --pt-noble: #f857a6;
  --pt-unknown: #a1a1a1;

  /* Map full category names as aliases for runtime JS lookup */
  --pt-alkali-metal: var(--pt-alkali);
  --pt-alkaline-earth-metal: var(--pt-alkaline);
  --pt-transition-metal: var(--pt-transition);
  --pt-post-transition-metal: var(--pt-post-transition);
  --pt-reactive-nonmetal: var(--pt-nonmetal);
  --pt-noble-gas: var(--pt-noble);

  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 20px; /* Rounded card layout matching modern Google/Flipboard */
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

/* Header Styles */
.pt-header {
  margin-bottom: 20px;
}

.pt-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.pt-title {
  font-size: 1.5rem;
  font-weight: 800; /* Bold Flipboard-style headings */
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Google-like search bar */
.pt-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 300px;
}

.pt-search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.pt-search-input {
  width: 100%;
  padding: 10px 36px 10px 40px;
  border-radius: 24px; /* Fully rounded pill shape like Google search */
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.25s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.pt-search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.12), 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.pt-clear-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.pt-clear-btn:hover {
  color: var(--text-primary);
}

/* Controls & Filters */
.pt-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}

.pt-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

/* Rounded Quick Filter Buttons */
.pt-filter-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 16px; /* Pill-shaped selectors */
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.pt-filter-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
}

.pt-filter-btn.active {
  background: var(--text-primary);
  color: var(--bg-light);
  border-color: var(--text-primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Temperature Simulator styling (Google/Flipboard blend) */
.pt-temp-simulator {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 260px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.pt-temp-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.pt-temp-value {
  color: var(--primary);
  font-weight: 800;
}

.pt-temp-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pt-temp-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-light);
  outline: none;
  margin: 6px 0;
  cursor: pointer;
}

.pt-temp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-light);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pt-temp-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.pt-temp-presets {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.pt-preset-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

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

.pt-preset-btn.pt-preset-active {
  background: var(--border);
  color: var(--text-primary);
}

/* Grid & Table Container */
.pt-table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.pt-grid {
  display: grid;
  grid-template-columns: repeat(18, minmax(42px, 1fr));
  grid-template-rows: repeat(10, minmax(44px, 1fr));
  gap: 4px;
  min-width: 820px;
  position: relative;
  padding: 2px;
}

/* Element Cell - Flipboard card styling with Glossy shine sweep */
.pt-element {
  appearance: none;
  width: auto;
  min-width: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  overflow: hidden; /* Vital for shine sweep */
  transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1), 
              box-shadow 0.2s cubic-bezier(0.165, 0.84, 0.44, 1), 
              border-color 0.2s, 
              opacity 0.25s;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.pt-element:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 2px;
  z-index: 11;
}

/* Glass shine sweep effect */
.pt-element::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -80%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  transition: all 0.4s ease;
  opacity: 0;
  pointer-events: none;
}

.pt-element:hover {
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  z-index: 10;
  border-color: var(--text-primary) !important;
}

.pt-element:hover::after {
  left: 130%;
  opacity: 1;
  transition: all 0.5s ease;
}

.pt-element-num {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1;
}

.pt-element-sym {
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.pt-element-name {
  font-size: 0.55rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  line-height: 1;
}

/* Placeholder/Group Cells */
.pt-placeholder-cell {
  background: var(--bg-hover) !important;
  opacity: 0.7;
}

.pt-placeholder-cell .pt-element-sym {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 700;
}

/* Elements state-temperature dots */
.state-indicator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  align-self: flex-end;
  margin-top: 1px;
}
.state-gas { background: var(--pt-nonmetal); }
.state-liquid { background: var(--pt-transition); }
.state-solid { background: var(--pt-unknown); }
.state-synthetic { background: var(--pt-noble); }

/* Inactive/Muted Element States during search */
.pt-element.dimmed {
  opacity: 0.12;
  filter: grayscale(100%);
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

.pt-element.highlighted {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.3);
  transform: scale(1.05);
}

/* Chemistry Group Gradients (Flipboard-style glossy glassmorphism look) */
.alkali-metal {
  border-top: 3px solid var(--pt-alkali);
  background: linear-gradient(180deg, rgba(255, 94, 98, 0.1) 0%, rgba(255, 94, 98, 0.02) 100%);
}
.alkaline-earth-metal {
  border-top: 3px solid var(--pt-alkaline);
  background: linear-gradient(180deg, rgba(255, 153, 102, 0.1) 0%, rgba(255, 153, 102, 0.02) 100%);
}
.transition-metal {
  border-top: 3px solid var(--pt-transition);
  background: linear-gradient(180deg, rgba(79, 172, 254, 0.1) 0%, rgba(79, 172, 254, 0.02) 100%);
}
.lanthanide {
  border-top: 3px solid var(--pt-lanthanide);
  background: linear-gradient(180deg, rgba(177, 159, 251, 0.1) 0%, rgba(177, 159, 251, 0.02) 100%);
}
.actinide {
  border-top: 3px solid var(--pt-actinide);
  background: linear-gradient(180deg, rgba(243, 159, 254, 0.1) 0%, rgba(243, 159, 254, 0.02) 100%);
}
.post-transition-metal {
  border-top: 3px solid var(--pt-post-transition);
  background: linear-gradient(180deg, rgba(0, 242, 254, 0.1) 0%, rgba(0, 242, 254, 0.02) 100%);
}
.metalloid {
  border-top: 3px solid var(--pt-metalloid);
  background: linear-gradient(180deg, rgba(0, 198, 255, 0.1) 0%, rgba(0, 198, 255, 0.02) 100%);
}
.reactive-nonmetal {
  border-top: 3px solid var(--pt-nonmetal);
  background: linear-gradient(180deg, rgba(56, 239, 125, 0.1) 0%, rgba(56, 239, 125, 0.02) 100%);
}
.noble-gas {
  border-top: 3px solid var(--pt-noble);
  background: linear-gradient(180deg, rgba(248, 87, 166, 0.1) 0%, rgba(248, 87, 166, 0.02) 100%);
}
.unknown {
  border-top: 3px solid var(--pt-unknown);
  background: linear-gradient(180deg, rgba(161, 161, 161, 0.1) 0%, rgba(161, 161, 161, 0.02) 100%);
}

/* Detail Display Panel - positioned absolutely inside the grid's top middle gap */
.pt-detail-display {
  position: absolute;
  left: calc(100% / 18 * 2 + 6px);
  width: calc(100% / 18 * 10 - 12px); /* Spans from Column 3 to Column 12 */
  top: 2px;
  height: calc(100% / 10 * 3 - 6px); /* Spans first 3 rows */
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.02), 0 2px 10px rgba(0,0,0,0.02);
  transition: background 0.3s ease, border-left 0.3s ease;
}

.pt-dd-empty {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  font-weight: 500;
}

/* Featured Flipboard Magazine style display on hover */
.pt-dd-content {
  display: flex;
  width: 100%;
  height: 100%;
  gap: 20px;
  align-items: center;
}

.pt-dd-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  width: 90px;
  height: 90px;
  background: var(--bg-light);
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.pt-dd-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-secondary);
  align-self: flex-start;
  padding-left: 6px;
}

.pt-dd-sym {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.pt-dd-mass {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.pt-dd-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

.pt-dd-name {
  font-size: 1.35rem;
  font-weight: 900; /* Bold header style */
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
}

.pt-dd-cat {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.pt-dd-stats {
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.pt-dd-stats span {
  font-weight: 700;
  color: var(--text-primary);
}

.pt-dd-conf {
  font-size: 0.7rem;
  font-family: monospace;
  color: var(--text-secondary);
  background: var(--bg-light);
  padding: 4px 8px;
  border-radius: 6px;
  align-self: flex-start;
  font-weight: 600;
  border: 1px solid var(--border-light);
}

/* Element Details Modal Overlay */
.pt-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pt-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px); /* Blur background like Google/Flipboard */
}

.pt-modal-content {
  position: relative;
  background: var(--bg-light);
  border: 1px solid var(--border);
  width: 90%;
  max-width: 480px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  padding: 28px;
  z-index: 1001;
  animation: ptModalScale 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ptModalScale {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.pt-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.75rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.pt-modal-close:hover {
  color: var(--text-primary);
}

.pt-modal-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 20px;
}

.pt-modal-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--border);
  border-radius: 16px;
  width: 80px;
  height: 80px;
  background: var(--bg);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.pt-modal-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-secondary);
  align-self: flex-start;
  padding-left: 6px;
}

.pt-modal-sym {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.pt-modal-name {
  font-size: 1.75rem;
  font-weight: 900;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.pt-modal-cat {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.pt-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.pt-info-item {
  display: flex;
  flex-direction: column;
}

.pt-info-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 2px;
}

.pt-info-val {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 700;
}

.pt-modal-desc-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.01);
}

.pt-modal-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* Adaptive styles for compact, non-full-width and sidebar layouts */
.pt-compact .pt-detail-display {
  position: static;
  width: 100%;
  height: auto;
  margin-bottom: 16px;
  box-shadow: none;
  background: var(--bg);
  border-left: 4px solid var(--border);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pt-compact .pt-dd-content {
  gap: 16px;
}

.pt-compact .pt-dd-left {
  width: 72px;
  height: 72px;
}

.pt-compact .pt-dd-sym {
  font-size: 1.8rem;
}

.pt-compact .pt-dd-name {
  font-size: 1.1rem;
}

/* Grid layout changes for compact layouts to shrink cells and hide details */
.pt-compact .pt-grid {
  grid-template-columns: repeat(18, minmax(20px, 1fr));
  grid-template-rows: repeat(10, minmax(24px, 1fr));
  gap: 2px;
  min-width: 440px; /* Small footprint layout! Fits mobile screens */
}

.pt-compact .pt-element {
  padding: 2px;
  border-radius: 4px;
}

.pt-compact .pt-element-num {
  font-size: 0.5rem;
}

.pt-compact .pt-element-sym {
  font-size: 0.75rem;
  font-weight: 800;
  margin-top: 0;
}

.pt-compact .pt-element-name,
.pt-compact .state-indicator {
  display: none !important; /* Hide extra elements to fit width cleanly */
}

/* Sidebar Specific overrides */
#results-sidebar .pt-card,
.results-slot--above-sidebar .pt-card,
.results-slot--below-sidebar .pt-card {
  padding: 12px;
  border-radius: 12px;
}

/* Electron Configuration Styled Representation */
.pt-conf-core {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  margin-right: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.pt-conf-orbital {
  display: inline-flex;
  align-items: baseline;
  margin-right: 5px;
  font-size: 0.85rem;
  font-weight: 700;
}

.pt-conf-shell {
  color: var(--text-primary);
}

.pt-conf-subshell {
  font-weight: 800;
  margin-left: 1px;
}
.pt-conf-subshell.subshell-s { color: var(--pt-noble); }             /* s-block: bright pink */
.pt-conf-subshell.subshell-p { color: var(--pt-alkaline); }          /* p-block: gold/orange */
.pt-conf-subshell.subshell-d { color: var(--pt-transition); }        /* d-block: blue */
.pt-conf-subshell.subshell-f { color: var(--pt-lanthanide); }        /* f-block: purple */

.pt-conf-power {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-secondary);
  vertical-align: super;
  line-height: 0;
  margin-left: 0.5px;
}

/* Preview Display Badges */
.pt-dd-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.pt-dd-badge {
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,0.01);
  transition: all 0.2s ease;
}

.pt-dd-badge-lbl {
  color: var(--text-secondary);
  margin-right: 5px;
}

.pt-dd-badge-val {
  color: var(--text-primary);
  font-weight: 800;
}

/* Simulated State Pill Color overrides */
.pt-dd-badge[data-state="gas"] {
  background: rgba(56, 239, 125, 0.08);
  border-color: rgba(56, 239, 125, 0.2);
  color: var(--pt-nonmetal);
}
.pt-dd-badge[data-state="liquid"] {
  background: rgba(79, 172, 254, 0.08);
  border-color: rgba(79, 172, 254, 0.2);
  color: var(--pt-transition);
}
.pt-dd-badge[data-state="solid"] {
  background: rgba(161, 161, 161, 0.08);
  border-color: rgba(161, 161, 161, 0.2);
  color: var(--text-secondary);
}
.pt-dd-badge[data-state="synthetic"] {
  background: rgba(248, 87, 166, 0.08);
  border-color: rgba(248, 87, 166, 0.2);
  color: var(--pt-noble);
}

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

.results-slot-panel:has(.cxs-wrap.slot-full-width) {
    max-width: none;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.results-slot-panel:has(.cxs-wrap.slot-full-width)
    > .results-slot-panel-body {
    width: 100%;
    max-width: none;
    padding: 0;
}

.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 {
    opacity: 0.15;
}

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

/* ── 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: var(--theme-radius-sm, 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);
}

.calc-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border: 1px solid color-mix(in srgb, var(--border-light, #dadce0) 88%, transparent);
  border-radius: 24px;
  background: var(--bg, #fff);
  color: var(--text-primary, #202124);
  font-family: "Google Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(60, 64, 67, 0.08),
    0 4px 16px rgba(60, 64, 67, 0.06);
  --calc-accent: var(--text-link, #1a73e8);
  --calc-accent-hover: color-mix(in srgb, var(--calc-accent) 88%, #000);
  --calc-accent-soft: color-mix(in srgb, var(--calc-accent) 10%, var(--bg, #fff));
  --calc-chip: var(--bg-light, #f1f3f4);
  --calc-key-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
  --calc-radius-lg: 20px;
  --calc-radius-md: 16px;
  --calc-radius-pill: 100px;
  --calc-graph-1: #1a73e8;
  --calc-graph-2: #d93025;
  --calc-graph-3: #188038;
  --calc-graph-4: #9334e6;
}

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

.calc-display {
  min-height: 88px;
  padding: 18px 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  gap: 6px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--calc-accent) 4%, transparent),
      transparent 72%
    ),
    var(--bg, #fff);
}

.calc-display-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
}

.calc-mode-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: var(--calc-radius-pill);
  background: var(--calc-accent-soft);
  color: var(--calc-accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.calc-mode-chip--graph {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--calc-accent) 18%, transparent);
}

.calc-keyboard-hint {
  min-width: 0;
  color: var(--text-secondary, #5f6368);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-expression {
  appearance: none;
  width: 100%;
  min-height: 20px;
  margin: 0;
  padding: 5px 0 3px;
  border: 0;
  border-bottom: 1px solid transparent;
  outline: 0;
  background: transparent;
  color: var(--text-secondary, #5f6368);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.35;
  text-align: right;
  transition:
    border-color 140ms ease,
    color 140ms ease;
}

.calc-expression:focus {
  border-bottom-color: color-mix(in srgb, var(--calc-accent) 42%, transparent);
  color: var(--text-primary, #202124);
}

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

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

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

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

.calc-graph {
  margin: 0 14px 14px;
  padding: 14px 14px 12px;
  border: 1px solid color-mix(in srgb, var(--border-light, #dadce0) 80%, transparent);
  border-radius: var(--calc-radius-lg);
  background: var(--bg-light, #f8f9fa);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.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 {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--calc-radius-pill);
  background: var(--calc-accent-soft);
  color: var(--calc-accent);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.calc-graph-series {
  min-width: 0;
  max-width: 78%;
  display: flex;
  justify-content: flex-start;
  gap: 5px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.calc-graph-series::-webkit-scrollbar {
  display: none;
}

.calc-graph-series-chip {
  min-width: 0;
  max-width: 180px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--border-light, #dadce0) 80%, transparent);
  border-radius: var(--calc-radius-pill);
  background: var(--bg, #fff);
  color: var(--text-secondary, #5f6368);
  font-size: 0.76rem;
  line-height: 1.2;
}

.calc-graph-series-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--calc-graph-1);
}

.calc-graph-series-chip:nth-child(2) .calc-graph-series-dot {
  background: var(--calc-graph-2);
}

.calc-graph-series-chip:nth-child(3) .calc-graph-series-dot {
  background: var(--calc-graph-3);
}

.calc-graph-series-chip:nth-child(4) .calc-graph-series-dot {
  background: var(--calc-graph-4);
}

.calc-graph-series-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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: var(--calc-radius-md);
  background:
    radial-gradient(
      120% 120% at 0% 0%,
      color-mix(in srgb, var(--calc-accent) 7%, transparent),
      transparent 42%
    ),
    var(--bg, #fff);
}

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

.calc-graph-zoom-controls {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  flex-direction: row;
  gap: 2px;
  z-index: 10;
  pointer-events: auto;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--border-light, #dadce0) 80%, transparent);
  border-radius: var(--calc-radius-pill);
  background: color-mix(in srgb, var(--bg, #ffffff) 92%, transparent);
  box-shadow: var(--calc-key-shadow);
  backdrop-filter: blur(8px);
}

.calc-graph-zoom-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  box-shadow: none;
  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 ease,
    color 150ms ease,
    transform 120ms ease;
}

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

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

.calc-function-strip {
  display: flex;
  gap: 6px;
  padding: 2px 12px 10px;
  overflow-x: auto;
  background: var(--bg-light, #f8f9fa);
  scrollbar-width: none;
}

.calc-function-strip::-webkit-scrollbar {
  display: none;
}

.calc-function-chip {
  min-width: 54px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--border-light, #dadce0) 78%, transparent);
  border-radius: var(--calc-radius-pill);
  background: var(--bg, #fff);
  color: var(--text-secondary, #5f6368);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--calc-key-shadow);
  transition:
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 100ms ease;
}

.calc-function-chip:hover {
  border-color: color-mix(in srgb, var(--calc-accent) 28%, var(--border-light, #dadce0));
  color: var(--calc-accent);
  box-shadow:
    var(--calc-key-shadow),
    0 2px 5px rgba(60, 64, 67, 0.1);
}

.calc-function-chip:focus-visible {
  outline: 2px solid var(--calc-accent);
  outline-offset: 2px;
}

.calc-function-chip:active {
  transform: scale(0.96);
}

.calc-keypad {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 14px;
  background: var(--bg-light, #f8f9fa);
  border-top: 1px solid color-mix(in srgb, var(--border-light, #dadce0) 70%, transparent);
}

.results-slot-panel:has(.calc-card) {
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

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

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

#results-sidebar .calc-card,
.results-slot-panel:has(.calc-card) .calc-card {
  max-width: none;
  margin: 0;
  width: 100%;
}

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

.calc-angle-toggle {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
  padding: 3px;
  border-radius: var(--calc-radius-pill);
  background: color-mix(in srgb, var(--calc-chip) 88%, var(--border-light, #dadce0));
}

.calc-btn {
  width: 100%;
  height: 44px;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--border-light, #dadce0) 72%, transparent);
  border-radius: var(--calc-radius-pill);
  padding: 0 6px;
  color: var(--text-primary, #202124);
  background: var(--bg, #fff);
  font: inherit;
  font-size: 0.88rem;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: var(--calc-key-shadow);
  transition:
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 100ms ease;
}

.calc-btn:hover {
  border-color: color-mix(in srgb, var(--calc-accent) 24%, var(--border-light, #dadce0));
  background: var(--bg, #fff);
  box-shadow:
    var(--calc-key-shadow),
    0 2px 5px rgba(60, 64, 67, 0.1);
}

.calc-btn:focus-visible {
  outline: 2px solid var(--calc-accent);
  outline-offset: 2px;
}

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

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

.calc-btn--digit:hover {
  background: var(--bg, #fff);
  border-color: color-mix(in srgb, var(--calc-accent) 24%, var(--border-light, #dadce0));
  box-shadow:
    var(--calc-key-shadow),
    0 0 0 1px color-mix(in srgb, var(--calc-accent) 12%, transparent);
}

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

.calc-btn--sci {
  background: color-mix(in srgb, var(--calc-chip) 78%, var(--bg, #fff));
}

.calc-btn--sci:hover {
  background: color-mix(in srgb, var(--calc-chip) 88%, var(--bg, #fff));
}

.calc-btn--op {
  background: var(--calc-accent-soft);
  border-color: color-mix(in srgb, var(--calc-accent) 18%, var(--border-light, #dadce0));
  color: var(--calc-accent);
  font-size: 1.05rem;
  font-weight: 500;
}

.calc-btn--op:hover {
  background: var(--calc-accent-soft);
  color: var(--calc-accent);
}

.calc-btn--clear {
  background: color-mix(in srgb, var(--danger, #d93025) 7%, var(--bg, #fff));
  border-color: color-mix(in srgb, var(--danger, #d93025) 16%, var(--border-light, #dadce0));
  font-weight: 600;
  color: color-mix(in srgb, var(--danger, #d93025) 82%, var(--text-secondary, #5f6368));
}

.calc-btn--clear:hover {
  background: color-mix(in srgb, var(--danger, #d93025) 8%, var(--bg, #fff));
}

.calc-btn--toggle {
  border-radius: var(--calc-radius-pill);
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-secondary, #5f6368);
  font-size: 0.82rem;
  font-weight: 600;
  height: 38px;
}

.calc-btn--toggle:hover {
  background: transparent;
  color: var(--text-primary, #202124);
}

.calc-btn--toggle.calc-btn--active,
.calc-btn--sci.calc-btn--active {
  background: var(--bg, #fff);
  color: var(--calc-accent);
  box-shadow: var(--calc-key-shadow);
  font-weight: 600;
}

.calc-btn--equals {
  border-color: var(--calc-accent);
  background: var(--calc-accent);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow:
    0 1px 2px rgba(26, 115, 232, 0.24),
    0 2px 8px rgba(26, 115, 232, 0.18);
}

.calc-btn--equals:hover {
  background: var(--calc-accent-hover);
  box-shadow:
    0 2px 4px rgba(26, 115, 232, 0.28),
    0 4px 12px rgba(26, 115, 232, 0.2);
}

.calc-btn--equals:active {
  transform: scale(0.96);
}

@media (max-width: 560px) {
  .calc-card {
    max-width: none;
    border-radius: 20px;
  }

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

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

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

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

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

  .calc-keypad {
    gap: 6px;
    padding: 8px 10px 12px;
  }

  .calc-row {
    gap: 5px;
  }

  .calc-btn {
    height: 38px;
    font-size: 0.8rem;
  }

  .calc-btn--digit {
    font-size: 0.88rem;
  }

  .calc-btn--toggle {
    height: 34px;
  }
}

/* literallygoogle theme: flatten outer slot shell, keep card chrome */
#results-page.degoog-fullwidth-slot-shell .results-slot-panel:has(.calc-card) {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

#results-page.degoog-fullwidth-slot-shell .calc-card {
  max-width: 440px;
}

/* Match LiterallyGoogle suggestion icon column (theme ::before at 0.8rem, 1.125rem). */
.ac-item--bang {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-block: 0.5rem;
    padding-inline-end: 0.75rem;
    padding-inline-start: 2.75rem;
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 400;
}

.ac-item--bang .ac-item-icon {
    position: absolute;
    inset-inline-start: 0.8rem;
    inset-block-start: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    color: var(--text-secondary);
}

.ac-item--bang .ac-item-icon svg {
    width: 1.125rem;
    height: 1.125rem;
    display: block;
}

.ac-item--bang::before {
    content: none !important;
    display: none !important;
}

.ac-item--bang .ac-item-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    overflow: hidden;
}

.ac-item--bang .ac-item-bang-trigger {
    flex: none;
    flex-shrink: 0;
    min-width: max-content;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92em;
    font-weight: 700;
    color: var(--primary);
}

.ac-item--bang .ac-item-bang-name {
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-primary);
}

.ac-item--bang .ac-item-bang-desc {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.88em;
}

.ac-item--bang:hover,
.ac-item--bang.active,
.ac-item--bang.ac-active,
.ac-item--bang.ac-item--bang-active {
    background: var(--bg-hover);
}

.auto-bang-help code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92em;
}

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

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

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