/* ---- Table size picker (Google-Docs-style hover grid) ------------- */
.docx-editor-table-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  background: #ffffff;
  border: 1px solid var(--de-border-raw, #d0d7de);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
  padding: 10px;
  width: max-content;
}
.docx-editor-table-picker__grid {
  display: grid;
  gap: 2px;
}
.docx-editor-table-picker__cell {
  width: 16px;
  height: 16px;
  background: #eef1f4;
  border: 1px solid #d7dce2;
  border-radius: 1px;
  cursor: pointer;
}
.docx-editor-table-picker__cell[data-active="true"] {
  background: #cfe2ff;
  border-color: #2563eb;
}
.docx-editor-table-picker__label {
  margin-top: 8px;
  font-size: 12px;
  color: #57606a;
  text-align: center;
}
.docx-editor-table-picker__custom {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #57606a;
  white-space: nowrap;
}
.docx-editor-table-picker__custom input {
  width: 44px;
  padding: 3px 5px;
  font-size: 12px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  outline: none;
}
.docx-editor-table-picker__custom input:focus {
  border-color: #2563eb;
}
.docx-editor-table-picker__custom button {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: #2563eb;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.docx-editor-table-picker__custom button:hover {
  background: #1d4ed8;
}

/* ---- Touch devices: the grid is dragged with a finger, not hovered with
   a pointer, so the cells and controls need to be big enough to hit
   accurately. `pointer: coarse` (not a layout selector) is used on purpose
   — the picker panel portals to `document.body`, outside the editor's
   `[data-de-layout="mobile"]` scope, so a scoped selector would never
   reach it. */
@media (pointer: coarse) {
  .docx-editor-table-picker {
    padding: 14px;
  }
  .docx-editor-table-picker__grid {
    gap: 4px;
  }
  .docx-editor-table-picker__cell {
    width: 26px;
    height: 26px;
    border-radius: 3px;
  }
  .docx-editor-table-picker__label {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 500;
  }
  .docx-editor-table-picker__custom {
    margin-top: 12px;
    padding-top: 12px;
    font-size: 14px;
    gap: 8px;
  }
  .docx-editor-table-picker__custom input {
    width: 56px;
    padding: 8px 8px;
    font-size: 15px;
  }
  .docx-editor-table-picker__custom button {
    padding: 9px 16px;
    font-size: 14px;
  }
}
