:root {
  color-scheme: light;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0f172a;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
}

main,
body > * {
  width: 100%;
  max-width: 640px;
}

.nw-header {
  text-align: center;
  margin-bottom: 16px;
}

.nw-header h1 {
  font-size: 26px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.nw-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.ad-slot {
  width: 100%;
  min-height: 70px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 14px;
  margin: 12px 0 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.label {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 4px;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
  border-color: #94a3b8;
  outline: none;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.25);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.button:hover:not(:disabled) {
  opacity: 0.85;
}

.button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.separator {
  width: 100%;
  height: 1px;
  background: var(--border);
}

.progress {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #0f172a;
  text-align: center;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #f1f1f3;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  width: 40%;
  height: 100%;
  background: #111;
  animation: progress-indeterminate 1.2s infinite linear;
}

@keyframes progress-indeterminate {
  from { transform: translateX(-100%); }
  to   { transform: translateX(200%); }
}

.result-card {
  margin-top: 20px;
}

.result-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 0;
}

.result-row strong {
  color: var(--muted);
  font-size: 14px;
}

.result-row p {
  margin: 0;
  word-break: break-all;
}

.ogp-img {
  max-width: 180px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 6px;
  background: #fff;
  margin: 0 auto;
  object-fit: contain;
}

.reset-btn {
  width: 100%;
  background: #f7f7f8;
  color: #111;
}

.nw-lang-switch {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 8px 0;
  font-weight: 600;
}

.nw-lang-switch button {
  border: none;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.nw-lang-switch button.active,
.nw-lang-switch button:hover {
  background: #e2e8f0;
}

.nw-howto {
  text-align: center;
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.faq-block {
  margin: 24px 0 12px;
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.faq-block p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.55;
}

.faq-block strong {
  font-weight: 600;
  color: var(--text);
}

.nw-donate {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.nw-donate-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.nw-donate-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.donate-btn {
  min-width: 110px;
}

.donate-btn {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #111111;
  border-radius: 8px;
  padding: 8px 14px;
  display: inline-block;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
}

.donate-btn:hover {
  background: #f3f4f6;
}

.nw-donate-links a {
  text-decoration: none;
}

.nw-links {
  margin: 18px 0 10px;
  text-align: center;
  color: var(--muted);
}

.nw-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.nw-links a:hover {
  text-decoration: underline;
}

.nw-footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.nw-footer a {
  color: var(--accent);
  text-decoration: none;
}

.error-text {
  color: #b91c1c;
  margin: 4px 0 0;
  min-height: 18px;
  font-size: 13px;
}

[data-i18n] {
  display: none;
}

.lang-ja [data-i18n="ja"],
.lang-en [data-i18n="en"] {
  display: block;
}

@media (max-width: 480px) {
  body {
    padding: 20px 14px 40px;
  }

  .card,
  .faq-block,
  .nw-donate {
    padding: 16px;
  }
}
