:root{
  --bg:#f4f2ec;
  --surface:#ffffff;
  --surface-soft:#f8f7f3;
  --ink:#24303a;
  --muted:#6d767d;
  --line:#e4e1da;
  --brand:#28435a;
  --brand-2:#3e5e50;
  --danger:#9e4545;
  --radius:22px;
  --shadow:0 10px 35px rgba(30,38,44,.07);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;background:var(--bg);color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic",sans-serif;
  line-height:1.65;
}
a{color:inherit}
.shell{max-width:960px;margin:0 auto;padding:28px 22px 64px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:42px}
.brand{text-decoration:none;font-weight:800;letter-spacing:.04em}
.brand small{display:block;font-size:11px;color:var(--muted);font-weight:600;letter-spacing:.12em}
.nav{display:flex;gap:10px;flex-wrap:wrap}
.nav a{text-decoration:none;color:var(--muted);padding:8px 11px;border-radius:999px}
.nav a:hover{background:rgba(255,255,255,.72);color:var(--ink)}
.hero{margin-bottom:28px}
.eyebrow{font-size:12px;letter-spacing:.14em;font-weight:800;color:var(--muted);text-transform:uppercase}
h1{font-size:clamp(32px,6vw,52px);line-height:1.16;margin:8px 0 12px;letter-spacing:-.03em}
h2{font-size:24px;line-height:1.35;margin:0 0 14px}
.lead{font-size:17px;color:var(--muted);max-width:720px}
.card{background:var(--surface);border:1px solid rgba(228,225,218,.9);border-radius:var(--radius);box-shadow:var(--shadow);padding:26px}
.stack{display:grid;gap:16px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:16px}
.click-card{display:block;text-decoration:none;transition:.16s ease;cursor:pointer}
.click-card:hover{background:#f1f5f3;border-color:#d8e1dc;transform:translateY(-2px);box-shadow:0 14px 36px rgba(30,38,44,.10)}
.click-card:focus-visible{outline:3px solid #a8bbc9;outline-offset:3px}
.meta{color:var(--muted);font-size:14px}
.title{font-size:22px;font-weight:800;line-height:1.35}
.actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border:0;border-radius:999px;padding:11px 17px;text-decoration:none;
  font:inherit;font-weight:700;cursor:pointer;background:var(--brand);color:#fff;
}
.btn:hover{filter:brightness(.96)}
.btn.secondary{background:#fff;color:var(--ink);border:1px solid var(--line)}
.btn.ghost{background:transparent;color:var(--brand);padding-left:0;padding-right:0}
.btn.danger{background:#fff;color:var(--danger);border:1px solid #e6caca}
.form-card{max-width:760px}
.field{margin:20px 0}
label.field-label{display:block;font-weight:800;margin-bottom:7px}
input,select,textarea{
  width:100%;border:1px solid #d8d5ce;background:#fff;border-radius:13px;
  padding:13px 14px;font:inherit;color:var(--ink);outline:none;
}
input:focus,select:focus,textarea:focus{border-color:#8da1af;box-shadow:0 0 0 3px rgba(86,112,130,.12)}
textarea{min-height:140px;resize:vertical}
.help{font-size:13px;color:var(--muted);margin-top:6px}
.notice{padding:12px 15px;border-radius:13px;background:#eef3ef;color:#365448;margin-bottom:18px}
.divider{height:1px;background:var(--line);margin:26px 0}
.pill{display:inline-block;border-radius:999px;padding:5px 10px;background:#eef1f2;color:#5d6970;font-size:13px}
.memory{white-space:pre-wrap;font-size:18px;line-height:1.9}
.fact-list{display:grid;gap:12px}
.fact{display:grid;grid-template-columns:minmax(190px,.9fr) 1.1fr;gap:18px;padding:14px 0;border-bottom:1px solid var(--line)}
.fact:last-child{border-bottom:0}
.fact-q{color:var(--muted)}
.fact-a{font-weight:800}
.danger-zone{margin-top:34px;padding-top:22px;border-top:1px solid #ead3d3}
.inline-form{display:inline}
.spot-picker{position:relative}
.spot-results{
  margin-top:8px;border:1px solid var(--line);border-radius:14px;background:#fff;
  max-height:320px;overflow:auto;box-shadow:var(--shadow);display:none
}
.spot-results.open{display:block}
.spot-option{
  display:block;width:100%;border:0;border-bottom:1px solid var(--line);
  background:#fff;color:var(--ink);text-align:left;padding:12px 14px;font:inherit;cursor:pointer
}
.spot-option:hover{background:#f1f5f3}
.spot-option:last-child{border-bottom:0}
.spot-area{font-size:12px;color:var(--muted);margin-right:6px}
.spot-search-wrap{position:relative}
.spot-clear{
  position:absolute;right:9px;top:50%;transform:translateY(-50%);
  width:30px;height:30px;border:0;border-radius:50%;background:#edf0ef;color:#5d666c;
  display:none;padding:0;cursor:pointer
}
.selected-spot{display:none;margin-top:8px;padding:9px 12px;border-radius:11px;background:#eff3f1;font-size:14px}
.selected-spot.show{display:block}
.option-row{display:flex;flex-wrap:wrap;gap:9px}
.option input{position:absolute;opacity:0;pointer-events:none}
.option span{display:inline-block;padding:10px 14px;border:1px solid var(--line);border-radius:999px;background:#fff;cursor:pointer}
.option input:checked + span{background:var(--brand);border-color:var(--brand);color:#fff}
.question{padding:20px 0;border-top:1px solid var(--line)}
.question:first-child{border-top:0}
.question-title{font-weight:800;font-size:17px;margin-bottom:7px}
@media(max-width:640px){
  .shell{padding-top:20px}
  .topbar{align-items:flex-start;flex-direction:column;margin-bottom:30px}
  .fact{grid-template-columns:1fr;gap:4px}
  .card{padding:20px;border-radius:18px}
}

/* v0.6.0 Dog Home */
.dog-profile{padding:30px}
.dog-profile-main{display:flex;justify-content:space-between;align-items:flex-start;gap:24px}
.dog-summary{font-size:17px;color:var(--muted)}
.dog-dates{display:flex;gap:18px;flex-wrap:wrap;margin-top:13px;color:var(--muted);font-size:14px}
.dog-dates strong{color:var(--ink);margin-right:4px}
.inline-edit-panel{margin-top:26px;padding-top:24px;border-top:1px solid var(--line)}
.compact-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.compact-grid .field{margin:4px 0 12px}
.dog-stats{display:grid;grid-template-columns:repeat(2,minmax(0,190px));gap:14px;margin-top:18px}
.stat-card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:18px 20px;box-shadow:var(--shadow)}
.stat-card strong{display:block;font-size:38px;line-height:1;font-weight:850;letter-spacing:-.04em}
.stat-card span{display:block;font-size:12px;font-weight:850;letter-spacing:.13em;color:var(--brand);margin-top:8px}
.stat-card small{display:block;color:var(--muted);margin-top:2px}
.section-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:18px;margin-bottom:18px}
.timeline-memory{font-size:15px;margin-top:8px;color:var(--muted)}
@media(max-width:640px){
 .dog-profile-main,.section-heading{align-items:flex-start;flex-direction:column}
 .dog-stats{grid-template-columns:1fr 1fr}
 .compact-grid{grid-template-columns:1fr}
 .stat-card strong{font-size:32px}
}

/* v0.6.1 Timeline refinement + edit semantics */
.visit-context{
  display:grid;grid-template-columns:1fr 1fr;gap:12px;
  padding:16px;border-radius:16px;background:var(--surface-soft);border:1px solid var(--line);margin-bottom:22px
}
.visit-context-item{display:flex;flex-direction:column;gap:3px}
.meta-label{font-size:11px;font-weight:850;letter-spacing:.12em;color:var(--muted);text-transform:uppercase}
.detail-heading{align-items:center;margin-bottom:12px}
.detail-heading h2{margin:0}
.section-edit{
  display:inline-flex;align-items:center;justify-content:center;text-decoration:none;
  border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 13px;
  font-size:14px;font-weight:800;color:var(--ink)
}
.section-edit:hover{background:#f1f5f3}

@media(min-width:801px){
  body.dog-home-page{overflow:hidden}
  .dog-home-shell{
    height:100vh;max-width:960px;padding-top:18px;padding-bottom:18px;
    display:flex;flex-direction:column;overflow:hidden
  }
  .dog-home-topbar{margin-bottom:18px;flex:0 0 auto}
  .dog-home-fixed{flex:0 0 auto}
  .dog-home-fixed .dog-profile{padding:24px 26px}
  .dog-home-fixed .dog-profile h1{font-size:38px}
  .dog-home-fixed .dog-stats{margin-top:12px}
  .dog-home-fixed .stat-card{padding:13px 17px;border-radius:16px}
  .dog-home-fixed .stat-card strong{font-size:31px}
  .dog-home-fixed .stat-card span{margin-top:5px}
  .dog-home-fixed .stat-card small{font-size:12px}
  .dog-timeline-section{
    flex:1 1 auto;min-height:0;display:flex;flex-direction:column;margin-top:22px
  }
  .dog-timeline-heading{flex:0 0 auto;margin-bottom:10px;align-items:center}
  .dog-timeline-heading h2{margin-bottom:0}
  .timeline-scroll{
    flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;
    padding:2px 8px 20px 2px;scrollbar-gutter:stable
  }
}
.timeline-year{margin-bottom:22px}
.timeline-year-label{
  font-size:22px;font-weight:850;letter-spacing:-.02em;margin:5px 0 8px;color:var(--ink)
}
.timeline-month{display:grid;grid-template-columns:70px minmax(0,1fr);gap:12px;margin-bottom:16px}
.timeline-month-label{padding-top:9px;color:var(--brand);font-size:14px}
.timeline-list{display:grid;gap:7px}
.timeline-row{
  display:grid;grid-template-columns:52px minmax(0,1fr) 18px;gap:12px;align-items:center;
  min-height:64px;padding:10px 14px;background:var(--surface);border:1px solid var(--line);
  border-radius:15px;box-shadow:0 5px 18px rgba(30,38,44,.045)
}
.timeline-row:hover{background:#f3f6f4;border-color:#d8e1dc;transform:translateY(-1px);box-shadow:0 7px 20px rgba(30,38,44,.075)}
.timeline-date{display:flex;align-items:baseline;gap:2px;color:var(--muted);border-right:1px solid var(--line)}
.timeline-date strong{font-size:22px;line-height:1;color:var(--ink)}
.timeline-date span{font-size:11px}
.timeline-title{font-size:16px;font-weight:850;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.timeline-memory{font-size:13px;margin-top:3px;line-height:1.45;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.timeline-arrow{font-size:23px;color:#a0a8ad;line-height:1}

@media(max-width:800px){
  body.dog-home-page{overflow:auto}
  .dog-home-shell{height:auto;display:block;overflow:visible}
  .dog-timeline-section{margin-top:30px}
  .timeline-scroll{overflow:visible}
  .timeline-month{grid-template-columns:46px minmax(0,1fr);gap:8px}
  .timeline-row{grid-template-columns:43px minmax(0,1fr) 14px;padding:10px 11px}
  .timeline-title{font-size:15px}
}
@media(max-width:640px){
  .visit-context{grid-template-columns:1fr}
}

/* v0.6.2 Compact Dog Home + map-first Visit creation */
.dog-profile-compact{padding:20px 24px}
.dog-profile-compact h1{font-size:34px;margin:4px 0 6px}
.dog-profile-copy{min-width:0}
.dog-profile-line{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  color:var(--muted);font-size:13px
}
.dog-profile-line strong{color:var(--ink);font-weight:700}
.profile-separator{color:#b7bbb9}
.dog-profile-side{display:flex;align-items:center;gap:14px}
.dog-mini-stats{display:flex;gap:8px}
.mini-stat{
  min-width:74px;padding:9px 11px;border-radius:14px;background:var(--surface-soft);
  border:1px solid var(--line);text-align:left
}
.mini-stat strong{display:block;font-size:26px;line-height:1;font-weight:850;letter-spacing:-.04em}
.mini-stat span{display:block;margin-top:5px;font-size:10px;font-weight:850;letter-spacing:.12em;color:var(--brand)}
.compact-edit{padding:9px 14px}
.selected-map-spot{
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  padding:15px 16px;border-radius:16px;background:#eff3f1;border:1px solid #dce5df
}
.selected-map-spot strong{display:block;margin-top:3px;font-size:17px}
.map-select-empty{
  padding:20px;border-radius:16px;background:var(--surface-soft);border:1px dashed #cfd3ce
}
.map-select-empty p{margin:0 0 12px;color:var(--muted)}
@media(min-width:801px){
  .dog-home-fixed .dog-profile{padding:18px 22px}
  .dog-home-fixed .dog-profile h1{font-size:32px}
  .dog-timeline-section{margin-top:14px}
  .dog-timeline-heading{margin-bottom:8px}
}
@media(max-width:800px){
  .dog-profile-side{width:100%;justify-content:space-between}
}
@media(max-width:640px){
  .dog-profile-compact{padding:18px}
  .dog-profile-side{align-items:flex-end;flex-direction:column}
  .dog-mini-stats{width:100%}
  .mini-stat{flex:1}
  .selected-map-spot{align-items:flex-start;flex-direction:column}
}

/* v0.6.3 Dog photo design prototype (local bundled asset) */
.dog-profile-identity{
  display:flex;
  align-items:center;
  gap:18px;
  min-width:0;
}
.dog-avatar-wrap{
  width:92px;
  height:92px;
  flex:0 0 92px;
  border-radius:24px;
  overflow:hidden;
  background:var(--surface-soft);
  border:1px solid var(--line);
  box-shadow:0 5px 18px rgba(30,38,44,.06);
}
.dog-avatar{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
@media(min-width:801px){
  .dog-profile-compact{padding:16px 20px}
  .dog-avatar-wrap{width:78px;height:78px;flex-basis:78px;border-radius:20px}
  .dog-profile-compact h1{font-size:30px}
}
@media(max-width:640px){
  .dog-profile-identity{align-items:flex-start}
  .dog-avatar-wrap{width:76px;height:76px;flex-basis:76px;border-radius:18px}
}

/* v0.6.4 regression fix: profile edit button must never wrap */
.dog-profile-side{flex-shrink:0}
.compact-edit{
  white-space:nowrap;
  flex-shrink:0;
  min-width:64px;
  writing-mode:horizontal-tb;
}

/* v0.6.7 navigation cleanup */
.back-nav-link{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:8px 10px;
  border-radius:10px;
  font-weight:750;
  text-decoration:none;
  white-space:nowrap;
}
.back-nav-link:hover{
  background:var(--surface-soft);
  text-decoration:none;
}
.back-nav-link:focus-visible{
  outline:2px solid currentColor;
  outline-offset:2px;
}

/* v0.6.9 Visit personal revisit intention */
.revisit-field .help{margin:5px 0 12px}
.revisit-scale{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.revisit-option{cursor:pointer;min-width:0}
.revisit-option input{position:absolute;opacity:0;pointer-events:none}
.revisit-option span{
  min-height:74px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
  padding:10px 7px;border:1px solid var(--line);border-radius:15px;background:#fff;text-align:center;
  transition:.15s ease
}
.revisit-option strong{font-size:20px;line-height:1;color:var(--ink)}
.revisit-option small{font-size:11px;line-height:1.3;color:var(--muted);font-weight:700}
.revisit-option:hover span{background:var(--surface-soft);border-color:#bccbc2}
.revisit-option input:checked + span{background:#e8f2ec;border-color:var(--brand);box-shadow:inset 0 0 0 1px var(--brand)}
.revisit-option input:checked + span strong,.revisit-option input:checked + span small{color:var(--brand)}
.revisit-option input:focus-visible + span{outline:2px solid var(--brand);outline-offset:2px}
.revisit-clear{display:inline-flex;align-items:center;gap:6px;margin-top:9px;font-size:12px;color:var(--muted);cursor:pointer}
.revisit-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:4px 0 2px}
.revisit-summary strong{font-size:15px;color:var(--brand)}
@media(max-width:640px){
  .revisit-scale{grid-template-columns:repeat(5,1fr);gap:5px}
  .revisit-option span{min-height:64px;padding:8px 3px;border-radius:12px}
  .revisit-option strong{font-size:18px}
  .revisit-option small{font-size:9px}
  .revisit-summary{align-items:flex-start;flex-direction:column;gap:5px}
}

/* v0.7.0 Account / Google authentication */
.auth-card{max-width:620px;margin:72px auto;padding:42px;background:var(--surface);border:1px solid var(--line);border-radius:24px;box-shadow:0 12px 34px rgba(30,38,44,.08);text-align:center}
.auth-card h1{margin:8px 0 12px}.google-login{display:inline-flex;margin-top:18px;min-width:220px;justify-content:center}.auth-note{margin-top:18px}


/* v0.7.2 My Dogs logout entry point */
.logout-form{margin:0}
.logout-button{
  appearance:none;border:0;background:transparent;color:var(--muted);
  padding:8px 10px;border-radius:10px;font:inherit;font-size:14px;font-weight:750;
  cursor:pointer;white-space:nowrap
}
.logout-button:hover{background:var(--surface-soft);color:var(--ink)}
.logout-button:focus-visible{outline:2px solid var(--brand);outline-offset:2px}


/* v0.8.0 STEP 9.2 - Dog profile photo focal-point editor */
.profile-crop-editor{
  margin-top:12px;display:grid;grid-template-columns:220px minmax(0,1fr);gap:14px 18px;
  align-items:center;padding:14px;border:1px solid var(--line);border-radius:18px;background:var(--surface-soft)
}
.profile-crop-frame{
  position:relative;width:220px;aspect-ratio:1/1;overflow:hidden;border-radius:22px;
  background:#e9eeeb;border:1px solid #d5ddd8;cursor:grab;touch-action:none;user-select:none;
  box-shadow:0 6px 20px rgba(30,38,44,.07)
}
.profile-crop-frame.is-dragging{cursor:grabbing}
.profile-crop-image{width:100%;height:100%;display:block;object-fit:cover;pointer-events:none;-webkit-user-drag:none}
.profile-crop-guide{
  position:absolute;inset:0;pointer-events:none;border-radius:22px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.72),inset 0 0 0 999px rgba(255,255,255,.015)
}
.profile-crop-guide::before,.profile-crop-guide::after{content:'';position:absolute;background:rgba(255,255,255,.55)}
.profile-crop-guide::before{left:50%;top:12%;bottom:12%;width:1px}
.profile-crop-guide::after{top:50%;left:12%;right:12%;height:1px}
.profile-crop-copy{display:flex;flex-direction:column;gap:6px;color:var(--muted);line-height:1.55}
.profile-crop-copy strong{font-size:15px;color:var(--ink)}
.profile-crop-copy span{font-size:13px}
.profile-crop-reset{
  grid-column:2;justify-self:start;appearance:none;border:0;background:transparent;color:var(--brand);
  padding:5px 0;font:inherit;font-size:12px;font-weight:800;cursor:pointer
}
.profile-crop-reset:hover{text-decoration:underline}
.profile-crop-editor.is-empty .profile-crop-frame{cursor:default}
@media(max-width:640px){
  .profile-crop-editor{grid-template-columns:1fr;padding:12px}
  .profile-crop-frame{width:min(100%,300px);justify-self:center;border-radius:24px}
  .profile-crop-guide{border-radius:24px}
  .profile-crop-reset{grid-column:1}
}


/* v0.8.0 STEP 9.2.1 - allow full-page scrolling while Dog edit is open */
@media(min-width:801px){
  body.dog-home-page.dog-edit-mode{overflow:auto}
  body.dog-home-page.dog-edit-mode .dog-home-shell{
    height:auto;
    min-height:100vh;
    display:block;
    overflow:visible;
  }
  body.dog-home-page.dog-edit-mode .dog-home-fixed{overflow:visible}
  body.dog-home-page.dog-edit-mode .dog-timeline-section{
    display:block;
    margin-top:22px;
  }
  body.dog-home-page.dog-edit-mode .timeline-scroll{
    overflow:visible;
    padding-bottom:32px;
  }

  /* Keep the crop editor comfortable on laptop-height screens. */
  body.dog-home-page.dog-edit-mode .profile-crop-editor{
    grid-template-columns:180px minmax(0,1fr);
  }
  body.dog-home-page.dog-edit-mode .profile-crop-frame{
    width:180px;
    border-radius:20px;
  }
  body.dog-home-page.dog-edit-mode .profile-crop-guide{
    border-radius:20px;
  }
}


/* v0.8.0 STEP 9.3 - zoomable Dog profile crop + My Dogs avatar */
.dog-avatar,
.dog-list-avatar img{
  will-change:transform;
}

.profile-zoom-label{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:8px;
  color:var(--ink);
  font-size:13px;
  font-weight:800;
}
.profile-zoom-label strong{font-size:13px;color:var(--brand)}
.profile-zoom-range{
  width:100%;
  padding:0;
  border:0;
  border-radius:0;
  box-shadow:none;
  accent-color:var(--brand);
}
.profile-zoom-range:focus{box-shadow:none}

.dog-list-card{
  display:flex;
  align-items:center;
  gap:18px;
}
.dog-list-avatar{
  width:72px;
  height:72px;
  flex:0 0 72px;
  overflow:hidden;
  border-radius:20px;
  background:var(--surface-soft);
  border:1px solid var(--line);
  box-shadow:0 5px 18px rgba(30,38,44,.06);
}
.dog-list-avatar img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.dog-list-copy{min-width:0}

@media(max-width:640px){
  .dog-list-card{gap:14px}
  .dog-list-avatar{width:64px;height:64px;flex-basis:64px;border-radius:18px}
  .dog-list-card .title{font-size:20px}
}


/* v0.8.1 - Visit Photos */
.visit-photo-field input[type="file"]{
  width:100%;
}
.visit-existing-photos{
  margin-top:16px;
}
.visit-photo-mini-grid{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:8px;
}
.visit-photo-mini-grid img{
  width:76px;
  height:76px;
  object-fit:cover;
  border-radius:16px;
  border:1px solid var(--line);
}

.visit-photo-section{
  margin-top:28px;
}
.visit-photo-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.visit-photo-card{
  position:relative;
  overflow:hidden;
  border-radius:22px;
  background:var(--surface-soft);
  border:1px solid var(--line);
  aspect-ratio:4/3;
  box-shadow:0 8px 24px rgba(30,38,44,.06);
}
.visit-photo-link,
.visit-photo-link img{
  display:block;
  width:100%;
  height:100%;
}
.visit-photo-link img{
  object-fit:cover;
}
.visit-photo-delete{
  position:absolute;
  top:10px;
  right:10px;
  margin:0;
}
.visit-photo-delete button{
  width:34px;
  height:34px;
  border:0;
  border-radius:999px;
  background:rgba(20,30,38,.78);
  color:#fff;
  font-size:22px;
  line-height:1;
  cursor:pointer;
  box-shadow:0 4px 16px rgba(0,0,0,.18);
}
.visit-photo-delete button:hover{
  background:rgba(20,30,38,.95);
}

@media(max-width:800px){
  .visit-photo-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .visit-photo-card{
    border-radius:18px;
  }
}


/* v0.8.1 - Visit photo limit UX */
.visit-photo-capacity{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:6px 10px;
  margin:10px 0 12px;
  padding:11px 14px;
  border-radius:14px;
  background:rgba(39,82,109,.07);
  color:var(--ink);
  font-size:13px;
}
.visit-photo-capacity strong{
  color:var(--brand);
}
.visit-photo-capacity.is-full{
  background:rgba(145,87,58,.08);
}
.visit-photo-capacity.is-full strong{
  color:#8f4f35;
}
.visit-photo-input:disabled{
  opacity:.52;
  cursor:not-allowed;
}
.visit-photo-error{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  background:#fff1ef;
  border:1px solid #efc1bb;
  color:#a53c30;
  font-size:13px;
  font-weight:700;
}


/* v0.8.2 - Inline Visit photo management */
.visit-photo-section,
.visit-photo-section *{
  box-sizing:border-box;
}
.visit-photo-section{
  width:100%;
  max-width:100%;
  overflow:hidden;
}
.visit-photo-detail-count{
  flex:0 0 auto;
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}
.visit-photo-detail-grid{
  width:100%;
  min-width:0;
}
.visit-photo-inline-add{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-width:0;
  aspect-ratio:4/3;
  border:1.5px dashed rgba(39,82,109,.36);
  border-radius:22px;
  background:rgba(39,82,109,.045);
  color:var(--brand);
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}
.visit-photo-inline-add:hover{
  background:rgba(39,82,109,.08);
  border-color:rgba(39,82,109,.58);
  transform:translateY(-1px);
}
.visit-photo-inline-add.is-disabled{
  opacity:.48;
  cursor:not-allowed;
  pointer-events:none;
}
.visit-photo-inline-add input{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.visit-photo-inline-plus{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border-radius:999px;
  background:var(--brand);
  color:#fff;
  font-size:28px;
  line-height:1;
}
.visit-photo-inline-add strong{font-size:14px}
.visit-photo-inline-add small{color:var(--muted);font-size:12px}
.visit-photo-inline-form{
  width:100%;
  min-width:0;
  margin-top:18px;
  padding:18px;
  border:1px solid var(--line);
  border-radius:22px;
  background:var(--surface-soft);
}
.visit-photo-inline-form[hidden]{display:none}
.visit-photo-pending-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
  font-size:13px;
}
.visit-photo-pending-head span{
  color:var(--muted);
  font-weight:700;
}
.visit-photo-pending-card > img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.visit-photo-pending-badge{
  position:absolute;
  left:10px;
  bottom:10px;
  padding:6px 9px;
  border-radius:999px;
  background:rgba(39,82,109,.88);
  color:#fff;
  font-size:11px;
  font-weight:800;
}
.visit-photo-inline-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:16px;
}
@media(max-width:800px){
  .visit-photo-inline-add{border-radius:18px}
}


/* v0.8.5 - Visibility cues for private Dogs / Visits */
.click-card.is-private{
  background:#f1f1ee;
  border-color:#d9d9d4;
}
.click-card.is-private:hover{
  background:#ecece8;
}
.privacy-badge{
  display:inline-flex;
  align-items:center;
  flex:0 0 auto;
  padding:4px 8px;
  border-radius:999px;
  background:#deded9;
  color:#5f666b;
  font-size:11px;
  font-weight:800;
  line-height:1.2;
  white-space:nowrap;
}
.timeline-title-line,
.dog-list-title-line{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
}
.timeline-title-line .timeline-title,
.dog-list-title-line .title{
  min-width:0;
}
@media(max-width:640px){
  .timeline-title-line,
  .dog-list-title-line{
    align-items:flex-start;
    flex-wrap:wrap;
    gap:6px 8px;
  }
}


/* v0.8.6 - Create Visit photo UI + horizontal overflow fix */
html,
body{
  max-width:100%;
  overflow-x:hidden;
}
.shell,
.form-card,
.form-card form,
.field,
.visit-create-photo-field,
.visit-create-photo-grid{
  min-width:0;
  max-width:100%;
}
.form-card{
  width:100%;
}
.visit-create-photo-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  min-width:0;
}
.visit-create-photo-head > div{
  min-width:0;
}
.visit-create-photo-count{
  flex:0 0 auto;
  color:var(--muted);
  font-size:13px;
  padding-top:2px;
  white-space:nowrap;
}
.visit-create-photo-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  width:100%;
  margin-top:14px;
}
.visit-create-photo-preview{
  position:relative;
  min-width:0;
  aspect-ratio:4/3;
  overflow:hidden;
  border-radius:18px;
  border:1px solid var(--line);
  background:var(--surface-soft);
}
.visit-create-photo-preview img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.visit-create-photo-grid .visit-photo-inline-add{
  min-width:0;
  width:100%;
  aspect-ratio:4/3;
}
.visit-create-photo-grid .visit-photo-inline-add[hidden]{
  display:none;
}
.visit-create-photo-summary{
  margin-top:10px;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}
.visit-create-photo-summary[hidden]{
  display:none;
}

/* Prevent long content / native controls from widening the Visit form. */
.form-card input,
.form-card select,
.form-card textarea,
.selected-map-spot,
.visit-context,
.revisit-scale{
  min-width:0;
  max-width:100%;
}
.selected-map-spot strong,
.visit-context strong{
  overflow-wrap:anywhere;
}

@media(max-width:640px){
  .visit-create-photo-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .visit-create-photo-head{
    align-items:center;
  }
  .visit-create-photo-preview,
  .visit-create-photo-grid .visit-photo-inline-add{
    border-radius:16px;
  }
}


/* v0.8.7 - Stateful Visit photo selection (create + edit + detail) */
.visit-form-photo-field,
.visit-form-photo-grid{
  min-width:0;
  max-width:100%;
}
.visit-form-photo-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}
.visit-form-photo-count{
  flex:0 0 auto;
  color:var(--muted);
  font-size:13px;
  white-space:nowrap;
}
.visit-form-photo-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
.visit-form-photo-existing,
.visit-form-photo-pending{
  position:relative;
  min-width:0;
  aspect-ratio:4/3;
  overflow:hidden;
  border-radius:18px;
  border:1px solid var(--line);
  background:var(--surface-soft);
}
.visit-form-photo-existing img,
.visit-form-photo-pending img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.visit-form-photo-remove,
.visit-photo-pending-remove{
  position:absolute;
  top:9px;
  right:9px;
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  padding:0;
  border:0;
  border-radius:999px;
  background:rgba(20,30,38,.82);
  color:#fff;
  font-size:20px;
  line-height:1;
  cursor:pointer;
  box-shadow:0 4px 14px rgba(0,0,0,.18);
}
.visit-form-photo-remove:hover,
.visit-photo-pending-remove:hover{
  background:rgba(20,30,38,.96);
}
.visit-form-photo-pending .visit-photo-badge{
  background:rgba(39,82,109,.88);
}
.visit-form-photo-grid .visit-photo-inline-add{
  width:100%;
  min-width:0;
  aspect-ratio:4/3;
}
.visit-form-photo-grid .visit-photo-inline-add[hidden],
.visit-photo-inline-add[hidden]{
  display:none !important;
}

@media(max-width:640px){
  .visit-form-photo-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .visit-form-photo-existing,
  .visit-form-photo-pending{
    border-radius:16px;
  }
}
