/* Plan fitting (fit.js): the Fit button on each picture, the fitting bar, its note */
.pc-fit { flex: none; min-height: 28px; padding: 0 10px; background: rgba(246, 234, 210, 0.06); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.pc-fit:hover { border-color: var(--accent); }
.pc-fit:focus-visible, .fit-bar button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.fit-bar { position: fixed; z-index: 30; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); box-sizing: border-box;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; backdrop-filter: blur(6px);
  font: 13px/1.4 Inter, system-ui, sans-serif; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); max-height: 46vh; overflow-y: auto; }
.fit-bar[hidden] { display: none; }
.fit-bar header { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.fit-bar header b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fit-bar header small { color: var(--soft); font-size: 11px; white-space: nowrap; }
.fit-tabs { display: flex; gap: 4px; margin: 8px 0 6px; }
.fit-tabs button { flex: 1; min-height: 32px; background: rgba(246, 234, 210, 0.06); border: 1px solid var(--line); border-radius: 7px; color: var(--soft); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.fit-tabs button.on { background: var(--accent); border-color: var(--accent); color: #0b1a16; }
.fit-hint { margin: 4px 0 6px; color: var(--soft); font-size: 12px; }
.fit-hint b { color: var(--ink); }
.fit-pairs { list-style: none; margin: 0 0 6px; padding: 0; max-height: 130px; overflow-y: auto; }
.fit-pairs li { display: flex; align-items: center; gap: 8px; padding: 2px 0; border-bottom: 1px solid rgba(246, 234, 210, 0.06); font-size: 12px; }
.fit-pairs li span { flex: none; width: 56px; }
.fit-pairs li small { flex: 1; color: var(--soft); font-variant-numeric: tabular-nums; }
.fit-pairs li button { flex: none; width: 30px; height: 30px; background: none; border: 0; color: var(--soft); cursor: pointer; border-radius: 6px; }
.fit-pairs li button:hover { color: var(--ink); background: rgba(246, 234, 210, 0.08); }
.fit-acc { margin: 0 0 6px; font-size: 12px; color: var(--soft); font-variant-numeric: tabular-nums; }
.fit-acc b { color: var(--ink); }
.fit-see { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; }
.fit-see small { color: var(--soft); font-size: 11px; white-space: nowrap; }
.fit-see input { flex: 1; min-width: 0; accent-color: var(--accent); }
.fit-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.fit-btns button { min-height: 34px; padding: 0 12px; background: rgba(246, 234, 210, 0.06); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.fit-btns button:disabled { opacity: 0.45; cursor: default; }
.fit-btns .save { background: var(--accent); border-color: var(--accent); color: #0b1a16; }
.fit-btns .cancel { color: var(--soft); }

.fit-say { position: fixed; z-index: 31; left: 50%; top: 16px; transform: translate(-50%, -8px); max-width: calc(100% - 32px); background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font: 12.5px/1.4 Inter, system-ui, sans-serif; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.fit-say.on { opacity: 1; transform: translate(-50%, 0); }

/* while fitting: the layer panel and the place card step aside so the bar and the picture have the screen (the foundation's edit view, when there, does the same) */
body.nm-fitting #panel, body.nm-fitting #place { display: none !important; }
@media (max-width: 599px) {
  .fit-bar { bottom: 8px; width: calc(100% - 16px); max-height: 52vh; padding: 8px 10px; }
  .fit-btns button { min-height: 40px; }
}

/* inside the foundation's edit bar (edit.js): no second floating box */
.fit-bar.in-ed { position: static; transform: none; width: auto; max-height: 40vh; padding: 6px 0 0; border: 0; border-radius: 0; box-shadow: none; background: none; backdrop-filter: none; }
