/* OmniTool - Editorial styles for tool guides, articles and policy pages */

.content-wrap {
  max-width: 880px;
  margin: 0 auto;
}

.tool-article,
.page-article {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
}

.tool-article > section,
.page-article > section {
  margin-top: 44px;
}

.tool-article h2,
.page-article h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  margin-bottom: 14px;
  scroll-margin-top: 90px;
}

.tool-article h3,
.page-article h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 26px 0 10px;
}

.tool-article p,
.page-article p {
  margin-bottom: 14px;
}

.tool-article ul,
.tool-article ol,
.page-article ul,
.page-article ol {
  margin: 0 0 16px 20px;
}

.tool-article li,
.page-article li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.tool-article a,
.page-article a {
  color: hsl(var(--primary));
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.3);
}

.tool-article a:hover,
.page-article a:hover {
  border-bottom-color: hsl(var(--primary));
}

.tool-article code,
.page-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--text-primary);
  word-break: break-word;
}

.tool-article pre,
.page-article pre {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  overflow-x: auto;
  margin-bottom: 18px;
}

.tool-article pre code,
.page-article pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
}

/* Lead paragraph under the H1 */
.article-lead {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Numbered "how to use" steps */
.steps-list {
  list-style: none;
  margin: 0 !important;
  counter-reset: step;
}

.steps-list li {
  position: relative;
  padding: 0 0 0 44px !important;
  margin-bottom: 16px;
  counter-increment: step;
}

.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(var(--primary-rgb), 0.28);
}

.steps-list li strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

/* Callout box */
.callout {
  display: flex;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid hsl(var(--primary));
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 20px 0;
  font-size: 0.95rem;
}

.callout .callout-icon {
  flex-shrink: 0;
  color: hsl(var(--primary));
  margin-top: 2px;
}

.callout .callout-icon svg {
  width: 20px;
  height: 20px;
}

.callout strong {
  color: var(--text-primary);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout.warn {
  border-left-color: hsl(var(--warning));
}

.callout.warn .callout-icon {
  color: hsl(var(--warning));
}

/* Data tables inside articles */
.article-table-wrap {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 440px;
}

.article-table th,
.article-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.article-table th {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.article-table tr:last-child td {
  border-bottom: none;
}

.article-table td code {
  white-space: nowrap;
}

/* FAQ accordion */
.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.faq-question::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
  color: hsl(var(--primary));
  transition: transform 0.2s ease;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 18px 16px;
  font-size: 0.95rem;
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* Related tools grid */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 14px;
}

.related-card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  text-decoration: none !important;
  border-bottom: 1px solid var(--border-color) !important;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--primary-rgb), 0.5) !important;
}

.related-card .related-name {
  display: block;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.related-card .related-desc {
  display: block;
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  font-weight: 400;
}

/* Page hero for tool + policy pages */
.page-hero {
  margin-bottom: 8px;
}

.page-hero h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.9px;
  color: var(--text-primary);
  line-height: 1.18;
  margin-bottom: 12px;
}

.page-hero .page-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 14px;
}

/* Table of contents */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 28px 0 0;
}

.toc h2 {
  font-size: 0.78rem !important;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted) !important;
  margin-bottom: 10px !important;
}

.toc ol {
  margin: 0 0 0 18px !important;
  font-size: 0.93rem;
}

.toc li {
  margin-bottom: 5px;
}

/* Divider between the live tool and the written guide */
.article-divider {
  height: 1px;
  background: var(--border-color);
  margin: 46px 0 0;
}

/* Guides index cards */
.guide-list {
  display: grid;
  gap: 16px;
}

.guide-card {
  display: block;
  padding: 22px 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  text-decoration: none !important;
  border-bottom: 1px solid var(--border-color) !important;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.guide-card:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--primary-rgb), 0.5) !important;
}

.guide-card h2 {
  font-size: 1.15rem !important;
  margin-bottom: 6px !important;
}

.guide-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 10px !important;
}

.guide-card .guide-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* All-tools directory index */
.directory-group {
  margin-bottom: 34px;
}

.directory-group h2 {
  font-size: 1.15rem !important;
  margin-bottom: 12px !important;
}

.directory-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px 20px;
}

.directory-links a {
  font-weight: 500 !important;
  font-size: 0.93rem;
  border-bottom: none !important;
}

/* Site footer with policy links */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 34px 24px 40px;
  margin-top: 20px;
}

.site-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.footer-cols {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 28px;
}

.footer-col h3 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.footer-col a:hover {
  color: hsl(var(--primary));
}

.footer-about p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 10px 0 0;
  max-width: 330px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
  text-decoration: none;
}

.footer-brand .footer-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-brand .footer-logo-icon svg {
  width: 15px;
  height: 15px;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: hsl(var(--primary));
}

@media (max-width: 780px) {
  .footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .footer-about {
    grid-column: 1 / -1;
  }
}

/* Contact form */
.contact-form {
  display: grid;
  gap: 14px;
  max-width: 560px;
}

.contact-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* Homepage: tools grouped by category */
.tools-group {
  margin-top: 40px;
}

.tools-group:first-child {
  margin-top: 28px;
}

.tools-group-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.tools-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.tools-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 48px 20px;
  font-size: 0.98rem;
}

.tools-empty a {
  color: hsl(var(--primary));
  font-weight: 600;
}

#tools-grid {
  margin-top: 8px;
}

.tool-card .tool-card-action {
  margin-top: auto;
}

/* Lucide swaps each <i data-lucide> for an <svg>, so the icon positioning in
   style.css (which targets `i`) stops applying once the icons render. */
.hero-search > svg,
.sidebar-search > svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.sidebar-search > svg {
  left: 14px;
  width: 16px;
  height: 16px;
}

/* Answer-first summary block. Kept visually quiet but semantically prominent:
   it is the part featured snippets and AI answer engines lift. */
.key-facts {
  margin-top: 28px !important;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  padding: 20px 24px;
}

.key-facts h2 {
  font-size: 0.78rem !important;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted) !important;
  margin-bottom: 14px !important;
}

.facts-list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.fact-row {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 14px;
  align-items: baseline;
  font-size: 0.94rem;
}

.fact-row dt {
  font-weight: 700;
  color: var(--text-primary);
}

.fact-row dd {
  margin: 0;
  color: var(--text-secondary);
}

@media (max-width: 560px) {
  .fact-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .fact-row + .fact-row {
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
  }
}

/* Keyboard users should be able to jump past the 60-link sidebar. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 20px;
  background: hsl(var(--primary));
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 var(--radius-md) 0;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

/* Visible focus ring, since the default is easy to lose on dark backgrounds. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== Tool result visuals =================================================
   Shared look for tools whose output is a figure rather than text. */

/* --- IP geolocation: one card per address family --- */
.ip-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ip-hero-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card-hover);
  padding: 14px 16px;
  transition: border-color 0.2s ease;
}

.ip-hero-card.is-ok {
  border-color: rgba(var(--primary-rgb), 0.45);
}

.ip-hero-card.is-missing {
  opacity: 0.72;
}

.ip-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
}

.ip-badge svg {
  width: 13px;
  height: 13px;
}

.ip-badge-v4 { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.ip-badge-v6 { background: var(--primary-gradient); }

.ip-hero-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.35;
}

.ip-hero-card.is-missing .ip-hero-value {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-muted);
}

.ip-hero-note {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.ip-copy {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  display: flex;
}

.ip-copy:hover:not(:disabled) {
  color: hsl(var(--primary));
  background: var(--bg-card);
}

.ip-copy:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ip-copy svg { width: 15px; height: 15px; }

/* --- BMI gauge --- */
.bmi-gauge {
  width: 100%;
  max-width: 340px;
  margin: 4px auto 0;
  display: block;
  overflow: visible;
}

.bmi-gauge-value {
  font-size: 40px;
  font-weight: 800;
  fill: var(--text-primary);
  font-family: var(--font-sans);
}

.bmi-gauge-category {
  font-size: 14px;
  font-weight: 700;
  fill: var(--text-secondary);
  font-family: var(--font-sans);
}

.bmi-gauge-tick {
  font-size: 11px;
  font-weight: 700;
  fill: var(--text-secondary);
  font-family: var(--font-sans);
}

.bmi-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-top: 16px;
}

.bmi-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-hover);
  font-size: 0.76rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.bmi-chip svg {
  width: 13px;
  height: 13px;
  color: var(--chip);
}

.bmi-chip b {
  font-weight: 700;
  color: var(--text-primary);
}

.bmi-chip small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* The category the reader actually landed in should be unmistakable. */
.bmi-chip.is-active {
  border-color: var(--chip);
  background: color-mix(in srgb, var(--chip) 16%, transparent);
  box-shadow: 0 0 0 1px var(--chip) inset;
}

.bmi-chip.is-active b,
.bmi-chip.is-active small {
  color: var(--chip);
}

.bmi-range {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card-hover);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.bmi-range svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 2px;
  color: hsl(var(--primary));
}

.bmi-range strong { color: var(--text-primary); }

/* ===== Shared result visuals ============================================= */

.viz-donut {
  width: 116px;
  height: 116px;
  flex-shrink: 0;
}

.viz-donut-track {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 12;
}

.viz-donut-value {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 70px 70px;
  transition: stroke-dashoffset 0.45s ease;
}

.viz-donut-label {
  font-size: 26px;
  font-weight: 800;
  fill: var(--text-primary);
  font-family: var(--font-sans);
}

.viz-donut-sub {
  font-size: 11px;
  font-weight: 600;
  fill: var(--text-muted);
  font-family: var(--font-sans);
}

.viz-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--border-color);
  overflow: hidden;
  margin: 8px 0;
}

.viz-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.viz-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.viz-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card-hover);
  text-align: center;
}

.viz-stat svg {
  width: 17px;
  height: 17px;
  color: hsl(var(--primary));
  margin-bottom: 2px;
}

.viz-stat b {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  word-break: break-word;
}

.viz-stat small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ===== Word counter: limit bars ========================================== */

.wc-limits {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.wc-limit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.wc-limit-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wc-limit-head svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.wc-limit-head b {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* ===== Age calculator ==================================================== */

.age-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
}

.age-unit {
  padding: 14px 6px;
  border-radius: var(--radius-md);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
}

.age-unit b {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.age-unit small {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.age-ring {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card-hover);
}

.age-ring-note {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.age-ring-note strong { color: var(--text-primary); }

.age-ring-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== Percentage calculator ============================================= */

.pct-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  word-break: break-all;
}

.pct-caption {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.pct-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.pct-donut-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pct-change {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
}

.pct-change svg { width: 26px; height: 26px; }

.pct-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Palindrome checker ================================================ */

.pal-idle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pal-verdict {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.pal-verdict svg { width: 19px; height: 19px; flex-shrink: 0; }

.pal-verdict.is-yes {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.13);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.pal-verdict.is-no {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.13);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.pal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 6px;
}

.pal-cell {
  width: 26px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.pal-cell.is-match {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.32);
}

.pal-cell.is-mismatch {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.32);
}

/* The middle character of an odd-length string has no partner to match. */
.pal-cell.is-pivot {
  color: hsl(var(--primary));
  background: rgba(var(--primary-rgb), 0.14);
  border-color: rgba(var(--primary-rgb), 0.4);
}

.pal-note {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ===== Random generator ================================================== */

.rng-faces {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 4px;
}

.rng-die, .rng-coin { width: 56px; height: 56px; }

.rng-die-body {
  fill: var(--bg-card-hover);
  stroke: var(--border-color);
  stroke-width: 3;
}

.rng-die-pips { fill: hsl(var(--primary)); }

.rng-die-num {
  fill: hsl(var(--primary));
  font-size: 42px;
  font-weight: 800;
  font-family: var(--font-sans);
}

.rng-coin-body { fill: var(--bg-card-hover); stroke: var(--border-color); stroke-width: 3; }
.rng-coin-ring { fill: none; stroke-width: 2; opacity: 0.55; }
.rng-coin.is-heads .rng-coin-ring { stroke: hsl(var(--primary)); }
.rng-coin.is-tails .rng-coin-ring { stroke: #f59e0b; }

.rng-coin-letter {
  font-size: 38px;
  font-weight: 800;
  font-family: var(--font-sans);
}

.rng-coin.is-heads .rng-coin-letter { fill: hsl(var(--primary)); }
.rng-coin.is-tails .rng-coin-letter { fill: #f59e0b; }

.rng-split { margin-top: 14px; }

.rng-split-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.rng-split-row b { color: var(--text-primary); font-variant-numeric: tabular-nums; }

.rng-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.rng-number {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

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

.rng-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
}

.rng-pick-rank {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--border-color);
  color: var(--text-secondary);
}

.rng-pick.rank-1 .rng-pick-rank { background: #f7c948; color: #4a3600; }
.rng-pick.rank-2 .rng-pick-rank { background: #c8cdd4; color: #333; }
.rng-pick.rank-3 .rng-pick-rank { background: #d08c52; color: #3d1f00; }

.rng-pick-name {
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.rng-more {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
}

@media (max-width: 520px) {
  .age-ring { flex-direction: column; text-align: center; }
  .pct-donut-row { flex-direction: column; text-align: center; }
}

/* ===== Ad slots ==========================================================
   The base .footer-ad-banner in style.css draws a dashed 90px box with an
   "Advertisement" label. When AdSense returns no ad - the site is not yet
   approved to serve, or an extension blocked the tag - that empty box reads
   as a broken placeholder. So the chrome only appears once a unit is
   actually filled, and js/page.js hides the banner outright when it is not. */
.footer-ad-banner {
  border: none;
  min-height: 0;
  padding: 0;
  background: none;
}

.footer-ad-banner .ad-label {
  display: none;
}

/* Restored only when AdSense reports data-ad-status="filled". */
.footer-ad-banner.is-filled {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px;
}

.footer-ad-banner.is-filled .ad-label {
  display: block;
}

/* The base rule sets display:flex, which would otherwise beat [hidden]. */
.footer-ad-banner[hidden] {
  display: none !important;
}
