/* css/field-editor.css — диалоги «Границы полей SPS» и «Открыть SPS-файлы».
   Светлые панели, бирюзовый акцент — как на остальных страницах сайта. */

/* ---------- редактор границ полей ---------- */
dialog#dlg {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  padding: 18px 20px;
  width: min(1180px, 96vw);
  max-height: 94vh;
  overflow: auto;
}
dialog#dlg::backdrop { background: rgba(15, 26, 32, .42); backdrop-filter: blur(2px); }
.dlgHead { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.dlgHead strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.dlgHead .hint { font-size: 11.5px; }
.fbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 7px 0; }
.fbar label { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-700); }
.fbar input[type=number] { width: 74px; font-family: var(--font-mono); font-size: 11.5px; }
.fbar select { max-width: 360px; }
.tabs { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-soft); }
.tabs button {
  height: 27px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.tabs button:hover { background: rgba(15, 118, 110, .06); border-color: transparent; color: var(--accent-dark); }
.tabs button.on { background: var(--bg); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-sm); }

.pview {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  overflow: auto;
  max-height: 54vh;
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 10px 0;
  cursor: crosshair;
  user-select: none;
  scrollbar-width: thin;
  scrollbar-color: #dbe4e9 transparent;
}
.pinner { min-width: max-content; }
.pruler {
  display: flex;
  height: 20px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--border);
}
.pruler .pno { height: 20px; line-height: 20px; color: var(--faint); font-size: 10px; background: var(--panel-soft); }
.pruTrack { position: relative; flex: 0 0 auto; height: 20px; }
.pruTrack .rl { position: absolute; top: 2px; font-size: 10px; color: var(--muted); line-height: 14px; }
.pruTrack .tick { position: absolute; top: 15px; bottom: 0; width: 1px; background: var(--border); }
.pvhead {
  flex: 0 0 154px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  font-size: 9.5px;
  color: var(--muted);
  line-height: 20px;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plines { position: relative; }
.pline { display: flex; height: 20px; }
.pline:nth-child(even) { background: rgba(21, 32, 40, .022); }
.pno {
  flex: 0 0 46px;
  padding-right: 10px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 20px;
  text-align: right;
  user-select: none;
  background: var(--panel-soft);
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 5;
}
.ptext {
  position: relative;
  flex: 0 0 auto;
  line-height: 20px;
  white-space: pre;
  color: var(--text);
  background-image: linear-gradient(90deg, rgba(21, 32, 40, .08) 0 1px, transparent 1px);
  background-size: var(--stripe, 72px) 100%;
}
.ptext .band {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: none;
  background: var(--accent-soft);
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
  pointer-events: none;
}
.ptext .t { position: relative; z-index: 2; display: block; }
.ptext .tab { background: rgba(180, 83, 9, .16); box-shadow: inset 0 -2px 0 rgba(180, 83, 9, .45); }
.pval {
  flex: 0 0 154px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  line-height: 20px;
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  cursor: default;
}
.pval.bad { color: var(--danger); background: rgba(180, 35, 24, .07); }
.pval.warn { color: var(--warn); }
.pempty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--muted);
  background: var(--bg);
  text-align: center;
}
.pempty[hidden] { display: none; }
#jsonBox { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
#jsonBox textarea { width: 100%; height: 150px; font-family: var(--font-mono); font-size: 12px; }
#jsonBox summary { color: var(--muted); font-size: 12.5px; }
#jsonBox p.hint { margin: 6px 0; }
#jsonBox code { font-family: var(--font-mono); font-size: 11px; background: var(--panel-soft); border: 1px solid var(--border-soft); border-radius: 4px; padding: 0 3px; }

/* ---------- диалог открытия SPS и пресеты форматов ---------- */
dialog#openDlg {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  padding: 18px 20px;
  width: min(820px, 94vw);
  max-height: 94vh;
  overflow: auto;
}
dialog#openDlg::backdrop { background: rgba(15, 26, 32, .42); backdrop-filter: blur(2px); }
.presetGrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 14px; }
.presetCard {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  height: auto;
  padding: 10px 12px;
  text-align: left;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.presetCard:hover { border-color: rgba(15, 118, 110, .45); background: var(--bg); }
.presetCard.on { border-color: var(--accent); background: var(--bg); box-shadow: inset 0 0 0 1px var(--accent); }
.presetCard .pcName { font-weight: 700; font-size: 13px; color: var(--text); letter-spacing: -.01em; }
.presetCard .pcMeta { font-size: 11px; color: var(--muted); line-height: 1.35; }
.presetCard .pcMark { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--border); margin-bottom: 2px; background: var(--bg); }
.presetCard.on .pcMark { background: var(--accent); border-color: var(--accent); }
.presetSpec { border: 1px solid var(--border); border-radius: 11px; background: var(--panel-soft); padding: 10px 12px; margin: 0 0 12px; }
.presetSpecHead { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.presetSpecHead strong { font-size: 13px; }
.presetSpecHead a { font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; }
.presetSpecHead a:hover { color: var(--accent-dark); text-decoration: underline; }
.specRows { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 5px 10px; margin-top: 8px; font-size: 12px; }
.specRows span:nth-child(odd) { color: var(--muted); }
.specRows code { font-family: var(--font-mono); font-size: 11px; color: var(--ink-700); }
.loadFiles { border-top: 1px solid var(--border); padding-top: 12px; }
#loadSummary { margin-bottom: 8px; min-height: 18px; color: var(--muted); font-size: 12px; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
@media (max-width: 640px) {
  .presetGrid { grid-template-columns: 1fr; }
  .dlgHead { flex-wrap: wrap; gap: 6px; }
  .dlgHead .hint { display: none; }
  .dlgHead strong { font-size: 14px; }
  .dlgHead button { margin-left: auto; }
  .fbar { gap: 6px; }
  dialog#dlg, dialog#openDlg { padding: 14px; border-radius: 14px; }
  .tabs button { padding: 0 8px; font-size: 11px; }
}
