:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #5b6472;
  --border: #e4e7ec;
  --primary: #4338ca;
  --primary-dark: #3730a3;
  --accent: #f97316;
  --accent-dark: #ea580c;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 10px 0 22px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.brand-mark svg { width: 26px; height: 26px; }

h1 {
  font-size: clamp(2rem, 7vw, 2.6rem);
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-tagline {
  font-size: clamp(1.2rem, 4.5vw, 1.45rem);
  font-weight: 750;
  margin: 0 0 8px;
  color: var(--primary);
}

.hero-sub {
  max-width: 460px;
  margin: 0 auto 14px;
  color: var(--muted);
  font-size: 1rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 18px;
}

.hero-meta span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  background: #eef2ff;
  padding: 5px 10px;
  border-radius: 999px;
}

.cta-primary {
  display: inline-block;
  min-height: 46px;
  padding: 12px 26px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.cta-primary:hover { background: var(--accent-dark); text-decoration: none; }

/* Tool */
#tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

textarea {
  width: 100%;
  min-height: 240px;
  padding: 14px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.55;
  border: 1px solid var(--border);
  border-radius: 12px;
  resize: vertical;
  background: #fff;
  color: var(--text);
}

textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

button {
  min-height: 48px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background 0.12s ease;
}

button:hover { background: var(--accent-dark); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

button.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

button.secondary:hover { background: #f4f5f8; }

.hidden { display: none !important; }
.muted { color: var(--muted); }

.error {
  margin-top: 12px;
  padding: 11px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red);
  border-radius: 10px;
  font-size: 0.95rem;
}

#status-line { margin-top: 12px; min-height: 22px; }
.status { font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.status.synced { color: var(--green); }
.status.syncing, .status.connecting { color: var(--muted); }
.status.dirty { color: var(--amber); }
.status.remote { color: var(--primary); }

#result-box {
  margin-top: 16px;
  padding: 14px;
  background: #eef2ff;
  border: 1px solid #dfe5ff;
  border-radius: 12px;
}

.id-line { margin: 0 0 6px; font-size: 1rem; }
#result-box .id-line strong {
  font-size: 1.35rem;
  color: var(--primary);
  letter-spacing: 1.5px;
}
.hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 12px; }

#connect-view {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

#connect-view h2 { margin: 0 0 4px; font-size: 1.15rem; }

.sync-row {
  display: flex;
  gap: 10px;
  max-width: 400px;
  margin-top: 12px;
}

.sync-row input {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  padding: 10px 12px;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  text-transform: lowercase;
  letter-spacing: 1.5px;
  border: 2px solid var(--border);
  border-radius: 12px;
}

.sync-row input:focus {
  outline: none;
  border-color: var(--primary);
}

.share-banner {
  text-align: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 10px 12px;
  border-radius: 10px;
}

#share-view textarea { min-height: 280px; margin-top: 12px; }

/* SEO content */
.seo-content { margin-top: 36px; }

.seo-content h2 {
  font-size: 1.4rem;
  margin: 36px 0 14px;
  letter-spacing: -0.02em;
}

.seo-content p { color: var(--text); }

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.steps li {
  position: relative;
  margin: 10px 0;
  padding-left: 40px;
  min-height: 30px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 8px;
}

.feature-list,
.related-list {
  margin: 0 0 12px;
  padding-left: 22px;
}

.feature-list li,
.related-list li { margin: 6px 0; }

/* Feature cards */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.feature-card svg {
  width: 26px;
  height: 26px;
  color: var(--primary);
}

.feature-card h3 {
  margin: 10px 0 4px;
  font-size: 1rem;
  line-height: 1.3;
}

.feature-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* FAQ */
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 10px 0;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
}

.faq-item p { margin: 10px 0 0; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.cta {
  display: inline-block;
  margin: 12px 0;
  padding: 13px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  font-weight: 700;
}

.cta:hover { background: var(--accent-dark); text-decoration: none; }

/* SEO pages */
.breadcrumb {
  margin: 0 0 22px;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

/* Footer */
footer { margin-top: 40px; }

.notice {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 12px 0 0;
  font-size: 0.85rem;
}

.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--primary); }

.contact-line {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.contact-line a {
  color: var(--muted);
  text-decoration: underline;
}

.contact-line a:hover { color: var(--primary); }

@media (min-width: 560px) {
  .actions { grid-template-columns: auto auto auto; }
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}
