/* Страница «Поля»: сетка блоков, а не один столбец. */

.pane { flex-grow: 1; min-height: 0; overflow-y: auto; padding: 32px 44px 80px; }

.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 30px 34px; align-items: start;
}

.unit {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--rule-head); padding-top: 12px;
}
.unit-grip {
  display: flex; align-items: center; justify-content: center;
  width: 14px; height: 26px; margin-left: -4px; flex-shrink: 0;
  color: var(--tick); cursor: grab;
}
.unit-grip:hover { color: var(--fg-strong); }

.values { list-style: none; margin: 0; padding: 0; }
.value { position: relative; display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--rule); }
.value-grip {
  position: absolute; left: -16px; top: 4px;
  display: flex; align-items: center; justify-content: center;
  width: 12px; height: 26px;
  color: var(--tick); cursor: grab; opacity: 0;
}
.value:hover .value-grip { opacity: 1; }
.value-grip:hover { color: var(--fg-strong); }
.unit.dragging, .value.dragging { opacity: .35; }
.value-input {
  flex-grow: 1; min-width: 0; height: 34px; padding: 0;
  background: none; border: 0; font-size: 13.5px; color: var(--fg-row);
}
.value-input:focus { outline: none; }
.value-input::placeholder { color: var(--tick); }

/* Add-field tile in the next free grid cell; SVG draws the long dashes a CSS border can't. */
.field-new {
  position: relative; align-self: stretch; min-height: 148px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: var(--radius);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); cursor: pointer; opacity: .6;
}
.field-new:hover, .field-new:focus-visible { opacity: 1; color: var(--fg-strong); }
.field-new:disabled { opacity: .6; color: var(--tick); cursor: default; }
.field-new-frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible; pointer-events: none; color: var(--rule-head);
}
.field-new-frame rect { fill: none; stroke: currentColor; stroke-width: 1; stroke-dasharray: 7 5; }

/* Пример поля, пока своих нет: как настоящий блок, но только для чтения. */
.field-example { display: flex; flex-direction: column; gap: 18px; max-width: 290px; margin-top: 30px; }
.field-example[hidden] { display: none; }
.field-example .unit { opacity: .6; }
.field-example-key { display: flex; align-items: center; }
.field-example-value { height: 34px; font-size: 13.5px; color: var(--fg-row); }

@media (max-width: 768px) {
  .pane { padding: 24px 20px 60px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); }
  .field-new { min-height: 96px; }
}
