/* ── Places workspace (barbotaipa's redesign, 2026-08-28): the place stays on
   screen and the UI works around it — strip of places up top, the current view
   as the fixed workspace, actions directly under it, one Views & History strip
   for every output, and a right rail (place card / CREATE / PLACE STRUCTURE).
   Same doctrine as the rest of the app: no framework, theme variables only. ── */

.pl-shell { display: flex; flex-direction: column; gap: 14px; }

/* ── My Places strip ── */
.pl-striprow { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pl-mylabel {
  flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--accent);
  display: flex; align-items: center; gap: 8px;
}
.pl-strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px;
  scrollbar-width: thin; min-width: 0;
}
.pl-tile {
  flex: 0 0 128px; cursor: pointer; border-radius: 10px; overflow: hidden;
  border: 2px solid var(--border-strong); background: var(--surface-2);
  position: relative;
}
.pl-tile img { width: 100%; height: 72px; object-fit: cover; display: block; }
.pl-tile .nm {
  display: block; font-size: 11px; padding: 4px 7px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.pl-tile.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pl-tile .kd { position: absolute; top: 4px; right: 5px; font-size: 11px; }
.pl-tile.add {
  display: flex; align-items: center; justify-content: center; height: 98px;
  border-style: dashed; font-size: 22px; color: var(--text-dim);
}
.pl-tile.add:hover { color: var(--accent); border-color: var(--accent); }

/* ── workspace: main column + right rail ── */
.pl-work {
  display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px;
  align-items: start;
}
.pl-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.pl-viewer {
  position: relative; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  min-height: 220px;
}
.pl-viewer img { width: 100%; display: block; max-height: 68vh; object-fit: contain; }
.pl-viewer canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
#plAnnoCanvas { touch-action: none; }
.pl-annochips {
  position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 3;
}
.pl-dropzones {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 5; flex-wrap: wrap; justify-content: center;
  max-width: 92%;
}
.pl-dropzones .dz {
  font-size: 12.5px; font-weight: 700; padding: 10px 16px; border-radius: 999px;
  border: 1.5px dashed var(--accent); background: var(--bg); color: var(--accent);
}
.pl-dropzones .dz.over { background: var(--accent); color: #000; border-style: solid; }
.pl-shot[draggable="true"] { cursor: grab; }
.pl-annochips .download-btn { background: var(--bg); }
.pl-pen {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-2);
  cursor: pointer; padding: 0;
}
.pl-pen.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pl-annonote {
  position: absolute; z-index: 4; width: 200px; font-size: 12px; padding: 6px 9px;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg);
  color: var(--text); outline: none;
}
.pl-spotpanel { width: 224px; padding: 9px; }
.pl-viewtag {
  position: absolute; left: 10px; bottom: 10px; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff;
}
.pl-viewer .empty {
  display: flex; align-items: center; justify-content: center; min-height: 220px;
  color: var(--text-faint); font-size: 13px; text-align: center; padding: 20px;
}

.pl-actionbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pl-actionbar .trait-input { flex: 1 1 180px; min-width: 140px; font-size: 12.5px; }
.pl-stations { display: flex; gap: 6px; flex-wrap: wrap; }
.pl-station {
  font-size: 12px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
}
.pl-station.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.pl-actionbar .gen-btn { flex: 0 0 auto; max-width: 170px; font-size: 12px; padding: 10px 16px; margin: 0; }

.pl-historyrow .section-label { display: flex; align-items: center; gap: 8px; }
.pl-history {
  display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 8px; scrollbar-width: thin;
}
.pl-shot {
  flex: 0 0 104px; cursor: pointer; border-radius: 9px; overflow: hidden;
  border: 2px solid var(--border-strong); background: var(--surface-2); position: relative;
}
.pl-shot img { width: 100%; height: 64px; object-fit: cover; display: block; }
.pl-shot .nm {
  display: block; font-size: 10px; padding: 3px 6px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; color: var(--text-dim); text-align: center;
}
.pl-shot.active { border-color: var(--accent); }
.pl-shot.pending { border-style: dashed; }
.pl-shot .keep {
  position: absolute; top: 3px; left: 3px; right: 3px; display: flex; gap: 4px;
  justify-content: center;
}
.pl-shot .keep button {
  font-size: 10px; padding: 2px 7px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: rgba(0, 0, 0, .65); color: #fff;
}
.pl-shot .keep button:first-child { border-color: var(--accent); color: var(--accent); }
.pl-shot .star {
  position: absolute; top: 2px; right: 4px; font-size: 12px; text-shadow: 0 0 4px #000;
}

/* ── right rail ── */
.pl-rail { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pl-panel {
  border: 1px solid var(--border-strong); border-radius: 14px; padding: 12px 14px;
  background: var(--surface);
}
.pl-paneltitle {
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.pl-paneltitle .spacer { flex: 1; }

.pl-card { display: flex; gap: 10px; position: relative; }
.pl-card img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: 0 0 auto;
  border: 1px solid var(--border);
}
.pl-card .meta { min-width: 0; flex: 1; }
.pl-card b { font-size: 14px; cursor: pointer; }
.pl-card b:hover { color: var(--accent); }
.pl-card textarea {
  width: 100%; margin-top: 6px; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface-2); color: var(--text); font: inherit;
  font-size: 11.5px; min-height: 40px; resize: vertical;
}
.pl-counts { font-size: 11px; color: var(--text-dim); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pl-counts select { font-size: 11px; padding: 3px 6px; width: auto; }
.pl-menu-btn {
  position: absolute; top: 0; right: 0; background: none; border: 0; cursor: pointer;
  color: var(--text-dim); font-size: 16px; padding: 2px 6px;
}
.pl-menu {
  position: absolute; top: 24px; right: 0; z-index: 20; display: none;
  flex-direction: column; gap: 2px; padding: 6px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border-strong);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}
.pl-menu.open { display: flex; }
.pl-menu button {
  background: none; border: 0; color: var(--text); font: inherit; font-size: 12.5px;
  cursor: pointer; text-align: left; padding: 6px 10px; border-radius: 7px; white-space: nowrap;
}
.pl-menu button:hover { background: var(--surface-2); }

.pl-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.pl-tab {
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  color: var(--text-dim); font: inherit; font-size: 12.5px; padding: 6px 10px;
}
.pl-tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }

.pl-drop {
  border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: 16px 12px;
  text-align: center; font-size: 12px; color: var(--text-dim); cursor: pointer;
}
.pl-drop:hover, .pl-drop.over { border-color: var(--accent); color: var(--accent); }

.pl-obj { border: 1px solid var(--border); border-radius: 9px; margin-bottom: 6px; }
.pl-obj summary {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer;
  font-size: 12.5px; list-style: none;
}
.pl-obj summary::-webkit-details-marker { display: none; }
.pl-obj summary .zn { font-size: 10px; color: var(--text-faint); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; }
.pl-obj summary .cnt { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.pl-obj[open] { border-color: var(--accent); }
.pl-obj .body { padding: 0 10px 9px; font-size: 11.5px; color: var(--text-dim); }
.pl-obj .acts { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }

.pl-refrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.pl-refrow .rf { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); cursor: pointer; }
.pl-refrow .rf img { width: 100%; height: 56px; object-fit: cover; display: block; }
.pl-refrow .rf .b3 { position: absolute; top: 2px; left: 3px; font-size: 9px; font-weight: 800; background: var(--accent); color: #000; border-radius: 999px; padding: 0 5px; }

.pl-empty { max-width: 640px; }

/* ── narrow: rail drops below the main column ── */
@media (max-width: 1020px) {
  .pl-work { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .pl-striprow { flex-direction: column; align-items: stretch; gap: 6px; }
  .pl-viewer img { max-height: 46vh; }
}

.pl-spotspill {
  position: absolute; top: 10px; right: 10px; z-index: 3; cursor: pointer;
  font-size: 11.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  border: 1px solid rgba(77, 107, 255, .8); background: var(--bg); color: #7d9aff;
}
.pl-spotspill:hover { background: rgba(77, 107, 255, .18); }
