:root {
  --bg: #000000;
  --bg-2: #050505;
  --ink: #f2eee8;
  --ink-soft: #c9c3bb;
  --muted: #9b958c;
  --line: #1c1c1c;
  --card: #080808;
  --input: #050505;
  --accent: #e3b36e;
  --accent-deep: #f3d29a;
  --star: #dbe6ff;
  --accent-soft: #3a2c18;
  --indigo: #7b74c7;
  --indigo-deep: #4a4580;
  --sage: #7ea88a;
  --sage-soft: #1c2a22;
  --danger: #e08b84;
  --danger-bg: #3a1c1c;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --font: "Zen Maru Gothic", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
html { color-scheme: dark; background: var(--bg); }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #000;
  min-height: 100vh;
  line-height: 1.7;
}
a { color: var(--accent-deep); }
a:hover { color: #f6d09a; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* Starfield (canvas, drawn by starfield.js) */
.starfield {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none; display: block; background: #000;
}

.site-header, .wrap, .site-footer, .admin-wrap { position: relative; z-index: 1; }

.site-header {
  max-width: 640px;
  margin: 0 auto;
  padding: 22px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: flex; flex-shrink: 0; }
.brand-mark img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
}
.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.03em;
  color: var(--ink);
  line-height: 1.35;
}
@media (max-width: 420px) {
  .brand-name { font-size: 0.92rem; }
}

.mode-chip {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
  border: 1px solid #5a4a28;
  background: #2a2316;
  border-radius: 999px;
  padding: 2px 8px;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 8px 20px 120px; }

.hero { padding: 10px 4px 4px; text-align: left; }
.hero-mascot {
  display: flex;
  justify-content: center;
  margin: 0 0 6px;
}
.hero-mascot-stage {
  position: relative;
  display: block;
  line-height: 0;
  animation: hero-mascot-float 4s ease-in-out infinite;
}
.hero-mascot picture img {
  position: relative;
  z-index: 1;
  width: min(72vw, 280px);
  height: auto;
  display: block;
  filter: drop-shadow(0 0 22px rgba(219, 230, 255, 0.14)) drop-shadow(0 10px 28px rgba(217, 160, 92, 0.18));
}
.hero-mascot-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.hero-mascot-ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  mix-blend-mode: lighten;
}
.hero-mascot-ghost.is-cyan { filter: url(#hero-mascot-cyan); }
.hero-mascot-ghost.is-magenta { filter: url(#hero-mascot-magenta); }
.hero-mascot-scan {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 30%;
  height: 1.5px;
  border-radius: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(180, 220, 255, 0.15) 15%, rgba(219, 230, 255, 0.9) 50%, rgba(243, 210, 154, 0.55) 70%, transparent 100%);
  box-shadow: 0 0 8px rgba(180, 220, 255, 0.55), 0 0 16px rgba(243, 210, 154, 0.25);
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
}
.hero-mascot.is-glitching picture img {
  animation: hero-mascot-jitter 0.28s steps(4, end);
}
.hero-mascot.is-glitching .hero-mascot-ghost.is-cyan {
  animation: hero-mascot-cyan 0.28s linear;
}
.hero-mascot.is-glitching .hero-mascot-ghost.is-magenta {
  animation: hero-mascot-magenta 0.28s linear;
}
.hero-mascot.is-glitching .hero-mascot-scan {
  animation: hero-mascot-scan 0.28s ease-out;
}
@keyframes hero-mascot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes hero-mascot-jitter {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 1px); }
  40% { transform: translate(4px, -1px); }
  60% { transform: translate(-2px, 0); }
  80% { transform: translate(3px, 1px); }
}
@keyframes hero-mascot-cyan {
  0%, 100% { opacity: 0; transform: translate(0, 0); clip-path: inset(0 0 0 0); }
  18% { opacity: 0.7; transform: translate(-6px, 0); clip-path: inset(10% 0 58% 0); }
  45% { opacity: 0.58; transform: translate(-7px, 1px); clip-path: inset(42% 0 18% 0); }
  72% { opacity: 0.65; transform: translate(-5px, 0); clip-path: inset(22% 0 46% 0); }
}
@keyframes hero-mascot-magenta {
  0%, 100% { opacity: 0; transform: translate(0, 0); clip-path: inset(0 0 0 0); }
  22% { opacity: 0.65; transform: translate(6px, 0); clip-path: inset(52% 0 10% 0); }
  50% { opacity: 0.55; transform: translate(7px, -1px); clip-path: inset(12% 0 56% 0); }
  78% { opacity: 0.6; transform: translate(5px, 0); clip-path: inset(36% 0 28% 0); }
}
@keyframes hero-mascot-scan {
  0% { opacity: 0; top: 18%; }
  25% { opacity: 0.9; }
  100% { opacity: 0; top: 78%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mascot-stage,
  .hero-mascot.is-glitching picture img,
  .hero-mascot.is-glitching .hero-mascot-ghost,
  .hero-mascot.is-glitching .hero-mascot-scan { animation: none !important; }
  .hero-mascot-ghost,
  .hero-mascot-scan { visibility: hidden; }
}
body[data-step="2"] .hero-mascot,
body[data-step="3"] .hero-mascot,
body[data-phase="transmit"] .hero-mascot,
body[data-phase="done"] .hero-mascot {
  display: none;
}
body[data-step="2"] .hero,
body[data-step="3"] .hero { padding-top: 10px; padding-bottom: 0; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.55rem, 6vw, 2.15rem);
  line-height: 1.4;
  margin: 0 0 10px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.catchphrase {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.08rem, 3.4vw, 1.42rem);
  line-height: 1.55;
  margin: 0;
  color: var(--accent-deep);
  text-shadow: 0 0 18px rgba(243, 210, 154, 0.28);
  letter-spacing: 0.03em;
  word-break: keep-all;
  line-break: strict;
}
.subcopy {
  margin: 8px 0 0;
  color: #f2eee8;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.6;
}
body[data-step="2"] .subcopy,
body[data-step="3"] .subcopy,
body[data-phase="transmit"] .subcopy,
body[data-phase="done"] .subcopy {
  display: none;
}
@media (max-width: 520px) {
  .catchphrase .phrase-break { display: block; }
}

.card {
  margin-top: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 22px 20px;
}
.card.compact { padding: 22px 20px 18px; }

.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 18px;
}
.prog-mascot {
  display: none;
  flex: 0 0 auto;
  width: 52px;
  line-height: 0;
}
.prog-mascot img {
  width: 52px;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(217, 160, 92, 0.25));
}
body[data-step="2"] .prog-mascot,
body[data-step="3"] .prog-mascot { display: block; }
.prog-dots {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0;
}
.prog-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a1a22;
  border: 1px solid #34343f;
  flex: 0 0 auto;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.prog-dot.is-on {
  background: var(--accent);
  border-color: var(--accent);
}
.prog-dot.is-current {
  box-shadow: 0 0 0 4px rgba(217, 160, 92, 0.22);
}
.prog-line {
  flex: 1;
  height: 1px;
  background: #23232c;
  margin: 0 6px;
}
.prog-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

.wizard-viewport { overflow: hidden; transition: height 0.35s ease; }
.wizard-track {
  display: flex;
  align-items: flex-start;
  width: 300%;
  transition: transform 0.4s cubic-bezier(.22, .8, .3, 1);
  transform: translateX(calc(var(--step-index, 0) * -33.333%));
}
.wizard-step {
  width: 33.333%;
  flex: 0 0 33.333%;
  padding-right: 1px;
}
@media (prefers-reduced-motion: reduce) {
  .wizard-track { transition: none; }
}

.wizard-nav {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 6px;
}
.wizard-nav .submit-btn { margin-top: 0; flex: 1; }
.wizard-nav .nav-back {
  flex: 0 0 auto;
  padding: 0 18px;
  font-size: 0.92rem;
}

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills.compact .pill { padding: 7px 12px; font-size: 0.85rem; }
.pill {
  font-family: inherit;
  font-size: 0.92rem;
  border: 1.5px solid var(--line);
  background: #0a0a0a;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill:hover { border-color: #5a4a28; background: #1a160f; color: var(--ink); }
.pill.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a140c;
  font-weight: 700;
}
.categories .pill { min-width: 92px; text-align: center; }
.pill-wide {
  width: 100%;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 16px;
  text-align: left;
  line-height: 1.35;
}
.pill-main { font-weight: 700; letter-spacing: 0.02em; }
.pill-sub {
  font-size: 0.78rem;
  font-weight: 400;
  color: inherit;
  opacity: 0.88;
}
.pill-wide.selected .pill-sub { opacity: 0.9; }
.field-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.field { margin-bottom: 16px; }
label, .label-like {
  display: block;
  font-weight: 500;
  font-size: 0.86rem;
  margin-bottom: 7px;
  color: var(--ink-soft);
}
.detect-label {
  margin-left: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="password"], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--input);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: #6f6a64; opacity: 1; }
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(217, 160, 92, 0.18);
}
input:-webkit-autofill, textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--input) inset;
  transition: background-color 9999s ease-out 0s;
}

.assist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
}
.char-count { font-size: 0.72rem; color: var(--muted); }

.ghost-btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-deep);
  background: transparent;
  border: 1px solid #5a4a28;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.ghost-btn:hover { background: var(--accent-soft); }
.ghost-btn:disabled { opacity: 0.5; cursor: wait; }
.ghost-btn.block { display: block; width: 100%; margin-top: 18px; padding: 10px 16px; }

.assist-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #0a0a0a;
  border: 1px solid var(--line);
}
.assist-box p { margin: 0; font-size: 0.9rem; color: #d8d3f0; }
.assist-actions { display: flex; gap: 14px; margin-top: 6px; }

.submit-btn {
  width: 100%;
  margin-top: 6px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #e0ae6c 0%, var(--accent) 100%);
  color: #1a140c;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(217, 160, 92, 0.28);
  transition: transform 0.12s, filter 0.12s;
}
.submit-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.submit-btn:disabled { opacity: 0.65; cursor: wait; transform: none; }
.submit-btn.compact { width: auto; padding: 8px 16px; font-size: 0.86rem; margin: 0; box-shadow: none; }

.form-error {
  background: var(--danger-bg);
  color: #f3b4ae;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.88rem;
  border: 1px solid #5c2a2a;
}
.tiny-note {
  margin: 12px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

[hidden] { display: none !important; }

/* Transmission */
.transmit-card {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.tx-stage {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 10px auto 8px;
}
.tx-ring, .tx-ring-2 {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px solid rgba(123, 116, 199, 0.45);
  box-shadow: 0 0 24px rgba(123, 116, 199, 0.2), inset 0 0 18px rgba(217, 160, 92, 0.08);
  animation: pulse-ring 2.2s ease-in-out infinite;
}
.tx-ring-2 { inset: 0; border-color: rgba(217, 160, 92, 0.28); animation-delay: 0.4s; }
.tx-core {
  position: absolute;
  inset: 58px;
  border-radius: 50%;
  background: radial-gradient(circle, #efc07a 0%, #7b74c7 55%, #16151e 80%);
  box-shadow: 0 0 36px rgba(217, 160, 92, 0.45);
  animation: core-glow 1.6s ease-in-out infinite;
}
.tx-scan {
  position: absolute;
  left: 18px;
  right: 18px;
  height: 2px;
  top: 20%;
  background: linear-gradient(90deg, transparent, #efc07a, transparent);
  box-shadow: 0 0 12px #efc07a;
  animation: scan 1.8s ease-in-out infinite;
}
.tx-status {
  margin: 8px 0 12px;
  color: var(--accent-deep);
  letter-spacing: 0.12em;
  font-size: 0.92rem;
  font-weight: 500;
}
.transmit-card.is-sent .tx-status { color: var(--ink); letter-spacing: 0.08em; }
.transmit-card.is-sent .tx-core {
  background: radial-gradient(circle, #efe4d4 0%, #d9a05c 40%, #2a2640 80%);
  animation: none;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.06); opacity: 1; }
}
@keyframes core-glow {
  0%, 100% { transform: scale(0.92); filter: brightness(0.9); }
  50% { transform: scale(1); filter: brightness(1.2); }
}
@keyframes scan {
  0% { top: 18%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 78%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tx-ring, .tx-ring-2, .tx-core, .tx-scan { animation: none; }
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  font-weight: 700;
}
.done-card { text-align: center; padding: 28px 22px 24px; }
.done-mascot {
  display: flex;
  justify-content: center;
  margin: 0 0 4px;
  position: relative;
}
.done-mascot::before {
  content: "";
  position: absolute;
  inset: 18% 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 160, 92, 0.28) 0%, rgba(123, 116, 199, 0.12) 45%, transparent 70%);
  filter: blur(8px);
  z-index: 0;
  animation: mascot-glow 3.2s ease-in-out infinite;
}
.done-mascot img {
  position: relative;
  z-index: 1;
  width: min(68vw, 240px);
  height: auto;
  display: block;
  animation: mascot-float 3.2s ease-in-out infinite;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
}
@keyframes mascot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes mascot-glow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .done-mascot img, .done-mascot::before { animation: none; }
}
.done-card h2 {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  margin: 0 0 16px;
  font-weight: 600;
}
.cat-tag {
  display: inline-block;
  margin: 0 0 14px;
  padding: 2px 12px;
  border-radius: 999px;
  background: #24203a;
  color: #c5c0ef;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.done-summary {
  margin: 0 auto 16px;
  max-width: 28em;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.8;
}
.follow-note {
  margin: 0;
  color: var(--accent-deep);
  font-weight: 500;
  font-size: 0.95rem;
}
.crisis-box {
  margin: 20px auto 0;
  max-width: 28em;
  text-align: left;
  background: var(--danger-bg);
  border: 1px solid #5c2a2a;
  color: #f3b4ae;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.88rem;
}
.crisis-box p { margin: 0 0 8px; }
.crisis-box p:last-child { margin: 0; }
.crisis-box a { color: #ffd0cc; }

.text-btn {
  border: 0;
  background: transparent;
  color: var(--accent-deep);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 0;
}
.text-btn.dim { color: var(--muted); text-decoration: none; }

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0 20px 32px;
}
.site-footer p { margin: 0; font-family: var(--serif); }

/* Admin */
.admin-body {
  background: #000;
  color: var(--ink);
}
.admin-wrap { max-width: 920px; margin: 0 auto; padding: 28px 20px 80px; }
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.consult-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.consult-item.is-crisis { border-color: #6a3030; }
.consult-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  cursor: pointer;
}
.consult-meta { color: var(--muted); font-size: 0.8rem; }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 6px;
}
.badge.cat { background: #24203a; color: #c5c0ef; }
.badge.open { background: var(--accent-soft); color: var(--accent-deep); }
.badge.done { background: var(--sage-soft); color: #b5dbc0; }
.badge.crisis { background: var(--danger-bg); color: var(--danger); }
.badge.confess { background: #2a2433; color: #d7c6ef; }
.badge.line { background: #16301f; color: #8fdfb0; }
.line-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: var(--accent);
}
.noreply-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0a0a0a;
  border: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.badge.u-緊急 { background: var(--danger-bg); color: var(--danger); }
.badge.u-高 { background: #3a2a16; color: #efc07a; }
.badge.u-中 { background: #2a2433; color: #c5c0ef; }
.badge.u-低 { background: #1c2a22; color: #b5dbc0; }
.temp-bar {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
  margin-right: 6px;
}
.temp-bar i {
  width: 7px;
  height: 12px;
  border-radius: 2px;
  background: #2a2833;
  display: inline-block;
}
.temp-bar.u-低 i:nth-child(1) { background: #7ea88a; }
.temp-bar.u-中 i:nth-child(-n+2) { background: #7b74c7; }
.temp-bar.u-高 i:nth-child(-n+3) { background: #d9a05c; }
.temp-bar.u-緊急 i { background: #e08b84; }
.consult-detail { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 16px;
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: var(--ink-soft);
}
@media (min-width: 640px) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
}
.login-card { max-width: 420px; margin: 60px auto; }
.draft-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 14px 0 6px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.message-block {
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
  line-height: 1.75;
}
.draft-area { min-height: 180px; }
.admin-hero h1 {
  font-family: var(--serif);
  font-size: 1.6rem;
  margin: 0 0 6px;
}
.admin-hero .lead { margin: 0 0 18px; color: var(--ink-soft); font-size: 0.95rem; }

/* Floating FAQ guide widget */
.faq-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  pointer-events: none;
}
.faq-widget > * { pointer-events: auto; }
.faq-fab {
  position: relative;
  height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #0a0a0a;
  box-shadow:
    0 0 0 1px rgba(243, 210, 154, 0.28),
    0 0 18px rgba(243, 210, 154, 0.16),
    0 8px 24px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  overflow: visible;
  color: var(--ink);
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.faq-fab-glow {
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  background: conic-gradient(from var(--fab-angle, 0deg), rgba(243,210,154,0) 0deg, rgba(243,210,154,0.55) 60deg, rgba(180,200,255,0.45) 120deg, rgba(243,210,154,0) 200deg, rgba(243,210,154,0) 360deg);
  filter: blur(5px);
  opacity: 0.75;
  z-index: -1;
  pointer-events: none;
  animation: faq-glow 4.5s linear infinite;
}
.faq-fab-face {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 40px;
  border-radius: 0;
  flex: none;
  background: transparent;
  box-shadow: none;
}
.faq-fab-face picture { display: block; width: 100%; height: 100%; border-radius: 0; overflow: visible; }
.faq-fab-face img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transform-origin: center center;
  filter: drop-shadow(0 0 5px rgba(243, 210, 154, 0.4));
  animation: emblem-breathe 4.8s ease-in-out infinite;
}
.faq-fab-dot {
  position: absolute;
  right: -1px;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8fe3b0;
  box-shadow: 0 0 0 2px #05050a, 0 0 8px rgba(143, 227, 176, 0.8);
}
.faq-fab-label {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  background: linear-gradient(90deg, #f3d29a, #dbe6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.faq-fab:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(243, 210, 154, 0.5), 0 0 24px rgba(180, 200, 255, 0.32), 0 8px 24px rgba(0, 0, 0, 0.6); }
.faq-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.faq-widget.is-open .faq-fab {
  box-shadow:
    0 0 0 1px rgba(243, 210, 154, 0.7),
    0 0 22px rgba(243, 210, 154, 0.35);
}
@property --fab-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes faq-glow {
  to { --fab-angle: 360deg; }
}
@keyframes emblem-breathe {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 5px rgba(243, 210, 154, 0.35)) drop-shadow(0 0 10px rgba(180, 200, 255, 0.12));
  }
  50% {
    transform: scale(1.04);
    filter: drop-shadow(0 0 10px rgba(243, 210, 154, 0.75)) drop-shadow(0 0 18px rgba(180, 200, 255, 0.4));
  }
}
@media (prefers-reduced-motion: reduce) {
  .faq-fab-glow { animation: none; }
  .faq-fab-face img { animation: none; }
}

.faq-panel {
  position: absolute;
  right: 0;
  bottom: 66px;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: min(640px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: #080808;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transform-origin: bottom right;
  animation: faq-open 0.28s ease-out;
}
.faq-panel[hidden] { display: none !important; }
@keyframes faq-open {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.faq-panel-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: inherit;
}
.faq-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: #0a0a0a;
}
.faq-head-face {
  width: 31px;
  height: 36px;
  border-radius: 0;
  overflow: visible;
  flex: none;
  background: transparent;
  box-shadow: none;
}
.faq-head-face picture { display: block; width: 100%; height: 100%; }
.faq-head-face img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }
.faq-head-text { flex: 1; min-width: 0; }
.faq-kicker {
  margin: 0;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.faq-head h2 {
  margin: 0;
  font-size: 0.98rem;
  font-family: var(--serif);
  font-weight: 600;
}
.faq-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.faq-close:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
.faq-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
  max-height: 340px;
}
.faq-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.faq-msg.bot {
  align-self: flex-start;
  background: rgba(123, 116, 199, 0.14);
  border: 1px solid rgba(123, 116, 199, 0.22);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}
.faq-msg.user {
  align-self: flex-end;
  background: rgba(217, 160, 92, 0.16);
  border: 1px solid rgba(217, 160, 92, 0.28);
  color: var(--ink);
  border-bottom-right-radius: 6px;
}
.faq-msg.crisis {
  background: var(--danger-bg);
  border-color: rgba(224, 139, 132, 0.45);
}
.faq-typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 2px;
}
.faq-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-deep);
  opacity: 0.35;
  animation: faq-dot 1s ease-in-out infinite;
}
.faq-typing i:nth-child(2) { animation-delay: 0.15s; }
.faq-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes faq-dot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.faq-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 10px;
}
.faq-tag {
  border: 1px solid rgba(217, 160, 92, 0.32);
  background: rgba(217, 160, 92, 0.08);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
}
.faq-tag:hover, .faq-tag:focus-visible {
  background: rgba(217, 160, 92, 0.2);
  border-color: var(--accent);
  outline: none;
}
.faq-form {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 10px;
}
.faq-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
}
.faq-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 160, 92, 0.15);
}
.faq-send {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-deep), var(--accent));
  color: #1a1208;
  font-weight: 700;
  font-family: inherit;
  padding: 10px 14px;
  cursor: pointer;
  flex: none;
}
.faq-send:disabled { opacity: 0.55; cursor: default; }
@media (max-width: 640px) {
  .faq-widget { right: 12px; bottom: 12px; left: 12px; }
  .faq-fab { margin-left: auto; display: flex; height: 48px; }
  .faq-fab-face { width: 31px; height: 36px; }
  .faq-panel {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    bottom: 64px;
    max-height: calc(100vh - 90px);
    border-radius: 20px;
  }
  .faq-log { max-height: none; }
}

.leadline{margin:0 0 .35em;font-size:.9rem;font-weight:300;letter-spacing:.12em;color:rgba(255,255,255,.72)}
body[data-step="2"] .leadline,body[data-step="3"] .leadline,body[data-phase="transmit"] .leadline,body[data-phase="done"] .leadline{display:none}

@media (max-width: 480px) { .pills.categories { display: grid; grid-template-columns: repeat(3, 1fr); } .categories .pill { min-width: 0; padding-left: 6px; padding-right: 6px; } }

/* v15: カテゴリの一行メモ */
.cat-note {
  margin: 8px 2px 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}
.cat-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* v15: ハニーポット（人には見えない欄） */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* v15: スマホではAI botボタンを縦長の小さなタブにして、フォームの右外に収める */
@media (max-width: 640px) {
  .wrap { padding-bottom: 96px; }
  .faq-widget { left: auto; right: 3px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .faq-widget.is-open { left: 12px; right: 12px; }
  .faq-fab {
    width: 38px;
    height: auto;
    padding: 5px 0 5px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    border-radius: 12px;
  }
  .faq-fab-glow { border-radius: 14px; }
  .faq-fab-face { width: 24px; height: 28px; }
  .faq-fab-dot { width: 7px; height: 7px; right: -3px; bottom: -1px; }
  .faq-fab-label { font-size: 10px; line-height: 1; letter-spacing: 0; }
  .faq-panel { bottom: 62px; }
}

/* v15: 管理ページの控えダウンロード */
.export-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.export-label { font-size: 0.82rem; color: var(--muted); margin-right: 4px; }
.export-btn { padding: 6px 12px; font-size: 0.82rem; }
.export-msg { font-size: 0.8rem; color: var(--muted); }

/* v16: 入力中にAIが拾った言葉 */
.ai-tags { margin-top: 10px; }
.ai-tags-label {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.ai-tags-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-deep);
  box-shadow: 0 0 8px var(--accent), 0 0 14px rgba(227, 179, 110, 0.6);
}
.ai-tags.is-reading .ai-tags-dot { animation: ai-dot-pulse 0.9s ease-in-out infinite; }
.ai-tags.is-reading .ai-tags-list { opacity: 0.45; transition: opacity 0.3s; }
.ai-tags-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 7px;
  min-height: 0;
  transition: opacity 0.3s;
}
.ai-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--accent-deep);
  background: radial-gradient(120% 140% at 30% 0%, rgba(227, 179, 110, 0.16), rgba(0, 0, 0, 0.9) 70%);
  border: 1px solid rgba(227, 179, 110, 0.45);
  box-shadow: 0 0 10px rgba(227, 179, 110, 0.18), inset 0 0 8px rgba(227, 179, 110, 0.08);
  animation: ai-tag-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both, ai-tag-drift 3.2s ease-in-out 0.7s infinite;
  animation-delay: calc(var(--i, 0) * 0.12s), calc(0.7s + var(--i, 0) * 0.12s);
}
.ai-tag.is-kept { animation: ai-tag-drift 3.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 0.3s); }
.ai-tag-star {
  font-size: 0.7rem; color: #fff3d6;
  text-shadow: 0 0 6px var(--accent), 0 0 12px rgba(227, 179, 110, 0.8);
  animation: ai-twinkle 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.35s);
}
@keyframes ai-tag-in {
  0% { opacity: 0; transform: translateY(8px) scale(0.85); filter: blur(3px); }
  60% { opacity: 1; filter: blur(0); box-shadow: 0 0 18px rgba(227, 179, 110, 0.45); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ai-tag-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes ai-twinkle {
  0%, 100% { opacity: 0.55; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes ai-dot-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.25); }
}

/* v16: 送信の3段階 */
.tx-steps {
  list-style: none;
  margin: 6px 0 14px;
  padding: 0;
  display: flex; flex-direction: column; gap: 0;
  width: min(260px, 100%);
}
.tx-step {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 7px 0;
  color: #4d4a45;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  transition: color 0.4s;
}
.tx-step + .tx-step::before {
  content: "";
  position: absolute;
  left: 10px; top: -9px;
  width: 2px; height: 18px;
  background: #1f1f1f;
  transition: background 0.5s, box-shadow 0.5s;
}
.tx-mark {
  flex: none;
  position: relative;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid #2c2c2c;
  background: #050505;
  display: grid; place-items: center;
  transition: border-color 0.4s, background 0.4s, box-shadow 0.4s;
}
.tx-check {
  font-size: 0.72rem; font-weight: 700; color: #1a140c;
  opacity: 0; transform: scale(0.4);
  transition: opacity 0.3s, transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.tx-step.is-active { color: var(--accent-deep); }
.tx-step.is-active .tx-mark {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(227, 179, 110, 0.5);
  animation: ai-dot-pulse 0.9s ease-in-out infinite;
}
.tx-step.is-done { color: var(--ink); }
.tx-step.is-done .tx-mark {
  border-color: var(--accent);
  background: linear-gradient(180deg, #f3d29a, var(--accent));
  box-shadow: 0 0 12px rgba(227, 179, 110, 0.55);
  animation: none;
}
.tx-step.is-done .tx-check { opacity: 1; transform: scale(1); }
.tx-step.is-active::before, .tx-step.is-done::before {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep)) !important;
  box-shadow: 0 0 8px rgba(227, 179, 110, 0.6);
}
.tx-cat {
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--accent-deep);
  border: 1px solid rgba(227, 179, 110, 0.45);
  animation: ai-tag-in 0.5s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .ai-tag, .ai-tag.is-kept, .ai-tag-star, .ai-tags.is-reading .ai-tags-dot,
  .tx-step.is-active .tx-mark, .tx-cat { animation: none !important; }
  .tx-step, .tx-mark, .tx-check, .tx-step::before { transition: none !important; }
}

/* Learn pages and site navigation (v21) */
a.brand {
  text-decoration: none;
  color: inherit;
}
a.brand:hover { color: inherit; }
a.brand:hover .brand-name { color: var(--accent-deep); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.learn-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-deep);
  background: transparent;
  border: 1px solid #5a4a28;
  border-radius: 999px;
  padding: 6px 14px;
  text-decoration: none;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.learn-entry:hover {
  background: var(--accent-soft);
  color: #f6d09a;
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
}
.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.footer-nav a:hover { color: var(--accent-deep); }

body.learn-page .wrap { padding-bottom: 64px; }

.learn-card { padding: 26px 22px 24px; }
.learn-card h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.45rem, 5.5vw, 1.95rem);
  line-height: 1.4;
  margin: 0 0 22px;
  letter-spacing: 0.02em;
}

.principle {
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.principle:last-of-type {
  margin-bottom: 8px;
  padding-bottom: 0;
  border-bottom: 0;
}
.principle h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.02rem, 3.6vw, 1.18rem);
  line-height: 1.6;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.principle-tag {
  color: var(--accent-deep);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.principle p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.85;
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: anywhere;
}

.column-body {
  font-family: var(--serif);
  font-size: clamp(1.02rem, 3.4vw, 1.14rem);
  line-height: 2.05;
  color: var(--ink);
  margin: 0 0 8px;
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: anywhere;
}
.column-body p { margin: 0 0 1.15em; }
.column-body p:last-child { margin-bottom: 0; }

.disclaimer {
  margin: 28px 0 0;
  padding: 16px 16px 14px;
  border: 1px solid #5a4a28;
  background: #120e08;
  border-radius: 14px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.85;
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: anywhere;
}
.disclaimer p { margin: 0; }

.learn-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-top: 24px;
}
.learn-nav a:not(.learn-back) {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--accent-deep);
}
.learn-nav a:not(.learn-back):hover { color: #f6d09a; }
.learn-back {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 10px 16px;
  box-sizing: border-box;
}
.learn-back:hover { color: #f6d09a; }

@media (max-width: 360px) {
  .learn-entry { padding: 5px 10px; font-size: 0.74rem; }
}

.site-header { flex-wrap: wrap; }

/* Learn-page charts and illustrations (v22) */
.cycle-figure {
  margin: 22px 0 0;
  padding: 12px 8px 10px;
  background: #0b0a08;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.cycle-figure svg {
  display: block;
  width: 100%;
  height: auto;
}
.cycle-figure figcaption {
  margin: 8px 4px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.principles-emblem {
  display: flex;
  justify-content: center;
  margin: -2px 0 22px;
}
.principles-emblem svg {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
}

.principle-illo {
  margin: 6px 0 12px;
  display: flex;
  justify-content: center;
  padding: 6px 8px 2px;
  background: #0b0a08;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.principle-illo svg {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .js-learn-fx .draw-in:not(.is-in) .cycle-line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
  }
  .js-learn-fx .draw-in.is-in .cycle-line {
    animation: cycle-draw 1.85s ease-out forwards;
  }
  .js-learn-fx .draw-in:not(.is-in) .cycle-fill,
  .js-learn-fx .draw-in:not(.is-in) .cycle-dots,
  .js-learn-fx .draw-in:not(.is-in) .cycle-label {
    opacity: 0;
  }
  .js-learn-fx .draw-in.is-in .cycle-fill {
    animation: cycle-fade 0.9s ease-out 1.05s forwards;
  }
  .js-learn-fx .draw-in.is-in .cycle-dots {
    animation: cycle-fade 0.55s ease-out 1.15s forwards;
  }
  .js-learn-fx .draw-in.is-in .cycle-label.is-up {
    animation: cycle-fade 0.5s ease-out 0.45s forwards;
  }
  .js-learn-fx .draw-in.is-in .cycle-label.is-drop {
    animation: cycle-fade 0.5s ease-out 1.05s forwards;
  }
  .js-learn-fx .draw-in.is-in .cycle-label.is-recover {
    animation: cycle-fade 0.5s ease-out 1.35s forwards;
  }

  .js-learn-fx .principles-emblem.draw-in:not(.is-in),
  .js-learn-fx .principle-illo.draw-in:not(.is-in) {
    opacity: 0;
    transform: translateY(8px);
  }
  .js-learn-fx .principles-emblem.draw-in.is-in,
  .js-learn-fx .principle-illo.draw-in.is-in {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
  }
}

@keyframes cycle-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes cycle-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .cycle-line,
  .cycle-fill,
  .cycle-dots,
  .cycle-label,
  .principles-emblem,
  .principle-illo {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
}

/* BTC entry on the top-page subcopy, and the cycle chart (v23) */
.btc-entry {
  color: inherit;
  font: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1.5px solid var(--accent);
  padding: 0 1px 1px;
  border-radius: 2px;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline;
}
.btc-entry-text {
  color: var(--accent-deep);
  text-shadow: 0 0 8px rgba(243, 210, 154, 0.4);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .btc-entry-text {
    background-image: linear-gradient(
      105deg,
      #c9a36a 0%,
      #e3b36e 28%,
      #fff4d4 46%,
      #f3d29a 54%,
      #e3b36e 70%,
      #c9a36a 100%
    );
    background-size: 220% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 5px rgba(227, 179, 110, 0.45));
    animation: btc-shimmer 3.2s ease-in-out infinite;
  }
}
.btc-spark {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  color: #f8e7b8;
  font-weight: 700;
  line-height: 1;
  font-size: 0.58em;
  text-shadow: 0 0 6px rgba(243, 210, 154, 0.95), 0 0 12px rgba(227, 179, 110, 0.55);
  animation: btc-twinkle 3.4s ease-in-out infinite;
}
.btc-spark-a { top: -0.62em; left: -0.28em; animation-delay: 0s; }
.btc-spark-b { top: -0.42em; right: -0.48em; font-size: 0.44em; animation-delay: 1.05s; }
.btc-spark-c { bottom: 0.02em; right: -0.62em; font-size: 0.4em; animation-delay: 2.05s; }

@keyframes btc-shimmer {
  0%, 18% { background-position: 100% 0; }
  48%, 58% { background-position: 0% 0; }
  100% { background-position: 100% 0; }
}
@keyframes btc-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.35) rotate(0deg); }
  10% { opacity: 1; transform: scale(1) rotate(18deg); }
  22% { opacity: 0.2; transform: scale(0.55) rotate(28deg); }
  32% { opacity: 0.95; transform: scale(1.08) rotate(8deg); }
  48% { opacity: 0; transform: scale(0.3) rotate(0deg); }
}

.btc-entry:hover,
.btc-entry:focus-visible {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-bottom-color: var(--accent-deep);
}
.btc-entry:hover .btc-entry-text,
.btc-entry:focus-visible .btc-entry-text {
  filter: drop-shadow(0 0 7px rgba(243, 210, 154, 0.7));
}
.btc-entry:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btc-entry:active {
  background: var(--accent-soft);
}
.btc-entry:active .btc-entry-text {
  filter: brightness(1.12) drop-shadow(0 0 7px rgba(243, 210, 154, 0.7));
}

@media (prefers-reduced-motion: reduce) {
  .btc-entry-text {
    animation: none !important;
    background-image: none !important;
    color: var(--accent-deep) !important;
    -webkit-text-fill-color: var(--accent-deep) !important;
    filter: none;
    text-shadow: 0 0 10px rgba(243, 210, 154, 0.5);
  }
  .btc-spark {
    animation: none !important;
    opacity: 0.75;
    transform: none;
  }
  .btc-spark-c { opacity: 0.45; }
}


.btc-figure {
  margin: 22px 0 0;
  padding: 0;
  background: transparent;
  border: 0;
  overflow: visible;
}
.btc-chart-scroll {
  overflow: hidden;
  background: #131722;
  border: 1px solid #1e222d;
  border-radius: 16px;
}
.btc-figure svg.btc-chart--fit {
  display: block;
  width: 100%;
  height: auto;
  background: #131722;
}
.btc-figure svg.btc-chart--wide {
  display: none;
  width: 1280px;
  max-width: none;
  height: auto;
  background: #131722;
}
.btc-figure figcaption {
  margin: 10px 2px 0;
  text-align: left;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

.btc-table-wrap { margin-top: 20px; }
.btc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  line-height: 1.5;
}
.btc-table th,
.btc-table td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.btc-table thead th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.btc-table tbody th {
  color: var(--accent-deep);
  font-weight: 700;
  white-space: nowrap;
}
.btc-table td { color: var(--ink-soft); }
.btc-table-note,
.btc-source {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
}
.btc-source { margin-top: 16px; }

.mark-peak { fill: #f3d29a; }
.mark-bottom { fill: #9dc5a8; }

@media (prefers-reduced-motion: no-preference) {
  .js-learn-fx .draw-in:not(.is-in) .btc-line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
  }
  .js-learn-fx .draw-in.is-in .btc-line {
    animation: cycle-draw 2.2s ease-out forwards;
  }
  .js-learn-fx .draw-in:not(.is-in) .btc-fill,
  .js-learn-fx .draw-in:not(.is-in) .btc-peaks,
  .js-learn-fx .draw-in:not(.is-in) .btc-bottoms,
  .js-learn-fx .draw-in:not(.is-in) .btc-mark-labels,
  .js-learn-fx .draw-in:not(.is-in) .btc-halving,
  .js-learn-fx .draw-in:not(.is-in) .btc-halving-labels {
    opacity: 0;
  }
  .js-learn-fx .draw-in.is-in .btc-fill {
    animation: cycle-fade 0.9s ease-out 1.2s forwards;
  }
  .js-learn-fx .draw-in.is-in .btc-peaks,
  .js-learn-fx .draw-in.is-in .btc-bottoms,
  .js-learn-fx .draw-in.is-in .btc-mark-labels {
    animation: cycle-fade 0.5s ease-out 1.4s forwards;
  }
  .js-learn-fx .draw-in.is-in .btc-halving,
  .js-learn-fx .draw-in.is-in .btc-halving-labels {
    animation: cycle-fade 0.5s ease-out 0.3s forwards;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btc-line, .btc-fill, .btc-peaks, .btc-bottoms, .btc-mark-labels,
  .btc-halving, .btc-halving-labels {
    animation: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
  }
}

.btc-marks {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}
.btc-marks li {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "kind when"
    "kind price"
    "kind dd";
  column-gap: 12px;
  row-gap: 0;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.btc-kind {
  grid-area: kind;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding-top: 1px;
}
.btc-marks li.is-peak .btc-kind { color: var(--accent-deep); }
.btc-marks li.is-bottom .btc-kind { color: #9dc5a8; }
.btc-when {
  grid-area: when;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
}
.btc-price {
  grid-area: price;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.btc-dd {
  grid-area: dd;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 1px;
}

/* Column: 学習の重要性 (v25) */
.learn-importance {
  margin-top: 32px;
  padding-top: 8px;
}
.learn-importance h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.15rem, 4.4vw, 1.4rem);
  line-height: 1.5;
  margin: 0 0 14px;
  letter-spacing: 0.02em;
}
.learn-compare {
  margin: 16px 0 6px;
  display: flex;
  justify-content: center;
  padding: 10px 8px 6px;
  background: #0b0a08;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.learn-compare svg {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
}
.learn-compare-link {
  margin: 14px 0 0;
  text-align: center;
}
.learn-compare-link a {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--accent-deep);
}
.learn-compare-link a:hover { color: #f6d09a; }

@media (prefers-reduced-motion: no-preference) {
  .js-learn-fx .learn-compare.draw-in:not(.is-in) {
    opacity: 0;
    transform: translateY(8px);
  }
  .js-learn-fx .learn-compare.draw-in.is-in {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
  }
}
@media (prefers-reduced-motion: reduce) {
  .learn-compare {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}


/* BTC期待値チェッカー (v27) */
.chk-lead {
  margin: -8px 0 18px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.75;
}
.chk-status {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.chk-status.is-error { color: var(--accent-deep); }
.chk-panel {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.chk-label {
  margin: 0 0 6px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.chk-usd,
.chk-ath-price {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.55rem, 7vw, 2.05rem);
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--accent-deep);
}
.chk-jpy {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.05rem, 4.2vw, 1.28rem);
  color: var(--ink);
}
.chk-ath-date {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.chk-pcts {
  margin: 2px 0 14px;
  text-align: center;
}
.chk-rise,
.chk-fourx,
.chk-from,
.chk-to {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.chk-rise { margin-bottom: 4px; }
.chk-fourx { margin: 16px 0 4px; }
.chk-from { margin: 16px 0 10px; }
.chk-rise span,
.chk-fourx span,
.chk-from span,
.chk-to span {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.7rem, 8vw, 2.25rem);
  letter-spacing: 0.02em;
  color: var(--accent-deep);
  line-height: 1.25;
}
.chk-rise .gold-rainbow,
.chk-fourx .gold-rainbow,
.chk-to .gold-rainbow {
  color: transparent;
}
.chk-rise-sub,
.chk-fourx-sub {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.chk-cycles {
  margin: 0 0 4px;
  padding: 10px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0b0a08;
  text-align: left;
}
.chk-cycles-title {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.chk-cycle-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chk-cycle-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 11px;
  line-height: 1.45;
}
.chk-cycle-when { color: var(--ink-soft); }
.chk-cycle-pct {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: 0.01em;
}
.chk-cycle-bar {
  margin-top: 3px;
  height: 6px;
  border-radius: 999px;
  background: #1a1510;
  border: 1px solid #3a2c18;
  overflow: hidden;
}
.chk-cycle-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8a6a38, var(--accent) 55%, var(--accent-deep));
}
.chk-cycle-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}
.chk-gauge-wrap { margin: 0 0 12px; }
.chk-gauge {
  margin-top: 8px;
  padding: 10px 2px 2px;
}
.chk-gauge-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #1a1510;
  border: 1px solid #5a4a28;
  overflow: visible;
}
.chk-gauge-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #8a6a38, var(--accent) 60%, var(--accent-deep));
}
.chk-gauge-mark {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--accent-deep);
  border: 2px solid #120e08;
  box-shadow: 0 0 8px rgba(243, 210, 154, 0.55);
  transform: translateY(-50%);
}
.chk-gauge-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.chk-gauge-labels .is-end { text-align: right; }
.chk-gauge-kicker {
  display: block;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-size: 0.68rem;
}
.chk-updated {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
}
.chk-refresh {
  display: block;
  width: 100%;
  margin: 16px 0 0;
  padding: 11px 16px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: #120e08;
  color: var(--accent-deep);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chk-refresh:hover { background: var(--accent-soft); }
.chk-refresh:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.chk-refresh:disabled { opacity: 0.55; cursor: wait; }

.note-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 8px 0 0;
  padding: 14px 18px 13px;
  border: 1px solid var(--accent);
  border-radius: 14px;
  background: #120e08;
  text-decoration: none;
  color: var(--accent-deep);
  text-align: center;
}
.note-link:hover {
  background: var(--accent-soft);
  color: #f6d09a;
}
.note-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.note-link-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.note-link-label svg {
  width: 0.95em;
  height: 0.95em;
  flex: 0 0 auto;
}
.note-link-title {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .chk-gauge-fill,
  .chk-gauge-mark {
    transition: none !important;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .chk-gauge-fill {
    transition: width 0.7s ease;
  }
  .chk-gauge-mark {
    transition: left 0.7s ease;
  }
}


/* v28: gold-leaning rainbow on 「あと」%, smaller checker notes, top BTC mini widget */
.gold-rainbow {
  color: var(--accent-deep);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .gold-rainbow {
    background-image: linear-gradient(
      105deg,
      #c9a36a 0%,
      #f8e7b8 12%,
      #f3d29a 20%,
      #f0b8b0 30%,
      #f6d09a 40%,
      #e3b36e 50%,
      #d0b8ea 61%,
      #f3d29a 73%,
      #b7d9d0 84%,
      #e3b36e 93%,
      #c9a36a 100%
    );
    background-size: 240% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 7px rgba(227, 179, 110, 0.45));
    animation: gold-rainbow-shift 7.5s ease-in-out infinite;
  }
}
@keyframes gold-rainbow-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .gold-rainbow {
    animation: none !important;
    background-image: none !important;
    color: var(--accent-deep) !important;
    -webkit-text-fill-color: var(--accent-deep) !important;
    filter: none;
  }
}

.chk-card .chk-lead,
.chk-card .chk-updated,
.chk-card .btc-source,
.chk-card .disclaimer,
.chk-card .chk-rise-sub,
.chk-card .chk-fourx-sub,
.chk-card .chk-cycle-note {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.chk-card .chk-cycle-note { font-size: 11px; }
.chk-card .chk-lead {
  margin: -6px 0 16px;
}
.chk-card .disclaimer {
  padding: 12px 12px 10px;
}

.btc-mini-slot {
  min-height: 2.25rem;
  margin: 12px 0 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.btc-mini {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 7px 10px 6px;
  border: 1px solid #5a4a28;
  border-radius: 999px;
  background: #120e08;
  text-decoration: none;
  color: var(--ink-soft);
  text-align: center;
  opacity: 0;
  -webkit-tap-highlight-color: transparent;
}
.btc-mini.is-ready { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .btc-mini.is-ready { transition: opacity 0.45s ease; }
}
.btc-mini:hover {
  background: var(--accent-soft);
  color: var(--ink-soft);
}
.btc-mini:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.btc-mini-line {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: baseline;
  gap: 0 0.22em;
  font-size: 0.69rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
  color: var(--ink-soft);
  white-space: nowrap;
  max-width: 100%;
}
.btc-mini-price,
.btc-mini-hypo {
  white-space: nowrap;
}
.btc-mini.is-stacked .btc-mini-line {
  flex-wrap: wrap;
  flex-direction: column;
  align-items: center;
  row-gap: 2px;
  white-space: normal;
}
.btc-mini.is-stacked .btc-mini-sep { display: none; }
.btc-mini-btc {
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: 0.04em;
}
.btc-mini-sep {
  color: var(--muted);
  font-weight: 400;
}
.btc-mini .gold-rainbow {
  font-weight: 700;
}
body[data-step="2"] .btc-mini-slot,
body[data-step="3"] .btc-mini-slot,
body[data-phase="transmit"] .btc-mini-slot,
body[data-phase="done"] .btc-mini-slot {
  display: none;
}

@media (max-width: 360px) {
  .btc-mini-line { font-size: 0.62rem; gap: 0 0.16em; }
}
