:root {
  --cream: #FAF7F2;
  --warm-white: #FFFCF8;
  --sand: #EDE8DF;
  --caramel: #C9A882;
  --brown: #8B6545;
  --dark-brown: #3D2B1F;
  --charcoal: #2A2220;
  --rust: #C4622D;
  --sage: #7A9E8E;
  --sage-light: #B8D4C8;
  --rose: #D4848A;
  --font-jp: 'Zen Kaku Gothic New', sans-serif;
  --font-serif: 'Shippori Mincho', serif;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 16px rgba(61,43,31,0.08);
  --nav-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-jp); background: var(--cream); color: var(--charcoal); font-size: 15px; line-height: 1.7; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ── NAV ── */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(250,247,242,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(139,101,69,0.12); height: var(--nav-h); }
.nav-inner { max-width: 900px; margin: 0 auto; padding: 0 20px; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-family: var(--font-serif); font-size: 20px; font-weight: 600; color: var(--dark-brown); }
.nav-logo span { color: var(--rust); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-icon { color: var(--brown); display: flex; align-items: center; position: relative; padding: 6px; border-radius: 8px; transition: background 0.15s; }
.nav-icon:hover { background: var(--sand); }
.nav-avatar img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--sand); }
.badge-dot { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; background: var(--rust); color: #fff; font-size: 10px; font-weight: 700; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.btn-nav { font-size: 13px; font-weight: 500; color: var(--brown); padding: 7px 16px; border-radius: 100px; border: 1px solid var(--sand); transition: all 0.2s; }
.btn-nav:hover { background: var(--sand); }
.btn-nav-primary { background: var(--dark-brown); color: var(--cream) !important; border-color: var(--dark-brown); }
.btn-nav-primary:hover { background: var(--rust); border-color: var(--rust); }

/* ── CONTAINER ── */
.container { max-width: 900px; margin: 0 auto; padding: 32px 20px; }
.container-sm { max-width: 540px; margin: 0 auto; padding: 48px 20px; }

/* ── CARD ── */
.card { background: var(--warm-white); border-radius: var(--radius); border: 1px solid rgba(139,101,69,0.1); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 16px; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px; border-radius: 100px; font-size: 14px; font-weight: 700; font-family: var(--font-jp); cursor: pointer; border: 1.5px solid transparent; transition: all 0.2s; letter-spacing: 0.03em; }
.btn-primary { background: var(--dark-brown); color: var(--cream); border-color: var(--dark-brown); }
.btn-primary:hover { background: var(--rust); border-color: var(--rust); }
.btn-secondary { background: transparent; color: var(--brown); border-color: var(--sand); }
.btn-secondary:hover { background: var(--sand); }
.btn-danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 16px; font-size: 12px; }

/* ── FORM ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 700; color: var(--brown); margin-bottom: 6px; letter-spacing: 0.04em; }
.form-control { width: 100%; padding: 11px 14px; border: 1.5px solid var(--sand); border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font-jp); background: var(--warm-white); color: var(--charcoal); outline: none; transition: border-color 0.2s; }
.form-control:focus { border-color: var(--caramel); }
.form-control::placeholder { color: var(--caramel); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B6545' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.form-error { color: var(--rust); font-size: 13px; margin-top: 4px; }
.form-hint { color: var(--caramel); font-size: 12px; margin-top: 4px; }
.required { color: var(--rust); }

/* ── PILLS / TAGS ── */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 5px 14px; border-radius: 100px; font-size: 12px; font-weight: 500; border: 1.5px solid var(--sand); color: var(--brown); background: var(--warm-white); cursor: pointer; transition: all 0.2s; }
.pill.active, .pill:hover { background: var(--rust); border-color: var(--rust); color: #fff; }
.pill-health { border-color: #F5C4B3; color: #993C1D; background: #FAECE7; }
.pill-walk  { border-color: var(--sage-light); color: var(--sage-dark); background: #E8F4EE; }
.pill-cafe  { border-color: #FAC775; color: #633806; background: #FAEEDA; }

/* ── USER CARD (検索結果) ── */
.user-card { background: var(--warm-white); border-radius: var(--radius); border: 1px solid rgba(139,101,69,0.1); box-shadow: var(--shadow); padding: 20px; display: flex; gap: 16px; align-items: flex-start; transition: box-shadow 0.2s; }
.user-card:hover { box-shadow: 0 4px 24px rgba(61,43,31,0.13); }
.user-card + .user-card { margin-top: 12px; }
.uc-avatar img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.uc-avatar .avatar-placeholder { width: 56px; height: 56px; border-radius: 14px; background: var(--sand); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.uc-body { flex: 1; min-width: 0; }
.uc-name { font-weight: 700; font-size: 15px; color: var(--dark-brown); }
.uc-area { font-size: 12px; color: var(--caramel); margin-top: 1px; }
.uc-dogs { font-size: 13px; color: var(--brown); margin-top: 6px; }
.uc-tags { margin-top: 8px; }
.uc-action { margin-left: auto; flex-shrink: 0; }

/* ── PROFILE ── */
.profile-header { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.profile-avatar img { width: 80px; height: 80px; border-radius: 20px; object-fit: cover; }
.profile-avatar .avatar-lg { width: 80px; height: 80px; border-radius: 20px; background: var(--sand); display: flex; align-items: center; justify-content: center; font-size: 36px; }
.profile-name { font-family: var(--font-serif); font-size: 22px; font-weight: 600; color: var(--dark-brown); }
.profile-area { font-size: 13px; color: var(--caramel); margin-top: 2px; }
.profile-bio { font-size: 14px; color: var(--brown); margin-top: 8px; line-height: 1.7; }

/* ── DOG CARD ── */
.dog-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--sand); }
.dog-card:last-child { border-bottom: none; }
.dog-photo img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.dog-photo .dog-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--sand); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.dog-name { font-weight: 700; color: var(--dark-brown); }
.dog-meta { font-size: 12px; color: var(--caramel); margin-top: 2px; }
.dog-health-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.health-event { display: flex; gap: 8px; align-items: flex-start; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.dot-rust { background: var(--rust); }
.dot-sage { background: var(--sage); }
.dot-caramel { background: var(--caramel); }
.health-title { font-size: 13px; font-weight: 700; color: var(--dark-brown); }
.health-detail { font-size: 12px; color: var(--brown); }
.health-private { font-size: 11px; color: var(--caramel); font-style: italic; }

/* ── SPOT CARD ── */
.spot-card { background: var(--warm-white); border-radius: var(--radius); border: 1px solid rgba(139,101,69,0.1); box-shadow: var(--shadow); overflow: hidden; }
.spot-photo { height: 160px; background: var(--sand); overflow: hidden; }
.spot-photo img { width: 100%; height: 100%; object-fit: cover; }
.spot-body { padding: 16px; }
.spot-cat { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--rust); text-transform: uppercase; margin-bottom: 4px; }
.spot-name { font-weight: 700; font-size: 15px; color: var(--dark-brown); }
.spot-area { font-size: 12px; color: var(--caramel); }
.spot-review { font-size: 13px; color: var(--brown); margin-top: 8px; line-height: 1.7; }
.spot-chihuahua-note { background: #FAECE7; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px; color: #993C1D; margin-top: 8px; line-height: 1.6; }

/* ── MESSAGE ── */
.msg-thread { display: flex; flex-direction: column; gap: 12px; }
.msg-bubble { max-width: 72%; }
.msg-bubble.mine { align-self: flex-end; }
.msg-bubble.theirs { align-self: flex-start; }
.msg-text { padding: 10px 16px; border-radius: 18px; font-size: 14px; line-height: 1.6; }
.msg-bubble.mine .msg-text { background: var(--dark-brown); color: var(--cream); border-bottom-right-radius: 4px; }
.msg-bubble.theirs .msg-text { background: var(--warm-white); border: 1px solid var(--sand); border-bottom-left-radius: 4px; }
.msg-time { font-size: 11px; color: var(--caramel); margin-top: 3px; text-align: right; }
.msg-bubble.theirs .msg-time { text-align: left; }

/* ── ALERTS ── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-error   { background: #FCEBEB; color: #791F1F; border: 1px solid #F09595; }
.alert-success { background: #E1F5EE; color: #085041; border: 1px solid #5DCAA5; }
.alert-info    { background: #EDE8DF; color: var(--brown); border: 1px solid var(--caramel); }

/* ── SECTION TITLE ── */
.sec-label { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; color: var(--rust); text-transform: uppercase; margin-bottom: 10px; }
.sec-title { font-family: var(--font-serif); font-size: 22px; font-weight: 600; color: var(--dark-brown); margin-bottom: 20px; line-height: 1.5; }

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }

/* ── TABS ── */
.tabs { display: flex; gap: 2px; border-bottom: 1.5px solid var(--sand); margin-bottom: 24px; }
.tab { padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--brown); border-bottom: 2px solid transparent; margin-bottom: -1.5px; cursor: pointer; transition: all 0.2s; }
.tab.active { color: var(--rust); border-bottom-color: var(--rust); }

/* ── FOOTER ── */
.footer { background: var(--charcoal); color: var(--caramel); padding: 40px 20px; margin-top: 60px; }
.footer-inner { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.footer-logo { font-family: var(--font-serif); font-size: 20px; font-weight: 600; color: var(--cream); }
.footer-logo span { color: var(--rust); }
.footer-links { display: flex; gap: 20px; list-style: none; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-size: 12px; transition: color 0.2s; }
.footer-links a:hover { color: var(--cream); }
.footer-copy { font-size: 12px; opacity: 0.7; }

/* ── FLASH TOAST ── */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--dark-brown); color: var(--cream); padding: 12px 24px; border-radius: 100px; font-size: 14px; font-weight: 500; z-index: 999; box-shadow: 0 4px 20px rgba(0,0,0,0.2); animation: toast-in 0.3s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .container { padding: 20px 16px; }
  .profile-header { flex-direction: column; }
  .uc-action { margin-left: 0; }
  .user-card { flex-wrap: wrap; }
}
