.wiki-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  overflow: hidden;
}

.wiki-thumb {
  border-radius: 13px;
  max-width: 40%;
  float: right;
  margin-left: 1rem;
  margin-bottom: 1rem;
  background: var(--border-color);
}

.wiki-thumb--logo {
  display: block;
  max-width: 80%;
  max-height: 60px;
  width: auto;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 0.75rem;
  margin: 0.75rem auto 2rem auto;
}

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

.wiki-title {
  display: block;
  font-size: var(--font-large);
  font-weight: 600;
  color: var(--link-color);
  text-decoration: none;
  line-height: 1.1;
}

.wiki-title:hover {
  color: var(--link-hover, var(--link-color));
  text-decoration: underline;
}

.wiki-desc {
  margin-bottom: 1rem;
  font-size: var(--font-small);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
}

.wiki-extract {
  font-size: var(--font-medium);
  color: var(--text-primary);
  display: inline;
}

.wiki-footer-link {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.wiki-footer-link:hover {
  color: var(--link-color);
  text-decoration: underline;
}

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

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

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

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

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

.math-result {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
/* -- Places Slot ------------------------------------------------ */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.calc-btn:hover {
  background: color-mix(in srgb, var(--text-primary, #202124) 6%, transparent);
}

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

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

.calc-btn--digit {
  background: var(--bg, #fff);
  border: 1px solid color-mix(in srgb, var(--border-light, #dadce0) 75%, transparent);
  box-shadow: var(--calc-key-shadow);
  font-size: 0.95rem;
  font-weight: 500;
}

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

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

.calc-btn--op {
  color: var(--calc-accent);
  font-size: 1.05rem;
  font-weight: 500;
}

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

.calc-btn--clear {
  font-weight: 600;
  color: color-mix(in srgb, var(--danger, #d93025) 82%, var(--text-secondary, #5f6368));
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  .calc-row {
    gap: 5px;
  }

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

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

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

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

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

.glance-ai-body--clamped {
  min-height: 160px;
  max-height: 160px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 45%, transparent 100%);
}

.glance-ai-body .glance-snippet h1:first-child,
.glance-ai-body .glance-snippet h2:first-child {
  margin-top: 0;
}


.glance-ai-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 0.25rem;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.15s;
}

.glance-ai-expand::after {
  content: '\25BE';
  font-size: 0.75rem;
  line-height: 1;
}

.glance-ai-expand:hover {
  color: var(--text-primary);
}

.glance-ai-expand[hidden] {
  display: none;
}

.glance-ai-tooltip {
  display: none;
  position: fixed;
  z-index: 9999;
  max-width: 260px;
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  background: var(--bg-hover);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.glance-ai-tooltip.glance-ai-tooltip--visible {
  display: block;
}

.glance-ai-tooltip-head {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.glance-ai-tooltip-host {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.glance-ai-tooltip-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.glance-ai-tooltip-snippet {
  color: var(--text-secondary);
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.glance-ai-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.glance-ai-chat {
  margin-top: 0.75rem;
}

.glance-ai-input {
  width: 100%;
  min-height: 5rem;
  resize: none;
}

.glance-ai-reply {
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 0.875rem;
}

.glance-ai-reply.glance-ai-user {
  align-self: flex-end;
  max-width: 78%;
  background: var(--bg-hover);
  border-radius: 1rem 1rem 0.25rem 1rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  display: block;
  width: auto;
}

.glance-ai-typing {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.glance-ai-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.glance-ai-skeleton .skeleton-line--snippet {
  width: 100%;
}

.glance-ai-skeleton .skeleton-line--snippet-short {
  width: 55%;
}

.glance-ai-writing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.glance-ai-writing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: glance-ai-pulse 1.2s ease-in-out infinite;
}

.glance-ai-writing span:nth-child(2) { animation-delay: 0.2s; }
.glance-ai-writing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes glance-ai-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.glance-ai-thinking-label {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  opacity: 0.7;
}

.glance-ai-thinking-stream {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.75;
  white-space: pre-wrap;
  max-height: 12em;
  overflow-y: auto;
  border-left: 2px solid var(--text-secondary);
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.glance-ai-cite {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: baseline;
  margin: 0 2px;
  text-decoration: none;
  line-height: 1.2;
}

.glance-ai-cite:hover {
  text-decoration: none;
  background: var(--bg-hover);
}

.glance-ai-cite .glance-ai-cite-favicon {
  border-radius: 2px;
  display: inline-block;
  vertical-align: middle;
}

.glance-ai-cite .glance-ai-cite-host {
  color: var(--text-secondary);
  font-size: 0.6875rem;
}

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

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

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

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

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

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

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

.apps-pocket-launcher {
  background: transparent;
  border: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--text-secondary);
}

.apps-pocket-launcher:hover {
  color: var(--text-primary);
}

#results-header .apps-pocket-launcher {
  margin-left: auto;
}

@media (max-width: 767.98px) {
  #results-header .apps-pocket-wrapper {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    display: flex;
    margin-left: 0;
  }

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

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

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

.apps-pocket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.apps-pocket-title {
  font-weight: 600;
  color: var(--text-primary);
}

.apps-pocket-info-btn {
  all: unset;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
}

.apps-pocket-info-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.apps-pocket-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.apps-pocket-grid::-webkit-scrollbar {
  display: none;
}

.apps-pocket-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  text-align: center;
  transition: background 0.15s;
}

.apps-pocket-tile:hover {
  background: var(--bg-hover);
}

.apps-pocket-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.apps-pocket-tile-img {
  width: 100%;
  object-fit: contain;
}

.apps-pocket-tile-fallback {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
  background: var(--bg);
}

.apps-pocket-tile-label {
  font-size: 12px;
  color: var(--text-primary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apps-pocket-empty {
  grid-column: 1 / -1;
  padding: 16px 8px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

.apps-pocket-bang {
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
  color: var(--text-primary);
}

.apps-pocket-modal {
  width: 640px;
}

.apps-pocket-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 2px;
}

.apps-pocket-rows::-webkit-scrollbar {
  display: none;
}

.apps-pocket-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.apps-pocket-row-add {
  align-self: flex-start;
}

.apps-pocket-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.apps-pocket-output {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  resize: vertical;
  min-height: 160px;
}
