/* ===== wannaポータル - Mobile First CSS ===== */

:root {
  /* Warm Paper theme — cream paper / notebook feel */
  --primary: #BF7E3E;        /* warm terracotta */
  --primary-light: #F5E8D2;  /* cream tint */
  --text: #3D342A;           /* dark warm brown */
  --sub: #8D7C69;            /* warm gray */
  --line-green: #06C755;     /* LINE brand — unchanged */
  --danger: #C94B3A;         /* warm red */
  --danger-bg: #FBECE8;      /* warm pale red */
  --border: #E4D8BF;         /* warm beige border */
  --bg: #F3ECDA;             /* cream paper page bg */
  --warm: #FAF3E2;           /* light cream */
  --white: #FFFDF7;          /* slightly warm white */
  --orange: #C17A37;         /* warm terracotta accent */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Hiragino Maru Gothic ProN', 'Rounded Mplus 1c', 'Hiragino Sans', 'Noto Sans JP', -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ===== Welcome Screen ===== */
.welcome-screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 40px;
  background: linear-gradient(170deg, #FAF4E4 0%, #F5EDD6 40%, #F0E6C8 70%, #F3ECDA 100%);
  position: relative; overflow: hidden;
}
.welcome-bg-paw { position: absolute; width: 180px; height: 180px; opacity: 0.04; font-size: 160px; }
.welcome-bg-paw.top-right { top: 40px; right: -20px; transform: rotate(20deg); }
.welcome-bg-paw.top-right::after { content: "🐾"; }
.welcome-bg-paw.bottom-left { bottom: 60px; left: -30px; transform: rotate(-15deg); }
.welcome-bg-paw.bottom-left::after { content: "🐾"; }
.welcome-logo-circle {
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 40px rgba(191, 126, 62, 0.10);
  margin-bottom: 28px; overflow: hidden;
}
.welcome-mascot { width: 170px; height: 170px; object-fit: contain; border-radius: 8px; }
.welcome-title { font-size: 32px; font-weight: 800; color: var(--text); margin-bottom: 8px; letter-spacing: -1px; }
.welcome-subtitle { font-size: 14px; color: var(--sub); margin-bottom: 44px; text-align: center; }
.welcome-terms { font-size: 11px; color: var(--sub); margin-top: 16px; text-align: center; line-height: 1.6; }
.welcome-terms a { color: var(--primary); text-decoration: underline; }

/* ===== LINE Login Button (公式ボタン画像) ===== */
/* button_to は <form> を生成するため、ラッパで余白をリセット */
form.btn-line-img-wrapper { margin: 0; padding: 0; display: inline-block; }

.btn-line-img-wrapper {
  background: none; border: none; padding: 0; cursor: pointer;
  display: inline-block; line-height: 0;
  -webkit-tap-highlight-color: transparent;
}
.btn-line-img {
  display: block;
  width: 200px; height: 44px;
  /* Propshaft が fingerprint 付きパスに自動書き換えるため、ファイル名だけ指定する */
  background-image: url("/assets/btn_login_base-63c6fda9.png");
  background-size: contain; background-repeat: no-repeat; background-position: center;
}
@media (hover: hover) {
  .btn-line-img-wrapper:hover .btn-line-img {
    background-image: url("/assets/btn_login_hover-71e75b80.png");
  }
}
.btn-line-img-wrapper:active .btn-line-img {
  background-image: url("/assets/btn_login_press-d62236f2.png");
}
/* Retina（@2x 画像があれば差し替え。今は同じ画像をそのまま使用） */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .btn-line-img { image-rendering: -webkit-optimize-contrast; }
}

/* ===== App Layout ===== */
.app-screen {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; background: var(--bg);
}
/* トップ (.app-header) と各ペット (.sub-header) でヘッダー高を統一 */
.app-header, .sub-header {
  min-height: 52px; box-sizing: border-box;
  padding: 6px 16px; background: white;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.app-header { justify-content: space-between; }
.header-brand { display: flex; align-items: center; gap: 8px; }
.header-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }
.header-title { font-size: 18px; font-weight: 800; color: var(--primary); }
.header-icon { background: none; border: none; cursor: pointer; color: var(--sub); padding: 4px; }

.sub-header {
  justify-content: flex-start;
  position: sticky; top: 0; z-index: 20;
}
.sub-header h2 { font-size: 15px; font-weight: 700; flex: 1; text-align: center; }
.sub-header-spacer { width: 24px; flex-shrink: 0; }
.header-home-btn {
  width: 24px; height: 24px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--sub); text-decoration: none;
}
.header-home-btn:active { opacity: 0.6; }
.pet-header-home {
  padding: 2px 4px;
  display: inline-flex; align-items: center; color: var(--sub);
  text-decoration: none; flex-shrink: 0;
}
.pet-header-home:active { opacity: 0.6; }
.pet-header-actions {
  margin-left: auto; display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0;
}

.pet-sub-header .pet-header-title {
  flex: 1; display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-width: 0;
}
.pet-header-avatar {
  width: 24px; height: 24px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: #F3F4F6; display: flex; align-items: center; justify-content: center;
  text-decoration: none; color: inherit;
}
a.pet-header-avatar { cursor: pointer; }
a.pet-header-avatar:active { opacity: 0.7; }
.pet-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pet-header-emoji { font-size: 14px; }
.pet-sub-header h2 { flex: 0 1 auto; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.pet-header-back {
  margin-left: auto; padding: 4px 6px;
  font-size: 13px; font-weight: 600;
  color: var(--primary); text-decoration: none;
  flex-shrink: 0;
}
.pet-header-back:active { opacity: 0.6; }

.page-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 10px 16px 4px;
}
.page-actions.page-actions-split { justify-content: space-between; }
.page-actions .header-icon { padding: 6px; }

/* ===== Home ===== */
.home-content { flex: 1; overflow-y: auto; padding: 0 16px 80px; }
.group-section { margin: 4px 0 12px; }
.group-header {
  padding: 12px 0 4px;
  display: flex; justify-content: space-between; align-items: center;
}
.group-name-row { display: flex; align-items: center; gap: 8px; }
.group-label { font-size: 17px; font-weight: 700; }
.pet-count { font-size: 12px; color: var(--sub); }
.group-edit-icon-btn {
  background: transparent; border: none; color: var(--sub);
  padding: 6px; cursor: pointer; line-height: 0;
  border-radius: 8px;
}
.group-edit-icon-btn:hover { color: var(--primary); background: var(--primary-light); }
.group-section-stats { font-size: 12px; color: var(--sub); margin: 4px 0 0; }
.group-switch-trigger {
  background: none; border: none; padding: 4px 8px 4px 0; margin: 0;
  cursor: pointer; color: inherit; font: inherit;
  display: flex; align-items: center; gap: 8px;
}
.group-switch-trigger:active { opacity: 0.6; }
.group-switch-chevron { color: var(--sub); flex-shrink: 0; }

/* ===== Group Switcher Sheet ===== */
.group-switcher[hidden] { display: none; }
.group-switcher {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
}
.group-switcher-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4);
  animation: groupSwitcherFade 0.18s ease-out;
}
.group-switcher-sheet {
  position: relative; z-index: 1; width: 100%; max-width: 540px;
  background: white; border-radius: 16px 16px 0 0;
  padding: 8px 0 max(16px, env(safe-area-inset-bottom));
  max-height: 80vh; overflow-y: auto;
  animation: groupSwitcherSlide 0.22s cubic-bezier(0.2, 0.8, 0.4, 1);
}
@keyframes groupSwitcherFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes groupSwitcherSlide {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
body.group-switcher-open { overflow: hidden; }

.group-switcher-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 12px;
}
.group-switcher-header h2 { font-size: 16px; font-weight: 700; }
.group-switcher-close {
  background: none; border: none; cursor: pointer; color: var(--sub);
  padding: 4px; display: flex;
}
.group-switcher-list { list-style: none; padding: 0; margin: 0; }
.group-switcher-list li { padding: 0 12px; }
.group-switcher-form { margin: 0; }
.group-switcher-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 12px; background: white; border: none; border-radius: 12px;
  cursor: pointer; text-align: left; font: inherit; color: inherit;
  text-decoration: none;
}
.group-switcher-item:not(.is-current):active { background: var(--bg); }
.group-switcher-item.is-current {
  background: var(--primary-light, #FFF3E0); cursor: default;
}
.group-switcher-icon { font-size: 22px; flex-shrink: 0; }
.group-switcher-text { flex: 1; min-width: 0; }
.group-switcher-name { font-size: 15px; font-weight: 700; color: var(--text); }
.group-switcher-meta { font-size: 12px; color: var(--sub); margin-top: 2px; }
.group-switcher-current-badge {
  font-size: 11px; font-weight: 700; color: var(--primary);
  padding: 3px 8px; border-radius: 10px; background: white;
  flex-shrink: 0;
}
.group-switcher-footer {
  padding: 12px 16px 4px; border-top: 1px solid var(--border); margin-top: 8px;
}
.group-switcher-create {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px;
  background: var(--primary); color: white; border-radius: 12px;
  font-size: 14px; font-weight: 700; text-decoration: none;
}
.group-switcher-create:active { opacity: 0.8; }
.form-hint {
  font-size: 13px; color: var(--sub); line-height: 1.6;
  margin-bottom: 16px; padding: 0 4px;
}
.btn-add {
  background: var(--primary); color: white; border: none; border-radius: 20px;
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 4px; cursor: pointer;
}

/* ===== Pet Cards ===== */
.pet-list { padding: 8px 0 4px; }
.pet-card {
  background: white; border-radius: 16px; padding: 16px;
  margin-bottom: 10px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04); cursor: pointer;
}
.pet-avatar {
  width: 56px; height: 56px; border-radius: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
  border: 3px solid white; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.pet-info { flex: 1; }
.pet-name { font-size: 16px; font-weight: 700; }
.pet-type { font-size: 13px; color: var(--sub); margin-top: 2px; }
.pet-bday { font-size: 12px; color: #bbb; margin-top: 2px; }

/* ===== Pet Detail ===== */
.pet-detail { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: 80px; }

.pet-profile-card {
  position: relative;
  background: var(--white); border-radius: 14px; padding: 16px;
  box-shadow: 0 2px 10px rgba(100, 70, 40, 0.05);
  border: 1px solid var(--border);
}
.pet-profile-edit {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--sub); background: transparent;
}
.pet-profile-edit:hover { background: var(--bg); }
.pet-profile-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.pet-profile-avatar {
  width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid var(--orange);
  overflow: hidden; background: var(--warm);
  display: flex; align-items: center; justify-content: center;
}
.pet-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pet-profile-emoji { font-size: 34px; }
.pet-profile-info { flex: 1; min-width: 0; }
.pet-profile-name { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.2; }
.pet-profile-gender { color: var(--orange); margin-left: 2px; }
.pet-profile-breed { font-size: 13px; color: var(--sub); margin-top: 2px; }

.pet-date-grid { display: flex; flex-direction: column; gap: 8px; }
.pet-date-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 12px; padding: 10px 14px;
}
.pet-date-icon { font-size: 18px; flex-shrink: 0; }
.pet-date-content { flex: 1; }
.pet-date-label { font-size: 10px; color: var(--sub); font-weight: 600; line-height: 1; margin-bottom: 2px; }
.pet-date-value { font-size: 13px; font-weight: 700; color: var(--text); }

/* Gender Radio Select */
.gender-select { display: flex; gap: 6px; }
.gender-option { flex: 1; }
.gender-radio { display: none; }
.gender-label {
  display: block; text-align: center; padding: 9px 0; border-radius: 10px;
  border: 1px solid var(--border); background: white;
  font-size: 13px; font-weight: 600; color: var(--sub); cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.gender-radio:checked + .gender-label {
  border-color: var(--primary); background: var(--primary-light);
  color: var(--primary);
}

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; color: var(--sub); margin-bottom: 20px; }

/* ===== Bottom Nav ===== */
.bottom-nav {
  display: flex; background: white; border-top: 1px solid var(--border);
  padding: 6px 0 max(8px, env(safe-area-inset-bottom));
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 30;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; font-weight: 600; color: #bbb; background: none; border: none; cursor: pointer;
  padding: 4px 0;
  /* 1行/2行ラベルの差で .bottom-nav の高さが変わるのを防ぐ。
     2行ラベル（Wannaカード）に合わせて min-height を固定し、ページ遷移で nav が swap されても
     フッター高さがブレないようにする。 */
  min-height: 52px;
}
.nav-item.active { color: var(--primary); }
.nav-item svg { width: 24px; height: 24px; }
/* 2行ラベル (Wanna<br>カード 等) — 行高を詰めて他のラベルと縦位置を揃える */
.nav-item-multiline { line-height: 1.05; text-align: center; }

/* ===== Settings ===== */
.settings-content { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: 80px; }
.profile-card {
  background: white; border-radius: 16px; padding: 20px;
  margin-bottom: 12px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.profile-avatar {
  width: 56px; height: 56px; border-radius: 28px;
  background: linear-gradient(135deg, var(--orange), #E8941A);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 16px; font-weight: 700; }
.profile-sub { font-size: 12px; color: var(--sub); }

.settings-section { margin-bottom: 12px; }
/* セクション見出し共通モジュール (settings/その他で使い回せる h2 相当)。
   .section-heading: 推奨。<h2 class="section-heading">name</h2>
   .section-title:   旧スタイル名のエイリアス。新規追加時は .section-heading を使う。 */
.section-heading,
.section-title {
  display: block; margin: 14px 0 6px; padding: 0 4px;
  font-size: 12px; font-weight: 700; color: var(--sub);
  letter-spacing: 0.04em;
}
h2.section-heading, h2.section-title { line-height: 1.4; }
.section-heading:first-child, .section-title:first-child { margin-top: 4px; }
.menu-card { background: white; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.menu-item {
  width: 100%; padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  background: none; border: none; border-top: 1px solid var(--border);
  cursor: pointer; font-size: 15px; color: var(--text); text-align: left;
}
.menu-item:first-child { border-top: none; }
.menu-item svg:first-child { color: var(--sub); flex-shrink: 0; }
.menu-label { flex: 1; font-weight: 500; }
.menu-item-btn { font-family: inherit; }
.menu-danger { color: var(--danger); }
.menu-danger svg:first-child { color: var(--danger); }

/* ===== Profile Edit ===== */
.profile-avatar-edit { display: flex; justify-content: center; margin-bottom: 28px; }
.profile-avatar-large {
  width: 88px; height: 88px; border-radius: 44px;
  background: linear-gradient(135deg, var(--orange), #E8941A);
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  overflow: hidden;
}
.profile-avatar-large img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Group Settings ===== */
.group-info-card {
  background: white; border-radius: 16px; padding: 20px;
  margin-bottom: 12px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.group-icon {
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--warm); display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.group-info-text { flex: 1; }
.group-info-name { font-size: 16px; font-weight: 700; }
.group-info-stats { font-size: 12px; color: var(--sub); }

.invite-section { margin-bottom: 16px; }
.btn-invite-line {
  width: 100%; padding: 14px; border-radius: 14px; border: none;
  background: #06C755; color: white; font-size: 15px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 4px 12px rgba(6,199,85,0.25);
}
.btn-invite-line:active { opacity: 0.85; }
.invite-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0; color: var(--sub); font-size: 12px;
}
.invite-divider::before, .invite-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.invite-code-section { }
.invite-code-display {
  background: white; border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04); margin-bottom: 4px;
}
.invite-label { font-size: 12px; color: var(--sub); }
.invite-code { font-size: 16px; font-weight: 700; font-family: monospace; flex: 1; letter-spacing: 1px; }
.btn-copy {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--primary);
  background: var(--primary-light); color: var(--primary);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.invite-url { font-size: 11px; color: var(--sub); padding: 4px 8px; word-break: break-all; }

.member-list { background: white; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.member-item {
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  border-top: 1px solid var(--border);
}
.member-item:first-child { border-top: none; }
.member-avatar {
  width: 40px; height: 40px; border-radius: 20px;
  background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 20px;
  overflow: hidden;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-info { flex: 1; }
.member-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.you-badge { font-size: 11px; color: var(--sub); font-weight: 400; }
.role-badge {
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 3px; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.role-owner { background: var(--warm); color: #D97706; }
.role-member { background: #F0F0F0; color: #888; }
.member-actions { display: flex; gap: 6px; }
.btn-sm {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: white; font-size: 11px; cursor: pointer; color: #555;
}
.btn-sm-danger { border-color: #FEE2E2; background: var(--danger-bg); color: var(--danger); }

/* ===== Group Show (Phase B-2) ===== */
.group-title-section { margin-bottom: 18px; padding: 4px 4px 0; }
.group-title-display { display: flex; align-items: center; gap: 8px; }
.group-title-name { font-size: 20px; font-weight: 700; margin: 0; }
.group-title-edit-btn {
  background: none; border: none; padding: 4px; color: var(--sub);
  cursor: pointer; display: inline-flex; align-items: center;
}
.group-title-edit-btn:hover { color: var(--primary); }
.group-title-form { display: flex; flex-direction: column; gap: 8px; }
.group-title-input { font-size: 16px; }
.group-title-form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.group-title-stats { font-size: 12px; color: var(--sub); margin: 6px 0 0; }

.section-header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0;
  margin-bottom: 6px;
}
.section-title-inline { padding: 8px 0 6px; }
.section-title-pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: rgba(191, 126, 62, 0.15); color: var(--primary);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}

.btn-add-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 16px; border: none;
  background: var(--primary); color: white;
  font-size: 12px; font-weight: 600; line-height: 1;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn-add-pill:active { opacity: 0.85; }

.btn-pill-primary {
  padding: 8px 16px; border-radius: 8px; border: none;
  background: var(--primary); color: white;
  font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-pill-block { width: 100%; }
.btn-pill-ghost {
  padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--sub); font-size: 13px; cursor: pointer; font-family: inherit;
}

/* グラフ/一覧 view-toggle は iOS 風の segmented control。
   チップ行と同じ row 内の右端に置けるよう flex-shrink: 0。 */
.graph-view-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; border-radius: 8px;
  background: #F1F3F5;
  flex-shrink: 0;
}
.graph-view-toggle-btn {
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 600; color: var(--sub);
  text-decoration: none; cursor: pointer; font-family: inherit;
  background: transparent; border: none;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}
.graph-view-toggle-btn.active {
  background: white; color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* チップ行 + view-toggle を同じ行に並べる */
.chips-with-toggle-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0;
}
.chips-with-toggle-row .graph-chips {
  flex: 1 1 auto; min-width: 0; padding: 0;
}

.role-tag-owner {
  margin-left: 8px; font-size: 10px; font-weight: 600;
  color: var(--primary);
}

.member-empty {
  padding: 16px; color: var(--sub); font-size: 13px; text-align: center; margin: 0;
}

.invite-trigger-wrap { position: relative; }

.member-menu-wrapper { position: relative; margin-left: auto; }
.member-menu-btn {
  background: none; border: none; padding: 4px 8px; font-size: 18px;
  color: var(--sub); cursor: pointer; line-height: 1; font-family: inherit;
}
.member-menu-popover {
  position: absolute; right: 0; top: 100%; margin-top: 4px;
  background: white; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 10; min-width: 160px; overflow: hidden;
}
.member-menu-form { margin: 0; }
.member-menu-item {
  display: block; width: 100%; padding: 10px 14px;
  background: white; border: none; border-bottom: 1px solid var(--border);
  text-align: left; font-size: 13px; cursor: pointer;
  color: var(--text); font-family: inherit;
}
.member-menu-item:last-child { border-bottom: none; }
.member-menu-item:hover { background: var(--bg); }
.member-menu-item-danger { color: var(--danger); }

/* Invite modal (<dialog>) */
.invite-modal {
  padding: 0; border: none; border-radius: 16px;
  width: 92vw; max-width: 480px; background: white; color: var(--text);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  box-sizing: border-box;
}
.invite-modal::backdrop {
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
}
.invite-modal-inner { padding: 20px; }
.invite-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.invite-modal-header h3 { font-size: 16px; font-weight: 700; margin: 0; }
.invite-modal-close {
  width: 32px; height: 32px; border-radius: 16px;
  border: none; background: var(--bg); color: var(--sub);
  font-size: 18px; cursor: pointer; font-family: inherit;
}
.invite-modal-close:hover { background: var(--border); }
.invite-modal-desc {
  color: var(--sub); font-size: 12px; line-height: 1.6; margin: 0 0 12px;
}
.invite-url-block {
  display: block; padding: 10px;
  background: var(--warm); border-radius: 6px;
  font-size: 11px; word-break: break-all; margin-bottom: 12px;
}

/* ===== Join Group ===== */
.join-content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; }
.join-icon { width: 72px; height: 72px; border-radius: 20px; background: var(--warm); display: flex; align-items: center; justify-content: center; font-size: 32px; margin-bottom: 16px; }
.join-group-name { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.join-subtitle { font-size: 14px; color: var(--sub); margin-bottom: 24px; }
.join-pets-card { background: var(--bg); border-radius: 14px; padding: 16px; width: 100%; margin-bottom: 28px; }
.join-pets-label { font-size: 13px; color: var(--sub); margin-bottom: 8px; }
.join-pet-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.join-pet-emoji { font-size: 20px; }
.join-pet-name { font-size: 14px; font-weight: 600; }
.join-pet-type { font-size: 12px; color: var(--sub); }

/* ===== Forms ===== */
/* padding-bottom は固定 .bottom-nav (約 70-90px) + 安全領域 + 余裕分を確保 */
.form-content { flex: 1; overflow-y: auto; padding: 14px 16px calc(90px + env(safe-area-inset-bottom)); }
.form-description { font-size: 13px; color: var(--sub); margin-bottom: 14px; }
.form-group { margin-bottom: 12px; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.required { color: var(--danger); font-size: 11px; }
.form-input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); font-size: 16px;
  background: white; outline: none; color: var(--text);
  font-family: inherit;
  -webkit-appearance: none; appearance: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(191, 126, 62, 0.15);
}
.text-center { text-align: center; }
.form-errors { background: var(--danger-bg); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; }
.form-errors p { font-size: 13px; color: var(--danger); }
.form-actions { padding: 8px 0 16px; }

/* ===== Buttons ===== */
.btn-primary {
  display: block; width: auto; padding: 15px 32px; border-radius: 14px;
  border: none; background: var(--primary); color: white;
  font-size: 16px; font-weight: 700; cursor: pointer;
  text-align: center; font-family: inherit;
}
.btn-danger {
  display: block; width: auto; padding: 15px 32px; border-radius: 14px;
  border: none; background: var(--danger); color: white;
  font-size: 16px; font-weight: 700; cursor: pointer;
  text-align: center; font-family: inherit;
}
.btn-danger:disabled { background: #ddd; cursor: default; }
.btn-full { width: 100%; }

/* ===== Info/Warning Boxes ===== */
.info-box {
  padding: 12px 16px; background: var(--warm); border-radius: 12px;
  font-size: 13px; color: #8B7355; line-height: 1.6; margin-bottom: 16px;
}
.warning-box {
  padding: 14px; background: #FFFBEB; border-radius: 14px;
  font-size: 13px; color: #92400E; line-height: 1.6; margin-bottom: 16px;
}
.warning-icon { width: 64px; height: 64px; border-radius: 32px; background: var(--danger-bg); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 28px; }
.text-danger { color: var(--danger); }
.danger-list { background: var(--danger-bg); border-radius: 14px; padding: 16px; margin-bottom: 20px; }
.danger-item { padding: 10px 0; border-top: 1px solid #FEE2E2; font-size: 14px; color: #B91C1C; }
.danger-item:first-child { border-top: none; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(61, 52, 42, 0.92); color: white;
  padding: 10px 24px; border-radius: 24px; font-size: 13px;
  opacity: 0; transition: all 0.3s; white-space: nowrap; z-index: 100;
  pointer-events: none; font-weight: 500;
}
.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-alert { background: rgba(239,68,68,0.9); }

/* ===== Avatar Upload ===== */
.avatar-upload-area {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 84px; border-radius: 12px;
  border: 1.5px dashed var(--border); background: white;
  cursor: pointer; overflow: hidden; position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.avatar-upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.avatar-upload-placeholder {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  color: var(--sub); font-size: 12px;
}
.avatar-file-input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; top: 0; left: 0; }
.avatar-preview { width: 100%; }
.avatar-preview-img { width: 100%; max-height: 140px; object-fit: cover; border-radius: 12px; display: block; }
.avatar-current { margin-bottom: 10px; }
.pet-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-preview { position: relative; width: 100%; }
.avatar-change-hint {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.5); color: white;
  text-align: center; padding: 8px; font-size: 12px; font-weight: 600;
  border-radius: 0 0 14px 14px;
}
.pet-detail-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Avatar Upload Overlay */
.avatar-overlay {
  position: absolute; inset: 0; border-radius: 14px;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: white; font-size: 13px; font-weight: 600;
  transition: opacity 0.4s;
}
.avatar-overlay--done { background: rgba(22,163,106,0.55); }
.avatar-overlay--error { background: rgba(239,68,68,0.6); }
.avatar-overlay--fade { opacity: 0; }
.avatar-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  animation: spin 0.7s linear infinite;
}
.avatar-check {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Crop Modal (アバタートリミング・ズーム) ===== */
.crop-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex; flex-direction: column;
}
.crop-modal[hidden] { display: none; }
body.crop-modal-open { overflow: hidden; }

.crop-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top, 8px) 16px 8px;
  padding-top: max(env(safe-area-inset-top, 8px), 12px);
  background: rgba(0, 0, 0, 0.4); color: white;
  flex-shrink: 0;
}
.crop-modal-header h3 {
  margin: 0; font-size: 15px; font-weight: 600; color: white;
}
.crop-modal-cancel,
.crop-modal-confirm {
  background: none; border: none; padding: 8px 4px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.crop-modal-cancel { color: #D1D5DB; }
.crop-modal-confirm { color: var(--primary); }
.crop-modal-confirm:active { opacity: 0.7; }

.crop-modal-body {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 8px;
}
.crop-modal-body img {
  /* Cropper.js が自分で見た目を制御するので、初期状態で全幅・高さ制限のみ与える */
  display: block; max-width: 100%;
}

.crop-modal-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px;
  padding-bottom: max(env(safe-area-inset-bottom, 12px), 12px);
  background: rgba(0, 0, 0, 0.4); color: white;
  flex-shrink: 0;
}
.crop-modal-hint {
  font-size: 11px; color: rgba(255, 255, 255, 0.7); text-align: center; flex: 1;
}
.crop-zoom-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.3);
  color: white; font-size: 20px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.crop-zoom-btn:active { background: rgba(255, 255, 255, 0.25); }

/* ===== Daily Log ===== */
.log-content { flex: 1; overflow-y: auto; padding: 0 12px 100px; }
.log-form { display: flex; flex-direction: column; gap: 8px; }

/* Date Nav (記録の日付ヘッダ + 振り返りの期間ヘッダ共通) */
.date-nav {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--bg);
  position: sticky; top: 52px; z-index: 19;
}
/* タブ/チップの下に置く用 — sticky だけ外す (背景・ボタンスタイルは同じ) */
.date-nav.date-nav-inline { position: static; }
.date-nav-btn {
  width: 36px; height: 36px; border-radius: 18px;
  background: white; border: 1px solid var(--border);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; padding: 0; text-decoration: none;
}
.date-nav-btn:disabled { opacity: 0.4; cursor: default; color: #bbb; }
.date-nav-label {
  flex: 1; text-align: center;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.date-nav-calendar { position: relative; color: var(--primary); }
.date-nav-date-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; padding: 0; border: none; background: transparent;
}

/* Log Cards */
.log-card {
  background: white; border-radius: 10px; padding: 10px 12px;
  border: 0.5px solid var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.log-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.log-card-title { font-size: 13px; font-weight: 700; color: var(--text); }
.log-card-prev { font-size: 11px; color: var(--sub); }
.log-card-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: var(--primary-light); color: var(--primary); font-weight: 600;
}
.log-card-body { }
.log-card-inline { display: flex; align-items: center; gap: 8px; }

/* Log Inputs */
.log-input {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 16px; background: var(--bg); color: var(--text);
  font-family: inherit; outline: none;
}
.log-input:focus { border-color: var(--primary); }
.log-input-sm { width: 64px; text-align: right; }
.log-unit { font-size: 13px; color: var(--sub); font-weight: 600; flex-shrink: 0; }
.log-hint { font-size: 12px; color: var(--sub); text-align: center; padding: 8px 0; }
.log-hint-inline { font-size: 11px; color: var(--sub); }
.log-diff { font-size: 12px; font-weight: 700; }
.diff-up { color: var(--danger); }
.diff-down { color: #16a34a; }

.log-select {
  flex: 1; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 14px; background: var(--bg); color: var(--text);
  font-family: inherit; outline: none; -webkit-appearance: none; appearance: none;
  font-size: 16px;
}

.log-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.log-row:last-child { margin-bottom: 0; }
.log-row-label { font-size: 12px; color: var(--sub); font-weight: 600; width: 36px; flex-shrink: 0; }

.log-textarea {
  width: 100%; height: 44px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); font-size: 16px; background: var(--bg);
  color: var(--text); font-family: inherit; outline: none; resize: none;
}
.log-textarea:focus { border-color: var(--primary); }

/* Stepper */
.stepper { display: flex; align-items: center; gap: 0; }
.stepper-btn {
  width: 32px; height: 32px; border: 1px solid var(--border); background: var(--bg);
  font-size: 16px; font-weight: 700; cursor: pointer; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.stepper-btn:first-child { border-radius: 8px 0 0 8px; }
.stepper-btn:last-child { border-radius: 0 8px 8px 0; }
.stepper-value {
  width: 40px; height: 32px; border: 1px solid var(--border); border-left: none; border-right: none;
  text-align: center; font-size: 16px; font-weight: 700; background: white; color: var(--text);
}
.stepper-value-wide {
  width: 56px;
}

/* Eaten Level */
.eaten-level { display: flex; gap: 4px; margin-top: 10px; }
.eaten-btn { flex: 1; }
.eaten-radio { display: none; }
.eaten-label {
  display: block; text-align: center; padding: 8px 2px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 12px; font-weight: 600; color: var(--sub); cursor: pointer;
}
.eaten-radio:checked + .eaten-label {
  border-color: var(--primary); background: var(--primary-light); color: var(--primary);
}

/* Meal Card */
.meal-row-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fafbfc;
}
.meal-row-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; font-size: 13px;
}
.meal-row-label { color: var(--sub); font-weight: 600; }
.meal-remove-btn {
  background: transparent; border: none; color: var(--sub);
  font-size: 18px; cursor: pointer; padding: 0 6px;
}
.meal-remove-btn:hover { color: var(--danger, #dc2626); }
.meals-add-btn {
  background: transparent; border: 1px dashed var(--border);
  color: var(--primary, #E89028); font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.meals-add-btn:hover { background: rgba(232,144,40,0.05); }
.meal-amount-row { margin-bottom: 8px; }
.meal-food-row {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px;
}
.meal-food-select, .meal-custom-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
.meal-food-select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5l3.5 3.5 3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
  padding-right: 32px;
}
.meal-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.meal-food-label {
  display: flex; flex-direction: column; min-width: 0; flex: 1;
}
.meal-name { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-brand { font-size: 11px; color: var(--sub); }
.meal-amount { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.meal-empty { text-align: center; padding: 12px 0; }
.input-with-unit { display: flex; align-items: center; gap: 8px; }

/* Medication Card */
.med-list { margin-bottom: 12px; }
.med-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.med-item:last-child { border-bottom: none; }
.med-check { flex-shrink: 0; cursor: pointer; }
.med-checkbox { display: none; }
.med-checkmark {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid #ccc;
  display: flex; align-items: center; justify-content: center;
}
.med-checkbox:checked + .med-checkmark {
  background: var(--primary); border-color: var(--primary);
}
.med-checkbox:checked + .med-checkmark::after {
  content: "✓"; color: white; font-size: 13px; font-weight: 700;
}
.med-info { flex: 1; }
.med-name { font-size: 14px; font-weight: 700; color: var(--text); }
.med-dosage { font-size: 12px; color: var(--sub); }
.med-delete {
  background: none; border: none; color: #ccc; font-size: 16px; cursor: pointer; padding: 4px;
}
.med-add-form { margin-top: 4px; }
.med-add-inline { display: flex; gap: 6px; align-items: center; }
.med-add-name { flex: 1; }
.med-add-dosage { width: 70px; }

/* Settings Panel */
.settings-panel {
  margin: 0 12px; background: white; border-radius: 14px;
  padding: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1px solid var(--border); margin-bottom: 8px;
}
.settings-panel-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 12px 0 4px; }
.settings-panel-hint { font-size: 12px; color: var(--sub); margin: 0 0 12px; line-height: 1.5; }
.settings-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.settings-item:last-of-type { border-bottom: none; }
.settings-item-name { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.badge-default {
  font-size: 10px; padding: 1px 6px; border-radius: 8px;
  background: var(--primary-light); color: var(--primary); font-weight: 600;
}

/* Toggle Switch */
.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 24px; transition: 0.2s;
}
.toggle-slider::before {
  content: ""; position: absolute; width: 20px; height: 20px;
  left: 2px; bottom: 2px; background: white; border-radius: 50%; transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Save Section */
.log-save-section { padding: 16px 0 20px; }
.log-save-hint { font-size: 11px; color: var(--sub); text-align: center; margin-top: 8px; }

/* Daily Log Link on Pet Detail */
.pet-daily-log-link { margin-top: 12px; }
.btn-daily-log {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--white); border-radius: 12px; box-shadow: 0 2px 8px rgba(100, 70, 40, 0.04);
  border: 1px solid var(--border);
}
.daily-log-icon { font-size: 24px; }
.daily-log-text { flex: 1; }
.daily-log-text strong { font-size: 15px; color: var(--text); display: block; }
.daily-log-text small { font-size: 12px; color: var(--sub); }

/* ===== Photos ===== */
.photo-content { flex: 1; overflow-y: auto; padding: 0 12px 100px; }

/* Tab Bar */
.photo-tabbar {
  display: flex; background: white; border-top: 1px solid var(--border);
  padding: 8px 0 max(16px, env(safe-area-inset-bottom));
}
.tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 600; color: #bbb; background: none; border: none; cursor: pointer;
}
.tabbar-item.active { color: var(--primary); }
.tabbar-ico { font-size: 18px; }

/* ===== FAB (Floating Action Button) — 共通モジュール =====
   .fab は固定位置のプラスボタン。やること / 日常写真 / 他あらゆる新規追加導線で共通使用。
   位置・サイズ・影・z-index を一元管理してページ間でブレないようにする。 */
.fab {
  position: fixed; right: 20px; bottom: 84px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(191, 126, 62, 0.35);
  z-index: 20; text-decoration: none;
}
.fab:active { transform: scale(0.96); }

/* ===== BackButton (左下の戻るボタン) — 共通モジュール =====
   .back-fab は直前画面へ戻るための共通ボタン。FAB と対称的に左下へ配置する。 */
.back-fab {
  position: fixed; left: 20px; bottom: 84px;
  width: 48px; height: 48px; border-radius: 50%;
  background: white; color: #555;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 20; cursor: pointer; padding: 0;
  text-decoration: none;
}
.back-fab:active { transform: scale(0.96); }

/* Date Group */
.photo-date-group {
  background: white; border-radius: 12px; padding: 12px;
  margin-bottom: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.photo-date-header {
  font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.photo-date-count { font-size: 11px; color: var(--sub); font-weight: 400; }

/* Area Group */
.photo-area-group { margin-bottom: 10px; }
.photo-area-group:last-child { margin-bottom: 0; }
.photo-area-header {
  font-size: 11px; color: #777; margin-bottom: 6px;
  display: flex; align-items: center; gap: 3px;
}
.photo-area-pin { font-size: 12px; }
.photo-area-name { font-weight: 600; }
.photo-area-spot { font-size: 10px; color: #aaa; margin-left: 4px; }
.photo-area-count { font-size: 10px; color: #bbb; margin-left: 2px; }

/* Photo Strip (horizontal swipe) */
.photo-strip {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.photo-strip::-webkit-scrollbar { display: none; }
.photo-card {
  flex-shrink: 0; width: 130px; height: 130px; border-radius: 10px;
  overflow: hidden; position: relative; scroll-snap-align: start;
}
.photo-card-img { width: 100%; height: 100%; object-fit: cover; }
.photo-card-counter {
  position: absolute; top: 5px; right: 5px;
  font-size: 9px; background: rgba(0,0,0,0.45); color: white;
  padding: 2px 6px; border-radius: 8px;
}

/* More Card (+N) */
.photo-more-card {
  flex-shrink: 0; width: 90px; height: 130px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  scroll-snap-align: start;
}
.photo-more-num { font-size: 18px; font-weight: 700; color: var(--primary); }
.photo-more-label { font-size: 10px; color: var(--sub); }

/* Empty State */
.photo-empty { text-align: center; padding: 60px 20px; }
.photo-empty-icon { font-size: 48px; margin-bottom: 12px; }
.photo-empty-text { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.photo-empty-hint { font-size: 13px; color: var(--sub); }

/* Calendar Shortcut */
.photo-cal-shortcut {
  margin: 8px 0; border-radius: 10px; overflow: hidden;
}
.photo-cal-link {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  padding: 12px; background: white; border-radius: 10px;
  border: 1px solid var(--border);
}
.photo-cal-text { font-size: 12px; color: var(--sub); }
.photo-cal-action { font-size: 13px; color: var(--primary); font-weight: 600; }

/* Upload Screen */
.photo-upload-area {
  text-align: center; padding: 40px 20px; margin: 12px 0;
  border: 2px dashed var(--border); border-radius: 16px;
  background: white; cursor: pointer;
}
.photo-upload-icon { font-size: 48px; margin-bottom: 8px; }
.photo-upload-text { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.photo-upload-hint { font-size: 12px; color: var(--sub); }

.photo-preview-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  margin: 12px 0;
}
.photo-preview-grid .photo-grid-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-sel-count { font-size: 12px; color: var(--sub); text-align: center; margin-bottom: 12px; }

.photo-meta-section {
  background: white; border-radius: 12px; padding: 14px;
  margin-bottom: 12px; border: 1px solid var(--border);
}
.photo-meta-title { font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.photo-meta-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-top: 1px solid var(--border);
}
.photo-meta-row:first-of-type { border-top: none; }
.photo-meta-icon { font-size: 16px; flex-shrink: 0; }
.photo-meta-body { flex: 1; }
.photo-meta-label { font-size: 10px; color: var(--sub); }
.photo-meta-value { font-size: 13px; font-weight: 500; }
.photo-meta-badge {
  font-size: 9px; color: var(--primary); border: 1px solid var(--primary);
  border-radius: 4px; padding: 2px 6px; flex-shrink: 0;
}
.photo-meta-input {
  width: 100%; border: none; outline: none; font-size: 16px;
  font-family: inherit; color: var(--text); background: transparent;
}
.photo-meta-input::placeholder { color: #bbb; }

.photo-upload-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.photo-upload-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.9); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.photo-upload-progress { text-align: center; }
.photo-upload-spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.photo-upload-progress-text { font-size: 14px; color: var(--text); font-weight: 600; }
.photo-upload-progress-note { font-size: 12px; color: var(--sub); margin-top: 8px; line-height: 1.5; }

/* 一括モード用バナー (モード切替表示) */
.photo-upload-mode-banner {
  background: #FEF3C7; border: 1px solid #F59E0B; border-radius: 8px;
  padding: 10px 12px; margin: 0 0 12px; font-size: 13px; line-height: 1.5;
}

/* 一括モード進捗: 上部スティッキーバー (画面操作はそのまま可能) */
.photo-upload-bulkbar {
  position: sticky; top: 49px; z-index: 18;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; margin: 0 -12px 12px;
  background: var(--primary); color: white;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.photo-upload-bulkbar[hidden] { display: none; }
.photo-upload-bulkbar-spinner {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: white;
  border-radius: 50%; animation: photo-bulkbar-spin 1s linear infinite;
}
@keyframes photo-bulkbar-spin {
  to { transform: rotate(360deg); }
}
.photo-upload-bulkbar-text { flex: 1; }

/* Detail Screen */
.photo-detail-strip {
  display: flex; gap: 0; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; margin: 0 -12px; background: #000;
}
.photo-detail-strip::-webkit-scrollbar { display: none; }

/* ===== Photo Preview Swipe (Phase A-3 supplement / React 22016e6) =====
   左右ナビ矢印 + n/total インジケータ。.photo-detail-preview-wrap の上に絶対配置。 */
.photo-detail-preview-wrap { position: relative; }
.photo-preview-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15); color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 28px; line-height: 40px; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
}
.photo-preview-nav-prev { left: 12px; }
.photo-preview-nav-next { right: 12px; }
.photo-preview-nav:active { transform: translateY(-50%) scale(0.96); }
.photo-preview-indicator {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  color: white; font-size: 13px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px; border-radius: 12px;
  z-index: 5; pointer-events: none;
}
.photo-detail-slide {
  flex-shrink: 0; width: 100%; scroll-snap-align: start;
  display: flex; align-items: center; justify-content: center; background: #000;
}
.photo-detail-img {
  display: block; width: 100%; height: auto;
  max-height: 70vh; object-fit: contain; background: #000;
}

/* Landscape orientation: full-screen photo, hide chrome */
@media (orientation: landscape) {
  .photo-detail-screen .sub-header,
  .photo-detail-screen .page-actions,
  .photo-detail-screen .photo-detail-fields,
  .photo-detail-screen .photo-detail-actions,
  .photo-detail-screen .bottom-nav { display: none !important; }
  .photo-detail-screen .photo-content { padding: 0; }
  .photo-detail-screen .photo-detail-strip { margin: 0; height: 100vh; }
  .photo-detail-screen .photo-detail-slide { height: 100vh; }
  .photo-detail-img {
    width: 100vw; height: 100vh; max-height: 100vh; object-fit: contain;
  }
}
.photo-detail-fields {
  display: flex; flex-direction: column; gap: 8px; margin-top: 12px;
}
.photo-field {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  background: white; border-radius: 10px; border: 1px solid var(--border);
}
.photo-field-icon { padding-top: 2px; }
.photo-field-icon { font-size: 14px; flex-shrink: 0; }
.photo-field-body { flex: 1; }
.photo-field-label { font-size: 10px; color: var(--sub); }
.photo-field-value { font-size: 13px; font-weight: 500; }
.photo-delete-btn { background: none; border: none; cursor: pointer; padding: 4px; }
.photo-detail-actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }

.photo-detail-form { display: flex; flex-direction: column; gap: 8px; }
.photo-field-input {
  width: 100%; font-size: 16px; font-weight: 500; padding: 4px 0;
  border: none; background: transparent; color: var(--text);
  appearance: none; -webkit-appearance: none;
}
.photo-field-input:focus { outline: none; }
.photo-field-textarea { resize: vertical; min-height: 60px; line-height: 1.4; }
.photo-field-readonly { background: #fafafa; }
.photo-upload-note {
  font-size: 12px; color: var(--sub); margin: 8px 0 12px; text-align: center;
}

/* Calendar Screen */
.photo-month-nav {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  padding: 8px 0;
}
.photo-month-arrow { color: var(--sub); padding: 4px; }
.photo-month-label { font-size: 14px; font-weight: 700; }

.photo-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  text-align: center; margin: 8px 0;
}
.photo-cal-hd { font-size: 10px; color: var(--sub); padding: 4px 0; font-weight: 600; }
.photo-cal-day {
  font-size: 12px; padding: 8px 0; border-radius: 6px; color: #555;
  display: flex; align-items: center; justify-content: center;
}
.photo-cal-day.has {
  background: var(--primary); color: white; font-weight: 600; cursor: pointer;
}
.photo-cal-day.off { color: #ddd; }

/* ===== Date Picker (記録ページの date-nav カレンダーモーダル) =====
   日常写真の月カレンダーと同じ見た目に揃える。日毎に「ある日」のドット表示はしない。 */
.date-cal-day {
  font-size: 13px; padding: 10px 0; border-radius: 8px; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit;
}
.date-cal-day:hover:not(.is-disabled) { background: var(--primary-light); }
.date-cal-day.is-selected {
  background: var(--primary); color: white; font-weight: 700;
}
.date-cal-day.is-selected:hover { background: var(--primary); }
.date-cal-day.is-disabled { color: #ccc; cursor: default; }
.photo-cal-legend {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: var(--sub); justify-content: center; margin-bottom: 12px;
}
.photo-cal-legend-dot {
  width: 10px; height: 10px; border-radius: 3px; background: var(--primary);
}
.photo-cal-preview-empty {
  text-align: center; padding: 24px; color: var(--sub); font-size: 13px;
}
.photo-cal-result { margin-top: 8px; }
.photo-cal-result-hd {
  font-size: 13px; font-weight: 700; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.photo-cal-result-count { font-size: 11px; color: var(--sub); font-weight: 400; }
.photo-cal-area-group { margin-bottom: 10px; }

/* Grid Views */
.photo-grid-sm {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
.photo-grid-full {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  margin-top: 8px;
}
.photo-grid-thumb {
  aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: var(--bg); border: 1px solid var(--border);
}
.photo-grid-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid-more {
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--primary); background: #edf2f7;
}
.photo-grid-subtitle { font-size: 12px; color: var(--sub); margin: 8px 0; }

/* Photo filter bar (on timeline index) */
.photo-filter-bar {
  justify-content: flex-start; gap: 8px;
  padding: 8px 12px 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.photo-filter-bar::-webkit-scrollbar { display: none; }
.photo-filter-chip-group { display: inline-flex; flex-shrink: 0; }
/* .photo-filter-chip / .on のスタイル本体は .chip 共通モジュールに統合済み */
.photo-filter-chip:hover { background: var(--bg); }
.photo-filter-clear {
  font-size: 12px; color: var(--sub); padding: 6px 4px; flex-shrink: 0;
}

/* Photo area modal */
.photo-area-modal {
  position: fixed; inset: 0; margin: auto;
  padding: 0; border: none; border-radius: 16px;
  width: 90vw; max-width: 420px; max-height: 80vh;
  background: white; color: var(--text);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  box-sizing: border-box; overflow: auto;
}
.photo-area-modal::backdrop {
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
}
.photo-area-modal-inner { padding: 20px; }
.photo-area-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.photo-area-modal-header h3 {
  font-size: 16px; font-weight: 700; margin: 0;
}
.photo-area-modal-close {
  width: 32px; height: 32px; border-radius: 16px;
  border: none; background: var(--bg); color: var(--sub);
  font-size: 18px; cursor: pointer; font-family: inherit;
}
.photo-area-modal-close:hover { background: var(--border); }
.photo-area-modal-empty {
  text-align: center; font-size: 13px; color: var(--sub); padding: 24px 0;
}

/* Filter Screen */
.photo-filter-section { margin-bottom: 16px; }
.photo-filter-label { font-size: 12px; font-weight: 600; color: #777; margin-bottom: 8px; }
.photo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* .photo-chip 基本スタイルは .chip 共通モジュールに統合済み */
.photo-chip.loc { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.photo-chip.loc.on { background: var(--primary); color: white; }
.photo-chip-count { font-size: 10px; margin-left: 4px; opacity: 0.7; }
.photo-filter-preview { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.photo-filter-preview-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.photo-filter-actions {
  margin-top: auto; padding-top: 16px;
  display: flex; flex-direction: column; gap: 8px;
}

/* Header action link */
.header-action { font-size: 13px; color: var(--primary); font-weight: 600; }

/* Shared button styles */
.btn-sm { font-size: 13px; padding: 10px; }
.btn-outline {
  display: flex; align-items: center; justify-content: center;
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; font-size: 14px; font-weight: 600; color: var(--text);
  cursor: pointer;
}
.btn-full { width: 100%; }

/* Photo link on pet detail */
.pet-photos-link { margin-top: 8px; }
.btn-photos {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--white); border-radius: 12px; box-shadow: 0 2px 8px rgba(100, 70, 40, 0.04);
  border: 1px solid var(--border);
}
.photos-icon { font-size: 24px; }
.photos-text { flex: 1; }
.photos-text strong { font-size: 15px; color: var(--text); display: block; }
.photos-text small { font-size: 12px; color: var(--sub); }

/* ===== Record Category Management ===== */
.category-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 16px;
}
.category-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: white; border-radius: 12px;
  border: 1px solid var(--border);
}
.category-item.archived { opacity: 0.75; }
.category-item-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.category-item-body { flex: 1; min-width: 0; }
.category-item-name { font-size: 15px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.category-item-meta { font-size: 12px; color: var(--sub); margin-top: 2px; }
.category-item-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.category-action-link {
  font-size: 12px; font-weight: 600; color: var(--primary);
  background: none; border: none; padding: 4px 8px; cursor: pointer;
  font-family: inherit;
}
.category-action-link.danger { color: var(--danger); }
.category-action-link.primary { color: var(--primary); }
.category-action-link form { margin: 0; padding: 0; }

/* ===== Category Form ===== */
.icon-picker {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
}
.icon-option { cursor: pointer; }
.icon-option input { position: absolute; opacity: 0; pointer-events: none; }
.icon-option span {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: white; border: 2px solid var(--border);
  font-size: 22px; transition: all 0.15s;
}
.icon-option input:checked + span { border-color: var(--primary); background: var(--primary-light); }

.color-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.color-option { cursor: pointer; }
.color-option input { position: absolute; opacity: 0; pointer-events: none; }
.color-swatch {
  display: block; width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid transparent; transition: border-color 0.15s;
  box-shadow: 0 0 0 1px var(--border);
}
.color-option input:checked + .color-swatch { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

.conditional-field[hidden] { display: none; }

.range-inputs { display: flex; align-items: center; gap: 10px; }
.range-inputs .form-input { flex: 1; }
.range-separator { color: var(--sub); font-weight: 600; }

.scale-label-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.scale-label-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.scale-label-row .form-input { flex: 1; }

.multi-check-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.multi-check-row .form-input { flex: 1; }
.btn-icon-remove {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: white; color: var(--sub);
  font-size: 16px; cursor: pointer; font-family: inherit;
}
.btn-icon-remove:hover { border-color: var(--danger); color: var(--danger); }

.form-locked {
  padding: 12px 14px; background: var(--bg); border-radius: 10px;
  color: var(--sub); font-size: 14px;
}

/* === Graph View Toggle (グラフ / 一覧 切替・期間ナビ右端に inline 配置) === */
.graph-period-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px;
}
.graph-period-row .graph-period-nav {
  flex: 1; margin-top: 0;
}
/* .graph-view-toggle / .graph-view-toggle-btn は .segment-toggle 共通モジュール (上方) のエイリアスに統合済み。 */

/* ===== Chip (フィルタ / カテゴリ選択の共通モジュール) =====
   .chip          基本ピル型ボタン
   .chip.active / .chip.on   選択状態 (--chip-color または primary 色で塗り)
   .chip.add      点線の追加ボタン用バリアント
   既存の .graph-chip / .vaccine-type-chip / .photo-filter-chip / .photo-chip は同じ見た目のエイリアス。
*/
.chip,
.graph-chip,
.vaccine-type-chip,
.photo-filter-chip,
.photo-chip {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: white; border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.4;
}
.chip.active, .chip.on,
.graph-chip.active,
.vaccine-type-chip.active,
.photo-filter-chip.on,
.photo-chip.on {
  background: var(--chip-color, var(--primary));
  border-color: var(--chip-color, var(--primary));
  color: white;
}
.chip.add,
.graph-chip.add {
  border-style: dashed; color: var(--sub);
  padding: 4px 10px; font-size: 13px; font-weight: 700;
  line-height: 1.4;
}
.chip-icon,
.graph-chip-icon { font-size: 12px; }
.chip-label,
.graph-chip-label { font-size: 11px; }

/* チップの並び (横スクロール可) */
.graph-chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
}
.graph-chips::-webkit-scrollbar { display: none; }

.graph-periods {
  display: flex; justify-content: center; gap: 0;
  padding: 6px 0;
  background: white; border-radius: 12px;
  border: 1px solid var(--border);
  margin-top: 2px;
}
.graph-period {
  flex: 1; text-align: center;
  padding: 6px 2px; font-size: 12px; color: var(--sub);
  border: none; border-right: 1px solid var(--border);
  background: none; font-family: inherit; cursor: pointer;
  min-width: 0; white-space: nowrap;
  -webkit-appearance: none; appearance: none;
  line-height: 1.2;
}
.graph-period:last-of-type { border-right: none; }
.graph-period.active { color: var(--primary); font-weight: 700; }

.graph-period-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 4px;
  padding: 4px 4px;
}
.graph-nav-btn {
  flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  background: white; border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
}
.graph-nav-btn:active { background: var(--primary-light); }
.graph-nav-btn.disabled { opacity: 0.3; cursor: default; pointer-events: none; }
.graph-period-range {
  flex: 1; text-align: center;
}
.graph-period-range-label { display: block; font-size: 14px; font-weight: 700; color: var(--text); }
.graph-period-range-sub { display: block; font-size: 11px; color: var(--sub); margin-top: 2px; }

/* カスタム期間モーダル（native <dialog>） */
.graph-custom-modal {
  position: fixed; inset: 0; margin: auto;
  padding: 0; border: none; border-radius: 16px;
  width: 90vw; max-width: 420px;
  max-height: 90vh;
  background: white; color: var(--text);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  box-sizing: border-box;
  overflow: auto;
}
.graph-custom-modal::backdrop {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}
.graph-custom-modal-inner { padding: 20px 20px 16px; }
.graph-custom-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.graph-custom-modal-header h3 {
  font-size: 16px; font-weight: 700; color: var(--text); margin: 0;
}
.graph-custom-modal-close {
  width: 32px; height: 32px; border-radius: 16px;
  border: none; background: var(--bg); color: var(--sub);
  font-size: 18px; cursor: pointer; font-family: inherit;
}
.graph-custom-modal-close:hover { background: var(--border); }

.graph-custom-presets {
  display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap;
}
.graph-preset-btn {
  display: inline-block;
  padding: 8px 14px; border-radius: 999px;
  background: var(--primary-light); border: 1px solid transparent;
  font-size: 13px; font-weight: 600; color: var(--primary);
}
.graph-preset-btn:hover { background: var(--primary); color: white; }

.graph-custom-form { display: flex; flex-direction: column; gap: 12px; }
.graph-custom-field {
  display: flex; align-items: center; gap: 12px;
}
.graph-custom-field > span {
  width: 44px; font-size: 13px; font-weight: 600; color: var(--sub);
}
.graph-custom-field .form-input {
  flex: 1; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: white; color: var(--text); font-family: inherit;
  min-width: 0; width: 100%; box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.graph-custom-modal-actions {
  display: flex; gap: 8px; margin-top: 8px;
}
.graph-custom-modal-actions .btn-outline,
.graph-custom-modal-actions .btn-primary {
  flex: 1; padding: 12px; font-size: 14px; font-weight: 700;
}

/* === 期間ピッカー モーダル: クイック選択 + from/to (React PeriodPicker dc4cf51 移植) === */
/* クイック選択ボタンは押下時に from/to を埋めるだけ — submit は「この期間で適用」ボタン経由 */
.graph-quick-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 16px;
}
.graph-quick-btn {
  padding: 10px 0; border-radius: 8px;
  border: 1px solid var(--border); background: white;
  color: var(--text); font-weight: 500; font-size: 13px;
  font-family: inherit; cursor: pointer;
}
.graph-quick-btn.active {
  background: var(--primary-light); color: var(--primary); font-weight: 700;
}
.graph-period-section {
  border-top: 1px solid var(--border); padding-top: 16px;
}
.graph-period-section-title {
  font-size: 12px; color: var(--sub); margin-bottom: 8px;
}
.graph-period-range-fields {
  display: flex; gap: 8px; align-items: center; margin-bottom: 12px;
}
.graph-period-range-fields .form-input {
  flex: 1; padding: 10px 12px; font-size: 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: white; color: var(--text); font-family: inherit;
  min-width: 0; width: 100%; box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.graph-main {
  margin-top: 4px; background: white;
  border-radius: 14px; border: 1px solid var(--border);
  padding: 12px;
}
.graph-canvas-wrap {
  position: relative; width: 100%; height: 260px;
  touch-action: pan-y; /* allow vertical scroll but capture horizontal swipe */
  user-select: none;
}
.graph-empty {
  text-align: center; padding: 32px 16px;
}
.graph-empty-icon { font-size: 40px; margin-bottom: 8px; }
.graph-empty-text { font-size: 14px; color: var(--sub); margin-bottom: 16px; line-height: 1.6; }

.graph-summary {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 16px;
}
.summary-card {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; text-align: center;
}
.summary-card.full { grid-column: 1 / -1; }
.summary-label { font-size: 11px; color: var(--sub); margin-bottom: 4px; }
.summary-value { font-size: 16px; font-weight: 700; color: var(--text); }
.summary-value.delta-up { color: var(--primary); }
.summary-value.delta-down { color: var(--danger); }
.summary-value.delta-neutral { color: var(--sub); }

/* Entry point link on daily_log header */
.graph-entry-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--primary); font-weight: 600;
}

/* ==============================
   Tasks (Phase 1 MVP)
   ============================== */

.task-screen { padding-bottom: 96px; }

.task-tabs {
  display: flex; gap: 4px; padding: 4px;
  background: #F1F3F5; border-radius: 10px;
  margin: 2px 0 8px;
}
.task-tab {
  flex: 1; text-align: center; padding: 10px 0;
  border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--sub); text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.task-tab-active {
  background: white; color: var(--primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.task-list { display: flex; flex-direction: column; gap: 8px; }

.task-row-wrap {
  position: relative; overflow: hidden;
  border-radius: 12px;
  background: white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.task-row-bg {
  position: absolute; top: 0; bottom: 0; width: 100%;
  display: flex; align-items: center;
  padding: 0 20px; gap: 8px;
  font-size: 13px; font-weight: 700; color: white;
  opacity: 0;
  transition: opacity 120ms linear;
  pointer-events: none;
}
.task-row-bg-complete {
  left: 0; justify-content: flex-start;
  background: #22C55E;
}
.task-row-bg-delete {
  left: 0; justify-content: flex-end;
  background: #EF4444;
}

.task-row {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: white;
  color: var(--text);
  touch-action: pan-y;
  will-change: transform;
}
.task-row-completed { color: var(--sub); }
.task-row-completed .task-row-title { text-decoration: line-through; color: var(--sub); }

.task-row-wrap-dragging .task-row { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.task-row-status { flex-shrink: 0; }
.task-check-form { display: inline-flex; }
.task-check-btn {
  background: none; border: none; padding: 0; margin: 0;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.task-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border: 2px solid #D1D5DB; border-radius: 50%;
  background: white;
}
.task-check-on {
  border-color: #22C55E; background: #22C55E; color: white;
}

.task-row-body { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.task-row-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-row-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px; font-size: 12px; color: var(--sub);
}
.task-row-due-overdue { color: #EF4444; font-weight: 600; }
.task-row-creator {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: #E8F0FE; color: var(--primary);
  font-size: 10px; font-weight: 700;
}
.task-row-category {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 10px;
  background: var(--warm); border: 1px solid var(--border);
  color: var(--text); font-size: 11px; line-height: 1.2;
}

.task-empty {
  text-align: center; color: var(--sub); padding: 48px 16px;
}
.task-empty p { margin: 0 0 6px; font-size: 14px; }
.task-empty-sub { font-size: 12px; color: #9CA3AF; }

/* FAB (.task-fab / .photo-fab は .fab に統合済み — 上部 "FAB 共通モジュール" 参照) */

/* Form */
.task-form .form-field { margin-bottom: 16px; }
.task-form .form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.task-form .form-label.required::after {
  content: "*"; color: #EF4444; margin-left: 4px;
}
.task-form .form-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 16px; background: white;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
/* iOS Safari: prevent auto-zoom on focus by ensuring all form inputs are 16px+
   (iOS ズームトリガーは 16px 未満なので、フォーム要素全体で下限を 16px に統一) */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]),
textarea, select {
  font-size: 16px;
}

/* Global focus ring — Tailwind/Material 共通の "ソフトリング" パターン。
   .form-input 個別 :focus がない他バリアント (task-form, graph-custom-field,
   graph-period-range-fields, vaccine-form 等) も含めてフォーカス時に統一表示。 */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]):focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(191, 126, 62, 0.15);
}
.task-form textarea.form-input { resize: vertical; min-height: 80px; }

/* === やること追加: 繰り返しトグル + シリーズ設定パネル === */
.task-form-title-input { font-size: 16px; font-weight: 500; padding: 12px 14px; }
.task-form-label-optional { color: var(--sub); font-weight: 400; font-size: 11px; }
.task-form-datetime-labels {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.task-form-datetime-labels > * { margin-bottom: 0; min-width: 0; }
.task-form-datetime-inputs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 6px;
}
.task-form-datetime-inputs > .form-input { min-width: 0; }

.task-form-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: white; border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 16px; gap: 12px;
}
.task-form-toggle-text { display: flex; flex-direction: column; gap: 2px; }
.task-form-toggle-text strong { font-size: 14px; font-weight: 700; color: var(--text); }
.task-form-toggle-sub { font-size: 11px; color: var(--sub); }
.task-form-switch { position: relative; display: inline-block; }
.task-form-switch input[type="checkbox"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.task-form-switch-track {
  display: inline-block; width: 44px; height: 26px;
  background: var(--border); border-radius: 13px;
  position: relative; transition: background 0.15s ease;
}
.task-form-switch-knob {
  position: absolute; left: 2px; top: 2px;
  width: 22px; height: 22px; border-radius: 11px;
  background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: left 0.15s ease;
}
.task-form-switch input:checked + .task-form-switch-track { background: var(--primary); }
.task-form-switch input:checked + .task-form-switch-track .task-form-switch-knob { left: 20px; }
.task-form-switch input:disabled + .task-form-switch-track { opacity: 0.7; }

.task-form-recur-card {
  background: var(--warm); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 14px; margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.task-form-recur-card .form-field { margin-bottom: 0; }
.task-form-section { display: flex; flex-direction: column; gap: 14px; }

.task-form-monthly-row {
  display: flex; align-items: center; gap: 8px;
}
.task-form-monthly-text { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; }
/* `.task-form .form-input { width:100% }` を上書きするため、ここでも .task-form を含める */
.task-form .task-form-monthly-select {
  width: auto; min-width: 96px; padding: 6px 10px;
  font-size: 14px; font-weight: 700;
}

.task-form-ntimes-row {
  display: flex; align-items: center; gap: 8px;
}
.task-form .task-form-ntimes-input {
  width: 72px; text-align: center; padding: 6px 10px;
  font-size: 14px; font-weight: 700;
}
.task-form-ntimes-row > span { font-size: 14px; color: var(--text); }

.task-form-preview {
  background: var(--primary-light); border-radius: 8px;
  padding: 10px 12px; font-size: 12px; color: var(--primary);
  line-height: 1.5;
}

/* `display:flex/grid` が ユーザーエージェントの [hidden] を上書きしてしまうので、
   task-form 配下の `hidden` を明示的に再非表示にする。 */
.task-form-recur-card[hidden],
.task-form-section[hidden],
.task-form-monthly-row[hidden],
.task-form-ntimes-row[hidden],
.task-form-datetime-labels[hidden],
.task-form-datetime-inputs[hidden] { display: none; }

.form-errors {
  background: #FEF2F2; border: 1px solid #FECACA; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 12px; color: #B91C1C; font-size: 13px;
}
.form-errors ul { margin: 0; padding-left: 18px; }

/* === 通院記録詳細ページ (情報リスト形式) === */
.visit-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 8px;
}
.visit-detail-title {
  font-size: 18px; font-weight: 700; margin: 0;
  color: var(--text); flex: 1; min-width: 0;
}
.visit-detail-edit {
  font-size: 13px; color: var(--primary); font-weight: 600;
  text-decoration: none; flex-shrink: 0; padding: 4px 6px;
}
.visit-detail-edit:active { opacity: 0.6; }

.info-dl {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 4px 0; margin: 0 0 16px;
  display: flex; flex-direction: column;
}
.info-dl > div {
  display: flex; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px; line-height: 1.5;
}
.info-dl > div:last-child { border-bottom: none; }
.info-dl dt {
  color: var(--sub); font-weight: 600;
  min-width: 60px; flex-shrink: 0;
  font-size: 12px; padding-top: 2px;
}
.info-dl dd { color: var(--text); margin: 0; flex: 1; min-width: 0; }
.info-dl dd p { margin: 0; }

.visit-detail-section-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin: 16px 0 8px;
}
.prescription-list {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
}
.prescription-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.prescription-row:last-child { border-bottom: none; }
.prescription-row-name {
  font-weight: 600; font-size: 14px; color: var(--text);
  margin-bottom: 4px;
}
.prescription-row-meta {
  font-size: 12px; color: var(--sub); line-height: 1.5;
}
.prescription-row-notes {
  margin-top: 6px; font-size: 12px; color: var(--text);
}
.prescription-row-notes p { margin: 0; }

/* === Expense row list (費用行スタイル) === */
.expense-list {
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.expense-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
}
.expense-row:last-child { border-bottom: none; }
.expense-row:active { background: #FAF7F2; }
.expense-row-icon { font-size: 18px; flex-shrink: 0; }
.expense-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.expense-row-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expense-row-memo { font-weight: 400; color: var(--sub); }
.expense-row-sub { font-size: 11px; color: var(--sub); }
.expense-row-amount { font-size: 14px; font-weight: 700; color: var(--text); flex-shrink: 0; white-space: nowrap; }

/* === Visit row (病院タブの通院行レイアウト) ===
   日付 + カテゴリチップを 1 行目、ワクチン種類 / 主訴 を 2 行目、動物病院を小さく 3 行目に。
   .expense-list 内に .expense-row.visit-row として置く。 */
.visit-row { align-items: flex-start; padding: 10px 12px; }
.visit-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.visit-row-header {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; min-width: 0;
}
.visit-row-date {
  font-size: 13px; font-weight: 700; color: var(--text);
  flex-shrink: 0;
}
.visit-row-cats {
  display: inline-flex; flex-wrap: wrap; gap: 4px; min-width: 0;
}
.visit-row-cat-chip {
  font-size: 11px; padding: 1px 6px; border-radius: 8px;
  background: color-mix(in srgb, var(--chip-color, var(--primary)) 14%, white);
  color: var(--chip-color, var(--primary));
  border: 1px solid color-mix(in srgb, var(--chip-color, var(--primary)) 30%, transparent);
  white-space: nowrap;
}
.visit-row-title {
  font-size: 13px; color: var(--text); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.visit-row-clinic {
  font-size: 11px; color: var(--sub); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 期間ピッカーに view-toggle を内包したときは、ラベル領域の中央寄せが
   崩れないよう label の flex を縮めつつ toggle の左側にだけ余白を入れる。 */
.date-nav .graph-view-toggle { margin-left: 4px; flex-shrink: 0; }

/* === Bulk select action bar (タスク一括処理) === */
.task-row-selected { background: #FEF3C7; }
.task-row-selected-btn .task-check {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}
.task-row-selected-btn .task-check::after {
  content: ""; width: 10px; height: 10px;
  background: white; border-radius: 2px;
}

.task-bulk-bar {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 25;
}
.task-bulk-bar[hidden] { display: none; }
.task-bulk-bar-count { font-size: 13px; font-weight: 600; color: var(--text); flex-shrink: 0; }
.task-bulk-bar-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.task-bulk-bar-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 8px;
  background: var(--primary); color: white; border: none; cursor: pointer;
  font-size: 13px; font-weight: 600;
}
.task-bulk-bar-btn:active { opacity: 0.85; }
.task-bulk-bar-btn-danger { background: #EF4444; }
.task-bulk-bar-btn-cancel { background: transparent; color: var(--sub); padding: 6px 8px; }

/* Undo snackbar */
.task-snackbar {
  position: fixed; left: 50%; bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  min-width: 280px; max-width: calc(100% - 32px);
  padding: 10px 12px 10px 16px;
  background: #1F2937; color: white; border-radius: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease-out, transform 200ms ease-out;
  z-index: 30;
  font-size: 14px;
}
.task-snackbar:empty { padding: 0; background: transparent; box-shadow: none; }
.task-snackbar-show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.task-snackbar-message { flex: 1; }
.task-snackbar-undo {
  background: transparent; border: none; color: #60A5FA;
  font-weight: 700; font-size: 14px; padding: 6px 10px; cursor: pointer;
}
.task-snackbar-undo:active { opacity: 0.7; }

.task-section-heading {
  font-size: 13px; font-weight: 700; color: var(--sub);
  margin: 0 0 8px; padding: 0 4px;
  letter-spacing: 0.02em;
}

/* ===== Wanna Number Card ===== */
.wanna-card-wrapper { padding: 0; margin-top: 8px; }
.wanna-card-scroller {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding: 0 16px 4px; gap: 12px;
}
.wanna-card-scroller::-webkit-scrollbar { display: none; }
.wanna-card {
  flex: 0 0 calc(100vw - 32px); max-width: 420px;
  scroll-snap-align: center;
  background: var(--white); border-radius: 20px;
  box-shadow: 0 2px 10px rgba(61, 52, 42, 0.08);
  border: 1px solid var(--border);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  min-height: 460px;
}
.wanna-card-title-row {
  display: flex; align-items: center; justify-content: space-between;
}
.wanna-card-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--primary-light); color: var(--primary);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}
.wanna-card-badge-vaccine { background: #E8F2DC; color: #5C7B3A; }
.wanna-card-edit {
  font-size: 12px; color: var(--primary); font-weight: 600;
}
.wanna-card-photo {
  width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden;
  background: var(--warm); display: flex; align-items: center; justify-content: center;
}
.wanna-card-photo img { width: 100%; height: 100%; object-fit: cover; }
/* 拡大表示クリック領域 (.wanna-card-photo に付与する modifier)。
   LINE LIFF (iOS WKWebView) で <div role="button"> がタップを拾わないことがあるため <button> を使用。
   button のネイティブスタイルをリセットして .wanna-card-photo と同じ見た目に保つ。 */
.wanna-card-photo-clickable {
  appearance: none; -webkit-appearance: none;
  padding: 0; border: 0; margin: 0; font: inherit; color: inherit;
  cursor: zoom-in;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  /* iOS の長押しメニュー (画像保存等) を抑制 */
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation;
}
.wanna-card-photo-clickable:active { opacity: 0.85; }
.wanna-card-emoji { font-size: 120px; }
.wanna-card-photo-cert { background: #F6F1E4; }
.wanna-card-pdf {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--sub); font-size: 14px;
}
.wanna-card-pdf-link {
  color: var(--primary); font-weight: 600; text-decoration: underline;
}
.wanna-card-no-image { color: var(--sub); font-size: 13px; }
.wanna-card-info { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.wanna-card-name {
  font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -0.5px;
}
.wanna-card-dl { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.wanna-card-dl > div { display: flex; gap: 10px; font-size: 13px; }
.wanna-card-dl dt {
  color: var(--sub); font-weight: 600; min-width: 76px; flex-shrink: 0;
}
.wanna-card-dl dd { color: var(--text); font-weight: 500; }
.wanna-card-muted { color: var(--sub); font-weight: 400; }
.wanna-card-subaction {
  margin-top: auto; align-self: flex-start;
  color: var(--primary); font-size: 13px; font-weight: 600;
  text-decoration: underline;
}
.wanna-card-empty {
  align-items: center; justify-content: center; text-align: center; gap: 16px;
}
.wanna-card-empty-icon { font-size: 48px; }
.wanna-card-empty-text { color: var(--sub); font-size: 14px; line-height: 1.6; }
.wanna-card-empty-text small { font-size: 12px; }

.wanna-card-dots {
  display: flex; justify-content: center; gap: 8px;
  padding: 14px 0 6px;
}
.wanna-card-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); border: none; padding: 0;
  cursor: pointer; transition: background 0.15s, transform 0.15s;
}
.wanna-card-dot.active { background: var(--primary); transform: scale(1.2); }

.wanna-card-actions {
  padding: 8px 16px 96px; display: flex; flex-direction: column;
  align-items: center; gap: 10px;
}
.wanna-card-add { width: 100%; max-width: 420px; text-align: center; }
.wanna-card-linktext { color: var(--sub); font-size: 13px; text-decoration: underline; }

/* ===== Vaccine list / timeline ===== */
.vaccine-dashboard {
  background: var(--white); border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04); border: 1px solid var(--border);
  padding: 12px 14px; margin-bottom: 14px;
}
.vaccine-dashboard-title {
  font-size: 12px; font-weight: 700; color: var(--sub);
  letter-spacing: 0.04em; margin-bottom: 8px;
}
.vaccine-dashboard-list {
  display: flex; flex-direction: column; gap: 6px;
}
.vaccine-dashboard-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.vaccine-dashboard-row:last-child { border-bottom: none; }
.vaccine-dashboard-row .type { color: var(--text); font-weight: 600; }
.vaccine-dashboard-row .date { color: var(--sub); font-size: 12px; }
.vaccine-dashboard-row .empty { color: var(--sub); font-size: 12px; }

/* vaccine-type-chip / .active は .chip 共通モジュールに統合済み (スタイル本体はそちら参照) */
.vaccine-type-filter {
  display: flex; gap: 6px; overflow-x: auto; padding: 6px 2px 12px;
  scrollbar-width: none;
}
.vaccine-type-filter::-webkit-scrollbar { display: none; }

.vaccine-timeline { display: flex; flex-direction: column; gap: 10px; padding-bottom: 96px; }
.vaccine-item {
  background: var(--white); border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px 14px; display: flex; gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.vaccine-item-thumb {
  width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  background: var(--warm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.vaccine-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vaccine-item-body { flex: 1; min-width: 0; }
.vaccine-item-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.vaccine-item-type { font-size: 14px; font-weight: 700; color: var(--text); }
.vaccine-item-date { font-size: 12px; color: var(--sub); white-space: nowrap; }
.vaccine-item-meta {
  font-size: 12px; color: var(--sub); margin-top: 4px; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.vaccine-item-next { font-size: 11px; color: var(--primary); font-weight: 600; margin-top: 4px; }

/* ===== Vaccine form ===== */
/* padding-bottom は固定フッター (.bottom-nav, 2行ラベル + safe-area で最大 ~103px) を確実にクリアするための余白 */
.vaccine-form { padding: 14px 16px calc(120px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.vaccine-form .form-field { display: flex; flex-direction: column; gap: 6px; }
.vaccine-form .form-field[hidden] { display: none; }
.vaccine-form label { font-size: 12px; font-weight: 600; color: var(--sub); }
.vaccine-form input[type="text"],
.vaccine-form input[type="date"],
.vaccine-form select,
.vaccine-form textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: white;
  font-family: inherit; font-size: 16px; color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  box-sizing: border-box;
}
.vaccine-form textarea { min-height: 80px; resize: vertical; }
.puppy-helper {
  background: var(--primary-light); border-radius: 10px; padding: 10px 12px;
  font-size: 12px; color: var(--text); display: flex; flex-direction: column; gap: 6px;
}
.puppy-helper-title { font-weight: 700; color: var(--primary); }
.puppy-helper-list { display: flex; gap: 8px; flex-wrap: wrap; }
.puppy-helper-chip {
  background: var(--white); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 10px; font-size: 11px; color: var(--text); font-weight: 600;
}
.cert-image-preview {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.cert-image-preview .cert-thumb {
  width: 80px; height: 80px; border-radius: 8px; overflow: hidden;
  background: var(--warm); position: relative; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.cert-image-preview .cert-thumb img,
.cert-image-preview .cert-thumb .cert-thumb-image { width: 100%; height: 100%; object-fit: cover; }
.cert-thumb-button {
  padding: 0; border: none; background: transparent; cursor: zoom-in;
  display: block; width: 100%; height: 100%;
}
.cert-thumb-image { cursor: zoom-in; }
.cert-thumb-pdf {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--sub); text-decoration: none;
}
.cert-image-remove {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px;
  border-radius: 50%; background: rgba(201, 75, 58, 0.92); color: white;
  border: none; font-size: 18px; line-height: 1; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 2; font-family: inherit; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.cert-image-remove:active { transform: scale(0.92); }
.vaccine-form-danger-zone {
  padding: 0 16px calc(120px + env(safe-area-inset-bottom)); display: flex; justify-content: center;
}

/* ===== Certificate image modal (拡大表示) ===== */
.cert-modal[hidden] { display: none; }
.cert-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.94);
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.cert-modal-image {
  max-width: 100vw; max-height: 100vh;
  /* 動的ビューポート: iOS Safari の URL バー表示状態を考慮 (対応ブラウザのみ) */
  max-width: 100dvw; max-height: 100dvh;
  width: auto; height: auto;
  object-fit: contain;
  user-select: none; -webkit-user-drag: none;
}
.cert-modal-close {
  position: fixed;
  top: max(env(safe-area-inset-top, 0px), 12px);
  right: max(env(safe-area-inset-right, 0px), 12px);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.95); color: #2a2a2a;
  border: none; font-size: 28px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit; padding: 0;
  z-index: 1; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.cert-modal-close:active { transform: scale(0.95); }
body.cert-modal-open { overflow: hidden; }

.vaccine-form-actions {
  display: flex; flex-direction: column; gap: 8px; margin-top: 8px;
}

/* ===== Vaccine certificate (OCR + storage) ===== */
.vaccine-cert-section {
  padding: 14px; border-radius: 14px;
  background: var(--white); border: 1px solid var(--border);
  gap: 10px !important;
}

/* ===== Photo Section (Compact) =====
   通院・お金フォーム冒頭の写真セクション。視認性を保ちつつフォーム全体スクロールを抑える。
   ・ラベル/ヒントは省略 (タイトルはフォーム上部から自明)
   ・選択ボタンは小さめのアウトライン型
   ・AI 反映ボタンは読み取り完了後のみ表示 (auto populate しない明示同意 UX) */
.photo-section-compact {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 8px;
}
/* 空のプレビューがレイアウト枠を取らないようにする */
.photo-section-compact .cert-image-preview:empty { display: none; }
.btn-photo-pick {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  background: white; border: 1px dashed var(--border);
  color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  align-self: flex-start;
}
.btn-photo-pick:hover { border-color: var(--primary); color: var(--primary); }
.btn-photo-pick:disabled { opacity: 0.6; cursor: progress; }

.ai-apply-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--primary-light); border: 1px solid var(--primary);
  color: var(--primary); font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  text-align: center;
}
.ai-apply-btn:hover { background: var(--primary); color: white; }
.ai-apply-btn[hidden] { display: none; }
.vaccine-cert-section > label {
  font-size: 13px; font-weight: 700; color: var(--text);
}
.vaccine-cert-hint {
  margin: 0; font-size: 12px; color: var(--sub); line-height: 1.6;
}
.vaccine-cert-meta { color: var(--sub); font-size: 11px; }
.vaccine-cert-thumbs {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.vaccine-cert-thumbs:empty { display: none; }
.vaccine-cert-thumb {
  width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: var(--warm);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--sub); position: relative;
}
.vaccine-cert-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vaccine-cert-btn {
  font-size: 15px; padding: 13px 20px; gap: 6px;
}
.vaccine-cert-btn:disabled,
.vaccine-ocr-busy .vaccine-cert-btn { opacity: 0.6; cursor: progress; }
.vaccine-ocr-status {
  font-size: 12px; padding: 10px 12px; border-radius: 10px; line-height: 1.5;
  background: var(--warm); border: 1px solid var(--border); color: var(--text);
  display: flex; align-items: flex-start; gap: 6px;
}
.vaccine-ocr-status[hidden] { display: none; }
.vaccine-ocr-status[data-level="info"]::before { content: "⏳"; }
.vaccine-ocr-status[data-level="ok"] {
  background: #F1ECDB; border-color: #D7C9A6; color: #6B5430;
}
.vaccine-ocr-status[data-level="ok"]::before { content: "✨"; }
.vaccine-ocr-status[data-level="warn"] {
  background: #FBEFD8; border-color: #E8C98A; color: #8A5A00;
}
.vaccine-ocr-status[data-level="warn"]::before { content: "⚠️"; }
.vaccine-ocr-status[data-level="error"] {
  background: var(--danger-bg); border-color: #E8B6AD; color: var(--danger);
}
.vaccine-ocr-status[data-level="error"]::before { content: "✕"; }
.vaccine-cert-disclaimer { color: var(--sub); font-size: 11px; line-height: 1.5; }
.vaccine-field-autofilled {
  background: var(--primary-light) !important;
  border-color: #E0C58F !important;
}
.btn-danger-link {
  color: var(--danger); font-size: 13px; text-align: center;
  background: none; border: none; cursor: pointer; padding: 8px; text-decoration: underline;
}

/* ===== Phase C-1: TaskSeries (くすり管理) ===== */
.medication-section-title {
  font-size: 12px; font-weight: 600; color: var(--sub);
  margin: 14px 4px 8px;
}
.medication-empty {
  text-align: center; padding: 24px; color: var(--sub);
  background: white; border-radius: 12px; border: 1px solid var(--border);
}
.medication-empty-icon { font-size: 36px; margin-bottom: 4px; }
.medication-empty p { margin: 0; font-size: 13px; }

.medication-card {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; margin-bottom: 12px;
}
.medication-card-head {
  display: flex; align-items: center; gap: 8px;
}
.medication-card-icon { font-size: 18px; }
.medication-card-body { flex: 1; min-width: 0; }
.medication-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.medication-card-meta {
  font-size: 11px; color: var(--sub); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.medication-card-remaining {
  font-size: 11px; font-weight: 600; color: var(--sub);
  white-space: nowrap;
}
.medication-card-remaining.is-danger { color: var(--danger); }

.medication-card-progress { margin-top: 10px; }
.medication-card-progress-text { font-size: 11px; color: var(--sub); margin-top: 4px; }
.medication-progress-bar {
  background: var(--bg); border-radius: 4px; height: 6px; overflow: hidden;
}
.medication-progress-bar-fill {
  height: 100%; background: var(--primary); border-radius: 4px;
  transition: width .2s ease;
}

.medication-card-actions {
  display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}
.medication-card-form { display: inline; margin: 0; }
.btn-pill {
  padding: 6px 14px; border-radius: 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border);
  background: white; color: var(--text);
}
.btn-pill-primary {
  background: var(--primary); border-color: var(--primary); color: white;
}
.btn-pill-outline { background: white; color: var(--text); }
.btn-pill-danger {
  background: white; border-color: var(--danger); color: var(--danger);
}

.medication-card-ended {
  opacity: 0.6;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; margin-bottom: 8px;
}
.medication-card-ended-title { flex: 1; font-size: 13px; font-weight: 600; }

/* ----- 登録/編集フォーム ----- */
.medication-form .form-field { margin-bottom: 14px; }
.medication-form-required::after {
  content: "必須";
  font-size: 10px; color: var(--danger);
  background: var(--danger-bg); border-radius: 4px;
  padding: 1px 6px; margin-left: 6px;
}

.medication-chip-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.medication-chip {
  padding: 8px 14px; border-radius: 18px;
  background: white; border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text);
  cursor: pointer; user-select: none;
}
.medication-chip.is-selected,
.medication-chip:has(input[type="checkbox"]:checked) {
  background: var(--primary-light); border-color: var(--primary);
  color: var(--primary); font-weight: 700;
}
.medication-chip[hidden] { display: none; }

.medication-form-date-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
/* CSS grid のデフォルト min-width: auto を上書き。
   "2027/05/09" のような長い日付値で input が grid セル幅を超え横はみ出すのを防ぐ。 */
.medication-form-date-row > * { min-width: 0; }
.medication-form-openended {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; margin-bottom: 14px; color: var(--text);
}

.medication-form-warn {
  background: #FFF7E5; border: 1px solid #E5B83A;
  border-radius: 8px; padding: 10px; margin-bottom: 12px; font-size: 12px;
  line-height: 1.5;
}
.medication-form-preview {
  background: var(--primary-light); border-radius: 8px;
  padding: 10px; margin-bottom: 12px; font-size: 12px; color: var(--primary);
  line-height: 1.5;
}

/* ----- ClinicVisit 内 TaskSeries inline 入力 (Phase C-2) ----- */
.clinic-visit-form .medication-row {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; margin-bottom: 10px; background: var(--bg);
}
.clinic-visit-form .medication-row + .medication-row { margin-top: 10px; }
.clinic-visit-form .medication-row[data-marked-destroy="1"] { display: none; }
.medication-row-remove {
  width: 100%; margin-top: 6px;
  background: white; color: var(--danger);
  border: 1px solid var(--danger); border-radius: 10px;
  padding: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.medication-row-add {
  width: 100%; margin-top: 6px;
  background: white; color: var(--primary);
  border: 1px solid var(--primary); border-radius: 10px;
  padding: 10px; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* flash messages for task_series index */
.form-flash {
  border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5;
}
.form-flash-success {
  background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46;
}
.form-flash-danger {
  background: var(--danger-bg); border: 1px solid #E8B6AD; color: var(--danger);
}

/* ===========================================================================
   PC / Desktop layout (PC版アプリリリース PC-05)
   --------------------------------------------------------------------------
   ブレークポイント: mobile <768 / tablet 768-1023 / desktop ≥1024
   モバイル UI は一切崩さず現状維持 (デフォルト)、desktop のみ media query で上書き。
   --------------------------------------------------------------------------- */

/* デフォルト (mobile / tablet): サイドバー非表示、shell は透過 */
.app-shell { min-height: 100vh; min-height: 100dvh; }
.app-sidebar, .app-sidebar-secondary { display: none; }
.app-main { min-width: 0; }

@media (min-width: 1024px) {
  /* デスクトップ: Tier-1 サイドバー + Tier-2 サイドバー (任意) + メイン
     Tier-2 が無いページではその要素自体が DOM に存在しないため flex で吸収する */
  .app-shell {
    display: flex;
    align-items: stretch;
  }

  .app-sidebar {
    display: flex; flex-direction: column;
    width: 220px; flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 24px 12px;
    position: sticky; top: 0;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
  }

  /* Tier-2 サイドバー: 中段カラム。ページ固有のマスタリスト・タブ・フィルタ */
  .app-sidebar-secondary {
    display: flex; flex-direction: column;
    width: 240px; flex-shrink: 0;
    background: var(--warm);
    border-right: 1px solid var(--border);
    padding: 24px 12px;
    position: sticky; top: 0;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
    gap: 20px;
  }
  .app-sidebar-secondary-section { display: flex; flex-direction: column; gap: 4px; }
  .app-sidebar-secondary-heading {
    padding: 0 14px 10px;
    font-size: 16px; font-weight: 800;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }
  .app-sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 8px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
  }
  .app-sidebar-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }
  .app-sidebar-title { font-size: 17px; font-weight: 800; color: var(--primary); letter-spacing: -0.3px; }
  .app-sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
  .app-sidebar-footer {
    margin-top: 16px; padding-top: 16px;
    border-top: 1px solid var(--border);
  }
  .sidebar-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 10px;
    color: var(--text); font-size: 14px; font-weight: 600;
    background: transparent; border: none; cursor: pointer;
    text-decoration: none; width: 100%;
    text-align: left;
    box-sizing: border-box;
  }
  .sidebar-item:hover { background: var(--warm); }
  .sidebar-item.active { background: var(--primary-light); color: var(--primary); }
  .sidebar-item.active svg { stroke: var(--primary); }
  /* ペット別サブナビ: 左 padding を増やしてインデント表現 */
  .sidebar-item-sub { padding-left: 22px; font-size: 13px; }
  .app-sidebar-section-label {
    padding: 12px 14px 6px;
    font-size: 11px; font-weight: 700;
    color: var(--sub);
    letter-spacing: 0.04em;
  }
  /* button_to は <form> でラップされるので form の余白を消す */
  .app-sidebar form.sidebar-item-btn,
  .app-sidebar form { margin: 0; padding: 0; }

  /* メインコンテンツ領域: flex で残りスペースを埋める。
     コンテンツはサイドバー以外を最大幅まで使う (max-width 制約なし)。 */
  .app-main {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
  }

  /* モバイルのボトムナビは desktop では非表示 */
  .bottom-nav, .pet-bottom-nav { display: none !important; }
  /* ボトム固定 FAB なども desktop では位置調整は別途検討 */

  /* desktop ではアプリトップヘッダー (wannaポータル ロゴ + 歯車) は非表示。
     ブランドは左サイドバーが担い、ページタイトルは sub-header / 各ページ内で表示する。 */
  .app-header { display: none !important; }
  /* ヘッダーが消えた分、最上部のコンテンツに少し余白を入れる */
  .app-screen { padding-top: 8px; }
  /* sub-header 内の "ホームへ戻る" ボタンはサイドバーと重複するので非表示 */
  .sub-header .header-home-btn { display: none; }
  .sub-header h2 { text-align: left; padding-left: 4px; }
  .sub-header-spacer { display: none; }

  /* welcome (未認証) は app-shell の外側で全幅 — 未ログイン時は app-main も使われない */

  /* Tier-2 サイドバー: 各ページが content_for(:sidebar_extra) で差し込んだ
     タブ / チップ / フィルタ等を表示するエリア。 */
  .app-sidebar-tier2 {
    margin-top: 16px; padding-top: 16px;
    border-top: 1px solid var(--border);
  }
  .sidebar-tier2-section { display: flex; flex-direction: column; gap: 4px; }
  .sidebar-tier2-section + .sidebar-tier2-section { margin-top: 16px; }
  .sidebar-tier2-label {
    padding: 0 14px 6px;
    font-size: 11px; font-weight: 700;
    color: var(--sub);
    letter-spacing: 0.04em;
  }

  /* desktop ではページ内 (主に画面上部) のタブやフィルタを非表示にし、
     Tier-2 サイドバーに集約する。 */
  .page-tier2-mobile { display: none !important; }
  /* Tier-2 sidebar item 内のカウント表示 */
  .sidebar-item-count { color: var(--sub); font-size: 11px; margin-left: 6px; }

  /* PC-11: モーダル / Picker / DateNav の desktop センターモーダル化
     mobile はボトムシート型 (.group-switcher) を維持、desktop は中央配置 + 全角丸。
     ネイティブ <dialog> 系 (.invite-modal, .photo-area-modal, .graph-custom-modal) は
     既に inset: 0 + margin: auto で中央配置されているため対応不要。 */
  .group-switcher { align-items: center; }
  .group-switcher-sheet {
    max-width: 480px;
    width: 92vw;
    border-radius: 16px;
    animation: groupSwitcherFadeIn 0.18s ease-out;
  }
  @keyframes groupSwitcherFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* PC-09: フォーム系の中央寄せ max-width */
  .task-form, .form-container, form.app-form {
    max-width: 600px;
    margin: 0 auto;
  }

  /* PC-10: 写真関連 desktop 最適化 */
  /* timeline の横スクロールストリップ → 折返しグリッドに */
  .photo-strip {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 8px;
  }
  .photo-card { width: 140px; height: 140px; }
  /* mini grid (PetWannaCard 等) は desktop で多列化 */
  .photo-grid-sm,
  .photo-grid-full {
    grid-template-columns: repeat(6, 1fr);
  }
}


