:root {
  --bg1: #e8f6fd;
  --bg2: #f7fcff;
  --ink: #22485c;
  --ink-soft: #4d7186;
  --line: #c6e4f5;
  --blue: #2f8fd0;
  --blue-deep: #1f74b5;
  --blue-soft: #e3f2fc;
  --card: #ffffff;
  --danger: #c0392b;
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Maru Gothic ProN", "M PLUS Rounded 1c",
    "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg1), var(--bg2) 420px);
  line-height: 1.7;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ---------- hero ---------- */
.hero { text-align: center; padding: 12px 4px 4px; }
.hero-img {
  width: min(340px, 80%);
  border-radius: 28px;
  box-shadow: 0 10px 30px rgba(47, 143, 208, 0.18);
}
.hero h1 {
  font-size: clamp(26px, 6.4vw, 40px);
  font-weight: 800;
  margin: 18px 0 10px;
  letter-spacing: 0.02em;
}
.h1-emoji { font-size: 0.85em; }
.empathy { margin: 2px 0; color: var(--ink-soft); font-size: 16px; }
.desc { margin: 12px 0 2px; font-size: 17px; font-weight: 700; }
.call { margin: 2px 0 14px; font-size: 16px; }
.note { margin: 0; font-size: 13px; color: var(--ink-soft); }
.privacy {
  margin: 8px auto 0;
  max-width: 560px;
  font-size: 13px;
  color: var(--blue-deep);
  background: var(--blue-soft);
  border-radius: 999px;
  padding: 6px 14px;
}

/* ---------- panels ---------- */
.panel {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-top: 22px;
  box-shadow: 0 6px 18px rgba(47, 143, 208, 0.08);
}
.panel h2 { font-size: 19px; margin: 0 0 6px; }
.panel h3 { font-size: 16px; margin: 16px 0 6px; }
.panel-sub { font-size: 13px; color: var(--ink-soft); margin: 0 0 12px; }

.field { margin-bottom: 18px; }
.label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 15px; }

textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  resize: vertical;
  background: #fbfdff;
}
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 143, 208, 0.18);
}

/* recipient pills */
.recipients { display: flex; flex-wrap: wrap; gap: 8px; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 15px;
}
.pill input:checked + span {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 700;
}
.pill input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(47, 143, 208, 0.3);
}

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit;
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--blue-soft);
  color: var(--blue-deep);
  cursor: pointer;
}
.chip:hover { border-color: var(--blue); }

/* buttons */
.btn-main {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #4aa8e3, var(--blue));
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(47, 143, 208, 0.3);
}
.btn-main:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.btn-sub {
  font: inherit;
  font-size: 15px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--blue-deep);
  cursor: pointer;
}
.btn-sub:disabled { opacity: 0.5; cursor: default; }
.btn-link {
  display: block;
  margin: 12px auto 0;
  font: inherit;
  font-size: 14px;
  background: none;
  border: none;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
}

.memo-tools { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.voice-note { font-size: 13px; color: var(--ink-soft); }
.voice-note.listening { color: var(--blue-deep); font-weight: 700; }

.status { font-size: 14px; color: var(--ink-soft); text-align: center; min-height: 1.4em; margin: 12px 0 0; }
.error {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fdeceb;
  color: var(--danger);
  font-size: 14px;
}

/* questions */
.question { margin-bottom: 16px; }
.question p { margin: 0 0 4px; font-weight: 700; }
.question .hint { font-size: 13px; color: var(--ink-soft); margin: 0 0 6px; font-weight: 400; }

/* result card */
.card-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.card-item:last-child { border-bottom: none; }
.num {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.card-item .q { font-size: 13px; color: var(--ink-soft); margin: 0; }
.card-item .a { margin: 2px 0 0; font-size: 16px; white-space: pre-wrap; }
.card-item .a.missing { color: #9db8c6; font-size: 14px; }
#missing-box {
  margin-top: 14px;
  background: var(--blue-soft);
  border-radius: 16px;
  padding: 6px 16px 12px;
}
#missing-box ul { margin: 4px 0 6px; padding-left: 20px; }
.result-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.result-actions .btn-link { margin: 0; }

/* history */
.history-list { list-style: none; margin: 0; padding: 0; }
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
}
.history-item:last-child { border-bottom: none; }
.history-main {
  flex: 1;
  text-align: left;
  font: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: 0;
}
.history-main .meta { font-size: 12px; color: var(--ink-soft); display: block; }
.history-main .excerpt { font-size: 15px; display: block; }
.history-del {
  font: inherit;
  font-size: 13px;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--ink-soft);
  cursor: pointer;
}

footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 12px;
  margin-top: 28px;
}
footer p { margin: 2px 0; }
