/* Mikata design tokens — "quiet luxury" refresh over the approved v2.1 palette.
   藍 = trust (primary) / 琥珀(brass) = あなたの番 (act, next-action ONLY) / 緑 = safe & free (go)
   金 = antique-gold accent (decorative hairlines & marks only, never a semantic state). */
:root {
  --bg: #f4f2ec;
  --bg-2: #efece4;
  --card: #ffffff;
  --card-2: #faf9f5;
  --text: #1a222e;
  --muted: #6b7280;
  --line: #e7e4db;
  --line-strong: #d9d5c9;
  --primary: #1f3252;
  --primary-tint: #eef1f6;
  --gold: #9c7c3c;
  --gold-soft: #c6a862;
  --act: #97670d;
  --act-bg: #fbf3e1;
  --go: #2e7d4f;
  --go-bg: #ecf5ef;
  --danger: #a4373a;
  /* text colors on filled primary/act surfaces (dark theme flips them) */
  --on-primary: #ffffff;
  --on-act: #ffffff;
  --shadow-sm: 0 1px 2px rgba(20, 30, 48, .05), 0 1px 1px rgba(20, 30, 48, .04);
  --shadow-md: 0 2px 6px rgba(20, 30, 48, .05), 0 14px 34px -18px rgba(20, 30, 48, .20);
  --shadow-lg: 0 4px 14px rgba(20, 30, 48, .07), 0 30px 64px -28px rgba(20, 30, 48, .32);
  --font-sans: "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", "MS Mincho", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-2: #0a0e14;
    --card: #161c26;
    --card-2: #1b222e;
    --text: #e9ebef;
    --muted: #98a1ad;
    --line: #29313d;
    --line-strong: #363f4d;
    --primary: #9fb6dd;
    --primary-tint: #1d2536;
    --gold: #c9a44e;
    --gold-soft: #d8bd7c;
    --act: #e2a94e;
    --act-bg: #2b2314;
    --go: #6fbf92;
    --go-bg: #16281e;
    --danger: #e08a8c;
    --on-primary: #0d1117;
    --on-act: #0d1117;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, .40), 0 18px 40px -20px rgba(0, 0, 0, .70);
    --shadow-lg: 0 6px 18px rgba(0, 0, 0, .45), 0 34px 70px -28px rgba(0, 0, 0, .80);
  }
}
:root[data-theme="light"] {
  --bg: #f4f2ec; --bg-2: #efece4; --card: #ffffff; --card-2: #faf9f5;
  --text: #1a222e; --muted: #6b7280; --line: #e7e4db; --line-strong: #d9d5c9;
  --primary: #1f3252; --primary-tint: #eef1f6; --gold: #9c7c3c; --gold-soft: #c6a862;
  --act: #97670d; --act-bg: #fbf3e1; --go: #2e7d4f; --go-bg: #ecf5ef; --danger: #a4373a;
  --on-primary: #ffffff; --on-act: #ffffff;
  --shadow-sm: 0 1px 2px rgba(20, 30, 48, .05), 0 1px 1px rgba(20, 30, 48, .04);
  --shadow-md: 0 2px 6px rgba(20, 30, 48, .05), 0 14px 34px -18px rgba(20, 30, 48, .20);
  --shadow-lg: 0 4px 14px rgba(20, 30, 48, .07), 0 30px 64px -28px rgba(20, 30, 48, .32);
}
:root[data-theme="dark"] {
  --bg: #0d1117; --bg-2: #0a0e14; --card: #161c26; --card-2: #1b222e;
  --text: #e9ebef; --muted: #98a1ad; --line: #29313d; --line-strong: #363f4d;
  --primary: #9fb6dd; --primary-tint: #1d2536; --gold: #c9a44e; --gold-soft: #d8bd7c;
  --act: #e2a94e; --act-bg: #2b2314; --go: #6fbf92; --go-bg: #16281e; --danger: #e08a8c;
  --on-primary: #0d1117; --on-act: #0d1117;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, .40), 0 18px 40px -20px rgba(0, 0, 0, .70);
  --shadow-lg: 0 6px 18px rgba(0, 0, 0, .45), 0 34px 70px -28px rgba(0, 0, 0, .80);
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 620px at 78% -8%, var(--bg-2), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* header / account menu / phone tab bar: see the 'site navigation' block at the end */
.brand { font-size: 20px; font-weight: 700; color: var(--primary); display: inline-flex; align-items: center; gap: 9px; letter-spacing: .01em; }
.brand-mark {
  display: block; width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 70%, transparent), var(--shadow-sm);
}
.brand-note { color: var(--muted); font-size: 12.5px; letter-spacing: .02em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 30px 20px 64px; }
.site-foot { max-width: 1040px; margin: 0 auto; padding: 22px 20px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.site-foot a { color: var(--primary); font-weight: 600; margin: 0 2px; }
.site-foot a:hover { text-decoration: underline; }

/* shared display-heading treatment: serif + gold hairline accent */
.hero h1, .auth-page h1, .pricing-page h1, .legal-page h1, .doc-title {
  font-family: var(--font-serif); font-weight: 600; letter-spacing: .01em;
}

/* ---- home ---- */
.hero { padding: 30px 4px 12px; }
.hero h1 { font-size: 33px; line-height: 1.42; color: var(--primary); }
.hero h1::after {
  content: ""; display: block; width: 56px; height: 2px; margin-top: 16px;
  background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 10%, transparent));
  border-radius: 2px;
}
.hero p { margin-top: 14px; color: var(--muted); font-size: 15px; }
.section { margin-top: 38px; }
.section-title { font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 14px; letter-spacing: .08em; text-transform: uppercase; }

.kata-search { margin-bottom: 18px; }
.kata-search-input {
  width: 100%; font: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px; font-size: 14.5px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.kata-search-input:focus { outline: none; border-color: var(--gold-soft); box-shadow: var(--shadow-sm), 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.kata-search-empty {
  display: none; color: var(--muted); font-size: 13.5px;
  background: var(--primary-tint); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px;
}

.kata-jump {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; padding-bottom: 2px;
}
/* Narrow screens: one swipeable row instead of wrapping, to keep the categories
   from pushing the kata cards off the first screen. */
@media (max-width: 640px) {
  .kata-jump {
    flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .kata-jump::-webkit-scrollbar { display: none; }
}
.kata-jump-chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px;
  background: var(--card); color: var(--primary); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 15px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.kata-jump-chip:hover { border-color: var(--gold-soft); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kata-jump-count { color: var(--muted); font-weight: 500; }

.kata-section { margin-top: 28px; }
.kata-section:first-of-type { margin-top: 0; }
.kata-section-title {
  font-size: 14.5px; font-weight: 700; color: var(--text); margin-bottom: 12px;
  scroll-margin-top: 76px; display: flex; align-items: center; gap: 9px;
}
.kata-section-title::before {
  content: ""; width: 3px; height: 15px; border-radius: 2px;
  background: linear-gradient(var(--gold), var(--gold-soft)); flex-shrink: 0;
}
.kata-section-count { color: var(--muted); font-weight: 500; margin-left: 2px; }

.kata-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.kata-card-form { display: contents; }
.kata-card {
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; width: 100%; color: var(--text); box-shadow: var(--shadow-sm);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
button.kata-card { position: relative; overflow: hidden; }
button.kata-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--gold), var(--gold-soft));
  opacity: 0; transition: opacity .18s;
}
button.kata-card:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--shadow-md); }
button.kata-card:hover::before { opacity: 1; }
.kata-name { font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.kata-tagline { color: var(--muted); font-size: 13.5px; }
.kata-urgent { color: var(--act); font-size: 12.5px; font-weight: 700; }
.kata-cta {
  margin-top: 8px; align-self: flex-start;
  background: var(--go-bg); color: var(--go); font-weight: 700; font-size: 13px;
  padding: 6px 15px; border-radius: 999px;
}
.kata-card.more {
  margin-top: 24px; flex-direction: row; align-items: baseline; gap: 14px;
  border-style: dashed; box-shadow: none;
}
.kata-more {
  display: block; width: 100%; margin-top: 12px; min-height: 46px;
  background: var(--card); color: var(--primary); border: 1px dashed var(--line-strong);
  border-radius: 12px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.kata-more:hover { border-color: var(--primary); background: var(--primary-tint); }
.kata-more[hidden] { display: none; }
.kata-card.more .kata-name { font-size: 14.5px; color: var(--muted); }

.case-list { display: flex; flex-direction: column; gap: 9px; }
.case-row {
  display: flex; align-items: baseline; gap: 8px 14px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 14px 17px;
  box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.case-row:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.case-row-title { font-weight: 700; }
.case-row-meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.case-row-go { margin-left: auto; color: var(--act); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.case-badge {
  font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--primary-tint); color: var(--primary); white-space: nowrap;
}
.case-badge.stage { background: var(--go-bg); color: var(--go); }
.case-badge.over { background: var(--act-bg); color: var(--act); }
.closed-card { border-color: var(--line); background: var(--card-2); box-shadow: none; }
.closed-card h3 { color: var(--muted); }
.closed-card form { margin-top: 8px; }
.closed-details summary { cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }
.case-row.closed { opacity: .72; box-shadow: none; }

.safe-note ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.safe-note li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; font-size: 14px; box-shadow: var(--shadow-sm); }

/* ---- case: cowork layout ---- */
.cowork { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 16px; margin-top: 18px; }
@media (max-width: 860px) { .cowork { grid-template-columns: 1fr; } }

/* Mobile-only: dates that are close or past and the urgent note, placed above .chat.
   Above the 860px breakpoint .cowork is two columns and the panel already shows them. */
.cowork-top-alert { display: none; flex-direction: column; gap: 12px; }
@media (max-width: 860px) {
  .cowork-top-alert { display: flex; }
  .panel .urgent-card { display: none; }
}

.chat {
  display: flex; flex-direction: column; height: 640px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.chat-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 18px; scrollbar-gutter: stable;
  display: flex; flex-direction: column; gap: 10px;
}
/* Bottom-aligned without justify-content:flex-end: with flex-end the older
   messages overflow upward, out of reach of the scrollbar. */
.chat-body > :first-child { margin-top: auto; }
.chat-body.is-measuring > :first-child { margin-top: 0; }
.msg { max-width: 85%; padding: 11px 15px; border-radius: 15px; font-size: 14.5px; white-space: pre-wrap; box-shadow: var(--shadow-sm); }
.msg.assistant { background: var(--primary-tint); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--primary); color: var(--on-primary); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.typing { color: var(--muted); font-size: 13px; box-shadow: none; }
.msg.is-unsent { opacity: 0.65; }
.msg-unsent-tag { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--danger); }
.msg-h { display: block; font-weight: 700; margin: 2px 0 4px; }
.msg-h:first-child { margin-top: 0; }
.chat-tools { display: flex; gap: 6px; padding: 8px 10px 0; border-top: 1px solid var(--line); }
.chat-input { display: flex; gap: 8px; padding: 8px 10px 10px; }
.chat-input textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 13px; font: inherit; font-size: 14px; background: var(--bg); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.chat-input textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.btn-send {
  background: var(--act);
  background: linear-gradient(180deg, color-mix(in srgb, var(--act) 88%, #fff), var(--act));
  color: var(--on-act); border: 0; border-radius: 11px;
  padding: 0 22px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 8px 18px -10px color-mix(in srgb, var(--act) 70%, transparent);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn-send:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 2px 4px rgba(0, 0, 0, .14), 0 12px 24px -10px color-mix(in srgb, var(--act) 72%, transparent); }
.btn-send:active { transform: translateY(0); filter: brightness(.98); }
.btn-send:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; filter: none; }

/* ---- case: right panel ---- */
.panel { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 15px 17px; box-shadow: var(--shadow-sm); }
.card h3 { font-size: 13.5px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.card p { font-size: 13.5px; }
.urgent-card { border-color: var(--act); background: var(--act-bg); color: var(--act); font-size: 13px; font-weight: 600; }
.ev-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ev { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.ev.collected { color: var(--text); }
.ev-head {
  display: flex; gap: 8px; align-items: flex-start; width: 100%;
  background: none; border: 0; padding: 0; font: inherit; color: inherit;
  text-align: left; cursor: pointer;
}
.ev-head:hover .ev-label { color: var(--text); text-decoration: underline; }
.ev-mark { color: var(--go); font-weight: 700; flex-shrink: 0; }
.ev.pending .ev-mark { color: var(--line-strong); }
.ev-detail { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 6px 22px; }
.ev-detail[hidden] { display: none; }
.ev-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-mini {
  background: var(--card-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 6px 11px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.btn-mini:hover { border-color: var(--primary); color: var(--primary); }
.ev-file { color: var(--primary); font-size: 12.5px; }
.card-hint { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.facts { display: flex; flex-direction: column; gap: 5px; }
.fact { display: flex; gap: 8px; font-size: 13px; }
.fact dt { color: var(--muted); flex-shrink: 0; min-width: 84px; font-weight: 600; }
.fact dd { color: var(--text); }

/* ---- documents ---- */
.doc-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.doc-item { display: flex; flex-direction: column; }
.doc-item a { color: var(--primary); font-size: 13.5px; font-weight: 600; }
.doc-meta { color: var(--muted); font-size: 11.5px; }
.doc-spec { margin-bottom: 8px; }
.doc-spec .card-hint { margin-bottom: 4px; }

.doc-page { max-width: 860px; margin: 0 auto; }
.doc-head { display: flex; align-items: baseline; gap: 12px; margin: 20px 0 14px; flex-wrap: wrap; }
.doc-back { color: var(--muted); font-size: 13px; }
.doc-title { font-size: 22px; }
.doc-status { font-size: 11.5px; font-weight: 700; padding: 2px 11px; border-radius: 999px; background: var(--primary-tint); color: var(--primary); }
.doc-status.final { background: var(--go-bg); color: var(--go); }
.doc-guide { margin-bottom: 12px; }
.fill-card { margin-bottom: 12px; }
.fill-card h2 { font-size: 15px; margin: 0 0 4px; }
.fill-card .fill-count { color: var(--muted); font-weight: 500; }
.fill-row {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 0;
  border-top: 1px solid var(--line);
}
.fill-row:first-of-type { border-top: none; padding-top: 8px; }
.fill-row label { font-size: 13px; font-weight: 600; }
.fill-ask-hint {
  background: var(--primary-tint); border-radius: 10px; padding: 10px 13px;
  font-size: 12.5px; line-height: 1.65; color: var(--text); margin: 4px 0 6px;
}

/* Small "?" that opens a plain-language explanation of a legal term. */
.term-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; margin-left: 5px; padding: 0; vertical-align: baseline;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--line));
  border-radius: 999px; background: var(--card); color: var(--primary);
  font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer;
  transition: background .15s, color .15s;
}
.term-help:hover { background: var(--primary); color: #fff; }

.term-pop {
  position: fixed; z-index: 60; max-width: min(340px, calc(100vw - 24px));
  background: var(--card); border: 1px solid var(--line-strong);
  border-radius: 12px; box-shadow: var(--shadow-md); padding: 13px 15px 14px;
}
.term-pop-close {
  position: absolute; top: 6px; right: 8px; border: none; background: none;
  color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; padding: 2px;
}
.term-pop-title { font-size: 13.5px; font-weight: 700; margin: 0 18px 5px 0; color: var(--primary); }
.term-pop-body { font-size: 12.5px; line-height: 1.7; margin: 0; color: var(--text); }

.term-glossary { margin-top: 14px; }
.term-glossary h2 { font-size: 15px; margin: 0 0 4px; }
.term-glossary-hint { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.term-item { border-top: 1px solid var(--line); padding: 9px 0; }
.term-item:first-of-type { border-top: none; }
.term-item summary {
  cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.term-item summary::-webkit-details-marker { display: none; }
.term-item .term-q {
  flex: none; width: 20px; height: 20px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--line));
  color: var(--primary); font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.term-item[open] .term-q { background: var(--primary); color: #fff; border-color: var(--primary); }
.term-item p { font-size: 12.5px; line-height: 1.75; color: var(--muted); margin: 8px 0 2px; }

/* Read view: a read-only mirror of the body with jargon marked inline. */
.doc-read-toggle-bar { margin-bottom: 8px; }
.doc-read {
  border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px;
  background: var(--bg); color: var(--text);
  font-family: var(--font-serif, inherit); font-size: 14.5px; line-height: 1.95;
  white-space: pre-wrap; word-break: break-word; min-height: 220px;
}
.term-mark {
  display: inline; white-space: nowrap;
  color: var(--primary); cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.term-mark:hover { text-decoration-style: solid; }
.term-mark:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }
.term-qi {
  font-size: .68em; vertical-align: super; margin-left: 1px;
  font-weight: 700; color: var(--primary);
}
@media print {
  .term-help, .term-glossary, .doc-read, .doc-read-toggle-bar { display: none; }
}
.fill-row input {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  font: inherit; font-size: 13.5px; background: var(--bg); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.fill-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.fill-row.done input { border-color: var(--go); color: var(--muted); background: var(--go-bg); }
.fill-row-done-mark { display: none; color: var(--go); font-size: 12.5px; font-weight: 700; }
.fill-row.done .fill-row-done-mark { display: inline; }
.fill-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.fill-save-toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.fill-save-hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.fill-all-done {
  background: var(--go-bg); color: var(--go); border-radius: 12px;
  padding: 12px 16px; font-size: 13.5px; font-weight: 600; margin-bottom: 12px;
}
.fill-warning {
  background: var(--act-bg); color: var(--act); border-radius: 12px;
  padding: 12px 16px; font-size: 13.5px; font-weight: 600; margin-bottom: 12px;
}
.doc-form textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 24px; background: var(--card); color: var(--text);
  font-family: var(--font-serif); font-size: 14.5px; line-height: 1.95;
  resize: vertical; box-shadow: var(--shadow-sm);
}
.doc-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--shadow-sm), 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.doc-actions { display: flex; gap: 8px; margin-top: 10px; }
.doc-actions .btn-send { padding: 8px 22px; }
#doc-print-area { display: none; }
@media print {
  /* Hide everything except the print area, using display:none so no hidden
     content keeps layout height (which was inserting blank pages between the
     filing and its glossary). The print area then flows normally from the top,
     so page-break-before lands the glossary on its own clean page. */
  /* only on the document page: the summary page and the call crib sheet print themselves */
  .site-head, .site-foot { display: none !important; }
  .wrap:has(#doc-print-area) > *:not(#doc-print-area) { display: none !important; }
  .wrap:has(#doc-print-area) { max-width: none; margin: 0; padding: 0; }
  #doc-print-area {
    display: block !important; margin: 0; padding: 0; color: #000;
    font-family: "MS Mincho", "Yu Mincho", serif;
  }
  .print-body {
    white-space: pre-wrap; margin: 0; padding: 0;
    font-size: 12pt; line-height: 1.9; color: #000;
    font-family: "MS Mincho", "Yu Mincho", serif;
  }
  .print-glossary[hidden] { display: none; }
  .print-glossary {
    page-break-before: always; break-before: page; color: #000;
    font-family: "MS Mincho", "Yu Mincho", serif;
  }
  .print-gloss-head {
    font-size: 10.5pt; border: 1pt solid #000; padding: 5pt 7pt;
    text-align: center; margin: 0 0 14pt;
  }
  .print-gloss-title { font-size: 13pt; margin: 0 0 10pt; }
  .print-glossary dl { margin: 0; }
  .print-glossary dt { font-weight: 700; font-size: 11pt; margin-top: 10pt; }
  .print-glossary dd { margin: 2pt 0 0; font-size: 10.5pt; line-height: 1.7; }
}

/* ---- auth ---- */
.auth-page { max-width: 424px; margin: 52px auto 0; }
.auth-page h1 { font-size: 26px; color: var(--primary); margin-bottom: 10px; }
.auth-page h1::after {
  content: ""; display: block; width: 44px; height: 2px; margin-top: 12px;
  background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 10%, transparent));
  border-radius: 2px;
}
.auth-lead { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-md); }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-form label { font-size: 13px; font-weight: 600; color: var(--muted); }
.auth-form input {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  font: inherit; font-size: 14px; background: var(--bg); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.auth-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.auth-submit { padding: 12px 22px; }
.auth-alt { margin-top: 16px; font-size: 13px; color: var(--muted); }
.auth-alt a { color: var(--primary); font-weight: 600; }
.form-error { background: var(--act-bg); color: var(--act); border-radius: 10px; padding: 11px 15px; font-size: 13px; margin-bottom: 12px; border: 1px solid color-mix(in srgb, var(--act) 30%, transparent); }
.form-success { background: var(--go-bg); color: var(--go); border-radius: 10px; padding: 11px 15px; font-size: 13px; margin-bottom: 12px; border: 1px solid color-mix(in srgb, var(--go) 28%, transparent); }

.auth-or {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0; color: var(--muted); font-size: 12px;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-oauth-group { display: flex; flex-direction: column; gap: 10px; }
.btn-oauth {
  display: flex; align-items: center; justify-content: center;
  height: 46px; border-radius: 10px; font-weight: 600; font-size: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
.btn-oauth:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-oauth-google { background: #fff; color: #3c4043; border-color: #dadce0; }
.btn-oauth-apple { background: #000; color: #fff; border-color: #000; }
.otp-input { text-align: center; font-size: 24px; letter-spacing: 8px; font-family: var(--font-serif); }
.inline-link { display: inline-block; text-align: center; margin-right: 8px; }

/* ---- pricing ---- */
.pricing-page h1 { font-size: 26px; color: var(--primary); margin: 20px 0 18px; }
.usage-card { margin-bottom: 26px; }
.usage-bar { height: 10px; border-radius: 999px; background: var(--primary-tint); overflow: hidden; margin: 8px 0 6px; }
.usage-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--go) 80%, #fff), var(--go)); transition: width .3s; }
.usage-fill.hot { background: linear-gradient(90deg, color-mix(in srgb, var(--act) 80%, #fff), var(--act)); }
.usage-nums { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 30px; }
.plan-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.plan-card.current { border-color: var(--go); box-shadow: var(--shadow-md); }
.plan-name { font-size: 16px; font-weight: 700; }
.plan-price { font-size: 27px; font-weight: 700; color: var(--primary); font-family: var(--font-serif); }
.plan-price small { font-size: 13px; color: var(--muted); font-weight: 600; font-family: var(--font-sans); }
.plan-tokens { font-size: 13px; color: var(--muted); font-weight: 600; }
.plan-blurb { font-size: 13px; color: var(--muted); flex: 1; }
.plan-cta { padding: 10px 18px; width: 100%; }
.plan-yearly { font-size: 12.5px; color: var(--go); font-weight: 700; }
.plan-yearly small { font-weight: 600; }
.plan-cta-yearly { width: 100%; margin-top: 6px; }
.plan-cta-down { width: 100%; margin-top: 6px; opacity: .85; }
.plan-current-tag { align-self: flex-start; background: var(--go-bg); color: var(--go); font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.pack-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px dashed var(--line-strong); border-radius: 13px; padding: 15px 17px;
  transition: border-color .15s, box-shadow .15s;
}
.pack-card:hover { border-color: var(--gold-soft); box-shadow: var(--shadow-sm); }
.pack-name { font-size: 13.5px; font-weight: 700; }
.pack-price { font-size: 20px; font-weight: 700; color: var(--primary); font-family: var(--font-serif); }
.pack-tokens { font-size: 12.5px; color: var(--muted); }
.pack-cta { align-self: flex-start; margin-top: 6px; }
.pricing-foot { margin-top: 22px; }

/* ---- quota message in chat ---- */
.quota-msg { border: 1px solid var(--act); background: var(--act-bg); }
.quota-link { color: var(--act); font-weight: 700; }

/* ---- dialogs ---- */
.mikata-dialog {
  border: 1px solid var(--line); border-radius: 16px; padding: 22px;
  background: var(--card); color: var(--text); max-width: 560px; width: 92vw;
  margin: auto; /* the global reset kills the UA centering — restore it */
  box-shadow: var(--shadow-lg);
}
.mikata-dialog::backdrop { background: rgba(10, 15, 25, .55); backdrop-filter: blur(2px); }
.mikata-dialog h3 { font-size: 16px; margin-bottom: 8px; font-family: var(--font-serif); font-weight: 600; }
.mikata-dialog textarea {
  width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 13px; font: inherit; font-size: 13.5px; background: var(--bg); color: var(--text);
  margin-top: 6px;
}
.mikata-dialog textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dialog-actions .btn-send { padding: 8px 22px; }
.exit-card { border-style: dashed; }
.exit-card p { color: var(--muted); }

/* ---- inbound photo read (vision) ---- */
.inbound-image-tools { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.btn-mini.disabled { opacity: .5; cursor: default; pointer-events: none; }
.inbound-image-status { font-size: 12px; color: var(--muted); }
.inbound-image-status.ok { color: var(--go); }
.inbound-image-status.warn { color: var(--act); }
.inbound-image-status.error { color: var(--danger); }

/* ---- legal pages (terms / privacy / tokushoho) ---- */
.legal-page { max-width: 720px; margin: 0 auto; }
.legal-page h1 { font-size: 26px; color: var(--primary); margin-bottom: 10px; }
.legal-page h1::after {
  content: ""; display: block; width: 44px; height: 2px; margin-top: 12px;
  background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 10%, transparent));
  border-radius: 2px;
}
.legal-lead { color: var(--muted); font-size: 13.5px; margin: 16px 0 20px; }
.legal-notice {
  background: var(--act-bg); color: var(--act); border: 1px solid var(--act);
  border-radius: 12px; padding: 13px 16px; font-size: 13px; font-weight: 600;
  margin-bottom: 24px;
}
.legal-body h2 { font-size: 16.5px; color: var(--primary); margin: 28px 0 8px; font-family: var(--font-serif); font-weight: 600; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body p { font-size: 13.5px; margin-bottom: 10px; }
.legal-body ul { margin: 0 0 12px 22px; }
.legal-body li { font-size: 13.5px; margin-bottom: 4px; }
.legal-table { display: grid; grid-template-columns: 150px 1fr; gap: 12px 16px; margin: 4px 0; }
.legal-table dt { font-weight: 700; color: var(--muted); font-size: 13px; padding-top: 1px; }
.legal-table dd { font-size: 13.5px; }
.legal-footdate { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
@media (max-width: 640px) {
  .legal-table { grid-template-columns: 1fr; gap: 2px 0; }
  .legal-table dd { margin-bottom: 10px; }
}

/* ---- readability for elderly / first-time users (2026-07 UX audit) ----
   Body copy was 12–14.5px and .btn-mini ~30px tall. Raise the floor: chat and
   card copy ≥ 15px, hints ≥ 13.5px, every tappable control ≥ 40px. Declared
   last so it overrides the earlier per-component sizes without touching them. */
.msg { font-size: 16px; line-height: 1.7; }
.msg.typing { font-size: 14px; }
.card h3 { font-size: 14.5px; }
.card p { font-size: 15px; line-height: 1.65; }
.card-hint { font-size: 13.5px; }
.urgent-card { font-size: 14.5px; }
.fact { font-size: 14px; }
.ev-file { font-size: 13.5px; }
.legal-body p, .legal-body li, .legal-table dd, .legal-lead { font-size: 15px; }
.legal-notice { font-size: 14px; }
.btn-mini { font-size: 14px; padding: 9px 14px; min-height: 40px; line-height: 1.3; }
.btn-send { min-height: 44px; font-size: 15px; }
.chat-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-input textarea { font-size: 16px; }  /* also stops iOS auto-zoom on focus */
.mikata-dialog textarea { font-size: 15px; }
.inbound-image-status { font-size: 13.5px; }

/* breadcrumb back to home on the case page */
.crumb { margin: 0 0 10px; font-size: 14px; }
.crumb a { color: var(--muted); text-decoration: none; font-weight: 600; }
.crumb a:hover { color: var(--primary); }

/* "how long to wait" block under the send guide + manual wait setter */
.send-wait { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.send-wait h3 { font-size: 15px; color: var(--primary); margin-bottom: 6px; }
.send-wait p { margin-bottom: 8px; }
.wait-set { margin-top: 10px; }
.wait-set-lead { color: var(--muted); font-size: 13.5px; }
.wait-set-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.wait-set-buttons .btn-mini.recommended { border-color: var(--primary); color: var(--primary); font-weight: 700; }
.wait-set-now { font-size: 13.5px; color: var(--muted); }
.wait-manual summary { cursor: pointer; font-size: 14.5px; font-weight: 700; color: var(--muted); list-style: none; }
.wait-manual summary::-webkit-details-marker { display: none; }
.wait-manual[open] summary { margin-bottom: 8px; color: var(--primary); }
.wait-clear { margin-top: 8px; }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 13.5px; text-decoration: underline; cursor: pointer; }
.link-button:hover { color: var(--primary); }

/* OTP: "mail didn't arrive" help */
.otp-help { margin-top: 18px; text-align: left; }
.otp-help h3 { font-size: 15px; color: var(--primary); }
.otp-help ol { margin: 6px 0 0 22px; }
.otp-help li { font-size: 15px; margin-bottom: 6px; line-height: 1.6; }
.otp-help a { color: var(--primary); font-weight: 700; }

/* 404 page */
.err-card { max-width: 640px; margin: 40px auto; text-align: center; padding: 32px 28px; }
.err-code { color: var(--muted); letter-spacing: .2em; font-size: 14px; margin-bottom: 6px; }
.err-title { font-size: 22px; color: var(--primary); margin-bottom: 12px; }
.err-body { font-size: 16px; line-height: 1.8; }
.err-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 22px 0 10px; }
.err-btn { min-height: 48px; display: inline-flex; align-items: center; font-size: 16px; padding: 0 22px; text-decoration: none; }
.err-hint { color: var(--muted); font-size: 14px; }

/* 解約予約の告知（Pro のまま「いつ終わるか」を必ず見せる） */
.plan-cancel-notice {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7e6;
  border: 1px solid #f0c987;
  color: #6b4a12;
  font-size: 14px;
  line-height: 1.6;
}

/* ---- progress meters ---- */
.meter-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.meter-row b { color: var(--text); }
.meter { height: 8px; border-radius: 99px; background: var(--primary-tint); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 99px; background: var(--go); transition: width .4s ease; }
.meter.overall .meter-fill { background: var(--act); }

/* ---- case: evidence "手元にない" ---- */
.ev.missing .ev-label { text-decoration: line-through; text-decoration-color: var(--line-strong); }
.ev.missing .ev-mark { color: var(--muted); }
.ev-file-slot { display: flex; flex-direction: column; gap: 2px; }

/* ---- case: documents ---- */
.doc-more { margin: 6px 0 10px; }
.doc-more summary { cursor: pointer; font-size: 12.5px; color: var(--primary); font-weight: 600; padding: 4px 0; }
.doc-more[open] summary { margin-bottom: 8px; }

/* ---- chat: attachments ---- */
.chat { position: relative; }
.btn-attach {
  display: grid; place-items: center; width: 44px; flex-shrink: 0; cursor: pointer; font-size: 19px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--bg);
}
.btn-attach:hover { border-color: var(--primary); }
.btn-attach[hidden] { display: none; }
.attach-tray { border-top: 1px solid var(--line); padding: 10px 12px 0; display: flex; flex-direction: column; gap: 6px; }
.attach-tray[hidden] { display: none; }
.attach-files { display: flex; flex-wrap: wrap; gap: 8px; }
.attach-item { position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 4px; font-size: 12px; max-width: 180px; }
.attach-item img { display: block; height: 64px; max-width: 120px; object-fit: cover; border-radius: 7px; }
.attach-item span { display: block; padding: 20px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-remove {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; line-height: 1;
}
.attach-ev { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.attach-ev select { font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.drop-overlay {
  position: absolute; inset: 8px; display: grid; place-items: center; border-radius: 12px; pointer-events: none;
  border: 2px dashed var(--act); background: color-mix(in srgb, var(--act-bg) 88%, transparent);
  color: var(--act); font-weight: 700; font-size: 15px;
}
.drop-overlay[hidden] { display: none; }

/* ---- feedback ---- */
.feedback-open { color: var(--act); font-weight: 700; }
.feedback-status { font-size: 12.5px; margin-top: 6px; min-height: 1em; }
.feedback-status.ok { color: var(--go); }
.feedback-status.error { color: var(--danger); }

/* ---- home: self-representation note ---- */
.hero-self {
  max-width: 680px; margin: 18px 0 0; padding: 14px 18px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.hero .hero-self p { font-size: 13.5px; line-height: 1.8; margin: 0; color: var(--text); }
.hero .hero-self p + p { margin-top: 8px; color: var(--muted); }

/* ---- guide character (2026-09-17): avatars, "次は何する？", tutorial spotlight ---- */
.msg-row { display: flex; align-items: flex-start; gap: 10px; align-self: flex-start; max-width: 92%; }
.msg-row[hidden] { display: none; }
.msg-row .msg { max-width: 100%; }
.msg-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.msg-name { font-size: 12px; font-weight: 700; color: var(--muted); padding-left: 4px; }
.msg-avatar, .coach-fab-face img, .coach-hint-face, .coach-spot-tip img {
  border-radius: 50%; object-fit: cover; background: linear-gradient(160deg, #f6efe0, #e6ecf5);
}
.msg-avatar { width: 44px; height: 44px; flex: none; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }

.coach { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.coach-fab {
  display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border: 0; border-radius: 99px; cursor: pointer;
  background: var(--card); color: var(--text); font: inherit; text-align: left;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--act) 40%, var(--line)), var(--shadow-lg);
  transition: transform .15s;
}
.coach-fab:hover { transform: translateY(-2px); }
.coach-fab-face {
  --pct: 0; width: 60px; height: 60px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--act) calc(var(--pct) * 1%), color-mix(in srgb, var(--act) 16%, var(--line)) 0);
}
.coach-fab-face img { width: 52px; height: 52px; border: 2px solid var(--card); }
.coach-fab-text { display: flex; flex-direction: column; line-height: 1.3; }
.coach-fab-text small { font-size: 12px; color: var(--act); font-weight: 700; }
.coach-fab-text b { font-size: 15px; }
.coach-fab.wiggle { animation: coach-wiggle .9s ease 2; }
@keyframes coach-wiggle {
  0%, 100% { transform: none; }
  20% { transform: translateY(-6px) rotate(-2deg); }
  40% { transform: translateY(0) rotate(2deg); }
  60% { transform: translateY(-3px); }
}

.coach-hint {
  position: relative; display: flex; align-items: center; gap: 10px; max-width: 340px; padding: 10px 34px 10px 10px; cursor: pointer;
  background: var(--card); border-radius: 16px; box-shadow: 0 0 0 1px var(--line), var(--shadow-lg);
  animation: coach-in .25s ease;
}
.coach-hint[hidden], .coach-pop[hidden] { display: none; }
.coach-hint::after {
  content: ""; position: absolute; right: 44px; bottom: -7px; width: 14px; height: 14px; background: var(--card);
  transform: rotate(45deg); box-shadow: 1px 1px 0 var(--line);
}
.coach-hint-face { width: 52px; height: 52px; flex: none; }
.coach-hint-text { font-size: 14px; line-height: 1.55; display: flex; flex-direction: column; }
.coach-name { font-size: 12px; font-weight: 700; color: var(--act); }
.coach-x {
  position: absolute; top: 6px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer;
}
.coach-x:hover { background: var(--bg-2); color: var(--text); }
@keyframes coach-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.coach-pop {
  position: relative; width: min(390px, calc(100vw - 32px)); max-height: calc(100vh - 150px); overflow-y: auto;
  background: var(--card); border-radius: 22px; padding: 16px 18px 14px;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-lg); animation: coach-in .25s ease;
}
.coach-head { display: flex; align-items: flex-end; gap: 4px; margin: -4px 0 10px -8px; }
.coach-figure { width: 132px; height: 132px; flex: none; object-fit: contain; }
.coach-bubble {
  position: relative; flex: 1; align-self: center; padding: 10px 12px; border-radius: 14px;
  background: var(--act-bg); border: 1px solid color-mix(in srgb, var(--act) 30%, var(--line));
}
.coach-bubble::before {
  content: ""; position: absolute; left: -7px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  background: var(--act-bg); border-left: 1px solid color-mix(in srgb, var(--act) 30%, var(--line));
  border-bottom: 1px solid color-mix(in srgb, var(--act) 30%, var(--line)); transform: rotate(45deg);
}
.coach-bubble p { font-size: 14.5px; line-height: 1.6; font-weight: 600; }
.coach-progress { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 14px; background: var(--bg-2); }
.coach-ring {
  --pct: 0; width: 72px; height: 72px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--go) calc(var(--pct) * 1%), var(--line) 0);
}
.coach-ring b {
  width: 58px; height: 58px; border-radius: 50%; background: var(--card);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.coach-ring b small { font-size: 11px; margin: 5px 0 0 1px; }
.coach-where { min-width: 0; }
.coach-step { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.coach-stage { font-size: 16px; font-weight: 700; }
.coach-dots { list-style: none; padding: 0; display: flex; gap: 5px; margin-top: 6px; }
.coach-dots li { width: 22px; height: 6px; border-radius: 99px; background: var(--line-strong); }
.coach-dots li.done { background: var(--go); }
.coach-dots li.now { background: var(--act); }
.coach-sub { font-size: 13px; font-weight: 700; color: var(--muted); margin: 14px 0 6px; }
.coach-todo { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.coach-item {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card-2);
}
.coach-item.done { background: transparent; border-style: dashed; color: var(--muted); padding: 6px 10px; }
.coach-check {
  width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong);
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff;
}
.coach-item.done .coach-check { background: var(--go); border-color: var(--go); }
.coach-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.coach-item-text { font-size: 14.5px; font-weight: 600; line-height: 1.45; }
.coach-item.done .coach-item-text { font-size: 13px; font-weight: 500; text-decoration: line-through; }
.coach-item-body small { font-size: 12px; color: var(--muted); margin-top: 2px; }
.coach-go {
  flex: none; border: 0; border-radius: 99px; padding: 8px 12px; min-height: 36px; cursor: pointer;
  background: var(--act); color: var(--on-act); font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.coach-go:hover { filter: brightness(1.06); }
.coach-change { display: block; margin: 12px auto 0; font-size: 12.5px; }

.coach-spot { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.coach-spot-hole {
  position: fixed; border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(12, 18, 28, .52), 0 0 0 3px var(--act);
  animation: coach-pulse 1.6s ease infinite;
}
@keyframes coach-pulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(12, 18, 28, .52), 0 0 0 3px var(--act); }
  50% { box-shadow: 0 0 0 9999px rgba(12, 18, 28, .52), 0 0 0 7px color-mix(in srgb, var(--act) 55%, transparent); }
}
.coach-spot-tip {
  position: fixed; pointer-events: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow-lg); animation: coach-in .25s ease;
}
.coach-spot-tip img { width: 46px; height: 46px; }
.coach-spot-tip p { flex: 1; min-width: 0; font-size: 14px; line-height: 1.55; }
.coach-spot-tip .coach-go { margin-left: auto; }

.guide-pick { max-width: 560px; }
.guide-pick-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 6px; }
.guide-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 12px 14px; cursor: pointer;
  border: 2px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, var(--card-2), var(--card));
  font: inherit; color: var(--text); transition: border-color .15s, transform .15s;
}
.guide-card:hover, .guide-card.selected { border-color: var(--act); transform: translateY(-2px); }
.guide-card img { width: 100%; max-width: 200px; height: auto; aspect-ratio: 1; object-fit: contain; }
.guide-card b { font-size: 18px; font-family: var(--font-serif); }
.guide-card span { font-size: 13px; color: var(--muted); line-height: 1.5; }
.guide-pick-note { text-align: center; }

/* phones: the chat input sits at the bottom, so keep the button compact and above it */
@media (max-width: 640px) {
  .coach { right: 12px; bottom: 88px; }
  .coach-fab { padding: 4px; }
  .coach-fab-text { display: none; }
  .coach-pop { max-height: calc(100vh - 170px); }
  .coach-figure { width: 104px; height: 104px; }
  .guide-card span { font-size: 12px; }
}

/* ---- public landing (2026-09-19): bigger, louder, illustrated ---- */
:root { --font-display: "Zen Kaku Gothic New", var(--font-sans); }
.lp-h1, .lp-h2, .lp-final h2, .lp-btn, .lp-chip, .lp-step-list b, .lp-can-card b, .lp-line-card b, .lp-cost-tag {
  font-family: var(--font-display); font-weight: 900; letter-spacing: .01em;
}

.lp-hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 18px; align-items: center;
  margin: 4px 0 8px; padding: 30px 30px 26px; border-radius: 28px; position: relative; overflow: hidden;
  background:
    radial-gradient(120% 120% at 88% 8%, color-mix(in srgb, var(--gold) 20%, transparent), transparent 55%),
    linear-gradient(165deg, var(--card), var(--card-2));
  box-shadow: 0 0 0 1px var(--line), var(--shadow-lg);
}
.lp-chip {
  display: inline-block; padding: 7px 14px; border-radius: 99px; font-size: 13px;
  background: var(--act-bg); color: var(--act); border: 1px solid color-mix(in srgb, var(--act) 35%, var(--line));
}
.lp-h1 { margin-top: 14px; font-size: clamp(34px, 5.2vw, 56px); line-height: 1.26; color: var(--primary); }
.lp-em {
  color: var(--act); white-space: nowrap; padding: 0 2px;
  background-image: linear-gradient(transparent 68%, color-mix(in srgb, var(--act) 22%, transparent) 0);
}
.lp-lead { margin-top: 18px; font-size: 17px; line-height: 1.85; color: var(--text); }
.lp-lead strong { color: var(--primary); }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.lp-cta.center { justify-content: center; }
.lp-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 30px;
  border-radius: 99px; font-size: 17px; text-decoration: none; transition: transform .12s, box-shadow .12s, filter .12s;
}
.lp-btn.primary {
  color: var(--on-act); background: linear-gradient(180deg, color-mix(in srgb, var(--act) 86%, #fff), var(--act));
  box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 16px 30px -14px color-mix(in srgb, var(--act) 75%, transparent);
}
.lp-btn.primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.lp-btn.big { min-height: 60px; font-size: 19px; padding: 0 40px; }
.lp-btn.ghost { color: var(--primary); background: var(--card); box-shadow: inset 0 0 0 2px var(--line-strong); }
.lp-btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--primary); }
.lp-micro { margin-top: 12px; font-size: 13px; color: var(--muted); }
.lp-micro a { color: var(--primary); font-weight: 700; }

.lp-hero-art { position: relative; min-height: 300px; display: flex; align-items: flex-end; justify-content: center; }
.lp-figure { object-fit: contain; filter: drop-shadow(0 18px 30px rgba(20, 30, 48, .16)); }
.lp-figure.a { width: min(300px, 78%); height: auto; }
.lp-figure.b { width: min(170px, 44%); height: auto; position: absolute; left: 0; bottom: 0; opacity: .96; }
.lp-bubble {
  position: absolute; top: 4px; right: 0; max-width: 230px; padding: 12px 14px; border-radius: 16px;
  background: var(--card); font-size: 14px; line-height: 1.6; font-weight: 600; color: var(--text);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-md);
}
.lp-bubble::after {
  content: ""; position: absolute; left: 26px; bottom: -8px; width: 16px; height: 16px; background: var(--card);
  transform: rotate(45deg); box-shadow: 2px 2px 0 var(--line);
}

.lp-h2 { font-size: clamp(23px, 3.2vw, 31px); line-height: 1.45; color: var(--primary); text-align: center; }
.lp-pain, .lp-cost, .lp-steps, .lp-can, .lp-line, .lp-final { margin-top: 56px; }
.lp-pain-list { list-style: none; padding: 0; display: grid; gap: 12px; margin: 22px auto 0; max-width: 760px; }
.lp-pain-list li {
  position: relative; padding: 16px 18px 16px 54px; border-radius: 16px; font-size: 15.5px; line-height: 1.7;
  background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
}
.lp-pain-list li::before {
  content: "✕"; position: absolute; left: 18px; top: 16px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.lp-pain-list b { font-family: var(--font-display); font-weight: 700; }
.lp-pain-turn { margin-top: 24px; text-align: center; font-size: 18px; line-height: 1.9; color: var(--muted); }
.lp-pain-turn span { font-family: var(--font-display); font-weight: 900; font-size: clamp(21px, 3vw, 28px); color: var(--go); }

.lp-cost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.lp-cost-card { padding: 22px 22px 18px; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.lp-cost-card.mine {
  background: linear-gradient(170deg, var(--go-bg), var(--card));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--go) 45%, transparent), var(--shadow-md);
}
.lp-cost-tag { display: inline-block; font-size: 14px; color: var(--muted); }
.lp-cost-card.mine .lp-cost-tag { color: var(--go); }
.lp-cost-card ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.lp-cost-card li { font-size: 15px; line-height: 1.6; }
.lp-cost-card li b { font-family: var(--font-display); font-weight: 900; font-size: 20px; color: var(--primary); }
.lp-cost-card.mine li b { color: var(--go); }
.lp-note { margin-top: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

.lp-step-list { list-style: none; padding: 0; margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lp-step-list li {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 26px 18px 20px; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
}
.lp-step-no {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 900; font-size: 16px;
  color: var(--on-act); background: var(--act); box-shadow: var(--shadow-sm);
}
.lp-ico { width: 78px; height: 78px; margin-top: 6px; }
.lp-ico .s-soft { fill: var(--primary-tint); stroke: var(--primary); stroke-width: 2.4; }
.lp-ico .s-line { stroke: var(--primary); stroke-width: 2.6; stroke-linecap: round; opacity: .55; fill: none; }
.lp-ico .s-act { fill: color-mix(in srgb, var(--act) 30%, transparent); stroke: var(--act); stroke-width: 2.4; }
.lp-step-list b { font-size: 19px; }
.lp-step-list span:last-child { font-size: 14px; line-height: 1.75; color: var(--muted); }

.lp-can-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.lp-can-card {
  display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 18px;
  background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
}
.lp-can-ico { font-size: 28px; line-height: 1; }
.lp-can-card b { font-size: 16.5px; }
.lp-can-card span:last-child { font-size: 14px; line-height: 1.75; color: var(--muted); }

.lp-line-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.lp-line-card { padding: 22px; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.lp-line-card b { display: block; font-size: 17px; margin-bottom: 12px; }
.lp-line-card.yes b { color: var(--go); }
.lp-line-card.no b { color: var(--muted); }
.lp-line-card ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.lp-line-card li { position: relative; padding-left: 26px; font-size: 14.5px; line-height: 1.75; }
.lp-line-card.yes li::before { content: "○"; position: absolute; left: 0; color: var(--go); font-weight: 700; }
.lp-line-card.no li::before { content: "—"; position: absolute; left: 0; color: var(--muted); font-weight: 700; }
.lp-line-note {
  margin-top: 16px; padding: 16px 18px; border-radius: 16px; font-size: 14.5px; line-height: 1.85;
  background: var(--primary-tint); color: var(--text);
}

.lp-final {
  text-align: center; padding: 40px 24px 34px; border-radius: 28px;
  background: linear-gradient(165deg, var(--card), var(--card-2));
  box-shadow: 0 0 0 1px var(--line), var(--shadow-md);
}
.lp-final h2 { font-size: clamp(25px, 3.6vw, 34px); color: var(--primary); }
.lp-final p { margin-top: 12px; font-size: 15.5px; color: var(--muted); }
.lp-final .lp-micro { margin-top: 16px; }

@media (max-width: 860px) {
  .lp-hero { grid-template-columns: 1fr; padding: 24px 20px 20px; }
  .lp-hero-art { min-height: 0; display: block; text-align: center; margin-top: 18px; }
  .lp-figure.a { width: 180px; }
  .lp-figure.b { position: static; width: 124px; margin-left: -14px; vertical-align: bottom; }
  .lp-bubble { position: static; display: block; max-width: 420px; margin: 0 auto 10px; }
  .lp-bubble::after { display: none; }
  .lp-cost-grid, .lp-line-grid, .lp-step-list, .lp-can-grid { grid-template-columns: 1fr; }
  .lp-step-list { gap: 26px; }
  .lp-btn { width: 100%; }
}
@media (max-width: 1040px) and (min-width: 861px) {
  .lp-can-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- landing: 本人訴訟 explainer + honest pros/cons (2026-09-19) ---- */
.lp-honnin, .lp-risk { margin-top: 56px; }
.lp-honnin-lead { margin-top: 18px; text-align: center; font-size: 16px; line-height: 2; color: var(--text); }
.lp-honnin-lead b { font-family: var(--font-display); font-weight: 700; color: var(--primary); }
.lp-honnin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
.lp-honnin-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 18px;
  background: linear-gradient(170deg, var(--primary-tint), var(--card));
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
}
.lp-honnin-card b { font-family: var(--font-display); font-weight: 900; font-size: 15.5px; color: var(--primary); }
.lp-honnin-card span { font-size: 13.5px; line-height: 1.75; color: var(--muted); }
.lp-honnin-note { margin-top: 16px; text-align: center; font-size: 14.5px; color: var(--muted); }

.lp-risk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.lp-risk-card { padding: 22px; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.lp-risk-card > b { display: block; font-family: var(--font-display); font-weight: 900; font-size: 17px; margin-bottom: 12px; }
.lp-risk-card.good { background: linear-gradient(170deg, var(--go-bg), var(--card)); }
.lp-risk-card.good > b { color: var(--go); }
.lp-risk-card.good li b { color: var(--go); }
.lp-risk-card.bad > b { color: var(--act); }
.lp-risk-card.bad li b { color: var(--act); }
.lp-risk-card ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.lp-risk-card li { position: relative; padding-left: 26px; font-size: 14.5px; line-height: 1.75; }
.lp-risk-card.good li::before { content: "◎"; position: absolute; left: 0; color: var(--go); font-weight: 700; }
.lp-risk-card.bad li::before { content: "▲"; position: absolute; left: 0; color: var(--act); font-weight: 700; }

.lp-faq { margin-top: 16px; display: grid; gap: 10px; }
.lp-faq details { border-radius: 16px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); }
.lp-faq summary {
  cursor: pointer; list-style: none; padding: 16px 18px; font-family: var(--font-display); font-weight: 700;
  font-size: 15.5px; color: var(--primary); display: flex; align-items: center; gap: 10px;
}
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::before { content: "Q"; color: var(--act); font-size: 14px; }
.lp-faq details[open] summary { padding-bottom: 6px; }
.lp-faq p { padding: 0 18px 16px 42px; font-size: 14.5px; line-height: 1.9; color: var(--text); }
.lp-faq p b { color: var(--primary); }

@media (max-width: 860px) {
  .lp-honnin-grid, .lp-risk-grid { grid-template-columns: 1fr; }
  .lp-honnin-lead { text-align: left; font-size: 15px; }
}
@media (max-width: 1040px) and (min-width: 861px) {
  .lp-honnin-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- home: pick up where you left off (2026-09-19) ---- */
.hm-resume {
  display: flex; align-items: center; gap: 18px; margin: 4px 0 26px; padding: 18px 22px;
  border-radius: 22px; background: linear-gradient(150deg, var(--primary-tint), var(--card));
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
}
.hm-resume-face { width: 108px; height: 108px; flex: none; object-fit: contain; }
.hm-resume-say { min-width: 0; }
.hm-resume-name { font-size: 12.5px; font-weight: 700; color: var(--primary); }
.hm-resume-text { margin: 2px 0 12px; font-size: 16px; font-weight: 700; line-height: 1.7; }
.hm-resume-text small { display: inline-block; margin-top: 4px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.hm-resume-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.hm-resume-go { padding: 11px 20px; }
.hm-resume-new { padding: 11px 18px; }

.case-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.case-cards > * { min-width: 0; }
.case-card {
  display: flex; flex-direction: column; gap: 8px; min-height: 212px; text-align: left;
  padding: 18px; border-radius: 20px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); font: inherit; color: inherit; cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.case-card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.case-card-top { display: flex; align-items: flex-start; gap: 10px; }
.case-card-ring {
  --pct: 0; width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--go) calc(var(--pct) * 1%), var(--line) 0);
}
.case-card-ring b {
  width: 45px; height: 45px; border-radius: 50%; background: var(--card);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.case-card-ring b small { font-size: 9.5px; margin: 4px 0 0 1px; }
.case-card-badges { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.case-card-badges .case-badge { white-space: normal; }
.case-card-title { font-size: 16px; font-weight: 700; line-height: 1.5; }
.case-card-step { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.case-card-next {
  font-size: 13px; line-height: 1.6; padding: 9px 11px; border-radius: 12px;
  background: var(--card-2); border: 1px solid var(--line);
}
/* keep every card the same shape however long the AI's next step is */
.case-card-next-text {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.case-card-next b { display: block; font-size: 11.5px; color: var(--act); }
.case-card-foot { margin-top: auto; display: flex; align-items: baseline; gap: 8px; padding-top: 10px; }
.case-card-meta { font-size: 12px; color: var(--muted); }
.case-card-go { margin-left: auto; color: var(--act); font-weight: 700; font-size: 13.5px; }
.case-card.new {
  align-items: center; justify-content: center; text-align: center; gap: 6px;
  border-style: dashed; background: transparent; box-shadow: none;
}
.case-card.new .case-card-plus { font-size: 26px; color: var(--primary); font-weight: 700; }
.case-card.new .case-card-step { max-width: 22ch; }

.kata-panel { scroll-margin-top: 78px; }
.kata-panel > summary { list-style: none; cursor: pointer; }
/* nothing in progress: the catalogue IS the page, so it cannot be folded away */
.kata-panel:not(.compact) > summary { pointer-events: none; cursor: default; }
.kata-panel:not(.compact) .section-title {
  font-size: 21px; color: var(--text); letter-spacing: 0; text-transform: none; font-family: var(--font-display);
}
.kata-panel:not(.compact) .kata-panel-sub { font-size: 14px; margin-bottom: 14px; }
.kata-panel > summary::-webkit-details-marker { display: none; }
.kata-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kata-panel-head-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kata-panel-head .section-title { margin: 0; }
.kata-panel-sub { font-size: 13px; color: var(--muted); }
.kata-panel.compact > summary {
  padding: 15px 18px; border-radius: 16px; border: 1px dashed var(--line-strong); background: var(--card);
}
.kata-panel.compact > summary .section-title { font-size: 17px; }
.kata-panel.compact .kata-panel-head::after { content: "▾ 開く"; flex: none; font-size: 12.5px; font-weight: 700; color: var(--act); }
.kata-panel.compact[open] > summary { margin-bottom: 14px; }
.kata-panel.compact[open] .kata-panel-head::after { content: "▴ とじる"; }

@media (max-width: 640px) {
  .hm-resume { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
  .hm-resume-face { width: 84px; height: 84px; }
  .hm-resume-btns .btn-send, .hm-resume-btns .btn-mini { flex: 1 1 auto; text-align: center; }
  .case-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .case-card { min-height: 190px; padding: 14px; border-radius: 16px; }
  .case-card-title { font-size: 14.5px; }
  .case-card-next { font-size: 12px; }
  .case-card-badges .case-badge { font-size: 10.5px; }
}

/* ---- naming and deleting a case (2026-09-19) ---- */
.case-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; margin: 2px 0 16px; }
.case-name { font-family: var(--font-serif); font-size: 23px; font-weight: 600; }
.case-head-kata { font-size: 12.5px; color: var(--muted); background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.case-head-rename {
  margin-left: auto; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--primary);
  background: none; border: 1px dashed var(--line-strong); border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.case-head-rename:hover { border-style: solid; background: var(--card); }

.case-card-wrap { position: relative; display: flex; min-width: 0; }
.case-card-wrap > .case-card { flex: 1; }
.case-rename {
  position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer;
  font-size: 13px; line-height: 1; opacity: 0; transition: opacity .15s, border-color .15s;
}
.case-card-wrap:hover .case-rename, .case-rename:focus-visible { opacity: 1; }
.case-rename:hover { border-color: var(--primary); color: var(--primary); }
@media (hover: none) { .case-rename { opacity: 1; } }

.rename-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
#case-rename-input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  font: inherit; font-size: 15px; background: var(--bg); color: var(--text);
}
#case-rename-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.dialog-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.btn-danger { color: var(--act); border-color: color-mix(in srgb, var(--act) 40%, var(--line)); }
.btn-send.btn-danger { background: var(--act); border-color: var(--act); color: #fff; }
.flash {
  background: var(--go-bg); color: var(--go); border: 1px solid color-mix(in srgb, var(--go) 28%, transparent);
  border-radius: 12px; padding: 12px 16px; font-size: 14px; font-weight: 600; margin-bottom: 18px;
}

/* ---- feedback: kinds, the public board, staff triage (2026-09-19) ---- */
.fb-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fb-kinds label { cursor: pointer; }
.fb-kinds input { position: absolute; opacity: 0; width: 0; height: 0; }
.fb-kinds span {
  display: inline-block; font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card-2); color: var(--muted);
}
.fb-kinds input:checked + span { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); }
.fb-kinds input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }

.voices-head { margin-bottom: 26px; }
.voices-head h1 { font-family: var(--font-serif); font-size: 26px; font-weight: 600; margin-bottom: 10px; }
.voices-head p { font-size: 15px; line-height: 1.9; max-width: 70ch; }
.voices-note { font-size: 13px; color: var(--muted); margin-top: 6px; }
.voices-head .btn-send { margin-top: 14px; }
.voices-empty { color: var(--muted); font-size: 14px; }
.voice-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.voice-card {
  display: flex; flex-direction: column; gap: 7px; padding: 17px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.voice-card.done { background: linear-gradient(170deg, var(--go-bg), var(--card)); }
.voice-card h3 { font-size: 16px; font-weight: 700; line-height: 1.6; }
.voice-card p { font-size: 13.5px; line-height: 1.8; color: var(--muted); }
.voice-status {
  align-self: flex-start; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--primary-tint); color: var(--primary);
}
.voice-status.done { background: var(--go-bg); color: var(--go); }
.voice-status.planned { background: var(--act-bg); color: var(--act); }
.voice-meta { font-size: 12px; color: var(--muted); }
.voice-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 10px; }
.voice-vote {
  margin-left: auto; display: flex; align-items: center; gap: 7px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--text);
}
.voice-vote:hover { border-color: var(--primary); color: var(--primary); }
.voice-vote.on { background: var(--primary-tint); border-color: var(--primary); color: var(--primary); }
.voice-vote b { font-size: 13px; }

.mng-title { font-family: var(--font-serif); font-size: 23px; font-weight: 600; margin-bottom: 6px; }
.mng-list { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.mng-item { padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.mng-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mng-meta { font-size: 12px; color: var(--muted); }
.mng-body { white-space: pre-wrap; font-size: 14px; line-height: 1.8; margin: 10px 0; }
.mng-fields { display: grid; gap: 8px; }
.mng-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.mng-fields input[type="text"], .mng-fields input[type="number"], .mng-fields select {
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font: inherit; font-size: 14px;
  background: var(--bg); color: var(--text);
}
.mng-check { flex-direction: row !important; align-items: center; gap: 7px !important; }
.mng-fields .btn-send { justify-self: start; padding: 9px 20px; }
.case-badge.done { background: var(--go-bg); color: var(--go); }
.case-badge.planned, .case-badge.looking { background: var(--act-bg); color: var(--act); }

/* ---- staff: 利用者の管理 ---- */
.mng-search { display: flex; gap: 8px; margin-top: 14px; }
.mng-search input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; }

/* ---- pricing: comped (unlimited) accounts ---- */
.comp-notice { margin: 18px 0 4px; padding: 12px 16px; border-radius: 14px; font-size: 14px;
  background: color-mix(in srgb, var(--ok, #2e7d4f) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok, #2e7d4f) 45%, transparent); }
.plan-cta.is-disabled, .pack-cta.is-disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: grayscale(.4); }

/* ---- ホーム画面に追加 ---- */
.a2hs-bar[hidden], .a2hs-sheet[hidden], [data-install-open][hidden], [data-install-done][hidden] { display: none !important; }
.a2hs-bar { display: flex; align-items: center; gap: 12px; max-width: 1080px; margin: 12px auto 0;
  padding: 10px 12px 10px 14px; border-radius: 16px; background: var(--card);
  border: 1px solid color-mix(in srgb, var(--gold-soft, #c6a862) 55%, transparent); box-shadow: var(--shadow-sm); }
.a2hs-bar img { border-radius: 50%; flex: none; }
.a2hs-bar p { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; line-height: 1.35; }
.a2hs-bar p span { font-size: 12px; color: var(--muted); }
.a2hs-go { flex: none; padding: 9px 16px; }
.a2hs-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.a2hs-x:hover { background: color-mix(in srgb, var(--muted) 15%, transparent); }
@media (max-width: 720px) { .a2hs-bar { margin: 10px 12px 0; } }

.a2hs-sheet { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .55); padding: 16px 16px 72px; }
.a2hs-sheet[data-mode="ipad"] { align-items: flex-start; padding-top: 72px; }
.a2hs-panel { position: relative; width: 100%; max-width: 440px; padding: 22px 20px 18px; border-radius: 22px;
  background: var(--card); color: var(--text); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); text-align: center; }
.a2hs-close { position: absolute; top: 10px; right: 10px; }
.a2hs-icon { border-radius: 50%; box-shadow: 0 0 0 2px var(--gold-soft, #c6a862); }
.a2hs-panel h3 { margin: 10px 0 6px; }
.a2hs-steps { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 10px; text-align: left; }
.a2hs-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 8%, transparent); line-height: 1.55; }
.a2hs-steps small { display: block; font-size: 12px; color: var(--muted); }
.a2hs-num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; background: var(--gold-soft, #c6a862); color: #1f1a10; }
.a2hs-share, .a2hs-plus { vertical-align: -5px; color: #2f7cf6; }
.a2hs-after { font-size: 13px; color: var(--muted); }
.a2hs-ok { width: 100%; margin-top: 4px; }
.a2hs-sheet[data-mode="inapp"] .a2hs-ios, .a2hs-sheet:not([data-mode="inapp"]) .a2hs-inapp { display: none; }
.a2hs-sheet[data-mode="ipad"] .a2hs-where-iphone, .a2hs-sheet:not([data-mode="ipad"]) .a2hs-where-ipad { display: none; }
.a2hs-arrow { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); font-size: 34px; color: #fff;
  animation: a2hs-bob 1.1s ease-in-out infinite; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.a2hs-sheet[data-mode="ipad"] .a2hs-arrow { top: 14px; bottom: auto; left: auto; right: 90px; transform: rotate(180deg); animation: none; }
.a2hs-sheet[data-mode="inapp"] .a2hs-arrow { display: none; }
@keyframes a2hs-bob { 50% { transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .a2hs-arrow { animation: none; } }

/* ---- site navigation (2026-09-22) ----
   PC: one 56px row — brand left, a few links + avatar right; everything else
   lives in the avatar menu. Phones: a 52px row with just brand + avatar, and
   the everyday actions in a bottom tab bar that hides while reading down and
   returns on the first scroll up (thumb reach beats a crowded header). */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 18px; height: 18px; flex: none; }

.site-head {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  /* iOS standalone (added-to-home-screen) needs viewport-fit=cover
     (base.html) for safe-area-inset-* to be non-zero at all; without the
     padding here, that combination alone would put this sticky header
     under the notch/status bar instead of below it. */
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.brand { font-size: 18px; gap: 8px; flex: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.head-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.head-link {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px;
  color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: color .15s, background-color .15s;
}
.head-link.as-button { border: 0; background: none; }
.head-link:hover { color: var(--text); background: color-mix(in srgb, var(--muted) 12%, transparent); }
.head-link.is-here { color: var(--primary); background: var(--primary-tint); }
.head-cta {
  display: inline-flex; align-items: center; height: 36px; padding: 0 16px; margin-left: 4px; border-radius: 99px;
  background: var(--go); color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap;
}
.head-cta:hover { filter: brightness(1.08); }

.avatar-btn {
  display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 6px 0 4px; margin-left: 6px;
  border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--muted);
  transition: border-color .15s, box-shadow .15s;
}
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { border-color: var(--gold-soft); box-shadow: var(--shadow-sm); }
.avatar-btn .chev { width: 16px; height: 16px; transition: transform .2s; }
.avatar-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.avatar-dot {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(145deg, #1f3252, #4a5a74 70%, #8a7340);  /* fixed navy: --primary turns pale in dark mode */
  color: #fff; font-size: 13px; font-weight: 800; letter-spacing: 0;
}
.avatar-dot.big { width: 40px; height: 40px; font-size: 16px; }

/* account menu: dropdown on PC */
.user-menu[hidden] { display: none !important; }
.user-menu { position: fixed; inset: 0; z-index: 90; }
.user-menu-panel {
  position: absolute; top: 60px; right: 16px;
  width: 280px; padding: 8px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: um-drop .16s ease-out;
}
@keyframes um-drop { from { opacity: 0; transform: translateY(-6px); } }
.um-who { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.um-email { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.user-menu form { margin: 0; }
.um-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 10px; background: none; color: var(--text); font-size: 15px; text-align: left;
}
.um-item[hidden] { display: none; }
.um-item .ico { color: var(--muted); }
.um-item:hover, .um-item:focus-visible { background: color-mix(in srgb, var(--primary) 9%, transparent); outline: none; }
.um-danger, .um-danger .ico { color: var(--danger); }
.um-sep { height: 1px; margin: 6px 4px; background: var(--line); }
.um-label { display: block; padding: 4px 12px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }

/* phone tab bar: not shown on PC */
.tabbar { display: none; }

@media (max-width: 720px) {
  .site-head { height: calc(52px + env(safe-area-inset-top)); gap: 10px; padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); }
  .brand-note { display: none; }
  /* logged in: the tab bar carries the links, the header keeps only the avatar */
  .has-tabbar .head-link { display: none; }
  .avatar-btn { padding: 0 3px; border-color: transparent; background: none; }
  .avatar-btn .chev { display: none; }
  /* logged out: ご意見 shrinks to its icon */
  .head-link.feedback-open { padding: 0 9px; font-size: 0; gap: 0; }
  .head-link.feedback-open .ico { width: 20px; height: 20px; }
  .head-link { padding: 0 9px; }
  .head-cta { padding: 0 13px; font-size: 13.5px; }

  /* menu becomes a bottom sheet */
  .user-menu { background: rgba(0, 0, 0, .45); animation: um-fade .18s ease-out; }
  .user-menu-panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; border-bottom: 0;
    animation: um-rise .22s cubic-bezier(.2, .8, .2, 1);
  }
  .user-menu-panel::before { content: ""; display: block; width: 40px; height: 4px; margin: 2px auto 8px; border-radius: 4px; background: var(--line-strong); }
  .um-item { min-height: 50px; font-size: 16px; }
  body.menu-open { overflow: hidden; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--card) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--line);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  }
  .tabbar-away .tabbar, .typing .tabbar { transform: translateY(110%); }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 50px; border: 0; border-radius: 12px; background: none;
    color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .02em;
  }
  .tab .ico { width: 24px; height: 24px; }
  .tab .avatar-dot { width: 24px; height: 24px; font-size: 11px; }
  .tab.is-here { color: var(--primary); }
  .tab:active { background: color-mix(in srgb, var(--primary) 9%, transparent); }
  /* keep page content and floating buttons clear of the bar */
  .has-tabbar .site-foot { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .has-tabbar .coach { bottom: calc(150px + env(safe-area-inset-bottom)); transition: bottom .25s cubic-bezier(.2, .8, .2, 1); }
  .has-tabbar.tabbar-away .coach, .has-tabbar.typing .coach { bottom: 88px; }
  /* reading down: the guide button steps aside with the tab bar instead of sitting on the text */
  .has-tabbar.tabbar-away .coach-fab { opacity: 0; transform: scale(.6); pointer-events: none; }
  .coach-fab { transition: opacity .2s, transform .2s; }
  .has-tabbar .a2hs-sheet { z-index: 1000; }
}
@keyframes um-fade { from { opacity: 0; } }
@keyframes um-rise { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) {
  .tabbar, .user-menu-panel, .user-menu, .coach { transition: none !important; animation: none !important; }
}
@media print { .tabbar, .user-menu { display: none !important; } }

/* ---- 初動 rows (2026-09-22; inside この件の進め方 since 2026-09-25) ---- */
.fs-face { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--line); }
.fs-list { list-style: none; margin: 0; padding: 4px 12px 8px; display: grid; gap: 10px; }
.fs-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--card-2); }
.fs-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fs-mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 800; background: var(--act); color: var(--on-act); }
.fs-item-title { flex: 1; min-width: 12em; font-size: 15.5px; line-height: 1.45; }
.fs-urgent { font-size: 11.5px; font-weight: 800; color: #fff; background: var(--danger); padding: 2px 8px; border-radius: 99px; }
.fs-state, .fs-undo { display: none; }
.fs-item[data-status="done"] .fs-state-done, .fs-item[data-status="skip"] .fs-state-skip { display: inline; font-size: 12.5px; font-weight: 700; }
.fs-state-done { color: var(--go); }
.fs-state-skip { color: var(--muted); }
.fs-item[data-status="done"] .fs-undo, .fs-item[data-status="skip"] .fs-undo { display: inline; font-size: 12.5px; }
.fs-item[data-status="done"], .fs-item[data-status="skip"] { background: transparent; }
.fs-item[data-status="done"] .fs-mark { background: var(--go); }
.fs-item[data-status="skip"] .fs-mark { background: var(--muted); }
.fs-item[data-status="done"] .fs-urgent, .fs-item[data-status="skip"] .fs-urgent { display: none; }
.fs-item[data-status="done"] .fs-body, .fs-item[data-status="skip"] .fs-body { display: none; }
.fs-item[data-status="done"] .fs-item-title, .fs-item[data-status="skip"] .fs-item-title { color: var(--muted); font-weight: 600; }
.fs-body { margin: 8px 0 0 36px; }
.fs-why { font-size: 14.5px; line-height: 1.65; margin: 0 0 6px; }
.fs-how { margin: 0 0 8px; padding-left: 1.2em; font-size: 14.5px; line-height: 1.7; }
.fs-skip { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 8px 0; padding: 8px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--muted) 9%, transparent); }
.fs-skip b { display: block; font-size: 12.5px; color: var(--text); }
.fs-contacts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.fs-call { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px 8px 10px; border-radius: 12px;
  background: var(--go-bg); color: var(--text); border: 1px solid color-mix(in srgb, var(--go) 40%, transparent); text-decoration: none; }
.fs-call:hover { border-color: var(--go); }
.fs-call.web { background: var(--primary-tint); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.fs-call-ico { font-size: 20px; }
.fs-call span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.fs-call b { font-size: 13.5px; }
.fs-call em { font-style: normal; font-size: 18px; font-weight: 800; letter-spacing: .02em; color: var(--go); }
.fs-call small { font-size: 12px; color: var(--muted); }
.fs-call.big { width: 100%; }
.fs-call.big em { font-size: 22px; }
.fs-picker { margin: 10px 0; padding: 12px; border-radius: 12px; border: 1px dashed var(--line-strong); }
.fs-picker-q { display: block; font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.fs-picker select { width: 100%; min-height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--card); color: var(--text); font: inherit; font-size: 16px; }
.fs-picked { margin-top: 10px; }
.fs-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.6; }
.fs-note[hidden] { display: none; }
.fs-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fs-do { border-color: var(--go); color: var(--go); font-weight: 700; }
.fs-not { color: var(--muted); }
@media (max-width: 640px) {
  .fs-body { margin-left: 0; }
  .fs-call { width: 100%; }
}

/* case page: the words this 型 uses, folded away until someone needs them */
.page-terms { margin: 12px 0 14px; padding: 12px 16px; }
.page-terms-head { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--text); }
.page-terms[open] .page-terms-head { margin-bottom: 6px; }

/* 初動 v2 (2026-09-23): folded rows, 「あとで」, 「これについて聞く」, call memo */
.fs-item-toggle {
  flex: 1; min-width: 12em; display: flex; align-items: center; gap: 8px; padding: 0; border: 0;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.fs-item-toggle .fs-item-title { flex: 1; min-width: 0; }
.fs-chev { flex: none; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); margin: -4px 4px 0; transition: transform .15s; }
.fs-item.is-open .fs-chev { transform: rotate(-135deg); margin-top: 4px; }
.fs-item:not(.is-open) .fs-body { display: none; }
.fs-item[data-status="later"] .fs-state-later { display: inline; font-size: 12.5px; font-weight: 700; color: var(--act); }
.fs-item[data-status="later"] .fs-undo { display: inline; font-size: 12.5px; }
.fs-item[data-status="later"] .fs-later { display: none; }
.fs-item[data-status="later"] .fs-mark { background: color-mix(in srgb, var(--act) 70%, var(--muted)); }
.fs-item[data-status="done"] .fs-chev, .fs-item[data-status="skip"] .fs-chev { display: none; }
.fs-later { color: var(--act); border-color: color-mix(in srgb, var(--act) 45%, var(--line)); }
.fs-ask { font-size: 13.5px; margin-left: auto; }
.fs-callmemo { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--go-bg, var(--primary-tint));
  border: 1px solid color-mix(in srgb, var(--go) 35%, var(--line)); }
.fs-callmemo[hidden] { display: none; }
.fs-callmemo-q { font-size: 14px; margin: 0 0 8px; line-height: 1.6; }
.fs-callmemo textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; padding: 8px 10px;
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); }
.fs-callmemo-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }

/* いつでも聞ける (2026-09-23): an ask bar while the chat is scrolled away, and the
   chat itself lifted over the page as a sheet (phones) / a floating window (PC). */
.chat-sheet-head { display: none; }
.ask-bar {
  position: fixed; z-index: 55; bottom: 20px; left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 320px)); min-height: 52px; padding: 8px 10px 8px 8px;
  display: flex; align-items: center; gap: 10px; border-radius: 999px; cursor: pointer;
  background: var(--card); color: var(--muted); border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .35), var(--shadow-sm);
  font: inherit; font-size: 15px; text-align: left;
  transition: bottom .25s cubic-bezier(.2, .8, .2, 1);
}
.ask-bar[hidden] { display: none; }
.ask-bar img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.ask-bar-text { flex: 1; min-width: 0; }
.ask-bar-go {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--act); color: var(--on-act); font-size: 17px;
}
.chat-sheet-backdrop { position: fixed; inset: 0; z-index: 1190; background: rgba(0, 0, 0, .4); animation: um-fade .18s ease-out; }
.chat-sheet-backdrop[hidden] { display: none; }
body.chat-sheet .chat {
  position: fixed; z-index: 1200; right: 24px; bottom: 24px; width: min(460px, calc(100vw - 48px));
  height: min(700px, calc(100vh - 110px));
  animation: um-rise .22s cubic-bezier(.2, .8, .2, 1);
}
.chat-sheet-title { display: flex; align-items: center; gap: 8px; }
.chat-sheet-face { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none;
  background: linear-gradient(160deg, #f6efe0, #e6ecf5); box-shadow: 0 0 0 1px var(--line); }

/* floating windows on a PC (static/floatwin.js): move by the header, size from the corner */
.is-floating { position: fixed; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45), 0 0 0 1px var(--line); }
.coach-pop.is-floating { max-height: none; z-index: 61; }
.fw-handle { cursor: move; user-select: none; touch-action: none; }
.fw-grip { display: none; }
.is-floating > .fw-grip {
  display: block; position: absolute; right: 2px; bottom: 2px; width: 18px; height: 18px; z-index: 2;
  cursor: nwse-resize; touch-action: none; opacity: .7;
  background: linear-gradient(135deg, transparent 0 45%, var(--muted) 45% 52%, transparent 52% 64%, var(--muted) 64% 71%, transparent 71%);
}
.is-floating > .fw-grip:hover { opacity: 1; }
/* the panel scrolls as a whole: keep the grip pinned to its visible corner */
.coach-pop.is-floating > .fw-grip { position: sticky; top: auto; bottom: -12px; margin: -18px -16px -12px auto; }
body.fw-dragging { user-select: none; }
body.fw-dragging iframe { pointer-events: none; }
body.chat-sheet .chat-sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); font-size: 15px;
}
.chat-sheet-close { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; padding: 8px; cursor: pointer; }
body.chat-sheet .coach, body.chat-sheet .ask-bar { display: none; }
@media (max-width: 720px) {
  .ask-bar { left: 12px; right: 12px; width: auto; transform: none; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .has-tabbar.tabbar-away .ask-bar { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .typing .ask-bar { display: none; }
  body.chat-sheet { overflow: hidden; }
  body.chat-sheet .chat {
    left: 0; right: 0; bottom: 0; width: auto; top: auto;
    height: calc(100dvh - 44px) !important; border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  body.chat-sheet .tabbar { transform: translateY(110%); }
}
@media (prefers-reduced-motion: reduce) { .ask-bar, body.chat-sheet .chat { transition: none; animation: none; } }

/* 2026-09-23: 予定と期限 / 電話の話すことメモ / まとめ・共有 / お知らせ */
.case-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.case-tool {
  display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--text);
  font-size: 13.5px; font-weight: 700; text-decoration: none;
}
.case-tool:hover { border-color: var(--primary); }
.date-alert {
  display: block; text-decoration: none; color: var(--act); background: var(--act-bg);
  border: 1px solid color-mix(in srgb, var(--act) 35%, var(--line)); font-weight: 700; font-size: 14px;
}
.date-alert.is-past { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.date-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.date-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); }
.date-item.is-soon { border-color: color-mix(in srgb, var(--act) 50%, var(--line)); background: var(--act-bg); }
.date-item.is-past { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.date-main { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.date-main b { font-size: 15px; }
.date-left { font-size: 13px; font-weight: 700; color: var(--muted); }
.is-soon .date-left { color: var(--act); }
.is-past .date-left { color: var(--danger); }
.date-title { margin: 4px 0 8px; font-size: 14.5px; line-height: 1.6; }
.date-title small { color: var(--muted); font-size: 12px; }
.date-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.date-actions .btn-mini { text-decoration: none; }
.date-actions .link-button { font-size: 13px; }
.date-del { margin: 0 0 0 auto; }
.date-del .link-button { color: var(--muted); }
[data-dates-list].is-new { animation: dates-new 2.4s ease-out; border-radius: 12px; }
@keyframes dates-new { 0% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--act) 60%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.date-add { margin: 6px 0; }
.date-add summary { cursor: pointer; font-weight: 700; color: var(--primary); font-size: 14px; padding: 6px 0; }
.date-add-form { display: grid; gap: 10px; margin-top: 8px; }
.date-add-form label { display: grid; gap: 4px; font-size: 13.5px; font-weight: 700; }
.date-add-form input {
  font: inherit; font-size: 16px; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--text); min-height: 44px; box-sizing: border-box; width: 100%;
}
.push-toggle { margin-top: 6px; }
.push-state { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.6; }
.push-state:empty { display: none; }

.fs-script { margin: 10px 0; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--card); }
.fs-script summary { cursor: pointer; padding: 10px 12px; font-weight: 700; font-size: 14px; }
.fs-script-body { padding: 0 14px 12px; }
.fs-script-h { margin: 10px 0 2px; font-weight: 700; font-size: 13.5px; color: var(--primary); }
.fs-script-body ul { margin: 0; padding-left: 1.3em; font-size: 15px; line-height: 1.75; }
.fs-script-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
@media print {
  body.print-script * { visibility: hidden; }
  body.print-script .fs-script.is-printing, body.print-script .fs-script.is-printing * { visibility: visible; }
  body.print-script .fs-script.is-printing { position: absolute; left: 0; top: 0; width: 100%; border: 0; font-size: 18px; }
  body.print-script .fs-script.is-printing .fs-script-body ul { font-size: 18px; }
  body.print-script .fs-script-actions { display: none; }
}

.summary { max-width: 760px; margin: 0 auto 18px; }
.summary-head h1 { margin: 2px 0 4px; font-size: 24px; line-height: 1.4; }
.summary-kicker { margin: 0; font-size: 13px; font-weight: 700; color: var(--gold); }
.summary-meta { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.summary-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.summary-actions .btn-mini { text-decoration: none; display: inline-flex; align-items: center; }
.summary-sec { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.summary-sec h2 { margin: 0 0 8px; font-size: 16px; }
.summary-next { border-color: color-mix(in srgb, var(--act) 45%, var(--line)); background: var(--act-bg); }
.summary-next p { margin: 0; font-weight: 700; font-size: 15.5px; }
.summary-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.summary-table th, .summary-table td { text-align: left; padding: 7px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.summary-table tr:first-child th, .summary-table tr:first-child td { border-top: 0; }
.summary-table th { white-space: nowrap; font-weight: 700; }
.summary-left { white-space: nowrap; color: var(--muted); font-size: 13px; text-align: right !important; }
.summary-table .is-soon .summary-left { color: var(--act); font-weight: 700; }
.summary-table .is-past .summary-left { color: var(--danger); font-weight: 700; }
.summary-facts { margin: 0; display: grid; gap: 6px; }
.summary-facts div { display: grid; grid-template-columns: minmax(6em, 30%) 1fr; gap: 10px; font-size: 14.5px; }
.summary-facts dt { color: var(--muted); font-weight: 700; }
.summary-facts dd { margin: 0; }
.summary-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line-strong); }
.summary-timeline li { position: relative; padding: 0 0 12px 12px; font-size: 14.5px; line-height: 1.65; }
.summary-timeline li::before { content: ""; position: absolute; left: -20px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.summary-timeline .tl-call::before { background: var(--act); }
.summary-timeline .tl-evidence::before { background: var(--go); }
.summary-timeline time { display: block; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.summary-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; }
.summary-checks li { display: grid; grid-template-columns: 5.5em 1fr; gap: 8px; align-items: baseline; }
.summary-checks b { font-size: 12.5px; color: var(--muted); }
.summary-checks .st-done b, .summary-checks .ev-collected b { color: var(--go); }
.summary-checks .st-later b { color: var(--act); }
.summary-foot { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.shared-banner { max-width: 760px; margin: 0 auto 14px; background: var(--primary-tint); }
.shared-banner p { margin: 6px 0 0; }
.shared-gone-title { font-size: 20px; margin: 0 0 8px; }
.share-card { max-width: 760px; margin: 0 auto 24px; }
.share-warn { background: var(--act-bg); color: var(--act); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 700; line-height: 1.6; }
.share-live input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--text);
}
.share-buttons { display: flex; gap: 8px; margin: 8px 0 0; }
.link-button.btn-danger-text { color: var(--danger); }
@media (max-width: 560px) {
  .summary-table, .summary-table tbody { display: block; }
  .summary-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
  .summary-table tr:first-child { border-top: 0; }
  .summary-table th, .summary-table td { border: 0; padding: 0; }
  .summary-table td:not(.summary-left) { grid-column: 1 / -1; grid-row: 2; }
}
@media print {
  .no-print, .site-head, .site-foot, .tabbar, .a2hs-bar, .coach, .feedback-fab { display: none !important; }
  body { background: #fff; }
  .summary { max-width: none; }
  .summary-sec { break-inside: avoid; border-color: #bbb; }
}

/* 似たケースと統計 (insights) */
.insights-page { max-width: 820px; margin: 0 auto; }
.insights-kata { color: var(--muted); font-weight: 700; margin-top: -6px; }
.insights-updated { font-size: 13px; color: var(--muted); }
.insights-caution { border-left: 4px solid var(--gold-soft); }
.insights-calcs { display: flex; flex-direction: column; gap: 8px; }
.insights-calc-link { text-align: center; text-decoration: none; }
.insights-stat h3 { margin-bottom: 4px; }
.insights-headline { font-weight: 700; }
.insights-bars { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.insights-bars li { display: grid; grid-template-columns: minmax(96px, 30%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.insights-bars .bar-track { background: var(--line); border-radius: 999px; height: 10px; overflow: hidden; }
.insights-bars .bar-fill { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.insights-bars .bar-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.insights-bars .bar-num small { color: var(--muted); }
.insights-source { font-size: 12px; color: var(--muted); }
.insights-case-meta { font-size: 12.5px; color: var(--muted); }
.insights-card .btn-mini { display: block; margin: 6px 0; text-align: center; }
.insights-card-headline { font-size: 13.5px; font-weight: 700; }
@media (max-width: 560px) {
  .insights-bars li { grid-template-columns: 1fr auto; }
  .insights-bars .bar-track { grid-column: 1 / -1; order: 3; }
}
.calc-form p { margin: 0 0 12px; }
.calc-form label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.calc-form input[type="number"], .calc-form select { width: 100%; max-width: 280px; font-size: 16px; padding: 8px; }
.calc-form ul { list-style: none; padding: 0; margin: 4px 0; }
.calc-form ul label { font-weight: 400; display: flex; gap: 6px; align-items: flex-start; }
.calc-form .errorlist { color: var(--danger, #b00020); font-size: 13px; }
.calc-result { border-left: 4px solid var(--primary); }
.calc-kind { font-size: 13.5px; color: var(--muted); margin: 0; }
.calc-band { font-size: 28px; font-weight: 800; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.calc-error { font-weight: 700; color: var(--danger, #b00020); }
.calc-lines { padding-left: 18px; font-size: 14px; }
.calc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.calc-tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 13.5px; }
.calc-tabs a.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
/* プランの切り替え (アップグレード) */
a.plan-cta, a.plan-cta-yearly, a.plan-cta-down { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
.plan-change-page { max-width: 620px; }
.plan-change-summary .plan-change-row { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0; }
.plan-change-summary .plan-change-row span { color: var(--muted); }
.plan-change-arrow { text-align: center; margin: 0; color: var(--muted); }
.plan-change-amount { font-size: 28px; font-weight: 800; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.plan-change-error { border-left: 4px solid var(--danger); color: var(--danger); font-weight: 700; }
/* 固定ヘッダー (56px / スマホ 52px) の下に見出しが潜らないように。
   #dates-card などへのリンクと scrollIntoView(block:"start") の両方に効く。 */
html { scroll-padding-top: 68px; }
@media (max-width: 720px) { html { scroll-padding-top: 64px; } }
/* ヘルパーの窓: 100vh はスマホだとアドレスバーの分だけ画面より高く、上が切れていた。
   見えている高さ (dvh) から、ヘッダー・ボタン・余白を引いた高さに収めて、中をスクロールさせる。 */
.coach-pop { max-height: calc(100vh - 162px); max-height: calc(100dvh - 162px); }
@media (max-width: 640px) {
  .coach-pop { max-height: calc(100vh - 222px); max-height: calc(100dvh - 222px - env(safe-area-inset-bottom)); }
}

/* ---- この件の進め方 (2026-09-25): one numbered list; the bar above links into it ---- */
.steps-nav { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.steps-nav-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.steps-nav-count { font-size: 15px; }
.steps-nav-now { font-size: 13px; color: var(--muted); }
.step-chips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.step-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 5px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--card-2); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; }
.step-chip:hover { border-color: var(--line-strong); }
.step-chip-no, .plan-no { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 12.5px; font-weight: 800; background: var(--primary-tint); color: var(--muted); }
.plan-no-ok { display: none; }
.step-chip.done, .plan-step.is-done .plan-step-head { color: var(--muted); }
.step-chip.done .step-chip-no, .plan-step.is-done .plan-no { background: var(--go); color: #fff; }
.step-chip.done .plan-no-n, .plan-step.is-done .plan-no-n { display: none; }
.step-chip.done .plan-no-ok, .plan-step.is-done .plan-no-ok { display: inline; }
.step-chip.now { border-color: var(--act); background: var(--act-bg); color: var(--act); }
.step-chip.now .step-chip-no, .plan-step.is-now .plan-no { background: var(--act); color: var(--on-act); }

.plan-card { margin-top: 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow-md);
  border: 1px solid color-mix(in srgb, var(--act) 40%, var(--line)); padding: 14px 14px 10px; }
.plan-top { display: flex; align-items: center; gap: 12px; padding: 0 2px 10px; }
.plan-top-text h2 { font-size: 18px; margin: 0; }
.plan-top-text p { font-size: 13px; color: var(--muted); margin: 2px 0 0; line-height: 1.5; }
.fs-face { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--line); }
.plan-finish { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--go-bg); color: var(--go); font-weight: 700; font-size: 14px; }
.plan-finish[hidden] { display: none; }
.plan-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-step { border: 1px solid var(--line); border-radius: 14px; background: var(--card); scroll-margin-top: 10px; }
.plan-step.is-now { border-color: var(--act); box-shadow: 0 0 0 1px var(--act); }
.plan-step.is-flash { animation: plan-flash 1.2s ease; }
@keyframes plan-flash { 0%, 60% { background: var(--act-bg); } 100% { background: var(--card); } }
.plan-step-head { display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; list-style: none; }
.plan-step-head::-webkit-details-marker { display: none; }
.plan-step-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.plan-step-text b { font-size: 15.5px; }
.plan-step-text small { font-size: 12.5px; color: var(--muted); }
.plan-step-state { flex: none; display: flex; align-items: center; gap: 6px; }
.plan-badge { display: none; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.plan-step.is-done .plan-badge-done { display: inline; background: var(--go-bg); color: var(--go); }
.plan-step.is-now .plan-badge-now { display: inline; background: var(--act); color: var(--on-act); }
.plan-count { font-size: 12.5px; color: var(--muted); padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 12%, transparent); }
.plan-count b { color: var(--text); }
.plan-step-body { padding: 0 12px 12px; }
.plan-sub { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }
.plan-sub small { display: block; font-weight: 500; }
.plan-step-body .fs-list { padding: 0; }
.plan-step-body .ev-list { gap: 8px; }
.plan-step-body .ev { font-size: 14px; }
.plan-empty { margin: 8px 0 0; }
.plan-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plan-doc { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card-2); }
.plan-doc-head { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; font-weight: 700; }
.plan-doc .ev-mark { color: var(--line-strong); }
.plan-doc.is-made .ev-mark { color: var(--go); }
.plan-doc.is-skipped { background: transparent; }
.plan-doc.is-skipped .plan-doc-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.plan-doc.is-skipped .plan-doc-body > .card-hint, .plan-doc.is-skipped .doc-create { display: none; }
.plan-doc-body { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.plan-step-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.plan-step-actions [hidden] { display: none; }
.plan-close { border-color: var(--go); color: var(--go); font-weight: 700; }
/* 初動 rows inside the list: a mark instead of a number */
.fs-mark { background: transparent; border: 2px solid var(--act); }
.fs-item[data-status="done"] .fs-mark::after { content: "✓"; color: #fff; }
.fs-item[data-status="skip"] .fs-mark::after { content: "－"; color: #fff; }
.fs-item[data-status="done"] .fs-mark, .fs-item[data-status="skip"] .fs-mark { border-color: transparent; }

.wait-box { margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 8%, var(--card));
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line)); display: flex; flex-direction: column; gap: 8px; }
.wait-box[hidden] { display: none; }
.wait-box .overdue { color: var(--act); font-weight: 700; }
.wait-box .wait-clear { margin: 0; }
.date-adds { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.exit-card > summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--muted); list-style: none; }
.exit-card > summary::-webkit-details-marker { display: none; }
.exit-card > summary::before { content: "▸ "; }
.exit-card[open] > summary::before { content: "▾ "; }
.exit-card[open] > summary { margin-bottom: 8px; }
@media (max-width: 640px) {
  .plan-card { padding: 12px 10px 8px; }
  .plan-step-head { padding: 10px; gap: 8px; }
  .plan-step-body { padding: 0 10px 10px; }
  .step-chip { font-size: 12.5px; }
}

/* ---- press feedback for buttons that leave for Stripe (busy.js) ---- */
.btn-send:active, .btn-mini:active { transform: scale(.96); filter: brightness(.93); transition-duration: .05s; }
[data-busy].is-busy {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: progress; pointer-events: none; transform: none; filter: none;
  animation: busy-pulse 1.4s ease-in-out infinite;
}
a[data-busy].is-busy { display: flex; }
.busy-spin {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: busy-spin .7s linear infinite;
}
[data-busy].is-waiting { opacity: .45; pointer-events: none; filter: grayscale(.4); }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@keyframes busy-pulse { 50% { opacity: .78; } }
@media (prefers-reduced-motion: reduce) {
  .busy-spin { animation-duration: 2s; }
  [data-busy].is-busy { animation: none; }
}

/* ===== 公開ページ (型カタログ / 検索からの入口) ==========================
   .pub-* は未ログインの人がいちばん最初に見る面。読み物として成立する組版に
   寄せる (行長 / 行間 / 見出しの間) — 滞在時間と読了率が検索順位に効く。 */
.pub { max-width: 760px; margin: 0 auto; }
.pub-crumb { max-width: 760px; margin: 14px auto 0; font-size: 13px; color: var(--muted); }
.pub-crumb a { color: var(--muted); text-decoration: none; }
.pub-crumb a:hover { color: var(--primary); text-decoration: underline; }
.pub-head { padding: 22px 0 8px; border-bottom: 1px solid var(--line); }
.pub-cat {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  color: var(--gold); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 3px 10px; margin-bottom: 10px;
}
.pub-h1 { font-size: clamp(26px, 5.2vw, 38px); line-height: 1.28; margin: 0 0 10px; letter-spacing: -.01em; }
.pub-lead { font-size: 17px; line-height: 1.75; color: var(--text); margin: 0 0 12px; }
.pub-intro { font-size: 15px; line-height: 1.95; color: var(--muted); margin: 0 0 18px; }
.pub-intro strong, .pub-lead strong { color: var(--text); }
.pub-urgent {
  display: inline-block; background: var(--act-bg); color: var(--act); font-weight: 700;
  border-radius: 10px; padding: 8px 12px; font-size: 14px; margin: 0 0 14px;
}
.pub-cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.pub-btn {
  display: inline-block; border-radius: 12px; padding: 13px 20px; font-weight: 700;
  font-size: 15px; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease;
}
.pub-btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-md); }
.pub-btn.ghost { background: var(--card); color: var(--primary); border: 1px solid var(--line-strong); }
.pub-btn.big { padding: 16px 28px; font-size: 17px; }
.pub-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.pub-sec { padding: 28px 0; border-bottom: 1px solid var(--line); }
.pub-sec:last-of-type { border-bottom: 0; }
.pub-h2 { font-size: clamp(20px, 3.6vw, 25px); line-height: 1.4; margin: 0 0 10px; }
.pub-h2 a { color: inherit; text-decoration: none; }
.pub-h2 a:hover { text-decoration: underline; }
.pub-count, .pub-jump-chip span { font-size: 13px; color: var(--muted); font-weight: 500; }
.pub-note { font-size: 14px; line-height: 1.85; color: var(--muted); margin: 0 0 16px; }

.pub-steps { list-style: none; counter-reset: none; padding: 0; margin: 0; }
.pub-step { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 14px; margin: 0 0 12px; box-shadow: var(--shadow-sm); }
.pub-step-title { display: flex; align-items: center; gap: 10px; font-size: 17px; margin: 0 0 8px; line-height: 1.45; }
.pub-step-no {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--primary);
  color: var(--on-primary); font-size: 14px; display: grid; place-items: center;
}
.pub-step-why { font-size: 15px; line-height: 1.85; margin: 0 0 10px; color: var(--text); }
.pub-step-how { margin: 0 0 8px; padding-left: 20px; font-size: 14.5px; line-height: 1.8; color: var(--text); }
.pub-step-how li { margin: 0 0 4px; }
.pub-step-skip { font-size: 13px; color: var(--muted); margin: 0; }
.pub-after {
  background: var(--primary-tint); border-radius: 14px; padding: 16px 18px;
  font-size: 15px; line-height: 1.85; margin: 16px 0 0;
}

.pub-flow { list-style: none; padding: 0; margin: 0; }
.pub-flow-item { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.pub-flow-item:last-child { border-bottom: 0; }
.pub-flow-no {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; background: var(--card-2);
  border: 1px solid var(--line-strong); color: var(--muted); font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}
.pub-flow-body { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.pub-flow-body span { font-size: 13.5px; color: var(--muted); }

.pub-evidence { list-style: none; padding: 0; margin: 0; }
.pub-evidence li {
  display: flex; gap: 10px; align-items: baseline; font-size: 15px; line-height: 1.75;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
}
.pub-evidence li:last-child { border-bottom: 0; }
.pub-ev-key {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 700; color: var(--gold);
  border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 6px;
}
.pub-docs { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pub-docs li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.pub-docs b { display: block; font-size: 15.5px; margin: 0 0 4px; }
.pub-docs span { font-size: 14px; color: var(--muted); line-height: 1.75; }

.pub-faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 8px; }
.pub-faq-item summary { cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: 15.5px; line-height: 1.6; }
.pub-faq-item[open] summary { border-bottom: 1px solid var(--line); }
.pub-faq-item p { margin: 0; padding: 14px 16px; font-size: 14.5px; line-height: 1.9; color: var(--text); }

.pub-disclaim {
  background: var(--card-2); border: 1px solid var(--line-strong); border-left: 3px solid var(--gold);
  border-radius: 12px; padding: 16px 18px; margin: 26px 0;
}
.pub-disclaim b { display: block; font-size: 14px; margin: 0 0 6px; }
.pub-disclaim p { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--muted); }
.pub-disclaim strong { color: var(--text); }

.pub-close { text-align: center; }
.pub-close p { font-size: 15px; line-height: 1.9; color: var(--muted); margin: 0 0 18px; }

.pub-jump { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0 4px; }
.pub-jump-chip {
  display: inline-flex; gap: 6px; align-items: baseline; background: var(--card);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px;
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--text);
}
.pub-jump-chip:hover { border-color: var(--primary); color: var(--primary); }

.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pub-card {
  display: flex; flex-direction: column; gap: 4px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  text-decoration: none; color: var(--text); box-shadow: var(--shadow-sm);
  transition: border-color .12s ease, transform .12s ease;
}
.pub-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.pub-card b { font-size: 15.5px; line-height: 1.45; }
.pub-card span { font-size: 13px; color: var(--muted); line-height: 1.6; }
.pub-card-urgent { color: var(--act) !important; font-weight: 600; }
.pub-more { margin: 18px 0 40px; font-size: 15px; }
.pub-more a { color: var(--primary); font-weight: 700; }

@media (max-width: 560px) {
  .pub-grid { grid-template-columns: 1fr; }
  .pub-sec { padding: 22px 0; }
}
