/* Arab SEO Tools ? RTL-first frontend */
:root {
  --ast-bg: #f5f8fb;
  --ast-surface: #ffffff;
  --ast-text: #1a2332;
  --ast-muted: #5a6b7d;
  --ast-border: #dde5ee;
  --ast-primary: #3596d2;
  --ast-primary-hover: #2a7fb8;
  --ast-radius: 10px;
  --ast-shadow: 0 1px 2px rgba(26, 35, 50, 0.05);
  --ast-font: "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
}

.ast-dark,
[data-theme="dark"] {
  --ast-bg: #0f1419;
  --ast-surface: #171d24;
  --ast-text: #e8eef4;
  --ast-muted: #8b9aab;
  --ast-border: #2a3440;
  --ast-primary: #5eb3e8;
  --ast-primary-hover: #7bc2ee;
}

/* When theme wraps the page, avoid double shell */
.astt-main .ast-tool-page,
.astt-main .ast-archive-page,
.ast-tool-page,
.ast-archive-page {
  background: transparent;
  color: var(--ast-text);
  font-family: inherit;
  padding: 2.25rem 0 3.5rem;
  min-height: 0;
}

.ast-main {
  background: var(--ast-bg);
  color: var(--ast-text);
  font-family: var(--ast-font);
  padding: 2rem 1rem 4rem;
  min-height: 60vh;
}

.ast-container {
  max-width: 1100px;
  margin: 0 auto;
}

.ast-breadcrumb a {
  color: var(--ast-muted);
  text-decoration: none;
}

.ast-breadcrumb a:hover {
  color: var(--ast-primary);
}

.ast-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  color: var(--ast-muted);
}

.ast-breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-inline-start: 0.5rem;
  opacity: 0.5;
}

.ast-tool-header,
.ast-archive-header {
  margin-bottom: 2rem;
}

.ast-tool-header__top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.ast-tool-header__text {
  min-width: 0;
  flex: 1;
}

.ast-tool-title,
.ast-archive-header h1 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.ast-tool-desc,
.ast-archive-header p {
  color: var(--ast-muted);
  margin: 0;
}

.ast-lang-switcher {
  display: none; /* theme header owns language switching */
}

.ast-search-wrap {
  position: relative;
  margin-top: 1.5rem;
  max-width: 480px;
}

.ast-search {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--ast-border);
  border-radius: var(--ast-radius);
  background: var(--ast-surface);
  color: var(--ast-text);
}

.ast-search-results {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  margin: 0.25rem 0 0;
  padding: 0.5rem;
  list-style: none;
  background: var(--ast-surface);
  border: 1px solid var(--ast-border);
  border-radius: var(--ast-radius);
  box-shadow: var(--ast-shadow);
  z-index: 10;
}

.ast-search-results a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--ast-text);
  text-decoration: none;
  border-radius: 8px;
}

.ast-search-results a:hover {
  background: var(--ast-bg);
}

.ast-categories,
.ast-tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .ast-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .ast-tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .ast-tools-grid-compact {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ast-tools-grid-compact {
  grid-template-columns: 1fr;
}

.ast-category-card,
.ast-tool-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.05rem 1.15rem;
  background: var(--ast-surface);
  border: 1px solid var(--ast-border);
  border-radius: var(--ast-radius);
  text-decoration: none;
  color: inherit;
  box-shadow: none;
  transition: border-color 0.15s ease;
  min-height: 88px;
}

.ast-category-card:hover,
.ast-tool-card:hover {
  transform: none;
  box-shadow: none;
  border-color: color-mix(in srgb, var(--ast-primary) 40%, var(--ast-border));
}

.ast-tool-card__body {
  flex: 1;
  min-width: 0;
}

.ast-tool-card__go {
  color: var(--ast-muted);
  flex-shrink: 0;
  display: inline-flex;
  margin-inline-start: auto;
}

html[dir="rtl"] .ast-tool-card__go {
  transform: scaleX(-1);
}

.ast-tool-card h3,
.ast-category-card h2 {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
  font-weight: 650;
}

.ast-tool-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ast-muted);
  line-height: 1.45;
}

.ast-tool-interface {
  background: var(--ast-surface);
  border: 1px solid var(--ast-border);
  border-radius: var(--ast-radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.ast-form-group {
  margin-bottom: 1.15rem;
}

.ast-form-group label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  color: var(--ast-text);
}

.ast-input,
.ast-textarea,
.ast-select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--ast-border);
  border-radius: 12px;
  background: var(--ast-surface);
  color: var(--ast-text);
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(26, 35, 50, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  appearance: none;
}

.ast-input::placeholder,
.ast-textarea::placeholder {
  color: var(--ast-muted);
  opacity: 0.72;
}

.ast-input:hover,
.ast-textarea:hover,
.ast-select:hover {
  border-color: color-mix(in srgb, var(--ast-primary) 28%, var(--ast-border));
}

.ast-input:focus,
.ast-textarea:focus,
.ast-select:focus {
  outline: none;
  border-color: var(--ast-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ast-primary) 20%, transparent);
  background: var(--ast-surface);
}

.ast-textarea {
  min-height: 9rem;
  resize: vertical;
}

.ast-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a6b7d' 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 0.9rem center;
  padding-inline-end: 2.4rem;
}

html[dir="rtl"] .ast-select,
[dir="rtl"] .ast-select {
  background-position: left 0.9rem center;
}

/* Modern URL field */
.ast-url-field {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 3.05rem;
  background: var(--ast-surface);
  border: 1px solid var(--ast-border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(26, 35, 50, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ast-url-field:hover {
  border-color: color-mix(in srgb, var(--ast-primary) 32%, var(--ast-border));
}

.ast-url-field:focus-within {
  border-color: var(--ast-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ast-primary) 20%, transparent);
}

.ast-url-field__affix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.85rem;
  color: var(--ast-muted);
  background: color-mix(in srgb, var(--ast-bg) 70%, var(--ast-surface));
  border-inline-end: 1px solid var(--ast-border);
}

.ast-url-field:focus-within .ast-url-field__affix {
  color: var(--ast-primary);
  background: color-mix(in srgb, var(--ast-primary) 8%, var(--ast-surface));
  border-inline-end-color: color-mix(in srgb, var(--ast-primary) 25%, var(--ast-border));
}

.ast-url-field__icon {
  display: block;
}

.ast-url-field .ast-input,
.ast-url-field .ast-input--url {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
}

.ast-url-field .ast-input:hover,
.ast-url-field .ast-input:focus {
  border: 0;
  box-shadow: none;
  outline: none;
}

.ast-dark .ast-url-field,
[data-theme="dark"] .ast-url-field {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ast-dark .ast-url-field__affix,
[data-theme="dark"] .ast-url-field__affix {
  background: color-mix(in srgb, var(--ast-bg) 55%, var(--ast-surface));
}

.ast-checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 600;
  cursor: pointer;
}

.ast-checkbox {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
}

.ast-form-group-select .ast-select {
  max-width: 100%;
}

.ast-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.ast-btn {
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.ast-btn:active {
  transform: translateY(1px);
}

.ast-btn-primary {
  background: var(--ast-primary);
  color: #fff;
}

.ast-btn-primary:hover {
  background: var(--ast-primary-hover);
}

.ast-btn-secondary {
  background: var(--ast-surface);
  color: var(--ast-text);
  border: 1px solid var(--ast-border);
}

.ast-btn-secondary:hover {
  border-color: color-mix(in srgb, var(--ast-primary) 35%, var(--ast-border));
}

.ast-tool-output {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--ast-bg);
  border-radius: 8px;
  min-height: 80px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
}

.ast-tool-output--rich {
  white-space: normal;
  background: transparent;
  padding: 0;
}

.ast-tool-output:empty::before {
  content: attr(data-placeholder);
  color: var(--ast-muted);
}

.ast-result {
  background: var(--ast-surface);
  border: 1px solid var(--ast-border);
  border-radius: 14px;
  padding: 1.1rem 1.15rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ast-result--error {
  border-color: color-mix(in srgb, #dc2626 35%, var(--ast-border));
  background: color-mix(in srgb, #dc2626 8%, var(--ast-surface));
}

.ast-result__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 800;
}

.ast-result__banner--warn {
  background: color-mix(in srgb, #dc2626 12%, transparent);
  color: #b91c1c;
  display: block;
  border-radius: 10px;
  margin-bottom: 0.75rem;
}

.ast-result__table-title {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 800;
}

.ast-result__score {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ast-primary) 8%, var(--ast-bg));
}

.ast-result__score-num {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ast-primary);
}

.ast-result__score--good .ast-result__score-num { color: #059669; }
.ast-result__score--ok .ast-result__score-num { color: #d97706; }
.ast-result__score--bad .ast-result__score-num { color: #dc2626; }

.ast-result__score-label {
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--ast-muted);
}

.ast-result__list {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.ast-result__row {
  display: grid;
  grid-template-columns: minmax(7rem, 34%) 1fr;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: var(--ast-bg);
}

.ast-result__row dt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ast-muted);
}

.ast-result__row dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ast-text);
  word-break: break-word;
}

.ast-result__note {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ast-muted);
}

.ast-result__raw {
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.ast-result__checks {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.ast-result__checks li {
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: var(--ast-bg);
  font-size: 0.85rem;
}

.ast-result__checks li.is-ok {
  border-inline-start: 3px solid #059669;
}

.ast-result__checks li.is-bad {
  border-inline-start: 3px solid #dc2626;
}

.ast-result__table-wrap {
  margin-top: 0.85rem;
  overflow-x: auto;
}

.ast-result__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.ast-result__table th,
.ast-result__table td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--ast-border);
  text-align: start;
}

.ast-result__compare {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (min-width: 720px) {
  .ast-result__compare {
    grid-template-columns: 1fr 1fr;
  }
}

.ast-result__col {
  padding: 0.75rem;
  border: 1px solid var(--ast-border);
  border-radius: 10px;
  background: var(--ast-bg);
}

.ast-result__col h4 {
  margin: 0 0 0.5rem;
}

.ast-tool-status {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--ast-muted);
}

.ast-notice {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.ast-notice-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
}

.ast-notice-info {
  background: #e0f2fe;
  border: 1px solid #38bdf8;
  color: #0c4a6e;
}

.ast-tool-formula {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  color: #065f46;
}

.ast-tool-content {
  margin: 2rem 0;
  line-height: 1.7;
}

.ast-faq {
  margin: 2.5rem 0 1rem;
}

.ast-faq > h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.ast-faq-item {
  border: 0;
  border-block-end: 1px solid var(--ast-border);
  border-radius: 0;
  margin-bottom: 0;
  background: transparent;
  padding-block: 0.85rem;
}

.ast-faq-item:first-child {
  border-block-start: 1px solid var(--ast-border);
}

.ast-faq-item summary {
  padding: 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.ast-faq-item summary::-webkit-details-marker {
  display: none;
}

.ast-faq-answer {
  padding: 0.55rem 0 0;
  color: var(--ast-muted);
  font-size: 0.94rem;
}

.ast-related > h2,
.ast-related__title {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
  font-weight: 800;
}

.ast-related {
  margin: 2rem 0 1.5rem;
}

.ast-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 768px) {
  .ast-related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ast-related-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.95rem;
  background: var(--ast-surface);
  border: 1px solid var(--ast-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ast-text);
  min-width: 0;
}

.ast-related-card:hover {
  border-color: var(--ast-primary);
}

.ast-related-card__name {
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.35;
}

.ast-cat-chips {
  display: none !important;
}

[data-theme="dark"] .ast-notice-warning {
  background: color-mix(in srgb, #f59e0b 18%, var(--ast-surface));
  border-color: color-mix(in srgb, #f59e0b 40%, var(--ast-border));
  color: #fde68a;
}

[data-theme="dark"] .ast-notice-info {
  background: color-mix(in srgb, #38bdf8 14%, var(--ast-surface));
  border-color: color-mix(in srgb, #38bdf8 35%, var(--ast-border));
  color: #bae6fd;
}

[data-theme="dark"] .ast-tool-formula {
  background: color-mix(in srgb, #34d399 12%, var(--ast-surface));
  border-color: color-mix(in srgb, #34d399 35%, var(--ast-border));
  color: #a7f3d0;
}

.ast-ads {
  margin: 1.5rem 0;
  text-align: center;
}

.ast-ltr .ast-breadcrumb li:not(:last-child)::after {
  content: "/";
}

.ast-robots-builder {
  display: grid;
  gap: 1rem;
}

.ast-robots-builder[hidden] {
  display: none !important;
}

.ast-rt-card {
  background: var(--ast-surface);
  border: 1px solid var(--ast-border);
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  box-shadow: var(--ast-shadow, 0 4px 20px rgba(20, 40, 32, 0.06));
}

.ast-rt-card-title {
  font-weight: 700;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ast-rt-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgba(10, 110, 98, 0.12);
  color: #0a6e62;
  font-size: 0.75rem;
}

.ast-rt-grid2 {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .ast-rt-grid2 {
    grid-template-columns: 1fr 1fr;
  }
}

.ast-rt-delay {
  max-width: 280px;
  margin-top: 0.75rem;
}

.ast-rt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.95rem;
}

.ast-rt-btn {
  border: 1px solid var(--ast-border);
  background: var(--ast-bg, #f2f6f4);
  color: var(--ast-text);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.ast-rt-btn:hover { opacity: 0.9; }
.ast-rt-btn-allow { color: #0a6e62; background: rgba(10,110,98,.08); border-color: rgba(10,110,98,.28); }
.ast-rt-btn-block { color: #c0392b; background: rgba(192,57,43,.07); border-color: rgba(192,57,43,.28); }
.ast-rt-btn-search { color: #0a6e62; background: rgba(10,110,98,.08); border-color: rgba(10,110,98,.25); }
.ast-rt-btn-ai { color: #a87208; background: rgba(201,137,10,.1); border-color: rgba(201,137,10,.3); }
.ast-rt-btn-seo { color: #1a8f4c; background: rgba(26,143,76,.1); border-color: rgba(26,143,76,.28); }
.ast-rt-btn-archive { color: #c0392b; background: rgba(192,57,43,.08); border-color: rgba(192,57,43,.28); }

.ast-rt-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ast-border);
  border-radius: 10px;
}

.ast-rt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.ast-rt-table th {
  background: var(--ast-bg, #e8f0ec);
  padding: 0.7rem 0.85rem;
  text-align: start;
  font-weight: 700;
}

.ast-rt-table td {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--ast-border);
  vertical-align: middle;
}

.ast-rt-sub {
  font-size: 0.75rem;
  color: var(--ast-muted, #4a6358);
}

.ast-rt-center { text-align: center; }
.ast-rt-th-allow { color: #0a6e62; text-align: center !important; }
.ast-rt-th-block { color: #c0392b; text-align: center !important; }

.ast-rt-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.ast-rt-radio {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #0a6e62;
  cursor: pointer;
}

.ast-rt-dirs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ast-rt-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--ast-bg, #e8f0ec);
  border: 1px solid var(--ast-border);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
  user-select: none;
}

.ast-rt-chip:hover { background: var(--ast-surface); }

.ast-rt-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.ast-rt-preview-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ast-rt-out {
  margin: 0;
  background: var(--ast-bg, #e8f0ec);
  border: 1px solid var(--ast-border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.78rem;
  line-height: 1.85;
  overflow: auto;
  max-height: 520px;
  white-space: pre;
}

.ast-result__col h4 {
  margin: 0 0 0.75rem;
}

/* Google PageSpeed?style gauges & CWV cards */
.ast-psi {
  display: grid;
  gap: 1.15rem;
}
.ast-psi__title {
  margin: 0;
  font-size: 1.1rem;
}
.ast-psi__gauges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  justify-content: center;
  padding: 0.5rem 0 0.25rem;
}
.ast-psi-gauge {
  position: relative;
  width: 108px;
  height: 108px;
  flex-shrink: 0;
}
.ast-psi-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ast-psi-gauge__track {
  fill: none;
  stroke: color-mix(in srgb, var(--ast-border) 80%, #e8eaed);
  stroke-width: 8;
}
.ast-psi-gauge__value {
  fill: none;
  stroke: var(--psi-color, #0cce6b);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: var(--psi-c);
  stroke-dashoffset: var(--psi-o);
  transition: stroke-dashoffset 0.55s ease;
}
.ast-psi-gauge__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  text-align: center;
  padding: 0.5rem;
}
.ast-psi-gauge__label strong {
  font-size: 1.55rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--psi-color, inherit);
}
.ast-psi-gauge__label span {
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--ast-muted);
  max-width: 5.5rem;
}
.ast-psi__meta {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ast-border);
  border-radius: var(--ast-radius);
  background: var(--ast-surface);
  font-size: 0.88rem;
}
.ast-psi__meta > div {
  display: grid;
  gap: 0.15rem;
}
.ast-psi__meta span {
  color: var(--ast-muted);
  font-size: 0.75rem;
}
.ast-psi__meta a,
.ast-psi__meta strong {
  color: var(--ast-text);
  word-break: break-word;
  text-decoration: none;
}
.ast-psi__metrics-head h3 {
  margin: 0;
  font-size: 1rem;
}
.ast-psi__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.ast-psi-metric {
  border: 1px solid var(--ast-border);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
  background: var(--ast-surface);
  border-inline-start: 4px solid #9aa0a6;
}
.ast-psi-metric--good { border-inline-start-color: #0cce6b; }
.ast-psi-metric--ok { border-inline-start-color: #ffa400; }
.ast-psi-metric--bad { border-inline-start-color: #ff4e42; }
.ast-psi-metric__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.ast-psi-metric__name {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ast-muted);
}
.ast-psi-metric__pill {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--ast-bg);
  color: var(--ast-muted);
}
.ast-psi-metric--good .ast-psi-metric__pill {
  background: color-mix(in srgb, #0cce6b 18%, var(--ast-surface));
  color: #0b7a3e;
}
.ast-psi-metric--ok .ast-psi-metric__pill {
  background: color-mix(in srgb, #ffa400 20%, var(--ast-surface));
  color: #9a5b00;
}
.ast-psi-metric--bad .ast-psi-metric__pill {
  background: color-mix(in srgb, #ff4e42 18%, var(--ast-surface));
  color: #b42318;
}
.ast-psi-metric__value {
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin-bottom: 0.55rem;
}
.ast-psi-metric--good .ast-psi-metric__value { color: #0cce6b; }
.ast-psi-metric--ok .ast-psi-metric__value { color: #ffa400; }
.ast-psi-metric--bad .ast-psi-metric__value { color: #ff4e42; }
.ast-psi-metric__bar {
  height: 4px;
  border-radius: 999px;
  background: var(--ast-bg);
  overflow: hidden;
}
.ast-psi-metric__bar > span {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: #9aa0a6;
}
.ast-psi-metric--good .ast-psi-metric__bar > span { background: #0cce6b; width: 92%; }
.ast-psi-metric--ok .ast-psi-metric__bar > span { background: #ffa400; width: 58%; }
.ast-psi-metric--bad .ast-psi-metric__bar > span { background: #ff4e42; width: 28%; }
.ast-psi__compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.ast-psi__col > h4 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}
@media (max-width: 720px) {
  .ast-psi__compare {
    grid-template-columns: 1fr;
  }
  .ast-psi-gauge {
    width: 96px;
    height: 96px;
  }
  .ast-psi-gauge__label strong {
    font-size: 1.35rem;
  }
}

/* ??? Measurement reports (SEO Checker style) ??? */
.ast-m-report { display: grid; gap: 1.1rem; }
.ast-m-scorecard {
  background: var(--ast-surface);
  border: 1px solid var(--ast-border);
  border-radius: var(--ast-radius);
  padding: 1.15rem 1.25rem;
}
.ast-m-scorecard__main {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}
.ast-m-scorecard__text h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}
.ast-m-issues { margin: 0; color: var(--ast-muted); font-size: 0.9rem; }
.ast-m-donut {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}
.ast-m-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ast-m-donut__track {
  fill: none;
  stroke: var(--ast-border);
  stroke-width: 10;
}
.ast-m-donut__value {
  fill: none;
  stroke: var(--ast-m-color, var(--ast-primary));
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: var(--ast-m-c);
  stroke-dashoffset: var(--ast-m-o);
  transition: stroke-dashoffset 0.45s ease;
}
.ast-m-donut__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
}
.ast-m-bars { display: grid; gap: 0.65rem; }
.ast-m-bar__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.84rem;
  margin-bottom: 0.25rem;
}
.ast-m-bar__track {
  height: 8px;
  border-radius: 999px;
  background: var(--ast-bg);
  overflow: hidden;
}
.ast-m-bar__track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ast-primary);
}
.ast-m-page {
  background: var(--ast-surface);
  border: 1px solid var(--ast-border);
  border-radius: var(--ast-radius);
  padding: 1.05rem 1.15rem;
}
.ast-m-page__head h3 { margin: 0 0 0.85rem; font-size: 1rem; }
.ast-m-page__meta { display: grid; gap: 0.75rem; }
.ast-m-page__meta span {
  display: block;
  font-size: 0.75rem;
  color: var(--ast-muted);
  margin-bottom: 0.15rem;
}
.ast-m-page__meta strong, .ast-m-page__meta p, .ast-m-page__meta a {
  font-size: 0.92rem;
  color: var(--ast-text);
  margin: 0;
  text-decoration: none;
  word-break: break-word;
}
.ast-m-page__stats { display: flex; gap: 0.5rem; margin-top: 0.9rem; flex-wrap: wrap; }
.ast-m-stat {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: var(--ast-bg);
  border: 1px solid var(--ast-border);
  font-size: 0.8rem;
  font-weight: 600;
}
.ast-m-stat.is-code { background: color-mix(in srgb, #22c55e 16%, var(--ast-surface)); border-color: color-mix(in srgb, #22c55e 35%, var(--ast-border)); color: #15803d; }
.ast-m-checks { display: grid; gap: 0.55rem; }
.ast-m-check {
  border: 1px solid var(--ast-border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  background: var(--ast-surface);
}
.ast-m-check header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.ast-m-check h4 { margin: 0; font-size: 0.92rem; flex: 1; }
.ast-m-check p { margin: 0; color: var(--ast-muted); font-size: 0.84rem; line-height: 1.45; }
.ast-m-check.is-ok { border-inline-start: 3px solid #22c55e; }
.ast-m-check.is-warn { border-inline-start: 3px solid #e6b422; }
.ast-m-check.is-fail { border-inline-start: 3px solid #e35d6a; }
.ast-m-tag {
  display: inline-flex;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--ast-primary) 12%, var(--ast-surface));
  color: var(--ast-primary);
}
.ast-m-tag.is-critical {
  background: color-mix(in srgb, #e35d6a 16%, var(--ast-surface));
  color: #b42318;
}
.ast-m-note { margin: 0; color: var(--ast-muted); font-size: 0.84rem; }
.ast-m-serp {
  background: var(--ast-surface);
  border: 1px solid var(--ast-border);
  border-radius: var(--ast-radius);
  padding: 1rem 1.15rem;
  margin-bottom: 0.25rem;
}
.ast-m-serp__url { color: #0d652d; font-size: 0.84rem; margin-bottom: 0.2rem; }
.ast-m-serp__title { color: #1a0dab; font-size: 1.15rem; line-height: 1.35; margin-bottom: 0.25rem; }
.ast-m-serp__desc { color: #4d5156; font-size: 0.9rem; line-height: 1.5; }
.ast-m-compare__grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 900px) {
  .ast-m-compare__grid { grid-template-columns: 1fr 1fr; }
}
