/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; touch-action: manipulation; }
input[type="date"].field-input { appearance: none; -webkit-appearance: none; min-width: 0; width: 100%; min-height: 42px; }
:root {
  --cream: #faf6f0; --warm: #f5ede0;
  --dog-primary: #c8844a; --dog-light: #f0d4b4; --dog-dark: #8b5a2b;
  --cat-primary: #7a9cc0; --cat-light: #c8dff0; --cat-dark: #3a6a8c;
  --text-dark: #2c2418; --text-mid: #5a4a38; --text-light: #9a8a78;
  --white: #ffffff; --red: #e05050; --green: #4caf80;
  --shadow: 0 4px 24px rgba(44,36,24,0.10);
  --radius: 18px; --accent: var(--dog-primary);
  --font: 'Hiragino Kaku Gothic ProN','Hiragino Sans','Noto Sans JP',sans-serif;
}
.cat-type { --accent: var(--cat-primary); }
html, body { height: 100%; font-family: var(--font); background: var(--cream); color: var(--text-dark); overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
#app { height: 100vh; height: -webkit-fill-available; position: relative; overflow: hidden; overscroll-behavior: none; touch-action: pan-y; }

/* ===== Screens ===== */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), visibility 0s linear 0.35s; background: var(--cream); overflow: hidden; visibility: hidden; pointer-events: none; }
.screen.active { transform: translateX(0); visibility: visible; pointer-events: auto; transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), visibility 0s linear 0s; }
.screen.slide-out { transform: translateX(-30%); visibility: visible; pointer-events: none; transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), visibility 0s linear 0s; }

/* ===== Select ===== */
#screen-select { justify-content: center; align-items: center; background: var(--warm); transform: translateX(0); visibility: visible; pointer-events: auto; }
.select-bg { position: absolute; inset: 0; background: radial-gradient(ellipse 60% 40% at 20% 80%, rgba(200,132,74,0.18), transparent 70%), radial-gradient(ellipse 50% 40% at 80% 20%, rgba(122,156,192,0.15), transparent 70%); pointer-events: none; }
.select-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 36px; padding: 32px 24px; }
.app-logo { text-align: center; animation: fadeDown 0.6s ease both; }
.logo-paw { font-size: 48px; margin-bottom: 12px; animation: floatPaw 3s ease-in-out infinite; }
@keyframes floatPaw { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes fadeDown { from{opacity:0;transform:translateY(-20px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeUp { from{opacity:0;transform:translateY(30px)} to{opacity:1;transform:translateY(0)} }
@keyframes cardIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.app-title { font-size: 32px; font-weight: 900; letter-spacing: 0.05em; line-height: 1.25; margin-bottom: 8px; }
.app-sub { font-size: 13px; color: var(--text-light); letter-spacing: 0.08em; }
.select-cards { display: flex; gap: 20px; animation: fadeUp 0.6s 0.15s ease both; }
.select-card { width: 148px; height: 185px; border: none; border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform 0.18s; }
.select-card::before { content:''; position:absolute; inset:0; opacity:0; transition:opacity 0.2s; background:rgba(255,255,255,0.2); }
.select-card:active::before { opacity:1; }
.select-card:active { transform: scale(0.96); }
.dog-card { background: linear-gradient(145deg,#f0d4b4,#e8b87a); }
.cat-card { background: linear-gradient(145deg,#c8dff0,#9abcd8); }
.card-emoji { font-size: 64px; line-height: 1; }
.card-label { font-size: 22px; font-weight: 800; }
.card-sub { font-size: 11px; letter-spacing: 0.12em; color: var(--text-mid); font-weight: 600; }
.select-footer { animation: fadeUp 0.6s 0.3s ease both; }
.transfer-btn { background: rgba(44,36,24,0.08); border: 1px solid rgba(44,36,24,0.12); border-radius: 20px; padding: 10px 20px; font-size: 13px; font-weight: 600; color: var(--text-mid); cursor: pointer; font-family: var(--font); }

/* ===== Header ===== */
.app-header { display: flex; align-items: center; padding: 52px 10px 12px; gap: 6px; background: var(--cream); border-bottom: 1px solid rgba(44,36,24,0.07); flex-shrink: 0; min-height: 96px; }
.back-btn { width: 36px; height: 36px; border: none; background: var(--warm); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.back-arrow { font-size: 18px; }
.header-title { flex: 1; font-size: 16px; font-weight: 800; text-align: center; }
.header-icon-btn { width: 36px; height: 36px; border: none; background: var(--warm); border-radius: 50%; font-size: 17px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.add-btn-icon { background: var(--accent); color: white; font-size: 22px; font-weight: 700; }
.edit-toggle-btn { height: 32px; padding: 0 12px; border: none; border-radius: 20px; font-size: 13px; font-weight: 700; cursor: pointer; flex-shrink: 0; background: var(--warm); color: var(--text-dark); font-family: var(--font); }
.edit-toggle-btn.editing { background: var(--accent); color: white; }

/* ===== List Controls ===== */
.list-controls, .folder-controls { padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.search-wrap { display: flex; align-items: center; background: var(--white); border-radius: 12px; padding: 0 14px; box-shadow: 0 2px 8px rgba(44,36,24,0.07); gap: 8px; }
.search-input { flex: 1; border: none; background: transparent; font-size: 15px; padding: 11px 0; color: var(--text-dark); font-family: var(--font); outline: none; }
.search-input::placeholder { color: var(--text-light); }
.sort-buttons { display: flex; gap: 8px; }
.sort-btn { flex: 1; padding: 8px; border: 1.5px solid rgba(44,36,24,0.12); background: var(--white); border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text-light); cursor: pointer; transition: all 0.15s; font-family: var(--font); }
.sort-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.sort-sub-row { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.sort-sub-row-right { display: flex; gap: 6px; }
.sort-sub-row-btn { padding: 5px 10px; border: 1.5px solid rgba(44,36,24,0.12); background: var(--white); border-radius: 8px; font-size: 11px; font-weight: 600; color: var(--text-light); cursor: pointer; transition: all 0.15s; font-family: var(--font); }
.sort-sub-row-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
#sort-reorder-btn { display: none; }
.sort-manual-active #sort-reorder-btn { display: inline-block; }

/* ===== Pet List ===== */
.pet-list { flex: 1; overflow-y: auto; padding: 10px 14px calc(100px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.pet-card { background: var(--white); border-radius: var(--radius); padding: 13px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s; animation: cardIn 0.3s ease both; }
.pet-card:active { transform: scale(0.98); }
.pet-card-photo { width: 58px; height: 58px; border-radius: 50%; flex-shrink: 0; background: var(--warm); display: flex; align-items: center; justify-content: center; font-size: 26px; overflow: hidden; border: 2px solid var(--warm); }
.pet-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.pet-card-info { flex: 1; min-width: 0; }
.pet-card-name { font-size: 16px; font-weight: 800; margin-bottom: 2px; }
.pet-card-meta { font-size: 12px; color: var(--text-light); }
.pet-card-arrow { font-size: 18px; color: var(--text-light); flex-shrink: 0; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-state .empty-emoji { font-size: 56px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; line-height: 1.6; }

/* ===== Detail ===== */
.detail-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px calc(100px + env(safe-area-inset-bottom)); }
.reg-date-badge { display: block; text-align: right; font-size: 11px; color: var(--text-light); margin-bottom: 8px; }
.detail-photo-wrap { text-align: center; margin-bottom: 14px; position: relative; }
.detail-photo { width: 116px; height: 116px; border-radius: 50%; background: var(--warm); display: inline-flex; align-items: center; justify-content: center; font-size: 54px; overflow: hidden; box-shadow: 0 4px 20px rgba(44,36,24,0.12); border: 3px solid var(--white); }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-change-btn { position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%) translateX(40px); width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--white); background: var(--accent); color: white; font-size: 13px; cursor: pointer; display: none; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.editing-mode .photo-change-btn { display: flex; }
.detail-card { background: var(--white); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.detail-card-title { font-size: 11px; font-weight: 700; letter-spacing: 0.10em; color: var(--text-light); margin-bottom: 10px; }
.detail-field { margin-bottom: 10px; }
.detail-field:last-child { margin-bottom: 0; }
.field-label { display: block; font-size: 11px; color: var(--text-light); margin-bottom: 3px; font-weight: 600; }
.required { color: var(--red); }
.field-value { font-size: 15px; font-weight: 700; min-height: 24px; line-height: 1.4; }
.field-age-note { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.field-input { width: 100%; max-width: 100%; min-width: 0; border: 1.5px solid rgba(44,36,24,0.12); border-radius: 10px; padding: 9px 11px; font-size: 15px; color: var(--text-dark); background: var(--cream); font-family: var(--font); outline: none; transition: border-color 0.2s; }
.field-input:focus { border-color: var(--accent); }
textarea.field-input { resize: vertical; min-height: 76px; line-height: 1.6; }

/* 犬種ボタン */
.breed-display-btn { width: 100%; text-align: left; border: 1.5px solid rgba(44,36,24,0.12); border-radius: 10px; padding: 9px 11px; font-size: 15px; color: var(--text-dark); background: var(--cream); font-family: var(--font); cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.breed-display-btn .placeholder { color: var(--text-light); }
.mixed-parents { display: flex; gap: 8px; }
.mixed-parents .field-input { flex: 1; }

/* 性別 */
.gender-select { display: flex; gap: 8px; }
.gender-btn { flex: 1; padding: 9px; border: 1.5px solid rgba(44,36,24,0.12); border-radius: 10px; background: var(--white); font-size: 14px; font-weight: 600; color: var(--text-mid); cursor: pointer; font-family: var(--font); transition: all 0.15s; text-align: center; }
.gender-btn.selected { background: var(--accent); border-color: var(--accent); color: white; }
/* 家族タグは数が増えるので折り返し、幅は中身なり */
.family-tag-picker { flex-wrap: wrap; }
.family-tag-picker .family-tag-chip { flex: 0 1 auto; padding: 8px 14px; font-size: 13px; }

/* 問題フォルダ */
.issue-folder { border: 1.5px solid rgba(44,36,24,0.09); border-radius: 13px; margin-bottom: 8px; overflow: hidden; background: var(--cream); }
.issue-folder-header { display: flex; align-items: center; padding: 11px 13px; cursor: pointer; gap: 8px; user-select: none; }
.issue-folder-icon { font-size: 17px; }
.issue-folder-name { flex: 1; font-size: 14px; font-weight: 700; }
.issue-folder-status { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px; }
.status-none { background: rgba(44,36,24,0.07); color: var(--text-light); }
.status-noted { background: rgba(200,132,74,0.15); color: var(--dog-dark); }
.cat-type .status-noted { background: rgba(122,156,192,0.2); color: var(--cat-dark); }
.issue-chevron { font-size: 12px; color: var(--text-light); transition: transform 0.2s; }
.issue-folder.open .issue-chevron { transform: rotate(90deg); }
.issue-folder-body { display: none; padding: 0 13px 13px; border-top: 1px solid rgba(44,36,24,0.07); }
.issue-folder.open .issue-folder-body { display: block; }
.issue-memo-label { font-size: 11px; color: var(--text-light); margin: 8px 0 5px; font-weight: 600; }
.memo-view { font-size: 14px; line-height: 1.7; white-space: pre-wrap; min-height: 18px; }
.memo-empty { color: var(--text-light); font-style: italic; font-size: 13px; }

/* 閲覧/編集モード */
.edit-only { display: none; }
.view-only { display: block; }
.editing-mode .edit-only { display: block; }
.editing-mode .view-only { display: none; }

/* 保存/削除ボタン */
.save-btn { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: calc(100% - 40px); max-width: 420px; padding: 15px; border: none; border-radius: 14px; background: var(--accent); color: white; font-size: 16px; font-weight: 800; cursor: pointer; display: none; font-family: var(--font); box-shadow: 0 4px 20px rgba(200,132,74,0.35); transition: transform 0.15s; }
.save-btn:active { transform: translateX(-50%) scale(0.98); }
.editing-mode .save-btn { display: block; }
.delete-btn { width: 100%; padding: 12px; border: 1.5px solid #e07070; background: transparent; border-radius: 12px; color: #e07070; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 18px; font-family: var(--font); transition: all 0.15s; }
.delete-btn:active { background: #e07070; color: white; }
.survey-open-btn { width: 100%; padding: 12px; border: none; border-radius: 12px; background: var(--accent); color: white; font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 4px; font-family: var(--font); }

/* ===== アンケート ===== */
.yn-group { display: flex; gap: 8px; }
.yn-btn { flex: 1; padding: 9px; border: 1.5px solid rgba(44,36,24,0.12); border-radius: 10px; background: var(--white); font-size: 14px; font-weight: 700; color: var(--text-mid); cursor: pointer; font-family: var(--font); transition: all 0.15s; text-align: center; }
.yn-btn.yes.selected { background: #4caf80; border-color: #4caf80; color: white; }
.yn-btn.no.selected { background: var(--red); border-color: var(--red); color: white; }
.toilet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toilet-item { background: var(--cream); border-radius: 10px; padding: 10px; }
.toilet-item-label { font-size: 12px; color: var(--text-light); font-weight: 600; margin-bottom: 6px; }
.toilet-ox { display: flex; gap: 6px; }
.ox-btn { flex: 1; padding: 7px 4px; border: 1.5px solid rgba(44,36,24,0.12); border-radius: 8px; font-size: 15px; font-weight: 700; background: var(--white); cursor: pointer; font-family: var(--font); text-align: center; transition: all 0.15s; }
.ox-btn.circle.selected { background: #4caf80; border-color: #4caf80; }
.ox-btn.cross.selected { background: var(--red); border-color: var(--red); }
.allergy-list { display: flex; flex-direction: column; gap: 6px; }
.allergy-item { display: flex; align-items: center; gap: 6px; }
.allergy-item .field-input { flex: 1; }
.allergy-remove-btn { width: 28px; height: 28px; border: none; background: rgba(224,80,80,0.1); border-radius: 50%; color: var(--red); font-size: 16px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.allergy-add-btn { padding: 8px; border: 1.5px dashed rgba(44,36,24,0.2); border-radius: 10px; background: transparent; font-size: 13px; font-weight: 600; color: var(--text-light); cursor: pointer; font-family: var(--font); width: 100%; }
.tools-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-chip { padding: 6px 12px; border: 1.5px solid rgba(44,36,24,0.12); border-radius: 20px; font-size: 13px; font-weight: 600; background: var(--white); color: var(--text-mid); cursor: pointer; transition: all 0.15s; font-family: var(--font); }
.tool-chip.selected { background: var(--accent); border-color: var(--accent); color: white; }
.personality-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.personality-chip { padding: 7px 13px; border: 1.5px solid rgba(44,36,24,0.12); border-radius: 20px; font-size: 13px; font-weight: 600; background: var(--white); color: var(--text-mid); cursor: pointer; transition: all 0.15s; font-family: var(--font); }
.personality-chip.selected { background: var(--accent); border-color: var(--accent); color: white; }

/* ===== 問題フォルダ画面 ===== */
.folder-content { flex: 1; overflow-y: auto; padding: 10px 14px 40px; -webkit-overflow-scrolling: touch; }
.folder-issue-section { margin-bottom: 18px; }
.folder-section-header { font-size: 12px; font-weight: 800; color: var(--text-light); letter-spacing: 0.08em; padding: 6px 2px 8px; margin-bottom: 4px; border-bottom: 1px solid rgba(44,36,24,0.08); }
.folder-issue-title { font-size: 13px; font-weight: 700; color: var(--text-light); letter-spacing: 0.08em; margin-bottom: 8px; }
.folder-pet-card { background: var(--white); border-radius: 12px; padding: 11px 13px; margin-bottom: 7px; box-shadow: 0 2px 10px rgba(44,36,24,0.07); cursor: pointer; display: flex; align-items: flex-start; gap: 10px; }
.folder-pet-card:active { opacity: 0.8; }
.folder-pet-photo { width: 40px; height: 40px; border-radius: 50%; background: var(--warm); display: flex; align-items: center; justify-content: center; font-size: 19px; overflow: hidden; flex-shrink: 0; }
.folder-pet-photo img { width: 100%; height: 100%; object-fit: cover; }
.folder-pet-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.folder-pet-breed { font-size: 11px; color: var(--text-light); background: var(--warm); padding: 1px 6px; border-radius: 10px; font-weight: 500; display: inline-block; }
.folder-pet-memo { font-size: 12px; color: var(--text-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-empty { text-align: center; color: var(--text-light); font-size: 13px; padding: 16px; }

/* ===== 写真 ===== */
.photo-upload-area { border: 2px dashed rgba(44,36,24,0.15); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; background: var(--cream); position: relative; overflow: hidden; }
.photo-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-light); font-size: 14px; }
.photo-placeholder span:first-child { font-size: 32px; }
.photo-preview { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; }
.hidden { display: none !important; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.25s; overflow: hidden; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box { background: var(--white); border-radius: 24px 24px 0 0; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); transform: translateY(30px); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1); -webkit-overflow-scrolling: touch; }
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-box-small { max-height: 55vh; }
.modal-box-tall { max-height: 92vh; }
.modal-header { display: flex; align-items: center; padding: 18px 18px 0; margin-bottom: 12px; }
.modal-title { flex: 1; font-size: 17px; font-weight: 800; }
.modal-close { width: 30px; height: 30px; border: none; background: var(--warm); border-radius: 50%; font-size: 13px; cursor: pointer; color: var(--text-mid); }
.modal-body { padding: 0 18px; display: flex; flex-direction: column; gap: 10px; }
.modal-footer { display: flex; gap: 10px; padding: 14px 18px; margin-top: 10px; }
.btn-cancel, .btn-primary, .btn-danger { flex: 1; padding: 13px; border: none; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: var(--font); }
.btn-cancel { background: var(--warm); color: var(--text-dark); }
.btn-primary { background: var(--accent); color: white; }
.btn-danger { background: #e07070; color: white; }

/* 犬種モーダル */
.breed-sort-btns { display: flex; gap: 8px; }
.breed-list { padding: 8px 18px 20px; overflow-y: auto; max-height: 55vh; -webkit-overflow-scrolling: touch; }
.breed-group-header { font-size: 11px; font-weight: 700; color: var(--text-light); letter-spacing: 0.1em; padding: 10px 0 4px; border-bottom: 1px solid rgba(44,36,24,0.08); margin-bottom: 4px; }
.breed-item { padding: 10px 6px; font-size: 15px; border-radius: 8px; cursor: pointer; transition: background 0.12s; }
.breed-item:active { background: var(--warm); }
.breed-item.selected { font-weight: 700; color: var(--accent); }
.breed-item-sub { font-size: 11px; color: var(--text-light); margin-top: 1px; }

/* データ引き継ぎ */
.transfer-section { padding: 4px 0 8px; }
.transfer-title { font-size: 15px; font-weight: 800; margin-bottom: 6px; }
.transfer-desc { font-size: 13px; color: var(--text-light); line-height: 1.6; margin-bottom: 12px; }
.btn-transfer { width: 100%; padding: 13px; border: none; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: var(--font); }
.btn-transfer.export { background: var(--accent); color: white; }
.btn-transfer.import { background: #4caf80; color: white; }
.btn-transfer.danger { background: rgba(224,80,80,0.1); color: var(--red); border: 1.5px solid var(--red); }
.transfer-divider { height: 1px; background: rgba(44,36,24,0.08); margin: 16px 0; }

/* 散歩中の常時表示バー（どの画面にいても分かるように） */
.walk-banner {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 900; display: flex; align-items: center; gap: 9px;
  background: var(--accent); color: #fff;
  border-radius: 14px; padding: 11px 15px;
  box-shadow: 0 6px 20px rgba(44,36,24,0.28);
  font-size: 13px; font-weight: 800; cursor: pointer;
  animation: walkBannerIn 0.25s ease both;
}
.walk-banner.hidden { display: none; }
.walk-banner-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.walk-banner-time { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 800; }
.walk-banner-paw { animation: floatPaw 2.4s ease-in-out infinite; }
@keyframes walkBannerIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .walk-banner, .walk-banner-paw { animation: none; }
}

/* 線画アイコン（絵文字の置き換え） */
.ico {
  width: 1em; height: 1em;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.14em; flex-shrink: 0;
}
.quick-care-btn .care-icon .ico { width: 26px; height: 26px; stroke-width: 1.75; }

/* 日常ケアは種類ごとに色を持たせる（絵文字の色味の代わり） */
.ico-nail  { color: #c8844a; }
.ico-tooth { color: #4a8fa8; }
.ico-flea  { color: #5c9166; }
.ico-groom { color: #9a6fa0; }

/* 同期 */
.btn-transfer.sync { background: #4a7fc8; color: white; }
.btn-transfer.subtle { background: rgba(44,36,24,0.06); color: var(--text-light); margin-top: 8px; }
.sync-status {
  font-size: 12px; line-height: 1.6; color: var(--text-light);
  background: rgba(44,36,24,0.04); border-radius: 10px;
  padding: 8px 10px; margin-bottom: 12px; word-break: break-all;
}
.sync-status.ok { color: #3a7a55; background: rgba(76,175,128,0.1); }
.sync-status.error { color: var(--red); background: rgba(224,80,80,0.08); }
.sync-login-msg { font-size: 12px; line-height: 1.6; color: var(--red); margin-top: 10px; min-height: 16px; }

/* Obsidian書き出し */
.obs-format-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.obs-format-opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid rgba(44,36,24,0.12); background: rgba(255,255,255,0.5);
}
.obs-format-opt:has(input:checked) { border-color: var(--accent); background: rgba(255,255,255,0.9); }
.obs-format-opt input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.obs-format-body { display: flex; flex-direction: column; gap: 2px; }
.obs-format-name { font-size: 14px; font-weight: 700; }
.obs-format-note { font-size: 12px; color: var(--text-light); line-height: 1.5; }
.obs-pick-head {
  display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px;
}
.obs-pick-title { font-size: 13px; font-weight: 700; }
.obs-pick-actions { display: flex; gap: 10px; }
.obs-pick-link {
  border: none; background: none; padding: 0; cursor: pointer;
  font-size: 12px; font-weight: 700; color: var(--accent); font-family: var(--font);
}
.obs-pick-list {
  max-height: 168px; overflow-y: auto; margin-bottom: 12px;
  border: 1.5px solid rgba(44,36,24,0.12); border-radius: 12px;
  background: rgba(255,255,255,0.5); padding: 4px;
}
.obs-pick-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.obs-pick-item:active { background: rgba(44,36,24,0.05); }
.obs-pick-item input { accent-color: var(--accent); flex-shrink: 0; }
.obs-pick-name { flex: 1; font-weight: 600; }
.obs-pick-type {
  font-size: 11px; font-weight: 700; color: var(--text-light);
  background: rgba(44,36,24,0.06); border-radius: 20px; padding: 2px 8px;
}
.obs-pick-empty { font-size: 13px; color: var(--text-light); padding: 12px 8px; text-align: center; }

.obs-photo-opt {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-light); margin-bottom: 12px; cursor: pointer;
}
.obs-photo-opt input { accent-color: var(--accent); }
/* iOS Safari のデフォルト青色を無効化 */
a, button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* 戻るボタン・タイトル文字が青くなる場合 */
.back-btn,
.back-arrow,
.header-title,
.card-label,
.card-sub {
  color: inherit;
  -webkit-text-fill-color: currentColor;
}

/* ==========================================================================
   ===== 病院記録＆ケア 統合画面 (Hospital & Care Integration Screen) =====
   ========================================================================== */

/* 病院記録画面ヘッダーとタブ */
.hospital-tabs {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid rgba(44,36,24,0.08);
  flex-shrink: 0;
  padding: 4px 6px;
  gap: 2px;
}
.hospital-tabs::-webkit-scrollbar {
  display: none;
}
.hospital-tab-btn {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font);
}
.hospital-tab-btn .tab-icon {
  font-size: 20px;
  opacity: 0.6;
  transition: transform 0.2s;
}
.hospital-tab-btn .tab-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.hospital-tab-btn.active {
  background: rgba(200, 132, 74, 0.08);
}
.cat-type .hospital-tab-btn.active {
  background: rgba(122, 156, 192, 0.08);
}
.hospital-tab-btn.active .tab-icon {
  opacity: 1;
  transform: scale(1.15);
}
.hospital-tab-btn.active .tab-label {
  color: var(--accent);
}

/* タブコンテンツ全体のコンテナ */
.hospital-tab-content-wrap {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--cream);
  padding: 14px 14px calc(60px + env(safe-area-inset-bottom));
}
.hospital-tab-content {
  display: none;
  animation: tabFadeIn 0.3s ease both;
}
.hospital-tab-content.active {
  display: block;
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 1. 日常ケア (1タップクイック完了) */
.quick-care-date-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--warm);
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.quick-date-input {
  flex: 1;
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid rgba(44,36,24,0.1);
  background: var(--white);
}
.quick-care-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quick-care-btn {
  background: var(--cream);
  border: 1.5px solid rgba(44,36,24,0.08);
  border-radius: 16px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font);
}
.quick-care-btn .care-icon {
  font-size: 26px;
  opacity: 0.5;
  transition: all 0.2s;
}
.quick-care-btn .care-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-mid);
}
.quick-care-btn .care-status {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  background: rgba(44,36,24,0.06);
  color: var(--text-light);
  transition: all 0.2s;
}
.quick-care-btn:active {
  transform: scale(0.95);
}

/* 完了状態のスタイル (グリーン系の優しいトーン) */
.quick-care-btn.completed {
  background: #eef9f2;
  border-color: #a3e0be;
}
.quick-care-btn.completed .care-icon {
  opacity: 1;
  transform: scale(1.1);
}
.quick-care-btn.completed .care-status {
  background: #4caf80;
  color: white;
}

/* 2. 体重推移グラフ & インライン追加 */
.weight-graph-container {
  position: relative;
  background: linear-gradient(to bottom, #ffffff, #faf6f0);
  border: 1px solid rgba(44,36,24,0.08);
  border-radius: 14px;
  height: 180px;
  margin-bottom: 12px;
  padding: 10px;
  overflow: hidden;
}
.weight-svg-element {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.graph-tooltip {
  position: absolute;
  background: rgba(44,36,24,0.92);
  color: white;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transform: translate(-50%, -100%);
  margin-top: -6px;
  white-space: nowrap;
  transition: opacity 0.15s, left 0.15s, top 0.15s;
}
.weight-add-inline {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.weight-add-inline .field-input {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
}
.weight-history-list {
  max-height: 150px;
  overflow-y: auto;
  border-top: 1px solid rgba(44,36,24,0.06);
  padding-top: 8px;
}
.weight-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
  font-size: 13px;
  border-bottom: 1px dashed rgba(44,36,24,0.05);
}
.weight-history-item:last-child {
  border-bottom: none;
}
.weight-history-date {
  color: var(--text-light);
}
.weight-history-val {
  font-weight: 700;
  color: var(--text-dark);
}
.weight-history-del {
  border: none;
  background: transparent;
  color: var(--red);
  font-weight: 800;
  padding: 2px 6px;
  cursor: pointer;
}

/* 3. 通院履歴 & タイムラインフィルター */
.medical-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.medical-filter-tabs {
  display: flex;
  background: var(--warm);
  padding: 4px;
  border-radius: 12px;
}
.medical-filter-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-mid);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  font-family: var(--font);
}
.medical-filter-btn.active {
  background: var(--white);
  color: var(--text-dark);
  box-shadow: 0 2px 6px rgba(44,36,24,0.06);
}
.add-medical-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  border-radius: 12px;
}

/* タイムライン年アコーディオン */
.medical-timeline-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-year-group {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.timeline-year-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--warm);
  cursor: pointer;
  user-select: none;
}
.timeline-year-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
}
.timeline-year-count {
  font-size: 12px;
  color: var(--text-light);
  margin-left: 8px;
}
.timeline-year-arrow {
  font-size: 12px;
  color: var(--text-light);
  transition: transform 0.25s;
}
.timeline-year-group.open .timeline-year-arrow {
  transform: rotate(180deg);
}
.timeline-year-body {
  display: none;
  padding: 8px 14px 14px;
  border-top: 1px solid rgba(44,36,24,0.06);
}
.timeline-year-group.open .timeline-year-body {
  display: block;
}

/* 通院カード項目 */
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(44,36,24,0.06);
  position: relative;
}
.timeline-item:last-child {
  border-bottom: none;
}
.timeline-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(200,132,74,0.1);
  color: var(--dog-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.cat-type .timeline-item-icon {
  background: rgba(122,156,192,0.12);
  color: var(--cat-dark);
}
.timeline-item-icon.vaccine-type {
  background: rgba(76,175,128,0.1);
  color: #4caf80;
}
.timeline-item-content {
  flex: 1;
  min-width: 0;
}
.timeline-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}
.timeline-item-date-hosp {
  font-size: 14px;
  font-weight: 800;
}
.timeline-item-cost {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
}
.timeline-item-meta {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 6px;
}
.timeline-item-notes {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.5;
  white-space: pre-wrap;
}
.timeline-item-photo {
  margin-top: 8px;
  border-radius: 8px;
  max-width: 100%;
  max-height: 150px;
  object-fit: cover;
  border: 1px solid rgba(44,36,24,0.08);
}
.timeline-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.timeline-action-btn {
  border: none;
  background: var(--warm);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  color: var(--text-mid);
  font-family: var(--font);
}
.timeline-action-btn.delete {
  background: rgba(224,80,80,0.08);
  color: var(--red);
}

/* 4. 病院紹介マスター */
.hospital-master-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.hospital-master-desc {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}
.add-hospital-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  border-radius: 12px;
}
.hospital-master-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hospital-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  border: 1px solid rgba(44,36,24,0.05);
}
.hospital-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(44,36,24,0.06);
  padding-bottom: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}
.hospital-card-title {
  font-size: 16px;
  font-weight: 800;
}
.hospital-card-arrow {
  font-size: 11px;
  color: var(--text-light);
  transition: transform 0.2s;
}
.hospital-card.open .hospital-card-arrow {
  transform: rotate(90deg);
}
.hospital-card-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hospital-card-body {
  display: none;
}
.hospital-card.open .hospital-card-body {
  display: block;
  animation: tabFadeIn 0.25s ease both;
}
.hospital-detail-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-mid);
}
.hospital-detail-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 18px;
}
.hospital-detail-val {
  flex: 1;
}
.hospital-detail-val.link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 700;
}
.hospital-memo-box {
  background: var(--warm);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.5;
  white-space: pre-wrap;
  margin: 6px 0;
}

/* 病院のアクション（シェア・編集・削除） */
.hospital-actions-bar {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  border-top: 1px dashed rgba(44,36,24,0.06);
  padding-top: 8px;
}
.hospital-act-btn {
  flex: 1;
  border: none;
  background: var(--warm);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-mid);
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.hospital-act-btn.share {
  background: rgba(76,175,128,0.08);
  color: #4caf80;
}
.hospital-act-btn.delete {
  background: rgba(224,80,80,0.08);
  color: var(--red);
}

/* 逆引き履歴テーブル */
.hospital-reverse-records {
  margin-top: 12px;
  background: var(--cream);
  border-radius: 10px;
  padding: 10px;
}
.hospital-rev-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.hospital-stats-box {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.hospital-stat-pill {
  flex: 1;
  background: var(--white);
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 11px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.hospital-stat-pill span {
  display: block;
  font-weight: 800;
  font-size: 13px;
  color: var(--accent);
  margin-top: 2px;
}
.hospital-rev-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}
.hospital-rev-item {
  background: var(--white);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hospital-rev-date-notes {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}
.hospital-rev-notes {
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hospital-rev-cost {
  font-weight: 800;
  color: var(--text-dark);
}

/* 5. ワクチン & 抗体価証明書 */
.certificates-desc {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 12px;
}
.certificates-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cert-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 16px;
  border: 2px solid rgba(44,36,24,0.06);
  position: relative;
  overflow: hidden;
}
/* 犬用・猫用・抗体価でアクセントを分ける */
.cert-card.vaccine-card {
  border-left: 6px solid var(--accent);
}
.cert-card.rabies-card {
  border-left: 6px solid #e08e45;
}
.cert-card.antibody-card {
  border-left: 6px solid #4caf80;
}
.cert-card-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
}
.vaccine-card .cert-card-badge { background: rgba(200,132,74,0.1); color: var(--dog-dark); }
.cat-type .vaccine-card .cert-card-badge { background: rgba(122,156,192,0.12); color: var(--cat-dark); }
.rabies-card .cert-card-badge { background: rgba(224,142,69,0.1); color: #c06c1c; }
.antibody-card .cert-card-badge { background: rgba(76,175,128,0.1); color: #3b8e64; }

.cert-card-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cert-card-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.cert-detail-row {
  display: flex;
  font-size: 13px;
}
.cert-detail-lbl {
  color: var(--text-light);
  width: 90px;
  font-weight: 600;
}
.cert-detail-val {
  flex: 1;
  font-weight: 700;
}
.cert-card-photo-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(44,36,24,0.08);
  margin-bottom: 12px;
  background: var(--cream);
  text-align: center;
}
.cert-card-photo {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  vertical-align: middle;
}
.cert-photo-empty {
  padding: 24px;
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
}
.cert-card-actions {
  display: flex;
  gap: 8px;
}
.cert-card-btn {
  flex: 1;
  border: none;
  background: var(--warm);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 0;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-dark);
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.cert-card-btn.upload {
  background: var(--accent);
  color: white;
}

/* ==========================================================================
   ===== 詳細画面 (Detail Screen) の登録日バッジと病院記録ボタンの配置 =====
   ========================================================================== */
.detail-header-meta-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 12px;
  padding: 0 4px;
}
.reg-date-badge {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 0 !important; /* flex-gapで制御するため */
}
.detail-hospital-records-btn-new {
  border: none;
  background: var(--accent);
  color: white;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(200,132,74,0.18);
  font-family: var(--font);
  transition: all 0.15s;
}
.cat-type .detail-hospital-records-btn-new {
  box-shadow: 0 3px 10px rgba(122,156,192,0.18);
}
.detail-hospital-records-btn-new:active {
  transform: scale(0.96);
}

/* ==========================================
   ===== 6. お薬管理・服用チェック (CSS) =====
   ========================================== */
.medicine-care-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}
.med-care-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.med-care-btn {
  background: var(--white);
  border: 1.5px solid rgba(44,36,24,0.08);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  min-height: 96px;
  position: relative;
  text-align: left;
  width: 100%;
}
.med-care-icon {
  font-size: 20px;
}
.med-care-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.med-care-dosage {
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.med-care-counter-val {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(44,36,24,0.06);
  color: var(--text-light);
  display: inline-block;
  align-self: flex-start;
  margin-top: auto;
}
.med-care-btn.completed {
  background: #eef9f2;
  border-color: #a3e0be;
}
.med-care-btn.completed .med-care-counter-val {
  background: #4caf80;
  color: white;
}
.med-care-actions {
  display: flex;
  gap: 6px;
}
.med-care-act-btn {
  flex: 1;
  border: none;
  font-size: 14px;
  font-weight: 800;
  padding: 6px 0;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}
.med-care-act-btn.plus {
  background: rgba(76,175,128,0.1);
  color: #4caf80;
}
.med-care-act-btn.minus {
  background: rgba(224,80,80,0.1);
  color: var(--red);
}

/* お薬マスター管理タブ */
.medicine-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.medicine-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  border: 1.5px solid rgba(44,36,24,0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.medicine-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(44,36,24,0.06);
  padding-bottom: 8px;
}
.medicine-card-title {
  font-size: 16px;
  font-weight: 800;
}
.medicine-order-btns {
  display: flex;
  gap: 4px;
}
.med-order-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--warm);
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
}
.med-order-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.medicine-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.med-grid-item {
  font-size: 13px;
  color: var(--text-mid);
}
.med-grid-item strong {
  color: var(--text-light);
  font-weight: 600;
}
.med-notes-box {
  background: var(--cream);
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.5;
  white-space: pre-wrap;
}
.medicine-actions {
  display: flex;
  gap: 6px;
  border-top: 1px dashed rgba(44,36,24,0.06);
  padding-top: 8px;
}
.medicine-act-btn {
  flex: 1;
  border: none;
  background: var(--warm);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 0;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-mid);
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.medicine-act-btn.delete {
  background: rgba(224,80,80,0.08);
  color: var(--red);
}

/* 病院登録時の料金表エディター行 */
.hospital-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.h-price-name {
  flex: 3;
  border: 1.5px solid rgba(44,36,24,0.12);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 14px;
  background: var(--cream);
  font-family: var(--font);
  outline: none;
}
.h-price-val {
  flex: 2;
  border: 1.5px solid rgba(44,36,24,0.12);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 14px;
  background: var(--cream);
  font-family: var(--font);
  outline: none;
}
.h-price-del-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(224,80,80,0.1);
  border-radius: 50%;
  color: var(--red);
  font-size: 14px;
  cursor: pointer;
}

/* 病院詳細の料金表閲覧用テーブル */
.hospital-price-table-wrap {
  margin-top: 10px;
  border: 1px solid rgba(44,36,24,0.06);
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
}
.hospital-price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.hospital-price-table th {
  background: var(--warm);
  padding: 8px 10px;
  font-weight: 800;
  text-align: left;
  border-bottom: 1px solid rgba(44,36,24,0.08);
}
.hospital-price-table td {
  padding: 8px 10px;
  border-bottom: 1px dashed rgba(44,36,24,0.05);
}
.hospital-price-table tr:last-child td {
  border-bottom: none;
}
.hospital-price-table td.val {
  text-align: right;
  font-weight: 400;
  color: var(--text-dark);
}

/* ==========================================================================
   ===== 複数医師管理 & 服用履歴編集用 新規追加クラス =====
   ========================================================================== */
.doctor-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.doctor-input {
  flex: 1;
  border: 1.5px solid rgba(44,36,24,0.12);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 14px;
  background: var(--cream);
  font-family: var(--font);
  outline: none;
}
.doctor-order-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: var(--warm);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doctor-order-btn:disabled {
  opacity: 0.3;
}
.history-edit-item {
  background: var(--cream);
  border: 1px solid rgba(44,36,24,0.08);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-edit-fields-row {
  display: flex;
  gap: 6px;
}
.history-edit-fields-row > * {
  flex: 1;
  min-width: 0;
}
.med-history-timeline-section {
  max-height: 220px;
  overflow-y: auto;
}
* {
  touch-action: manipulation;
}
/* ========== 散歩タイマー ボタン ========== */
.walk-timer-start-btn { border: none; background: var(--accent); color: #fff; border-radius: 12px; padding: 11px 18px; font-size: 15px; font-weight: 800; cursor: pointer; font-family: var(--font); box-shadow: 0 3px 12px rgba(200,132,74,0.32); transition: transform 0.15s; }
.walk-timer-start-btn:active { transform: scale(0.96); }
.walk-timer-stop-btn { width: 100%; border: none; background: #e8ded5; color: var(--text-mid); border-radius: 12px; padding: 11px; font-size: 15px; font-weight: 800; cursor: pointer; font-family: var(--font); margin-top: 8px; transition: transform 0.15s; }
.walk-timer-stop-btn:active { transform: scale(0.96); }

/* ========== ペット一覧 手動並び替えボタン ========== */
.pet-card-order-btns { display: flex; flex-direction: column; gap: 3px; padding: 0 4px; }
.pet-card-order-btns button { border: none; background: rgba(200,132,74,0.12); color: var(--accent); border-radius: 6px; padding: 4px 8px; font-size: 13px; font-weight: 700; cursor: pointer; line-height: 1; }
.pet-card-order-btns button:disabled { opacity: 0.25; cursor: default; }

/* ========== 気になるメモ ========== */
.pending-note-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; background: var(--white); border-radius: 10px; margin-bottom: 6px; box-shadow: 0 1px 6px rgba(44,36,24,0.07); }
.pending-note-body { flex: 1; min-width: 0; }
.pending-note-text { font-size: 13px; font-weight: 600; color: var(--text-dark); display: block; word-break: break-word; }
.pending-note-meta { font-size: 11px; color: var(--text-light); margin-top: 3px; }
.pending-note-photo { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; margin-top: 6px; display: block; cursor: pointer; }
.pending-note-del { border: none; background: none; color: var(--text-light); font-size: 16px; cursor: pointer; padding: 0; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.pending-note-chip { display: flex; align-items: flex-start; gap: 6px; background: rgba(44,36,24,0.05); border: 1.5px solid rgba(44,36,24,0.1); border-radius: 8px; padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--text-dark); transition: background 0.15s, border-color 0.15s; }
.pending-note-chip.selected { background: rgba(200,132,74,0.12); border-color: var(--accent); color: var(--text-dark); }

/* ========== うちの子のトリセツ ========== */
.torisetsu-row { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px dashed rgba(44,36,24,0.07); }
.torisetsu-row-col { flex-direction: column; gap: 2px; }
.torisetsu-label { font-size: 11px; font-weight: 700; color: var(--text-light); white-space: nowrap; min-width: 80px; }
.torisetsu-val { font-size: 13px; font-weight: 600; color: var(--text-dark); word-break: break-word; }
