:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-hover: #ebebef;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --red: #d70015;
  --red-bg: #fff2f3;
  --green: #1a7f37;
  --green-bg: #f1fbf4;
  --amber: #8a5300;
  --amber-bg: #fff9eb;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

/* Top translucent navigation bar */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 52px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
}

.nav-inner {
  max-width: 920px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-links a:hover { color: var(--ink); }

/* Sections */
.section {
  padding: 72px 24px;
}

.section-surface {
  background: var(--surface);
}

.inner {
  max-width: 720px;
  margin: 0 auto;
}

.inner-wide {
  max-width: 880px;
  margin: 0 auto;
}

/* Hero */
.hero {
  padding: 96px 24px 88px;
  text-align: center;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(40px, 7vw, 60px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.06;
  color: var(--ink);
}

.hero-lead {
  margin: 0 auto 30px;
  max-width: 520px;
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 400;
  color: var(--muted);
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 980px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.btn-pill:hover { background: var(--blue-hover); }
.btn-pill:disabled { opacity: 0.38; cursor: not-allowed; }

.btn-pill-sm {
  padding: 9px 18px;
  font-size: 14px;
}

.btn-ghost {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--line);
  border-radius: 980px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.link-more {
  color: var(--blue);
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
}
.link-more:hover { text-decoration: underline; }

.hero-meta {
  margin-top: 22px;
  font-size: 12px;
  color: var(--muted);
}

/* Headings */
.section-head {
  text-align: center;
  margin-bottom: 40px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.section-head p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

/* 3 Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 700px) {
  .steps { grid-template-columns: 1fr; gap: 20px; }
}

.step {
  background: var(--bg);
  border-radius: 18px;
  padding: 24px 22px;
}

.step-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.step h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.step p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.step code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink);
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Auth & Forms */
.panel {
  background: var(--surface);
  border-radius: 18px;
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

input[type="text"],
input[type="password"],
select {
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  padding: 10px 13px;
  font-size: 15px;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.muted-note {
  font-size: 12px;
  color: var(--muted);
}

.hidden { display: none !important; }

/* Feedback banners */
.msg {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 10px;
}
.msg.info  { background: #eef5ff; color: #004ea2; }
.msg.ok    { background: var(--green-bg); color: var(--green); }
.msg.warn  { background: var(--amber-bg); color: var(--amber); }
.msg.err   { background: var(--red-bg); color: var(--red); }

/* Dictionary area */
.dict-block {
  margin-top: 28px;
}

.sub-heading {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 32px;
  margin-bottom: 10px;
}

.search-input {
  flex: 1;
  background: var(--surface) !important;
  border: 1px solid transparent !important;
  border-radius: 980px !important;
  padding: 10px 18px !important;
  font-size: 14px !important;
}

.search-input:focus {
  background: var(--bg) !important;
  border-color: var(--blue) !important;
}

.list-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Clean hair-line word rows */
.word-rows {
  border-top: 1px solid var(--line-soft);
}

.word-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.word-row-main {
  min-width: 0;
}

.word-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.word-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.cat-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 980px;
  background: var(--surface);
  color: var(--muted);
}

.word-row-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.btn-del {
  background: transparent;
  color: var(--red);
  border: 1px solid #f5c2c7;
  border-radius: 980px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-del:hover { background: var(--red-bg); }

/* Quiet admin disclosure */
details.admin {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

details.admin summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
details.admin summary::-webkit-details-marker { display: none; }
details.admin summary:hover { color: var(--ink); }

.admin-body {
  margin-top: 12px;
  background: var(--surface);
  border-radius: 14px;
  padding: 16px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}
.stats-table th, .stats-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 6px;
  text-align: left;
}
.stats-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}

footer {
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
