:root {
  --bg: #f3f6ec;
  --card: #ffffff;
  --ink: #24302a;
  --muted: #6a776d;
  --green: #3f7d4e;
  --green-d: #2d5e39;
  --leaf: #a9d08e;
  --mint: #e5efd9;
  --sun: #f4c34f;
  --sun-l: #fff4d4;
  --rose: #e46a5e;
  --line: #dfe6d5;
  --r: 22px;
  --shadow: 0 6px 18px rgba(45, 94, 57, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-weight: 500;
  line-height: 1.7;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--green-d); }

/* ヘッダー：左にアプリ名、右端にインスタ */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(243, 246, 236, .92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; font-weight: 900; font-size: 15px; color: var(--green-d); min-width: 0; text-align: left; }
.brand img { border-radius: 10px; flex: none; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig { display: flex; align-items: center; gap: 5px; text-decoration: none; color: var(--ink); font-size: 12px; font-weight: 700; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px 5px 7px; flex: none; }

main { max-width: 520px; margin: 0 auto; padding: 18px 16px 8px; }

.inapp { max-width: 520px; margin: 12px auto 0; padding: 0 16px; }
.inapp .box { background: var(--sun-l); border: 1.5px solid var(--sun); border-radius: 16px; padding: 12px 14px; font-size: 14px; }

.card { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card.soft { background: var(--mint); box-shadow: none; }
.card.sun { background: var(--sun-l); box-shadow: none; border: 1.5px solid #f2dd9c; }

h1 { font-size: 24px; line-height: 1.4; margin: 4px 0 10px; font-weight: 900; }
h2 { font-size: 18px; margin: 0 0 8px; font-weight: 900; }
.lead { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.small { font-size: 13px; color: var(--muted); }
.center { text-align: center; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 0; border-radius: 999px; padding: 15px 18px;
  font-weight: 900; font-size: 17px; background: var(--green); color: #fff;
  box-shadow: 0 4px 0 var(--green-d); margin: 10px 0 0; text-decoration: none;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--green-d); }
.btn.sub { background: #fff; color: var(--green-d); border: 2px solid var(--green); box-shadow: none; font-size: 15px; padding: 12px 16px; }
.btn.ghost { background: none; color: var(--muted); box-shadow: none; font-size: 14px; font-weight: 700; padding: 8px; }
.btn.yellow { background: var(--sun); color: #4a3a07; box-shadow: 0 4px 0 #d4a332; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* ホームの数字 */
.stats { display: flex; gap: 10px; margin: 6px 0 2px; }
.stat { flex: 1; background: var(--mint); border-radius: 18px; padding: 12px 10px; text-align: center; }
.stat b { display: block; font-size: 28px; line-height: 1.2; color: var(--green-d); font-weight: 900; }
.stat span { font-size: 12px; color: var(--muted); }
.chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; }
.chip button { background: none; border: 0; color: var(--green); font-size: 12px; text-decoration: underline; padding: 0; }

/* お題カード */
.topic-label { font-size: 12px; font-weight: 900; color: var(--green); letter-spacing: .08em; }
.topic { font-size: 26px; font-weight: 900; line-height: 1.35; margin: 2px 0 12px; }
.gram { background: var(--sun-l); border-radius: 16px; padding: 10px 14px; margin: 10px 0; }
.gram .gname { font-weight: 900; font-size: 16px; }
.gram .guse { font-size: 13px; color: var(--muted); }
.gram .gpat { font-family: inherit; font-size: 15px; font-weight: 700; color: #5b4708; }
.hints { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.hint { background: var(--mint); color: var(--green-d); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 700; }
.ex { margin-top: 10px; padding: 10px 14px; border-left: 4px solid var(--leaf); background: #f9fbf6; border-radius: 0 12px 12px 0; font-size: 15px; }
.ex small { display: block; color: var(--muted); font-size: 12px; }
.sec-title { font-size: 12px; font-weight: 900; color: var(--muted); margin-top: 12px; }

/* 丸いタイマー */
.ring-wrap { position: relative; width: 210px; height: 210px; margin: 10px auto 6px; }
.ring-wrap svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--mint); stroke-width: 14; }
.ring-fg { fill: none; stroke: var(--green); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.ring-fg.rec { stroke: var(--rose); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b { font-size: 52px; line-height: 1; font-weight: 900; }
.ring-center span { font-size: 13px; color: var(--muted); margin-top: 4px; }

.mic {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  width: 128px; height: 128px; margin: 8px auto; border-radius: 50%; border: 0;
  background: var(--rose); color: #fff; font-weight: 900; font-size: 15px;
  box-shadow: 0 6px 0 #b9493f;
}
.mic.stop { background: var(--ink); box-shadow: 0 6px 0 #000; }
.mic svg { width: 40px; height: 40px; margin-bottom: 4px; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 6px 0 #000, 0 0 0 0 rgba(228, 106, 94, .5); } 50% { box-shadow: 0 6px 0 #000, 0 0 0 18px rgba(228, 106, 94, 0); } }

.play { display: flex; align-items: center; gap: 10px; background: var(--mint); border-radius: 16px; padding: 8px 12px; margin: 8px 0; }
.play .pbtn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--green); color: #fff; flex: none; display: flex; align-items: center; justify-content: center; }
.play .pinfo { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; }
.play .pinfo small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.play .save { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--green-d); flex: none; }

textarea, input[type=text] {
  width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px;
  font: inherit; font-size: 16px; background: #fff; color: var(--ink); resize: vertical;
}
textarea:focus, input[type=text]:focus { outline: none; border-color: var(--leaf); }

.steps { display: flex; justify-content: center; gap: 6px; margin: 0 0 10px; }
.steps i { width: 26px; height: 6px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--green); }

.opts { display: grid; gap: 8px; margin: 10px 0; }
.opt { text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; font-weight: 700; font-size: 15px; }
.opt.on { border-color: var(--green); background: var(--mint); }

/* 記録 */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head button { background: var(--mint); border: 0; border-radius: 999px; width: 36px; height: 36px; font-weight: 900; color: var(--green-d); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: 11px; color: var(--muted); font-weight: 700; }
.cal .d { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; border-radius: 50%; position: relative; }
.cal .d.has { background: var(--green); color: #fff; font-weight: 900; }
.cal .d.today { outline: 2px solid var(--sun); outline-offset: -2px; }
.entry { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.entry:first-child { border-top: 0; padding-top: 0; }
.entry .date { font-size: 12px; color: var(--muted); font-weight: 700; }
.entry .t { font-size: 17px; font-weight: 900; }
.tag { display: inline-block; font-size: 11px; font-weight: 900; border-radius: 999px; padding: 1px 8px; background: var(--sun-l); color: #6b5410; margin-left: 4px; vertical-align: 2px; }
.memo { background: #f9fbf6; border-radius: 12px; padding: 8px 12px; font-size: 14px; margin: 6px 0; white-space: pre-wrap; }
.del { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; padding: 4px 0; }

.big-emoji { font-size: 56px; text-align: center; line-height: 1.2; margin: 6px 0; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
.err { background: #fde9e6; border: 1.5px solid #f2b3ab; border-radius: 14px; padding: 10px 14px; font-size: 14px; margin-top: 10px; }

.foot { max-width: 520px; margin: 10px auto 0; padding: 16px 16px 34px; text-align: center; font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); }
.foot p { margin: 8px 0; }
.foot .made { font-weight: 700; color: var(--ink); }
.foot .links a { font-weight: 700; }

@media (max-width: 420px) {
  .brand { font-size: 14px; }
  .ig span { display: none; }
  .ig { padding: 6px; }
}

/* 話しはじめの一言 */
.opener { background: var(--mint); border-radius: 16px; padding: 12px 14px; margin: 4px 0 10px; }
.opener-en { font-size: 18px; font-weight: 900; color: var(--green-d); line-height: 1.45; }
.opener-note { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* 隠したヒント */
.more { margin-top: 6px; }
.more summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; background: var(--sun-l); border: 1.5px solid #f2dd9c; color: #6b5410; font-weight: 900; font-size: 14px; border-radius: 999px; padding: 6px 14px; }
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { margin-bottom: 8px; }
