:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #666;
  --line: #dedede;
  --soft: #f6f6f6;
  --accent: #155eef;
  --accent-hover: #104bc2;
  --danger: #b42318;
  --success: #067647;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: var(--ink); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, input { font: inherit; }

.site-header {
  min-height: 66px;
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 9px; font-size: 1.05rem; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 7px; font-size: .9rem; }
.header-note { color: var(--muted); font-size: .85rem; }
main, footer { width: min(100% - 32px, 760px); margin-inline: auto; }
.download-section { padding: 64px 0 48px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: .75rem; line-height: 1.2; font-weight: 800; letter-spacing: .12em; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.035em; }
h1 { margin: 0; font-size: clamp(2.25rem, 8vw, 4.1rem); }
h2 { margin: 0 0 18px; font-size: clamp(1.55rem, 4vw, 2rem); }
h3 { margin: 26px 0 6px; font-size: 1.1rem; }
.intro { max-width: 650px; margin: 16px 0 28px; color: #444; font-size: 1.08rem; }

.download-form { padding: 20px; background: var(--soft); border: 1px solid #e3e3e3; border-radius: 12px; }
.download-form label { display: block; margin-bottom: 7px; font-weight: 700; }
.input-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
input { min-width: 0; height: 50px; padding: 0 14px; background: #fff; color: var(--ink); border: 1px solid #b9b9b9; border-radius: 8px; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(21, 94, 239, .13); }

button, .download-link { min-height: 50px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent; font-weight: 750; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
button .fas, .download-link .fas { margin-right: 7px; }
.primary-button, .download-link { background: var(--accent); color: #fff; }
.primary-button:hover, .download-link:hover { background: var(--accent-hover); }
.secondary-button { background: #fff; border-color: #b9b9b9; color: var(--ink); }
.secondary-button:hover { background: #eee; }
button:disabled { opacity: .62; cursor: wait; }
.form-help { margin: 8px 0 0; color: var(--muted); font-size: .83rem; }
.message { min-height: 0; margin-top: 0; font-size: .92rem; font-weight: 650; }
.message:not(:empty) { margin-top: 10px; }
.message.error { color: var(--danger); }
.message.success { color: var(--success); }

.results { margin-top: 16px; }
.result-card { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.result-card + .result-card { margin-top: 10px; }
.result-card.no-thumbnail { grid-template-columns: 1fr; }
.result-card img { width: 112px; aspect-ratio: 9 / 12; object-fit: cover; background: var(--soft); border-radius: 7px; }
.result-card .result-name { margin: 0; font-weight: 750; overflow-wrap: anywhere; }
.result-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 3px 0 12px; color: var(--muted); font-size: .82rem; }
.result-meta span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 8px 2px 0; background: #aaa; border-radius: 50%; }
.download-link { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }

.content-section { padding: 44px 0; border-top: 1px solid var(--line); }
.content-section p { color: #3f3f3f; }
.steps { padding-left: 22px; }
.steps li { margin: 0 0 12px; padding-left: 6px; }
.keyword-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.keyword-grid span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; color: #4a4a4a; font-size: .84rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { padding: 17px 2px; cursor: pointer; font-weight: 720; }
.faq details p { margin: -3px 0 18px; padding-right: 20px; }
footer { padding: 32px 0 50px; border-top: 1px solid var(--line); }
footer p { margin: 0 0 8px; }
.legal { color: var(--muted); font-size: .78rem; line-height: 1.55; }

.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.admin-main { width: min(100% - 32px, 960px); }
.admin-panel { padding: 58px 0; }
.admin-panel h1 { font-size: clamp(2rem, 6vw, 3rem); }
.admin-login { max-width: 600px; margin-top: 26px; }
.admin-input-row { grid-template-columns: 1fr auto; }
.admin-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.admin-heading h1 { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 26px 0 46px; }
.stat-card { padding: 16px; border: 1px solid var(--line); border-radius: 9px; }
.stat-card span { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.stat-card strong { display: block; margin-top: 8px; font-size: 1.65rem; letter-spacing: -.04em; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--soft); color: #444; font-size: .78rem; }
tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-heading { align-items: flex-start; }
}

@media (max-width: 640px) {
  .site-header { padding-inline: 16px; }
  .header-note { display: none; }
  main, footer { width: min(100% - 28px, 760px); }
  .download-section { padding: 42px 0 36px; }
  .input-row { grid-template-columns: 1fr auto; }
  .input-row input { grid-column: 1 / -1; }
  .primary-button { grid-column: 1 / 2; grid-row: 2; }
  .secondary-button { grid-column: 2 / 3; grid-row: 2; }
  .admin-input-row .primary-button { grid-column: 2 / 3; grid-row: 1; }
  .admin-input-row input { grid-column: 1 / 2; }
  .content-section { padding: 36px 0; }
}

@media (max-width: 420px) {
  .result-card { grid-template-columns: 82px 1fr; gap: 12px; }
  .result-card img { width: 82px; }
  .download-link { padding-inline: 13px; }
  .admin-input-row { grid-template-columns: 1fr; }
  .admin-input-row input, .admin-input-row .primary-button { grid-column: 1; grid-row: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
