.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;
}
.math-calc {
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 652px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.math-calc-expr {
  width: 100%;
  background: var(--bg-light);
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.4rem;
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: 12px;
  outline: none;
}

.math-calc-result {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  min-height: 1.6rem;
  padding: 0 0.75rem;
}

.math-calc-keys {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.math-calc-row {
  display: flex;
  gap: 0.4rem;
}

.math-calc-key {
  flex: 1;
  appearance: none;
  border: 0;
  border-radius: 12px;
  background: var(--bg-light);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.05rem;
  padding: 0.7rem 0;
  cursor: pointer;
  transition: background 0.15s;
}

.math-calc-key:hover {
  background: var(--bg-hover);
}

.math-calc-fn {
  color: var(--text-secondary);
}

.math-calc-eq {
  background: var(--brand-blue);
  color: #fff;
}

.math-calc-eq:hover {
  background: var(--brand-blue);
  opacity: 0.92;
}

.define-result .define-word {
  font-size: 1.5rem;
  margin: 0 0 0.25rem 0;
}

.define-phonetic {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 0.75rem 0;
}

.define-meaning {
  margin-bottom: 1rem;
}

.define-pos {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.define-list {
  margin: 0.25rem 0 0 1rem;
  padding-left: 0.5rem;
}

.define-example {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.glance-ai-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.glance-ai-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
}

.glance-ai-title .fa-robot {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.glance-ai-sources-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border: none;
  border-radius: 1.5rem;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s;
}

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

.glance-ai-sources-toggle::after {
  content: "\25BE";
  font-size: 0.625rem;
  line-height: 1;
  transition: transform 0.15s;
}

.glance-ai-sources-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.glance-ai-stack {
  display: inline-flex;
  align-items: center;
}

.glance-ai-stack-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--bg-hover);
  object-fit: contain;
}

.glance-ai-stack-icon + .glance-ai-stack-icon {
  margin-left: -6px;
}

.glance-ai-rail {
  display: flex;
  gap: 0.5rem;
  margin: -0.25rem 0 0.75rem;
  padding-bottom: 0.25rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

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

.glance-ai-rail-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 0 0 11rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
  scroll-snap-align: start;
  transition: background 0.15s;
}

.glance-ai-rail-card:hover {
  background: rgba(var(--primary-rgb), 0.12);
  text-decoration: none;
}

.glance-ai-rail-head {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.glance-ai-rail-icon {
  flex-shrink: 0;
  border-radius: 3px;
}

.glance-ai-rail-host {
  color: var(--text-secondary);
  font-size: 0.625rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.glance-ai-rail-title {
  font-size: 0.75rem;
  line-height: 1.35;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.glance-ai-body .glance-snippet > :first-child {
  margin-top: 0;
}

.glance-ai-body .glance-snippet p,
.glance-ai-reply p {
  margin: 0 0 0.75rem;
  line-height: 1.65;
}

.glance-ai-body .glance-snippet h2,
.glance-ai-body .glance-snippet h3,
.glance-ai-reply h2,
.glance-ai-reply h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.glance-ai-body .glance-snippet ul,
.glance-ai-body .glance-snippet ol,
.glance-ai-reply ul,
.glance-ai-reply ol {
  margin: 0 0 0.75rem;
  padding-inline-start: 1.15rem;
}

.glance-ai-body .glance-snippet li,
.glance-ai-reply li {
  margin-bottom: 0.35rem;
  line-height: 1.6;
}

.glance-ai-body .glance-snippet li::marker,
.glance-ai-reply li::marker {
  color: var(--text-secondary);
}

.glance-ai-body .glance-snippet table,
.glance-ai-reply table {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0 0 0.75rem;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.glance-ai-body .glance-snippet th,
.glance-ai-body .glance-snippet td,
.glance-ai-reply th,
.glance-ai-reply td {
  padding: 0.375rem 0.625rem;
  text-align: start;
  vertical-align: top;
}

.glance-ai-body .glance-snippet thead th,
.glance-ai-reply thead th {
  background: var(--bg-hover);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.glance-ai-body .glance-snippet tbody tr:nth-child(even),
.glance-ai-reply tbody tr:nth-child(even) {
  background: var(--bg-hover);
}

.glance-ai-body .glance-snippet code,
.glance-ai-reply code {
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg-hover);
  font-size: 0.8125em;
}

.glance-ai-body .glance-snippet pre,
.glance-ai-reply pre {
  margin: 0 0 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--bg-hover);
  overflow-x: auto;
}

.glance-ai-body .glance-snippet pre code,
.glance-ai-reply pre code {
  padding: 0;
  background: none;
}

.glance-ai-body .glance-snippet blockquote,
.glance-ai-reply blockquote {
  margin: 0 0 0.75rem;
  padding: 0.125rem 0 0.125rem 0.75rem;
  border-inline-start: 2px solid var(--border);
  color: var(--text-secondary);
}

.glance-ai-body .glance-snippet hr,
.glance-ai-reply hr {
  margin: 1rem 0;
  border: none;
  height: 1px;
  background: var(--border);
}

.glance-ai-key {
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(var(--primary-rgb), 0.16);
  color: var(--text-primary);
  font-weight: 600;
}

.glance-ai.degoog-panel {
  overflow: visible;
  position: relative;
  background: transparent;
}

.glance-ai:has(.glance-ai-collapse:not([hidden])) {
  padding-bottom: 1.5rem;
  margin-bottom: 1rem;
}

.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);
  color: var(--white);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.15s;
  border: 2px solid var(--primary);
  border-radius: 2rem;
}

.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],
.glance-ai-collapse[hidden] {
  display: none;
}

.glance-ai-collapse {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: auto;
  margin: 0;
  padding: 0.35rem 0.9rem;
  border: none;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.75rem;
  white-space: nowrap;
  cursor: pointer;
  transform: translate(-50%, 50%);
  transition: color 0.15s;
}

.glance-ai-collapse::after {
  content: "\25BE";
  font-size: 0.75rem;
  line-height: 1;
  transform: rotate(180deg);
}

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

.glance-ai-cite {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: baseline;
  margin: 0 2px;
  padding: 0 4px;
  max-width: 12rem;
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.15s;
}

.glance-ai-cite:hover,
.glance-ai-cite--open {
  background: var(--bg-hover);
}

.glance-ai-cite-favicon {
  flex-shrink: 0;
  border-radius: 2px;
  vertical-align: middle;
}

.glance-ai-cite-host {
  font-size: 0.6875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.glance-ai-pop {
  display: none;
  position: fixed;
  z-index: 9999;
  width: 17rem;
  max-height: 20rem;
  overflow-y: auto;
  padding: 0.375rem;
  border-radius: 0.5rem;
  background: var(--bg-light);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--text-primary);
}

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

.glance-ai-pop--pinned {
  pointer-events: auto;
}

.glance-ai-pop-label {
  padding: 0.25rem 0.375rem;
  color: var(--text-secondary);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.glance-ai-pop-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.375rem;
  border-radius: 0.375rem;
  color: var(--text-primary);
  text-decoration: none;
}

.glance-ai-pop--pinned .glance-ai-pop-row:hover {
  background: rgba(var(--primary-rgb), 0.12);
  text-decoration: none;
}

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

.glance-ai-pop-host {
  font-size: 0.625rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.glance-ai-pop-title {
  font-weight: 500;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.glance-ai-pop-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;
}

@property --glance-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.glance-ai-input-wrap--styled {
  position: relative;
  padding: 2px;
  border-radius: 0.5rem;
}

.glance-ai-input-wrap--styled::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from var(--glance-angle),
    var(--brand-blue, var(--primary)),
    var(--danger),
    var(--brand-yellow, var(--warning)),
    var(--success),
    var(--brand-blue, var(--primary))
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.glance-ai-input-wrap--styled:focus-within::before {
  opacity: 1;
  animation: glance-ai-spin 4s linear infinite;
}

@keyframes glance-ai-spin {
  to {
    --glance-angle: 360deg;
  }
}

.glance-ai-input {
  position: relative;
  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 0 1rem 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;
}

@media (prefers-reduced-motion: reduce) {
  .glance-ai-input-wrap--styled:focus-within::before {
    animation: none;
  }

  .glance-ai-writing span {
    animation: none;
  }
}

/* Hide sidebar and expand main column when Maps tab is active */
body.maps-tab-active .results-sidebar {
  display: none !important;
}

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

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

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

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

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

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

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

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

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

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

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

/* ── OSM Slot ─────────────────────────────────────────────── */

.osm-slot-wrap {
  margin-bottom: 12px;
  max-width: 680px;
}

.osm-slot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

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

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

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

.osm-slot-open {
  font-size: 0.7rem;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.osm-slot-open:hover {
  text-decoration: underline;
}

.osm-map-container {
  width: 100%;
  height: 280px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Fix Leaflet popup inside dark themes */
.leaflet-popup-content-wrapper {
  background: var(--bg-light) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.leaflet-popup-tip {
  background: var(--bg-light) !important;
}

.leaflet-popup-content {
  margin: 8px 12px !important;
  font-size: 0.8rem !important;
}

/* Fix Leaflet controls inside dark themes */
.leaflet-control-zoom a {
  background: var(--bg-light) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg-hover) !important;
}

.leaflet-control-attribution {
  background: rgba(0,0,0,0.4) !important;
  color: var(--text-secondary) !important;
  font-size: 0.6rem !important;
}

.leaflet-control-attribution a {
  color: var(--primary) !important;
}

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

.places-wrap {
  container-type: inline-size;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
}

.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 {
  min-height: 24px;
  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);
}

@container (min-width: 780px) {
  .places-layout {
    grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
    align-items: stretch;
  }
}

.places-wrap :where(button, input, select, textarea, a[href], [role="button"]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 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: var(--success, #137333);
}

.places-hours-closed {
  color: var(--danger, #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 {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  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: var(--text-link, #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: var(--bg-hover, var(--bg));
  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: var(--primary, #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: color-mix(in srgb, var(--primary, #1a73e8) 82%, black);
  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: var(--danger, #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: 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;
  }
}

.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-page .results-slot-panel:has(> .results-slot-panel-body > .trc-card) {
  overflow: hidden;
}

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

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

#results-page .results-slot-panel:has(> .results-slot-panel-body > .trc-card) > .results-slot-panel-body > .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;
  }
}

/* Stock Quote Slot */

.stocks-card {
    container-type: inline-size;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    --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);
}

.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;
    border-radius: 6px;
    padding: 0 0.15rem;
    transition: color 180ms ease;
}

@keyframes stocks-price-flash-up {
    0% {
        background-color: color-mix(in srgb, var(--stocks-up) 38%, transparent);
        color: var(--stocks-up);
    }
    100% {
        background-color: transparent;
        color: var(--text-primary);
    }
}

@keyframes stocks-price-flash-down {
    0% {
        background-color: color-mix(in srgb, var(--stocks-down) 38%, transparent);
        color: var(--stocks-down);
    }
    100% {
        background-color: transparent;
        color: var(--text-primary);
    }
}

.stocks-price-flash-up {
    animation: stocks-price-flash-up 650ms ease-out;
}

.stocks-price-flash-down {
    animation: stocks-price-flash-down 650ms ease-out;
}

@keyframes stocks-change-flash {
    0% {
        transform: scale(1.04);
        filter: brightness(1.08);
    }
    100% {
        transform: scale(1);
        filter: none;
    }
}

.stocks-change-flash-up,
.stocks-change-flash-down {
    animation: stocks-change-flash 450ms ease-out;
}

.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);
    transition: cy 280ms ease, cx 280ms ease;
}

@keyframes stocks-dot-pulse {
    0% {
        r: 3;
        opacity: 1;
    }
    40% {
        r: 5.5;
        opacity: 0.85;
    }
    100% {
        r: 3;
        opacity: 1;
    }
}

.stocks-sparkline-dot--pulse {
    animation: stocks-dot-pulse 520ms ease-out;
}

.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 {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: var(--text-link);
    text-decoration: none;
}

.stocks-detail-link:hover {
    text-decoration: underline;
}

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

.stocks-chart {
    border-radius: 16px;
}

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

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

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

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

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

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

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

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

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

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

.speedtest-card {
    container-type: inline-size;
    --speedtest-accent: #4285f4;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-family: var(--font-sans, sans-serif);
}

.speedtest-card__controls {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.speedtest-card__controls--footer {
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
}

.speedtest-card__button-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-left: auto;
}

.speedtest-card__server-picker {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    flex: 1 1 250px;
    align-items: flex-start;
}

.speedtest-card__server-picker-label {
    color: var(--text-secondary);
    font-size: 0.88rem;
    white-space: nowrap;
}

.speedtest-card__server-select {
    min-width: 250px;
    max-width: 280px;
    min-height: 2.5rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-light, #2f3033);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.94rem;
}

.speedtest-card__server-select:disabled {
    opacity: 0.72;
}

.speedtest-card__action {
    flex-shrink: 0;
    min-height: 2.5rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        opacity 160ms ease;
    margin-left: auto;
}

.speedtest-card__button-group .speedtest-card__action {
    margin-left: 0;
}

.speedtest-card__action--cancel {
    border-color: color-mix(in srgb, #d93025 36%, var(--border));
    background: color-mix(in srgb, #d93025 10%, transparent);
    color: #f28b82;
}

.speedtest-card__action--cancel:hover:not(:disabled) {
    background: color-mix(in srgb, #d93025 16%, transparent);
}

.speedtest-card__action:hover:not(:disabled) {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.speedtest-card__action:disabled {
    cursor: default;
    opacity: 0.7;
}

.speedtest-card__gauge-shell {
    position: relative;
    min-height: 352px;
    max-height: 420px;
    padding: 1.15rem 0 0.95rem;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    overflow: hidden;
    opacity: 1;
    transition:
        max-height 220ms ease,
        min-height 220ms ease,
        padding 220ms ease,
        opacity 160ms ease,
        border-color 160ms ease;
}

.speedtest-card__gauge {
    display: block;
    width: min(100%, 610px);
    margin: 0 auto;
}

.speedtest-card__gauge-track,
.speedtest-card__gauge-fill {
    fill: none;
    stroke-linecap: round;
    stroke-width: 15;
}

.speedtest-card__gauge-track {
    stroke: color-mix(in srgb, var(--border) 82%, transparent);
}

.speedtest-card__gauge-fill {
    stroke: var(--speedtest-accent);
    stroke-dasharray: 0 100;
    transition: stroke-dasharray 220ms ease;
}

.speedtest-card__gauge-tip {
    fill: #ffffff;
    transition: transform 220ms ease;
    /* initial transform is 0 degrees around the center of the arc */
    transform: rotate(0deg);
    transform-origin: 160px 170px;
}

.speedtest-card__ticks text {
    fill: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-anchor: middle;
    dominant-baseline: middle;
}

.speedtest-card__center {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.14rem;
    width: min(100%, 300px);
    text-align: center;
    pointer-events: none;
}

.speedtest-card__phase {
    min-height: 1rem;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.speedtest-card__value {
    font-size: 3.2rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.speedtest-card__unit {
    margin-top: 0.25rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.speedtest-card__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: var(--bg-light, #2f3033);
}

.speedtest-card--compact .speedtest-card__gauge-shell {
    min-height: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-color: transparent;
    border-bottom-color: transparent;
    opacity: 0;
}

.speedtest-card--compact .speedtest-card__stats {
    border-top: 1px solid var(--border-light);
}

.speedtest-card__stat {
    padding: 1rem 1.1rem;
}

.speedtest-card__stat + .speedtest-card__stat {
    border-left: 1px solid var(--border-light);
}

.speedtest-card__stat-value {
    font-size: 2.45rem;
    font-weight: 400;
    line-height: 0.96;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.speedtest-card__stat-label {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.speedtest-card__details {
    display: grid;
    gap: 0.7rem;
    padding: 1rem 0 0;
}

.speedtest-card__detail {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.speedtest-card__detail strong {
    color: var(--text-primary);
    font-weight: 600;
}

.speedtest-card__assessment {
    margin: 1rem 0 0;
    font-size: 1rem;
    line-height: 1.45;
}

.speedtest-card__status {
    margin: 0.7rem 0 0;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.speedtest-card__debug {
    margin: 0.9rem 0 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-light);
}

.speedtest-card__debug-summary {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.92rem;
    user-select: none;
}

.speedtest-card__debug[open] .speedtest-card__debug-summary {
    margin-bottom: 0.7rem;
}

.speedtest-card__debug-output {
    margin: 0;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--bg-light, #2f3033);
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    font:
        0.82rem/1.45 ui-monospace,
        SFMono-Regular,
        Menlo,
        Consolas,
        monospace;
}

@container (min-width: 640px) {
    .speedtest-card__details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (max-width: 639px) {
    .speedtest-card__controls--footer {
        width: 100%;
    }

    .speedtest-card__server-picker {
        width: 100%;
    }

    .speedtest-card__server-select {
        width: 100%;
        max-width: none;
    }

    .speedtest-card__button-group {
        width: 100%;
        justify-content: flex-end;
    }

    .speedtest-card__action {
        align-self: auto;
    }

    .speedtest-card__gauge-shell {
        min-height: 312px;
        max-height: 360px;
        padding: 0.95rem 0 0.85rem;
    }

    .speedtest-card__center {
        top: 61%;
        width: min(100%, 260px);
    }

    .speedtest-card__value {
        font-size: 2.75rem;
    }

    .speedtest-card__ticks text {
        font-size: 11px;
    }

    .speedtest-card__stat {
        padding: 0.9rem 1rem;
    }
}

.speedtest-card :where(button, input, select, a[href], [role="button"]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

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

#results-page .results-slot-panel:has(> .results-slot-panel-body > .timer-widget) > .results-slot-panel-body {
    padding: 0 !important;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.timer-widget :where(button, input, select, [role="button"]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
