/* listings.css - "My listings" page (my-listings/, my-listings/mylistings.js).
   Same look as the owner section: graph-paper header, white cards, thin borders,
   soft shadows, gold accents, the yellow focus ring. Loaded last on that page. */

.mlpage {
  background: linear-gradient(180deg, #fff 0%, #f7faff 260px, #f7faff 100%);
  min-height: calc(100dvh - 73px);
}

/* ---------- header ---------- */
.ml-top {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 40px 0 22px;
}
.ml-headrow {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}
.ml-headrow h1 {
  font-size: clamp(30px, 4.6vw, 44px);
  color: var(--ink);
  letter-spacing: -0.03em;
}
.ml-headrow h1:after {
  content: "";
  display: block;
  height: 6px;
  width: 56px;
  border-radius: 9px;
  background: var(--gold);
  margin-top: 8px;
}
.ml-headrow p {
  margin: 10px 0 0;
  color: var(--mute);
  max-width: 52ch;
}
.ml-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ml-stats span {
  padding: 6px 14px;
  border-radius: 99px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--mute);
  box-shadow: 0 2px 8px rgba(10, 47, 115, 0.05);
}
.ml-stats b {
  color: var(--ink);
  font-size: 15px;
  margin-right: 2px;
}

/* ---------- layout ---------- */
.ml-body {
  padding: 8px 0 64px;
}
.ml-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .ml-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- side list ---------- */
.ml-side {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
}
@media (max-width: 900px) {
  .ml-side {
    position: static;
  }
}
.ml-list {
  display: grid;
  gap: 8px;
}
.ml-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  font: inherit;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.ml-item:hover {
  border-color: #b9cdee;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(10, 47, 115, 0.08);
}
.ml-item.on {
  border-color: var(--brand);
  box-shadow:
    0 0 0 3px rgba(10, 71, 169, 0.12),
    0 6px 18px rgba(10, 47, 115, 0.08);
}
.ml-item:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.ml-th {
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, #dfeafb, #fff3cf);
  color: var(--brand);
}
.ml-th img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ml-th .ic {
  width: 22px;
  height: 22px;
  opacity: 0.75;
}
.ml-it-t {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.ml-it-t b {
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ml-it-t small {
  font-size: 12.5px;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ml-upd {
  opacity: 0.8;
}
.ml-feat {
  align-self: flex-start;
  flex: none;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--gold);
  color: var(--goldink);
}
.ml-new {
  justify-content: center;
  gap: 8px;
  padding: 13px;
  border-style: dashed;
  border-width: 1.5px;
  color: var(--brand);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.6);
}
.ml-new .ic {
  width: 18px;
  height: 18px;
}
.ml-use {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--mute);
  line-height: 1.45;
}
.ml-use:empty {
  display: none;
}
.ml-use b {
  color: var(--ink);
}
.ml-use-bar {
  height: 6px;
  border-radius: 9px;
  background: #eef4fd;
  overflow: hidden;
}
.ml-use-bar i {
  display: block;
  height: 100%;
  border-radius: 9px;
  background: var(--brand);
  transition: width 0.4s ease;
}
.ml-use-bar.hi i {
  background: #e0a800;
}

/* ---------- editor ---------- */
.ml-ed {
  display: grid;
  gap: 18px;
}
.ml-ed-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.ml-ed-head h2 {
  font-size: clamp(22px, 3vw, 28px);
  color: var(--ink);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.ml-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #0e8a4f;
}
.ml-state:before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #12b868;
  box-shadow: 0 0 0 3px rgba(18, 184, 104, 0.2);
}
.ml-state.draft {
  color: #8a6300;
}
.ml-state.draft:before {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 200, 61, 0.3);
}
.ml-ed-head .btn,
.ml-empty .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.ml-ed-head .btn .ic,
.ml-empty .btn .ic {
  width: 17px;
  height: 17px;
}
.ml-ed-head .btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.ml-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(10, 47, 115, 0.06);
  display: grid;
  gap: 16px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.ml-card-h {
  display: grid;
  gap: 3px;
}
.ml-card-h h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  color: var(--ink);
}
.ml-card-h h3 .ic {
  width: 20px;
  height: 20px;
  color: var(--brand);
}
.ml-card-h .meta {
  font-size: 13.5px;
}

/* photos */
#mlCoverCard.drop,
#mlPhotos.drop {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(10, 71, 169, 0.12);
}
.ml-cover {
  position: relative;
  aspect-ratio: 16 / 7;
  border-radius: 16px;
  overflow: hidden;
  background: #eef4fd;
}
@media (max-width: 560px) {
  .ml-cover {
    aspect-ratio: 4 / 3;
  }
}
.ml-cover img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
}
.ml-cover.drop {
  outline: 3px dashed var(--brand);
  outline-offset: -3px;
}
.ml-cover:has(img):after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 30, 80, 0.55), transparent 45%);
  pointer-events: none;
}
.ml-cover-tag {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px 4px 9px;
  border-radius: 99px;
  background: var(--gold);
  color: var(--goldink);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.ml-cover-tag .ic {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.ml-cover-acts {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ml-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font:
    700 13px Figtree,
    system-ui,
    sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.15s,
    background 0.15s;
}
.ml-pill:hover {
  transform: translateY(-1px);
  background: #fff;
}
.ml-pill .ic {
  width: 15px;
  height: 15px;
}
.ml-drop {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 20px;
  cursor: pointer;
  text-align: center;
  border: 2px dashed #b9cdee;
  border-radius: 16px;
  background: linear-gradient(135deg, #f4f8ff, #fffaf0);
  color: var(--mute);
  font:
    500 13.5px/1.45 Figtree,
    system-ui,
    sans-serif;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.ml-drop:hover,
.ml-cover.drop .ml-drop {
  border-color: var(--brand);
  background: linear-gradient(135deg, #eaf1fe, #fff6dd);
}
.ml-drop b {
  font-size: 16px;
  color: var(--ink);
}
.ml-drop span:not(.ml-drop-i) {
  max-width: 40ch;
}
.ml-drop-i {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #fff;
  color: var(--brand);
  box-shadow: 0 4px 14px rgba(10, 47, 115, 0.12);
  margin-bottom: 4px;
}
.ml-drop-i .ic {
  width: 26px;
  height: 26px;
}
.ml-drop:focus-visible,
.ml-add:focus-visible,
.ml-pill:focus-visible,
.ml-tile-acts button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.ml-gal-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: -6px;
}
.ml-gal-h b {
  font-size: 14px;
  color: var(--ink);
}
.ml-gal {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.ml-tile {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: #eef4fd;
  border: 1px solid var(--line);
}
.ml-tile img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
}
.ml-num {
  position: absolute;
  left: 8px;
  top: 8px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 99px;
  background: rgba(10, 30, 80, 0.7);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
}
.ml-tile-acts {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 18px 6px 6px;
  background: linear-gradient(transparent, rgba(10, 30, 80, 0.75));
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.18s,
    transform 0.18s;
}
.ml-tile:hover .ml-tile-acts,
.ml-tile:focus-within .ml-tile-acts {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .ml-tile-acts {
    opacity: 1;
    transform: none;
  }
}
.ml-tile-acts button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.ml-tile-acts button:hover:not(:disabled) {
  background: var(--gold);
  color: var(--goldink);
}
.ml-tile-acts button[data-act="del"]:hover {
  background: #e53e3e;
  color: #fff;
}
.ml-tile-acts button:disabled {
  opacity: 0.35;
  cursor: default;
}
.ml-tile-acts .ic {
  width: 15px;
  height: 15px;
}
.ml-busy {
  display: grid;
  place-items: center;
}
.ml-spin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(10, 71, 169, 0.15);
  border-top-color: var(--brand);
  animation: mlSpin 0.8s linear infinite;
}
@keyframes mlSpin {
  to {
    transform: rotate(360deg);
  }
}
.ml-add {
  aspect-ratio: 4 / 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  cursor: pointer;
  border: 2px dashed #b9cdee;
  border-radius: 14px;
  background: #fbfdff;
  color: var(--brand);
  font:
    500 12px Figtree,
    system-ui,
    sans-serif;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.ml-add:hover {
  border-color: var(--brand);
  background: #f1f6ff;
}
.ml-add .ic {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
}
.ml-add b {
  font-size: 14px;
}
.ml-add small {
  color: var(--mute);
}
.ml-rule {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 0;
  padding: 10px 13px;
  border-radius: 12px;
  background: #fff8e1;
  border: 1px solid #ffe39a;
  color: var(--goldink);
  font-size: 13px;
  line-height: 1.45;
}
.ml-rule .ic {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 1px;
}

/* form fields: same look as the add-property form */
.ml-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
@media (max-width: 600px) {
  .ml-form {
    grid-template-columns: 1fr;
  }
}
.ml-form .full {
  grid-column: 1 / -1;
}
.ml-form label,
.ml-fld > label:first-child {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.ml-fld {
  display: grid;
  gap: 6px;
}
.ml-form input[type="text"],
.ml-form input[type="number"],
.ml-form input[type="tel"],
.ml-ta textarea {
  width: 100%;
  box-sizing: border-box;
  font:
    500 15px Figtree,
    system-ui,
    sans-serif;
  color: var(--ink);
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}
.ml-form input:hover:not(:disabled),
.ml-ta textarea:hover {
  border-color: #b9cdee;
}
.ml-form input:focus,
.ml-ta textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 200, 61, 0.35);
}
.ml-form input:disabled {
  opacity: 0.55;
  background: #f2f5fa;
}
.ml-form input::placeholder,
.ml-ta textarea::placeholder {
  color: var(--mute);
  opacity: 0.7;
}
.ml-form .bad,
.ml-ta .bad {
  border-color: #e53e3e !important;
  box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.15) !important;
}
.ml-check {
  display: inline-flex !important;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px !important;
  font-weight: 500 !important;
  font-size: 13.5px !important;
  color: var(--mute) !important;
  cursor: pointer;
}
.ml-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
  margin: 0;
}

/* styled dropdowns (shared/js/app/select.js) dressed like the inputs */
.ml-form label.dd {
  position: relative;
}
.ml-form .dd-btn {
  padding: 11px 14px;
  font:
    500 15px Figtree,
    system-ui,
    sans-serif;
  color: var(--ink);
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.ml-form .dd-btn:hover {
  border-color: #b9cdee;
}
.ml-form .dd-open .dd-btn,
.ml-form .dd-btn:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 200, 61, 0.35);
}
.ml-form .dd-list {
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  min-width: 0;
}

/* description */
.ml-ta {
  position: relative;
}
.ml-ta textarea {
  display: block;
  min-height: 140px;
  resize: vertical;
  line-height: 1.55;
  padding-bottom: 28px;
}
.ml-cnt {
  position: absolute;
  right: 12px;
  bottom: 9px;
  font-size: 11.5px;
  color: var(--mute);
  pointer-events: none;
}
.ml-tips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: -4px;
}
.ml-tip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 99px;
  background: #eef4fd;
  color: var(--brand);
}

/* amenities */
.ml-chips {
  gap: 8px;
}
.ml-chips .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: #fbfdff;
  border: 1px solid var(--line);
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.15s;
}
.ml-chips .chip:hover {
  border-color: var(--brand);
}
.ml-chips .chip:active {
  transform: scale(0.96);
}
.ml-chips .chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.ml-ok {
  width: 0;
  height: 15px;
  stroke-width: 3;
  opacity: 0;
  transition:
    width 0.15s,
    opacity 0.15s;
}
.ml-chips .chip[aria-pressed="true"] .ml-ok {
  width: 15px;
  opacity: 1;
}

/* danger zone */
.ml-danger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border-color: #f6caca;
  box-shadow: none;
}
.ml-danger > div {
  display: grid;
  gap: 2px;
}
.ml-danger b {
  color: var(--ink);
}
.ml-delbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1.5px solid #e53e3e;
  border-radius: 10px;
  background: #fff;
  color: #c53030;
  font:
    700 14px Figtree,
    system-ui,
    sans-serif;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.ml-delbtn:hover,
.ml-delbtn.sure {
  background: #e53e3e;
  color: #fff;
}
.ml-delbtn .ic {
  width: 16px;
  height: 16px;
}

/* save bar: sticks to the bottom of the screen while editing */
.ml-bar {
  position: sticky;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 12px 12px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(10, 47, 115, 0.16);
  margin-right: 150px; /* keeps clear of the Ask Namo button */
}
@media (max-width: 700px) {
  .ml-bar {
    margin-right: 0;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}
.ml-bar.dirty {
  border-color: var(--gold);
}
.ml-bar.nudge {
  animation: mlNudge 0.45s ease;
}
@keyframes mlNudge {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}
.ml-bar-msg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--mute);
}
.ml-bar-msg .ic {
  width: 17px;
  height: 17px;
  color: #12b868;
}
.ml-bar-msg i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 200, 61, 0.3);
}
.ml-bar-msg i.err {
  background: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.2);
}
.ml-bar.dirty .ml-bar-msg {
  color: var(--ink);
}
.ml-bar-acts {
  display: flex;
  gap: 8px;
}
.ml-bar .btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 99px;
  padding: 9px 18px;
  font-weight: 700;
}
.ml-bar .btn .ic {
  width: 16px;
  height: 16px;
}
.ml-bar .btn[hidden] {
  display: none;
}
.ml-bar .btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.ml-bar .btn.alt {
  border-width: 1.5px;
}

/* empty state */
.ml-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 56px 24px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(10, 47, 115, 0.06);
}
.ml-empty-i {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(135deg, #eef4fd, #fff3cf);
  color: var(--brand);
  margin-bottom: 6px;
}
.ml-empty-i .ic {
  width: 34px;
  height: 34px;
}
.ml-empty h2 {
  font-size: 24px;
  color: var(--ink);
}
.ml-empty p {
  margin: 0;
  max-width: 46ch;
  color: var(--mute);
}
.ml-empty-acts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .ml-item,
  .ml-pill,
  .ml-tile-acts,
  .ml-chips .chip {
    transition: none;
  }
  .ml-bar.nudge,
  .ml-spin {
    animation: none;
  }
}
