/* vsco map — dark instrument panel */

:root {
  --bg: #0e0e0d;
  --panel: #141413;
  --raise: #1b1b19;
  --ink: #f2f1ec;
  --ink2: #c4c2b8;
  --muted: #86847c;
  --hair: rgba(255, 255, 255, 0.09);
  --hair2: rgba(255, 255, 255, 0.16);
  --gold: #d4b06a;
  --gold-dim: #a9843c;
  --crit: #e0705f;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { height: 100%; }
body {
  height: 100%;          /* fallback for browsers without dvh */
  height: 100dvh;        /* track the live viewport when window/toolbars grow */
  min-height: 100%;
  margin: 0;
  font: 13.5px/1.55 "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: grid;
  grid-template-columns: 336px 1fr;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- panel ---------------- */

#panel {
  background: var(--panel);
  border-right: 1px solid var(--hair);
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--hair2) transparent;
}
#panel > * { flex-shrink: 0; }   /* stop flexbox crushing the stats block */
#panel::-webkit-scrollbar { width: 8px; }
#panel::-webkit-scrollbar-thumb { background: var(--hair2); border-radius: 4px; }

.brand { display: flex; align-items: baseline; gap: 9px; }
.brand h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.brand .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 176, 106, 0.16);
}
#panel .sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* section labels */
.label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 7px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.label .hint { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 11px; }

/* inputs */
textarea, input[type="number"] {
  font: inherit;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--hair);
  border-radius: 9px;
  background: var(--raise);
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.15s, background 0.15s;
}
textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; min-height: 46px; }
textarea::placeholder { color: #5f5d57; }
textarea:hover, input[type="number"]:hover { border-color: var(--hair2); }
textarea:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--gold-dim);
  background: #201f1d;
}

/* buttons */
button {
  font: inherit;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--ink2);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.06s;
}
button:hover:not(:disabled) { color: var(--ink); border-color: var(--hair2); background: rgba(255,255,255,0.03); }
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 2px; }
button:disabled { opacity: 0.38; cursor: default; }

button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #17150f;
  font-weight: 600;
}
button.primary:hover:not(:disabled) { background: #e0bd77; border-color: #e0bd77; color: #17150f; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; }

/* page stepper */
.stepper {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--hair); border-radius: 9px; overflow: hidden;
  background: var(--raise);
}
.stepper button {
  border: 0; border-radius: 0; padding: 8px 11px; color: var(--muted);
  background: transparent;
}
.stepper button:hover:not(:disabled) { background: rgba(255,255,255,0.05); color: var(--ink); }
.stepper input {
  width: 46px; text-align: center; border: 0; background: transparent;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink);
}
.stepper input:focus { outline: none; }
.stepper .unit {
  padding: 0 10px 0 2px; color: var(--muted); font-size: 11px;
  border-left: 1px solid var(--hair);
}

/* toggles */
.toggles { display: flex; gap: 14px; flex-wrap: wrap; }
.chk {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--ink2); font-size: 12.5px; cursor: pointer; user-select: none;
}
.chk input {
  appearance: none; width: 15px; height: 15px; margin: 0;
  border: 1px solid var(--hair2); border-radius: 4px;
  background: var(--raise); cursor: pointer; position: relative;
  transition: background 0.12s, border-color 0.12s;
}
.chk input:checked { background: var(--gold); border-color: var(--gold); }
.chk input:checked::after {
  content: ""; position: absolute; inset: 0;
  background: #17150f;
  clip-path: polygon(18% 52%, 40% 72%, 82% 26%, 88% 34%, 41% 84%, 12% 59%);
}
.chk input:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 2px; }

/* stats */
#stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
  border-radius: 11px;
  overflow: hidden;
  margin: 0;
}
#stats > div { background: var(--panel); padding: 11px 13px 12px; }
#stats dt {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); font-weight: 600;
}
#stats dd {
  margin: 3px 0 0;
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
#stats dd.accent { color: var(--gold); }

/* status */
.status {
  margin: 0; font-size: 12px; color: var(--muted);
  min-height: 17px; line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.status.err { color: var(--crit); }
.status.busy { color: var(--gold); }

/* progress bar */
#bar {
  height: 2px; background: var(--hair); border-radius: 2px;
  overflow: hidden; opacity: 0; transition: opacity 0.2s;
}
#bar.on { opacity: 1; }
#bar > i {
  display: block; height: 100%; width: 0%;
  background: var(--gold); transition: width 0.25s ease;
}

/* footer */
#panel footer {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--hair);
  font-size: 11.5px; line-height: 1.6; color: var(--muted);
}
#panel footer p { margin: 0; }
code {
  font: 11px/1 var(--mono); background: rgba(255,255,255,0.06);
  padding: 2px 5px; border-radius: 4px; color: var(--ink2);
}

/* ---------------- map ---------------- */

#map-wrap { position: relative; height: 100%; min-height: 0; overflow: hidden; }
#map { height: 100%; width: 100%; background: #101010; }

/* dark map from light tiles: inverts roads, keeps water distinguishable */
.leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.88) contrast(0.86) saturate(0.28);
}

.leaflet-container {
  background: #101010;
  font-family: "Inter", system-ui, sans-serif;
  outline: none;
}
.leaflet-control-attribution {
  background: rgba(14,14,13,0.82) !important;
  color: #6f6d66 !important;
  font-size: 10px !important;
  padding: 3px 7px !important;
  border-radius: 6px 0 0 0;
  backdrop-filter: blur(6px);
}
.leaflet-control-attribution a { color: #8f8d85 !important; }
.leaflet-bar {
  border: 1px solid var(--hair2) !important;
  border-radius: 9px !important;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
}
.leaflet-bar a {
  background: rgba(20,20,19,0.94) !important;
  color: var(--ink2) !important;
  border-bottom: 1px solid var(--hair) !important;
  width: 30px !important; height: 30px !important; line-height: 30px !important;
  font-size: 16px !important;
  transition: background 0.12s, color 0.12s;
}
.leaflet-bar a:hover { background: #242422 !important; color: var(--ink) !important; }

/* popup */
.leaflet-popup-content-wrapper {
  background: #1b1b19 !important;
  color: var(--ink) !important;
  border: 1px solid var(--hair2);
  border-radius: 12px !important;
  box-shadow: 0 18px 46px rgba(0,0,0,0.6) !important;
  padding: 0 !important;
  overflow: hidden;
}
.leaflet-popup-content { margin: 0 !important; width: 250px !important; }
.leaflet-popup-tip { background: #1b1b19 !important; border: 1px solid var(--hair2); }
.leaflet-popup-close-button {
  color: #8f8d85 !important;
  font-size: 18px !important;
  padding: 6px 8px 0 0 !important;
}
.leaflet-popup-close-button:hover { color: var(--ink) !important; }

.photo-pop img {
  display: block; width: 100%; height: auto;
  background: #232322;
  max-height: 300px; object-fit: cover;
}
.photo-pop .body { padding: 11px 13px 13px; }
.photo-pop .date {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 4px;
}
.photo-pop .desc {
  font-size: 12.5px; line-height: 1.45; color: var(--ink);
  margin-bottom: 7px; word-break: break-word;
}
.photo-pop .caps {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  display: flex; flex-direction: column; gap: 3px;
  border-top: 1px solid var(--hair); padding-top: 8px; margin-top: 2px;
}
.photo-pop .caps span:first-child { color: var(--ink2); font-family: "Inter", system-ui, sans-serif; font-size: 11px; }

/* the account named in a popup is a control: click it to search that handle */
.photo-pop .pop-acct {
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;      /* handles keep their real casing */
  color: var(--gold);
  background: none;
  border: 0;
  border-radius: 3px;
  padding: 0;
  margin: 0;
  min-height: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(212,176,106,0.45);
  text-underline-offset: 2px;
}
/* a 14px word is a poor tap target: widen the hit area without moving the text */
.photo-pop .pop-acct { position: relative; }
.photo-pop .pop-acct::after {
  content: "";
  position: absolute;
  inset: -10px -4px;
}
.photo-pop .pop-acct:hover { color: #f4d492; text-decoration-color: currentColor; }
.photo-pop .pop-acct:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 2px; }
.photo-pop .pop-acct:active { transform: none; }

/* numbered pins in the account view */
.pin-num {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #f4d492;
  color: #12110f;
  font: 700 11.5px/1 "Inter", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  border: 2px solid #12110f;
  box-shadow: 0 0 0 4px rgba(244,212,146,.18), 0 4px 10px rgba(0,0,0,.6);
}
#av-list .row-item .d .n {
  display: inline-grid;
  place-items: center;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  margin-right: 6px;
  border-radius: 9px;
  background: rgba(212,176,106,.22);
  color: var(--gold);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
#av-list .row-item:hover .d .n { background: var(--gold); color: #12110f; }

/* markers */
.pin svg {
  filter:
    drop-shadow(0 0 5px rgba(244, 212, 146, 0.65))
    drop-shadow(0 0 12px rgba(244, 212, 146, 0.28))
    drop-shadow(0 4px 7px rgba(0, 0, 0, 0.65));
}
.pin:hover svg { filter:
    drop-shadow(0 0 8px rgba(244, 212, 146, 0.9))
    drop-shadow(0 0 18px rgba(244, 212, 146, 0.4))
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7)); }
.cluster {
  background: rgba(20,20,19,0.92);
  border: 1.5px solid var(--gold);
  color: var(--ink);
  border-radius: 50%;
  display: grid; place-items: center;
  font: 600 12px/1 "Inter", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 5px rgba(212,176,106,0.10), 0 6px 18px rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  transition: transform 0.12s;
}
.cluster:hover { transform: scale(1.06); }

/* empty state */
#empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none; z-index: 400;
  background: radial-gradient(ellipse at center, rgba(14,14,13,0.55), rgba(14,14,13,0.92));
  transition: opacity 0.25s;
}
#empty.hide { opacity: 0; }
#empty .card {
  pointer-events: auto;
  text-align: center;
  padding: 30px 34px;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: rgba(20,20,19,0.72);
  backdrop-filter: blur(10px);
  max-width: 380px;
}
#empty h2 {
  font-size: 15px; font-weight: 600; margin: 0 0 7px; letter-spacing: -0.01em;
}
#empty p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
#empty kbd {
  font: 11px/1 var(--mono); background: rgba(255,255,255,0.07);
  border: 1px solid var(--hair2); border-radius: 5px;
  padding: 3px 6px; color: var(--ink2);
}

/* ---------------- thumbnail rail ---------------- */

#thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--hair2) transparent;
}
#thumbs::-webkit-scrollbar { width: 7px; }
#thumbs::-webkit-scrollbar-thumb { background: var(--hair2); border-radius: 4px; }
#thumbs:empty::after {
  content: "No located photos in this view.";
  display: block;
  grid-column: 1 / -1;
  padding: 10px 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--hair);
  overflow: hidden;
  background: #232322;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.08s;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease, filter 0.15s;
}
.thumb:hover { border-color: var(--gold-dim); }
.thumb:hover img { transform: scale(1.035); }
.thumb:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 2px; }
.thumb.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 6px 18px rgba(0,0,0,0.45);
}
.thumb .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #4a4a45;
  font-size: 20px;
  background: #232322;
}
/* repost tiles name the account the photo came from, visible without hovering */
.thumb .thumb-tag {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 5px 3px;
  font: 500 9.5px/1.3 "Inter", system-ui, sans-serif;
  color: var(--ink2);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,0));
  pointer-events: none;
}
.thumb.loading { opacity: 0.5; pointer-events: none; }
.thumb.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25);
}

#timeline.on, .row.nav button { padding: 8px 10px; font-size: 12.5px; }
.row.nav #prev, .row.nav #next { padding: 8px 12px; }
#tour.on { background: rgba(212,176,106,0.14); border-color: var(--gold-dim); color: var(--gold); }

/* ---------------- locate control ---------------- */

.area-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--hair2); border-radius: 9px;
  background: rgba(20,20,19,0.94); color: var(--ink2);
  cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  transition: color .12s, background .12s, border-color .12s;
}
.area-btn:hover { color: var(--gold); border-color: var(--gold-dim); background: #242422; }
.area-btn:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 2px; }
.locate-btn {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  padding: 0;
  border: 1px solid var(--hair2);
  border-radius: 9px;
  background: rgba(20,20,19,0.94);
  color: var(--ink2);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  transition: color .12s, background .12s, border-color .12s;
}
.locate-btn:hover { color: var(--gold); border-color: var(--gold-dim); background: #242422; }
.locate-btn:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 2px; }

/* ---------------- mobile ---------------- */

@media (max-width: 780px) {
  html, body { overflow-x: hidden; overflow-y: auto; height: auto; }
  body {
    display: block;              /* no grid: stack naturally */
    min-height: 100%;
    background: var(--panel);
  }

  #panel {
    border-right: 0;
    border-bottom: 1px solid var(--hair);
    padding: 16px 15px 14px;
    gap: 13px;
    max-height: none;
    overflow: visible;
    min-width: 0;
    width: 100%;
  }
  #panel > * { min-width: 0; }

  /* map fixed to a readable slice under the panel */
  #map {
    height: 62vh;
    min-height: 380px;
    width: 100%;
  }
  #map-wrap { height: auto; }

  /* stats: 2 x 2 so labels never squeeze */
  #stats { grid-template-columns: 1fr 1fr; }
  #stats dd { font-size: 17px; }

  /* rail scrolls sideways */
  #thumbs {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    max-height: 46vh;
    min-width: 0;
  }

  /* touch targets */
  button, .stepper button { min-height: 42px; }
  .leaflet-bar a { width: 38px !important; height: 38px !important; line-height: 38px !important; }
  .area-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--hair2); border-radius: 9px;
  background: rgba(20,20,19,0.94); color: var(--ink2);
  cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  transition: color .12s, background .12s, border-color .12s;
}
.area-btn:hover { color: var(--gold); border-color: var(--gold-dim); background: #242422; }
.area-btn:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 2px; }
.locate-btn { width: 42px; height: 42px; }

  .leaflet-popup-content { width: 200px !important; }
  .leaflet-popup-content-wrapper { border-radius: 10px !important; }
  .photo-pop img { max-height: 200px; }
  .photo-pop .body { padding: 9px 11px 11px; }
}

@media (max-width: 420px) {
  .brand h1 { font-size: 15px; }
  .toggles { gap: 10px; }
  .chk { font-size: 12px; }
}

/* ---------------- posts / reposts shelf ---------------- */

.row.seg { gap: 0; border: 1px solid var(--hair); border-radius: 9px; overflow: hidden; }
.row.seg button {
  flex: 1;
  border: 0;
  border-radius: 0;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
}
.row.seg button:first-child { border-right: 1px solid var(--hair); }
.row.seg button.on { background: rgba(212,176,106,0.14); color: var(--gold); }
.row.seg button:hover:not(.on) { background: rgba(255,255,255,0.04); color: var(--ink2); }
.row.seg .n { color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.row.seg button.on .n { color: var(--gold-dim); }

/* ---------------- tag chips ---------------- */

#tags { display: flex; flex-wrap: wrap; gap: 5px; }
#tags:empty::after {
  content: "No hashtags in the loaded captions.";
  font-size: 11.5px; color: var(--muted); padding: 2px 0;
}
.tag {
  font: 500 11.5px/1 "Inter", system-ui, sans-serif;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: rgba(255,255,255,0.03);
  color: var(--ink2);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.tag:hover { border-color: var(--hair2); color: var(--ink); }
.tag .n { color: var(--muted); margin-left: 5px; font-weight: 400; }
.tag.on { background: rgba(212,176,106,0.14); border-color: var(--gold-dim); color: var(--gold); }
.tag.on .n { color: var(--gold-dim); }

/* ---------------- loaded accounts ---------------- */

/* ---------------- email gate ---------------- */

.gate {
  border: 1px solid var(--hair);
  border-radius: 9px;
  background: rgba(212,176,106,0.06);
  padding: 10px 11px;
  margin-top: 10px;
}
.gate p { margin: 0 0 8px; font-size: 12px; line-height: 1.45; color: var(--ink2); }
.gate b { color: var(--gold); }
.gate form { display: flex; gap: 6px; }
.gate input {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid var(--hair2);
  background: var(--raise);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}
.gate input:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 1px; }
.gate button { padding: 7px 12px; font-size: 12px; white-space: nowrap; }
.gate .gate-note { margin: 8px 0 0; font-size: 10.5px; color: var(--muted); }
#av-list .av-gate { list-style: none; }
#av-list .gate { margin-top: 4px; }

/* ---------------- accounts ---------------- */

#accounts-list { display: flex; flex-direction: column; gap: 3px; }
#accounts-list:empty { display: none; }
.acct {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hair);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.acct:hover { background: rgba(255,255,255,0.06); border-color: var(--hair2); }
.acct:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 2px; }
.acct .a-name { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .a-count {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.acct .a-count small { color: var(--muted); font-weight: 400; }

/* compact account tile under the load row */
#acct-tile {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 6px;
  border: 1px solid var(--hair);
  border-radius: 9px;
  background: rgba(255,255,255,0.03);
}
#acct-tile[hidden] { display: none; }
#acct-tile img, #acct-tile .at-ph {
  width: 36px; height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: #232322;
  display: grid;
  place-items: center;
  color: var(--muted);
}
#acct-tile .at-body { min-width: 0; }
#acct-tile #at-name {
  font-size: 12.5px;
  color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#acct-tile #at-meta { margin: 2px 0 0; font-size: 11px; }
#acct-tile #at-open { padding: 5px 10px; font-size: 11.5px; }

/* ---------------- account view ---------------- */

#acct-view {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  z-index: 5000;
  background: var(--bg);
  display: none;
  grid-template-rows: auto 1fr;
  transform: translateY(12px);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#acct-view.open { display: grid; opacity: 1; transform: translateY(0); }

#acct-view > header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--hair);
  background: var(--panel);
}
#acct-view h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
#acct-view .sub { margin: 2px 0 0; }
#av-close { padding: 6px 12px; font-size: 16px; line-height: 1; }
#av-play.on { background: rgba(212,176,106,0.14); border-color: var(--gold-dim); color: var(--gold); }
#av-play:disabled { opacity: 0.4; cursor: default; }
#acct-view .av-seg { margin-left: auto; width: 190px; }
#acct-view .av-seg button { padding: 6px 10px; font-size: 12px; }
#av-list .av-empty {
  padding: 18px 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.photo-pop .date .n2 {
  display: inline-grid;
  place-items: center;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  margin-right: 5px;
  border-radius: 9px;
  background: rgba(212,176,106,0.22);
  color: var(--gold);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.av-body {
  position: relative;          /* absolute panes: no grid measurement races */
  min-height: 0;
  overflow: hidden;
}
#av-map {
  position: absolute;
  top: 0; left: 0; right: 300px; bottom: 0;
  background: #101010;
}
body.av-open { overflow: hidden; }

/* why the map is empty, over the empty map rather than instead of it */
.av-note {
  position: absolute;
  top: 0; left: 0; right: 300px; bottom: 0;
  z-index: 900;              /* above Leaflet's panes (400-700) and controls (800) */
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  text-align: center;
  background: rgba(14,14,13,0.72);
}
.av-note[hidden] { display: none; }
.av-note-in { max-width: 320px; }
.av-note h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--gold); }
.av-note p { margin: 0 0 6px; font-size: 12.5px; color: var(--ink2); line-height: 1.5; }
.av-note .hint { color: var(--muted); font-size: 11.5px; }

#av-list {
  list-style: none;
  margin: 0;
  padding: 10px;
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 300px;
  overflow-y: auto;
  border-left: 1px solid var(--hair);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#av-list .row-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  background: transparent;
  color: inherit;
  font: inherit;
  transition: background 0.12s, border-color 0.12s;
}
#av-list .row-item.repost .d::after {
  content: " ↗";
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0;
}
#av-list .row-item.loading { opacity: 0.5; pointer-events: none; }
#av-list .row-item:hover { background: rgba(255,255,255,0.045); border-color: var(--hair); }
#av-list .row-item.active { background: rgba(212,176,106,0.10); border-color: var(--gold-dim); }
#av-list img, #av-list .ph {
  width: 56px; height: 56px; border-radius: 7px; object-fit: cover; background: #232322;
  display: block;
}
#av-list .d { font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
#av-list .t { font-size: 12px; color: var(--ink2); line-height: 1.35; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#av-list .c { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 3px; }

@media (max-width: 780px) {
  #acct-view > header { gap: 8px; padding: 10px 12px; }
  #acct-view .av-seg { width: 132px; }
  #av-meta { display: none; }
  #av-map { right: 0; bottom: 45%; }
  .av-note { right: 0; bottom: 45%; padding: 16px; }
  #av-list { width: 100%; top: 55%; border-left: 0; border-top: 1px solid var(--hair); }
}
