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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  .calc-keypad {
    padding: 6px;
  }

  .calc-row {
    gap: 3px;
  }

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

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

.clrtr-card {
    container-type: inline-size;
    color: var(--text-primary, CanvasText);
    font-family: var(--font-sans, sans-serif);
    margin-bottom: 12px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    --clrtr-surface: var(--bg-light, color-mix(in srgb, var(--bg, Canvas) 92%, var(--text-primary, CanvasText) 8%));
    --clrtr-field-bg: var(--bg, Canvas);
    --clrtr-border: var(--border-light, var(--border, rgba(128, 128, 128, 0.28)));
    --clrtr-muted: var(--text-secondary, color-mix(in srgb, var(--text-primary, CanvasText) 68%, transparent));
}

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

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

.clrtr-panel {
    display: grid;
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
    background: var(--slot-inset-bg, var(--bg-secondary, var(--clrtr-surface)));
    border: 1px solid var(--slot-inset-border, var(--clrtr-border));
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
}

.clrtr-preview-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.clrtr-preview-box {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--clrtr-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.clrtr-preview-box:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.clrtr-preview-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.2s ease;
}

.clrtr-color-name {
    font-size: 0.8rem;
    color: var(--clrtr-muted);
    font-weight: 500;
    text-align: center;
    word-break: break-all;
}

.clrtr-color-name span {
    font-weight: 700;
    color: var(--text-primary, CanvasText);
    text-transform: capitalize;
}

/* Picker section styling */
.clrtr-picker-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    margin-top: 10px;
    border-top: 1px solid var(--clrtr-border);
    padding-top: 14px;
}

.clrtr-wheel {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #ffffff 0%, transparent 100%),
                conic-gradient(from 0deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
    cursor: crosshair;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.15);
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    border: 1px solid var(--clrtr-border);
}

.clrtr-wheel-marker {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 4px rgba(0,0,0,0.6);
    transform: translate(-50%, -50%);
    pointer-events: none;
    left: 50%;
    top: 50%;
}

.clrtr-sliders {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.clrtr-slider-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clrtr-slider-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--clrtr-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.clrtr-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    outline: none;
    margin: 4px 0;
    border: 1px solid var(--clrtr-border);
    cursor: pointer;
}

.clrtr-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #555555;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: transform 0.1s ease;
}

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

.clrtr-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #555555;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: transform 0.1s ease;
}

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

.clrtr-hue-slider {
    background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}

.clrtr-lightness-slider {
    background: linear-gradient(to right, #000000, #7f7f7f, #ffffff);
}

.clrtr-opacity-slider {
    background-size: auto, 8px 8px;
    background-position: 0 0, 0 0;
    background-repeat: no-repeat, repeat;
    background-image: repeating-conic-gradient(#cccccc 0 25%, #ffffff 0 50%);
}

/* Translation rows */
.clrtr-translations {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    width: 100%;
}

.clrtr-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--clrtr-field-bg);
    border: 1px solid var(--clrtr-border);
    transition: background-color 0.15s ease, border-color 0.15s ease;
    min-height: 40px;
    box-sizing: border-box;
}

.clrtr-row:hover {
    background: color-mix(in srgb, var(--clrtr-field-bg) 92%, var(--text-primary, CanvasText) 8%);
    border-color: var(--border, var(--clrtr-border));
}

.clrtr-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--clrtr-muted);
    min-width: 130px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.clrtr-value-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.clrtr-value {
    font-family: var(--font-mono, monospace);
    font-size: 0.82rem;
    color: var(--text-primary, CanvasText);
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    padding: 0;
    cursor: text;
}

.clrtr-copy-btn {
    background: transparent;
    border: 1px solid var(--clrtr-border);
    border-radius: 6px;
    color: var(--clrtr-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.clrtr-copy-btn:not([disabled]):hover {
    border-color: var(--primary, var(--text-link, #1a73e8));
    color: var(--primary, var(--text-link, #1a73e8));
    background: color-mix(in srgb, var(--primary, var(--text-link, #1a73e8)) 12%, transparent);
}

.clrtr-copy-btn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

.clrtr-copy-btn.copied {
    border-color: #34a853;
    color: #34a853;
    background: rgba(52, 168, 83, 0.08);
    transform: scale(1.05);
}

.clrtr-copy-icon,
.clrtr-check-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.clrtr-check-icon {
    display: none;
}

.clrtr-copy-btn.copied .clrtr-copy-icon {
    display: none;
}

.clrtr-copy-btn.copied .clrtr-check-icon {
    display: block;
    animation: clrtr-pop 0.2s ease-out;
}

@keyframes clrtr-pop {
    0% { transform: scale(0.6); }
    100% { transform: scale(1); }
}

/* Responsive — stack vertically on narrow slots */
@container (max-width: 560px) {
    .clrtr-panel {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }

    .clrtr-preview-container {
        align-items: center;
        max-width: 200px;
        margin: 0 auto;
    }

    .clrtr-label {
        min-width: 100px;
        font-size: 0.68rem;
    }
}

@container (max-width: 420px) {
    .clrtr-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .clrtr-label {
        min-width: 0;
    }

    .clrtr-value-container {
        width: 100%;
    }
}

/* Wide two-column translations when the theme spans the full results grid. */
@container (min-width: 900px) {
    #results-page.degoog-fullwidth-slot-shell
        .clrtr-card.slot-full-width
        .clrtr-panel {
        grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
        gap: 24px;
        padding: 24px;
    }
}

@container (min-width: 1100px) {
    #results-page.degoog-fullwidth-slot-shell
        .clrtr-card.slot-full-width
        .clrtr-translations {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 12px;
        align-content: start;
    }
}

/* LiterallyGoogle presents controls as rounded pills; mirror that in this slot. */
#results-page.degoog-fullwidth-slot-shell .clrtr-panel {
    border-radius: 24px;
}

#results-page.degoog-fullwidth-slot-shell .clrtr-row {
    border-radius: 999px;
    padding-inline: 14px;
}

#results-page.degoog-fullwidth-slot-shell .clrtr-copy-btn {
    border-radius: 999px;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.cxs-copy svg {
    display: block;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

.cxs-swap-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease;
    width: 100%;
    height: 100%;
}

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

/* Rate bar */
.cxs-rate-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding: 10px 18px;
    border-top: 1px solid var(--border-light);
    font-size: 0.88rem;
    color: var(--text-secondary);
}

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

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

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

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

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

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

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

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

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

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

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

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

.cxs-pair-rate {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Picker */
.cxs-picker {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-light, var(--bg));
    border: 1px solid var(--border);
    border-radius: 12px;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

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

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

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

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

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

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

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

.cxs-picker-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
}

.cxs-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 160ms ease;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

    .cxs-row {
        padding: 14px;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Card Container & Styling */
.ms-card {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary, #1a1a1a);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 16px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: none;
  box-sizing: border-box;
  user-select: none;
}

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

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

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

/* Header */
.ms-card .ms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.ms-card .ms-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ms-card .ms-difficulty-selector {
  display: flex;
  gap: 6px;
}

.ms-card .ms-diff-btn {
  background: var(--bg, #f1f5f9);
  border: 1px solid var(--border-light, var(--border, #cbd5e1));
  color: var(--text-secondary, #64748b);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ms-card .ms-diff-btn:hover {
  background: var(--bg-secondary, var(--bg-hover, #cbd5e1));
  color: var(--text-primary);
}

.ms-card .ms-diff-btn.ms-active {
  background: var(--text-link, #3b82f6);
  color: #ffffff;
  border-color: var(--text-link, #3b82f6);
}

/* Dashboard counters and restart button */
.ms-card .ms-dashboard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-light, var(--border, #e2e8f0));
  border-radius: 8px;
  padding: 8px 16px;
  margin-bottom: 16px;
}

.ms-card .ms-counter,
.ms-card .ms-timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ef4444;
  background: #0f172a;
  padding: 2px 8px;
  border-radius: 6px;
  min-width: 48px;
  text-align: center;
  letter-spacing: 1px;
}

.ms-card .ms-face-btn {
  font-size: 1.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.1s ease;
  line-height: 1;
}

.ms-card .ms-face-btn:active {
  transform: scale(0.9);
}

/* Grid layout & wrapper */
.ms-card .ms-grid-container {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding: 6px;
  background: var(--bg-secondary, #f8fafc);
  border-radius: 8px;
  border: 1px solid var(--border-light, var(--border, #e2e8f0));
}

.ms-card .ms-grid {
  display: grid;
  grid-template-columns: repeat(var(--ms-cols, 8), 1fr);
  grid-template-rows: repeat(var(--ms-rows, 8), 1fr);
  gap: 2px;
  background-color: var(--border-light, var(--border, #cbd5e1));
  padding: 2px;
  border-radius: 6px;
  user-select: none;
}

/* Cell styles */
.ms-card .ms-cell {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  box-sizing: border-box;
  border-radius: 3px;
  transition: background-color 0.1s ease;
}

.ms-card .ms-cell.ms-unrevealed {
  background-color: #cbd5e1;
  border: 1px solid #94a3b8;
  box-shadow: inset 1px 1px 0px #ffffff, inset -1px -1px 0px #64748b;
}

.ms-card .ms-cell.ms-unrevealed:hover {
  background-color: #94a3b8;
}

.ms-card .ms-cell.ms-revealed {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  cursor: default;
}

.ms-card .ms-cell.ms-flagged {
  background-color: #cbd5e1;
  border: 1px solid #94a3b8;
  box-shadow: inset 1px 1px 0px #ffffff, inset -1px -1px 0px #64748b;
  position: relative;
}

.ms-card .ms-cell.ms-flagged::after {
  content: "🚩";
  font-size: 1rem;
}

.ms-card .ms-cell.ms-mine {
  background-color: #94a3b8;
  border: 1px solid #475569;
  position: relative;
}

.ms-card .ms-cell.ms-mine::after {
  content: "💣";
  font-size: 1.05rem;
}

.ms-card .ms-cell.ms-exploded {
  background-color: #f87171;
  border: 1px solid #b91c1c;
  position: relative;
}

.ms-card .ms-cell.ms-exploded::after {
  content: "💥";
  font-size: 1.05rem;
}

/* Number styles (1-8) */
.ms-card .ms-cell.ms-num-1 { color: #2563eb; }
.ms-card .ms-cell.ms-num-2 { color: #16a34a; }
.ms-card .ms-cell.ms-num-3 { color: #dc2626; }
.ms-card .ms-cell.ms-num-4 { color: #1e3a8a; }
.ms-card .ms-cell.ms-num-5 { color: #7c2d12; }
.ms-card .ms-cell.ms-num-6 { color: #0891b2; }
.ms-card .ms-cell.ms-num-7 { color: #0f172a; }
.ms-card .ms-cell.ms-num-8 { color: #475569; }

/* Control buttons & Mobile Toggle */
.ms-card .ms-controls {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  gap: 12px;
}

.ms-card .ms-control-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg, #f1f5f9);
  border: 1px solid var(--border-light, var(--border, #cbd5e1));
  color: var(--text-primary);
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ms-card .ms-control-btn:hover {
  background: var(--bg-secondary, var(--bg-hover, #cbd5e1));
}

.ms-card .ms-control-btn[data-ms-action="toggle-flag"].ms-flagging {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ef4444;
}

.ms-card .ms-control-btn[data-ms-action="toggle-flag"].ms-flagging .ms-flag-mode-icon {
  animation: ms-bounce 0.5s infinite alternate;
}

.ms-card .ms-control-btn[data-ms-action="toggle-sound"].ms-muted {
  opacity: 0.65;
}


@keyframes ms-bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

/* Dark mode overrides (respecting system theme) */
@media (prefers-color-scheme: dark) {
  .ms-card {
    color: var(--text-primary, #f1f5f9);
    background: var(--bg-light, var(--bg, #1e293b));
    border-color: var(--border-light, var(--border, #334155));
  }
  
  .ms-card .ms-diff-btn {
    background: #334155;
    border-color: #475569;
    color: var(--text-secondary, #94a3b8);
  }
  
  .ms-card .ms-diff-btn:hover {
    background: #475569;
    color: #f1f5f9;
  }
  
  .ms-card .ms-dashboard {
    background: #1e293b;
    border-color: #334155;
  }
  
  .ms-card .ms-grid-container {
    background: #1e293b;
    border-color: #334155;
  }
  
  .ms-card .ms-grid {
    background-color: #334155;
  }
  
  .ms-card .ms-cell.ms-unrevealed {
    background-color: #475569;
    border-color: #334155;
    box-shadow: inset 1px 1px 0px #64748b, inset -1px -1px 0px #1e293b;
  }
  
  .ms-card .ms-cell.ms-unrevealed:hover {
    background-color: #64748b;
  }
  
  .ms-card .ms-cell.ms-revealed {
    background-color: #1e293b;
    border-color: #334155;
  }
  
  .ms-card .ms-cell.ms-flagged {
    background-color: #475569;
    border-color: #334155;
    box-shadow: inset 1px 1px 0px #64748b, inset -1px -1px 0px #1e293b;
  }
  
  .ms-card .ms-cell.ms-num-1 { color: #60a5fa; }
  .ms-card .ms-cell.ms-num-2 { color: #4ade80; }
  .ms-card .ms-cell.ms-num-3 { color: #f87171; }
  .ms-card .ms-cell.ms-num-4 { color: #93c5fd; }
  .ms-card .ms-cell.ms-num-5 { color: #fdba74; }
  .ms-card .ms-cell.ms-num-6 { color: #22d3ee; }
  .ms-card .ms-cell.ms-num-7 { color: #cbd5e1; }
  .ms-card .ms-cell.ms-num-8 { color: #94a3b8; }
  
  .ms-card .ms-control-btn {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
  }
  
  .ms-card .ms-control-btn:hover {
    background: #475569;
  }
  
  .ms-card .ms-control-btn[data-ms-action="toggle-flag"].ms-flagging {
    background: #451a1a;
    border-color: #7f1d1d;
    color: #f87171;
  }
}



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

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

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



/* ── Weather Slot — Minimal Theme ───────────────────── */

/* Built-in slot chrome can clip or cap width; full-width plugin roots need room to grow. */
.results-slot-panel:has(> .results-slot-panel-body > .wxs-wrap.slot-full-width) {
    overflow: visible;
    max-width: none;
}

.wxs-wrap {
    container-type: inline-size;
    --wxs-accent: #4285f4;
    --wxs-sun: #f59e0b;
    --wxs-rain: #60a5fa;
    --wxs-snow: #bfdbfe;

    margin-bottom: 12px;
    font-family: var(--font-sans, sans-serif);
    color: var(--text-primary);
    position: relative;
}

/* ── Eyebrow / header ─────────────────────────── */

.wxs-header {
    margin-bottom: 10px;
}

.wxs-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.wxs-eyebrow-label {
    color: var(--text-secondary);
}

.wxs-eyebrow-location {
    color: var(--text-primary);
    font-weight: 600;
}

.wxs-eyebrow-sep {
    opacity: 0.55;
}

.wxs-eyebrow-date {
    color: var(--text-secondary);
}

/* ── Hero ──────────────────────────────────────── */

.wxs-hero {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
    align-items: start;
    padding: 16px 18px;
    margin-bottom: 12px;
    border: 1px solid var(--slot-inset-border, var(--border-light));
    border-radius: 16px;
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--text-primary) 4%, transparent),
            transparent 55%
        ),
        var(--slot-inset-bg, var(--bg-light, transparent));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent);
}

/* Warm tint by day, cool tint by night — echoes the sun/moon card. */
.wxs-wrap[data-wxs-is-day="1"] .wxs-hero {
    background:
        radial-gradient(
            130% 135% at 6% -25%,
            color-mix(in srgb, var(--wxs-sun) 14%, transparent),
            transparent 56%
        ),
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--text-primary) 4%, transparent),
            transparent 55%
        ),
        var(--slot-inset-bg, var(--bg-light, transparent));
}

.wxs-wrap[data-wxs-is-day="0"] .wxs-hero {
    background:
        radial-gradient(
            130% 135% at 6% -25%,
            color-mix(in srgb, var(--wxs-accent) 16%, transparent),
            transparent 56%
        ),
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--text-primary) 5%, transparent),
            transparent 55%
        ),
        var(--slot-inset-bg, var(--bg-light, transparent));
}

.wxs-hero-left {
    display: grid;
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
        "icon temp meta"
        "icon temp meta";
    align-items: center;
    gap: 8px 14px;
    min-width: 0;
}

.wxs-hero-icon {
    grid-area: icon;
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wxs-hero-temp {
    grid-area: temp;
    display: flex;
    align-items: flex-start;
    line-height: 0.95;
    white-space: nowrap;
}

.wxs-num {
    font-size: clamp(2.6rem, 6vw, 3.6rem);
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    transition: opacity 200ms ease;
}

.wxs-deg {
    font-size: clamp(1.1rem, 2.8vw, 1.5rem);
    font-weight: 300;
    color: var(--text-secondary);
    margin-top: 0.35em;
    margin-left: 0.1em;
    letter-spacing: -0.02em;
}

.wxs-hero-meta {
    grid-area: meta;
    display: grid;
    gap: 4px;
    min-width: 0;
}

.wxs-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.wxs-meta-label {
    color: var(--text-secondary);
}

.wxs-meta-value {
    color: var(--text-primary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.wxs-hero-right {
    display: grid;
    gap: 6px;
    text-align: right;
    min-width: 0;
}

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

.wxs-hero-date {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.wxs-hero-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.wxs-hero-hilo {
    margin-top: 4px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

.wxs-hilo-hi strong,
.wxs-hilo-lo strong {
    color: var(--text-primary);
    font-weight: 600;
}

.wxs-hilo-sep {
    opacity: 0.55;
}

/* ── Tabs ─────────────────────────────────────── */

.wxs-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 5px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    border-radius: 100px;
    background: var(--bg-light, transparent);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 5%, transparent);
}

.wxs-tab {
    flex: 1 1 0;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    text-align: center;
    transition:
        color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
}

.wxs-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover, rgba(255, 255, 255, 0.05));
}

.wxs-tab-active,
.wxs-tab-active:hover {
    color: #fff;
    background: var(--wxs-accent);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--wxs-accent) 38%, transparent);
}

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

.wxs-chart-wrap {
    border: 1px solid var(--slot-inset-border, var(--border-light));
    border-radius: 16px;
    padding: 12px 14px 10px;
    margin-bottom: 12px;
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--text-primary) 4%, transparent),
            transparent 55%
        ),
        var(--slot-inset-bg, var(--bg-light, transparent));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent);
}

.wxs-chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

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

.wxs-chart-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.wxs-chart {
    position: relative;
    width: 100%;
    height: 140px;
}

.wxs-chart-scroll {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.wxs-chart svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.wxs-chart-grid line {
    stroke: var(--border-light);
    stroke-dasharray: 2 4;
    opacity: 0.6;
}

.wxs-chart-axis text {
    fill: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
}

.wxs-chart-label {
    fill: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    text-anchor: middle;
    font-family: inherit;
}

.wxs-chart-area {
    opacity: 0.18;
}

.wxs-chart-line {
    fill: none;
    stroke-width: 2.2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.wxs-chart-bar {
    transition: opacity 160ms ease;
}

.wxs-chart-point {
    fill: var(--bg, #111);
    stroke-width: 2;
    pointer-events: none;
}

.wxs-chart-marker {
    cursor: crosshair;
    pointer-events: all;
}

.wxs-chart-label {
    pointer-events: none;
}

.wxs-chart-line,
.wxs-chart-area {
    pointer-events: none;
}

.wxs-chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--bg, #1a1a1a);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.88rem;
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
    transform: translate(-50%, calc(-100% - 10px));
    opacity: 0;
    transition:
        opacity 120ms ease,
        left 80ms ease;
    z-index: 2;
    min-width: 112px;
}

.wxs-chart-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 8px;
    height: 8px;
    background: var(--bg, #1a1a1a);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transform: translateX(-50%) rotate(45deg);
}

.wxs-chart-tooltip.wxs-tt-visible {
    opacity: 1;
}

.wxs-chart-tooltip strong {
    color: var(--text-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.wxs-chart-tooltip .wxs-tt-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-light);
}

.wxs-chart-tooltip .wxs-tt-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    line-height: 1.35;
}

.wxs-chart-tooltip .wxs-tt-row + .wxs-tt-row {
    margin-top: 3px;
}

.wxs-chart-tooltip .wxs-tt-key {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.wxs-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.wxs-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wxs-chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
    font-style: normal;
}

/* ── Days ─────────────────────────────────────── */

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

.wxs-days-hint {
    font-size: 0.74rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-secondary);
}

.wxs-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 12px;
}

.wxs-day {
    position: relative;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 10px 4px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--text-primary) 3%, transparent),
            transparent 60%
        ),
        var(--slot-inset-bg, var(--bg-light, transparent));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 5%, transparent);
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.wxs-day:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--wxs-accent) 42%, var(--border-light));
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

.wxs-day-active,
.wxs-day-active:hover {
    transform: none;
    border-color: var(--wxs-accent);
    background: color-mix(in srgb, var(--wxs-accent) 14%, transparent);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--wxs-accent) 22%, transparent);
}

.wxs-day-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.wxs-day-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 28px;
    margin-bottom: 4px;
}

.wxs-day-hi {
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.wxs-day-lo {
    font-size: 0.86rem;
    color: var(--text-secondary);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.wxs-day-precip {
    margin-top: 6px;
    font-size: 0.76rem;
    color: var(--wxs-rain);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.wxs-day-precip svg {
    display: block;
}

.wxs-day-precip.wxs-day-precip-zero {
    color: var(--text-secondary);
    opacity: 0.55;
}

/* ── Details grid ────────────────────────────── */

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

.wxs-details {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.wxs-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 11px 13px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--text-primary) 3%, transparent),
            transparent 60%
        ),
        var(--slot-inset-bg, var(--bg-light, transparent));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 5%, transparent);
    transition: border-color 160ms ease;
}

.wxs-detail:hover {
    border-color: color-mix(in srgb, var(--wxs-accent) 32%, var(--border-light));
}

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

.wxs-detail-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.wxs-detail-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

/* ── Astronomy (combined sun + moon card) ────── */

.wxs-astro {
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid var(--slot-inset-border, var(--border-light));
    border-radius: 16px;
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--text-primary) 4%, transparent),
            transparent 55%
        ),
        var(--slot-inset-bg, var(--bg-light, transparent));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent);
}

.wxs-astro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.wxs-astro-col {
    position: relative;
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 14px 16px;
    border-radius: 12px;
    min-width: 0;
}

.wxs-astro-col-sun {
    background: radial-gradient(
        130% 90% at 50% -25%,
        color-mix(in srgb, var(--wxs-sun) 12%, transparent),
        transparent 68%
    );
}

.wxs-astro-col-moon {
    background: radial-gradient(
        130% 90% at 50% -25%,
        color-mix(in srgb, var(--wxs-accent) 13%, transparent),
        transparent 68%
    );
}

/* Vertical hairline divider between the two columns (wide layout). */
.wxs-astro-col-moon::before {
    content: "";
    position: absolute;
    left: -3px;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: var(--border-light);
}

.wxs-astro-col-head {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.wxs-astro-ico {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    flex-shrink: 0;
    line-height: 1;
}

.wxs-astro-ico-sun {
    color: var(--wxs-sun);
    background: color-mix(in srgb, var(--wxs-sun) 16%, transparent);
}

.wxs-astro-ico-sun svg {
    display: block;
    width: 18px;
    height: 18px;
}

.wxs-astro-ico-moon {
    color: #dbeafe;
    font-size: 1.05rem;
    background: color-mix(in srgb, var(--wxs-accent) 16%, transparent);
    box-shadow: inset -4px 0 0 color-mix(in srgb, var(--bg) 45%, transparent);
}

.wxs-astro-col-name {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.wxs-astro-phase {
    margin-left: auto;
    display: grid;
    justify-items: end;
    gap: 1px;
    min-width: 0;
    text-align: right;
}

.wxs-astro-phase-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.2;
}

.wxs-astro-phase-illum {
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
}

.wxs-astro-body {
    display: grid;
    grid-template-columns: minmax(64px, auto) minmax(0, 1fr) minmax(64px, auto);
    align-items: center;
    gap: 14px;
}

.wxs-astro-endpoint {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.wxs-astro-endpoint-right {
    justify-items: end;
    text-align: right;
}

.wxs-astro-ep-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.wxs-astro-ep-time {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.wxs-astro-relative {
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.wxs-astro-track {
    position: relative;
    align-self: center;
    height: 56px;
    min-width: 0;
}

.wxs-astro-arc {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.wxs-astro-arc-bg {
    stroke: color-mix(in srgb, var(--border) 78%, var(--text-secondary));
    opacity: 0.5;
    stroke-linecap: round;
}

.wxs-astro-arc-fill {
    opacity: 0.9;
    stroke-linecap: round;
}

.wxs-sun-arc-fill {
    stroke: var(--wxs-sun);
    filter: drop-shadow(0 1px 4px color-mix(in srgb, var(--wxs-sun) 28%, transparent));
}

.wxs-moon-arc-fill {
    stroke: color-mix(in srgb, var(--wxs-accent) 60%, #dbeafe);
    filter: drop-shadow(0 1px 4px color-mix(in srgb, var(--wxs-accent) 20%, transparent));
}

.wxs-sun-dot,
.wxs-moon-dot {
    position: absolute;
    top: 0;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--wxs-sun);
    border: 2px solid var(--bg-light, var(--bg));
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--wxs-sun) 24%, transparent),
        0 3px 12px color-mix(in srgb, var(--wxs-sun) 56%, transparent);
    transform: translate(-50%, -50%);
    transition:
        left 0.6s ease,
        top 0.6s ease;
    pointer-events: none;
}

.wxs-moon-dot {
    width: 12px;
    height: 12px;
    background: #dbeafe;
    box-shadow:
        0 0 0 2px color-mix(in srgb, #dbeafe 22%, transparent),
        0 3px 12px color-mix(in srgb, var(--wxs-accent) 32%, transparent);
}

.wxs-moon-dot--down {
    opacity: 0.38;
    background: color-mix(in srgb, #dbeafe 55%, var(--text-secondary));
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--text-secondary) 16%, transparent),
        0 2px 6px color-mix(in srgb, var(--text-secondary) 20%, transparent);
}

.wxs-astro-apex {
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    white-space: nowrap;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.wxs-astro-apex-label {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

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

.wxs-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.wxs-footer a {
    color: var(--text-link, var(--wxs-accent));
    text-decoration: none;
}

.wxs-footer a:hover {
    text-decoration: underline;
}

.wxs-footer-sep {
    opacity: 0.55;
}

/* ── Animated hero icons ─────────────────────── */

.wxs-ani-float {
    animation: wxs-float 4s ease-in-out infinite;
}
.wxs-ani-sun {
    animation: wxs-float 4s ease-in-out infinite;
}

@keyframes wxs-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes wxs-spin {
    from {
        transform: rotate(0);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes wxs-fadein {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wxs-drop {
    position: absolute;
    width: 2px;
    border-radius: 2px;
    background: var(--wxs-rain);
    opacity: 0.85;
    animation: wxs-rain 1.1s linear infinite;
}

@keyframes wxs-rain {
    0% {
        transform: translateY(-2px);
        opacity: 0;
    }
    50% {
        opacity: 0.85;
    }
    100% {
        transform: translateY(18px);
        opacity: 0;
    }
}

.wxs-flake {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--wxs-snow);
    animation: wxs-snow 1.4s linear infinite;
}

@keyframes wxs-snow {
    0% {
        transform: translateY(-2px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(14px);
        opacity: 0;
    }
}

.wxs-bolt {
    animation: wxs-flash 2s ease-in-out infinite;
}

@keyframes wxs-flash {
    0%,
    100% {
        opacity: 0.45;
    }
    50% {
        opacity: 1;
    }
}

.wxs-hero-icon > div {
    animation: wxs-fadein 0.35s ease;
}

/* ── Responsive ──────────────────────────────── */

@container (max-width: 720px) {
    .wxs-hero {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .wxs-hero-right {
        text-align: left;
    }

    .wxs-hero-hilo {
        justify-content: flex-start;
    }

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

@container (max-width: 560px) {
    .wxs-hero-left {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "icon temp"
            "meta meta";
    }

    .wxs-hero-icon {
        width: 72px;
        height: 72px;
    }

    .wxs-days {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .wxs-astro-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Divider becomes a horizontal rule between the stacked columns. */
    .wxs-astro-col-moon::before {
        left: 14px;
        right: 14px;
        top: -1px;
        bottom: auto;
        width: auto;
        height: 1px;
    }
}

@container (max-width: 420px) {
    .wxs-days {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .wxs-details {
        grid-template-columns: 1fr 1fr;
    }

    .wxs-astro-body {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "rise set"
            "track track";
        gap: 12px;
    }

    .wxs-astro-endpoint {
        grid-area: rise;
    }

    .wxs-astro-endpoint-right {
        grid-area: set;
    }

    .wxs-astro-track {
        grid-area: track;
        margin-top: 2px;
    }
}

.until-card {
    container-type: inline-size;
    color: var(--text-primary, CanvasText);
    --until-board: #17181b;
    --until-board-2: #202126;
    --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;
    /* Google blue (dark-surface tone) used for accents/hover. */
    --until-accent: #8ab4f8;
    /* Material-ish rounding hierarchy. */
    --until-radius: 24px;
    --until-radius-sm: 14px;
    --until-radius-flap: 10px;
}

.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, rgba(255, 255, 255, 0.06), 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 rgba(255, 255, 255, 0.08),
        0 1px 2px rgba(0, 0, 0, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.24);
}

.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: rgba(255, 255, 255, 0.05);
    color: color-mix(in srgb, var(--text-secondary, #a1a1aa) 88%, #fff);
}

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

.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(--text-secondary, #a1a1aa);
    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: #fff;
    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 rgba(255, 255, 255, 0.12);
    border-radius: var(--until-radius-flap);
    overflow: hidden;
    color: #f8fafc;
    background: var(--until-board-2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5),
        0 6px 16px rgba(0, 0, 0, 0.26);
    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, 820);
    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: rgba(0, 0, 0, 0.45);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.until-card__flap-card {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    box-sizing: border-box;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 60%),
        var(--until-board-2);
    backface-visibility: hidden;
}

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

/* Top leaf: starts upright over the upper half and falls forward/down. */
.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);
}

/* Bottom leaf: waits folded up behind the hinge, then drops into place. */
.until-card__flap-card--flip-lower {
    bottom: 0;
    z-index: 3;
    border-radius: 0 0 var(--until-radius-flap) var(--until-radius-flap);
    transform-origin: center top;
    transform: rotateX(90deg);
}

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

.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 520ms cubic-bezier(0.36, 0, 0.66, 1) both;
}

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

.until-card__part-unit {
    color: var(--text-secondary, #a1a1aa);
    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: 860;
    --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: #fff;
    font-size: 2.2rem;
    font-weight: 820;
    line-height: 1;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.32);
}

.until-card__caption {
    color: var(--text-secondary, #a1a1aa);
    font-size: 0.92rem;
    line-height: 1.35;
}

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

.until-card__detail {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--until-radius-sm);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.until-card__detail:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: color-mix(in srgb, var(--until-accent) 40%, rgba(255, 255, 255, 0.1));
}

.until-card__detail dt {
    margin: 0;
    color: color-mix(in srgb, var(--text-secondary, #a1a1aa) 86%, #fff);
}

.until-card__detail dd {
    margin: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 780;
    line-height: 1.2;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

/* Phase 1 (0-50%): the top leaf falls forward, uncovering the new upper half. */
@keyframes until-flip-top {
    0% {
        transform: rotateX(0deg);
    }
    50%,
    100% {
        transform: rotateX(-90deg);
    }
}

/* Phase 2 (50-100%): the new bottom leaf swings down onto the lower half. */
@keyframes until-flip-bottom {
    0%,
    50% {
        transform: rotateX(90deg);
    }
    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 1fr;
    }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.uxs-copy svg {
    display: block;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* ── TMDB Slot Plugin — Minimal Theme ──────────────────────────────────────── */

/*
 * Built-in (default) theme: above-results slots use `overflow: hidden` on
 * `.results-slot-panel`; stacked TV layout needs `overflow: visible` so the episodes rail
 * can grow. Flex/`contain` fixes below apply to stacked mode — that is where the rail could
 * collapse (phones + default theme), not LiterallyGoogle’s optional side-by-side rail.
 *
 * LiterallyGoogle-only: `#results-page.degoog-fullwidth-slot-shell` + `.slot-full-width`
 * enables the two-column TV band (hero | episodes) with full-width cast below; theme CSS is unchanged here beyond those scoped blocks.
 */
.results-slot-panel:has(
    > .results-slot-panel-body > .tmdb-result.slot-full-width
) {
    overflow: visible;
    max-height: none;
}

.tmdb-result {
    container-type: inline-size;
    container-name: tmdb-result;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    color: var(--text-primary);
    padding: 0 0 1.25rem;
    font-family: var(--font-sans, sans-serif);
    /* Themes often set --border-light too close to --bg-light in dark mode; edges stay visible. */
    --tmdb-edge: var(
        --border,
        color-mix(in srgb, var(--text-primary, CanvasText) 22%, transparent)
    );
}

.tmdb-result > .tmdb-panel {
    min-width: 0;
    max-width: 100%;
}

/* ── Image Combo (movie / TV): 1 large poster + 2 stacked backdrops ───────── */

.tmdb-img-combo {
    min-width: 0;
    gap: 2px;
    background: rgba(0, 0, 0, 0.65);
    margin-bottom: 0;
    border-radius: 12px;
    overflow: hidden;
    isolation: isolate;
}

.tmdb-img-main {
    height: 100%;
}

.tmdb-img-side {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
    height: 100%;
}

.tmdb-img-side > .tmdb-combo-tile-wrap,
.tmdb-img-side > .tmdb-combo-img,
.tmdb-img-side > .tmdb-combo-placeholder {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
}

.tmdb-combo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--bg-light);
    cursor: pointer;
    transition: transform 0.25s ease;
    overflow: hidden;
    transform-origin: center center;
    backface-visibility: hidden;
}

/* Per-tile clip (esp. quad columns): some engines don’t clip transformed <img> on the
   inner horizontal gutter; the wrapper is the reliable overflow box. */
.tmdb-combo-tile-wrap {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.tmdb-combo-tile-wrap > .tmdb-combo-img {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
}

/* Hover zoom stays inside each tile (clips black gutters + outer rounded frame). */
.tmdb-img-combo .tmdb-combo-img:hover,
.tmdb-person-photo .tmdb-person-photo-img:hover {
    transform: scale(1.08);
}

/* Ensure overflow hidden clips the zoomed image */
.tmdb-img-main,
.tmdb-img-side,
.tmdb-person-photo {
    overflow: hidden;
}

.tmdb-combo-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    border-radius: 6px;
}

/* Default (narrow container): stack the image combo on top of the info block.
   The wide side-by-side layout is restored via @container below. */
.tmdb-overview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* ── Person: portrait grid ───────────────────────────────────────────────── */

.tmdb-person-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    margin-bottom: 0;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 7;
    width: 100%;
}

.tmdb-person-photo {
    overflow: hidden;
    background: var(--bg-light);
    grid-template-columns: repeat(2, 1fr);
}

.tmdb-person-grid .tmdb-person-photo:nth-child(odd):last-child {
    grid-row: 1 / 3;
}

.tmdb-person-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.25s ease;
    overflow: hidden;
    transform-origin: center center;
    backface-visibility: hidden;
}

.tmdb-person-photo--empty {
    opacity: 0.15;
}

/* ── Adaptive image layouts ────────────────────────────────────────────────── */

/* Single image: full width of the combo frame.
   Posters are portrait — do not force 16:9 or cover (that clips tops/sides). */
.tmdb-img-combo.tmdb-img-combo--single {
    display: block;
    grid-template-columns: none;
}

.tmdb-img-combo--single > .tmdb-combo-img:not(.tmdb-combo-poster) {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.tmdb-img-combo--single > .tmdb-combo-img.tmdb-combo-poster {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: unset;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* Two images: side by side */
.tmdb-img-combo.tmdb-img-combo--double {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.tmdb-img-combo--double > .tmdb-combo-tile-wrap {
    aspect-ratio: 1;
    min-height: 0;
}

/* Poster + backdrop: poster column sizes itself to the poster's natural aspect ratio at
   the collage height — no forced width. Backdrops take the remaining space. */
.tmdb-img-combo.tmdb-img-combo--double.tmdb-img-combo--poster-first {
    grid-template-columns: auto minmax(0, 1fr);
}

.tmdb-img-combo--double.tmdb-img-combo--poster-first > .tmdb-combo-tile-wrap {
    aspect-ratio: unset;
    align-self: stretch;
}

/* Triple layout: one row, two equal columns — poster | stacked backdrops.
   (Do not use a 2-row grid with main spanning both rows and side in row 1 only;
    that collapses the side cell height and smushes images.) */
.tmdb-img-combo.tmdb-img-combo--triple {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    align-items: stretch;
    gap: 2px;
    min-height: 0;
}

.tmdb-img-combo.tmdb-img-combo--triple.tmdb-img-combo--poster-first {
    grid-template-columns: auto minmax(0, 1fr);
}

.tmdb-img-combo--triple > .tmdb-img-main {
    min-height: 0;
    height: 100%;
    grid-column: 1;
    grid-row: 1;
}

.tmdb-img-combo--triple > .tmdb-img-side {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Poster-leading hero column: poster drives its own width from intrinsic aspect ratio. */
.tmdb-img-combo--poster-first > .tmdb-img-main,
.tmdb-img-combo--double.tmdb-img-combo--poster-first
    > .tmdb-combo-tile-wrap:first-child {
    display: flex;
    min-width: 0;
    min-height: 0;
    align-items: stretch;
}

.tmdb-img-combo--poster-first > .tmdb-img-main > .tmdb-combo-img,
.tmdb-img-combo--poster-first > .tmdb-img-main > .tmdb-combo-placeholder,
.tmdb-img-combo--double.tmdb-img-combo--poster-first
    > .tmdb-combo-tile-wrap:first-child
    > .tmdb-combo-img,
.tmdb-img-combo--double.tmdb-img-combo--poster-first
    > .tmdb-combo-tile-wrap:first-child
    > .tmdb-combo-placeholder {
    width: auto;
    height: 100%;
    min-height: 0;
    object-fit: contain;
    object-position: center top;
    display: block;
}

/* Three stills only (no poster in the assembled set) */
.tmdb-img-combo.tmdb-img-combo--triple-no-poster {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.tmdb-img-combo--triple-no-poster > .tmdb-combo-tile-wrap {
    min-height: 0;
}

.tmdb-img-combo--triple-no-poster > .tmdb-combo-tile-wrap > .tmdb-combo-img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
}

/* Poster + three backdrops: full-height poster column | top row (2 stills) + bottom wide still */
.tmdb-img-combo.tmdb-img-combo--quad {
    display: grid;
    grid-template-columns: minmax(158px, 46%) minmax(0, 1fr);
    gap: 2px;
    min-height: 0;
    align-items: stretch;
}

.tmdb-img-combo--quad > .tmdb-img-main {
    min-height: 0;
    height: 100%;
}

.tmdb-img-side--quad {
    display: grid;
    grid-template-rows: 2fr 3fr;
    gap: 2px;
    min-height: 0;
    height: 100%;
}

.tmdb-quad-side-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    min-height: 0;
    overflow: hidden;
}

.tmdb-quad-side-bottom {
    min-height: 0;
    overflow: hidden;
}

.tmdb-img-side--quad .tmdb-quad-side-top .tmdb-combo-tile-wrap,
.tmdb-img-side--quad .tmdb-quad-side-bottom .tmdb-combo-tile-wrap {
    min-height: 0;
}

.tmdb-img-combo--quad .tmdb-combo-tile {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
}

/* Empty state */
.tmdb-img-combo.tmdb-img-combo--empty {
    display: block;
}

.tmdb-person-info,
.tmdb-info-block {
    padding-bottom: 0.25rem;
    min-width: 0;
}

/* Medium container (>=640px): side-by-side layout. */
@container (min-width: 640px) {
    .tmdb-overview {
        grid-template-columns: repeat(4, 1fr);
    }
    .tmdb-overview .tmdb-person-grid {
        grid-column: 1 / 3;
        aspect-ratio: auto;
        height: 300px;
    }
    .tmdb-person-info,
    .tmdb-info-block {
        grid-column: 3 / 5;
    }
}

/* ── Info block ───────────────────────────────────────────────────────────── */

.tmdb-info-block {
    margin-bottom: 0.5rem;
}

.tmdb-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-primary);
}

.tmdb-year {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.tmdb-title-text {
    font-weight: inherit;
    color: inherit;
}

.tmdb-title-sep {
    color: var(--text-secondary);
    font-weight: 400;
}

.tmdb-title:has(.tmdb-title-text) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0;
    row-gap: 0.2rem;
}

.tmdb-title-link + .tmdb-year {
    margin-left: 0.35rem;
}

/* Match title text color (not global link blue); h3 is 500 — keep secondary line normal weight. */
.tmdb-title .tmdb-year {
    font-weight: 400;
}

.tmdb-plot {
    margin: 0 0 0.75rem;
    font-size: 0.94rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

/*
 * TMDB strings are overwhelmingly Latin/LTR. On `dir=rtl` pages, without isolation the
 * Unicode bidirectional algorithm can place sentence-final punctuation on the wrong side.
 */
.tmdb-plot,
.tmdb-season-overview,
.tmdb-episode-overview {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: start;
}

/* ── Clickable title (opens TMDB in a new tab) ───────────────────────────── */

/* Stronger than theme `a { color: link }` inside results slots. */
.tmdb-result .tmdb-panel .tmdb-title-link,
.tmdb-result .tmdb-panel .tmdb-title-link:any-link,
.tmdb-result .tmdb-panel .tmdb-title-link:visited {
    display: inline;
    color: var(--text-primary);
    text-decoration: none;
}

.tmdb-result .tmdb-panel .tmdb-title-link .tmdb-title-text {
    color: var(--text-primary);
}

.tmdb-result .tmdb-panel .tmdb-title-link:hover,
.tmdb-result .tmdb-panel .tmdb-title-link:any-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tmdb-result .tmdb-panel .tmdb-title-link:focus-visible {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Panel header (used above person panel) ──────────────────────────────── */

.tmdb-panel-header {
    margin: 0 0 0.75rem;
}

.tmdb-panel-header .tmdb-title {
    margin: 0;
}

/* ── Back button (injected client-side by script.js) ─────────────────────── */

.tmdb-back-btn {
    all: unset;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    margin: 0 0 0.75rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    transition:
        background 0.15s,
        border-color 0.15s,
        transform 0.1s;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tmdb-back-btn:hover,
.tmdb-back-btn:focus-visible {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    border-color: var(--primary, #1a73e8);
}

.tmdb-back-btn:active {
    transform: translateX(-1px);
}

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

/* ── Loading state while navigating ──────────────────────────────────────── */

.tmdb-result.tmdb-loading {
    position: relative;
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s;
}

.tmdb-result.tmdb-loading::after {
    content: "";
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary, #1a73e8);
    border-radius: 50%;
    animation: tmdb-spin 0.8s linear infinite;
}

@keyframes tmdb-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Metadata grid (weather-style divider grid) ───────────────────────────── */

.tmdb-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1px;
    background: var(--border-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
}

.tmdb-meta-cell {
    background: var(--bg-light, var(--bg));
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

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

.tmdb-meta-value {
    font-size: 0.94rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.35;
}

/* ── Cast: horizontal strip + hover carousel arrows (no scrollbar) ───────── */

.tmdb-cast-carousel {
    position: relative;
    min-width: 0;
}

.tmdb-cast-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-width: 0;
}

.tmdb-cast-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.tmdb-cast-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg, Canvas) 90%, transparent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.tmdb-cast-nav-icon {
    display: block;
    margin-top: -1px;
}

.tmdb-cast-nav--prev {
    left: 0.15rem;
}

.tmdb-cast-nav--next {
    right: 0.15rem;
}

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

/* Touch / stylus: no hover — keep arrows usable without relying on :hover */
@media (hover: none) {
    .tmdb-cast-carousel .tmdb-cast-nav:not(:disabled) {
        opacity: 1;
        pointer-events: auto;
    }
}

.tmdb-cast-nav:hover,
.tmdb-cast-nav:focus-visible {
    border-color: var(--primary, #1a73e8);
    color: var(--text-primary);
    background: color-mix(in srgb, var(--bg-light, var(--bg)) 95%, transparent);
    outline: none;
}

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

.tmdb-cast-nav:disabled {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none !important;
}

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

.tmdb-cast-card {
    flex: 0 0 auto;
    width: 7rem;
    background: var(--bg-light);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--tmdb-edge);
    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease;
}

/* Clickable cast cards navigate to the person's slot (see script.js). */
.tmdb-cast-card--clickable {
    cursor: pointer;
    user-select: none;
}

.tmdb-cast-card--clickable:hover,
.tmdb-cast-card--clickable:focus-visible {
    transform: translateY(-2px);
    border-color: var(--primary, #1a73e8);
    background: var(--bg-hover, var(--bg-light));
}

.tmdb-cast-card--clickable:focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
}

.tmdb-cast-card--clickable:active {
    transform: translateY(0);
}

.tmdb-cast-photo-wrap {
    width: 100%;
    /* Taller than square: extra card height goes to the headshot, not the name block */
    aspect-ratio: 4 / 5;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 13px 13px 0 0;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35);
}

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

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

.tmdb-cast-name {
    padding: 0.48rem 0.42rem 0.12rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.tmdb-cast-char {
    padding: 0 0.42rem 0.48rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ── Filmography scroll strip ─────────────────────────────────────────────── */

.tmdb-filmography-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0 0.75rem;
    margin-bottom: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.tmdb-filmography-scroll::-webkit-scrollbar {
    height: 8px;
}

.tmdb-filmography-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.tmdb-filmography-scroll::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 999px;
}

.tmdb-filmography-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

.tmdb-filmography-strip {
    display: flex;
    gap: 0.65rem;
    width: max-content;
}

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

.tmdb-film-card:hover {
    transform: scale(1.03);
}

.tmdb-film-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-light);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tmdb-film-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tmdb-film-placeholder {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.tmdb-film-title {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
    padding: 0 0.2rem;
}

.tmdb-film-year {
    font-size: 0.67rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
    text-align: center;
}

/* ── Section heading ──────────────────────────────────────────────────────── */

.tmdb-section-heading {
    margin: 0.75rem 0 0.4rem;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ── Accordion (seasons, cast) ────────────────────────────────────────────── */

.tmdb-accordion {
    margin-bottom: 0.4rem;
}

.tmdb-accordion-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.tmdb-accordion-summary::-webkit-details-marker {
    display: none;
}

.tmdb-accordion-summary::before {
    content: "\25B6";
    font-size: 0.55rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

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

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

.tmdb-accordion-body {
    padding: 0 0 0.5rem 0.4rem;
}

/* ── Episode list (lazy-loaded inside a season accordion) ────────────────── */

.tmdb-episodes {
    margin-top: 0.75rem;
}

.tmdb-episodes:empty {
    margin-top: 0;
}

.tmdb-episodes-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--tmdb-edge);
    max-height: min(280px, 42vh);
    overflow-y: auto;
    overflow-x: hidden;
    margin-inline-end: -0.1rem;
    padding-inline-end: 0.35rem;
}

/* Cards must keep natural height; flex-shrink was collapsing rows + clipping stills/copy. */
.tmdb-episodes-list > .tmdb-episode {
    flex-shrink: 0;
}

.tmdb-episode {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-block: 0;
    padding-inline-start: 0;
    padding-inline-end: 0.55rem;
    border-radius: 12px;
    background: var(--bg-light);
    border: 1px solid var(--tmdb-edge);
    color: inherit;
    overflow: hidden;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        transform 0.1s ease;
}

/* Grid: row height = max(thumb, copy). Stretch thumb so the still fills the cell (cover)
   when copy is taller — no dead band below a short still. */
.tmdb-episode-flow {
    display: grid;
    grid-template-columns: var(--tmdb-episode-thumb-w) minmax(0, 1fr);
    column-gap: 0.65rem;
    align-items: stretch;
    min-width: 0;
    padding-top: 0;
    --tmdb-episode-thumb-w: 118px;
}

.tmdb-episode-thumb {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: var(--tmdb-episode-thumb-w);
    margin: 0;
    border-start-start-radius: 12px;
    border-end-start-radius: 12px;
    border-start-end-radius: 0;
    border-end-end-radius: 0;
    overflow: hidden;
    background: color-mix(in srgb, var(--tmdb-edge) 28%, var(--bg-light));
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-height: calc(var(--tmdb-episode-thumb-w) * 9 / 16);
}

.tmdb-episode-copy {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-inline-end: 0.35rem;
}

.tmdb-episode-head {
    display: block;
    margin: 0;
    min-width: 0;
}

.tmdb-episode-thumb--link,
.tmdb-episode-head--link {
    color: inherit;
    text-decoration: none;
}

.tmdb-episode-thumb--link {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.tmdb-episode-head--link:focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
    border-radius: 6px;
}

.tmdb-episode-thumb--link:focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
    border-start-start-radius: 12px;
    border-end-start-radius: 12px;
    border-start-end-radius: 0;
    border-end-end-radius: 0;
}

.tmdb-episode--clickable {
    cursor: default;
}

.tmdb-episode--clickable:hover,
.tmdb-episode--clickable:focus-within {
    border-color: var(--primary, #1a73e8);
    background: var(--bg-hover, var(--bg-light));
}

.tmdb-episode-head--link:active {
    transform: translateY(1px);
}

.tmdb-episode--clickable .tmdb-episode-head--link:hover .tmdb-episode-title,
.tmdb-episode--clickable
    .tmdb-episode-head--link:focus-visible
    .tmdb-episode-title {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tmdb-episode-still {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.tmdb-episode-still--empty {
    flex: 1 1 auto;
    width: 100%;
    min-height: calc(var(--tmdb-episode-thumb-w) * 9 / 16);
    opacity: 0.25;
}

.tmdb-episode-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}

.tmdb-episode-num {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tmdb-episode-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.tmdb-episode-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.tmdb-episode-header + .tmdb-episode-meta {
    margin-top: 0.25rem;
}

/* ~2 lines; full copy available on TMDB via existing episode links.
   min-height: WebKit often contributes ~0 intrinsic height for -webkit-box + clamp,
   which collapsed the grid row and clipped the still + meta. */
.tmdb-episode-overview {
    margin: 0;
    padding-top: 0.1rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    min-height: calc(1.45em * 2);
}

.tmdb-episodes-loading,
.tmdb-episodes-error,
.tmdb-episodes-empty {
    padding: 0.75rem;
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: center;
    border-top: 1px solid var(--tmdb-edge);
}

.tmdb-episodes-error {
    color: var(--danger, #d33);
}

/* Stack episode cards only on very narrow viewports — not when the slot alone is narrow.
   Otherwise default themes keep a ~480px slot but LiterallyGoogle reads “wide”; episode rows
   must stay thumb | copy inside the rail. */
@media (max-width: 420px) {
    .tmdb-episode {
        padding-inline-start: 0.45rem;
    }

    .tmdb-episode-flow {
        grid-template-columns: 1fr;
        row-gap: 0.45rem;
    }

    .tmdb-episode-thumb {
        grid-column: 1;
        grid-row: 1;
        max-width: 100%;
        border-radius: 12px;
    }

    .tmdb-episode-copy {
        grid-column: 1;
        grid-row: 2;
        padding-inline-end: 0;
    }
}

/* ── Season detail row ────────────────────────────────────────────────────── */

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

.tmdb-season-poster {
    flex-shrink: 0;
    width: 52px;
    border-radius: 8px;
    display: block;
}

.tmdb-season-info {
    flex: 1;
    min-width: 0;
}

.tmdb-season-overview {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    max-height: calc(1.45em * 3 + 0.25em);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */

.tmdb-tabs {
    position: relative;
}

.tmdb-tab-bar {
    display: flex;
    gap: 0.15rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 1px;
    border-bottom: 1px solid var(--tmdb-edge);
}

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

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

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

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

/* ── Jellyfin card ────────────────────────────────────────────────────────── */

.tmdb-jf-wrap {
    margin-top: 0.75rem;
}

.tmdb-jf-card--compact {
    flex-shrink: 0;
    align-self: flex-start;
    padding: 0.2rem 0.55rem 0.2rem 0.45rem;
    gap: 0.35rem;
    border-radius: 999px;
    max-width: none;
}

.tmdb-jf-card--compact.tmdb-jf-card--icon-only {
    padding: 0.38rem;
    gap: 0;
    border-radius: 10px;
    margin-left: auto;
}

.tmdb-jf-card--compact.tmdb-jf-card--icon-only .tmdb-jf-logo {
    width: 24px;
    height: 24px;
    display: block;
}

.tmdb-jf-card--compact .tmdb-jf-logo {
    width: 18px;
    height: 18px;
}

.tmdb-jf-card--compact .tmdb-jf-btn {
    margin-left: 0;
    border: none;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary, #1a73e8);
    white-space: nowrap;
}

.tmdb-jf-card {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    background: transparent;
    transition:
        border-color 0.15s,
        background 0.15s;
    max-width: 100%;
}

.tmdb-jf-card:hover {
    border-color: var(--primary, #1a73e8);
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.tmdb-jf-logo {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    object-fit: contain;
}

.tmdb-jf-title {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.tmdb-jf-btn {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary, #1a73e8);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--primary, #1a73e8);
    border-radius: 4px;
    white-space: nowrap;
}

/* ── Image Modal ──────────────────────────────────────────────────────────── */

.tmdb-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.tmdb-modal-overlay.tmdb-modal--visible {
    opacity: 1;
    visibility: visible;
}

.tmdb-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
    z-index: 10001;
}

.tmdb-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
}

.tmdb-modal-close:focus {
    outline: 2px solid var(--primary, #4285f4);
    outline-offset: 2px;
}

.tmdb-modal-img {
    max-width: 100%;
    max-height: calc(100vh - 4rem);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.tmdb-modal-overlay.tmdb-modal--visible .tmdb-modal-img {
    transform: scale(1);
}

/* ── Wide-container progressive enhancements ──────────────────────────────── */
/* These override earlier base rules when the inline container is wide enough.
   Placed at the end so they always win in the cascade. */

@container (min-width: 900px) {
    /* Redistribute overview: give info block more room (40/60 split) */
    .tmdb-overview {
        grid-template-columns: 2fr 3fr;
        gap: 1.25rem;
    }
    .tmdb-overview .tmdb-person-grid {
        grid-column: 1;
        height: 360px;
    }
    .tmdb-person-info,
    .tmdb-info-block {
        grid-column: 2;
    }

    /* Scale up typography */
    .tmdb-title {
        font-size: 1.4rem;
    }

    /* Larger cast cards */
    .tmdb-cast-card {
        width: 7.75rem;
    }

    /* Wider episode still column */
    .tmdb-episode-flow {
        --tmdb-episode-thumb-w: 160px;
    }
}

/* Very wide containers (≥1100px): maximize the info section. */
@container (min-width: 1100px) {
    .tmdb-overview {
        grid-template-columns: 1fr 2fr;
        gap: 1.5rem;
    }
    .tmdb-overview .tmdb-person-grid {
        height: 400px;
    }
    .tmdb-title {
        font-size: 1.6rem;
    }
    .tmdb-cast-card {
        width: 8.5rem;
    }
    .tmdb-episode-flow {
        --tmdb-episode-thumb-w: 180px;
    }
}

/* ── New Google-style hero layout (movies & TV shows) ──────────────────────── */

/* Header: title row (title + optional Jellyfin), then subtitle */
.tmdb-header {
    margin-bottom: 0.75rem;
}

.tmdb-header-primary {
    min-width: 0;
}

.tmdb-header-title-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
}

.tmdb-header-title-row .tmdb-title-link {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.tmdb-header-title-row .tmdb-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tmdb-header .tmdb-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.25;
}

.tmdb-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.tmdb-header-primary > .tmdb-subtitle {
    margin-top: 0.35rem;
}

/* Hero: stacked by default; movies with a trailer use a two-column band on wide containers. */
.tmdb-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
    min-width: 0;
}

/* Hero media: the image combo fills the hero column */
.tmdb-hero-media {
    min-width: 0;
    width: 100%;
}

.tmdb-hero-side {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    min-height: 0;
}

.tmdb-hero-trailer {
    min-width: 0;
    flex-shrink: 0;
}

.tmdb-hero--movie-with-trailer .tmdb-hero-side {
    gap: 0.45rem;
    min-height: 0;
    overflow: hidden;
}

.tmdb-hero--movie-with-trailer .tmdb-hero-trailer {
    width: 100%;
    max-width: 100%;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.tmdb-hero--movie-with-trailer .tmdb-hero-info {
    flex: 0 0 auto;
    gap: 0.45rem;
    min-height: 0;
}

.tmdb-hero.tmdb-hero--movie-with-trailer {
    container-type: inline-size;
    container-name: tmdb-movie-hero;
    margin-bottom: 0.65rem;
}

.tmdb-hero--movie-with-trailer + .tmdb-section {
    margin-top: 0;
}

.tmdb-hero-media .tmdb-img-combo {
    height: 280px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: unset;
    min-height: 260px;
}

/* Movie hero poster-only: frame wraps image (overrides fixed 280px on .tmdb-hero-media .tmdb-img-combo). */
.tmdb-hero--movie .tmdb-hero-media .tmdb-img-combo.tmdb-img-combo--single {
    height: auto;
    min-height: 0;
    max-height: none;
    background: var(--bg-light);
}

/* Movie + trailer: side column stacks trailer + copy; poster column height is intrinsic. */
.tmdb-hero--movie-with-trailer .tmdb-hero-media {
    display: flex;
    min-height: 0;
}

.tmdb-hero--movie-with-trailer .tmdb-hero-media .tmdb-img-combo {
    flex: 1 1 auto;
    align-self: stretch;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    aspect-ratio: unset;
}

/* Single poster: don't stretch to trailer column — combo hugs intrinsic poster height */
.tmdb-hero--movie-with-trailer
    .tmdb-hero-media
    .tmdb-img-combo.tmdb-img-combo--single {
    flex: 0 0 auto;
    align-self: flex-start;
    height: auto;
    min-height: 0;
}

/* Hero info: optional “Created by”, then ratings, then overview (director stays in `.tmdb-subtitle` on movies). */
.tmdb-hero-info {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
}

.tmdb-created-by {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.tmdb-trailer {
    width: 100%;
    border: 1px solid var(--tmdb-edge);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-light, rgba(255, 255, 255, 0.04));
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tmdb-trailer-frame {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    flex: 1 1 auto;
    min-height: 0;
}

/* Stacked hero (non-wide containers): keep trailer as a normal 16:9 block.
   The side-by-side "fill available height" mode above can collapse/hide it when
   the side column is content-driven instead of height-capped by the row layout. */
@container tmdb-movie-hero (max-width: 519px) {
    .tmdb-hero--movie-with-trailer .tmdb-hero-side {
        overflow: visible;
    }

    .tmdb-hero--movie-with-trailer .tmdb-hero-trailer {
        width: 100%;
        max-width: none;
        flex: 0 0 auto;
        align-self: stretch;
        margin-inline: 0;
        overflow: visible;
    }

    .tmdb-hero--movie-with-trailer .tmdb-trailer {
        height: auto;
    }

    .tmdb-hero--movie-with-trailer .tmdb-trailer-frame {
        aspect-ratio: 16 / 9;
        height: auto;
        width: 100%;
    }
}

/* Ratings display */
.tmdb-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.tmdb-rating-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-light, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--tmdb-edge);
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
}

.tmdb-rating-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    text-transform: uppercase;
    line-height: 1;
}

.tmdb-rating-badge--tmdb {
    color: #01b4e4;
}

.tmdb-rating-badge--imdb {
    color: #f5c518;
}

.tmdb-rating-badge--rt {
    color: #fa320a;
}

.tmdb-rating-badge--letterboxd {
    color: #00e054;
}

.tmdb-rating-badge--jellyfin {
    color: #00a4dc;
    text-transform: none;
    letter-spacing: 0.02em;
}

.tmdb-rating-jf-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
}

.tmdb-rating-item--jellyfin:hover,
.tmdb-rating-item--jellyfin:focus-visible {
    border-color: #00a4dc;
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.tmdb-rating-item--jellyfin:focus-visible {
    outline: 2px solid #00a4dc;
    outline-offset: 2px;
}

.tmdb-rating-score {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.tmdb-rating-unit {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1;
}

.tmdb-rating-score--rt {
    font-variant-numeric: tabular-nums;
}

.tmdb-rating-item--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.tmdb-rating-item--link:hover,
.tmdb-rating-item--link:focus-visible {
    border-color: #00e054;
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.tmdb-rating-item--link:focus-visible {
    outline: 2px solid #00e054;
    outline-offset: 2px;
}

.tmdb-rating-external {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-link, var(--primary, #1a73e8));
}

/* Director / Creator credit */
.tmdb-hero-director {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.tmdb-hero-director-label {
    font-weight: 400;
    color: var(--text-secondary);
}

/* Cast section heading */
.tmdb-section {
    margin-bottom: 1rem;
    min-width: 0;
}

.tmdb-section-heading {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* English labels + “N people”; RTL page `dir` must not reorder digits vs word or flex items. */
    direction: ltr;
    unicode-bidi: isolate;
    text-align: start;
}

.tmdb-section-count {
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

/* Movies with trailer: poster column | trailer + copy.
   Gate on BOTH viewport and the slot inline size (`.tmdb-result` container).
   Viewport-only `@media` was forcing this layout while the above-results slot
   stayed narrow, stretching collage / cast / episodes past the panel in themes
   without LiterallyGoogle’s full-width slot shell. */
@media (min-width: 640px) {
    @container (min-width: 520px) {
        .tmdb-hero--movie-with-trailer {
            grid-template-columns: minmax(220px, min(40%, 340px)) minmax(0, 1fr);
            align-items: stretch;
            column-gap: 1rem;
        }

        /* Avoid forcing a tall poster column when the still is shorter than the trailer rail */
        .tmdb-hero--movie-with-trailer .tmdb-hero-media {
            min-height: 0;
        }

        /* Side column must not exceed the poster height — overflow hidden clips the rest */
        .tmdb-hero--movie-with-trailer .tmdb-hero-side {
            align-self: stretch;
            overflow: hidden;
        }

        /* Two-column mode only: let trailer fill the capped side column height. */
        .tmdb-hero--movie-with-trailer .tmdb-trailer {
            height: 100%;
        }

        .tmdb-hero--movie-with-trailer .tmdb-trailer-frame {
            aspect-ratio: unset;
            height: 100%;
            width: 100%;
        }
    }
}

/* TV + movie-without-trailer: taller stacked collage on wide containers. */
@container (min-width: 720px) {
    .tmdb-panel--tv .tmdb-hero-media .tmdb-img-combo,
    .tmdb-hero--movie:not(.tmdb-hero--movie-with-trailer)
        .tmdb-hero-media
        .tmdb-img-combo {
        height: 400px;
        min-height: 320px;
    }

    .tmdb-header .tmdb-title {
        font-size: 1.65rem;
    }
}

@container (min-width: 900px) {
    .tmdb-panel--tv .tmdb-hero-media .tmdb-img-combo,
    .tmdb-hero--movie:not(.tmdb-hero--movie-with-trailer)
        .tmdb-hero-media
        .tmdb-img-combo {
        height: 488px;
        min-height: 400px;
    }

    .tmdb-header .tmdb-title {
        font-size: 1.85rem;
    }
}

@container (min-width: 1100px) {
    .tmdb-panel--tv .tmdb-hero-media .tmdb-img-combo,
    .tmdb-hero--movie:not(.tmdb-hero--movie-with-trailer)
        .tmdb-hero-media
        .tmdb-img-combo {
        height: 568px;
        min-height: 440px;
    }
}
/* TV body: column wrapper when an episode rail exists (band + cast below).
   Wide containers: `.tmdb-tv-band--with-head` is a grid (title row, then hero | episodes rail). */
.tmdb-tv-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
    min-width: 0;
    max-width: 100%;
}

.tmdb-tv-band {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    min-width: 0;
}

.tmdb-tv-band-head {
    min-width: 0;
}

/* Title sits in the band so wide layouts can align the episodes rail with the title row. */
.tmdb-tv-band--with-head > .tmdb-tv-band-head .tmdb-header {
    margin-bottom: 0.5rem;
}

/* Main column must not flex-grow and steal vertical space from siblings in stretched panels. */
.tmdb-tv-main {
    flex: 0 1 auto;
    min-width: 0;
}

/* Wide panel + episode rail: title spans full width; hero left / rail right; rail spans both
   rows so its top lines up with the title (no dead space above the episode box). */
@container tmdb-result (min-width: 560px) {
    .tmdb-panel--tv .tmdb-tv-band--with-head {
        display: grid;
        /* Slightly wider rail column so episodes block aligns closer to the panel edge. */
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
        grid-template-rows: auto minmax(0, 1fr);
        row-gap: 0;
        column-gap: 1.75rem;
        align-items: stretch;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-band-head {
        grid-column: 1 / -1;
        grid-row: 1;
        min-width: 0;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-main {
        grid-column: 1;
        grid-row: 2;
        min-width: 0;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail {
        grid-column: 2;
        grid-row: 1 / span 2;
        /* Fill the grid track: a fixed max-width left empty space to the right of the rail
           (misaligned vs cast / full-width content below). Column width is already capped by fr. */
        min-width: min(100%, 240px);
        max-width: none;
        width: 100%;
        justify-self: stretch;
        position: relative;
        box-sizing: border-box;
        min-height: 0;
        height: auto;
        max-height: none;
        overflow: hidden;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-seasons-rail,
    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-season-detail,
    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-episodes {
        overflow: hidden;
        min-height: 0;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-episodes-list {
        max-height: none;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-seasons-rail {
        flex: 1 1 0;
        min-height: 0;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-season-detail {
        flex: 1 1 0;
        min-height: 0;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-episodes {
        flex: 1 1 0;
        min-height: 0;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-episodes-list {
        flex: 1 1 0;
        min-height: 0;
    }
}

@container tmdb-result (min-width: 900px) {
    #results-page.degoog-fullwidth-slot-shell
        .tmdb-result.slot-full-width
        .tmdb-tv-body {
        gap: 1.75rem;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head {
        column-gap: 2.25rem;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail {
        max-width: none;
    }
}

/* Narrow slot: tighten gaps; when a rail exists, keep hero → cast → episodes reading order. */
@container tmdb-result (max-width: 559px) {
    .tmdb-tv-body:has(.tmdb-tv-band) {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .tmdb-tv-body:has(.tmdb-tv-band) .tmdb-tv-band {
        display: contents;
    }

    .tmdb-tv-body:has(.tmdb-tv-band) .tmdb-tv-band-head {
        grid-row: 1;
    }

    .tmdb-tv-body:has(.tmdb-tv-band) .tmdb-tv-main {
        grid-row: 2;
    }

    .tmdb-tv-body:has(.tmdb-tv-band) > .tmdb-section {
        grid-row: 3;
    }

    .tmdb-tv-body:has(.tmdb-tv-band) .tmdb-tv-rail {
        grid-row: 4;
    }

    .tmdb-tv-body:not(:has(.tmdb-tv-band)) {
        gap: 0.55rem;
    }

    .tmdb-panel--tv .tmdb-hero {
        margin-bottom: 0.65rem;
    }

    .tmdb-tv-main .tmdb-section:last-child,
    .tmdb-tv-body > .tmdb-section:last-child {
        margin-bottom: 0.3rem;
    }
}

.tmdb-tv-rail {
    border: 1px solid var(--tmdb-edge);
    border-radius: 12px;
    background: var(--bg-light, rgba(255, 255, 255, 0.04));
    padding: 0.5rem 0.6rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    min-height: 0;
}

.tmdb-seasons-rail {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    /* Stacked layout: grow from content (flex-1 + min-height:0 collapses when parent height is auto). */
    flex: 0 1 auto;
    min-height: auto;
}

.tmdb-seasons-carousel {
    position: relative;
    flex-shrink: 0;
}

.tmdb-seasons-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    padding: 0.2rem 0 0;
    border-bottom: 1px solid var(--tmdb-edge);
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tmdb-seasons-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.tmdb-season-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    margin: 0;
    border: 1px solid var(--tmdb-edge);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg, Canvas) 90%, transparent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.tmdb-season-nav-icon {
    display: block;
    margin-top: -1px;
}

.tmdb-season-nav--prev {
    left: 0.15rem;
}

.tmdb-season-nav--next {
    right: 0.15rem;
}

.tmdb-seasons-carousel:hover .tmdb-season-nav:not(:disabled),
.tmdb-seasons-carousel:focus-within .tmdb-season-nav:not(:disabled) {
    opacity: 1;
    pointer-events: auto;
}

@media (hover: none) {
    .tmdb-seasons-carousel .tmdb-season-nav:not(:disabled) {
        opacity: 1;
        pointer-events: auto;
    }
}

.tmdb-season-nav:hover,
.tmdb-season-nav:focus-visible {
    border-color: var(--primary, #1a73e8);
    color: var(--text-primary);
    background: color-mix(in srgb, var(--bg-light, var(--bg)) 95%, transparent);
    outline: none;
}

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

.tmdb-season-nav:disabled {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none !important;
}

.tmdb-seasons-strip {
    display: flex;
    align-items: flex-end;
    gap: 0.15rem;
    width: max-content;
    padding: 0 0.25rem 0 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
}

.tmdb-season-tab {
    appearance: none;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.42rem 0.72rem 0.52rem;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    flex: 0 0 auto;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

.tmdb-season-tab:hover,
.tmdb-season-tab:focus-visible {
    outline: none;
    background: transparent;
}

.tmdb-season-tab:focus-visible {
    box-shadow: none;
}

.tmdb-season-tab:focus-visible .tmdb-season-tab-label {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.tmdb-season-tab.is-active {
    border-bottom-color: var(--primary, #1a73e8);
    background: transparent;
}

.tmdb-season-tab:not(.is-active) .tmdb-season-tab-label {
    color: var(--text-secondary);
}

.tmdb-season-tab.is-active .tmdb-season-tab-label {
    color: var(--text-primary);
}

.tmdb-season-tab-label {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
}

.tmdb-season-detail {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-width: 0;
    min-height: auto;
}

.tmdb-season-facts {
    margin-block: 0 0.5rem;
    margin-inline: 0;
    padding-block: 0 0.45rem;
    padding-inline: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--tmdb-edge);
    /* Inherit document `direction` so the row packs to inline-start in RTL; each segment stays `dir=ltr` for numbers/dates. */
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    flex-direction: row;
    gap: 0.35rem;
    justify-content: start;
}

.tmdb-season-facts__seg {
    unicode-bidi: isolate;
}

.tmdb-season-facts__sep {
    unicode-bidi: isolate;
    color: var(--text-secondary);
    opacity: 0.85;
}

.tmdb-tv-rail .tmdb-season-overview {
    flex-shrink: 0;
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    /* Hard cap so flex never gives the episode block zero height if line-clamp fails */
    max-height: calc(1.45em * 3 + 0.35rem);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.tmdb-season-overview--empty {
    display: none;
}

.tmdb-tv-rail .tmdb-episodes {
    margin-top: 0;
    flex: 0 1 auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    align-self: stretch;
    width: 100%;
}

.tmdb-tv-rail .tmdb-episodes-list {
    flex: 0 1 auto;
    min-height: auto;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    padding-bottom: 0.35rem;
    /* Base .tmdb-episodes-list uses a negative margin for scrollbar gutter; keep rail flush. */
    margin-inline-end: 0;
    padding-inline-end: 0.3rem;
}

/* Episode list: scroll inside a viewport cap on stacked layouts (phones still scroll the page). */
@container (max-width: 559px) {
    .tmdb-tv-rail .tmdb-episodes-list {
        max-height: min(420px, 70vh);
    }
}

@container (min-width: 560px) {
    .tmdb-tv-rail .tmdb-episodes-list {
        max-height: min(520px, 65vh);
    }
}

/* LiterallyGoogle shell adjustments belong in plugin CSS (AGENTS.md contract). */
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-img-combo,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-person-grid,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-combo-placeholder,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-trailer,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-trailer-frame,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-rating-item,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-tv-rail,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-cast-card,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-episode,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-episode-thumb,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-season-poster,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-film-card,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-film-poster,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-jf-card,
#results-page.degoog-fullwidth-slot-shell
    .tmdb-result
    .tmdb-title-link:focus-visible {
    border-radius: 20px !important;
}

#results-page.degoog-fullwidth-slot-shell
    .tmdb-result
    .tmdb-trailer
    .tmdb-trailer-frame {
    border-radius: 0 !important;
}

#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-cast-photo-wrap,
#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-cast-photo {
    border-radius: 0 !important;
}

#results-page.degoog-fullwidth-slot-shell .tmdb-result .tmdb-jf-card--compact {
    border-radius: 20px !important;
}

#results-page.degoog-fullwidth-slot-shell
    .tmdb-result
    .tmdb-panel
    .tmdb-title-link,
#results-page.degoog-fullwidth-slot-shell
    .tmdb-result
    .tmdb-panel
    .tmdb-title-link:any-link,
#results-page.degoog-fullwidth-slot-shell
    .tmdb-result
    .tmdb-panel
    .tmdb-title-link:visited,
#results-page.degoog-fullwidth-slot-shell
    .tmdb-result
    .tmdb-panel
    .tmdb-title-link
    .tmdb-title-text {
    color: var(--text-primary) !important;
}

#results-page.degoog-fullwidth-slot-shell
    .tmdb-result
    .tmdb-panel
    .tmdb-title-link:hover,
#results-page.degoog-fullwidth-slot-shell
    .tmdb-result
    .tmdb-panel
    .tmdb-title-link:any-link:hover,
#results-page.degoog-fullwidth-slot-shell
    .tmdb-result
    .tmdb-panel
    .tmdb-title-link:focus-visible {
    color: var(--text-primary) !important;
}

#results-page.degoog-fullwidth-slot-shell
    .tmdb-result
    .tmdb-panel
    .tmdb-title-link
    + .tmdb-year {
    margin-left: 0.35rem;
}

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


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

/* Stock Quote Slot */

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

.stocks-card {
    container-type: inline-size;
    --stocks-up: #188038;
    --stocks-down: #d93025;
    --stocks-flat: var(--text-secondary);
    --stocks-line: var(--stocks-flat);
    color: var(--text-primary);
    display: grid;
    gap: 12px;
    font-family: var(--font-sans, sans-serif);
    min-width: 0;
}

.stocks-summary {
    align-items: stretch;
    display: grid;
    gap: 12px;
    min-width: 0;
}



.stocks-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.stocks-identity {
    min-width: 0;
}

.stocks-eyebrow {
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.3;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.stocks-symbol-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.stocks-symbol {
    color: var(--text-primary);
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.05;
    text-decoration: none;
}

.stocks-symbol:hover {
    color: var(--text-link);
    text-decoration: underline;
}

.stocks-exchange {
    border: 1px solid var(--border-light);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    max-width: 190px;
    overflow: hidden;
    padding: 4px 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stocks-company {
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.35;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.stocks-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.stocks-price-block {
    display: grid;
    gap: 2px;
    justify-items: end;
    text-align: right;
}

.stocks-price {
    align-items: baseline;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}

.stocks-price-value {
    color: var(--text-primary);
    font-size: 1.65rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1.05;
}

.stocks-currency {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 650;
}

.stocks-change {
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 4px;
}

.stocks-card-up .stocks-change {
    background-color: var(--stocks-up);
    color: #ffffff;
}

.stocks-card-down .stocks-change {
    background-color: var(--stocks-down);
    color: #ffffff;
}

.stocks-card-flat .stocks-change {
    background-color: var(--stocks-flat);
    color: #ffffff;
}

.stocks-chart {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--slot-inset-border, var(--border-light));
    border-radius: 16px;
    padding: 16px;
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--text-primary) 4%, transparent),
            transparent 58%
        ),
        var(--slot-inset-bg, var(--bg-light, transparent));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent);
    --stocks-line: var(--stocks-flat);
}

.stocks-chart-up {
    --stocks-line: var(--stocks-up);
}

.stocks-chart-down {
    --stocks-line: var(--stocks-down);
}

.stocks-chart-flat {
    --stocks-line: var(--stocks-flat);
}

.stocks-chart-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    min-width: 0;
}

.stocks-chart-title {
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.stocks-chart-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    padding: 4px;
    border: 1px solid var(--border-light);
    border-radius: 100px;
    background: color-mix(in srgb, var(--bg-light, transparent) 72%, transparent);
}

.stocks-period {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-sans, sans-serif);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1;
    min-height: 24px;
    min-width: 30px;
    padding: 5px 6px;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.stocks-period:hover,
.stocks-period:focus-visible {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    border-color: var(--border-light);
    color: var(--text-primary);
    outline: none;
}

.stocks-period--active,
.stocks-period--active:hover {
    background: var(--stocks-line);
    border-color: var(--stocks-line);
    color: #fff;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--stocks-line) 34%, transparent);
}

.stocks-chart-body {
    flex: 1;
    min-height: 100px;
    min-width: 0;
    position: relative;
}

.stocks-chart-loading {
    align-items: center;
    color: var(--text-secondary);
    display: flex;
    font-size: 0.9rem;
    height: 100%;
    min-height: 100px;
    justify-content: center;
}

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

.stocks-chart-stats:empty {
    display: none;
    min-height: 0;
}

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

.stocks-chart-stat-label {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1;
    text-transform: uppercase;
}

.stocks-chart-stat-value {
    color: var(--text-primary);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stocks-chart-stat-value--up {
    color: var(--stocks-up);
}

.stocks-chart-stat-value--down {
    color: var(--stocks-down);
}

.stocks-sparkline {
    display: block;
    width: 100%;
    height: 100%;
}

.stocks-sparkline-area {
    fill: color-mix(in srgb, var(--stocks-line) 16%, transparent);
}

.stocks-sparkline-line {
    fill: none;
    stroke: var(--stocks-line);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
}

.stocks-sparkline-dot {
    fill: var(--stocks-line);
}

.stocks-sparkline-label {
    fill: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0;
}

.stocks-sparkline-empty {
    align-items: center;
    color: var(--text-secondary);
    display: flex;
    font-size: 0.9rem;
    height: 100%;
    min-height: 100px;
    justify-content: center;
}

/* Hover and Grid Styles */
.stocks-chart-grid-line {
    stroke: var(--border-light, #dadce0);
    stroke-width: 1;
    stroke-dasharray: 2,4;
    opacity: 0.72;
}
.stocks-chart-x-label,
.stocks-chart-y-label {
    fill: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
}
.stocks-chart-hl-line {
    stroke: var(--stocks-line);
    stroke-width: 1;
    stroke-dasharray: 2,3;
    opacity: 0.45;
}
.stocks-chart-hl-dot {
    fill: var(--bg-light, var(--bg));
    stroke: var(--stocks-line);
    stroke-width: 2;
}
.stocks-chart-hit {
    fill: transparent;
    pointer-events: all;
    cursor: crosshair;
}
.stocks-chart-tooltip {
    position: absolute;
    background: var(--bg, #1a1a1a);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.28);
    pointer-events: none;
    z-index: 10;
    margin-top: 22px;
    min-width: max-content;
    opacity: 0;
    transition:
        opacity 120ms ease,
        left 80ms ease;
}
.stocks-chart-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -5px;
    width: 8px;
    height: 8px;
    background: var(--bg, #1a1a1a);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: translateX(-50%) rotate(45deg);
}
.stocks-chart-tooltip--visible {
    display: block !important;
    opacity: 1;
}
.stocks-tt-date {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.stocks-tt-price {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stocks-details {
    display: grid;
    gap: 8px 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: auto;
}

.stocks-detail {
    background-color: var(--bg-hover, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-light);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 6px 10px;
}

.stocks-detail-label {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-transform: uppercase;
}

.stocks-detail-value {
    color: var(--text-primary);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 1.25;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stocks-detail-link {
    color: var(--text-link);
    text-decoration: none;
}

.stocks-detail-link:hover {
    text-decoration: underline;
}

#results-page.degoog-fullwidth-slot-shell .stocks-card {
    gap: 14px;
}

@container (min-width: 760px) {
    .stocks-summary {
        grid-template-columns: minmax(300px, 0.82fr) minmax(320px, 1fr);
    }

    .stocks-chart {
        min-height: auto;
    }

    .stocks-chart-body {
        min-height: 190px;
        height: 190px;
        flex: none;
        margin-bottom: 16px;
    }

    .stocks-chart-stats {
        margin-top: auto;
        padding-top: 16px;
    }

    .stocks-details {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px 10px;
        margin-top: auto;
    }
}

@container (max-width: 560px) {
    .stocks-chart-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .stocks-chart-periods {
        justify-content: flex-start;
    }

    .stocks-price-block {
        justify-items: start;
        text-align: left;
    }

    .stocks-price {
        justify-content: flex-start;
    }
}

@container (max-width: 390px) {
    .stocks-details {
        grid-template-columns: 1fr;
    }
}

/* literallygoogle theme support */
#results-page.degoog-fullwidth-slot-shell .stocks-chart {
    border-radius: 16px;
}

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

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

.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: 116px;
  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-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;
}

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

/* ── Tip Calculator – Premium Slot Theme ──────────────────── */

.tipcalc-card {
    container-type: inline-size;
    margin-bottom: 16px;
    font-family: var(--font-sans, sans-serif);
    color: var(--text-primary);
    background: transparent;
    border: none;
    box-sizing: border-box;
    width: 100%;
    --tipcalc-surface: var(--bg-light, color-mix(in srgb, var(--bg, Canvas) 92%, var(--text-primary, CanvasText) 8%));
    --tipcalc-field-bg: var(--bg, Canvas);
    --tipcalc-border: var(--border-light, var(--border, rgba(128, 128, 128, 0.28)));
    --tipcalc-muted: var(--text-secondary, color-mix(in srgb, var(--text-primary, CanvasText) 70%, transparent));
    --tipcalc-slider-track: color-mix(in srgb, var(--text-primary, CanvasText) 24%, var(--tipcalc-field-bg) 76%);
    --tipcalc-slider-fill: var(--primary, var(--text-link, #1a73e8));
}

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

.tipcalc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tipcalc-muted);
}

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

.tipcalc-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Two-column layout on wider containers */
@container (min-width: 580px) {
    .tipcalc-body {
        display: grid;
        grid-template-columns: 1.2fr 1fr;
        gap: 24px;
        align-items: start;
    }
}

/* Inputs Column styling */
.tipcalc-inputs-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tipcalc-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tipcalc-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tipcalc-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Input Containers */
.tipcalc-input-prefix-container,
.tipcalc-input-suffix-container {
    display: inline-flex;
    align-items: center;
    background: var(--tipcalc-field-bg);
    border: 1px solid var(--tipcalc-border);
    border-radius: 8px;
    padding: 6px 12px;
    height: 36px;
    box-sizing: border-box;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.tipcalc-input-prefix-container:focus-within,
.tipcalc-input-suffix-container:focus-within {
    border-color: var(--primary, var(--text-link, #1a73e8));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, var(--text-link, #1a73e8)) 20%, transparent);
}

.tipcalc-currency-symbol,
.tipcalc-suffix {
    font-size: 0.9rem;
    color: var(--tipcalc-muted);
    user-select: none;
}

.tipcalc-currency-symbol {
    margin-right: 4px;
}

.tipcalc-suffix {
    margin-left: 4px;
}

.tipcalc-number-input {
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    width: 75px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    padding: 0;
    margin: 0;
}

.tipcalc-number-input::-webkit-inner-spin-button,
.tipcalc-number-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.tipcalc-number-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Specific size adjustment for bill input container */
.tipcalc-input-prefix-container {
    width: 120px;
}

.tipcalc-input-prefix-container .tipcalc-number-input {
    width: 100%;
}

/* Slider styling */
.tipcalc-slider-container {
    padding-top: 4px;
}

.tipcalc-range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(
        to right,
        var(--tipcalc-slider-fill) 0%,
        var(--tipcalc-slider-fill) var(--tipcalc-progress, 0%),
        var(--tipcalc-slider-track) var(--tipcalc-progress, 0%),
        var(--tipcalc-slider-track) 100%
    );
    outline: none;
    margin: 0;
    transition: background 150ms ease;
    cursor: pointer;
    accent-color: var(--tipcalc-slider-fill);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tipcalc-slider-track) 80%, transparent);
}

/* Custom Range Slider Thumb & Track */
.tipcalc-range-slider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
}

.tipcalc-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -4px;
    border-radius: 50%;
    background: var(--primary, var(--text-link, #1a73e8));
    border: 2px solid var(--tipcalc-field-bg);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 100ms ease, background-color 100ms ease;
}

.tipcalc-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.tipcalc-range-slider::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: var(--tipcalc-slider-track);
}

.tipcalc-range-slider::-moz-range-progress {
    height: 8px;
    border-radius: 999px;
    background: var(--tipcalc-slider-fill);
}

.tipcalc-range-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary, var(--text-link, #1a73e8));
    border: 2px solid var(--tipcalc-field-bg);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 100ms ease, background-color 100ms ease;
}

.tipcalc-range-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
}

/* Results Column styling */
.tipcalc-results-col {
    display: flex;
    flex-direction: column;
}

.tipcalc-results-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: none;
}

.tipcalc-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.tipcalc-result-label {
    font-size: 0.9rem;
    color: var(--tipcalc-muted);
}

.tipcalc-result-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.tipcalc-result-row-total {
    margin-top: 2px;
}

.tipcalc-result-row-total .tipcalc-result-label {
    font-weight: 600;
    color: var(--text-primary);
}

.tipcalc-result-row-total .tipcalc-result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary, var(--text-link, #1a73e8));
}

/* Divider inside results */
.tipcalc-result-divider {
    height: 1px;
    background: var(--tipcalc-border);
    margin: 8px 0;
}

/* Split Results sub-section animates height/opacity */
.tipcalc-split-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: tipcalc-fade-slide 200ms ease-out forwards;
}

@keyframes tipcalc-fade-slide {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Theme support for degoog fullwidth slot */
#results-page.degoog-fullwidth-slot-shell .tipcalc-card {
    border: 1px solid var(--tipcalc-border);
    background: var(--bg-secondary, var(--tipcalc-surface));
    border-radius: 24px;
    padding: 16px 20px;
    margin: 0 auto;
}

#results-page.degoog-fullwidth-slot-shell .tipcalc-card .tipcalc-header {
    border-bottom-color: var(--tipcalc-border);
}

#results-page.degoog-fullwidth-slot-shell .tipcalc-input-prefix-container,
#results-page.degoog-fullwidth-slot-shell .tipcalc-input-suffix-container {
    border-radius: 999px;
    padding-inline: 14px;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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