/* PAWCARE スタイル（スマートフォン最優先） */
:root {
  --brand: #1f7a68;
  --brand-dark: #165a4d;
  --brand-soft: #e3f2ee;
  --bg: #f4f7f6;
  --card: #ffffff;
  --text: #1d2b28;
  --muted: #64746f;
  --line: #e2e9e6;
  --danger: #d23f3f;
  --danger-soft: #fdecec;
  --radius: 16px;
  --nav-h: 64px;
  --shadow: 0 1px 2px rgba(20, 50, 45, .06), 0 4px 14px rgba(20, 50, 45, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }
p { margin: 0 0 .6em; }
.noscript { padding: 16px; background: var(--danger-soft); }

/* ヘッダー */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .06em; color: var(--brand-dark); }
.brand img { border-radius: 8px; }
.header-emergency {
  border: 0; border-radius: 999px; padding: 6px 14px;
  background: var(--danger); color: #fff; font-weight: 700; font-size: .85rem;
}

.app-main { max-width: 560px; margin: 0 auto; padding: 14px 14px 8px; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
.page-title { margin: 6px 2px 12px; }

/* カード */
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  margin-bottom: 14px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sub { font-weight: 700; margin: 12px 0 6px; }
.pre { white-space: pre-wrap; }
.empty { color: var(--muted); text-align: center; padding: 14px 0; margin: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-between h1, .row-between h2 { margin-bottom: 0; }
.row-between + * { margin-top: 10px; }
.notice-small { font-size: .78rem; color: var(--muted); text-align: center; margin: 4px 8px 12px; }
.disclaimer { font-size: .8rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 14px; }
.ok-text { color: var(--brand); font-weight: 700; text-align: center; margin: 4px 0; }
.error-text { color: var(--danger); font-weight: 700; }
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: .8rem; font-weight: 700; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; flex-direction: column;
  min-height: 46px; padding: 10px 16px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; text-decoration: none; text-align: center; line-height: 1.3;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn.big { min-height: 64px; font-size: 1.1rem; }
.btn small { font-weight: 500; font-size: .85rem; opacity: .9; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--brand-dark); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: #fff; border-color: #f2c4c4; color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.form-actions { display: grid; gap: 10px; margin-top: 14px; }
.link { background: none; border: 0; color: var(--brand); font-weight: 700; padding: 6px 0; }
.icon-btn { background: none; border: 0; width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; color: var(--muted); }
.chev { color: #a9b6b2; font-size: 1.4rem; margin-left: auto; }

/* ホーム */
.emergency-card, .action-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
}
.emergency-card { background: var(--danger-soft); border: 1px solid #f4c9c9; color: #8f1f1f; }
.emergency-card .em-ico, .action-card > span:first-child { font-size: 1.6rem; }
.emergency-card strong, .action-card strong { display: block; font-size: 1rem; }
.emergency-card small, .action-card small { display: block; color: inherit; opacity: .85; font-size: .8rem; }
.action-card { background: var(--card); }
.welcome { text-align: center; }
.welcome .btn { margin-top: 10px; }
.pet-hero { display: flex; align-items: center; gap: 14px; }
.pet-hero h1 { margin: 0; }
.pet-hero p { margin: 0; }
.pet-avatar {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%;
  background: var(--brand-soft); display: grid; place-items: center; font-size: 1.9rem;
}
.quick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0 12px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 70px; padding: 6px 2px; border-radius: 14px; font-size: .74rem; font-weight: 700;
  background: color-mix(in srgb, var(--c) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c) 30%, #fff);
  color: var(--text);
}
@supports not (background: color-mix(in srgb, red 10%, white)) {
  .quick-btn { background: #f7faf9; border-color: var(--line); }
}
.quick-btn span { font-size: 1.5rem; line-height: 1.1; }
.quick-btn:active { transform: scale(.95); }
@media (max-width: 340px) { .quick-grid { grid-template-columns: repeat(4, 1fr); } }

/* チップ */
.chips { display: flex; gap: 8px; margin-bottom: 12px; }
.chips.scroll-x { overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 14px; font-size: .9rem; font-weight: 600; white-space: nowrap;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 記録リスト */
.day-head { font-size: .9rem; color: var(--muted); margin: 18px 4px 8px; }
.log-list, .memo-list { list-style: none; margin: 0; padding: 0; }
.card > .log-list { margin: 0 -6px; }
.app-main > .log-list { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.log-list li + li, .memo-list li + li { border-top: 1px solid var(--line); }
.log-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: 0; text-align: left; padding: 11px 12px; min-height: 56px;
}
.log-item:active { background: #f1f6f4; }
.log-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3.1em; color: var(--brand-dark); }
.log-dot { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1.05rem; background: #eee; }
.log-dot { background: color-mix(in srgb, var(--c) 18%, #fff); }
.log-main { display: flex; flex-direction: column; min-width: 0; }
.log-cat { font-weight: 700; }
.log-pet { margin-left: 8px; color: var(--muted); font-weight: 500; }
.log-memo { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.log-value { font-size: .9rem; font-weight: 700; }

/* フォーム */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
input:not([type=radio]):not([type=checkbox]):not([type=file]), select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px; min-height: 46px;
  border: 1px solid #cfdad6; border-radius: 10px; background: #fff; font-size: 16px; font-weight: 400;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, #6b7a76 50%), linear-gradient(135deg, #6b7a76 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 32px;
}
input[type=date], input[type=datetime-local] { min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 50%, transparent); border-color: var(--brand); }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 12px; }
legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.req { font-size: .7rem; background: var(--danger); color: #fff; border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { color: var(--danger); font-weight: 700; font-size: .9rem; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
.cat-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cat-opt { margin: 0; }
.cat-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cat-opt span {
  display: block; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: .9rem; background: #fff;
}
.cat-opt input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); box-shadow: inset 0 0 0 1px var(--c); }
.cat-opt input:focus-visible + span { outline: 2px solid var(--brand); }
.filters { padding-bottom: 8px; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.filter-grid .span2 { grid-column: span 2; }
.file-btn { position: relative; overflow: hidden; margin: 0; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* 問診 */
.choice-list { display: grid; gap: 8px; margin-bottom: 12px; }
.choice { margin: 0; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; font-weight: 600; background: #fff; }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input:checked + span::before { content: "✓ "; color: var(--brand); }
.choice input:focus-visible + span { outline: 2px solid var(--brand); }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: var(--brand); transition: width .2s ease; }
.progress + p { margin: 6px 2px 10px; }
.wizard-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 16px; }
.memo {
  white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: .88rem;
  background: #f7faf9; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 8px 0 0;
  max-height: 60vh; overflow: auto; -webkit-user-select: text; user-select: text;
}
.alert { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.alert.danger { background: var(--danger-soft); border: 1px solid #f2c0c0; color: #7d1a1a; }
.alert ul { margin: 8px 0 0; padding-left: 1.2em; font-size: .9rem; }
.alert li + li { margin-top: 3px; }
.alert p { margin: 6px 0 0; font-size: .9rem; }
.card .alert { margin: 12px 0; }
.check-list { padding-left: 1.2em; margin: 0 0 10px; }
.emergency-title { color: var(--danger); }

/* ペット */
.pet-card.is-active { border-color: color-mix(in srgb, var(--brand) 45%, #fff); }
.pet-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.pet-card-head h2, .pet-card-head p { margin: 0; }
.pet-dl { display: grid; grid-template-columns: 5em 1fr; gap: 4px 10px; margin: 8px 0 0; font-size: .92rem; }
.pet-dl dt { color: var(--muted); }
.pet-dl dd { margin: 0; }
.notice ul { padding-left: 1.2em; margin: 0 0 8px; font-size: .92rem; }

/* 下部ナビ */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.bottom-nav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; font-size: .7rem; font-weight: 700; color: var(--muted);
}
.bottom-nav .ico { font-size: 1.35rem; line-height: 1; filter: grayscale(1); opacity: .7; }
.bottom-nav button.active { color: var(--brand); }
.bottom-nav button.active .ico { filter: none; opacity: 1; }

/* シート（モーダル） */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 30, 26, .45); animation: fade .15s ease; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh;
  background: var(--bg); border-radius: 20px 20px 0 0; display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto; animation: up .2s ease;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 8px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); }
@keyframes up { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* トースト・バナー */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  width: max-content; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center;
  background: #213330; color: #fff; padding: 10px 14px; border-radius: 14px; font-size: .9rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2); animation: up .2s ease;
}
.toast button { background: rgba(255, 255, 255, .14); border: 0; color: #9ff0d9; font-weight: 700; padding: 6px 10px; border-radius: 8px; }
.storage-banner {
  display: flex; gap: 8px; align-items: flex-start; max-width: 560px; margin: 10px auto 0;
  padding: 10px 6px 10px 14px; border-radius: 12px; font-size: .88rem; background: #fff6df; border: 1px solid #f0d58a;
}
.storage-banner.error { background: var(--danger-soft); border-color: #f2c0c0; color: #7d1a1a; }
.storage-banner span { flex: 1; padding-top: 8px; }

@media (min-width: 600px) {
  .app-main { padding-top: 20px; }
  .sheet-panel { bottom: auto; top: 50%; transform: translateY(-50%); border-radius: 20px; animation: none; }
}

/* 予定・共有（v1.1） */
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-dark); vertical-align: 2px; }
.tag.danger { background: var(--danger); color: #fff; }
.tag.warn { background: #f5b335; color: #3a2a00; }
.rem-actions { display: flex; gap: 8px; padding: 0 12px 12px 58px; flex-wrap: wrap; }
.rem-done .log-cat { color: var(--muted); text-decoration: line-through; }
.alert.warn { background: #fff6df; border: 1px solid #f0d58a; color: #5a4300; font-size: .9rem; }
.qr-wrap { text-align: center; margin-bottom: 12px; }
.qr { width: min(280px, 80vw); height: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.share-url { font-size: 13px !important; }
.shared-head h1 { margin: 6px 0 2px; }
.shared-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.shared-table th, .shared-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.shared-table th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.shared-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
body[data-view=view] .bottom-nav, body[data-view=view] .header-emergency { display: none; }
body[data-view=view] { padding-bottom: 24px; }
@media print {
  .app-header, .bottom-nav, .toast, .storage-banner, .no-print { display: none !important; }
  body { background: #fff; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .memo { max-height: none; }
}

/* 犬・猫向けの見直し（v1.2） */
.species-big { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; }
.species-btn { min-height: 58px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: .72rem; font-weight: 700; line-height: 1.2; padding: 4px 2px; word-break: keep-all; overflow-wrap: anywhere; }
.species-btn.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.day-summary { list-style: none; margin: 0; padding: 0; }
.day-summary li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.day-summary li div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ds-item { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #f1f6f4; font-size: .85rem; font-weight: 600; }
.ds-item.ds-alert { background: var(--danger-soft); color: #7d1a1a; }
.ds-details { margin-top: 12px; }
.ds-details summary { cursor: pointer; color: var(--brand); font-weight: 700; padding: 6px 0; }
@media print { .ds-details { display: block; } .ds-details[open] summary, .ds-details summary { display: none; } }

/* v1.3 もしもの準備・要点・読み上げメモ */
.prep-list { list-style: none; margin: 8px 0 0; padding: 0; }
.prep-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.prep-list .prep-label { flex: 1; }
.prep-list li.done .prep-label { color: var(--muted); }
.night-call { margin-top: 10px; }
.phone-script { background: #fffdf3; border-color: #f0e2a8; font-size: .95rem; line-height: 1.8; }
.key-points { border: 2px solid var(--brand); }
.kp-dl { display: grid; grid-template-columns: 6.5em 1fr; gap: 6px 10px; margin: 0; font-size: .95rem; }
.kp-dl dt { color: var(--muted); font-weight: 600; }
.kp-dl dd { margin: 0; font-weight: 600; }

/* v1.4 ごはんチェック */
.nu-need { font-size: 1.05rem; margin-bottom: 8px; }
.nu-need small { display: block; color: var(--muted); font-size: .8rem; }
.nu-findings, .nu-sugg { list-style: none; margin: 0; padding: 0; }
.nu-findings li { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }
.nu-findings li.nu-warn { color: #6b4300; }
.nu-sugg li { padding: 6px 0 6px 1.2em; position: relative; font-size: .92rem; }
.nu-sugg li::before { content: "・"; position: absolute; left: 0; }
.toxic-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.toxic-row input { margin-top: 0 !important; }
.toxic-row .btn { flex: 0 0 auto; }

/* v1.5 もしもカード・前回から・誤食メモ・受診記録・引き継ぎ */
.quick-btn .qs { display: block; font-size: .6rem; font-weight: 500; color: var(--muted); line-height: 1.25; margin-top: 2px; }
.quick-grid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
.quick-btn { min-height: 84px; }
.pet-hero { flex-wrap: wrap; }
.hero-card-btn { margin-left: auto; }
.moshimo { border: 2px solid #d23f3f; }
.moshimo-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 10px; }
.moshimo-head span { color: #d23f3f; font-weight: 700; font-size: .9rem; }
.moshimo-head strong { font-size: 1.3rem; }
.cf-empty { color: #a9b6b2 !important; font-weight: 500 !important; }
.card-tel { white-space: nowrap; color: var(--brand-dark); font-weight: 700; }
.med-row { border: 1px dashed var(--line); border-radius: 10px; padding: 8px; margin-bottom: 8px; display: grid; gap: 6px; }
.med-row input { margin-top: 0 !important; }
.choice-list.cols2 { grid-template-columns: 1fr 1fr; }
.ref-note { background: #f1f6f4; border-radius: 10px; padding: 8px 10px; font-size: .88rem; }
.alert.small { font-size: .85rem; padding: 10px 12px; }
.import-head h1 { font-size: 1.15rem; margin: 6px 0 2px; }
body[data-view=cardview] .bottom-nav, body[data-view=cardview] .header-emergency { display: none; }
body[data-view=cardview] { padding-bottom: 24px; }
@media print { .moshimo { border-width: 1px; max-width: 148mm; } }
.kp-dl { grid-template-columns: 7.5em 1fr; }
.kp-dl dd { white-space: pre-line; }

/* v1.6 健康手帳 */
.book-cover h1 { font-size: 1.6rem; margin: 6px 0 10px; }
.book-list { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.book-list li { padding: 6px 0; border-top: 1px solid var(--line); }
.wchart { width: 100%; height: auto; display: block; margin: 4px 0 10px; }
.wgrid { stroke: #e2e9e6; stroke-width: 1; }
.wtick { fill: #64746f; font-size: 12px; }
.wline { fill: none; stroke: #1f7a68; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wdot { fill: #1f7a68; stroke: #fff; stroke-width: 2; }
.whit { fill: transparent; }
.wpt:hover .wdot { r: 6; }
.wlabel { fill: #1d2b28; font-size: 13px; font-weight: 700; }
body[data-view=book] .storage-banner { display: none; }
@media print {
  body[data-view=book] .card { break-inside: avoid; page-break-inside: avoid; border: 1px solid #cfdad6; }
  body[data-view=book] .book-cover { border: 2px solid #1f7a68; }
  .no-print { display: none !important; }
}
@media print { body[data-view=book] .app-main { max-width: none; padding: 0; } }

/* v1.7 がんばり（EXP・レベル・勲章） */
.game-bar { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; }
.gb-lv { grid-row: span 2; font-weight: 800; font-size: 1.15rem; color: #fff; background: linear-gradient(135deg, #1f7a68, #2ea58a); border-radius: 12px; padding: 10px 10px; min-width: 3.6em; text-align: center; }
.gb-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gb-title { font-weight: 700; font-size: .92rem; }
.gb-streak { color: #c2410c; font-weight: 700; font-size: .85rem; }
.gb-track { display: block; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.gb-track span { display: block; height: 100%; background: #e8a33d; border-radius: 99px; }
.gb-track.big { height: 12px; margin: 8px 0 4px; }
.gb-exp { font-size: .72rem; color: var(--muted); }
.gb-say { grid-column: 1 / -1; font-size: .85rem; background: #fffdf3; border: 1px solid #f0e2a8; border-radius: 12px; padding: 6px 10px; }
.game-hero { text-align: center; }
.gh-lv { font-size: 2rem; font-weight: 800; color: #1f7a68; margin: 0; }
.gh-title { font-weight: 700; margin: 0; }
.gh-say { background: #fffdf3; border: 1px solid #f0e2a8; border-radius: 12px; padding: 8px 10px; margin-top: 10px; }
.medals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.medal { border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; background: #f7f7f7; }
.medal .m-icon { font-size: 1.7rem; filter: grayscale(1); opacity: .35; }
.medal .m-name { font-weight: 700; font-size: .78rem; color: var(--muted); }
.medal .m-how { font-size: .66rem; color: var(--muted); line-height: 1.35; }
.medal.got { background: #fff8e6; border-color: #f0d58a; }
.medal.got .m-icon { filter: none; opacity: 1; }
.medal.got .m-name { color: var(--text); }

/* v1.8 ホームの整理 */
.em-strip { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 1px solid #f4c9c9; background: var(--danger-soft); color: #8f1f1f; border-radius: 12px; padding: 9px 12px; margin-bottom: 12px; font-size: .82rem; }
.em-strip .chev { margin-left: auto; color: #c98b8b; }
.pet-hero.slim { padding: 12px 14px; gap: 12px; flex-wrap: nowrap; }
.pet-avatar.sm { width: 46px; height: 46px; font-size: 1.6rem; }
.hero-text { min-width: 0; flex: 1; }
.hero-text h1 { font-size: 1.15rem; }
.hero-text p { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-chip { flex: 0 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 3px; width: 84px; border: 1px solid #f0d58a; background: #fff8e6; border-radius: 12px; padding: 6px 8px; text-align: center; }
.lv-n { font-weight: 800; color: #1f7a68; font-size: .95rem; line-height: 1; }
.lv-s { font-size: .68rem; color: #c2410c; font-weight: 700; line-height: 1; }
.lv-chip .gb-track { height: 5px; }
.quick-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 6px; }
.quick-btn { min-height: 76px; font-size: .7rem; padding: 6px 1px; }
.quick-btn .qs { font-size: .56rem; white-space: nowrap; }
.notice-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: .88rem; box-shadow: var(--shadow); }
.notice-row .chev { margin-left: auto; }
.tiles-card { padding: 12px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: #f4f7f6; border-radius: 14px; padding: 10px 2px; font-size: .7rem; font-weight: 700; line-height: 1.25; color: var(--text); min-height: 74px; }
.tile span { font-size: 1.5rem; line-height: 1; }
.sheet .prep { border: 0; box-shadow: none; padding: 0; }

/* v1.9 プラン・広告枠 */
.plans { display: grid; gap: 12px; }
.plan-price { font-size: 1.25rem; font-weight: 800; color: var(--brand-dark); margin: 4px 0; }
.plan-items { margin: 8px 0 0; padding-left: 1.2em; font-size: .9rem; }
.plan-pro { border-color: #9fd3c4; }
.plan-family { border-color: #f0d58a; }
.upsell { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: #f2f7ff; border: 1px solid #cfe0f7; border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: .85rem; color: #1d3557; }
.upsell .chev { margin-left: auto; }
.ad-card { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text); position: relative; padding-top: 22px; }
.ad-label { position: absolute; top: 8px; left: 12px; font-size: .65rem; font-weight: 800; color: #6b4300; background: #fff3dc; border: 1px solid #f0d58a; border-radius: 4px; padding: 0 5px; }
.ad-title { font-weight: 700; }
.ad-sponsor { font-size: .72rem; color: var(--muted); }

/* 飼い方のめやす（v1.10） */
.guide-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.guide-pick select { width: 100%; }
.guide-dl { margin: 0; }
.guide-dl > div { padding: 10px 0; border-top: 1px solid var(--line); }
.guide-dl > div:first-child { border-top: 0; }
.guide-dl dt { font-weight: 700; margin-bottom: 2px; }
.guide-dl dt span { margin-right: 6px; }
.guide-dl dd { margin: 0; line-height: 1.6; }
.guide-breed p { margin: 6px 0; line-height: 1.6; }
.guide-note { margin: 8px 4px 16px; line-height: 1.6; }
.exotic-note { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #fff7ec; }
.sp-emoji { display: block; font-size: 1.4rem; line-height: 1.2; }

/* ============================================================
 * v1.11 うちの子ステージ・Wiiのようにシンプルで子どもも触れるホーム
 * 原則：白とうすい空色、大きく丸いボタン、文字は少なく、押すと気持ちよく反応する
 * ============================================================ */
:root { --soft-blue: #34a8d8; --soft-blue-soft: #e6f5fc; --round-font: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "Zen Maru Gothic", "M PLUS Rounded 1c", "Hiragino Sans", "Noto Sans JP", sans-serif; }
body[data-view=home], body[data-view=avatar] { background: linear-gradient(#f7fafb, #eef3f5); }
body[data-view=home] #app, body[data-view=avatar] #app { font-family: var(--round-font); }
.stage { position: relative; margin: 4px 0 14px; padding: 16px 16px 14px; border-radius: 28px; text-align: center;
  background: linear-gradient(180deg, var(--bg-a, #E9F6FD), var(--bg-b, #fff)); border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d9e4e8, 0 6px 18px rgba(40, 90, 110, .10); }
.stage .bubble { position: relative; display: inline-block; max-width: 92%; margin: 0 auto 2px; padding: 10px 16px; border-radius: 20px;
  background: #fff; border: 2px solid #d9e4e8; font-weight: 700; font-size: 1rem; line-height: 1.5; color: var(--text); }
.stage .bubble::after { content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -8px; border: 8px solid transparent; border-top-color: #d9e4e8; border-bottom: 0; }
.av-btn { position: relative; display: block; margin: 4px auto 0; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.av-btn svg { display: block; margin: 0 auto; overflow: visible; }
.stage-name h1 { margin: 0; font-size: 1.5rem; }
.stage-name p { margin: 0 0 8px; font-size: .9rem; }
.stage .lv-chip { margin: 0 auto 10px; }
.stage-actions { display: flex; gap: 10px; justify-content: center; }
.pill { min-height: 48px; padding: 0 20px; border-radius: 999px; border: 2px solid #d3dfe3; background: linear-gradient(#fff, #f1f5f7);
  font: inherit; font-weight: 700; font-size: 1rem; color: var(--text); box-shadow: 0 2px 0 #d3dfe3; }
.pill:active { transform: translateY(2px); box-shadow: none; }
.stage.small { padding: 12px; }
.stage.calm .bubble { border-color: var(--danger); }

/* アバターの動き */
.av-live .av-body { transform-origin: 100px 190px; animation: av-bob 2.6s ease-in-out infinite; }
.av-live .av-eyes { transform-box: fill-box; transform-origin: center; animation: av-blink 5s infinite; }
.av-live .av-tail { transform-box: fill-box; transform-origin: 0% 100%; animation: av-wag 1.4s ease-in-out infinite; }
.av-live .av-ears { transform-box: fill-box; transform-origin: 50% 100%; animation: av-ear 3.2s ease-in-out infinite; }
.av-live .av-wing { transform-box: fill-box; transform-origin: 30% 20%; animation: av-wag 1.8s ease-in-out infinite; }
.av-live .av-bubble { animation: av-up 3s ease-in infinite; }
.av-live .av-bubble.b2 { animation-delay: 1.4s; }
.av-live.av-fish .av-body { animation: av-swim 3s ease-in-out infinite; }
.av-live .av-shadow { transform-box: fill-box; transform-origin: center; animation: av-shadow 2.6s ease-in-out infinite; }
.stage.calm .av-live * { animation: none !important; }
.av-btn.jump svg { animation: av-jump .5s cubic-bezier(.3, 1.6, .5, 1); }
.av-btn .heart { position: absolute; left: 50%; top: 10%; color: #f06a86; font-size: 1.8rem; pointer-events: none; animation: av-heart 1s ease-out forwards; }
@keyframes av-bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-5px) scale(1.01, .99); } }
@keyframes av-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes av-wag { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }
@keyframes av-ear { 0%, 80%, 100% { transform: rotate(0); } 88% { transform: rotate(-6deg); } }
@keyframes av-up { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-40px); opacity: 0; } }
@keyframes av-swim { 0%, 100% { transform: translateX(-4px) rotate(-2deg); } 50% { transform: translateX(4px) rotate(2deg); } }
@keyframes av-shadow { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.9); } }
@keyframes av-jump { 0% { transform: translateY(0); } 40% { transform: translateY(-22px) scale(1.04); } 100% { transform: translateY(0); } }
@keyframes av-heart { 0% { transform: translate(-50%, 0) scale(.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-50%, -60px) scale(1.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .av-live *, .av-btn.jump svg, .av-btn .heart { animation: none !important; } }

/* ワンタップ記録を「チャンネル」のような丸い大きなボタンに */
body[data-view=home] .card { border-radius: 24px; }
.quick-grid.channels { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-grid.channels .quick-btn { min-height: 88px; border-radius: 20px; border: 2px solid #dbe5e9; background: linear-gradient(#fff, #f3f7f9);
  box-shadow: 0 3px 0 #dbe5e9; font-weight: 700; transition: transform .08s; }
.quick-grid.channels .quick-btn:active { transform: translateY(3px); box-shadow: none; }
.quick-grid.channels .quick-btn > span { font-size: 1.7rem; }
body[data-view=home] .tile { border-radius: 20px; border: 2px solid #dbe5e9; background: linear-gradient(#fff, #f3f7f9); box-shadow: 0 3px 0 #dbe5e9; }
body[data-view=home] .tile:active { transform: translateY(3px); box-shadow: none; }

/* 着せかえ */
.avatar-edit h2 { font-size: 1rem; margin: 14px 0 8px; }
.avatar-edit h2:first-child { margin-top: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 2px solid #dbe5e9; background: var(--sw, #fff); font: inherit; font-weight: 700; color: var(--text); }
.sw.on { border-color: var(--soft-blue); box-shadow: 0 0 0 3px var(--soft-blue-soft); }
.sw.color { width: 44px; height: 44px; padding: 0; background: #fff; display: grid; place-items: center; }
.sw.color span { width: 30px; height: 30px; border-radius: 50%; background: var(--sw); border: 2px solid #3D3436; }
.share-img { display: block; width: 100%; max-width: 360px; margin: 0 auto 10px; border-radius: 16px; border: 1px solid var(--line); }
/* ステージは横並びでコンパクトに（ワンタップ記録が最初の画面に入るように） */
.stage { text-align: left; padding: 12px 12px 12px; }
.stage-row { display: flex; align-items: center; gap: 6px; }
.stage-row .av-btn { flex: 0 0 auto; margin: 0; }
.stage-side { flex: 1; min-width: 0; }
.stage .bubble { display: block; max-width: none; margin: 0 0 8px; padding: 8px 12px; font-size: .92rem; border-radius: 16px; }
.stage .bubble::after { left: -9px; bottom: auto; top: 50%; margin: -8px 0 0; border: 8px solid transparent; border-right-color: #d9e4e8; border-left: 0; }
.stage-name h1 { font-size: 1.3rem; line-height: 1.3; }
.stage-name p { margin: 0 0 6px; font-size: .82rem; }
.stage .lv-chip { margin: 0; }
.stage-actions { margin-top: 8px; }
.stage-actions .pill { flex: 1; min-height: 44px; font-size: .95rem; padding: 0 10px; }
.stage.small { text-align: center; }
.stage.small .av-btn { margin: 0 auto; }

/* ============================================================
 * v1.12 動きと手応え（「AIでアプリを作る時に使う、動きの名前24」から、使える所に）
 * どれも「動きを減らす」設定ではオフ。緊急時の画面ではお祝い・スタッガーを使わない
 * ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* イラストのアバター */
.av { position: relative; display: inline-block; vertical-align: middle; }
.av .av-body { position: absolute; inset: 0; transform-origin: 50% 95%; }
.av img { display: block; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; user-select: none; }
.av .av-over { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.av .av-shadow { position: absolute; left: 22%; right: 22%; bottom: 1%; height: 7%; border-radius: 50%; background: rgba(0, 0, 0, .07); }
.av-live .av-body { animation: av-breathe 2.8s ease-in-out infinite; }
.av-live.av-fish .av-body, .av-live.av-bird .av-body { animation: av-float 3.2s ease-in-out infinite; }
.av-live .av-shadow { animation: av-shadow 2.8s ease-in-out infinite; }
.av-btn.jump .av-body { animation: av-jump .55s cubic-bezier(.3, 1.6, .5, 1); }
.stage.calm .av-live .av-body, .stage.calm .av-live .av-shadow { animation: none !important; }
@keyframes av-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, .975); } }
@keyframes av-float { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-6px) rotate(1.5deg); } }

/* 1 リップル（押した所から波紋） */
.has-ripple { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .16; transform: scale(0); pointer-events: none; animation: ripple .55s ease-out forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* 1 トグル（チェックボックスをスイッチの見た目に） */
input[type=checkbox] { -webkit-appearance: none; appearance: none; flex: 0 0 auto; width: 46px; height: 28px; margin: 0 8px 0 0; border-radius: 999px;
  background: #cfd8dc; position: relative; vertical-align: middle; cursor: pointer; transition: background .2s; }
input[type=checkbox]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.3, 1.5, .5, 1); }
input[type=checkbox]:checked { background: var(--brand); }
input[type=checkbox]:checked::after { transform: translateX(18px); }
input[type=checkbox]:focus-visible { outline: 3px solid var(--soft-blue-soft); outline-offset: 2px; }

/* 1 ローディングボタン（くるくる→チェック） */
.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, .15); border-top-color: var(--brand); animation: spin .7s linear infinite; }
.btn.primary.is-loading::after { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.is-done { animation: done-pop .4s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes done-pop { 50% { transform: scale(1.06); } }

/* 2 スケルトン（中身の形を先に出す） */
.skeleton { display: grid; gap: 12px; padding-top: 6px; }
.sk-card { display: grid; grid-template-columns: 56px 1fr; grid-auto-rows: 14px; gap: 10px 12px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.sk-card i { grid-row: span 3; height: 56px; border-radius: 12px; }
.sk-card b { grid-column: 2; border-radius: 7px; }
.sk-card b.short { width: 55%; }
.sk-card:not(:has(i)) b { grid-column: 1 / -1; }
.sk-card i, .sk-card b { background: linear-gradient(90deg, #eef2f3 25%, #f8fafb 50%, #eef2f3 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* 2 プログレスバー（もしもの準備の進み具合） */
.progress { display: block; height: 10px; border-radius: 999px; background: #e7eef0; overflow: hidden; margin: 6px 0 4px; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f2a65a, #f7c46a); transition: width .5s ease; }
.progress.slim { height: 6px; margin: 4px 0 0; max-width: 220px; }
.notice-row .grow { flex: 1; min-width: 0; }

/* 3 トースト（下からふわっと出て、すっと消える） */
.toast { animation: toast-in .35s cubic-bezier(.2, 1.4, .4, 1); }
.toast.out { animation: toast-out .2s ease forwards; }
@keyframes toast-in { from { transform: translate(-50%, 24px) scale(.96); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes toast-out { to { transform: translate(-50%, 12px); opacity: 0; } }

/* 3 ボトムシート（ばねで出て、つまみを下に引くと閉じる） */
.sheet-grab { display: none; }
@media (max-width: 599px) {
  .sheet-panel { animation: sheet-up .38s cubic-bezier(.2, 1.25, .4, 1); transition: transform .25s ease; }
  .sheet-grab { display: block; width: 44px; height: 5px; border-radius: 3px; background: #c9d4d8; margin: 8px auto -4px; touch-action: none; }
  .sheet-head { touch-action: none; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

/* 4 スワイプアクション（記録を左にずらすと「削除」） */
.swipe-row { position: relative; overflow: hidden; touch-action: pan-y; }
.swipe-row .log-item { position: relative; z-index: 1; background: var(--card); transition: transform .25s cubic-bezier(.2, 1.2, .4, 1); }
.swipe-del { position: absolute; right: 0; top: 0; bottom: 0; width: 88px; border: 0; background: var(--danger); color: #fff; font: inherit; font-weight: 700; }
.swipe-hint { margin: 6px 4px; }

/* 5 いいねのはじけ（ワンタップ記録が「ぽん」とはずんで＋1） */
.popped { animation: pop .45s cubic-bezier(.3, 1.8, .5, 1); }
.plus-one { position: absolute; right: 8px; top: 6px; font-weight: 800; color: var(--brand); pointer-events: none; animation: plus-one .9s ease-out forwards; }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes plus-one { 0% { transform: translateY(6px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-26px); opacity: 0; } }

/* 5 コンフェッティ（レベルアップ・勲章のときだけ） */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translate(var(--x), 105vh) rotate(var(--r)); } }

/* 6 シェイク（まちがいを横に震えて知らせる） */
.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* 7 スタッガー（画面が切り替わったとき、上から順にふわっと） */
#app.enter > * { animation: rise .38s cubic-bezier(.2, .9, .3, 1) both; }
#app.enter > *:nth-child(2) { animation-delay: .04s; } #app.enter > *:nth-child(3) { animation-delay: .08s; }
#app.enter > *:nth-child(4) { animation-delay: .12s; } #app.enter > *:nth-child(5) { animation-delay: .16s; }
#app.enter > *:nth-child(n+6) { animation-delay: .2s; }
#app.enter .channels .quick-btn { animation: rise .35s cubic-bezier(.2, .9, .3, 1) both; animation-delay: calc(.1s + var(--n, 0) * .025s); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ripple, .confetti, .plus-one { display: none !important; }
  .toast, .toast.out, .sheet-panel, .popped, .shake, #app.enter > *, #app.enter .channels .quick-btn, .av-live .av-body, .av-live .av-shadow, .is-done { animation: none !important; }
  .swipe-row .log-item, input[type=checkbox]::after, .progress > span { transition: none; }
}

/* ============================================================
 * v1.13 Duolingoに学ぶ「楽しく続く」：今日のおせわ・パーフェクト・コンボ・厚みのあるボタン
 * ============================================================ */
/* 厚みのある押しボタン（押すと沈む） */
.btn.primary { box-shadow: 0 4px 0 var(--brand-dark); border-radius: 16px; font-weight: 800; letter-spacing: .02em; transition: transform .06s, box-shadow .06s; }
.btn.primary:active { transform: translateY(4px); box-shadow: 0 0 0 var(--brand-dark); }
.btn.danger { box-shadow: 0 4px 0 #a52c2c; }
.btn.danger:active { transform: translateY(4px); box-shadow: none; }

/* 今日のおせわ（太い進み具合バー） */
.daily { margin: -2px 0 12px; padding: 10px 12px 8px; border-radius: 18px; background: #f3f8fa; border: 2px solid #e2edf1; }
.daily .row-between strong { font-size: 1rem; }
.daily-count { font-weight: 800; color: var(--soft-blue); }
.daily .small { margin: 2px 0 0; }
.progress.big { height: 16px; margin: 6px 0; background: #e2ebee; }
.progress.big > span { background: linear-gradient(180deg, #7fd86a, #58c442); position: relative; transition: width .6s cubic-bezier(.2, 1.3, .4, 1); }
.progress.big > span::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .45); }
.daily.perfect { background: #fff8e1; border-color: #f6d77a; }
.daily.perfect .progress.big > span { background: linear-gradient(180deg, #ffd45c, #f5b417); }
.quick-btn[data-goal] { position: relative; }
.quick-btn[data-goal=todo]::before { content: ""; position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: #58c442; box-shadow: 0 0 0 2px #fff; }
.quick-btn[data-goal=done]::before { content: "✓"; position: absolute; top: 4px; right: 5px; width: 20px; height: 20px; border-radius: 50%; background: #58c442; color: #fff; font-size: .75rem; line-height: 20px; font-weight: 800; text-align: center; }

/* パーフェクトのお祝い画面 */
.celebrate { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(circle at 50% 35%, #fffbe8 0%, #fff4c9 45%, #ffe8a3 100%); animation: fade .25s ease; }
.celebrate.out { animation: fade .22s ease reverse forwards; }
.cel-inner { width: 100%; max-width: 380px; text-align: center; font-family: var(--round-font); }
.cel-av { display: flex; justify-content: center; animation: cel-hop 1s cubic-bezier(.3, 1.6, .5, 1) .1s 2 both; }
.cel-title { margin: 8px 0 0; font-size: 2.6rem; font-weight: 900; letter-spacing: .04em; color: #f59e0b;
  text-shadow: 0 3px 0 #c2700a, 0 6px 14px rgba(194, 112, 10, .25); animation: cel-pop .6s cubic-bezier(.2, 1.8, .4, 1) .2s both; }
.cel-sub { margin: 4px 0 16px; font-weight: 700; color: #6b5a2a; }
.cel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.cel-stats > div { padding: 10px 4px; border-radius: 16px; background: #fff; border: 2px solid #f3dc92; box-shadow: 0 3px 0 #f3dc92; animation: rise .4s ease both; }
.cel-stats > div:nth-child(2) { animation-delay: .1s; } .cel-stats > div:nth-child(3) { animation-delay: .2s; }
.cel-n { display: block; font-size: 1.4rem; font-weight: 900; color: #3d3436; }
.cel-stats small { color: #8a7a4a; font-weight: 700; }
.cel-next { min-height: 56px; font-size: 1.15rem; }
@keyframes cel-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes cel-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-24px); } }
@media (prefers-reduced-motion: reduce) { .celebrate, .cel-av, .cel-title, .cel-stats > div { animation: none !important; } .progress.big > span { transition: none; } }

/* ============================================================
 * v1.14 Finch×Duolingo×Atoms：会いたくなるホーム・タップの瞬間の反応・今週のようす・音と振動
 * ============================================================ */
.haptic-switch { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
input.haptic-input { -webkit-appearance: auto; appearance: auto; }

/* ステージ（上にうちの子、すぐ下に今日のお世話） */
.stage.finch { text-align: center; padding: 10px 12px 12px; }
.stage-top { display: flex; align-items: center; gap: 8px; }
.stage-top .spacer { flex: 1; }
.stage-top .lv-chip { margin: 0; }
.streak-chip { padding: 4px 10px; border-radius: 999px; background: #fff3e0; border: 2px solid #ffd9a8; font-weight: 800; color: #e8710a; font-size: .9rem; }
.streak-chip.off { filter: grayscale(1); opacity: .6; }
.icon-pill { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #d3dfe3; background: #fff; font-size: 1.2rem; box-shadow: 0 2px 0 #d3dfe3; }
.icon-pill:active { transform: translateY(2px); box-shadow: none; }
.stage.finch .bubble { display: inline-block; max-width: 92%; margin: 8px auto 0; text-align: center; }
.stage.finch .bubble::after { left: 50%; top: auto; bottom: -10px; margin: 0 0 0 -8px; border: 8px solid transparent; border-top-color: #d9e4e8; border-bottom: 0; }
.stage.finch .av-btn { margin: 2px auto -4px; }
.stage.finch .stage-name h1 { font-size: 1.35rem; }
.stage.finch .stage-name p { margin-bottom: 8px; }

/* タップした瞬間の反応：ぴょこっと跳ねて首をかしげる */
.av-btn.react .av-body { animation: av-react .7s cubic-bezier(.3, 1.7, .5, 1); }
@keyframes av-react { 0% { transform: none; } 30% { transform: translateY(-14px) rotate(-6deg) scale(1.04); } 60% { transform: translateY(0) rotate(4deg); } 100% { transform: none; } }

/* 今日のお世話の一覧 */
.care { text-align: left; margin-top: 4px; padding: 10px 12px 8px; border-radius: 20px; background: #fff; border: 2px solid #e2edf1; }
.care.perfect { background: #fff8e1; border-color: #f6d77a; }
.care.perfect .progress.big > span { background: linear-gradient(180deg, #ffd45c, #f5b417); }
.care-list { list-style: none; margin: 6px 0 2px; padding: 0; display: grid; gap: 6px; }
.care-row { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 6px 10px; border-radius: 16px;
  border: 2px solid #e2edf1; background: #f8fbfc; font: inherit; text-align: left; color: var(--text); box-shadow: 0 3px 0 #e2edf1; }
.care-row:active { transform: translateY(3px); box-shadow: none; }
.care-ic { font-size: 1.5rem; width: 34px; text-align: center; }
.care-label { flex: 1; font-weight: 800; }
.care-label small { display: block; font-weight: 600; color: var(--muted); }
.care-check { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #cfdbe0; background: #fff; display: grid; place-items: center; font-weight: 900; color: #fff; }
.care-row.done { background: #effae9; border-color: #bfe8ae; box-shadow: 0 3px 0 #bfe8ae; }
.care-row.done .care-check { background: #58c442; border-color: #58c442; animation: check-pop .35s cubic-bezier(.3, 1.8, .5, 1); }
.care .link.small { font-size: .85rem; margin-top: 4px; }
@keyframes check-pop { from { transform: scale(.3); } to { transform: none; } }

/* 今週のようす（数字の下に、次の行動が分かる一文） */
.wm-list { list-style: none; margin: 4px 0 0; padding: 0; }
.wm-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.wm-list li:first-child { border-top: 0; }
.wm-ic { font-size: 1.4rem; width: 32px; text-align: center; }
.wm-main { flex: 1; min-width: 0; }
.wm-title b { font-size: 1.1rem; }
.wm-main small { display: block; color: var(--muted); }
.wm-dots { display: grid; grid-template-columns: repeat(7, 10px); gap: 3px; }
.wm-dots i { width: 10px; height: 10px; border-radius: 3px; background: #e5ecef; }
.wm-dots i.on { background: #58c442; }
.check-list { display: grid; gap: 6px; margin: 8px 0; }
.check-row { display: flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 700; }

/* パーフェクトの肉球スタンプ */
.cel-card { position: relative; padding: 14px 14px 10px; margin: 6px 0 14px; border-radius: 22px; background: #fff; border: 2px solid #f3dc92; box-shadow: 0 4px 0 #f3dc92; }
.cel-card .cel-title { margin-top: 0; }
.cel-done { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0; padding: 0; }
.cel-done li { padding: 4px 10px; border-radius: 999px; background: #effae9; color: #2f7d22; font-weight: 800; font-size: .9rem; }
.paw-stamp { position: absolute; right: -6px; top: -18px; width: 86px; height: 86px; color: #e2533c; transform: rotate(-14deg); opacity: .9;
  animation: stamp .45s cubic-bezier(.2, 1.5, .4, 1) .55s both; }
.paw-stamp svg { width: 100%; height: 100%; }
@keyframes stamp { 0% { transform: scale(2.8) rotate(-30deg); opacity: 0; } 70% { transform: scale(.9) rotate(-12deg); opacity: 1; } 100% { transform: scale(1) rotate(-14deg); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .av-btn.react .av-body, .care-row.done .care-check, .paw-stamp { animation: none !important; } }
/* v1.14.1 読みやすさ：小さすぎる文字を大きく（分析レビュー） */
.quick-grid.channels .quick-btn .qs { font-size: .72rem; white-space: normal; line-height: 1.25; }
.wm-main small, .care-label small { font-size: .82rem; }
.call-first .btn.big { font-size: 1.15rem; }

/* v1.15 緊急時の追加（外平先生のご意見）：落ち着いた見た目で、動きは使わない */
.em-guide h2 { margin-bottom: 4px; }
.toxic-grid { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.toxic-grid li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 14px; background: #fff5f3; border: 2px solid #f6d3cc; text-align: center; }
.toxic-grid li::after { content: ""; position: absolute; top: 8px; left: 50%; width: 46px; height: 46px; margin-left: -23px; border-radius: 50%; border: 3px solid rgba(210, 63, 63, .55);
  background: linear-gradient(135deg, transparent 46%, rgba(210, 63, 63, .55) 46%, rgba(210, 63, 63, .55) 54%, transparent 54%); pointer-events: none; }
.tx-ic { font-size: 2rem; line-height: 46px; height: 46px; }
.tx-name { font-weight: 800; font-size: .85rem; line-height: 1.3; }
.tx-tag { font-size: .7rem; font-weight: 700; color: var(--danger); }
.em-item { border: 2px solid var(--line); border-radius: 14px; margin: 8px 0; background: #fff; }
.em-item > summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; min-height: 56px; }
.em-item > summary::-webkit-details-marker { display: none; }
.em-item > summary::after { content: "＋"; margin-left: auto; font-weight: 800; color: var(--muted); }
.em-item[open] > summary::after { content: "−"; }
.em-item > summary small { display: block; color: var(--muted); font-size: .8rem; }
.em-item[open] { border-color: #f2b8b0; }
.em-item > :not(summary) { margin-left: 12px; margin-right: 12px; }
.em-item ul, .em-item ol { padding-left: 1.3em; margin-top: 2px; }
.em-item li { margin: 4px 0; line-height: 1.55; }
.em-ic { font-size: 1.6rem; }
.em-action { font-weight: 800; color: #9b1c1c; background: var(--danger-soft); padding: 8px 10px; border-radius: 10px; }
.em-item .btn-row { margin: 8px 12px 12px; }
.draft-note { font-size: .82rem; background: #fff8e1; border: 1px solid #f3dc92; border-radius: 10px; padding: 6px 10px; }
/* v1.15 手触りの調整（制作レビュー） */
.confetti { z-index: 85; }
.care-row.popped { animation: care-press .32s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes care-press { 0% { transform: translateY(2px) scale(.99); } 55% { transform: translateY(-2px) scale(1.02); } 100% { transform: none; } }
.care-row .plus-one { right: 50px; top: 50%; margin-top: -12px; font-size: 1.15rem; color: #2f7d22; animation-duration: .7s; }
.care-row.done:not(.popped) .care-check { animation: none; }
.paw-stamp { animation: stamp .5s cubic-bezier(.2, 1.5, .4, 1) .36s both; }
@keyframes stamp { 0% { transform: scale(2.6) rotate(-30deg); opacity: 0; } 60% { transform: scale(2.4) rotate(-26deg); opacity: .85; } 85% { transform: scale(.92) rotate(-12deg); opacity: 1; } 100% { transform: scale(1) rotate(-14deg); opacity: .9; } }
.stage.finch .bubble { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stage.finch .stage-name { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.stage.finch .stage-name p { margin: 0 0 6px; }
/* v1.15 手触りの調整（制作レビュー） */
.confetti { z-index: 85; }
.care-row.popped { animation: care-press .32s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes care-press { 0% { transform: translateY(2px) scale(.99); } 55% { transform: translateY(-2px) scale(1.02); } 100% { transform: none; } }
.care-row .plus-one { right: 50px; top: 50%; margin-top: -12px; font-size: 1.15rem; color: #2f7d22; animation-duration: .7s; }
.care-row.done:not(.popped) .care-check { animation: none; }
.paw-stamp { animation: stamp .5s cubic-bezier(.2, 1.5, .4, 1) .36s both; }
@keyframes stamp { 0% { transform: scale(2.6) rotate(-30deg); opacity: 0; } 60% { transform: scale(2.4) rotate(-26deg); opacity: .85; } 85% { transform: scale(.92) rotate(-12deg); opacity: 1; } 100% { transform: scale(1) rotate(-14deg); opacity: .9; } }
.stage.finch .bubble { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stage.finch .stage-name { display: flex; align-items: baseline; justify-content: center; gap: 8px; flex-wrap: wrap; }
.stage.finch .stage-name p { margin: 0 0 6px; }
.stage.finch .bubble { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
