:root {
  color-scheme: dark;
  --paper: #070b09;
  --card: #0c1310;
  --card-raised: #111b16;
  --ink: #e1f4e7;
  --muted: #82988a;
  --line: rgba(120, 255, 158, .16);
  --green: #83ffa2;
  --green-dark: #42d875;
  --green-pale: rgba(73, 240, 126, .11);
  --cyan: #69e5d1;
  --orange: #ffc078;
  --red: #ff8177;
  --shadow: 0 18px 48px rgba(0, 0, 0, .38);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 8% -12%, rgba(32, 125, 66, .17), transparent 42%),
    radial-gradient(ellipse at 95% 28%, rgba(24, 110, 116, .10), transparent 38%),
    linear-gradient(rgba(117, 255, 157, .026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(117, 255, 157, .026) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
  background-attachment: fixed;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }
.loading-screen { min-height: 100vh; display: grid; place-items: center; color: var(--muted); font: .82rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; }
.login-screen { min-height: 100vh; max-width: 440px; margin: auto; padding: max(14vh, 74px) 28px 50px; }
.login-mark, .brand-mark { display: grid; place-items: center; background: #10291a; border: 1px solid rgba(131, 255, 162, .55); color: var(--green); font-weight: 800; box-shadow: 0 0 26px rgba(66, 216, 117, .14), inset 0 0 18px rgba(66, 216, 117, .08); }
.login-mark { width: 52px; height: 52px; border-radius: 17px; font-size: 1.35rem; margin-bottom: 46px; }
.eyebrow { margin: 0 0 11px; color: var(--green); font: 700 .68rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.045em; }
.login-screen h1 { font-size: clamp(2.7rem, 12vw, 4rem); line-height: 1.03; margin-bottom: 18px; }
.login-copy { color: var(--muted); line-height: 1.6; margin-bottom: 34px; }
.login-footnote { margin-top: 23px; color: #698071; font-size: .8rem; text-align: center; }
.button { border: 1px solid transparent; border-radius: 12px; padding: 13px 18px; min-height: 48px; font-weight: 700; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.button:active { transform: scale(.98); }
.button-primary { background: var(--green-dark); color: #041108; box-shadow: 0 0 22px rgba(66, 216, 117, .15); }
.button-primary:hover { background: var(--green); box-shadow: 0 0 27px rgba(66, 216, 117, .24); }
.button-dark { background: #18251d; color: var(--ink); border-color: var(--line); }
.button-secondary { background: #17221b; color: var(--ink); border-color: var(--line); }
.button-wide { width: 100%; }
.field-label { display: block; margin: 0 0 8px; font: 700 .74rem ui-monospace, SFMono-Regular, Menlo, monospace; color: #b2cdb9; }
.text-input { display: block; width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; background: #090f0c; color: var(--ink); outline: none; margin-bottom: 15px; }
.text-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(96, 255, 142, .11); }
.inline-error, .app-error { color: var(--red); font-size: .86rem; }
.login-screen .button { margin-top: 4px; }

.topbar { height: 76px; padding: 0 max(28px, calc((100vw - 1160px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(7, 12, 9, .88); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -.035em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: .9rem; }
.top-actions { display: flex; align-items: center; gap: 20px; }
.icon-button, .text-button, .dismiss-button { border: 0; background: transparent; color: var(--ink); }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; font-size: 1.25rem; }
.icon-button:hover { background: var(--green-pale); color: var(--green); }
.push-button.enabled { color: var(--green); background: var(--green-pale); box-shadow: 0 0 17px rgba(66, 216, 117, .12); }
.bell-icon { display: block; transform: rotate(180deg); }
.text-button { color: var(--muted); font-size: .83rem; }
.text-button:hover { color: var(--green); }
.page-wrap { max-width: 1160px; margin: auto; padding: 60px 28px 100px; }
.welcome-row { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 39px; }
.welcome-row h1 { margin: 0 0 8px; font-size: clamp(2.15rem, 5vw, 3.5rem); }
.muted { color: var(--muted); line-height: 1.55; }
.welcome-row .muted { margin: 0; }
.install-tip { position: relative; max-width: 315px; padding: 14px 34px 14px 48px; background: rgba(17, 54, 31, .73); border: 1px solid var(--line); border-radius: 12px; color: #a4c8ad; font-size: .76rem; line-height: 1.5; }
.install-tip strong { color: var(--green); }
.install-tip-icon { position: absolute; top: 14px; left: 16px; font-size: 1.15rem; }
.dismiss-button { position: absolute; top: 7px; right: 8px; font-size: 1.3rem; color: #82988a; }
.tab-row { display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); margin-bottom: 25px; }
.tab { display: flex; align-items: center; gap: 9px; background: transparent; color: var(--muted); padding: 13px 16px 15px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; font: 600 .78rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.tab.active { color: var(--green); border-color: var(--green); text-shadow: 0 0 14px rgba(131, 255, 162, .25); }
.count-pill { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; background: #17221b; color: #9bb3a1; font: .68rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.tab.active .count-pill { background: rgba(73, 240, 126, .16); color: var(--green); }
.listing-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; align-items: start; }
.listing-card { overflow: hidden; border: 1px solid rgba(120, 255, 158, .14); border-radius: 15px; background: linear-gradient(145deg, rgba(14, 23, 18, .97), rgba(9, 15, 12, .98)); box-shadow: var(--shadow); transition: border-color .18s ease, transform .18s ease; }
.listing-card:hover { border-color: rgba(131, 255, 162, .36); transform: translateY(-2px); }
.gallery { position: relative; height: 260px; background: #080d0a; overflow: hidden; }
.gallery-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.gallery-empty { display: grid; place-items: center; background: radial-gradient(ellipse, rgba(29, 70, 42, .27), transparent 70%), #080d0a; }
.gallery-empty::after { content: 'NO IMAGE SIGNAL'; color: rgba(131, 255, 162, .5); font: .67rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; }
.gallery-count { position: absolute; right: 13px; bottom: 13px; padding: 6px 10px; border: 1px solid rgba(131, 255, 162, .25); border-radius: 99px; background: rgba(4, 11, 7, .78); color: #d8f9e1; font: .67rem ui-monospace, SFMono-Regular, Menlo, monospace; backdrop-filter: blur(8px); }
.listing-body { padding: 20px 21px 18px; }
.price-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.listing-summary { flex: 1 1 200px; min-width: 0; padding-top: 1px; }
.listing-map-side { display: grid; flex: 0 0 208px; justify-items: end; gap: 7px; }
.listing-price { margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: -.05em; color: #f0fff3; }
.listing-location { margin: 3px 0 0; color: #a2b6a7; font-size: .9rem; }
.fresh-label { color: var(--cyan); font: 700 .62rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
.map-preview { position: relative; width: 208px; height: 208px; overflow: hidden; border: 1px solid rgba(131, 255, 162, .3); border-radius: 9px; background: #14231a; box-shadow: inset 0 0 16px rgba(0, 0, 0, .22); }
.mini-map-link { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; overflow: hidden; border: 0; background: linear-gradient(135deg, #263c2e, #15241b); color: inherit; cursor: pointer; }
.mini-map-svg { display: block; width: 100%; height: 100%; }
.mini-map-link:focus-visible { outline: 2px solid var(--green); outline-offset: -3px; }
.map-pin { fill: #62ef8b; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .85)); }
.map-pin circle { fill: #102117; }
.map-credit { position: absolute; z-index: 1; right: 2px; bottom: 2px; padding: 2px 3px; border-radius: 3px; background: rgba(4, 10, 6, .84); color: #e3f1e7; font: 600 6.5px/1.15 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; text-decoration: none; white-space: nowrap; }
.map-credit:hover { color: #fff; text-decoration: underline; }
.listing-facts { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 0 15px; border-bottom: 1px solid var(--line); }
.fact-chip { padding: 6px 9px; border: 1px solid rgba(120, 255, 158, .13); border-radius: 7px; background: rgba(24, 42, 30, .68); color: #b7d2bd; font: .68rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.listing-amenities { margin: 13px 0 0; padding: 11px 12px; border: 1px solid rgba(120, 255, 158, .12); border-radius: 9px; background: rgba(9, 18, 12, .7); }
.listing-amenities p { margin: 0 0 5px; color: #a9c4b0; font-size: .75rem; line-height: 1.5; }
.listing-amenities p:last-child { margin-bottom: 0; }
.listing-amenities strong { color: var(--green); font: 700 .67rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.listing-description { margin: 14px 0 18px; color: #a7b9aa; font-size: .83rem; line-height: 1.58; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.listing-description.empty { color: #748579; font-style: italic; }
.listing-link { display: inline-block; margin: -4px 0 16px; color: var(--green); text-decoration: none; font: 700 .72rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.listing-link:hover { color: #b7ffc7; text-decoration: underline; }
.decision-row { display: grid; grid-template-columns: 1fr 1.5fr; gap: 9px; }
.decision-button { min-height: 47px; border: 1px solid var(--line); border-radius: 10px; background: #101813; color: #d6e8da; font-weight: 700; }
.decision-button:hover { border-color: rgba(131, 255, 162, .42); background: #142119; }
.decision-button.yes { border-color: rgba(90, 244, 137, .33); background: rgba(31, 111, 56, .28); color: var(--green); }
.decision-button.yes:hover { background: rgba(31, 130, 63, .4); }
.todo-editor { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.todo-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 11px; }
.status-select { appearance: none; border: 1px solid var(--line); border-radius: 8px; padding: 9px 31px 9px 10px; color: #b9d3bf; background: #0a110d; font: 700 .72rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.status-select-wrap { position: relative; }
.status-select-wrap::after { content: '⌄'; position: absolute; right: 10px; top: 5px; color: var(--green); pointer-events: none; }
.note-area { width: 100%; min-height: 68px; resize: vertical; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; color: var(--ink); background: #080e0a; outline: none; font-size: .8rem; line-height: 1.5; }
.note-area:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(96, 255, 142, .08); }
.note-save-row { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 8px; }
.save-note { border: 0; background: transparent; color: var(--green); font: 700 .7rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.saved-label { color: var(--muted); font-size: .7rem; }
.trash-note { margin: 13px 0 0; padding: 10px 12px; background: rgba(87, 45, 39, .24); border: 1px solid rgba(255, 129, 119, .16); border-radius: 9px; color: #c7a6a0; font-size: .78rem; line-height: 1.5; }
.restore-button { margin-top: 12px; padding: 7px 0; border: 0; background: transparent; color: var(--green); font: 700 .72rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.empty-state { max-width: 400px; margin: 80px auto 0; text-align: center; }
.empty-mark { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--green-pale); color: var(--green); font-size: 1.55rem; box-shadow: 0 0 30px rgba(66, 216, 117, .09); }
.empty-state h2 { margin: 0 0 9px; font-size: 1.4rem; }
.empty-state p { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.app-error { margin: 26px 0; padding: 12px 14px; border: 1px solid rgba(255, 129, 119, .22); border-radius: 10px; background: rgba(85, 34, 31, .28); }
.mobile-nav { display: none; }
.reject-dialog { width: min(460px, calc(100% - 28px)); padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: #0c1410; color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.62); }
.reject-dialog::backdrop { background: rgba(2, 7, 4, .76); backdrop-filter: blur(5px); }
.reject-dialog h2 { margin: 0 0 10px; font-size: 1.7rem; }
.reject-dialog .muted { margin-bottom: 22px; font-size: .85rem; }
.note-input { resize: vertical; min-height: 100px; line-height: 1.5; }
.dialog-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 19px; }
.dialog-actions .button { min-height: 44px; padding: 10px 13px; font-size: .8rem; }
.map-dialog { width: min(940px, calc(100% - 24px)); max-width: none; max-height: calc(100vh - 24px); padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #0c1410; color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.62); }
.map-dialog::backdrop { background: rgba(2, 7, 4, .78); backdrop-filter: blur(5px); }
.map-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.map-dialog-header .eyebrow { margin-bottom: 5px; }
.map-dialog-header h2 { margin: 0; font-size: clamp(1.1rem, 3vw, 1.45rem); overflow-wrap: anywhere; }
.map-dialog-header form { margin: 0; }
.map-dialog-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #101b14; color: var(--ink); font-size: 1.45rem; line-height: 1; }
#map-frame { display: block; width: 100%; height: min(68vh, 650px); border: 1px solid rgba(131, 255, 162, .2); border-radius: 9px; background: #14231a; }
.map-dialog-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; color: var(--muted); font-size: .76rem; }
.map-dialog-footer a { color: var(--green); text-decoration: none; font: 700 .7rem ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.map-dialog-footer a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 18px; }
  .brand { font-size: .92rem; }
  .brand-mark { width: 31px; height: 31px; }
  .top-actions { gap: 8px; }
  .text-button { font-size: .75rem; }
  .page-wrap { padding: 35px 16px calc(100px + env(safe-area-inset-bottom)); }
  .welcome-row { display: block; margin-bottom: 25px; }
  .welcome-row h1 { font-size: 2.45rem; }
  .install-tip { margin-top: 18px; max-width: none; }
  .tab-row { display: none; }
  .listing-list { grid-template-columns: 1fr; gap: 15px; }
  .gallery { height: clamp(215px, 66vw, 310px); }
  .listing-body { padding: 18px 17px 16px; }
  .listing-summary { flex-basis: 100%; }
  .listing-map-side { flex-basis: 100%; gap: 6px; }
  .map-preview { width: 184px; height: 184px; }
  .map-credit { font-size: 5.7px; }
  .mobile-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3,1fr); padding: 9px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(7, 12, 9, .94); backdrop-filter: blur(18px); }
  .mobile-nav-item { display: grid; justify-items: center; gap: 3px; border: 0; background: transparent; color: #718477; font-size: 1.12rem; }
  .mobile-nav-item small { font: 600 .62rem ui-monospace, SFMono-Regular, Menlo, monospace; }
  .mobile-nav-item.active { color: var(--green); }
  .reject-dialog { padding: 24px 20px 20px; }
  .map-dialog { padding: 15px 13px 13px; }
  #map-frame { height: min(68vh, 560px); }
  .map-dialog-footer { align-items: flex-start; font-size: .69rem; }
}

@media (min-width: 761px) {
  .login-screen { padding-top: 18vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
