:root {
  --bg: #fff8ef;
  --card: #ffffff;
  --ink: #2f2925;
  --muted: #766d66;
  --accent: #ed805f;
  --accent-dark: #d96647;
  --blue: #dceff4;
  --line: #eee2d7;
  --shadow: 0 12px 35px rgba(83, 55, 38, .10);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.center-card { width: min(420px, calc(100% - 32px)); margin: 9vh auto; padding: 32px 24px; text-align: center; background: var(--card); border-radius: 28px; box-shadow: var(--shadow); }
.brand-mark, .paw { font-size: 52px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 28px; }
h2 { margin-bottom: 18px; font-size: 22px; }
.muted { color: var(--muted); line-height: 1.6; }
.stack, .event-form { display: grid; gap: 16px; text-align: left; }
label { display: grid; gap: 7px; font-size: 14px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 13px 14px; color: var(--ink); background: #fff; border: 1px solid #d9cec4; border-radius: 13px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(237,128,95,.15); }
.primary { padding: 14px 18px; border: 0; border-radius: 14px; color: white; background: var(--accent); font-weight: 800; box-shadow: 0 6px 15px rgba(237,128,95,.25); }
.primary:active { transform: translateY(1px); background: var(--accent-dark); }
.danger-button { padding: 13px 18px; color: #b43b32; background: #fff; border: 1px solid #e9aaa4; border-radius: 14px; font-weight: 800; }
.danger-button:active { background: #fff0ee; }
.danger-button:disabled { cursor: wait; opacity: .55; }
.text-button, .icon-button { border: 0; color: var(--accent-dark); background: transparent; font-weight: 700; }
.text-button { padding: 12px; }
.icon-button { width: 42px; height: 42px; font-size: 22px; border-radius: 50%; background: #fff; }
.message { min-height: 22px; margin: 14px 0 0; color: var(--accent-dark); font-size: 14px; }
#main-view { min-height: 100dvh; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
.app-header { position: sticky; z-index: 5; top: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 18px 13px; background: rgba(255,248,239,.92); backdrop-filter: blur(16px); }
.app-header h1 { margin: 0; font-size: 23px; }
.eyebrow { margin-bottom: 3px; color: var(--accent-dark); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.page { display: none; max-width: 680px; margin: 0 auto; }
.page.active { display: block; }
.hero-card { margin: 8px 14px 20px; padding: 22px 18px; background: var(--card); border-radius: 25px; box-shadow: var(--shadow); }
.date-label { margin-bottom: 5px; color: var(--muted); font-size: 13px; font-weight: 700; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.quick { min-height: 76px; padding: 10px 6px; border: 0; border-radius: 17px; color: #3c3530; font-size: 14px; font-weight: 900; box-shadow: inset 0 -2px rgba(0,0,0,.05); }
.quick span { display: block; margin-bottom: 5px; font-size: 25px; }
.food { background: #ffe4b8; }
.water { background: var(--blue); }
.walk { background: #dff0d4; }
.wide { grid-column: 1 / -1; }
.section-block { margin: 0 14px; padding: 18px; background: var(--card); border-radius: 24px; box-shadow: var(--shadow); }
.top-space { margin-top: 8px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading h2 { margin: 0; }
.date-picker { margin-bottom: 18px; }
.log-list { display: grid; gap: 10px; }
.empty { padding: 30px 10px; text-align: center; color: var(--muted); }
.log-card { display: grid; grid-template-columns: 45px 1fr auto; gap: 11px; align-items: center; width: 100%; padding: 13px 8px; text-align: left; color: inherit; background: #fff; border: 0; border-bottom: 1px solid var(--line); }
.log-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; background: var(--bg); font-size: 22px; }
.log-card strong { display: block; margin-bottom: 3px; }
.log-card small { color: var(--muted); }
.person { color: var(--accent-dark); font-size: 12px; font-weight: 800; }
.bottom-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.95); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.nav-button { padding: 6px; color: var(--muted); background: transparent; border: 0; font-size: 11px; font-weight: 800; }
.nav-button span { display: block; margin-bottom: 2px; font-size: 21px; }
.nav-button.active { color: var(--accent-dark); }
dialog { width: min(520px, calc(100% - 24px)); max-height: 88dvh; padding: 24px; color: var(--ink); background: var(--card); border: 0; border-radius: 24px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(39,31,27,.55); backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--bg); font-size: 24px; }
.detail-photo { width: 100%; max-height: 320px; margin: 12px 0; object-fit: contain; background: var(--bg); border-radius: 16px; }
.detail-row { padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-row dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.detail-row dd { margin: 4px 0 0; white-space: pre-wrap; }
.detail-edit { display: grid; gap: 13px; margin-top: 18px; }
.pet-profile-card { text-align: center; }
.pet-avatar { display: grid; width: 92px; height: 92px; margin: 4px auto 14px; place-items: center; background: #dff0d4; border-radius: 50%; font-size: 49px; }
.pet-facts { margin: 0 0 22px; text-align: left; }
.pet-facts div { display: grid; grid-template-columns: 90px 1fr; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.pet-facts dt { color: var(--muted); font-size: 13px; font-weight: 800; }
.pet-facts dd { margin: 0; font-weight: 700; }
.vaccine-form { padding-top: 8px; text-align: left; }
.vaccine-form h3 { margin: 0; font-size: 17px; }
.toast { position: fixed; z-index: 30; right: 20px; bottom: 95px; left: 20px; max-width: 420px; margin: auto; padding: 13px 17px; text-align: center; color: white; background: #3d3935; border-radius: 14px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (min-width: 720px) { .bottom-nav { right: 50%; left: auto; width: 680px; transform: translateX(50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; } }
