:root {
  --brand: #22c55e;
  --brand-2: #14b8a6;
  --ink: #101c34;
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e6e8ec;
  --muted: #64748b;
  --grad: linear-gradient(135deg, #22c55e, #14b8a6);
  --radius: 16px;
  --nav-bg: rgba(247, 248, 250, 0.75);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --input-bg: #ffffff;
  --chip-bg: #ffffff;
  --ctx-toggle-bg: rgba(241, 245, 249, 0.5);
  --ctx-panel-bg: rgba(255, 255, 255, 0.6);
  --empty-bg: rgba(241, 245, 249, 0.3);
  --score-bg: #ffffff;
  --bar-bg: #eef2f6;
  --step-bg: #eef2f6;
  --feat-bg: #ffffff;
}

[data-theme="dark"] {
  --ink: #f8fafc;
  --bg: #080d16;
  --card: #111827;
  --border: #1e293b;
  --muted: #708da9;
  --nav-bg: rgba(8, 13, 22, 0.75);
  --glass-bg: rgba(17, 24, 39, 0.75);
  --input-bg: #1f2937;
  --chip-bg: #1f2937;
  --ctx-toggle-bg: rgba(31, 41, 55, 0.5);
  --ctx-panel-bg: rgba(17, 24, 39, 0.6);
  --empty-bg: rgba(31, 41, 55, 0.3);
  --score-bg: #111827;
  --bar-bg: #1f2937;
  --step-bg: #1f2937;
  --feat-bg: #111827;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { color: var(--muted); font-weight: 400; }
.sm { font-size: 12px; }
.hidden { display: none !important; }
.mt { margin-top: 20px; }

.logo-img-dot { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; }
.logo-img-big { width: 80px; height: 80px; object-fit: contain; transition: transform 0.3s ease; }
.logo-img-big:hover { transform: rotate(5deg) scale(1.05); }
.logo-big-wrap { display: flex; justify-content: center; margin-bottom: 22px; }
.logo-img-badge { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; margin-right: 4px; }

.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 20px;
  background: var(--nav-bg); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
  cursor: pointer;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s, transform 0.3s;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle-btn:hover { background: var(--border); transform: scale(1.05); }
.theme-toggle-btn:active { transform: scale(0.95); }
.sun-icon { display: none; }
.moon-icon { display: block; }
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

.github-link {
  color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.github-link:hover { background: var(--border); transform: scale(1.05); }
.github-link:active { transform: scale(0.95); }

.lbl-ic { vertical-align: middle; margin-right: 6px; display: inline-block; }
.chip-custom { display: inline-flex; align-items: center; gap: 6px; }
.chip-custom svg { flex-shrink: 0; }
.btn-ic { vertical-align: middle; margin-right: 6px; flex-shrink: 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: none; cursor: pointer; font-family: inherit; font-weight: 700;
  border-radius: 999px; padding: 14px 26px; font-size: 16px;
  transition: transform .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(20, 184, 166, .6); }
.btn-grad:hover { transform: scale(1.03); }
.btn-grad:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-sm { padding: 9px 18px; font-size: 14px; border-radius: 999px; }
.btn-block { width: 100%; padding: 16px; }
.btn-secondary {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.btn-secondary:hover { background: var(--bg); transform: scale(1.03); }

.hero {
  max-width: 720px; margin: 0 auto; padding: 64px 20px 24px;
  text-align: center; position: relative; overflow: visible;
}
.hero-glow {
  position: absolute; top: 40px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 300px;
  background: radial-gradient(ellipse at center, rgba(34,197,94,0.13) 0%, rgba(20,184,166,0.08) 40%, transparent 70%);
  pointer-events: none; z-index: 0; filter: blur(20px);
}
.hero > *:not(.hero-glow) { position: relative; z-index: 1; }
.pill {
  display: inline-flex; gap: 8px; align-items: center; margin-bottom: 20px;
  border: 1px solid var(--border); background: var(--card);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--muted);
}
.hero h1 { font-size: 52px; font-weight: 800; line-height: 1.08; letter-spacing: -.02em; }
.hero .sub { margin: 18px auto 0; max-width: 480px; font-size: 18px; color: var(--muted); line-height: 1.6; }
.trust { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; color: var(--muted); font-size: 13px; }
.hero-buttons { display: inline-flex; gap: 12px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }

.how-it-works { max-width: 900px; margin: 0 auto; padding: 60px 20px; text-align: center; }
.how-it-works h2 { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 40px; }
.section-eyebrow {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--brand); margin-bottom: 10px;
}
.steps { display: flex; align-items: flex-start; justify-content: center; gap: 0; flex-wrap: wrap; }
.step-card {
  flex: 1; min-width: 200px; max-width: 260px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 28px 24px; text-align: center;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px -16px rgba(34,197,94,.15);
  border-color: rgba(34,197,94,.3);
}
.step-num { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--brand); margin-bottom: 14px; opacity: .7; }
.step-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(34,197,94,.15), rgba(20,184,166,.15));
  border: 1px solid rgba(34,197,94,.2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; color: var(--brand);
}
.step-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step-card p { font-size: 14px; color: var(--muted); line-height: 1.55; }
.step-connector {
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); opacity: .4; padding: 0 8px; margin-top: 60px; flex-shrink: 0;
}

.tool { max-width: 720px; margin: 0 auto; padding: 24px 20px 60px; }
.card { background: var(--card); border-radius: 24px; padding: 28px; transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; }
.glass {
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border: 1px solid var(--border); box-shadow: 0 24px 60px -24px rgba(15, 23, 42, .22);
}
.lbl { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.lbl-sm { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin: 8px 0 6px; }
textarea, .inp {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  border: 1px solid var(--border); border-radius: 14px; padding: 13px 16px;
  background: var(--input-bg); resize: none; outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease, background-color 0.3s, color 0.3s;
}
textarea:focus, .inp:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12), 0 4px 12px rgba(34, 197, 94, 0.04);
}
.loading-pulse { animation: pulseGlow 1.5s infinite ease-in-out; pointer-events: none; opacity: 0.85; }
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.22); }
  100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12); }
}
.counter { text-align: right; font-size: 12px; color: var(--muted); margin-top: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--chip-bg); color: var(--ink);
  border-radius: 999px; padding: 7px 15px; font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s, color 0.3s;
}
.chip:hover { background: var(--bg); border-color: var(--brand); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(34, 197, 94, 0.08); }
.chip:active { transform: translateY(0); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2); }

.ctx-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  border: 1px dashed var(--border); background: var(--ctx-toggle-bg);
  border-radius: 16px; padding: 13px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; color: var(--ink);
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}
.ctx-panel { margin-top: 12px; border: 1px solid var(--border); border-radius: 16px; padding: 16px; background: var(--ctx-panel-bg); transition: background-color 0.3s, border-color 0.3s; }
.error { margin-top: 12px; background: rgba(239, 68, 68, .1); color: #dc2626; padding: 10px 16px; border-radius: 12px; font-size: 14px; }

.action-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.action-buttons .btn { flex: 1; min-width: 140px; }

.out-wrap { margin-top: 24px; animation: floatUp .4s ease-out; }
.out-card { border: 1px solid rgba(34, 197, 94, .3); background: rgba(34, 197, 94, .07); border-radius: 16px; padding: 20px; transition: border-color 0.3s, background-color 0.3s; }
.badge { display: inline-flex; align-items: center; gap: 6px; background: var(--chip-bg); border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: background-color 0.3s, color 0.3s; }
.out-text { margin-top: 12px; white-space: pre-wrap; font-size: 15px; line-height: 1.6; }
.out-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.out-actions button { border: 1px solid var(--border); background: var(--chip-bg); color: var(--ink); border-radius: 999px; padding: 8px 15px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; display: inline-flex; gap: 6px; align-items: center; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }
.out-actions button:hover { background: var(--bg); }

.evolution { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; font-size: 13px; font-weight: 600; color: var(--muted); flex-wrap: wrap; }
.evolution .step { background: var(--step-bg); color: var(--ink); border-radius: 999px; padding: 4px 12px; transition: background-color 0.3s, color 0.3s; }
.evolution .step.final { background: var(--grad); color: #fff; }

.score { margin-top: 20px; border: 1px solid var(--border); border-radius: 16px; padding: 20px; background: var(--score-bg); transition: background-color 0.3s, border-color 0.3s; }
.score-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.score-num { font-size: 24px; font-weight: 800; }
.bar-row { margin-bottom: 12px; }
.bar-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.bar-top .plus { color: var(--brand); font-weight: 700; }
.bar { height: 8px; background: var(--bar-bg); border-radius: 999px; overflow: hidden; transition: background-color 0.3s; }
.bar-fill { height: 100%; background: var(--grad); border-radius: 999px; animation: fillBar .7s ease-out; }

.empty { text-align: center; border: 1px dashed var(--border); border-radius: 16px; padding: 40px 24px; margin-top: 24px; background: var(--empty-bg); transition: background-color 0.3s, border-color 0.3s; }
.empty svg { margin: 0 auto 16px; display: block; }
.empty-title { font-size: 14px; font-weight: 500; }

.features { max-width: 1000px; margin: 0 auto; padding: 60px 20px; }
.features h2 { text-align: center; font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.features .section-eyebrow { text-align: center; }
.grid { margin-top: 36px; display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
.feat { border: 1px solid var(--border); background: var(--feat-bg); border-radius: 16px; padding: 24px; transition: transform .2s, box-shadow .2s, background-color 0.3s, border-color 0.3s; }
.feat:hover { transform: translateY(-4px); box-shadow: 0 16px 32px -16px rgba(15,23,42,.2); }
.feat-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; }
.feat h3 { margin-top: 16px; font-size: 16px; font-weight: 700; }
.feat p { margin-top: 4px; font-size: 14px; color: var(--muted); }

.rec-banner {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(34, 197, 94, 0.08); border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-top: 10px;
  animation: floatUp .3s ease-out; gap: 12px;
}
[data-theme="dark"] .rec-banner { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.3); }
.rec-content { display: flex; align-items: center; gap: 8px; color: var(--ink); min-width: 0; }
.rec-icon { color: var(--brand); flex-shrink: 0; }
.rec-apply-btn {
  background: var(--brand); color: #fff; border: none;
  padding: 6px 12px; font-size: 12px; font-weight: 700;
  border-radius: 6px; cursor: pointer; flex-shrink: 0;
  transition: opacity 0.2s, transform 0.1s;
}
.rec-apply-btn:hover { opacity: 0.9; }
.rec-apply-btn:active { transform: scale(0.95); }

.kaizen-info { max-width: 1000px; margin: 0 auto; padding: 40px 20px; }
.kaizen-info-card { display: flex; align-items: center; gap: 40px; padding: 40px; border-radius: 24px; }
.kaizen-symbol {
  font-size: 80px; font-weight: 900;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1.1; letter-spacing: -4px; opacity: 0.85; user-select: none;
  font-family: "Hiragino Mincho ProN", "MS PMincho", serif; flex-shrink: 0;
}
.kaizen-text { flex: 1; min-width: 0; }
.kaizen-text h2 { font-size: 28px; font-weight: 800; margin-bottom: 16px; letter-spacing: -.02em; }
.kaizen-text p { font-size: 15px; line-height: 1.6; color: var(--muted); margin-bottom: 12px; }
.kaizen-text p:last-child { margin-bottom: 0; }

.mode-tabs {
  display: flex; background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; margin-bottom: 16px;
  transition: background-color 0.3s, border-color 0.3s;
}
.mode-tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; border: none; color: var(--muted);
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 16px; border-radius: 8px; cursor: pointer; transition: all 0.2s ease;
}
.mode-tab:hover { color: var(--ink); }
.mode-tab.active { background: var(--card); color: var(--ink); box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08); }
[data-theme="dark"] .mode-tab.active { box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.3); }
.tab-ic { flex-shrink: 0; }

.input-actions-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; margin-bottom: 16px; gap: 8px;
}
.input-actions-left { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-action {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--border); color: var(--ink);
  font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
  white-space: nowrap;
}
.btn-action:hover { background: var(--bg); }
.btn-action:active { transform: scale(0.97); }

.warning-note {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; font-size: 12px; color: var(--muted); margin-top: 16px; text-align: center;
}
.warn-ic { color: #eab308; flex-shrink: 0; }

.footer { border-top: 1px solid var(--border); padding: 40px 20px 28px; text-align: center; transition: border-color 0.3s; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 24px; }
.footer-tagline { font-size: 13px; }
.footer-copy {
  font-size: 12px; border-top: 1px solid var(--border); padding-top: 24px;
  max-width: 1000px; margin: 0 auto;
}
.footer-copy a { color: var(--muted); text-decoration: none; transition: color .2s; }
.footer-copy a:hover { color: var(--brand); }

@keyframes fillBar { from { width: 0; } }
@keyframes floatUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.comparison-container { display: flex; align-items: stretch; gap: 16px; margin-top: 16px; }
.comparison-block {
  flex: 1; background: var(--chip-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; display: flex; flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease; min-width: 0;
}
.comparison-block:hover { border-color: rgba(34, 197, 94, 0.3); box-shadow: 0 4px 12px rgba(34, 197, 94, 0.04); }
.comparison-badge {
  align-self: flex-start; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 8px; border-radius: 6px; margin-bottom: 8px;
}
.before-badge { background: rgba(100, 116, 139, 0.1); color: var(--muted); }
.after-badge { background: rgba(34, 197, 94, 0.1); color: var(--brand); }
.comparison-text { font-size: 14px; line-height: 1.6; white-space: pre-wrap; margin-top: 0 !important; word-break: break-word; }
.comparison-arrow { display: flex; align-items: center; justify-content: center; color: var(--brand); flex-shrink: 0; opacity: 0.8; }

.info-banner {
  margin-top: 12px; background: rgba(59, 130, 246, 0.08); color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.2); padding: 10px 16px;
  border-radius: 12px; font-size: 14px; display: flex; align-items: center; gap: 8px;
  animation: floatUp 0.3s ease-out;
}
[data-theme="dark"] .info-banner { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border-color: rgba(59, 130, 246, 0.3); }
.info-ic { color: #3b82f6; flex-shrink: 0; }

.ctx-note { display: flex; align-items: center; gap: 6px; margin-top: 8px; margin-bottom: 12px; font-size: 11px; color: var(--brand); opacity: 0.9; }
.ctx-note-ic { flex-shrink: 0; }

.kaizen-note-banner {
  color: var(--brand) !important; background: var(--empty-bg);
  border: 1px solid rgba(34, 197, 94, 0.2); border-left: 3px solid var(--brand);
  padding: 10px 14px; border-radius: 8px; font-size: 12px;
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; width: 100%; transition: border-color 0.3s ease;
}
.kaizen-note-banner .warn-ic { color: var(--brand) !important; flex-shrink: 0; }

@media (max-width: 768px) {
  .hero { padding: 48px 16px 20px; }
  .hero h1 { font-size: 36px; }
  .hero .sub { font-size: 16px; }
  .hero-glow { width: 100%; }
  .tool { padding: 16px 16px 40px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .features { padding: 40px 16px; }
  .how-it-works { padding: 40px 16px; }
  .kaizen-info { padding: 24px 16px; }
  .kaizen-info-card { flex-direction: column; text-align: center; gap: 20px; padding: 28px 20px; }
  .kaizen-symbol { font-size: 64px; }
}

@media (max-width: 700px) {
  .step-connector { transform: rotate(90deg); margin: 8px auto; padding: 0; }
  .steps { flex-direction: column; align-items: center; }
  .step-card { max-width: 100%; width: 100%; }
}

@media (max-width: 600px) {
  .comparison-container { flex-direction: column; align-items: stretch; gap: 8px; }
  .comparison-arrow { transform: rotate(90deg); margin: 6px 0; }
}

@media (max-width: 480px) {
  .nav { padding: 0 12px; }
  .nav .btn-grad { display: none; }
  .hero { padding: 40px 12px 16px; }
  .hero h1 { font-size: 26px; }
  .hero .sub { font-size: 15px; }
  .card { padding: 16px; border-radius: 20px; }
  .grid { grid-template-columns: 1fr; }
  .out-actions button { flex: 1 1 120px; justify-content: center; }
  .action-buttons { flex-direction: column; }
  .action-buttons .btn { width: 100%; }
  .input-actions-row { flex-direction: column; align-items: stretch; }
  .input-actions-left { width: 100%; }
  .input-actions-left .btn-action { flex: 1; justify-content: center; }
  .counter { text-align: right; }
  .rec-banner { flex-direction: column; align-items: flex-start; }
  .score-num { font-size: 20px; }
}
