/* Listing workspace (28 Oct 2026). Phone first; same type, cards and pills as Keystone. No :has(), no runtime custom
   properties (the 22 Oct perf rules in app.css). Everything is scoped under .lw (and the lightbox .lw-lb). */
.lw { display: flex; flex-direction: column; gap: 12px; }
.lw h3 { margin: 0 0 8px; font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 21px; line-height: 1.15; }
.lw h3 small { font-family: "Geist", system-ui, sans-serif; font-size: 12px; color: var(--muted); }
.lw .lw-h4 { font-family: "Geist", system-ui, sans-serif; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; text-transform: none; }
.lw .cs { font-size: 12.5px; color: var(--muted); display: block; }
.lw-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 14px; }
.lw-grow { flex: 1; }
.lw .btn.sm { min-height: 34px; padding: 0 11px; font-size: 13px; }
.lw label.btn { cursor: pointer; }

/* hero */
.lw-hero { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; display: grid; grid-template-columns: 1fr; }
.lw-hero-ph { aspect-ratio: 3 / 2; background: var(--notice); }
.lw-hero-ph img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.lw-hero-tx { padding: 12px 14px 14px; min-width: 0; }
.lw-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lw-addr { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 27px; line-height: 1.1; margin: 8px 0 0; }
.lw-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.lw-price { font-size: 18px; font-weight: 600; margin: 8px 0 0; }
.lw-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lw-facts span { font-size: 13.5px; border: 1px solid var(--rule); border-radius: 8px; padding: 4px 8px; }
.lw-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; color: var(--muted); margin: 10px 0 0; }
.lw-meta b { color: var(--ink); font-weight: 600; }
.lw-people { font-size: 13.5px; margin: 8px 0 0; line-height: 1.5; }
@media (min-width: 760px) { .lw-hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } .lw-hero-ph { aspect-ratio: auto; min-height: 260px; } }
.lw-ph.empty { display: grid; place-items: center; text-align: center; height: 100%; min-height: 90px; color: var(--muted); font-size: 13px; background: var(--notice); cursor: pointer; }
.lw-ph.empty.pdf { font-weight: 700; color: #b42318; background: #fde8e4; letter-spacing: .05em; }
.lw-ph.empty.big { min-height: 50vh; font-size: 15px; color: #fff; background: #222; }

/* tabs: one row that scrolls sideways on a phone, wraps on a desk */
.lw-tabs { position: sticky; top: -14px; z-index: 5; display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 8px 0; background: var(--bg); }
.lw-tabs::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .lw-tabs { flex-wrap: wrap; overflow: visible; } }
.lw-tabs button { flex: none; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); font-size: 13.5px; color: var(--muted); white-space: nowrap; min-height: 38px; }
.lw-tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.lw-b { font-style: normal; font-size: 11px; background: var(--notice); color: var(--muted); border-radius: 999px; padding: 1px 6px; margin-left: 3px; }
.lw-tabs button.on .lw-b { background: rgba(255, 255, 255, .25); color: inherit; }
.lw-b.bad { background: #fde8e4; color: #b42318; }
.lw-sec { display: flex; flex-direction: column; gap: 12px; }

/* forms */
.lw-f { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 13px; color: var(--muted); min-width: 0; }
.lw-f > span { font-weight: 500; }
.lw input:not([type=checkbox]):not([type=radio]):not([type=file]), .lw select, .lw textarea, .lw-lb input, .lw-lb select {
  width: 100%; min-width: 0; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 9px 10px; font: inherit; font-size: 16px; }
.lw textarea { line-height: 1.45; resize: vertical; }
.lw input:focus, .lw select:focus, .lw textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.lw-grid2, .lw-grid3, .lw-grid4 { display: grid; gap: 0 10px; grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .lw-grid3 { grid-template-columns: repeat(3, 1fr); } .lw-grid4 { grid-template-columns: repeat(4, 1fr); } }
.lw-2 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; margin-top: 8px; align-items: end; }
.lw-2 .lw-save { margin: 0; }
.lw-save { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.lw-save.sticky { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; margin: 0; z-index: 4; }
.lw-msg { font-size: 13px; }
.lw-msg.warn { color: #c2410c; }
.lw-tick { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 10px; color: var(--ink); }
.lw-tick.sm { font-size: 13px; margin-top: 4px; }
.lw-tick input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.lw-fg { font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lw-chip { padding: 7px 11px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); font-size: 13.5px; color: var(--ink); min-height: 36px; }
.lw-chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.lw-chip.on::before { content: "✓ "; }
.lw-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.lw-seg button { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--rule); background: var(--surface); font-size: 14px; min-height: 40px; }
.lw-seg button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.lw-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.lw-rooms { display: flex; flex-direction: column; gap: 6px; }
.lw-room { display: grid; grid-template-columns: 1.4fr .8fr .8fr; gap: 6px; }
.lw-room input[data-rm=note] { grid-column: 1 / -1; }
@media (min-width: 640px) { .lw-room { grid-template-columns: 1.4fr .7fr .7fr 1.6fr; } .lw-room input[data-rm=note] { grid-column: auto; } }

/* photos */
.lw-drop { border: 1.5px dashed var(--rule); border-radius: 14px; padding: 16px 12px; text-align: center; background: var(--bg); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lw-drop b { font-size: 16px; }
.lw-drop.small { padding: 10px; margin-top: 10px; }
.lw-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.lw-q { list-style: none; margin: 8px 0 0; padding: 0; }
.lw-q:empty { display: none; }
.lw-q li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--rule); }
.lw-q li .lw-meter { grid-column: 1 / -1; }
.lw-q li.done .cs { color: #13744a; } .lw-q li.bad .cs { color: #c2410c; }
.lw-qn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lw-meter { display: block; height: 5px; border-radius: 3px; background: var(--rule); overflow: hidden; margin-top: 6px; }
.lw-meter b { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .2s; }
.lw-meter.over b { background: #c2410c; }
.lw-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.lw-bar h3 { margin: 0; }
.lw-grid { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
@media (min-width: 640px) { .lw-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.lw-tile { position: relative; border-radius: 10px; overflow: hidden; background: var(--notice); border: 1px solid var(--rule); }
.lw-tile.drag { opacity: .4; }
.lw-tile.hid img { opacity: .45; }
.lw-tbtn { display: block; width: 100%; aspect-ratio: 3 / 2; padding: 0; }
.lw-tbtn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lw-tbtn .lw-ph.empty { min-height: 0; height: 100%; }
.lw-tag { position: absolute; left: 6px; top: 6px; font-size: 11px; font-weight: 600; background: rgba(20, 22, 28, .78); color: #fff; padding: 2px 7px; border-radius: 999px; }
.lw-tag.main { background: var(--accent); }
.lw-tag + .lw-tag { top: 28px; }
.lw-cap { display: block; font-size: 12px; padding: 4px 6px 6px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 22px; }
.lw-mv { position: absolute; right: 4px; top: 4px; display: flex; gap: 4px; }
.lw-mv button { width: 36px; height: 36px; border-radius: 50%; background: rgba(20, 22, 28, .78); color: #fff; font-size: 20px; line-height: 1; }
.lw-mv button[disabled] { opacity: .3; }

/* lists */
.lw-list { list-style: none; margin: 6px 0 0; padding: 0; }
.lw-list li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; border-top: 1px solid var(--rule); padding: 10px 0; font-size: 14px; }
.lw-list li:first-child { border-top: 0; }
.lw-list li > span:first-child { min-width: 0; flex: 1; }
.lw-list li.off { opacity: .55; }
.lw-list li.done b { text-decoration: line-through; text-decoration-color: var(--muted); }
.lw-list .lw-tick { margin: 0; align-items: flex-start; }
.lw-col { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; max-width: 48%; }
.lw-q2 { display: block; margin: 3px 0; white-space: pre-wrap; }
.lw-pt { display: flex; gap: 4px; align-items: center; flex: none; }
.lw-pt input { width: 64px !important; padding: 6px 8px !important; font-size: 15px !important; }
@media (max-width: 480px) { .lw-list li { flex-wrap: wrap; } .lw-pt { width: 100%; } .lw-col { max-width: none; align-items: flex-start; flex-direction: row; flex-wrap: wrap; } }
.lw-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; margin: 4px 0 8px; }
.lw-kpis div { border: 1px solid var(--rule); border-radius: 12px; padding: 8px 10px; }
.lw-kpis b { display: block; font-size: 20px; font-weight: 600; }
.lw-kpis span { font-size: 12px; color: var(--muted); }

/* copy */
.lw-count { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.lw-count .over { color: #c2410c; font-weight: 600; }
.lw-sugg { margin-top: 12px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; }
.lw-pre { white-space: pre-wrap; font-size: 14px; line-height: 1.45; }
.lw-checks { margin-top: 14px; }
.lw-checks ul, .lw-rules { list-style: none; margin: 4px 0 0; padding: 0; }
.lw-checks li, .lw-rules li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; padding: 6px 0; border-top: 1px solid var(--rule); }
.lw-checks li:first-child, .lw-rules li:first-child { border-top: 0; }
.lw-checks li > b, .lw-rules li > b { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--notice); color: var(--muted); }
.lw-checks li.ok > b, .lw-rules li.ok > b { background: #dcf3e8; color: #13744a; }
.lw-checks li.bad > b, .lw-rules li.bad > b { background: #fde8e4; color: #b42318; }
.lw-checks li.warn > b, .lw-rules li.warn > b { background: #fdecd6; color: #a14b00; }
.lw-checks li > div, .lw-rules li > div { min-width: 0; }
.lw details summary { font-size: 12px; color: var(--accent); cursor: pointer; margin-top: 2px; }
.lw .pill.p-expired { background: #fde8e4; color: #b42318; }

/* offers */
.lw-offer { border-top: 1px solid var(--rule); padding: 12px 0; }
.lw-offer p { margin: 4px 0; font-size: 14px; }
.lw-offer.rejected, .lw-offer.withdrawn, .lw-offer.lapsed { opacity: .7; }
.lw-amt { font-size: 20px; }
.lw-offer select { width: auto; flex: 1; max-width: 240px; }

/* report, advertising */
.lw-banner { background: var(--accent-soft); color: var(--ink); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; margin: 0 0 6px; }
.lw-prev { display: grid; grid-template-columns: 1fr; gap: 10px; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; padding-bottom: 10px; }
.lw-prev img, .lw-prev .lw-ph { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.lw-prev > div:last-child { padding: 0 12px; }
.lw-prev p { margin: 3px 0; font-size: 14px; }
@media (min-width: 640px) { .lw-prev { grid-template-columns: 220px 1fr; padding: 0; } .lw-prev > div:last-child { padding: 10px 12px 10px 0; } }
.lw-ok { font-size: 13px; color: #13744a; margin: 4px 0 0; }
.lw-ok a { color: var(--accent); margin-left: 6px; }

/* lightbox */
.lw-lb { position: fixed; inset: 0; z-index: 80; background: #0d0f15; color: #fff; display: flex; flex-direction: column; }
.lw-lb[hidden] { display: none; }
.lw-lb-top { display: flex; align-items: center; gap: 10px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; font-size: 14px; color: #c9cdd8; }
.lw-lb-top .back { color: #fff; font-weight: 600; font-size: 17px; min-height: 44px; padding: 0 10px; }
.lw-lb-a { color: #9fb0ff; padding: 0 10px; }
.lw-lb-view { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; }
.lw-lb-view img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lw-lb-view iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.lw-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 64px; font-size: 34px; color: #fff; background: rgba(0, 0, 0, .35); border-radius: 10px; z-index: 2; }
.lw-lb-nav.p { left: 6px; } .lw-lb-nav.n { right: 6px; }
.lw-lb-nav[disabled] { opacity: .2; }
.lw-lb-ed { background: #161922; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 640px) { .lw-lb-ed { grid-template-columns: 2fr 1fr auto; align-items: center; } .lw-lb-ed .cs, .lw-lb-ed .lw-acts { grid-column: 1 / -1; } }
.lw-lb input, .lw-lb select { background: #0d0f15; color: #fff; border-color: #2c3140; }
.lw-lb .lw-tick { color: #e6e8ee; margin: 0; }
.lw-lb .cs { color: #9aa0b2; font-size: 12px; }
.lw-lb .lw-acts { margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.lw-lb .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; font-size: 13.5px; }
.lw-lb .btn.ghost { background: transparent; border: 1px solid #2c3140; color: #c9d2ff; }
.lw-lb .btn.danger { color: #ff9b8f; }
.lw-pv[hidden] { display: none; }
.lw-pv .viewer-top a.share { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-size: 15px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lw-b.bad, :root:not([data-theme="light"]) .lw .pill.p-expired { background: #3a1a17; color: #ff9b8f; }
  :root:not([data-theme="light"]) .lw-ph.empty.pdf { background: #3a1a17; color: #ff9b8f; }
  :root:not([data-theme="light"]) .lw-checks li.ok > b, :root:not([data-theme="light"]) .lw-rules li.ok > b { background: #12352a; color: #6fd3a5; }
  :root:not([data-theme="light"]) .lw-checks li.bad > b, :root:not([data-theme="light"]) .lw-rules li.bad > b { background: #3a1a17; color: #ff9b8f; }
  :root:not([data-theme="light"]) .lw-checks li.warn > b, :root:not([data-theme="light"]) .lw-rules li.warn > b { background: #3a2a14; color: #f2b366; }
  :root:not([data-theme="light"]) .lw-ok { color: #6fd3a5; }
}

/* ═════ Desktop (28 Oct 2026): inside min-width: 1024px only, phones untouched. The workspace opens in Keystone's wide drawer:
   the hero across the top, the sections as a list down the left, and each section's cards side by side where they pair up
   (a list beside its "add" form). The photo grid gets bigger tiles; forms keep their 2/3/4-column grids. ═════ */
@media (min-width: 1024px) {
  .lw { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px 22px; align-items: start; }
  .lw > .lw-hero { grid-column: 1 / -1; }
  .lw-hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .lw-hero-ph { aspect-ratio: auto; min-height: 300px; max-height: 380px; }
  .lw-hero-tx { padding: 18px 22px; }
  .lw-addr { font-size: 32px; }
  .lw-card { padding: 18px 20px; }
  .lw h3 { font-size: 22px; }

  /* section list down the left */
  .lw > .lw-tabs { position: sticky; top: 0; flex-direction: column; flex-wrap: nowrap; overflow: visible; gap: 2px; padding: 0; background: none; }
  .lw-tabs button { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-radius: 9px; background: none; text-align: left;
    padding: 0 12px; min-height: 36px; font-size: 14px; color: var(--muted); }
  .lw-tabs button:hover { background: var(--notice); color: var(--ink); }
  .lw-tabs button.on { background: var(--accent-soft); color: var(--accent); }
  .lw-tabs button.on .lw-b { background: var(--accent); color: var(--accent-ink); }
  .lw-tabs button.on .lw-b.bad { background: #fde8e4; color: #b42318; }

  /* sections: cards side by side where they pair up */
  .lw-s-fb, .lw-s-offers, .lw-s-camp, .lw-s-insp, .lw-s-report, .lw-s-details, .lw-s-ads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .lw-s-price { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
  .lw-s-copy { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
  .lw-s-offers { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .lw-s-insp > :first-child { grid-column: 2; grid-row: 1 / span 2; }
  .lw-s-report > :last-child, .lw-s-ads > :last-child { grid-column: 1 / -1; }
  .lw-s-details > :nth-child(-n+2), .lw-s-details > .lw-save { grid-column: 1 / -1; }
  .lw-save.sticky { padding: 12px 0; }
  .lw-s-insp .lw-grid3 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }

  /* photos: bigger tiles, hover, the drop zone more compact */
  .lw-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
  .lw-tile { transition: box-shadow .12s, border-color .12s; }
  .lw-tile:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
  .lw-tile[draggable="true"] { cursor: grab; }
  .lw-drop { flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 18px; }
  .lw-hero-ph img:hover { opacity: .95; }

  /* forms: a little more room, desktop-sized inputs */
  .lw input:not([type=checkbox]):not([type=radio]):not([type=file]), .lw select, .lw textarea { font-size: 15px; padding: 8px 10px; }
  .lw-grid2 { gap: 0 14px; }
  .lw-chip:hover, .lw-seg button:not(.on):hover { border-color: var(--accent); color: var(--accent); }
  .lw-chip, .lw-seg button { min-height: 34px; }
  .lw-list li:hover { background: var(--notice); box-shadow: -8px 0 0 var(--notice), 8px 0 0 var(--notice); }
  .lw-prev { grid-template-columns: 260px 1fr; }
  .lw-lb-nav:hover { background: rgba(0, 0, 0, .55); }
}
@media (min-width: 1024px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lw-tabs button.on .lw-b.bad { background: #3a1a17; color: #ff9b8f; }
}
@media (min-width: 1024px) and (max-width: 1279px) { .lw { grid-template-columns: 168px minmax(0, 1fr); gap: 16px; } }
.lw-feed a { word-break: break-all; }
