:root {
  --color-primary: #195fd7;
  --color-primary-dark: #1349a8;
  --color-secondary: #0f172a;
  --color-bg: #ffffff;
  --color-bg-muted: #f5f7fb;
  --color-card: #ffffff;
  --color-text: #0f172a;
  --color-muted: #3d4d63;
  --color-border: #e4e9f0;
  --color-success: #0f7a4a;
  --color-success-bg: #e8f6ee;
  --color-error: #9f1239;
  --color-error-bg: #fff1f4;
  --color-warn-bg: #fff8eb;
  --color-warn: #8a4b08;
  --color-hero: #1857c8;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --container: 1120px;
  --header-h: 64px;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  --font: var(--font-inter), "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  overflow-x: clip;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--color-primary); }
button, input, textarea { font: inherit; }
[id] { scroll-margin-top: 80px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  background: #fff;
  color: var(--color-text);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 50;
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
}
.narrow { width: min(760px, calc(100% - 32px)); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo-link { color: inherit; text-decoration: none; }
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-text);
}
.logo-mark { width: 32px; height: 32px; color: var(--color-primary); }
.logo-accent { color: var(--color-primary); }
.nav-toggle {
  min-height: 40px;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
}
.nav-panel { display: none; }
.nav-panel.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 8px 16px 16px;
  gap: 4px;
}
.nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 560;
  font-weight: 600;
}
.nav-link:hover { background: var(--color-bg-muted); }
.nav-link[aria-current="page"] { color: var(--color-primary); }

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-panel,
  .nav-panel.is-open {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    border: 0;
    padding: 0;
    gap: 4px;
    background: transparent;
  }
}

.hero {
  background: var(--color-hero);
  color: #fff;
  padding: 48px 0 56px;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  text-align: center;
}
.hero-lede, .privacy-note, .clipboard-note, .field-error {
  text-align: center;
}
.hero-lede {
  margin: 0 auto 28px;
  max-width: 640px;
  font-size: 1.05rem;
}
.downloader { max-width: 760px; margin: 0 auto; }
.composer { display: flex; flex-direction: column; gap: 12px; }
.field {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  min-width: 0;
}
.field input {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  border: 0;
  border-radius: var(--radius-md);
  padding: 0 16px;
  color: var(--color-text);
  background: transparent;
  font-size: 16px;
}
.field input:focus { outline: none; }
.field:focus-within { outline: 3px solid #fff; outline-offset: 3px; }
.field-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 0 8px 8px;
}
.ghost-button, .text-button {
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-weight: 700;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.ghost-button:hover, .text-button:hover { background: #eef4ff; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:disabled { opacity: 0.65; cursor: not-allowed; }
.button-hero {
  width: 100%;
  min-height: 56px;
  background: #fff;
  color: var(--color-primary);
  box-shadow: var(--shadow);
}
.button-hero:hover:not(:disabled) { background: #f3f7ff; }
.button-primary { background: var(--color-primary); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--color-primary-dark); }
.button-secondary { background: #fff; color: var(--color-primary); border-color: var(--color-border); }
.privacy-note { color: #fff; margin: 14px 0 0; font-size: 0.95rem; }
.field-error, .clipboard-note { min-height: 0; margin: 8px 0 0; }
.field-error:not(:empty), .clipboard-note:not(:empty) {
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}
.field-error { color: var(--color-error); }
.clipboard-note { color: var(--color-success); }

.notice {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
}
.notice p { margin: 0 0 12px; }
.notice-error { background: var(--color-error-bg); color: var(--color-error); }
.notice-warn { background: var(--color-warn-bg); color: var(--color-warn); }
.notice-ok { background: var(--color-success-bg); color: var(--color-success); }
.notice-loading { display: flex; align-items: center; gap: 10px; }
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #d5e2f8;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--color-primary); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.results {
  margin-top: 20px;
  background: #fff;
  color: var(--color-text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 16px;
}
.thumb-frame {
  width: min(100%, 280px);
  aspect-ratio: 9 / 16;
  margin-inline: auto;
  background: #e8eef7;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.thumb-frame img { width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-muted);
}
.thumb-fallback svg { width: 36px; height: 36px; }
.results-body h2 { margin: 0 0 8px; font-size: 1.4rem; }
.media-title { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.media-author, .fine-print { margin: 6px 0 0; color: var(--color-muted); }
.download-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.download-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.download-link:hover { background: var(--color-primary-dark); }
.download-meta { display: flex; gap: 8px; font-size: 0.85rem; font-weight: 600; opacity: 0.9; }

@media (min-width: 768px) {
  .hero { padding: 72px 0 80px; }
  .composer { flex-direction: row; align-items: stretch; }
  .field { flex: 1; flex-direction: row; align-items: center; }
  .field-actions { padding: 0 8px 0 0; }
  .button-hero { width: auto; min-width: 148px; }
  .results { grid-template-columns: 280px 1fr; align-items: start; padding: 20px; }
  .thumb-frame { margin: 0; }
}

.section { padding: 56px 0; }
.section-muted { background: var(--color-bg-muted); }
.section h2, .inner h1 {
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.section h2 { margin: 0 0 12px; font-size: clamp(1.6rem, 3vw, 2rem); }
.section-intro { max-width: 720px; color: var(--color-muted); margin: 0 0 28px; }
.steps, .feature-grid, .card-grid, .guide-grid {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.step, .feature, .info-card, .guide-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.section-muted .step, .section-muted .feature, .section-muted .info-card { background: #fff; }
.step-index {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8f0ff;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 10px;
}
.step h3, .feature h3, .info-card h3, .guide-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.step p, .feature p, .info-card p, .guide-card p { margin: 0; color: var(--color-muted); }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.guide-card { display: block; text-decoration: none; color: inherit; }
.guide-card:hover { border-color: #b9cff6; }

@media (min-width: 768px) {
  .section { padding: 80px 0; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .feature-grid, .card-grid { grid-template-columns: repeat(3, 1fr); }
  .guide-grid { grid-template-columns: repeat(3, 1fr); }
}

.faq-list { display: grid; gap: 8px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 4px 16px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 0;
  min-height: 48px;
}
.faq-item p { margin: 0 0 14px; color: var(--color-muted); }

.site-footer {
  background: var(--color-secondary);
  color: #d7deea;
  padding: 40px 0 20px;
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer h2 { color: #fff; font-size: 0.95rem; margin: 0 0 12px; }
.footer-grid { display: grid; gap: 28px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid p { margin: 12px 0 0; max-width: 320px; }
.footer-bar { margin-top: 28px; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 16px; }
.footer-bar p { margin: 0; font-size: 0.92rem; }
.site-footer .logo { color: #fff; }
.site-footer .logo-mark { color: #8eb6ff; }
.site-footer .logo-accent { color: #8eb6ff; }
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

.inner { padding: 32px 0 72px; }
.inner h1 { margin: 8px 0 12px; font-size: clamp(2rem, 4vw, 2.8rem); }
.lede { color: var(--color-muted); font-size: 1.05rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; color: var(--color-muted); font-size: 0.92rem; }
.breadcrumb li { display: inline; }
.prose h2 { margin: 32px 0 8px; font-size: 1.35rem; }
.prose p, .prose li { color: var(--color-text); }
.prose ul, .prose ol { display: grid; gap: 8px; padding-left: 18px; }
.contact-form, .text-input { width: 100%; }
.contact-form { display: grid; gap: 8px; margin-top: 20px; }
.text-input {
  min-height: 48px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 16px;
}
textarea.text-input { min-height: 140px; resize: vertical; }
.form-intro { margin-top: 0; color: var(--color-muted); }
.honeypot { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.page-error { padding: 64px 0; }

@media (max-width: 359px) {
  .container, .narrow { width: calc(100% - 24px); }
  .download-link { flex-direction: column; align-items: flex-start; }
}
