/* Public page layouts. Each component has one layout across all 20 languages. */
.hero, .how, .features, .privacy-banner { padding-inline: 32px; }
.hero-inner, .how-inner, .features-inner, .privacy-banner-inner { max-width: var(--content); margin: auto; }
.hero { padding-block: 56px 48px; }
.hero-inner { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 48px; align-items: start; }
.hero-text { min-width: 0; padding-top: 8px; }
.eyebrow { font-size: 13px; font-weight: 700; color: var(--teal); letter-spacing: .03em; }
.hero h1 { margin: 16px 0 22px; font-size: clamp(34px,3.8vw,48px); line-height: 1.3; letter-spacing: -.035em; overflow-wrap: anywhere; }
.hero h1 span { color: var(--teal); }
.hero-desc { max-width: 540px; color: var(--muted); font-size: 17px; line-height: 1.85; }
.hero-cta { display: flex; flex-direction: row; align-items: stretch; justify-content: flex-start; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
html[dir="rtl"] .hero-cta > a.btn-install.manual-cta > span[aria-hidden="true"] { transform: scaleX(-1); }
.hero-cta > a, .hero-cta > button { min-height: 50px; padding: 13px 22px; max-width: 100%; }
.hero-cta .btn-open { background: var(--white); color: var(--teal); border-color: var(--soft-line); }
.hero-cta .btn-open:hover:not(:disabled) { background: var(--soft); }
.hero-cta .btn-open:disabled { opacity: 1; color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.extension-support { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.extension-status { min-block-size: 6.125em; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.install-hint { color: var(--muted); font-size: 14px; line-height: 1.75; }
.install-hint[data-state="error"] { color: var(--error); }
.extension-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 20px; margin-top: 8px; }
.btn-manual-small, .manual-toggle { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; font-size: 14px; font-weight: 600; line-height: 1.6; background: none; border: 0; text-align: start; }
.btn-manual-small { color: var(--teal); }
.manual-toggle { color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
.manual-steps { margin-top: 10px; padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--muted); }
.code-copy { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.code-copy code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--teal); font-size: 13px; }
.code-copy button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--soft-line); border-radius: 6px; color: var(--teal); background: var(--soft); font-size: 14px; }
.comparison-guide { min-width: 0; background: var(--white); padding: 24px; border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: var(--radius); box-shadow: var(--shadow); }
.comparison-guide h2 { font-size: 25px; line-height: 1.5; letter-spacing: -.025em; margin: 10px 0 24px; }
.comparison-guide ol { list-style: none; counter-reset: condition; padding: 0; }
.comparison-guide li { position: relative; counter-increment: condition; padding-block: 0 16px; padding-inline: 42px 0; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.comparison-guide li > .guide-number::before { content: counter(condition); position: absolute; inset-inline-start: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; background: var(--soft); color: var(--teal); font-size: 13px; font-weight: 700; border-radius: 8px; }
.comparison-guide li:last-child { border: 0; padding-bottom: 0; margin-bottom: 20px; }
.comparison-guide strong { font-size: 16px; }
.comparison-guide p { font-size: 14px; line-height: 1.8; color: var(--muted); margin-top: 5px; }
.comparison-guide .guide-note { padding: 12px 14px; background: var(--soft); border-radius: 8px; font-size: 13px; }
.how { background: var(--white); border-block: 1px solid var(--line); padding-block: 40px; }
.how h2, .features h2 { margin: 8px 0 28px; font-size: 28px; line-height: 1.4; letter-spacing: -.025em; }
.steps-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 32px; list-style: none; padding: 0; }
.step { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.step-num { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px; background: var(--soft); color: var(--teal); font-size: 14px; font-weight: 700; }
.step h3, .feature-card h3 { font-size: 17px; line-height: 1.5; margin-bottom: 8px; }
.step p, .feature-card p { color: var(--muted); font-size: 15px; line-height: 1.85; }
.features { padding-block: 40px; }
.feature-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.feature-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.data-note { margin-top: 24px; font-size: 14px; color: var(--muted); line-height: 1.8; }
.privacy-banner { background: var(--soft); border-top: 1px solid var(--soft-line); padding-block: 28px; }
.privacy-banner h3 { font-size: 16px; margin-bottom: 8px; }
.privacy-banner p { color: var(--muted); font-size: 14px; line-height: 1.85; }
.page-wrap { max-width: 1064px; margin: auto; padding: 36px 32px 56px; }
.page-header { margin-bottom: 24px; }
.page-header h1, .prose h1 { font-size: 32px; line-height: 1.4; letter-spacing: -.03em; margin-bottom: 12px; overflow-wrap: anywhere; }
.page-header h1 span { display: block; margin-top: 4px; color: var(--teal); }
.page-header p { max-width: 800px; color: var(--muted); font-size: 16px; line-height: 1.85; }
.input-card { background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.input-card label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 650; }
.input-card textarea { display: block; width: 100%; min-height: 100px; padding: 12px 14px; border: 1px solid var(--field-line); border-radius: 9px; background: var(--field); color: var(--ink); font-size: 16px; line-height: 1.65; resize: vertical; }
.input-card textarea[aria-invalid="true"] { border-color: var(--error); }
textarea::placeholder { color: var(--muted); }
.input-row { display: flex; align-items: flex-end; gap: 16px; margin-top: 18px; }
.input-row > label { flex: 1; min-width: 0; max-width: 400px; margin: 0; }
.input-row select { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 48px; padding: 10px 12px; margin-top: 8px; border: 1px solid var(--field-line); border-radius: 9px; background: var(--field); color: var(--ink); font-size: 16px; }
.input-row .btn-primary { min-height: 48px; margin-inline-start: auto; padding-inline: 24px; flex-shrink: 0; max-width: 45%; }
.field-help { font-size: 14px; color: var(--muted); line-height: 1.75; margin-top: 10px; }
#manualRegionHelp { margin-top: 14px; }
.error-msg { display: none; color: var(--error); font-size: 14px; margin-top: 10px; }
.notice-banner, .progress-tip, .context-warning { padding: 18px 20px; border: 1px solid var(--soft-line); border-radius: 10px; margin-bottom: 24px; background: var(--soft); color: var(--soft-ink); font-size: 14px; line-height: 1.8; }
.notice-banner strong { display: block; margin-bottom: 4px; font-size: 15px; }
.progress-tip, .context-warning { background: var(--warning); color: var(--warning-ink); border-color: var(--warning-line); }
.progress-tip { display: none; }
.condition-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; color: var(--muted); font-size: 14px; }
.condition-summary:empty { display: none; }
.condition-summary span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.results-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.results-header h2 { min-width: 0; overflow-wrap: anywhere; font-size: 22px; line-height: 1.5; }
.count-pill { display: inline-block; padding: 3px 8px; margin-inline-start: 6px; background: var(--quiet); color: var(--muted); font-size: 13px; border-radius: 6px; vertical-align: middle; }
.results-actions { display: flex; align-items: stretch; flex-wrap: wrap; gap: 10px; }
#batchOpenBtn { color: var(--teal); border-color: var(--soft-line); }
#resetVisitsBtn { background: transparent; }
.batch-status { font-size: 14px; color: var(--muted); margin: 12px 0 16px; }
.cid-table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; background: var(--white); }
.cid-table-wrap table { width: 100%; border-collapse: collapse; }
.cid-table-wrap th, .cid-table-wrap td { padding: 14px 16px; text-align: start; border-bottom: 1px solid var(--line); font-size: 14px; }
.cid-table-wrap th { background: var(--quiet); color: var(--muted); font-size: 13px; font-weight: 650; }
.cid-table-wrap tbody tr:last-child td { border-bottom: 0; }
.cid-table-wrap tbody tr:hover { background: var(--hover); }
.cid-table-wrap td:first-child { color: var(--muted); font-size: 13px; }
.cid-label { display: block; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.cid-num { font-size: 12px; color: var(--muted); }
.region-tag { display: inline-block; font-size: 12px; padding: 4px 8px; background: var(--quiet); border-radius: 6px; color: var(--muted); }
.open-link { font-size: 14px; padding-inline: 12px; }
.open-link[aria-disabled="true"] { color: var(--muted); cursor: not-allowed; }
.visited-mark { display: inline; font-size: 12px; color: var(--teal); margin-inline-start: 8px; }
.empty-state { padding: 36px 24px; min-height: 190px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); background: var(--field); }
.empty-icon { display: block; margin-bottom: 14px; }
.empty-icon svg { display: block; width: 44px; height: 44px; margin: auto; color: var(--muted); }
.empty-state p { font-size: 15px; line-height: 1.8; }
.prose { max-width: 880px; margin: auto; padding: 36px 32px 56px; }
.prose h2 { margin: 32px 0 12px; font-size: 20px; line-height: 1.5; overflow-wrap: anywhere; }
.prose p, .prose li { font-size: 16px; line-height: 1.9; color: var(--muted); margin-bottom: 12px; overflow-wrap: anywhere; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose strong { color: var(--ink); }
.notice-box { background: var(--soft); border: 1px solid var(--soft-line); border-radius: 10px; padding: 20px; margin: 20px 0 28px; font-size: 15px; color: var(--soft-ink); line-height: 1.85; }
.updated { display: block; color: var(--muted); font-size: 14px; }
@media (max-width: 900px) {
  .hero { padding-block: 40px; }
  .hero-inner { gap: 32px; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .hero h1 { font-size: 36px; }
  .comparison-guide { padding: 24px; }
  .steps-list { gap: 24px; }
  .feature-grid { gap: 16px; }
  .feature-card { padding: 20px; }
}
@media (max-width: 700px) {
  .hero-inner { grid-template-columns: minmax(0,1fr); }
  .steps-list, .feature-grid { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .hero-text { padding: 0; }
  .hero-desc { max-width: none; }
  .hero-cta > a, .hero-cta > button { flex: 1 1 100%; }
}
@media (max-width: 640px) {
  .hero, .how, .features, .privacy-banner { padding-inline: 20px; }
  .hero { padding-block: 28px; }
  .hero-inner { gap: 28px; }
  .steps-list, .feature-grid { gap: 18px; }
  .hero h1 { font-size: 34px; }
  .hero-desc { font-size: 16px; }
  .comparison-guide, .feature-card { padding: 18px; }
  .comparison-guide h2 { font-size: 23px; }
  .how, .features { padding-block: 28px; }
  .how h2, .features h2 { font-size: 25px; margin-bottom: 24px; }
  .privacy-banner { padding-block: 24px; }
  .page-wrap, .prose { padding: 28px 20px 48px; }
  .page-header h1, .prose h1 { font-size: 28px; }
  .page-header p br { display: none; }
  .input-card { padding: 18px; }
  .input-row { flex-direction: column; align-items: stretch; gap: 16px; }
  .input-row > label { max-width: none; }
  .input-row .btn-primary { max-width: none; width: 100%; margin: 0; }
  .notice-banner, .progress-tip { padding: 16px; }
  .results-actions { width: 100%; }
  .results-actions > button { flex: 1 1 140px; }
  .cid-table-wrap { border: 0; overflow: visible; background: none; }
  .cid-table-wrap table, .cid-table-wrap tbody { display: block; }
  .cid-table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #linkBody tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(88px,.4fr); gap: 8px 12px; padding: 16px; margin-bottom: 12px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
  #linkBody td { min-width: 0; padding: 0; border: 0; }
  #linkBody td:first-child { display: none; }
  #linkBody td:nth-child(2) { grid-column: 1; grid-row: 1; }
  #linkBody td:nth-child(3) { grid-column: 1; grid-row: 2; }
  #linkBody td:nth-child(4) { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .open-link { width: 100%; }
  .visited-mark { margin: 6px 0 0; overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  .hero, .how, .features, .privacy-banner { padding-inline: 16px; }
  .page-wrap, .prose { padding-inline: 16px; }
  .input-card, .comparison-guide, .feature-card { padding: 16px; }
  #linkBody tr { grid-template-columns: minmax(0,1fr); }
  #linkBody td:nth-child(4) { grid-column: 1; grid-row: 3; }
  .open-link { width: auto; margin-top: 4px; }
}

/* Long translations may wrap inside the existing grid; control text stays readable. */
.step-body{min-width:0;overflow-wrap:anywhere}

/* Catalogue failure stays readable; no page masking or layout overlay. */
.translation-unavailable { margin-block: 16px; padding: 12px 16px; border: 1px solid var(--soft-line); border-radius: 8px; background: var(--soft); color: var(--soft-ink); font-size: 14px; line-height: 1.7; }

/* Keep translated help and navigation usable in narrow windows and at text zoom. */
.site-footer-inner > span, .extension-tools > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.code-copy button { flex-shrink: 0; }
.prose li > a, .page-wrap > a { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 44px; max-width: 100%; }

/* Plain section headings and text columns keep the focus on the comparison flow. */
.extension-status { min-block-size: 3.5em; }
.comparison-guide { border-top-width: 1px; border-radius: 8px; box-shadow: none; }
.comparison-guide li > .guide-number::before { background: none; border-radius: 0; color: var(--muted); }
.feature-grid { gap: 24px; }
.feature-card { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
.privacy-banner { background: none; border-color: var(--line); }
@media (min-width: 701px) {
  .feature-card + .feature-card { border-inline-start: 1px solid var(--line); padding-inline-start: 24px; }
}
@media (max-width: 700px) {
  .feature-card + .feature-card { border-top: 1px solid var(--line); padding-top: 20px; }
}

/* Balance only the error-page title; long translations can still wrap safely. */
.not-found-title { text-wrap: balance; overflow-wrap: anywhere; }

/* Mobile density: retain full text and touch targets while grouping related actions. */
@media (max-width: 640px) {
  #linkBody tr { margin-bottom: 8px; }
}
@media (max-width: 360px) {
  .hero h1 { margin-block: 8px 16px; }
  .hero-cta { margin-top: 16px; }
  .results-actions > button { flex-basis: 120px; }
  #linkBody tr { grid-template-columns: minmax(0,1fr) minmax(88px,1fr); }
  #linkBody td:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  #linkBody td:nth-child(3) { grid-column: 1; grid-row: 2; align-self: center; }
  #linkBody td:nth-child(4) { grid-column: 2; grid-row: 2; }
  #linkBody .region-tag { max-width: 100%; overflow-wrap: anywhere; }
  .open-link { width: 100%; margin-top: 0; }
}

/* Mobile actions precede long introductory copy; desktop keeps its established order. */
@media (max-width: 640px) {
  .hero-text { display: flex; flex-direction: column; }
  .hero-cta { order: 0; margin-top: 0; }
  .hero h1 { order: 1; margin-block: 16px; }
  .hero-desc { order: 2; }
  .extension-support { order: 3; }
  .result-range { margin-block: 12px 8px; color: var(--muted); font-size: 14px; }
  .result-navigation { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-block: 8px 16px; }
  .result-navigation > * { min-width: 0; max-width: 100%; min-height: 44px; }
  .result-navigation select { width: 100%; padding: 8px 10px; border: 1px solid var(--teal); border-radius: 9px; background: var(--white); color: var(--ink); font-size: 16px; }
}
