/* The client book. Starts from the approved mockup (docs/specs/m6_book_reference.html). */
:root{--cover:#2F5D50;--cover-ink:#FBFAF7;--ground:#FBFAF7;--ink:#1E2421;--muted:#4A524E;--faint:#5F6863;--line:#E4DFD4;--soft:#EFEBE2;--accent:#2F5D50;--accent-dark:#1F4238;--mint:#E7EFE9;--sand:#FBEBD7;--sand-ink:#7A4410;--card:#FFFFFF;--heart:#C2410C}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--ground:#151917;--ink:#ECEFEA;--muted:#B5BDB8;--faint:#9AA39E;--line:#2E3532;--soft:#1E2421;--accent:#7FB8A4;--accent-dark:#A6D1C1;--mint:#22362F;--sand:#3A2A17;--sand-ink:#F2C894;--card:#1B201E;--cover:#22463C;--cover-ink:#F3F1EA;--heart:#F0875A;color-scheme:dark}}
:root[data-theme="dark"]{--ground:#151917;--ink:#ECEFEA;--muted:#B5BDB8;--faint:#9AA39E;--line:#2E3532;--soft:#1E2421;--accent:#7FB8A4;--accent-dark:#A6D1C1;--mint:#22362F;--sand:#3A2A17;--sand-ink:#F2C894;--card:#1B201E;--cover:#22463C;--cover-ink:#F3F1EA;--heart:#F0875A;color-scheme:dark}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
@media (prefers-reduced-motion: reduce){html{scroll-behavior:auto}}
body{margin:0;background:var(--ground);color:var(--ink);font-family:'Public Sans',system-ui,sans-serif;line-height:1.5}
a{color:var(--accent)}a:hover{color:var(--accent-dark)}
h1,h2,h3{font-family:'Fraunces',Georgia,serif;font-weight:600;margin:0;line-height:1.15}
.wrap{max-width:1120px;margin:0 auto;padding:0 max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px))}
@media (max-width:420px){.wrap{padding:0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px))}}

/* Cover */
header.cover{background:var(--cover);color:var(--cover-ink)}
.cover .wrap{padding-top:20px;padding-bottom:16px;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:14px 28px}
.cover-main{flex:1 1 380px;min-width:0}
.eyebrow{font-size:13px;letter-spacing:.14em;text-transform:uppercase;opacity:.85}
.cover h1{font-size:clamp(1.5rem,5vw,2.1rem);margin:0 0 8px;overflow-wrap:anywhere}
.cover .sub{font-size:15px;opacity:.92;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.access{display:inline-flex;align-items:center;font-size:12px;font-weight:600;letter-spacing:.02em;background:rgba(255,255,255,.16);padding:3px 9px;border-radius:999px}
.agent-block{display:flex;flex-direction:column;gap:16px;min-width:0}
.agent{display:flex;align-items:flex-start;gap:12px;min-width:0}
.agent .who{min-width:0;line-height:1.48}
.agent .photo{width:84px;height:84px;flex-shrink:0;border-radius:50%;overflow:hidden;border:2px solid rgba(251,250,247,.6);background:var(--mint)}
.agent .photo img{width:100%;height:100%;object-fit:cover;display:block}
/* Logos are made for white, so the strip stays white in both themes. */
.brandbar{background:#FFFFFF;border-bottom:1px solid rgba(0,0,0,.08)}
.brandbar .wrap{display:flex;align-items:center;min-height:64px;padding-top:10px;padding-bottom:10px}
.brandbar img{display:block;max-height:44px;max-width:min(240px,60vw);width:auto;height:auto}
.agent .name{font-weight:600;font-size:16px}
.agent .org{font-size:14px;opacity:.9;font-variant-numeric:tabular-nums}
.agent .email{overflow-wrap:anywhere}
.contact{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-width:306px}
.cbtn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:42px;padding:0 12px;border-radius:999px;font-size:15.5px;white-space:nowrap;background:var(--cover-ink);color:var(--cover);font-weight:600;text-decoration:none}
.cbtn:hover{opacity:.9;color:var(--cover)}
.cbtn:focus-visible{outline:3px solid var(--cover-ink);outline-offset:2px}
.cbtn .arr{transition:transform .15s}
.cbtn:hover .arr{transform:translateX(3px)}
@media (prefers-reduced-motion: reduce){.cbtn .arr{transition:none}}

/* Main */
main .wrap{padding-top:8px;padding-bottom:16px}
/* Visits and Homes share one header row: title left, switches right, same height. */
.section-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px;min-height:40px}
.section-head h2{font-size:1.4rem;line-height:1.2;margin:0}
.visits-section{margin-top:24px}
.visits-section .vpane{margin-top:14px;display:flex;flex-direction:column;gap:14px}
.homes-head{margin-top:28px;padding-top:24px;border-top:1px solid var(--line)}
.toolbar{display:flex;flex-wrap:wrap;gap:8px}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:999px;overflow:hidden;background:var(--card)}
.seg button{font:inherit;font-size:14px;font-weight:600;border:0;background:transparent;color:var(--muted);padding:6px 13px;min-height:38px;cursor:pointer}
.seg button[aria-pressed="true"]{background:var(--accent);color:var(--ground)}
.seg .n{display:inline-block;min-width:1.4em;padding:0 6px;margin-left:4px;border-radius:999px;background:var(--soft);color:var(--ink);font-size:13px}
.seg button[aria-pressed="true"] .n{background:rgba(255,255,255,.25);color:inherit}
button:focus-visible,textarea:focus-visible,input:focus-visible,a:focus-visible{outline:3px solid var(--accent);outline-offset:2px}

/* Cards */
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:18px;margin-top:16px}
@media (max-width:640px){.cards{grid-template-columns:1fr}}
.card{display:flex;flex-direction:column;gap:12px;background:var(--card);border:1px solid var(--line);border-radius:18px;padding:20px;color:inherit;min-width:0}
.card:hover{border-color:var(--faint)}
.row{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap}
.row.meta{align-items:center}
.street{font-family:'Fraunces',Georgia,serif;font-weight:600;font-size:21px}
.card .street{color:var(--ink);text-decoration:none}
.card .street:hover{text-decoration:underline}
.town{color:var(--muted);font-size:15px}
.price{font-weight:600;font-size:17px;white-space:nowrap}
.cardtop{display:flex;align-items:center;gap:6px}
.tags{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.badge{font-size:13px;font-weight:600;padding:6px 10px;border-radius:999px;background:var(--mint);color:var(--accent-dark)}
.badge.planned{background:var(--sand);color:var(--sand-ink)}
.nope-tag{font-size:13px;font-weight:600;padding:5px 10px;border-radius:999px;background:var(--soft);color:var(--muted)}
.count{font-size:14px;color:var(--muted)}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{font-size:13px;padding:4px 10px;border-radius:999px;border:1px solid var(--line);color:var(--muted);background:var(--card)}
.latest{font-size:15px;color:var(--muted);font-style:italic;border-top:1px solid var(--line);padding-top:12px;overflow-wrap:anywhere}
.empty{margin-top:20px;padding:24px;border:1px dashed var(--line);border-radius:18px;color:var(--muted);text-align:center}

/* Heart and thumbs-down */
.reacts{display:inline-flex;align-items:center;gap:2px}
.fav,.nope{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border:0;border-radius:50%;background:transparent;cursor:pointer;color:var(--muted);padding:0}
.fav svg path,.nope svg path{fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round}
.fav[aria-pressed="true"],.fav.on{color:var(--heart)}
.fav[aria-pressed="true"] svg path,.fav.on svg path{fill:currentColor}
.nope[aria-pressed="true"],.nope.on{color:var(--ink)}
.nope[aria-pressed="true"] svg path:first-child,.nope.on svg path:first-child{fill:currentColor}
.fav.on,.nope.on{cursor:default}

/* Stand-in map */
.mapview{display:flex;flex-wrap:wrap;gap:20px;margin-top:20px}
.mapbox{flex:999 1 420px;min-width:0}
.mapbox svg{width:100%;height:auto;display:block;border-radius:18px;border:1px solid var(--line)}
.mapbox .land{fill:var(--soft)}
.town-label{fill:var(--muted);font-size:14px;font-family:'Public Sans',system-ui,sans-serif;paint-order:stroke;stroke:var(--soft);stroke-width:4px;stroke-linejoin:round}
.pin circle{fill:var(--accent);stroke:var(--ground);stroke-width:3}
.pin text{fill:var(--ground);font-weight:700;font-size:15px;font-family:'Public Sans',system-ui,sans-serif}
.pin.is-fav circle{fill:var(--heart)}
.pin.dim{opacity:.25}
.mapnote{font-size:12px;color:var(--faint);margin-top:6px}
.mapside{flex:1 1 260px;min-width:0;display:flex;flex-direction:column;gap:10px}
.mapside h3{font-size:1.1rem;margin-top:6px}
.legend{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.legend a{display:flex;gap:12px;align-items:center;text-decoration:none;color:var(--ink);background:var(--card);border:1px solid var(--line);border-radius:14px;padding:10px 12px;min-height:44px}
.legend .num{width:28px;height:28px;flex-shrink:0;border-radius:50%;background:var(--accent);color:var(--ground);display:flex;align-items:center;justify-content:center;font-weight:700}
.legend li.is-fav .num{background:var(--heart)}
.missingbox .legend .num{background:var(--faint)}
.pairs{list-style:none;margin:0;padding:0}
.pairs li{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--line);font-size:15px}
.pairs li span:last-child{white-space:nowrap;color:var(--muted)}

/* Visits and sharing */
.visits{margin-top:28px;background:var(--soft);border-radius:18px;padding:22px}
.visits h2{font-size:1.4rem;margin-bottom:10px}
.visit{display:flex;gap:16px;align-items:baseline;padding:4px 0}
.visit .d{width:76px;flex-shrink:0;font-weight:600;color:var(--accent)}
.visit a{color:var(--ink);text-decoration:none;display:inline-block;padding:6px 0}
.visit a:hover{text-decoration:underline}
.share{margin-top:20px;display:flex;flex-direction:column;align-items:flex-start;gap:6px}
.share .hint{margin:0;font-size:14px;color:var(--faint)}
.share-status{font-size:14px;color:var(--muted);width:100%}
.sharelink{font:inherit;font-size:16px;width:100%;max-width:520px;margin-top:6px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--card);color:var(--ink)}
button.primary{display:inline-flex;align-items:center;gap:8px;font:inherit;font-weight:600;border:0;border-radius:999px;background:var(--accent);color:var(--ground);padding:0 18px;min-height:44px;cursor:pointer}

/* One section per home */
section.home{border-top:1px solid var(--line);padding:40px 0 16px;margin-top:32px;scroll-margin-top:12px}
section.home ~ section.home{margin-top:0}
.home-head{display:flex;flex-direction:column;gap:8px}
.headrow{display:flex;justify-content:space-between;align-items:center;gap:8px}
.home-head h2{font-size:clamp(1.7rem,5vw,2.2rem);display:flex;align-items:baseline;gap:12px;overflow-wrap:anywhere}
.homenum{flex-shrink:0;align-self:center;width:32px;height:32px;border-radius:50%;background:var(--accent);color:var(--ground);font-family:'Public Sans',system-ui,sans-serif;font-size:16px;font-weight:700;display:inline-flex;align-items:center;justify-content:center}
.home-head .where{font-size:17px;color:var(--muted)}
.home-head .price{font-size:24px}
.cols{display:flex;flex-wrap:wrap;gap:28px;margin-top:22px}
.cols .left{flex:1 1 320px;min-width:0;display:flex;flex-direction:column;gap:22px}
.cols .right{flex:999 1 420px;min-width:0}
.facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.fact{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:12px 14px}
.fact .l{font-size:13px;color:var(--faint)}
.fact .v{font-size:17px;font-weight:600}
.near h3{font-size:1.25rem;margin-bottom:6px}
.near .p{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--line);font-size:15px}
.near .p span:last-child{color:var(--muted);white-space:nowrap}
.small{font-size:12px;color:var(--faint);margin-top:6px}
.back{display:inline-flex;align-items:center;gap:6px;min-height:44px;font-weight:600;text-decoration:none;margin-top:8px}

/* Notes */
.notes{background:var(--soft);border-radius:20px;padding:22px 16px}
.notes h3{font-size:1.35rem;margin:0 4px 14px}
.notes .none{margin:0 4px 14px;color:var(--muted)}
.note{display:flex;gap:12px}
.rail{display:flex;flex-direction:column;align-items:center;width:14px;flex-shrink:0}
.dot{width:12px;height:12px;border-radius:6px;background:var(--accent);margin-top:5px}
.line{flex-grow:1;width:2px;background:var(--line);margin-top:4px}
.note:last-child .line{background:transparent}
.nbody{display:flex;flex-direction:column;gap:6px;padding-bottom:18px;min-width:0;flex:1}
.when{font-size:13px;font-weight:600;color:var(--accent)}
.note.client .dot{background:var(--sand-ink)}
.note.client .when{color:var(--sand-ink)}
.text{background:var(--card);border-radius:14px;padding:14px;font-size:16px;white-space:pre-wrap;overflow-wrap:anywhere}
.how{font-size:13px;color:var(--faint)}
.who-tag{font-weight:600;color:var(--ink)}
.note-actions{display:flex;gap:4px}
button.link{font:inherit;font-size:14px;font-weight:600;border:0;background:transparent;color:var(--accent);min-height:44px;padding:0 10px;cursor:pointer;border-radius:8px}
button.link:first-child{padding-left:0}
.nbody > .err:empty{display:none}
.err{font-size:13px;color:var(--sand-ink);min-height:1em}

/* Add or edit a note */
.add{margin-top:6px;background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:10px}
.add label{font-weight:600;font-size:15px}
.add textarea,.add input{font:inherit;font-size:16px;color:var(--ink);background:var(--ground);border:1px solid var(--line);border-radius:10px;padding:10px 12px;width:100%}
.add textarea{resize:vertical;min-height:84px}
.addrow{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.from{display:flex;align-items:center;gap:10px;flex:1 1 220px;min-width:0}
.add .from label{font-weight:600;font-size:15px;color:var(--muted)}
.from input{flex:1 1 auto;min-width:0}
@media (max-width:640px){.addrow{flex-direction:column;align-items:stretch}.addrow .from{flex:0 0 auto}.addrow button[type=submit]{width:100%}}
.add button{font:inherit;font-weight:600;border:0;border-radius:10px;background:var(--accent);color:var(--ground);padding:0 18px;min-height:44px;cursor:pointer}
.add button.secondary{background:transparent;color:var(--accent);border:1px solid var(--line)}
.add button:disabled{opacity:.6;cursor:default}
.add .hint{font-size:13px;color:var(--faint)}
.counter{font-size:13px;color:var(--faint);text-align:right}
.edit{margin-top:0}

/* Loading and error states */
.state{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px 16px}
.state-card{max-width:420px;text-align:center;font-size:18px;display:flex;flex-direction:column;align-items:center;gap:16px}
.state-card p{margin:0}

footer .wrap{padding-top:24px;padding-bottom:40px;font-size:13px;color:var(--faint)}

.toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom));transform:translateX(-50%);background:var(--ink);color:var(--ground);padding:12px 18px;border-radius:12px;font-size:15px;font-weight:600;max-width:calc(100% - 32px);z-index:10}

/* The whole summary card opens its home. */
.card[data-pid]{cursor:pointer}
.card[data-pid]:active{border-color:var(--accent)}

/* Upcoming visits: the first thing after the intro. */
.uday h3{font-size:1.05rem;margin:0 0 6px;color:var(--muted);font-family:inherit;font-weight:600;letter-spacing:.01em}
.uday.today h3{color:var(--accent)}
.uday ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.uday li{display:flex;gap:16px;align-items:baseline;padding:8px 0;border-top:1px solid var(--line)}
.uday li:first-child{border-top:0}
.uday .t{width:84px;flex-shrink:0;font-weight:700;font-variant-numeric:tabular-nums}
.uday .t.unset{font-weight:500;color:var(--muted);font-size:14px}
.uday a{color:var(--ink);text-decoration:none;min-width:0;overflow-wrap:anywhere}
.uday a:hover strong{text-decoration:underline}
.uday .town{color:var(--muted)}
.uday.today{background:var(--mint);padding:12px 14px;border-radius:14px}
.uday.today li{border-top-color:rgba(0,0,0,.08)}
.badge.today{background:var(--accent);color:var(--ground)}

/* Past visits fold under the upcoming ones in the same section. */
.visits-section .none{margin:0;color:var(--muted)}
.pastlist{list-style:none;margin:0;padding:0}
.pastlist li{display:flex;gap:16px;align-items:baseline;padding:8px 0;border-top:1px solid var(--line)}
.pastlist li:first-child{border-top:0}
.pastlist .t{width:118px;flex-shrink:0;color:var(--muted);font-variant-numeric:tabular-nums}
.pastlist .what{min-width:0;overflow-wrap:anywhere}
.pastlist .kind{color:var(--muted)}
.pastlist a{color:var(--ink);text-decoration:none}
.pastlist a:hover strong{text-decoration:underline}
.pastlist .town{color:var(--muted)}

/* Compare: homes side by side. Row labels stay put while the table scrolls sideways. */
.compareview{margin-top:16px;display:flex;flex-direction:column;gap:12px}
.cmp-controls{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.cmp-controls .seg{flex-wrap:wrap}
.linkish{font:inherit;font-size:14px;font-weight:600;color:var(--accent);background:none;border:0;padding:6px 0;min-height:36px;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.cmp-scroll{overflow-x:auto;border:1px solid var(--line);border-radius:16px;background:var(--card)}
.cmp-scroll:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.cmp{border-collapse:separate;border-spacing:0;width:100%;font-size:15px}
.cmp th,.cmp td{padding:9px 12px;text-align:left;vertical-align:top;border-bottom:1px solid var(--line)}
.cmp td{min-width:140px;font-variant-numeric:tabular-nums}
.cmp .rowlabel{position:sticky;left:0;z-index:1;background:var(--card);color:var(--muted);font-weight:600;min-width:128px;max-width:160px;border-right:1px solid var(--line)}
.cmp thead th{background:var(--soft);vertical-align:bottom}
.cmp thead .rowlabel{background:var(--soft)}
.cmp .homecol{min-width:150px}
.hc-top{display:flex;align-items:flex-start;justify-content:space-between;gap:6px}
.hc-street{font-family:'Fraunces',Georgia,serif;font-weight:600;font-size:16px;color:var(--ink);text-decoration:none;line-height:1.25}
.hc-street:hover{text-decoration:underline}
.hc-drop{font:inherit;border:0;background:transparent;color:var(--muted);min-width:32px;min-height:32px;border-radius:50%;cursor:pointer;line-height:1}
.hc-drop:hover{background:var(--line);color:var(--ink)}
.hc-drop:focus-visible{outline:3px solid var(--accent);outline-offset:1px}
.hc-sub{font-size:13px;color:var(--muted);font-weight:500;margin-top:2px}
.hc-fav{color:#C2410C}
.hc-tag{font-size:12px;font-weight:600;color:var(--accent);margin-top:4px}
.cmp .grouprow th{position:sticky;left:0;background:var(--soft);color:var(--ink);font-size:13px;letter-spacing:.06em;text-transform:uppercase;padding-top:12px}
.cmp td.empty{color:var(--faint)}
.cmp td.check{color:var(--accent);font-weight:700}
.cmp td a{color:var(--accent);font-weight:600}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.compareview .none{color:var(--muted);margin:0}

/* Lighter controls: a Favorites toggle by the heading, text tabs for views. */
.homes-head h2 .count{font-family:'Public Sans',system-ui,sans-serif;font-size:15px;font-weight:500;color:var(--muted);margin-left:2px}
.favchip{font:inherit;font-size:14px;font-weight:600;display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:var(--card);color:var(--muted);cursor:pointer}
.favchip .n{display:inline-block;min-width:1.4em;padding:0 6px;border-radius:999px;background:var(--soft);color:var(--ink);font-size:12px;text-align:center}
.favchip[aria-pressed="true"]{border-color:#C2410C;color:#C2410C;background:var(--card)}
.favchip[aria-pressed="true"] .n{background:#C2410C;color:#FFFFFF}
.favchip:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.tabs{display:flex;gap:22px;border-bottom:1px solid var(--line);margin-top:10px}
.tabs button{font:inherit;font-size:15px;font-weight:600;color:var(--muted);background:none;border:0;border-bottom:3px solid transparent;margin-bottom:-1px;padding:8px 0;min-height:40px;cursor:pointer}
.tabs button[aria-pressed="true"]{color:var(--ink);border-bottom-color:var(--accent)}
.tabs button:hover{color:var(--ink)}
.tabs button:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:4px}
.tabs .n{font-size:13px;font-weight:500;color:var(--faint);margin-left:2px}
.visits-section .tabs{margin-top:8px}
.cmp-day{display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--muted)}
.cmp-day select{font:inherit;font-size:15px;font-weight:600;color:var(--ink);background:var(--card);border:1px solid var(--line);border-radius:10px;padding:6px 10px;min-height:38px}
.cmp-day select:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.rotate-tip{display:none;margin:0;font-size:13px;color:var(--muted)}
@media (max-width: 600px) and (orientation: portrait){.rotate-tip{display:block}}

/* Compare scrolls inside its own box, so the home names stay pinned at the top
   and the row labels on the left, like a spreadsheet. */
.cmp-scroll{overflow:auto;max-height:calc(100vh - 140px);max-height:calc(100dvh - 140px);overscroll-behavior:contain}
.cmp thead th{position:sticky;top:0;z-index:2;background:var(--soft);box-shadow:0 1px 0 var(--line)}
.cmp thead .rowlabel{left:0;z-index:3}
.cmp .grouprow th{z-index:1}
@media (orientation: landscape) and (max-height: 500px){.cmp-scroll{max-height:calc(100vh - 70px);max-height:calc(100dvh - 70px)}}

/* Landscape phones: a compact header row so more of the table shows. */
@media (orientation: landscape) and (max-height: 500px){
  .cmp th,.cmp td{padding:6px 10px}
  .hc-street{font-size:15px}
  .hc-sub{display:none}
  .hc-tag{margin-top:2px}
}

/* Note form: the label sits close to its box, and an empty error line takes no room. */
.add > label{margin-bottom:-4px}
.add > .err:empty{display:none}
/* New since the last visit */
.newbar{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;justify-content:space-between;margin:12px auto 0;padding:10px 14px;border-radius:12px;background:var(--mint);color:var(--ink);font-weight:600}
.newbar a{color:var(--accent);font-weight:700;min-height:44px;display:inline-flex;align-items:center}
.newtag{display:inline-block;padding:1px 8px;border-radius:999px;background:var(--accent);color:var(--ground);font-size:12px;font-weight:700;letter-spacing:.02em}
.note.new .nbody{box-shadow:inset 3px 0 0 var(--accent);padding-left:10px}

/* "Show me" lands a note in the top third, clear of the notch. */
.note{scroll-margin-top:max(25vh,calc(env(safe-area-inset-top) + 24px))}
.nextpill{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(16px + env(safe-area-inset-bottom));z-index:20;display:flex;align-items:center;gap:0;padding:0 4px 0 0;border-radius:999px;background:var(--ink);color:var(--ground);font-weight:600;box-shadow:0 6px 20px rgba(0,0,0,.25);white-space:nowrap}
.nextpill .go{color:var(--ground);text-decoration:none;min-height:44px;display:inline-flex;align-items:center;gap:12px;padding:0 8px 0 18px;border-radius:999px}
.nextpill .next{font-weight:700}
.nextpill .x{border-left:1px solid rgba(127,127,127,.4)!important;border-radius:0}
.nextpill .x{background:none;border:0;color:var(--ground);font-size:16px;min-width:44px;min-height:44px;cursor:pointer}

/* Home photos: a thumbnail on each card, a full-width photo above the details. */
.cardhead{display:flex;align-items:flex-start;gap:14px}
.cardmain{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}
.cardmain .cardtop{margin-top:8px}
.thumb{flex:0 0 auto;width:112px;height:84px;object-fit:cover;border-radius:12px;background:var(--soft)}
@media (max-width:380px){.thumb{width:92px;height:69px}}
.hero{display:block;width:100%;height:auto;max-height:70vh;object-fit:cover;border-radius:18px;margin-top:22px;background:var(--soft)}
img[hidden]{display:none}
