/* Shared semantic tokens; the site follows the system theme. */

/* tokens */

/* Generated from extension/shared/palette.js; run the existing build scripts. */

:root {
  --bg: #FFFFFF;
  --card: #F7F7FA;
  --text: #1A1A22;
  --text-soft: #6D6D79;
  --border: #ECECF2;
  --accent: #6959D6;
  --accent-soft: #EFEDFF;
  --on-accent: #FFFFFF;
  --focus: #6959D6;
  --ok: #237A46;
  --ok-soft: #E4F4EA;
  --warn: #876019;
  --warn-soft: #FBF1DE;
  --bad: #B8413D;
  --bad-soft: #FBE9E8;
  --muted: #8A8A95;
  --badge: #7C6CF0;
  --on-badge: #16161D;
  --on-overlay: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161D;
    --card: #1F1F2A;
    --text: #F2F2F7;
    --text-soft: #9A9AA5;
    --border: #2A2A36;
    --accent: #9B8CFF;
    --accent-soft: #2A2440;
    --on-accent: #1A1A22;
    --focus: #9B8CFF;
    --ok: #31A660;
    --ok-soft: #1C2E24;
    --warn: #E0A33E;
    --warn-soft: #33291A;
    --bad: #FF7B7B;
    --bad-soft: #33201F;
    --muted: #9A9AA5;
    --badge: #7C6CF0;
    --on-badge: #16161D;
    --on-overlay: #FFFFFF;
  }
}

/* end tokens */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Flex column layout keeps the footer at the bottom of short pages; this is not position:fixed. */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg);
  min-height: 100dvh; display: flex; flex-direction: column;
}

/* Page content container; restricts content width with responsive horizontal padding. */
.container {
  max-width: 1080px;
  margin-inline: auto;
  width: 100%;
  padding-inline: 24px;
  box-sizing: border-box;
}
@media (max-width: 720px) {
  .container { padding-inline: 16px; }
}

main { flex: 1 0 auto; padding-block: 20px 32px; }

/* Site header and navigation. Mobile menu and desktop rules depend on media queries. */
.site-head { background: var(--bg); border-bottom: 1px solid var(--border); }
.site-head-in { display: flex; align-items: center; gap: 16px; padding-block: 12px; position: relative; }
.logo { font-weight: 800; font-size: 18px; color: var(--accent); text-decoration: none; letter-spacing: .3px; }
.logo { display: inline-flex; align-items: center; gap: 8px; line-height: 1; }
.brand-icon { width: 32px; height: 32px; flex: none; display: block; }
.logo[data-home-hint] { position: relative; }
.logo[data-home-hint]::after { content: attr(data-home-hint); display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 10; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 12px; font-weight: 400; letter-spacing: normal; white-space: nowrap; pointer-events: none; }
.logo[data-home-hint]:hover::after, .logo[data-home-hint]:focus-visible::after { display: block; }
.site-nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.site-nav a { color: var(--text-soft); text-decoration: none; font-weight: 600; }
.site-nav a:hover { color: var(--accent); }
.site-nav a.active { color: var(--accent); }
.nav-privacy { display: none; }
.nav-burger { display: none; border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 10px; width: 44px; height: 44px; font-size: 20px; line-height: 1; cursor: pointer; margin-left: auto; }
.nav-burger-glyph { display: block; }
@media (max-width: 720px) {
  .nav-burger { display: block; }
  .site-nav { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
    flex-direction: column; gap: 0; background: var(--bg); border: 1px solid var(--border);
    border-radius: 14px; padding: 6px; margin: 0; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
  .site-nav.open { display: flex; }
  .site-nav a { min-height: 44px; display: flex; align-items: center; padding: 0 12px; font-size: 15px; border-radius: 10px; }
}

/* Site footer */
.site-foot { margin-top: auto; background: var(--bg); border-top: 1px solid var(--border); }
.site-foot-in { padding-block: 20px; display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 15px; color: var(--text-soft); }
.site-foot a { color: var(--accent); text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }

/* Static page typography and layout blocks */
h1 { font-size: 30px; margin-bottom: 10px; line-height: 1.2; }
@media (min-width: 900px) { h1 { font-size: 38px; } }
h2 { margin: 40px 0 14px; font-size: 20px; }
p.lead { font-size: 16px; color: var(--text-soft); margin-bottom: 16px; max-width: 640px; }
.sub { font-size: 15px; color: var(--text-soft); margin: 12px 0 0; }
.sub a { color: var(--accent); font-weight: 600; }
.btn { display: inline-block; padding: 13px 26px; background: var(--accent); color: var(--on-accent);
       border-radius: 12px; text-decoration: none; font-weight: 700; }
.btn:hover { filter: brightness(1.08); }
ol, ul { margin: 0 0 8px 20px; color: var(--text-soft); }
ol li, ul li { margin-bottom: 6px; }

/* Hero section and example card container */
.hero { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 900px) { .hero { flex-direction: row; align-items: center; gap: 28px; } }
.demo { flex: none; width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--border);
        border-radius: 14px; padding: 14px 16px; }
@media (min-width: 900px) { .demo { width: 360px; } }
@media (max-width: 720px) { .demo { max-width: 100%; } }
.demo-caption { font-size: 12px; color: var(--text-soft); margin: 0 0 8px; }

/* Unified device card styles (used across hero demo and /v/:videoId).
   Wraps long values to avoid horizontal overflow. */
.dc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dc-cat { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.dc-name { font-weight: 700; font-size: 16px; margin-bottom: 2px; color: var(--text); }
.dc-brand { font-size: 13px; color: var(--text-soft); }
.dc-specs { margin-top: 8px; }
.dc-specs-title { font-size: 12px; font-weight: 700; color: var(--text-soft); margin-bottom: 6px; }
.dc-spec { font-size: 13px; line-height: 1.45; margin-bottom: 3px; color: var(--text);
  overflow-wrap: anywhere; }
.dc-spec-label { color: var(--text-soft); }
.dc-spec-value { color: var(--text); }
.dc-specs-other { font-size: 12px; font-weight: 700; color: var(--text-soft); margin: 8px 0 4px; }

/* Recent analyses card grid and cards. Truncates long titles with webkit-line-clamp. */
.latest-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
.latest-card { display: flex; flex-direction: row; align-items: flex-start; gap: 10px;
               background: var(--card); border: 1px solid var(--border); border-radius: 14px;
               padding: 10px; text-decoration: none; color: var(--text); height: auto; }
.latest-card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(124, 108, 240, .14); }
.latest-card:focus-visible { border-color: var(--accent); }
.latest-card img { width: 112px; flex: none; aspect-ratio: 16 / 9; height: auto; object-fit: cover;
                   border-radius: 10px; display: block; background: var(--accent-soft); }
.latest-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.latest-card h3 { font-size: 14px; line-height: 1.35; margin-bottom: 4px; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.latest-card p.meta { font-size: 12px; color: var(--text-soft); margin-top: auto; }
.latest-card .meta-count { color: var(--text-soft); font-weight: 600; }
.latest-card .meta-date { color: var(--text-soft); }
.latest-card .found { font-size: 12px; color: var(--text-soft); margin-top: 3px; overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .latest-row { grid-template-columns: repeat(3, 1fr); }
}
.howto-steps { color: var(--text-soft); font-size: 15px; margin: 0; }
.home h2 { margin: 20px 0 10px; }
.home .latest-head { margin: 20px 0 10px; }
.about p { color: var(--text-soft); font-size: 15px; margin-bottom: 10px; max-width: 720px; }
.install-steps { margin-top: 18px; }
.install-note { margin-top: 14px; font-size: 15px; color: var(--text-soft); }

/* SSR analysis pages (/v/:videoId, /articles/) */
.vp-back { display: inline-block; margin: 0 0 14px; font-size: 14px; font-weight: 600;
  color: var(--accent); text-decoration: none; }
.vp-back:hover { text-decoration: underline; }
.vp-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
@media (min-width: 900px) { .vp-head { flex-direction: row; align-items: flex-start; gap: 20px; } }
.vp-thumb { flex: none; width: 200px; max-width: 100%; margin: 0; }
.vp-thumb img { width: 100%; height: auto; display: block; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card); }
.vp-thumb figcaption { font-size: 12px; color: var(--text-soft); margin-top: 6px; }
.vp-head-info { display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  min-width: 0; flex: 1; }
h1.vp-h1 { font-size: 22px; margin: 0; }
.vp-meta { color: var(--text-soft); font-size: 13px; margin: 0; }
.vp-intro { color: var(--text-soft); font-size: 14px; margin: 0 0 18px; }
.vp-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .vp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vp-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
a.vp-card { display: block; text-decoration: none; color: var(--text); }
a.vp-card:hover { border-color: var(--accent); }
.dc-conf { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.vp-yt-btn { align-self: flex-start; display: inline-block; background: var(--accent);
  color: var(--on-accent); padding: 9px 16px; border-radius: 10px; font-size: 13px;
  font-weight: 700; text-decoration: none; }
.vp-yt-btn:hover { filter: brightness(1.08); }
.vp-notfound { text-align: center; padding: 60px 0; }
.vp-notfound h1 { font-size: 20px; margin-bottom: 10px; }
.vp-notfound a { color: var(--accent); }

/* Catalog filters and layout */
.vp-tools { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; }
.vp-search-form { display: flex; }
.vp-search-form .vp-search { flex: 1; }
a.vp-chip-btn { display: inline-block; text-decoration: none; }

/* Sticky control panel above the catalog: top:0 pins it while the site header scrolls away. */
.vp-panel { position: sticky; top: 0; z-index: 30; background: var(--bg);
  padding: 10px 0; margin: 0 0 14px; border-bottom: 1px solid var(--border); }
.vp-count-slot { margin: 0; }
.vp-pager-slot { margin: 8px 0 0; }
.vp-pager-slot:empty { margin: 0; }
/* Loading state dims elements and disables pointer events on buttons; does not intercept keyboard navigation. */
.vp-loading { opacity: .55; }
.vp-panel.vp-loading .vp-page, .vp-panel.vp-loading .vp-size { pointer-events: none; }
.vp-count-row { display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px 16px; }
.vp-total { font-size: 13px; color: var(--text-soft); }
.vp-size-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vp-size-label { font-size: 13px; color: var(--text-soft); }
.vp-size { height: 40px; min-height: 40px; padding: 0 12px; font-size: 13px;
  font-weight: 600; color: var(--text); background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.vp-size:hover { border-color: var(--accent); }
.vp-size:focus-visible { border-color: var(--accent); outline: 2px solid var(--focus);
  outline-offset: 2px; }
.vp-size-go { height: 40px; min-height: 40px; padding: 0 14px; font-size: 13px;
  font-weight: 600; color: var(--accent); background: var(--card);
  border: 1px solid var(--accent); border-radius: 10px; cursor: pointer; }
.vp-size-go:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 560px) {
  .vp-count-row { justify-content: flex-start; row-gap: 10px; }
  .vp-size-form { width: 100%; justify-content: space-between; }
}

/* Pagination controls */
.vp-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0; }
.vp-page { display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; min-height: 40px; padding: 0 14px; text-decoration: none;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  color: var(--text); font-size: 14px; font-weight: 600; line-height: 1; }
.vp-page:hover { color: var(--accent); border-color: var(--accent); }
.vp-page:focus-visible { border-color: var(--accent); outline: 2px solid var(--focus);
  outline-offset: 2px; }
.vp-page-current, .vp-page-current:hover { background: var(--accent);
  border-color: var(--accent); color: var(--on-accent); }
.vp-page-prev, .vp-page-next { padding: 0 16px; }
.vp-page-off, .vp-page-off:hover { background: var(--card); border-color: var(--border);
  color: var(--text-soft); opacity: .38; cursor: default;
  pointer-events: none; user-select: none; }
.vp-page-gap { display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; min-height: 40px; font-size: 14px; color: var(--text-soft); }
@media (max-width: 480px) {
  .vp-page { padding: 0 10px; font-size: 13px; }
  .vp-page-prev, .vp-page-next { padding: 0 12px; }
}
.vp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vp-chip-btn { border: 1px solid var(--border); background: var(--card); color: var(--text-soft);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.vp-chip-btn:hover { color: var(--accent); border-color: var(--accent); }
.vp-chip-btn.vp-chip-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.vp-search { border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 10px; padding: 8px 12px; font-size: 14px; width: 100%; }

/* Catalog card grid. Minimum height uses server CSS variables --vp-rows-1 and --vp-rows-2.
   grid-auto-rows:auto and align-content:start keep cards at natural content height instead of expanding across reserved height. */
.vp-catalog { display: grid; grid-template-columns: 1fr; gap: 12px;
  grid-auto-rows: auto; align-content: start; --vp-row-h: 104px;
  min-height: calc(var(--vp-rows-1, 8) * var(--vp-row-h) + (var(--vp-rows-1, 8) - 1) * 12px); }
@media (min-width: 900px) { .vp-catalog { grid-template-columns: 1fr 1fr;
  min-height: calc(var(--vp-rows-2, 4) * var(--vp-row-h) + (var(--vp-rows-2, 4) - 1) * 12px); } }

.vp-cat-card { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px; text-decoration: none; color: var(--text); }
.vp-cat-card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(124, 108, 240, .14); }
.vp-cat-card:focus-visible { border-color: var(--accent); }
/* Thumbnail container maintains a 16:9 ratio; align-self:flex-start prevents stretching inside the flex card. */
.vp-cat-thumb-wrap { flex: none; width: 132px; aspect-ratio: 16 / 9; align-self: flex-start;
  border-radius: 10px; background: var(--accent-soft); overflow: hidden; }
.vp-cat-thumb { width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: 10px; background: var(--accent-soft); }
.vp-cat-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.vp-cat-title { font-weight: 700; font-size: 14px; line-height: 1.35; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.vp-cat-meta { font-size: 12px; color: var(--text-soft); }
.vp-cat-meta .vp-cat-count { color: var(--text-soft); font-weight: 600; }
.vp-cat-meta .vp-cat-date { color: var(--text-soft); }
.vp-cat-found { font-size: 12px; color: var(--text-soft); display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.vp-cat-open { font-size: 12px; font-weight: 700; color: var(--accent); }

/* Focus indicator for keyboard navigation */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.latest-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 40px 0 14px; }
.latest-head h2 { margin: 0; }
.latest-all { color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; margin-left: auto; }
.latest-all:hover { text-decoration: underline; }

.hero-right { display: flex; flex-direction: column; gap: 12px; align-items: center; }
@media (min-width: 900px) { .hero-right { align-items: flex-end; } }
.hero-right:has(.hero-shot) .demo { display: none; }
.hero-shot { flex: none; width: 100%; max-width: 320px; margin: 0; }
.hero-shot img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border);
  background: var(--card); cursor: zoom-in; display: block; }
.hero-shot figcaption { font-size: 12px; color: var(--text-soft); margin-top: 8px; text-align: center; }

/* Screenshot lightbox overlay */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 10, 14, 0.82);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox img { max-width: min(94vw, 1200px); max-height: 88vh; width: auto; height: auto;
  border-radius: 12px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5); }
.lightbox-close { position: absolute; top: 14px; right: 18px; width: 44px; height: 44px;
  border: none; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: var(--on-overlay);
  font-size: 24px; line-height: 1; cursor: pointer; }
.lightbox-close:focus-visible { outline-color: var(--on-overlay); }
.lightbox-close:hover { background: rgba(255, 255, 255, 0.24); }

/* About section.
   Text link colors exclude .btn via :not(.btn) to avoid overriding button text styles. */
.about { max-width: 720px; }
.about h2 { margin: 28px 0 10px; }
.about a:not(.btn) { color: var(--accent); text-decoration: none; }
.about a:not(.btn):hover { text-decoration: underline; }
.about a:not(.btn):visited { color: var(--accent); }
.about-contact { margin-top: 20px; padding: 12px 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn-ghost { display: inline-block; padding: 13px 26px; border-radius: 12px; font-weight: 700;
  text-decoration: none; color: var(--accent); border: 1px solid var(--accent); background: transparent; }
.btn-ghost:hover { background: var(--accent-soft); }

/* Extension install guide */
.install-wrap { max-width: 720px; }
.install-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 6px 0 4px; }
.btn-lg { padding: 15px 32px; font-size: 16px; }
.install-for { font-size: 13px; color: var(--text-soft); }
.install-steps { margin-top: 22px; }
.install-steps li { margin-bottom: 16px; }
.install-steps h3 { font-size: 15px; margin-bottom: 4px; color: var(--text); }
.install-steps p { color: var(--text-soft); }
.install-steps code { background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  padding: 1px 6px; font-size: 13px; user-select: all; }
.copy-btn { border: 1px solid var(--border); background: var(--card); color: var(--accent);
  border-radius: 8px; padding: 3px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
  margin-left: 6px; }
.copy-btn:hover { border-color: var(--accent); }
.install-copy-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; }
.install-copy-row .copy-btn { margin-left: 0; }
.install-shot-wrap { margin: 10px 0 0; }
.install-shot { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border);
  display: block; cursor: zoom-in; }
.install-shot-wrap figcaption { font-size: 12px; color: var(--text-soft); margin-top: 8px; }
.install-popup { margin: 22px 0 0; max-width: 360px; }
.install-popup img { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); display: block; }
.install-popup figcaption { font-size: 12px; color: var(--text-soft); margin-top: 8px; }
.install-help { margin-top: 24px; font-size: 14px; color: var(--text-soft); }
.install-help a { color: var(--accent); }

/* Notice displayed using hover and pointer interaction media features, not viewport width or phone detection. */
.mobile-notice { display: none; }
@media (hover: none) and (pointer: coarse) {
  .mobile-notice { display: block; margin: 0 0 18px; padding: 14px 16px; background: var(--card);
    border: 1px solid var(--border); border-radius: 14px; }
  .mobile-notice p { color: var(--text-soft); font-size: 14px; margin-bottom: 10px; }
}

/* Shared footer identity; only the product name is bold. */
.site-credit { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.site-credit img { display: block; width: 20px; height: 20px; flex: none; }
.site-credit strong { font-weight: 700; }
/* Neutral placeholders stay visible until the matching image has loaded. */
.latest-placeholder { min-height: 86px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.latest-thumb { display: block; flex: none; width: 112px; aspect-ratio: 16 / 9; background: var(--border); border-radius: 10px; overflow: hidden; }
.latest-thumb img { width: 100%; height: 100%; border-radius: 0; background: transparent; }
.site-thumbs-ready [data-video-thumb] { opacity: 0; }
.site-thumbs-ready [data-video-thumb][data-loaded] { opacity: 1; }
.dc-head { justify-content: space-between; align-items: flex-start; }
.dc-cat { min-width: 0; overflow-wrap: anywhere; }
.dc-confidence { position: relative; flex: none; margin-left: auto; }
.dc-conf { list-style: none; cursor: help; white-space: nowrap; border-radius: 999px; padding: 2px 6px; background: var(--card); }
.dc-conf::-webkit-details-marker { display: none; }
.dc-confidence-help { display: none; position: absolute; right: 0; top: 100%; z-index: 5; width: 220px; max-width: calc(100vw - 48px); padding: 8px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; }
.dc-confidence[open] .dc-confidence-help, .dc-confidence:hover .dc-confidence-help, .dc-confidence:focus-within .dc-confidence-help { display: block; }
