/* ヤンドル：やわらかい藤色と桃色。字は地との差 4.5 以上。 */

[hidden] { display: none !important; }

:root {
  --bg: #f7f0fb;
  --surface: #ffffff;
  --line: #e6d8f0;
  --text: #2b2236;
  --muted: #625573;
  --pink: #e9669d;
  --pink-soft: #fde8f1;
  --pink-text: #b0336b;
  --lav: #8e6fd8;
  --lav-soft: #efe8fb;
  --lav-text: #6446b8;
  --gold-text: #8a5b05;
  --gold-soft: #fff4d9;
  --bad: #b3362c;
  --bar: rgba(250, 245, 253, 0.92);
  --shadow: 0 6px 18px rgba(110, 70, 160, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--text);
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(110% 45% at 50% -10%, rgba(233, 102, 157, 0.16), transparent 60%),
    linear-gradient(180deg, #f3e9fb 0%, #f7f0fb 40%, #fbf8fd 100%);
  background-attachment: fixed;
}
main { max-width: 640px; margin: 0 auto; padding: 0 14px 48px; }

/* ---- 上の帯 ---- */
.top {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bar);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
h1 { margin: 0; font-size: 1.15rem; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.title {
  font-weight: 800; letter-spacing: 0.1em; text-decoration: none;
  background: linear-gradient(90deg, #c63f7c, #7350c9);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle { font-size: 0.68rem; font-weight: 600; color: var(--muted); letter-spacing: 0.06em; }
.tabs { display: flex; gap: 6px; flex-shrink: 0; }
.tab {
  position: relative; padding: 5px 14px; font-size: 0.85rem; font-weight: 700; text-decoration: none;
  color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px;
}
.tab.on { color: #fff; background: var(--lav-text); border-color: var(--lav-text); }
.dot {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 0.7rem; line-height: 18px; text-align: center; color: #fff; background: var(--pink-text); border-radius: 999px;
}

/* ---- 文字と札 ---- */
h2 { margin: 22px 0 8px; font-size: 1rem; }
h3 { margin: 14px 0 6px; font-size: 0.9rem; color: var(--muted); }
.msg { min-height: 1.4em; margin: 10px 0 4px; font-size: 0.9rem; color: var(--pink-text); font-weight: 600; }
.msg:empty { display: none; }
.quiet { color: var(--muted); }
.small { font-size: 0.82rem; }
.center { text-align: center; }
.lead { margin: 0 0 8px; font-weight: 700; font-size: 1.02rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 12px 0; box-shadow: var(--shadow);
}
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

label { display: block; margin: 12px 0 4px; font-size: 0.84rem; color: var(--muted); }
input, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--lav); outline-offset: 1px; }
button, .btn {
  display: inline-block; padding: 8px 16px; font: inherit; font-size: 0.9rem; font-weight: 600; text-decoration: none;
  color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
button.primary, .btn.primary { color: #fff; background: linear-gradient(90deg, #d44d8a, #7a55d0); border-color: transparent; }
button.danger { color: var(--bad); border-color: rgba(179, 54, 44, 0.35); }
form .primary { margin-top: 14px; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--lav-text); outline-offset: 2px; }

.badge {
  display: inline-block; padding: 1px 8px; font-size: 0.75rem; font-weight: 700;
  color: var(--gold-text); background: var(--gold-soft); border: 1px solid rgba(201, 138, 28, 0.35); border-radius: 999px;
}
.invite { background: var(--lav-soft); border-color: rgba(142, 111, 216, 0.35); }

/* ---- 聞き手の札 ---- */
.lcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lcard a {
  display: block; padding: 14px 16px; text-decoration: none; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.lcard.yandoru a { border-color: rgba(201, 138, 28, 0.55); background: linear-gradient(180deg, #fffaf0, #fff); }
.lname { margin: 0; font-weight: 800; font-size: 1.05rem; }
.lstars { margin: 2px 0 0; font-size: 0.85rem; color: var(--gold-text); font-weight: 700; }
.lintro { margin: 6px 0 0; font-size: 0.9rem; }
.lrecent { display: block; margin-top: 4px; color: var(--muted); font-size: 0.78rem; }
.foot { max-width: 640px; margin: 0 auto; padding: 0 14px calc(28px + env(safe-area-inset-bottom)); text-align: center; font-size: 0.8rem; }
.foot a { color: var(--muted); }

/* ---- 話の並び ---- */
.talks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.titem a {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; text-decoration: none; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
}
.titem.ended a { background: #faf7fc; color: var(--muted); }
.tname { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 0.72rem; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.unread { min-width: 22px; height: 22px; padding: 0 6px; font-size: 0.75rem; line-height: 22px; text-align: center; color: #fff; background: var(--pink-text); border-radius: 999px; }
.ttime { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

/* ---- 聞き手の自分の札・頁 ---- */
.me-name { margin: 0; font-weight: 800; font-size: 1.15rem; }
.stars-line { margin: 2px 0 6px; color: var(--gold-text); font-weight: 700; }
.intro { margin: 6px 0; white-space: pre-wrap; }
.lhead .btn { margin-top: 10px; }
.rules { margin: 14px 0 0; padding-left: 1.2em; font-size: 0.84rem; color: var(--muted); }
.edit { margin-top: 12px; }
.edit summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
.reviews { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.review { padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.rstars { margin: 0; color: var(--gold-text); letter-spacing: 0.1em; }
.rcomment { margin: 4px 0; white-space: pre-wrap; }

/* ---- 話 ---- */
.talk-head { margin: 14px 0 6px; }
.talk-head .who { margin: 0; font-weight: 800; font-size: 1.1rem; }
.talk-head p { margin: 0; }
.msgs { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 82%; }
.bubble.mine { align-self: flex-end; }
.bubble.theirs { align-self: flex-start; }
.btext {
  margin: 0; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 18px;
}
.mine .btext { background: var(--lav-soft); border: 1px solid rgba(142, 111, 216, 0.3); border-bottom-right-radius: 6px; }
.theirs .btext { background: var(--pink-soft); border: 1px solid rgba(233, 102, 157, 0.3); border-bottom-left-radius: 6px; }
.bmeta { display: block; margin-top: 2px; font-size: 0.72rem; color: var(--muted); }
.mine .bmeta { text-align: right; }
.say {
  position: sticky; bottom: 0; display: flex; gap: 8px; align-items: flex-end;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(251, 248, 253, 0), #fbf8fd 30%);
}
.say textarea { flex: 1; }
.say .primary { margin: 0; }
.actions { margin-top: 14px; }

/* ---- 評価 ---- */
.star-pick { display: flex; gap: 6px; margin: 8px 0; }
.star-pick button { padding: 4px 8px; font-size: 1.8rem; line-height: 1; color: #d9cfe3; background: transparent; border: none; }
.star-pick button.on { color: #e0a21a; }

/* ---- 相談窓口 ---- */
.hotlines { margin: 10px 0 14px; padding-left: 1.1em; }
.hotlines li { margin: 0 0 10px; }
.hotlines a { font-weight: 700; color: var(--lav-text); }

/* ---- 募集・見ただけ・通知 ---- */
.req-mine { background: var(--lav-soft); border-color: rgba(142, 111, 216, 0.35); }
.req-new p.small { margin: 0 0 12px; }
.peeks { margin: 0 0 8px; color: var(--bad); font-weight: 600; }
.push-box { margin: 12px 0; }
.push-box .push-note { margin: 0 0 6px; }
.titem .seen { font-size: 0.72rem; color: var(--muted); }

/* ---- 記録を残す・記録・病んだ ---- */
.keep { margin: 6px 0 10px; padding: 10px 12px; background: #fff; border: 1px dashed var(--line); border-radius: 14px; }
.keep p { margin: 6px 0 0; }
.keep button.on { color: #fff; background: var(--lav-text); border-color: var(--lav-text); }
.sick-btn { display: block; width: 100%; margin: 10px 0 4px; text-align: left; color: var(--bad); border-color: rgba(179, 54, 44, 0.35); }
.sick-btn.on { color: #fff; background: var(--bad); border-color: var(--bad); }
.rsick { margin: 0; color: var(--bad); font-weight: 700; }
#t-public .btn, #t-public button { margin: 4px; }
.tabs .tab { padding: 5px 11px; }
/* 並びの行が長い字で画面の外へ伸びないように（grid の行は中身の幅まで広がるため）。 */
.talks, .lcards, .reviews { grid-template-columns: minmax(0, 1fr); }
.talks > li, .lcards > li, .reviews > li { min-width: 0; }
.titem a { min-width: 0; }
/* はじめに（畳んでおく）。 */
.notes summary { cursor: pointer; list-style: none; margin: 0; }
.notes summary::-webkit-details-marker { display: none; }
.notes summary::after { content: " ▸"; font-weight: 400; }
.notes[open] summary { margin-bottom: 8px; }
.notes[open] summary::after { content: " ▾"; }
.notes ul { margin: 0; padding-left: 1.2em; font-size: 0.86rem; color: var(--muted); }
